/* ─────────────────────────────────────────────────────────────────────────
   Driftwood — teaser splash
   "The dim-lit lounge": a warm-black room where light is scarce.
   Lora carries the writing-that-matters voice; DM Sans is the quiet chrome.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  /* Warm-black room — never pure black */
  --surface-base:    #161412;
  --surface-raised:  #1e1b18;
  --surface-elev:    #2a2622;

  /* Warm off-white — never pure white */
  --ink:        #f4efe8;
  --ink-soft:   #d3cabd;
  --ink-mute:   #a89e91;

  --border:        #38332c;
  --border-strong: #4a443c;

  /* Candle amber: the one light source, the one action */
  --amber:       #e8a44a;
  --amber-hi:    #f0b560;
  --amber-glow:  232 164 74;   /* rgb channels for alpha compositing */

  /* Frond green: a cool jade undertone borrowed from the room's foliage.
     Atmosphere only — never an action color. */
  --frond-glow:  79 125 87;    /* rgb channels for alpha compositing */

  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);

  /* Pulled from a vintage cocktail menu: a 1950s brush-script for the
     section headers, a Times-like serif for the printed item lines. */
  --font-ui:      "DM Sans", system-ui, -apple-system, sans-serif;
  --font-display: "Grand Hotel", "Snell Roundhand", cursive;
  --font-menu:    "Tinos", "Times New Roman", Georgia, serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--surface-base);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-hi); }

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

/* ── Atmosphere ──────────────────────────────────────────────────────────
   Fixed, behind everything. A single warm bloom low-right, deepened edges,
   a sparse rise of embers, and film grain so the light never reads flat.   */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* The vintage room itself, ghosted in beneath everything. Screen blend lets
   only the highlights — lanterns, thatch, the lit floor, the seated figures —
   surface against the warm-black, so it reads as a half-remembered scene
   rather than a photograph. Sepia warms those highlights to candlelight. */
.scene {
  position: absolute;
  inset: 0;
  background: url("scene.jpg") center / cover no-repeat;
  filter: sepia(0.55) contrast(1.06) brightness(0.96);
  opacity: 0.13;
  mix-blend-mode: screen;
}

.glow {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(46% 42% at 74% 70%, rgb(var(--amber-glow) / 0.22), rgb(var(--amber-glow) / 0.07) 42%, transparent 70%),
    radial-gradient(30% 26% at 71% 66%, rgb(var(--amber-glow) / 0.20), transparent 68%),
    /* Cool jade undertone, opposite the candle, so the warmth has a foil. */
    radial-gradient(42% 40% at 14% 20%, rgb(var(--frond-glow) / 0.11), transparent 64%),
    radial-gradient(120% 90% at 60% 128%, rgb(var(--amber-glow) / 0.10), transparent 60%);
  transform-origin: 72% 68%;
  will-change: opacity, transform;
}

.vignette {
  position: absolute;
  inset: 0;
  /* Intentional atmosphere: a vignette must read deeper than --surface-base
     to sink the room's corners. Warm near-black, tinted off the room itself. */
  background: radial-gradient(125% 105% at 50% 38%, transparent 52%, rgba(10, 9, 8, 0.5) 100%);
}

.embers { position: absolute; inset: 0; }
.embers span {
  position: absolute;
  bottom: -6%;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--amber-hi);
  filter: blur(0.4px);
  opacity: 0;
  box-shadow: 0 0 6px 1px rgb(var(--amber-glow) / 0.55);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Page frame ──────────────────────────────────────────────────────────
   One fold. Content left-anchored against the light blooming off-right.     */
.page {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(2rem, 5vh, 3.5rem);
  width: min(100% - 3rem, 1120px);
  margin-inline: auto;
  padding-block: clamp(1.5rem, 4vh, 2.5rem);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.wordmark__mark {
  width: 1.15rem; height: 1.15rem;
  color: var(--amber);
  filter: drop-shadow(0 0 7px rgb(var(--amber-glow) / 0.5));
}
.wordmark__name { font-size: 1.0625rem; }

.status {
  /* "WINE LIST" treatment: bold serif caps, widely letterspaced, no chrome. */
  font-family: var(--font-menu);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  align-self: center;
  min-width: 0;
  max-width: 36rem;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 7.4vw, 4rem);
  line-height: 1.12;
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: break-word;
  color: var(--ink);
  /* Script wants a little of the candle's warmth, like ink catching light. */
  text-shadow: 0 1px 18px rgb(var(--amber-glow) / 0.12);
}

.hero__lede {
  margin: clamp(1.25rem, 3vh, 1.75rem) 0 0;
  max-width: 46ch;
  font-family: var(--font-menu);
  font-size: clamp(1.125rem, 1.7vw, 1.3125rem);
  line-height: 1.58;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* The dotted leader that ran from menu item to price, recast as a divider. */
.leader {
  margin: clamp(1.75rem, 4.5vh, 2.5rem) 0 0;
  max-width: 30rem;
  height: 0;
  border-bottom: 2px dotted var(--border-strong);
}

/* ── Signup ──────────────────────────────────────────────────────────── */
.signup { margin-top: clamp(1.5rem, 3.5vh, 2rem); max-width: 30rem; }

.signup__cue {
  margin: 0 0 0.9rem;
  /* The menu's centered italic aside, borrowed for the sign-up line. */
  font-family: var(--font-menu);
  font-style: italic;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.signup__form {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--surface-raised);
  /* Vintage menu frame: square corners, a thick rule, and a thin inner
     keyline set off by a small gap — the double-rule box from the menu. */
  border: 2px solid var(--border-strong);
  border-radius: 0;
  box-shadow: inset 0 0 0 2px var(--surface-raised), inset 0 0 0 3px var(--border);
  transition: border-color 150ms ease, box-shadow 250ms ease;
}
.signup__form:focus-within {
  border-color: var(--amber);
  box-shadow:
    inset 0 0 0 2px var(--surface-raised),
    inset 0 0 0 3px rgb(var(--amber-glow) / 0.6),
    0 0 0 3px rgb(var(--amber-glow) / 0.16);
}

.signup__input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  padding: 0 0.5rem 0 1rem;
}
.signup__input::placeholder { color: var(--ink-mute); }

.signup__button {
  flex: 0 0 auto;
  appearance: none;
  cursor: pointer;
  background: var(--amber);
  color: var(--surface-base);
  /* A square, stamped block with a dark keyline — printed-menu, not pill. */
  border: 2px solid var(--surface-base);
  border-radius: 0;
  font: inherit;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0 1.4rem;
  height: 2.75rem;
  transition: background-color 150ms ease, transform 150ms var(--ease-expo);
}
.signup__button:hover { background: var(--amber-hi); }
.signup__button:active { transform: scale(0.97); }

.signup__note {
  margin: 0.85rem 0 0;
  font-family: var(--font-menu);
  font-size: 0.875rem;
  color: var(--ink-mute);
  min-height: 1.2em;
  transition: color 200ms ease;
}
.signup.is-done .signup__note { color: var(--amber-hi); }

/* Success: swap the form for a confirmation line */
.signup__done {
  display: none;
  align-items: center;
  gap: 0.6rem;
  min-height: 3.55rem;
  padding-left: 0.25rem;
  font-family: var(--font-menu);
  font-size: 1.125rem;
  color: var(--ink);
}
.signup.is-done .signup__form { display: none; }
.signup.is-done .signup__done { display: flex; }
.signup__done svg {
  flex: 0 0 auto;
  width: 1.5rem; height: 1.5rem;
  color: var(--amber);
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8125rem;
  color: var(--ink-mute);
}
.footer__dot { color: var(--border-strong); }
.footer a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--border-strong); }
.footer a:hover { color: var(--ink); text-decoration-color: var(--ink-mute); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 0;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .hero { max-width: none; }
  .signup__form { flex-direction: column; border-radius: 0; padding: 0.6rem; gap: 0.6rem; }
  .signup__input { padding: 0.6rem 0.85rem; }
  .signup__button { width: 100%; }
  .status { display: none; }
}

/* ── Motion ──────────────────────────────────────────────────────────────
   Everything below only runs when motion is welcome. The resting state of
   every element is the *visible* state, so reduced-motion and no-JS users
   see the finished page — the reveal only enhances.                         */
@media (prefers-reduced-motion: no-preference) {

  /* Orchestrated entrance — only armed once JS confirms it can run. */
  .js .reveal { opacity: 0; transform: translateY(14px); }
  .js.ready .reveal {
    animation: rise 0.95s var(--ease-expo) forwards;
    animation-delay: var(--d, 0ms);
  }
  @keyframes rise {
    to { opacity: 1; transform: none; }
  }

  /* Candlelight: a slow, slightly irregular breath. */
  .glow { animation: flicker 7s ease-in-out infinite; }
  @keyframes flicker {
    0%, 100% { opacity: 0.92; transform: scale(1); }
    35%      { opacity: 1;    transform: scale(1.025); }
    60%      { opacity: 0.86; transform: scale(0.99); }
    80%      { opacity: 0.97; transform: scale(1.012); }
  }

  /* Embers drift up and fade. */
  .embers span {
    animation: ember var(--dur, 14s) linear infinite;
    animation-delay: var(--delay, 0s);
  }
  @keyframes ember {
    0%   { opacity: 0; transform: translate(0, 0) scale(0.7); }
    12%  { opacity: 0.8; }
    70%  { opacity: 0.5; }
    100% { opacity: 0; transform: translate(var(--drift, 12px), -88svh) scale(1); }
  }
}
