/* =====================================================================
   Valeria's 15th Birthday Celebration — Seat Finder
   Art-Deco high-roller theme. Gold on black-velvet & oxblood.
   ===================================================================== */

/* ------------------------------ Tokens ------------------------------ */
:root {
  /* Color — OKLCH, drenched dark casino palette */
  --noir:         oklch(0.15 0.025 22);   /* page floor */
  --noir-deep:    oklch(0.10 0.018 20);   /* vignette pools */
  --velvet:       oklch(0.205 0.052 24);  /* raised surface */
  --velvet-2:     oklch(0.255 0.060 25);  /* input / rows */
  --velvet-hi:    oklch(0.30 0.066 26);   /* hovered row */

  --crimson:      oklch(0.52 0.185 26);   /* casino red */
  --crimson-deep: oklch(0.40 0.150 26);
  --crimson-glow: oklch(0.58 0.205 27);

  --gold:         oklch(0.83 0.128 86);   /* primary gold */
  --gold-bright:  oklch(0.91 0.105 92);   /* highlight */
  --gold-deep:    oklch(0.68 0.120 80);   /* antique edge */

  --champagne:    oklch(0.95 0.022 88);   /* primary text on dark */
  --ink-soft:     oklch(0.87 0.020 88);   /* secondary text */
  --muted:        oklch(0.74 0.022 86);   /* tertiary text */

  --hairline:     oklch(0.83 0.128 86 / 0.30);
  --hairline-soft:oklch(0.83 0.128 86 / 0.16);
  --gold-glow:    oklch(0.83 0.128 86 / 0.35);

  /* Type */
  /* --font-display (Cinzel) is reserved for the table-number chip — do not change. */
  --font-display: "Cinzel", "Cinzel Decorative", "Trajan Pro", "Times New Roman", serif;
  --font-ui: "Jost", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-script: "Great Vibes", "Snell Roundhand", "Apple Chancery", cursive;
  --font-deco: "Limelight", "Cinzel", "Copperplate", serif;

  /* Fluid type scale (~1.25–1.3 ratio) */
  --step--1: clamp(0.78rem, 0.74rem + 0.20vw, 0.88rem);
  --step-0:  clamp(0.95rem, 0.90rem + 0.25vw, 1.05rem);
  --step-1:  clamp(1.15rem, 1.05rem + 0.50vw, 1.40rem);
  --step-2:  clamp(1.45rem, 1.25rem + 1.00vw, 2.00rem);
  --step-3:  clamp(2.10rem, 1.70rem + 2.00vw, 3.20rem);
  --step-name: clamp(3.20rem, 2.30rem + 4.60vw, 5.60rem);

  /* Spacing */
  --space-1: 0.4rem;
  --space-2: 0.7rem;
  --space-3: 1.1rem;
  --space-4: 1.6rem;
  --space-5: 2.4rem;
  --space-6: clamp(2.4rem, 1.6rem + 3vw, 4rem);

  /* Radii & motion */
  --radius: 12px;
  --radius-sm: 8px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);          /* ease-out-expo-ish */
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);

  /* z-scale */
  --z-frame: 5;
  --z-listbox: 30;
  --z-confetti: 60;
}

/* ------------------------------ Reset ------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100svh;
  font-family: var(--font-ui);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--champagne);
  background: var(--noir);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; }
:focus-visible { outline: none; }

/* ----------------------- Atmospheric backdrop ----------------------- */
/* Deep oxblood glow, a soft top spotlight, and a fine Deco texture.    */
.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding:
    max(env(safe-area-inset-top), var(--space-5))
    max(env(safe-area-inset-right), var(--space-4))
    max(env(safe-area-inset-bottom), var(--space-5))
    max(env(safe-area-inset-left), var(--space-4));
  isolation: isolate;
  overflow: clip;
}
.stage::before {
  /* Red-carpet premiere scene: starry night up top, a warm gold marquee
     halo behind the title, and a rich red-carpet glow rising from below. */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(125% 70% at 50% -6%, oklch(0.26 0.045 255) 0%, transparent 46%),   /* cool night sky */
    radial-gradient(85% 52% at 50% 27%, oklch(0.55 0.105 82 / 0.42) 0%, transparent 58%),/* gold marquee halo */
    radial-gradient(150% 95% at 50% 124%, oklch(0.42 0.175 27) 0%, transparent 60%),    /* red carpet */
    radial-gradient(160% 130% at 50% 100%, oklch(0.13 0.03 24) 0%, transparent 70%),    /* deep base glow */
    var(--noir);
}
.stage::after {
  /* Starfield scattered across the upper sky, fading out before the carpet. */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 16%, oklch(1 0 0 / 0.90), transparent 60%),
    radial-gradient(1.1px 1.1px at 27% 7%, oklch(1 0 0 / 0.70), transparent 60%),
    radial-gradient(1.3px 1.3px at 46% 13%, oklch(0.96 0.06 90 / 0.95), transparent 60%),
    radial-gradient(1.0px 1.0px at 61% 6%, oklch(1 0 0 / 0.70), transparent 60%),
    radial-gradient(1.7px 1.7px at 79% 15%, oklch(1 0 0 / 0.88), transparent 60%),
    radial-gradient(1.1px 1.1px at 90% 9%, oklch(0.96 0.06 90 / 0.85), transparent 60%),
    radial-gradient(1.2px 1.2px at 35% 23%, oklch(1 0 0 / 0.55), transparent 60%),
    radial-gradient(1.0px 1.0px at 56% 25%, oklch(1 0 0 / 0.50), transparent 60%),
    radial-gradient(1.4px 1.4px at 71% 27%, oklch(1 0 0 / 0.60), transparent 60%),
    radial-gradient(1.1px 1.1px at 7% 30%, oklch(1 0 0 / 0.45), transparent 60%);
  -webkit-mask: linear-gradient(to bottom, #000 0%, #000 26%, transparent 52%);
          mask: linear-gradient(to bottom, #000 0%, #000 26%, transparent 52%);
}

/* --------------------------- Deco frame ----------------------------- */
/* A double gold rule with ornamented corners, hugging the safe area.   */
.frame {
  position: fixed;
  inset: clamp(10px, 2.4vw, 22px);
  inset-block-start: max(clamp(10px, 2.4vw, 22px), env(safe-area-inset-top));
  inset-block-end: max(clamp(10px, 2.4vw, 22px), env(safe-area-inset-bottom));
  z-index: var(--z-frame);
  pointer-events: none;
  border: 1px solid var(--hairline-soft);
  border-radius: 4px;
  box-shadow: inset 0 0 0 4px transparent, inset 0 0 0 5px var(--hairline-soft);
}
.frame::before {
  /* inner thin rule */
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid var(--hairline);
  border-radius: 2px;
}
.frame__corner {
  position: absolute;
  width: 38px;
  height: 38px;
  color: var(--gold);
  opacity: 0.9;
}
.frame__corner svg { width: 100%; height: 100%; display: block; }
.frame__corner--tl { top: -2px; left: -2px; }
.frame__corner--tr { top: -2px; right: -2px; transform: scaleX(-1); }
.frame__corner--bl { bottom: -2px; left: -2px; transform: scaleY(-1); }
.frame__corner--br { bottom: -2px; right: -2px; transform: scale(-1, -1); }

/* ------------------------------ Card -------------------------------- */
.invite {
  position: relative;
  z-index: 1;
  width: min(100%, 33rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Kicker — single deliberate label, not a per-section eyebrow */
.kicker {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: var(--step--1);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  text-indent: 0.34em;
  color: var(--gold);
  margin-bottom: var(--space-2);
}

/* Marquee motto — "Lights · Camera · Action" with flanking light-rules */
.marquee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin: 0 0 var(--space-4);
  color: var(--gold);
}
.marquee::before, .marquee::after {
  content: "";
  width: clamp(22px, 10vw, 52px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline) 55%, var(--gold-glow));
}
.marquee::after { transform: scaleX(-1); }
.marquee__text {
  font-family: var(--font-deco);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-bright);
  white-space: nowrap;
}
.marquee__star { font-size: 0.7rem; color: var(--gold); opacity: 0.9; }

/* Title */
.title {
  line-height: 1.0;
  text-wrap: balance;
  margin-bottom: var(--space-2);
}
.title__name {
  display: block;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(4.4rem, 3.1rem + 6.4vw, 8rem);
  line-height: 0.95;
  letter-spacing: 0.005em;
  padding: 0.06em 0.12em 0.14em;   /* room for the script's swashes */
  color: var(--gold);
  /* warm gilded glow — solid color, NOT gradient-clip text */
  text-shadow:
    0 1px 1px oklch(0.45 0.08 60 / 0.7),
    0 0 8px var(--gold-glow),
    0 0 34px oklch(0.83 0.128 86 / 0.45);
}
.title__rest {
  display: block;
  margin-top: 0.15em;
  font-family: var(--font-deco);
  font-size: var(--step-1);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-bright);
  text-shadow: 0 0 18px oklch(0.83 0.128 86 / 0.3);
}

/* Meta line: venue · date */
.meta {
  font-family: var(--font-ui);
  font-size: var(--step--1);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  margin-bottom: var(--space-6);
}
.meta__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); opacity: 0.8; }

/* ------------------------------ Finder ------------------------------ */
.finder { width: 100%; }

.prompt {
  display: block;
  font-family: var(--font-deco);
  font-size: var(--step-1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
  text-shadow: 0 0 16px oklch(0.83 0.128 86 / 0.28);
  margin-bottom: var(--space-3);
}

.field {
  position: relative;
}
.field__icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--gold-deep);
  pointer-events: none;
  transition: color 0.25s var(--ease-out);
}
.search {
  width: 100%;
  height: 3.6rem;
  padding: 0 1rem 0 2.9rem;
  font-size: 1.05rem; /* >=16px keeps iOS from zooming */
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--champagne);
  background: var(--velvet-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.05),
    0 10px 30px -18px oklch(0 0 0 / 0.9);
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background 0.25s var(--ease-out);
}
.search::placeholder { color: var(--muted); opacity: 1; }
.search:hover { border-color: var(--gold-glow); }
.search:focus-visible {
  background: var(--velvet-hi);
  border-color: var(--gold);
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.06),
    0 0 0 3px var(--gold-glow),
    0 12px 36px -20px oklch(0 0 0 / 0.9);
}
.field:focus-within .field__icon { color: var(--gold); }

/* Clear button */
.search-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-radius: 50%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--ease-out), color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
.search-clear:hover { color: var(--champagne); background: oklch(1 0 0 / 0.06); }
.search-clear svg { width: 18px; height: 18px; }
.field[data-filled="true"] .search-clear { opacity: 1; visibility: visible; }
.field[data-filled="true"] .search { padding-right: 3.1rem; }

/* --------------------------- Suggestions ---------------------------- */
.listbox {
  list-style: none;
  padding: 0.4rem;
  margin: 0.6rem 0 0;
  background: var(--velvet);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -28px oklch(0 0 0 / 0.95);
  max-height: min(46vh, 22rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  text-align: left;
  z-index: var(--z-listbox);
}
.listbox[hidden] { display: none; }

.option {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  scroll-margin: 0.4rem;
}
.option + .option { margin-top: 2px; }
.option:hover,
.option[aria-selected="true"] {
  background: var(--velvet-hi);
}
.option[aria-selected="true"] { box-shadow: inset 0 0 0 1px var(--hairline); }

.option__chip {
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, var(--crimson) 0 58%, var(--crimson-deep) 59% 100%);
  border: 1.5px solid var(--gold);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  box-shadow: 0 2px 6px -2px oklch(0 0 0 / 0.7);
}
.option__text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.option__name {
  display: block;
  font-weight: 500;
  font-size: 1.02rem;
  color: var(--champagne);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.option__name mark {
  background: none;
  color: var(--gold-bright);
  font-weight: 600;
}
.option__hint {
  font-size: var(--step--1);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Empty / no-match state */
.noresult {
  padding: 0.9rem 0.8rem;
  text-align: center;
  color: var(--muted);
  font-size: var(--step--1);
  line-height: 1.5;
}
.noresult strong { color: var(--ink-soft); font-weight: 600; }

/* Helper line under the field */
.hint-line {
  margin-top: var(--space-3);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ----------------------------- Result ------------------------------- */
.result {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.result[hidden] { display: none; }

.result__lead {
  font-family: var(--font-ui);
  font-size: var(--step-0);
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  margin-bottom: var(--space-4);
}
.result__lead b { color: var(--gold-bright); font-weight: 600; }

/* Casino chip */
.chip {
  position: relative;
  width: clamp(13rem, 58vw, 16.5rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-bottom: var(--space-5);
}
.chip__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.chip__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}
.chip__label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
}
.chip__number {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3.8rem, 22vw, 5.6rem);
  line-height: 0.9;
  color: var(--gold-bright);
  text-shadow: 0 2px 0 var(--gold-deep), 0 0 26px var(--gold-glow);
}
/* one-time sheen sweep across the chip */
.chip__sheen {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: radial-gradient(circle, #000 99%, transparent 100%);
          mask: radial-gradient(circle, #000 99%, transparent 100%);
}
.chip__sheen::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -60%;
  width: 50%;
  height: 180%;
  background: linear-gradient(90deg, transparent, oklch(1 0 0 / 0.5), transparent);
  transform: rotate(18deg) translateX(0);
}

.result__seat {
  font-family: var(--font-ui);
  font-size: var(--step--1);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-5);
}

/* Reset button */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  transition: border-color 0.25s var(--ease-out), color 0.25s var(--ease-out), background 0.25s var(--ease-out);
}
.btn-ghost:hover { border-color: var(--gold); background: oklch(0.83 0.128 86 / 0.08); color: var(--gold-bright); }
.btn-ghost:focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.btn-ghost svg { width: 15px; height: 15px; }

/* ----------------------------- Confetti ----------------------------- */
.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-confetti);
  pointer-events: none;
}

/* --------------------------- Visually hidden ------------------------ */
.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;
}

/* ------------------------------ Motion ------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    animation: rise 0.9s var(--ease-out) forwards;
  }
  .reveal-1 { animation-delay: 0.05s; }
  .reveal-2 { animation-delay: 0.16s; }
  .reveal-3 { animation-delay: 0.28s; }
  .reveal-4 { animation-delay: 0.40s; }
  .reveal-5 { animation-delay: 0.52s; }

  @keyframes rise {
    to { opacity: 1; transform: translateY(0); }
  }

  .frame { animation: frame-in 1.1s var(--ease-out) both; }
  @keyframes frame-in {
    from { opacity: 0; transform: scale(1.012); }
    to   { opacity: 1; transform: scale(1); }
  }

  /* Result reveal */
  .result:not([hidden]) .chip {
    animation: chip-in 0.7s var(--ease-out-quint) both;
  }
  @keyframes chip-in {
    from { opacity: 0; transform: translateY(10px) scale(0.86) rotate(-8deg); }
    to   { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
  }
  .result:not([hidden]) .chip__sheen::after {
    animation: sheen 1.1s 0.5s var(--ease-out) both;
  }
  @keyframes sheen {
    from { transform: rotate(18deg) translateX(0); }
    to   { transform: rotate(18deg) translateX(520%); }
  }
  .result:not([hidden]) .result__lead { animation: rise 0.6s 0.1s var(--ease-out) both; }
  .result:not([hidden]) .result__seat { animation: rise 0.6s 0.45s var(--ease-out) both; }
  .result:not([hidden]) .result__reset { animation: rise 0.6s 0.6s var(--ease-out) both; }

  .option { animation: opt-in 0.32s var(--ease-out) both; }
  @keyframes opt-in {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .chip__sheen { display: none; }
}

/* --------------------------- Short screens -------------------------- */
@media (max-height: 680px) {
  .marquee { margin-bottom: var(--space-3); }
  .meta { margin-bottom: var(--space-4); }
  .title__name { font-size: clamp(3.8rem, 2.8rem + 5vw, 6rem); }
}
