/* ============================================================
   EMBER & OAK - wood fire steakhouse
   Palette + type per BRAND-ember-oak-demo.md. One accent, no pure white,
   no cold greys. The serif carries mood; the sans carries facts.
   ============================================================ */

:root {
  --bg:       #0E0C0A;  /* 60 - charred warm black */
  --text:     #F2E8D8;  /* 30 - warm cream */
  --accent:   #E8622C;  /* 10 - ember orange, the ONLY accent */
  --surface:  #1A1611;  /* support: raised surfaces */
  --muted:    #8C8272;  /* support: muted text */
  --line:     #2C251C;

  --display: "Cormorant Garamond", Garamond, Georgia, "Times New Roman", serif;
  --body: "Inter", "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --gutter: clamp(20px, 5vw, 72px);
  --measure: 60ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;   /* no horizontal scroll, ever */
}

img, canvas { max-width: 100%; }

::selection { background: var(--accent); color: var(--bg); }

a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- film grain, the brand's one texture ---------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}

/* ---------- masthead ---------- */
.mast {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px var(--gutter);
  background: linear-gradient(180deg, rgba(14,12,10,.9) 0%, transparent 100%);
}
.mast .wordmark {
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: .34em;
  text-transform: uppercase;
  font-weight: 400;
}
.mast nav {
  margin-left: auto;
  display: flex;
  gap: 28px;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.mast nav a { color: var(--muted); text-decoration: none; transition: color .25s; }
.mast nav a:hover { color: var(--text); }
.mast nav a.book { color: var(--accent); }
@media (max-width: 700px) { .mast nav a:not(.book) { display: none; } }

/* ============================================================
   Scrub sections
   ============================================================ */
.cinematic { position: relative; height: 300vh; }
.cinematic .sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.cinematic canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 42%, rgba(14,12,10,.72) 100%),
    linear-gradient(180deg, rgba(14,12,10,.55) 0%, transparent 26%, transparent 62%, rgba(14,12,10,.88) 100%);
}

.overlay { position: absolute; inset: 0; pointer-events: none; }

/* The engine writes ONLY opacity + --reveal-y. Overlay elements own their own
   transform and compose the reveal offset. Never let the engine set transform. */
.reveal-line { transform: translateY(var(--reveal-y, 0px)); }

.line {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateY(var(--reveal-y, 0px));
  width: min(92vw, 22ch);
  margin: 0;
  text-align: center;
  opacity: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(34px, 6.4vw, 88px);
  line-height: 1.06;
  letter-spacing: .01em;
  text-wrap: balance;
  text-shadow: 0 2px 40px rgba(14,12,10,.7);
}
.line.wordmark-line {
  letter-spacing: .3em;
  text-transform: uppercase;
  font-size: clamp(28px, 5.2vw, 70px);
  width: min(92vw, 16ch);
}

.scroll-hint {
  position: absolute;
  bottom: 34px; left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
  transition: opacity .4s;
}
.progress {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: rgba(242,232,216,.08);
}
.progress-fill { height: 100%; width: 0; background: var(--accent); }

/* ============================================================
   Editorial sections
   ============================================================ */
.panel { padding: clamp(80px, 13vh, 160px) var(--gutter); }
.panel-head { max-width: var(--measure); margin: 0 auto clamp(40px, 6vh, 72px); text-align: center; }
.eyebrow {
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 18px;
}
h2 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(32px, 4.6vw, 58px);
  line-height: 1.1;
  margin: 0 0 16px;
  text-wrap: balance;
}
.panel-head p { color: var(--muted); margin: 0; }

/* ---------- menu ---------- */
.menu {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 clamp(32px, 6vw, 80px);
}
.dish {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 14px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.dish h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 25px;
  margin: 0;
  letter-spacing: .01em;
}
.dish .price {
  /* facts are set in the sans, per the brand doc */
  font-family: var(--body);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.dish p {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}
.menu-note {
  max-width: 900px;
  margin: 40px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* single elegant column at small widths - recipe 05 assertion 3 */
@media (max-width: 760px) {
  .menu { grid-template-columns: 1fr; }
}

/* ---------- hours + map ---------- */
.split {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
}
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

.split h3 {
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; margin: 0 0 20px;
}
.hours { list-style: none; margin: 0; padding: 0; }
.hours li {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.hours li span:last-child { color: var(--muted); }
.hours li.closed span:last-child { color: color-mix(in srgb, var(--muted) 62%, var(--bg)); }
.addr { font-style: normal; line-height: 1.9; }
.addr .map-link {
  display: inline-block; margin-top: 16px;
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid var(--accent); padding-bottom: 3px;
}

/* ---------- reservation ---------- */
.reserve { background: var(--surface); }
.form {
  max-width: 620px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 22px;
}
/* one column on phones - a date picker and a select side by side at 375px is cramped */
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 8px; }
.field.wide { grid-column: 1 / -1; }
.field label {
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
.field input, .field select {
  font-family: var(--body); font-size: 16px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line);
  padding: 14px 15px; border-radius: 0; appearance: none;
  transition: border-color .2s;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.field input:hover, .field select:hover { border-color: color-mix(in srgb, var(--line) 55%, var(--muted)); }
/* Invalid styling is driven by the validator's aria-invalid, NOT by :invalid.
   A required date input is :invalid while empty and can never be :placeholder-shown,
   so an :invalid rule paints the field red before the user has touched it. */
.field [aria-invalid="true"] { border-color: color-mix(in srgb, var(--accent) 55%, var(--bg)); }
.field .err { font-size: 12.5px; color: var(--accent); min-height: 0; }

button[type=submit] {
  grid-column: 1 / -1;
  font-family: var(--body); font-size: 12px; font-weight: 600;
  letter-spacing: .24em; text-transform: uppercase;
  color: var(--bg); background: var(--accent);
  border: 0; padding: 19px; cursor: pointer;
  transition: background .2s;
}
button[type=submit]:hover { filter: brightness(1.09); }

.confirm {
  max-width: 620px; margin: 0 auto; text-align: center;
  border: 1px solid var(--accent); padding: clamp(36px, 6vw, 64px);
}
.confirm h3 {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(28px, 3.6vw, 42px); margin: 0 0 14px;
}
.confirm p { color: var(--muted); margin: 0; }
.confirm .detail { color: var(--text); margin-top: 18px; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- footer ---------- */
footer {
  padding: 60px var(--gutter);
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 16px 40px; align-items: center;
  font-size: 12.5px; color: var(--muted);
}
footer .wordmark {
  font-family: var(--display); letter-spacing: .3em;
  text-transform: uppercase; color: var(--text);
}
/* .credit takes the right edge; .fine now sits with the address on the left. */
footer .credit { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; }
footer .credit .sep { opacity: .45; }
footer .credit a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding-bottom: 1px;
  transition: color .18s ease, border-color .18s ease;
}
footer .credit a:hover,
footer .credit a:focus-visible { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- reduced motion ----------
   The engine already pins each scrub to a single poster frame. Here we drop the
   sticky travel so the page reads as a normal document, and reveal the copy that
   the scroll would otherwise have faded in. */
@media (prefers-reduced-motion: reduce) {
  .cinematic { height: auto; }
  .cinematic .sticky { position: relative; height: auto; }
  .cinematic canvas { height: auto; aspect-ratio: 16 / 9; }
  .overlay {
    position: relative;
    inset: auto;
    padding: 48px var(--gutter) 8px;
    display: flex; flex-direction: column; gap: 12px; align-items: center;
  }
  .line {
    position: relative; left: auto; top: auto;
    transform: none;
    opacity: 1 !important;
    width: 100%;
    font-size: clamp(28px, 4.2vw, 52px);
  }
  .scroll-hint, .progress { display: none; }
}
