/* ------------------------------------------------------------------
   سعّود وينه؟ · digital premiere invitation
   One continuous vertical poster. Storm sky on top, film world below.
   ------------------------------------------------------------------ */

@font-face {
  font-family: 'Zunburk';
  src: url('../assets/fonts/TSZunburkVF.woff2') format('woff2'),
       url('../assets/fonts/TSZunburkVF.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #071427;
  --navy-deep: #03091a;
  --blue: #1b3a6b;
  --blue-hi: #5b93d6;

  --gold: #f2b632;
  --gold-soft: #e3b65c;
  --gold-line: rgba(227, 182, 92, 0.55);
  --gold-line-faint: rgba(227, 182, 92, 0.28);

  --ink: #efe8da;
  --ink-80: rgba(239, 232, 218, 0.82);
  --ink-65: rgba(239, 232, 218, 0.65);
  --ink-45: rgba(239, 232, 218, 0.45);

  --col: min(780px, 100% - 40px);
  --col-wide: min(980px, 100% - 40px);

  --font: 'Zunburk', 'Noto Naskh Arabic', 'Geeza Pro', 'Tahoma', sans-serif;
  --font-latin: 'Zunburk', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* TS Zunburk width axis runs 0 (narrow, the font's own default) to 10 (wide).
     Browsers map font-stretch 100% onto it and clamp to 10, so set it explicitly. */
  --wdth: 0;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--navy-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-weight: 450;
  font-variation-settings: 'wdth' var(--wdth);
  color: var(--ink);
  /* transparent on purpose: a body background would paint over the negative z-index
     background and rain layers; the page colour lives on html */
  background: transparent;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.nowrap { white-space: nowrap; }
.gold { color: var(--gold); }

/* ---------- Atmosphere (fixed, behind everything) ---------- */

.atmos {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  overflow: hidden;
}
.atmos__bg {
  position: absolute;
  inset: 0;
  /* Anchored below the top so wide screens see the darker middle of the storm, not its bright crown. */
  background: var(--navy-deep) url('../assets/img/storm-bg.jpg') center 45% / cover no-repeat;
  filter: contrast(1.1) saturate(1.12);
}
@supports (background-image: url('../assets/img/storm-bg.webp')) {
  .atmos__bg { background-image: url('../assets/img/storm-bg.webp'); }
}
.atmos__bg::after {
  /* Darkens the storm so the clouds and the ending artwork feather in without a hard step. */
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(3, 9, 26, 0.3);
}
.atmos__mist {
  position: absolute;
  width: 140vmax;
  height: 140vmax;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  opacity: 0.55;
  will-change: transform;
}
.atmos__mist--a {
  background: radial-gradient(closest-side, rgba(70, 120, 190, 0.15), rgba(70, 120, 190, 0) 70%);
  animation: mistA 46s ease-in-out infinite alternate;
}
.atmos__mist--b {
  background: radial-gradient(closest-side, rgba(20, 50, 110, 0.35), rgba(20, 50, 110, 0) 70%);
  animation: mistB 58s ease-in-out infinite alternate;
}
@keyframes mistA {
  from { transform: translate(-70%, -80%) scale(1); }
  to   { transform: translate(-30%, -40%) scale(1.15); }
}
@keyframes mistB {
  from { transform: translate(-30%, -30%) scale(1.1); }
  to   { transform: translate(-70%, -60%) scale(0.95); }
}

/* ---------- Poster column ---------- */

.poster {
  position: relative;
  /* no z-index on purpose: the hero sky and ending art use negative z-index so the fixed rain layer
     (z-index -1) paints above them and below every piece of text and artwork */
}

.section {
  position: relative;
  width: var(--col);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) 0 clamp(48px, 7vw, 88px);
  text-align: center;
}

.rule {
  border: 0;
  height: 1px;
  width: 100%;
  margin: 0 auto clamp(40px, 6vw, 64px);
  background: linear-gradient(90deg, transparent, var(--gold-line-faint) 18%, var(--gold-line) 50%, var(--gold-line-faint) 82%, transparent);
}

.heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 0 clamp(20px, 3vw, 30px);
  color: var(--gold);
  font-weight: 650;
  font-size: clamp(26px, 3.6vw, 34px);
  line-height: 1.4;
  letter-spacing: 0.005em;
  /* The font's tatweel axis (TAWL, 0 to 10) stretches the connecting strokes; 6 is the type designer's
     own "TA" instance. font-variation-settings replaces the whole value, so the width pin comes along. */
  font-variation-settings: 'wdth' var(--wdth), 'TAWL' 6;
}
.heading::before, .heading::after {
  content: '';
  flex: 0 0 clamp(36px, 7vw, 72px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line));
}
.heading::after { background: linear-gradient(270deg, transparent, var(--gold-line)); }
.heading--minor {
  font-size: clamp(22px, 3vw, 27px);
  margin-top: clamp(36px, 5vw, 56px);
}
.heading--minor::before, .heading--minor::after { flex-basis: clamp(24px, 5vw, 44px); }
.heading--start { justify-content: flex-start; }
.heading--start::before, .heading--start::after { display: none; }

.lead {
  margin: 0 auto 14px;
  max-width: 640px;
  font-size: clamp(19px, 2.5vw, 22px);
  color: var(--ink);
  font-weight: 500;
}
.body {
  margin: 0 auto;
  max-width: 600px;
  font-size: clamp(17.5px, 2.2vw, 19.5px);
  color: var(--ink-80);
  font-weight: 450;
}
.body + .body { margin-top: 12px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 34px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 17.5px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn--outline {
  color: var(--gold);
  background: rgba(6, 14, 30, 0.22);
  border: 1px solid var(--gold-line);
  box-shadow: inset 0 0 0 0 rgba(242, 182, 50, 0);
}
.btn--outline:hover, .btn--outline:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(242, 182, 50, 0.18);
  background: rgba(242, 182, 50, 0.08);
}
.btn--solid {
  color: #1c1503;
  background: var(--gold);
  border: 1px solid var(--gold);
  font-weight: 650;
  box-shadow: 0 8px 30px rgba(242, 182, 50, 0.18);
}
.btn--solid:hover, .btn--solid:focus-visible {
  background: #ffc63f;
  box-shadow: 0 10px 36px rgba(242, 182, 50, 0.32);
}
.btn--small { min-height: 40px; padding: 0 22px; font-size: 14.5px; }
.btn:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }
.btn:active { transform: translateY(1px); }

/* ---------- Logo row (top of the hero and the ending) ---------- */

/* The partner logo uploaded on the admin's Event tab and the Katara logo, centred together as a pair with
   a thin gold rule between them, the same at the top of the page and at its foot. The partner comes first:
   on the right in Arabic, mirrored in English, where Novo was until 20 October. Without one, Katara stands
   alone in the middle. The partner keeps its own proportions, up to Katara's height (the logo is
   0.69 times as tall as it is wide) and wide enough for a long wordmark; the admin trims its transparent
   margins on upload, so the box is filled by the artwork itself. */
.logos {
  display: flex;
  justify-content: center;
  align-items: center;
}
.logos > img {
  padding: 0 clamp(14px, 2.6vw, 24px);
  box-sizing: content-box;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.7));
}
.logos > img + img { border-inline-start: 1px solid var(--gold-line); }
.logos__katara { width: clamp(84px, 11vw, 104px); height: auto; }
.logos__partner {
  width: auto;
  height: auto;
  max-width: clamp(150px, 45vw, 210px);
  max-height: clamp(58px, 7.6vw, 72px);
}
@media (max-width: 420px) {
  .logos > img { padding: 0 12px; }
  .logos__katara { width: 76px; }
  .logos__partner { max-height: 52px; }
}

/* ---------- 01 · Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(36px, 6vh, 64px) 20px clamp(48px, 8vh, 96px);
  overflow: hidden;
}
.hero__sky {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 58%, rgba(0,0,0,0.6) 78%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 58%, rgba(0,0,0,0.6) 78%, transparent 100%);
}
.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  filter: saturate(1.2) contrast(1.12);
  transition: filter 0.12s ease-out;
}
.hero__sky.is-flash .hero__video { filter: saturate(1.2) contrast(1.12) brightness(1.5); }
.hero__sky::after {
  /* soft darkening toward the centre so type stays readable */
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 50% 45%, rgba(4, 10, 24, 0.55), rgba(4, 10, 24, 0) 100%),
    linear-gradient(to bottom, rgba(3, 9, 26, 0.25), rgba(3, 9, 26, 0) 30%, rgba(3, 9, 26, 0.35) 100%);
}

.hero__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: min(560px, 100%);
}
.hero__logos { margin-bottom: clamp(30px, 6vh, 56px); }
.hero__kicker {
  margin: 0;
  color: var(--gold);
  font-weight: 650;
  font-size: clamp(24px, 3.4vw, 30px);
  line-height: 1.3;
  font-variation-settings: 'wdth' var(--wdth), 'TAWL' 6;
}
.hero__sub {
  margin: 4px 0 clamp(14px, 3vh, 26px);
  color: var(--ink);
  font-weight: 500;
  font-size: clamp(18px, 2.4vw, 21px);
  line-height: 1.5;
}
.hero__title {
  margin: 0;
  width: clamp(240px, 58vw, 420px);
}
/* The glow lives on a wrapper and the reveal mask on the image itself.
   Chrome paints a dark rectangle when a blur/drop-shadow filter and an animated
   mask sit on the same element, so they are kept apart, and the mask is removed
   once the reveal has finished (see main.js). */
.hero__title .title-glow {
  display: block;
  filter: drop-shadow(0 0 22px rgba(255, 176, 0, 0.35)) drop-shadow(0 6px 24px rgba(0, 0, 0, 0.5));
  animation: titleGlow 2.8s ease-out 0.9s both;
}
.hero__title .title-art {
  width: 100%;
  height: auto;
  -webkit-mask-image: linear-gradient(to right, transparent 0 48%, #000 66%);
          mask-image: linear-gradient(to right, transparent 0 48%, #000 66%);
  -webkit-mask-size: 300% 100%;
          mask-size: 300% 100%;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: 0% 0;
          mask-position: 0% 0;
  animation: titleReveal 2.4s var(--ease) 0.9s forwards;
}
.hero__title .title-art.is-revealed {
  animation: none;
  -webkit-mask-image: none;
          mask-image: none;
}
@keyframes titleReveal {
  from { -webkit-mask-position: 0% 0; mask-position: 0% 0; }
  to   { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
}
@keyframes titleGlow {
  0%   { filter: drop-shadow(0 0 40px rgba(255, 176, 0, 0.9)) drop-shadow(0 6px 24px rgba(0, 0, 0, 0.5)); }
  60%  { filter: drop-shadow(0 0 34px rgba(255, 176, 0, 0.7)) drop-shadow(0 6px 24px rgba(0, 0, 0, 0.5)); }
  100% { filter: drop-shadow(0 0 22px rgba(255, 176, 0, 0.35)) drop-shadow(0 6px 24px rgba(0, 0, 0, 0.5)); }
}
.hero__credit {
  margin-top: clamp(20px, 3.5vh, 32px);
  width: min(640px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2vh, 18px);
}
.hero__credit-text {
  margin: 0;
  font-size: clamp(14.5px, 1.8vw, 16.5px);
  font-weight: 500;
  line-height: 1.85;
  color: var(--ink-80);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
/* Partner marks in a row with the same thin gold rules that divide the logos in the email. */
.hero__partners {
  display: flex;
  align-items: center;
  direction: ltr;
}
.hero__partners img {
  height: clamp(30px, 4.2vw, 40px);
  width: auto;
  padding: 0 clamp(14px, 2.4vw, 24px);
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.5));
}
.hero__partners img + img { border-left: 1px solid var(--gold-line); }
@media (max-width: 420px) {
  /* The Media City and Film Committee lockup is wide; keep the pair inside a narrow phone. */
  .hero__partners img { height: 26px; padding: 0 10px; }
}
.hero__date {
  margin: clamp(18px, 3.5vh, 30px) 0 clamp(18px, 3vh, 26px);
  font-size: clamp(20px, 2.7vw, 23px);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
}
/* Thin gold rule between the date and the reception time, like the one between the partner logos. */
.hero__sep {
  display: inline-block;
  width: 1px;
  height: 0.9em;
  margin: 0 0.65em;
  vertical-align: middle;
  background: var(--gold-line);
}
.hero__chevron {
  margin-top: clamp(22px, 5vh, 44px);
  color: var(--ink-65);
  animation: bob 2.6s ease-in-out 3.4s infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(6px); opacity: 1; }
}

/* hero entrance */
.enter {
  opacity: 0;
  transform: translateY(14px);
  animation: enter 1.1s var(--ease) forwards;
}
.enter--1 { animation-delay: 0.15s; }
.enter--2 { animation-delay: 0.45s; }
.enter--3 { animation-delay: 0.6s; }
.enter--4 { animation-delay: 1.85s; }
.enter--5 { animation-delay: 2.1s; }
.enter--6 { animation-delay: 2.35s; }
.enter--7 { animation-delay: 2.9s; }
@keyframes enter {
  to { opacity: 1; transform: translateY(0); }
}
.hero__chevron.enter { animation: enter 1.1s var(--ease) 2.9s forwards, bob 2.6s ease-in-out 4s infinite; }

/* ---------- 03 · About ---------- */

.section--about { width: var(--col-wide); }
.about {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 48px);
  align-items: center;
  text-align: start;
}
.about__text .body { margin-inline: 0; max-width: none; }
.about__text .btn { margin-top: 26px; }
.about__media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  -webkit-mask-image: radial-gradient(120% 110% at 50% 50%, #000 40%, rgba(0,0,0,0.85) 62%, transparent 100%);
          mask-image: radial-gradient(120% 110% at 50% 50%, #000 40%, rgba(0,0,0,0.85) 62%, transparent 100%);
}
.about__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 1.2s var(--ease), filter 0.6s var(--ease);
  filter: saturate(0.95) brightness(0.92);
}
.about__media:hover img, .about__media:focus-visible img { transform: scale(1.06); filter: saturate(1) brightness(1); }
.about__media:focus-visible { outline: none; }
.play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(239, 232, 218, 0.75);
  color: var(--ink);
  background: rgba(5, 12, 28, 0.28);
  backdrop-filter: blur(2px);
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease), background-color 0.5s var(--ease);
}
.play svg { margin: 0; }
.about__media:hover .play, .about__media:focus-visible .play {
  transform: scale(1.06);
  border-color: var(--gold);
  background: rgba(242, 182, 50, 0.12);
}
@media (min-width: 820px) {
  .about {
    grid-template-columns: 1.05fr 1fr;
  }
  /* The first grid column is on the reading side: in Arabic the trailer sits right and the text left;
     English mirrors it. */
  .about__text { grid-column: 2; }
  .about__media { grid-column: 1; grid-row: 1; }
}

/* ---------- 04 · Credits ---------- */

.makers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(520px, 100%);
  margin: 0 auto;
}
.makers__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px;
}
.makers__item + .makers__item { border-inline-start: 1px solid var(--gold-line-faint); }
.makers .label, .details .label {
  color: var(--gold-soft);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.makers .name {
  font-size: clamp(18px, 2.4vw, 21px);
  font-weight: 500;
  color: var(--ink);
}
.cast {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: min(640px, 100%);
}
.cast li {
  padding: 12px 8px;
  font-size: clamp(16.5px, 2.1vw, 18.5px);
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--gold-line-faint);
}
.cast li:nth-last-child(-n+2) { border-bottom: 0; }
@media (min-width: 640px) {
  .cast { grid-template-columns: repeat(4, 1fr); }
  .cast li:nth-last-child(-n+4) { border-bottom: 0; }
}

/* ---------- 05 · Details ---------- */

.details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 0;
  width: 100%;
  margin: 0 auto clamp(28px, 4vw, 40px);
}
.details__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
}
.details__item .icon {
  width: 26px;
  height: 26px;
  margin-bottom: 8px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.details .value {
  font-size: clamp(16px, 2vw, 17.5px);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.5;
}
.details .value--latin {
  font-family: var(--font-latin);
  direction: ltr;
  font-weight: 450;
}
/* The city is optional in the admin; an empty one takes no gap. */
.details .value:empty { display: none; }
@media (min-width: 640px) {
  .details { grid-template-columns: repeat(4, 1fr); }
  .details__item + .details__item { border-inline-start: 1px solid var(--gold-line-faint); }
}
@media (max-width: 639px) {
  .details__item:nth-child(even) { border-inline-start: 1px solid var(--gold-line-faint); }
}

/* ---------- 06 · RSVP ---------- */

.rsvp__intro { margin-bottom: 14px; }
.rsvp__note {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0 auto clamp(26px, 4vw, 36px);
  max-width: 560px;
  color: var(--gold-soft);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.6;
}
.rsvp__note-en {
  font-family: var(--font-latin);
  font-size: 16px;
  color: var(--ink-65);
  letter-spacing: 0.01em;
}
.form {
  width: min(700px, 100%);
  margin: 0 auto;
  text-align: start;
}
.form__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px 20px;
}
@media (min-width: 640px) {
  .form__grid { grid-template-columns: 1fr 1fr; }
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 17px;
  color: var(--ink-80);
  font-weight: 500;
  font-family: var(--font-latin);
  text-align: left;
  letter-spacing: 0.01em;
}
.field__hint { color: var(--gold-soft); font-weight: 450; }
.field input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  font-family: var(--font-latin);
  text-align: left;
  direction: ltr;
  border: 1px solid rgba(239, 232, 218, 0.28);
  border-radius: 3px;
  background: rgba(4, 10, 24, 0.35);
  color: var(--ink);
  font: inherit;
  font-size: 18.5px;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background-color 0.3s var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
.field input::placeholder { color: var(--ink-45); }
.field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(242, 182, 50, 0.35), 0 0 22px rgba(242, 182, 50, 0.12);
  background: rgba(4, 10, 24, 0.5);
}
.field.is-invalid input { border-color: #e0725c; }

.choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 40px;
  margin: clamp(26px, 4vw, 36px) 0 0;
  padding: 0;
  border: 0;
}
.choice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 19.5px;
  font-weight: 500;
  color: var(--ink-80);
  transition: color 0.3s var(--ease);
}
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice__dot {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--ink-65);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  flex: none;
}
.choice__dot::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--gold);
  transform: scale(0);
  transition: transform 0.3s var(--ease);
}
.choice input:checked + .choice__dot { border-color: var(--gold); box-shadow: 0 0 14px rgba(242, 182, 50, 0.25); }
.choice input:checked + .choice__dot::after { transform: scale(1); }
.choice input:checked ~ span:last-child { color: var(--ink); }
.choice input:focus-visible + .choice__dot { outline: 1px solid var(--gold); outline-offset: 3px; }

.hp { position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0; overflow: hidden; }

.form__error {
  margin: 22px 0 0;
  text-align: center;
  color: #f0a08f;
  font-size: 17px;
}
.form__submit {
  position: relative;
  display: flex;
  margin: clamp(26px, 4vw, 34px) auto 0;
  min-width: 240px;
  min-height: 54px;
  font-size: 20px;
}
.form__submit .btn__spinner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(28, 21, 3, 0.25);
  border-top-color: #1c1503;
  opacity: 0;
  animation: spin 0.8s linear infinite;
}
.form__submit.is-busy { pointer-events: none; }
.form__submit.is-busy .btn__label { opacity: 0; }
.form__submit.is-busy .btn__spinner { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.form__done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 0 0;
  animation: enter 0.9s var(--ease) both;
}
.form__done-icon { color: var(--gold); margin-bottom: 8px; }
.form__done-title {
  margin: 0;
  font-size: clamp(23px, 3vw, 27px);
  font-weight: 600;
  color: var(--ink);
}
.form__done-text {
  margin: 0;
  max-width: 560px;
  color: var(--ink-80);
  font-size: 18px;
}

/* ---------- 07 · Ending ---------- */

/* The artwork is square (the man under the floating scarf) and closes the page, flush with its bottom
   edge. A band from the scarf down is shown, capped at 1280px wide with its sides melting into the storm
   on wide screens, fitted by height on phones; the date, title, closing words, logo and Instagram rest
   on its foot over a darkening gradient. */
.ending {
  position: relative;
  --art-w: min(100vw, 1280px);
  /* The file is the square key art with its bottom 15% cut off (1600 by 1360). The band shows it from
     15% of the original down, so the fade-in can start in the sky above the scarf: 70% of the width. */
  --art-h: calc(var(--art-w) * 0.7);
  min-height: calc(var(--art-h) + clamp(12px, 2.5vh, 32px));
  overflow: hidden;
  margin-top: clamp(8px, 2vw, 28px);
}
.ending::before {
  /* Eases the storm down into the night before the clouds and the artwork appear. */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(to bottom, rgba(3, 9, 26, 0) 0%, rgba(3, 9, 26, 0.45) 40%, rgba(3, 9, 26, 0.55) 100%);
}
.ending__clouds {
  /* cloud haze continuing the storm into the scene */
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: calc(100% - var(--art-h) * 0.45);
  z-index: -2;
  background: url('../assets/img/clouds-b.jpg') center center / cover no-repeat;
  /* Screen blending lets the dark sky in the frame vanish and only the cloud puffs add haze,
     so the frame's edges and its near-black upper half never show as a band. */
  mix-blend-mode: screen;
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 40%, rgba(0,0,0,0.6) 72%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 40%, rgba(0,0,0,0.6) 72%, transparent 100%);
}
@supports (background-image: url('../assets/img/clouds-b.webp')) {
  .ending__clouds { background-image: url('../assets/img/clouds-b.webp'); }
}
.ending__art {
  position: absolute;
  bottom: 0;
  left: calc(50% - var(--art-w) / 2);
  width: var(--art-w);
  height: var(--art-h);
  z-index: -2;
}
.ending__art picture, .ending__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ending__art img {
  object-fit: cover;
  object-position: 50% 100%;
  filter: saturate(1.12) contrast(1.06);
  /* A long, gradual fade in from the storm, beginning in the sky above the scarf and solid just past
     its top edge; solid to the bottom edge of the page. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.25) 12%, rgba(0,0,0,0.65) 24%, #000 36%);
          mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.25) 12%, rgba(0,0,0,0.65) 24%, #000 36%);
}
@media (min-width: 1281px) {
  .ending__art {
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%);
            mask-image: linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%);
  }
}
.ending__art::after {
  /* Darkens the lower part of the picture so the stack of date, title, words and logo reads over it. */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(3, 9, 26, 0) 22%, rgba(3, 9, 26, 0.35) 55%, rgba(3, 9, 26, 0.65) 100%);
}
/* The stack is centred vertically along the picture, never pinned to its foot; the bottom padding
   lifts that centre by 5% of the picture's height. */
.ending__content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--art-h);
  width: min(560px, 100%);
  margin: 0 auto;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 20px calc(var(--art-h) * 0.1);
}
.ending__date {
  margin: 0 0 6px;
  color: var(--gold);
  font-family: var(--font-latin);
  direction: ltr;
  font-size: 15px;
  letter-spacing: 0.22em;
  font-weight: 600;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.ending__title {
  width: clamp(200px, 40vw, 300px);
  height: auto;
  filter: drop-shadow(0 0 18px rgba(255, 176, 0, 0.3)) drop-shadow(0 6px 20px rgba(0, 0, 0, 0.6));
}
.ending__text {
  margin: clamp(16px, 3vh, 24px) 0 clamp(28px, 5vh, 44px);
  font-size: clamp(16px, 2vw, 17.5px);
  font-weight: 500;
  color: var(--ink);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}
@media (max-width: 480px) {
  /* A phone is too narrow for the sentence on one line; let it wrap there rather than overflow. */
  .ending__text { white-space: normal; }
}
.ending__social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: clamp(18px, 3vh, 26px);
  color: var(--gold-soft);
  font-family: var(--font-latin);
  direction: ltr;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  transition: color 0.3s var(--ease);
}
.ending__social:hover, .ending__social:focus-visible { color: var(--gold); outline: none; }
@media (max-width: 640px) {
  /* Taller than wide, so the picture is fitted by height and the whole of it shows, sides cropped. */
  .ending { --art-h: min(140vw, 560px); }
}

/* ---------- Rain, grain, vignette (fixed overlays) ---------- */

/* Rain paints above the storm background, the hero sky and the ending scene (z-index -3 and -2)
   and below all text and artwork, which stay at z-index auto or higher. */
.rain {
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  transform: rotate(7deg);
  mix-blend-mode: screen;
  opacity: 0.3;
}
.rain__layer {
  position: absolute;
  left: 0;
  right: 0;
  top: -1024px;
  bottom: 0;
  background-repeat: repeat;
  will-change: transform;
  animation: rainfall linear infinite;
}
.rain__layer--far {
  background-image: url('../assets/img/rain-far.png');
  background-size: 256px 512px;
  opacity: 0.26;
  animation-duration: 1.9s;
}
.rain__layer--mid {
  background-image: url('../assets/img/rain-mid.png');
  background-size: 384px 768px;
  opacity: 0.55;
  animation-duration: 1.15s;
}
.rain__layer--near {
  background-image: url('../assets/img/rain-near.png');
  background-size: 512px 1024px;
  opacity: 0.42;
  animation-duration: 0.72s;
  filter: blur(0.5px);
}
@keyframes rainfall {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(0, 1024px, 0); }
}

.grain {
  position: fixed;
  inset: -512px;
  z-index: 6;
  pointer-events: none;
  background: url('../assets/img/grain.png') repeat;
  background-size: 512px 512px;
  mix-blend-mode: overlay;
  opacity: 0.17;
  animation: grain 0.5s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(512px, 256px); }
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, rgba(2, 6, 18, 0) 55%, rgba(2, 6, 18, 0.55) 100%);
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.reveal.in-view { opacity: 1; transform: none; }

/* ---------- Trailer dialog ---------- */

.trailer {
  border: 0;
  padding: 0;
  margin: auto;
  width: min(1100px, 100vw);
  max-width: 100vw;
  max-height: 100vh;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
.trailer::backdrop {
  background: rgba(2, 6, 16, 0.9);
  backdrop-filter: blur(6px);
}
.trailer__frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}
.trailer__frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.trailer__close {
  position: absolute;
  top: -52px;
  inset-inline-end: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(239, 232, 218, 0.35);
  border-radius: 50%;
  background: rgba(5, 12, 28, 0.4);
  cursor: pointer;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.trailer__close:hover, .trailer__close:focus-visible { border-color: var(--gold); color: var(--gold); outline: none; }
@media (max-width: 1140px) {
  .trailer__close { top: 12px; inset-inline-end: 12px; z-index: 2; }
}

/* ---------- Background music control (bottom left) ---------- */

.music {
  position: fixed;
  left: calc(16px + env(safe-area-inset-left, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  direction: ltr;
}
.music__btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  background: rgba(5, 12, 28, 0.55);
  color: var(--ink);
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), opacity 0.3s var(--ease);
}
.music__btn:hover, .music__btn:focus-visible { border-color: var(--gold); color: var(--gold); outline: none; }
.music__slash { display: none; }
.music.is-off .music__btn { color: var(--ink-65); }
.music.is-off .music__slash { display: block; }
.music.is-waiting .music__btn { animation: musicPulse 2.4s ease-in-out infinite; }
@keyframes musicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 182, 50, 0); }
  50%      { box-shadow: 0 0 0 7px rgba(242, 182, 50, 0.16); border-color: var(--gold); }
}
.music__vol {
  width: 76px;
  height: 20px;
  margin: 0;
  accent-color: var(--gold);
  cursor: pointer;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
/* With a mouse the slider slides out on hover or focus; on touch screens it stays visible. */
.music:hover .music__vol, .music:focus-within .music__vol { opacity: 1; transform: none; }
@media (hover: none) { .music__vol { opacity: 1; transform: none; } }
.music__vol[hidden] { display: none; }

/* ---------- Language switcher (top right) and English ---------- */

/* Two equal halves, English on the left in both languages; a gold pill slides under the active one. */
.lang {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  z-index: 8;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  direction: ltr;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: rgba(5, 12, 28, 0.55);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  opacity: 0;
  animation: langIn 1.1s var(--ease) 0.6s forwards;
  transition: transform 0.45s var(--ease);
}
@keyframes langIn { to { opacity: 1; } }
/* Tucked above the screen while the visitor scrolls down (js/i18n.js). A transform, because the
   entrance animation holds the opacity. */
.lang.is-tucked { transform: translateY(calc(-100% - 24px - env(safe-area-inset-top, 0px))); }
.lang::before {
  content: '';
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: rgba(242, 182, 50, 0.16);
  box-shadow: inset 0 0 0 1px rgba(242, 182, 50, 0.55);
  transition: transform 0.45s var(--ease);
}
html[data-lang="ar"] .lang::before { transform: translateX(100%); }
.lang__opt {
  position: relative;
  min-width: 46px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-65);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.3s var(--ease);
}
.lang__opt[lang="en"] { font-family: var(--font-latin); letter-spacing: 0.14em; font-weight: 600; padding-left: 14px; }
.lang__opt[lang="ar"] { font-weight: 600; font-size: 15px; }
.lang__opt:hover { color: var(--ink); }
.lang__opt[aria-pressed="true"] { color: var(--gold); cursor: default; }
.lang__opt:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }

/* Content that exists in one language only. */
html[data-lang="ar"] [data-only="en"],
html[data-lang="en"] [data-only="ar"] { display: none !important; }

/* The switch fades the text out and back in; the backgrounds, rain and music stay. Opacity is set on
   the content blocks only: on .poster it would create a stacking context and lift the rain layer. */
.hero__content, .section, .ending__content { transition: opacity 0.2s var(--ease); }
html.lang-fading .hero__content,
html.lang-fading .section,
html.lang-fading .ending__content { opacity: 0; }

/* The romanised title under the calligraphy, English only. */
.hero__title-en {
  margin: 10px 0 0;
  color: var(--gold-soft);
  font-family: var(--font-latin);
  font-size: clamp(14px, 1.7vw, 16px);
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
/* Shown by a switch after the entrance has played: appear at once, not after the entrance delay. */
html.lang-switched .hero__title-en { animation: none; opacity: 1; transform: none; }

/* English sets tighter than the Arabic: the same sizes, less leading. */
html[data-lang="en"] body { line-height: 1.65; }
html[data-lang="en"] .hero__credit-text { line-height: 1.7; }
/* Even lines, so the film title or a partner's name never sits alone on the last one. */
html[data-lang="en"] .lead,
html[data-lang="en"] .heading span,
html[data-lang="en"] .hero__credit-text { text-wrap: balance; }
html[data-lang="en"] .rsvp__note-en { font-size: 17px; color: var(--gold-soft); }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rain__layer, .grain, .atmos__mist, .hero__chevron, .music__btn { animation: none !important; }
  .lang { animation: none; opacity: 1; }
  .lang::before { transition: none; }
  .rain { opacity: 0.25; }
  .enter, .reveal { opacity: 1; transform: none; animation: none; transition: none; }
  .hero__title .title-art, .hero__title .title-glow { animation: none; }
  .hero__title .title-art { -webkit-mask-image: none; mask-image: none; }
}
