/* ==========================================================================
   Memmy World — the finale: calendar, packs, QR panel, closing CTA, footer
   ========================================================================== */

.act--finale {
  height: auto;
  padding: calc(var(--topbar-h) + clamp(34px, 7vh, 80px)) 0 clamp(20px, 4vh, 48px);
}

.stage--finale {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(26px, 4.6vh, 50px);
  height: auto;
  min-height: 0;
  overflow: visible;
  padding: 0 var(--shell);
  padding-inline-start: calc(var(--shell) + var(--rail-gutter, 0px));
  max-width: min(1180px, 100%);
  margin-inline: auto;
}

.finale__head {
  max-width: 62ch;
}

.kicker {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent-2);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.finale__title {
  font-size: clamp(1.85rem, 4.2vw, 3.45rem);
  text-wrap: balance;
}

.finale__title em {
  display: block;
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
  text-shadow: 0 0 40px var(--accent-glow);
}

.finale__sub {
  margin-top: 12px;
  max-width: 56ch;
  color: var(--ink-soft);
  font-size: clamp(0.88rem, 1.08vw, 1.02rem);
}

/* -------------------------------- calendar ------------------------------- */
/* The ending frames of the film are the brightest of the whole page (the
   magical world inside the tablet). Every glass panel therefore carries its own
   dark floor, so white copy never sits on a lit-up video frame. */
.calendar-strip {
  padding: clamp(13px, 2vw, 20px);
  border-radius: var(--radius);
  background: rgba(9, 6, 14, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
}

.calendar-strip__label {
  margin-bottom: 11px;
  color: var(--ink-faint);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
  gap: 6px;
}

.calendar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 3px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  color: var(--ink-faint);
  font-size: 0.62rem;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s;
}

.calendar__item b {
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.calendar__item.is-film {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-2);
  box-shadow: 0 0 24px -14px var(--accent-glow);
}

.calendar__item.is-film b {
  color: var(--ink);
}

.calendar__item--mystery {
  position: relative;
  min-height: 58px;
  justify-content: center;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--mystery-color) 26%, transparent);
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--mystery-color) 12%, rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.018)
  );
  box-shadow: inset 0 0 22px color-mix(in srgb, var(--mystery-color) 8%, transparent);
}

.calendar__item--mystery::before {
  content: '';
  position: absolute;
  inset: 15% 18%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--mystery-color), transparent 70%);
  filter: blur(13px);
  opacity: 0.7;
}

.calendar__mystery-mark {
  position: relative;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--mystery-color) 38%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--mystery-color) 10%, rgba(10, 7, 16, 0.76));
  color: var(--mystery-color);
  font-size: 0.8rem;
  filter: blur(0.55px);
  opacity: 0.8;
  text-shadow: 0 0 12px var(--mystery-color);
}

.calendar__item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.09);
  color: var(--ink);
}

.calendar__item--mystery:hover {
  background: color-mix(in srgb, var(--mystery-color) 16%, rgba(10, 7, 16, 0.84));
}

.calendar__month {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  opacity: 0.6;
}

.calendar-mystery {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 13px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--ink-faint);
  font-family: var(--display);
  font-size: 0.68rem;
  font-style: italic;
}

.calendar-mystery__mark {
  display: grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(201, 166, 255, 0.28);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 166, 255, 0.2), rgba(201, 166, 255, 0.02) 72%);
  color: #d7c1ff;
  font-size: 0.82rem;
  font-style: normal;
  box-shadow: 0 0 20px -8px rgba(201, 166, 255, 0.62);
}

/* --------------------------------- packs -------------------------------- */
.packs-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.packs__note {
  align-self: flex-start;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px dashed var(--accent-line);
  color: var(--accent-2);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.packs {
  display: grid;
  /* One offer on the website (per-unit purchase only). The grid stays
     flexible so a future addition does not break the layout, but a
     single .pack--unit fills a comfortable max-width centred column. */
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(10px, 1.4vw, 16px);
  max-width: 540px;
}

.packs:has(:nth-child(2)) {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  max-width: none;
}

.pack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: clamp(15px, 1.9vw, 22px);
  border-radius: var(--radius);
  background: rgba(9, 6, 14, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  transition: transform 0.3s var(--ease-out), border-color 0.3s, background 0.3s;
}

.pack:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  background: rgba(9, 6, 14, 0.9);
}

.pack--featured {
  background: linear-gradient(160deg, var(--accent-soft), rgba(9, 6, 14, 0.86));
  border-color: var(--accent);
  box-shadow: 0 24px 60px -36px var(--accent-glow);
}

.pack__flag {
  position: absolute;
  top: -10px;
  inset-inline-start: 16px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1206;
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pack__name {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.pack__desc {
  color: var(--ink-faint);
  font-size: 0.72rem;
  line-height: 1.45;
}

.pack__price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--accent-2);
}

.pack__period {
  font-family: var(--body);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.pack__cta {
  margin-top: 5px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.pack__cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1206;
}
/* ------------------------- closing CTA ----------------------------------- */
.finale__grid {
  display: flex;
  justify-content: center;
  width: 100%;
}

.qr-panel {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.6vw, 18px);
  padding: clamp(16px, 2.2vw, 28px);
  border-radius: var(--radius-lg);
  background: rgba(9, 6, 14, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 70px -50px #000;
}

.qr-panel__head h3 {
  font-size: clamp(1.15rem, 1.9vw, 1.6rem);
  letter-spacing: -0.02em;
}

.qr-panel__head p {
  margin-top: 7px;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.55;
}

.qr-panel__body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(14px, 2vw, 24px);
}

.qr-panel__frame {
  position: relative;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 10px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--accent-line);
  box-shadow: 0 0 48px -18px var(--accent-glow);
}

/* A halo behind the white card so the QR does not look pasted on the film. */
.qr-panel__frame::before {
  content: '';
  position: absolute;
  inset: -18px;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  opacity: 0.55;
}

.qr-panel__frame img {
  width: clamp(140px, 16vw, 200px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

.qr-panel__controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.qr-panel__label {
  color: var(--ink-faint);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.qr-panel__controls select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(9, 6, 14, 0.6);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

[dir='rtl'] .qr-panel__controls select {
  background-position: 16px 50%, 11px 50%;
}

.qr-panel__controls select option {
  background: #120d06;
  color: var(--ink);
}

.qr-panel__caption {
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
}

.qr-panel__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.qr-panel__row .btn {
  padding: 8px 15px;
  font-size: 0.78rem;
}

/* The deep link is metadata, not copy: one clamped line with an ellipsis. It
   used to be `word-break: break-all`, which honoured the panel width but broke
   a per-story link (Play `referrer` included) into two ragged lines spanning
   the panel edge to edge at 0.62 rem. The URL is LTR text even on the Arabic
   page, so the direction is isolated here and the ellipsis lands on the right;
   `text-align: end` under RTL keeps the line on the reading edge. The full
   value stays one tap away in the "copy link" button. */
.qr-panel__link {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
  color: var(--ink-faint);
  font-size: 0.62rem;
  line-height: 1.4;
  opacity: 0.75;
}

[dir='rtl'] .qr-panel__link {
  text-align: end;
}

/* ------------------------------ closing CTA ------------------------------ */
.finale__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 600px;
  margin-inline: auto;
  padding: clamp(22px, 3.2vw, 38px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 50% 0%, var(--accent-soft), transparent 62%),
    rgba(9, 6, 14, 0.86);
  border: 1px solid var(--accent-line);
  box-shadow: inset 0 0 60px -30px var(--accent-glow);
}

.finale__cta h3 {
  font-size: clamp(1.15rem, 2vw, 1.65rem);
  letter-spacing: -0.02em;
}

.finale__cta p {
  max-width: 40ch;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.55;
}

.download-platforms {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  height: 50px;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #050505;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s, filter 0.2s, box-shadow 0.2s;
}

.store-badge--play {
  width: 168px;
}

.store-badge--apple {
  width: 158px;
}

.store-badge:hover,
.store-badge:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.14);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.34);
}

.store-badge__icon {
  display: block;
  flex: 0 0 auto;
  width: 25px;
  height: 28px;
}

.store-badge__icon--apple {
  width: 27px;
  height: 31px;
}

.store-badge__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  line-height: 1;
  white-space: nowrap;
}

.store-badge__eyebrow {
  margin-bottom: 3px;
  font-family: Arial, sans-serif;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.store-badge__name {
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.store-badge--apple .store-badge__name {
  font-size: 15px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ios-interest-trigger {
  font: inherit;
}

.ios-interest-trigger:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Keep the badge row balanced on narrow screens too. */
@media (max-width: 520px) {
  .store-badge--play {
    width: 158px;
  }

  .store-badge--apple {
    width: 150px;
  }
}

.ios-interest {
  width: min(460px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 1px solid var(--accent-line);
  border-radius: 22px;
  background: #17111f;
  color: var(--ink);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.6);
}

.ios-interest::backdrop {
  background: rgba(4, 3, 7, 0.78);
  backdrop-filter: blur(8px);
}

.ios-interest__form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 30px;
}

.ios-interest__close {
  position: absolute;
  top: 12px;
  inset-inline-end: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-size: 1.5rem;
  cursor: pointer;
}

.ios-interest__eyebrow {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ios-interest__form h2 {
  max-width: 16ch;
  font-size: 1.4rem;
  line-height: 1.2;
}

.ios-interest__form > p:not(.ios-interest__eyebrow) {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.55;
}

.ios-interest__form > label:not(.ios-interest__consent) {
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 800;
}

.ios-interest__form input[type='email'] {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  outline: none;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font: inherit;
}

.ios-interest__form input[type='email']:focus-visible {
  border-color: var(--accent);
}

.ios-interest__consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.ios-interest__consent input {
  flex: 0 0 auto;
  margin-top: 3px;
  accent-color: var(--accent);
}

.ios-interest__submit {
  align-self: stretch;
  justify-content: center;
}

.ios-interest__note {
  font-size: 0.72rem !important;
  opacity: 0.8;
}

.ios-interest__trap {
  position: absolute;
  inset-inline-start: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ios-interest__submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.finale__hint {
  color: var(--ink-faint);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* -------------------------------- footer --------------------------------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: 12px 22px;
  padding-top: clamp(16px, 2.4vw, 26px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.site-footer__tagline {
  font-family: var(--display);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.site-footer__links a {
  color: var(--ink-faint);
  font-size: 0.74rem;
  font-weight: 700;
  transition: color 0.2s;
}

.site-footer__links a:hover {
  color: var(--accent);
}

.site-footer__copy {
  width: 100%;
  text-align: center;
  flex-basis: 100%;
  color: var(--ink-faint);
  font-size: 0.66rem;
  opacity: 0.7;
}
