/* ============================================================
   St-Germain x The White Lotus - V1 microsite
   Mobile-first. Design artboard: 1080 x 3231 px (portrait).
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "St Germain Display";
  src: url("assets/fonts/StGermainDisplay-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Taviraj";
  src: url("assets/fonts/Taviraj-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Taviraj";
  src: url("assets/fonts/Taviraj-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --boulevard-green: #b5f2cb;   /* spec: Boulevard Green RGB(181,242,203) */
  --band-green: #cdecd6;        /* softer header tint matching the comp     */
  --cream: #f4eee1;
  --cream-field: #fffdf8;
  --ink: #6f7c88;               /* slate blue-grey: headings, button body   */
  --ink-soft: #8d97a0;          /* sub-copy                                 */
  --gold: #c4a96b;              /* placeholder text, chevron                */
  --gold-deep: #b2965a;

  --font-display: "St Germain Display", "Taviraj", Georgia, serif;
  --font-body: "Taviraj", Georgia, serif;

  --maxw: 520px;                /* visual width of the mobile canvas        */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: #e7e0d1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

.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;
}

/* ---------- Shell ---------- */
.shell {
  max-width: var(--maxw);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--cream);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(60, 70, 60, 0.12);
}

/* ---------- Screens ---------- */
.screen { display: none; }
.screen.is-active { display: block; }

/* ============================================================
   GATE
   ============================================================ */
.band {
  position: relative;
  background: var(--band-green);
  padding: clamp(28px, 7vw, 46px) 24px clamp(40px, 11vw, 66px);
  text-align: center;
}
.band__curve {
  position: absolute;
  left: 0; bottom: -1px;
  width: 100%; height: clamp(40px, 11vw, 70px);
}
.band__curve path { fill: var(--cream); }

/* Brand lockup */
.lockup { position: relative; z-index: 1; }
.lockup__hbo {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink);
  display: flex; gap: 0.4em; justify-content: center; align-items: baseline;
}
.lockup__hbo span { font-size: 8px; letter-spacing: 0.3em; opacity: 0.85; }

.lockup__lotus {
  margin: 4px 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(22px, 6.4vw, 30px);
  letter-spacing: 0.26em;
  color: var(--ink);
  text-indent: 0.26em;
}

/* Cartouche badge (shared shape) */
.badge {
  position: relative;
  display: inline-block;
  padding: 9px 30px;
  line-height: 1;
}
.cartouche {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.badge .cartouche path { fill: var(--ink); }
.badge__text {
  position: relative; z-index: 1;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--cream);
  display: inline-flex; align-items: center; gap: 0.6em;
  text-indent: 0.2em;
}
.spk { font-style: normal; font-size: 9px; color: var(--boulevard-green); }

/* Gate body */
.gate__body {
  padding: clamp(10px, 3vw, 20px) clamp(28px, 8vw, 48px) clamp(34px, 9vw, 54px);
  text-align: center;
}
.headline {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(34px, 11vw, 56px);
  line-height: 0.98;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin: clamp(14px, 4vw, 26px) 0 clamp(14px, 3.5vw, 22px);
}
.subhead {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(16px, 4.6vw, 20px);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 clamp(26px, 7vw, 40px);
}

/* Form */
.form { margin: 0; }

.field {
  position: relative;
  display: flex; align-items: center;
  background: var(--cream-field);
  border: 1px solid rgba(111, 124, 136, 0.35);
  border-radius: 14px;
  height: clamp(62px, 15vw, 78px);
  margin-bottom: 16px;
  transition: border-color var(--ease) 0.2s, box-shadow var(--ease) 0.2s;
}
.field:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196, 169, 107, 0.18);
}
.field--invalid { border-color: #c06a52; box-shadow: 0 0 0 3px rgba(192, 106, 82, 0.15); }

/* End ornaments (the little bracket flourishes) */
.ornament {
  flex: 0 0 auto;
  width: 22px; height: 56%;
  position: relative;
}
.ornament::before {
  content: "";
  position: absolute; top: 0; bottom: 0;
  width: 1.5px;
  background: rgba(111, 124, 136, 0.5);
  border-radius: 2px;
}
.ornament::after {
  content: "";
  position: absolute; top: 50%; width: 9px; height: 9px;
  border: 1.5px solid rgba(111, 124, 136, 0.5);
  border-radius: 50%;
  transform: translateY(-50%);
}
.ornament--left { margin-left: 16px; }
.ornament--left::before { left: 4px; }
.ornament--left::after { left: 0; }
.ornament--right { margin-left: auto; margin-right: 16px; }
.ornament--right::before { right: 4px; }
.ornament--right::after { right: 0; }

.field__input {
  flex: 1 1 auto;
  width: 100%;
  border: 0; background: transparent; outline: none;
  color: var(--ink);
  text-align: center;
  font-family: var(--font-display);
}
.field__input--year {
  font-size: clamp(30px, 8vw, 40px);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
}
.field__input--year::placeholder { color: var(--gold); opacity: 1; }

.field__input--select {
  font-family: var(--font-body);
  font-size: clamp(16px, 4.6vw, 19px);
  letter-spacing: 0.02em;
  color: var(--gold-deep);
  appearance: none; -webkit-appearance: none;
  text-align: left;
  padding-left: 6px;
  cursor: pointer;
}
.field__input--select:valid { color: var(--ink); }
.field__input--select option { color: #333; }

.chevron {
  position: absolute; right: 46px; top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px; color: var(--gold-deep);
  pointer-events: none;
}
.chevron svg { width: 100%; height: 100%; }

.field__help {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
  text-align: center;
}

.form__error {
  min-height: 1.2em;
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: #b85a42;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.form__error.is-shown { opacity: 1; }

/* Continue button (cartouche) */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: min(100%, 360px);
  height: clamp(66px, 16vw, 84px);
  margin: clamp(22px, 6vw, 34px) auto 0;
  background: none; border: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.cartouche--btn { filter: drop-shadow(0 8px 18px rgba(111, 124, 136, 0.35)); }
.btn .cartouche path {
  fill: var(--ink);
  transition: fill 0.2s var(--ease);
}
.btn__text {
  position: relative; z-index: 1;
  font-family: var(--font-body);
  font-weight: 500;
  text-transform: uppercase;
  font-size: clamp(16px, 4.6vw, 20px);
  letter-spacing: 0.18em;
  color: var(--cream);
  text-indent: 0.18em;
}
.btn:hover .cartouche path { fill: #5f6c78; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; }
.btn:focus-visible .cartouche path { fill: #5f6c78; }
.btn:focus-visible .cartouche { filter: drop-shadow(0 0 0 3px rgba(196,169,107,0.6)); }

.btn--light .cartouche path { fill: var(--cream); }
.btn--light .btn__text { color: var(--ink); }
.btn--light:hover .cartouche path { fill: #fff; }

/* Footer */
.gate__foot {
  margin-top: clamp(26px, 7vw, 40px);
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.gate__foot p { margin: 0 0 4px; }
.privacy-link { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.privacy-link:hover { color: var(--ink); }

/* ============================================================
   WELCOME (success)
   ============================================================ */
.screen--welcome { position: relative; min-height: 100dvh; }
.welcome__media { position: absolute; inset: 0; }
.welcome__media img { width: 100%; height: 100%; object-fit: cover; }
.welcome__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(20,40,40,0) 30%, rgba(30,45,45,0.65) 100%);
}
.welcome__panel {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  text-align: center;
  padding: 0 clamp(28px, 8vw, 48px) clamp(44px, 12vw, 70px);
  gap: 16px;
}
.badge--welcome { margin-bottom: 4px; }
.welcome__heading {
  font-family: var(--font-display);
  font-weight: 400; text-transform: uppercase;
  font-size: clamp(34px, 11vw, 52px);
  line-height: 0.98;
  color: #fff;
  margin: 0;
  text-shadow: 0 2px 18px rgba(0,0,0,0.3);
}
.welcome__copy {
  font-family: var(--font-body);
  font-size: clamp(16px, 4.4vw, 19px);
  line-height: 1.5;
  color: rgba(255,255,255,0.92);
  margin: 0;
  max-width: 24ch;
  text-shadow: 0 1px 10px rgba(0,0,0,0.3);
}
.welcome__note {
  font-family: var(--font-body);
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.7); margin: 2px 0 0;
}

/* ---------- Entry animation ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen.is-active .lockup,
.screen.is-active .headline,
.screen.is-active .subhead,
.screen.is-active .form,
.screen.is-active .gate__foot,
.screen--welcome.is-active .welcome__panel > * {
  animation: rise 0.7s var(--ease) both;
}
.screen.is-active .headline { animation-delay: 0.06s; }
.screen.is-active .subhead  { animation-delay: 0.12s; }
.screen.is-active .form     { animation-delay: 0.18s; }
.screen.is-active .gate__foot { animation-delay: 0.24s; }

/* ============================================================
   GAME (build your spritz)
   ============================================================ */
.screen--game { position: relative; min-height: 100dvh; overflow: hidden; }

.scene { position: absolute; inset: 0; z-index: 0; }
.scene__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.scene__img--final { opacity: 0; transition: opacity 0.9s var(--ease); }
.scene__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(20,40,40,0.30) 0%, rgba(20,40,40,0) 24%),
    linear-gradient(to top, rgba(18,34,34,0.70) 0%, rgba(18,34,34,0) 44%);
}
.fly { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.fly__item {
  position: absolute;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
}

/* Top prompt */
.game__top {
  position: relative; z-index: 2;
  text-align: center;
  padding: clamp(22px, 7vw, 40px) 24px 0;
}
.badge--game { margin-bottom: 14px; }
.game__heading {
  font-family: var(--font-display);
  font-weight: 400; text-transform: uppercase;
  font-size: clamp(30px, 9vw, 46px);
  line-height: 1; color: #fff; margin: 0;
  text-shadow: 0 2px 16px rgba(0,0,0,0.35);
}
.game__caption {
  font-family: var(--font-body);
  font-size: clamp(15px, 4.2vw, 18px);
  color: rgba(255,255,255,0.92);
  min-height: 1.5em; margin: 10px 0 0;
  text-shadow: 0 1px 10px rgba(0,0,0,0.4);
}
.pips { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.pip {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.pip.is-filled { background: var(--boulevard-green); transform: scale(1.15); }

/* Ingredient tray */
.tray {
  position: absolute; z-index: 2;
  left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center; gap: clamp(6px, 2.5vw, 14px);
  padding: 18px clamp(10px, 3vw, 18px) calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(18,34,34,0.8), rgba(18,34,34,0));
}
.chip {
  flex: 1 1 0; max-width: 92px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: none; border: 0; padding: 0;
  opacity: 0.45;
  transition: opacity 0.3s var(--ease), transform 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.chip__art {
  position: relative;
  width: clamp(54px, 15vw, 66px); height: clamp(54px, 15vw, 66px);
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  border: 1.5px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.chip__art img { width: 72%; height: 72%; object-fit: contain; }
.chip__label {
  font-family: var(--font-body); font-weight: 500;
  font-size: 11px; letter-spacing: 0.04em; color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.chip.is-active { opacity: 1; }
.chip.is-active .chip__art {
  border-color: var(--boulevard-green);
  background: rgba(181, 242, 203, 0.18);
  animation: pulse 1.8s var(--ease) infinite;
}
.chip.is-done { opacity: 0.9; }
.chip.is-done .chip__art { border-color: var(--boulevard-green); }
.chip.is-done .chip__art::after {
  content: "\2713";
  position: absolute; right: -3px; top: -3px;
  width: 18px; height: 18px; line-height: 18px; text-align: center;
  border-radius: 50%;
  background: var(--boulevard-green); color: #1d2b22;
  font-size: 11px; font-weight: 700; font-family: var(--font-body);
}
.chip:disabled { cursor: default; }
.chip:not(:disabled):active { transform: translateY(1px) scale(0.97); }
.chip:focus-visible { outline: none; }
.chip:focus-visible .chip__art { box-shadow: 0 0 0 3px rgba(196, 169, 107, 0.7); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(181, 242, 203, 0.5); }
  50%      { box-shadow: 0 0 0 10px rgba(181, 242, 203, 0); }
}

/* Served (completion) */
.served {
  position: absolute; inset: 0; z-index: 4;
  display: none; flex-direction: column; align-items: center; justify-content: flex-end;
  text-align: center;
  padding: 0 clamp(28px, 8vw, 48px) calc(clamp(44px, 12vw, 70px) + env(safe-area-inset-bottom));
  gap: 16px;
  background: linear-gradient(to top, rgba(18,34,34,0.9) 0%, rgba(18,34,34,0.5) 45%, rgba(18,34,34,0.1) 75%, rgba(18,34,34,0) 100%);
}
.served.is-shown { display: flex; }

/* On completion, clear the prompt and tray so only the served panel reads.
   animation:none lifts the entry `rise` fill that otherwise pins opacity at 1. */
.screen--game.is-complete .game__top,
.screen--game.is-complete .tray {
  animation: none;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.5s var(--ease), visibility 0s linear 0.5s;
}
.served__heading {
  font-family: var(--font-display);
  font-weight: 400; text-transform: uppercase;
  font-size: clamp(34px, 11vw, 52px);
  line-height: 0.98; color: #fff; margin: 0;
  text-shadow: 0 2px 18px rgba(0,0,0,0.3);
}
.served__copy {
  font-family: var(--font-body);
  font-size: clamp(16px, 4.4vw, 19px); line-height: 1.5;
  color: rgba(255,255,255,0.92); margin: 0; max-width: 26ch;
  text-shadow: 0 1px 10px rgba(0,0,0,0.3);
}
.served__note {
  font-family: var(--font-body);
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.7); margin: 2px 0 0;
}

/* ---------- Entry animations ---------- */
.screen--game.is-active .game__top,
.screen--game.is-active .tray { animation: rise 0.7s var(--ease) both; }
.screen--game.is-active .tray { animation-delay: 0.12s; }
.served.is-shown > * { animation: rise 0.6s var(--ease) both; }
.served.is-shown > *:nth-child(2) { animation-delay: 0.08s; }
.served.is-shown > *:nth-child(3) { animation-delay: 0.16s; }
.served.is-shown > *:nth-child(4) { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
