/* Halfmoon Coffee - test page for Tier 2B cinematic scroll.
   Palette from the footage itself: walnut, wall grey, the oxblood of the leaves.
   Mobile first. */

@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/fraunces-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/fraunces-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #f1f1ef;
  --surface: #ffffff;
  --ink: #1e1714;
  --muted: #564c47;
  --line: #cfcac6;
  --accent: #862232;
  --accent-ink: #ffffff;
  --walnut: #322017;
  --bone: #f7f2ec;
  --focus: #1b5fd6;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 3.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14100e;
    --surface: #1f1916;
    --ink: #f1ece6;
    --muted: #bcb1a9;
    --line: #3d332e;
    --accent: #f1909c;
    --accent-ink: #1e1714;
    --focus: #8fb6ff;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 1rem); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-sans);
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
h1, h2 { font-family: var(--font-display); font-weight: 600; line-height: 1.04; letter-spacing: -0.01em; margin: 0 0 0.6rem; }
h2 { font-size: clamp(1.9rem, 6vw, 3.2rem); }
p { margin: 0 0 1rem; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; transition: text-decoration-thickness 0.15s, color 0.15s; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.cine :focus-visible { outline-color: #ffd36b; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 0.5rem; top: -4rem; z-index: 50; background: var(--surface); color: var(--ink); padding: 0.6rem 1rem; }
.skip-link:focus { top: 0.5rem; }

.wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }

.demo-banner {
  margin: 0;
  padding: 0.45rem 1rem;
  background: #ffd36b;
  color: #1e1714;
  font-size: 0.85rem;
  line-height: 1.35;
  text-align: center;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
  padding-inline: 1rem;
  max-width: 90rem;
  margin-inline: auto;
}
.logo { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; text-decoration: none; margin-right: auto; }
.nav-list { display: none; list-style: none; margin: 0; padding: 0; gap: 1.5rem; }
.nav-list a { text-decoration: none; padding: 0.5rem 0; }
.nav-list a:hover { text-decoration: underline; }
.call-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0 0.95rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.call-btn:hover { box-shadow: 0 4px 14px -6px var(--accent); transform: translateY(-1px); }
.call-btn:active { transform: scale(0.96); }
@media (min-width: 760px) { .nav-list { display: flex; } }
/* the smallest phones: the number stays, the icon goes, so nothing pushes past 320px */
@media (max-width: 359px) {
  .header-inner { gap: 0.5rem; padding-inline: 0.75rem; }
  .logo { font-size: 1.15rem; }
  .call-btn svg { display: none; }
  .call-btn { padding: 0 0.8rem; font-size: 0.95rem; }
}

/* ---------- the cinematic hero ---------- */
.cine h1 {
  font-size: clamp(2.6rem, 12vw, 5.6rem);
  line-height: 0.98;
  margin-bottom: 0.9rem;
}
.cine h1 em { font-style: italic; font-weight: 400; color: #f4b9c2; }
.h1-line { display: block; }
.cine h2 { font-size: clamp(1.8rem, 7vw, 3.4rem); }
.cine .lede { font-size: 1.2rem; }
.open-status { font-weight: 600; }
.open-status[data-state="open"]::before,
.open-status[data-state="closed"]::before {
  content: "";
  display: inline-block;
  width: 0.6em; height: 0.6em;
  margin-right: 0.45em;
  border-radius: 50%;
  vertical-align: 0.05em;
  background: #6fd08c;
}
.open-status[data-state="closed"]::before { background: #c9bdb5; }

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.1rem; margin: 1.1rem 0 0.4rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.4rem;
  border: 0;
  border-radius: 999px;
  font: 650 1.05rem/1 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.cine .btn-primary { background: var(--bone); color: var(--walnut); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(0,0,0,0.6); }
.btn:active { transform: translateY(0) scale(0.97); box-shadow: none; }
.text-link { font-weight: 600; }
.cine .text-link { color: var(--bone); }

.scroll-cue { margin: 0.9rem 0 0; font-size: 0.9rem; color: #e6dbd2; display: flex; align-items: center; gap: 0.6rem; }
.scroll-cue::after {
  content: "";
  width: 2.2rem; height: 1px;
  background: currentColor;
  transform-origin: left;
}

/* the first 3 seconds: the camera settles in and the headline sets itself */
@media (prefers-reduced-motion: no-preference) {
  .cine-frame { animation: settle 2.6s cubic-bezier(.2,.7,.2,1) both; }
  .h1-line { animation: rise 0.9s cubic-bezier(.2,.8,.2,1) both; }
  .h1-line + .h1-line { animation-delay: 0.18s; }
  .scroll-cue::after { animation: cue 1.4s ease-in-out 0.8s 3 both; }
}
@keyframes settle { from { transform: scale(1.09) translateY(1.5%); } to { transform: none; } }
@keyframes rise { from { transform: translateY(0.45em); } to { transform: none; } }
@keyframes cue { 0% { transform: scaleX(0); } 60% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0.4; } }

/* phone: the film stops above a walnut floor; beat 1 sits on that floor at the bottom
   of the first screen, under the banner and header, so the cup stays in view */
.cine { --cine-floor: 24svh; --cine-top: calc(var(--header-h) + 0.75rem); }
.beat-1 { min-height: calc(100svh - var(--header-h) - 3rem); padding-bottom: 1.25rem; }
/* beat 1 starts on the plain floor, so its scrim is invisible there; it only shows once the
   text rides up over the film, which keeps the lede above 4.5:1 in every frame */
.beat-1 .cine-text {
  max-width: none;
  padding: 0.6rem 1rem 0.4rem;
  margin-inline: -1rem;
  border-radius: 0;
  /* full width (no side edges) and a feathered top, so the scrim melts into the film */
  box-shadow:
    0 -2.5rem 2rem -0.5rem color-mix(in srgb, var(--cine-edge, #322017) 84%, transparent),
    0 1.25rem 1rem -0.25rem color-mix(in srgb, var(--cine-edge, #322017) 84%, transparent);
}

/* the brew timer: counts with the pour, sits on its own chip so it reads over any frame.
   Only shown once the film is live (not in the still, not without JavaScript). */
.brew-timer {
  margin: 0.25rem 0 0;
  padding: 0.35rem 0.75rem 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(30, 20, 14, 0.82);
  color: var(--bone);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  display: none;
  align-items: center;
  gap: 0.45rem;
}
.brew-timer [data-brew-time] { font-weight: 700; font-size: 1rem; }
.brew-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #f4b9c2; }
.cine-live .brew-timer { display: inline-flex; }
.beat-1 .lede { margin-bottom: 0.5rem; }
.scroll-cue { display: none; }
@media (min-width: 900px) {
  .scroll-cue { display: flex; }
  .beat-1 { min-height: calc(100svh - var(--header-h) - 2rem); }
  .beat-1 .cine-text { margin-inline: 0; padding: 0; }
  .cine h1 { font-size: clamp(4.2rem, 8.2vw, 8.6rem); letter-spacing: -0.025em; }
  .brew-timer { font-size: 0.95rem; }
}

/* ---------- sections ---------- */
.section { padding: clamp(3.5rem, 10vw, 7rem) 0; }
.note { color: var(--muted); font-size: 0.95rem; }

/* menu: the walnut runs on from the film, then the page turns light */
.menu { background: var(--walnut); color: var(--bone); }
.menu .note { color: #d9ccc2; }
.menu-grid { display: grid; gap: 1.5rem; }
.menu-list { list-style: none; margin: 0; padding: 0; font-size: 1.15rem; }
.menu-list li { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.75rem 0; border-bottom: 1px solid rgba(247,242,236,0.18); }
.menu-list .item { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; }
.menu-list .dots { flex: 1; border-bottom: 1px dotted rgba(247,242,236,0.35); transform: translateY(-0.3em); }
.menu-list .price { font-variant-numeric: tabular-nums; font-weight: 600; }
@media (min-width: 900px) { .menu-grid { grid-template-columns: 1fr 1.4fr; gap: 4rem; } }

/* hours */
.hours-grid { display: grid; gap: 1.5rem; }
.hours-table { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
.hours-table th, .hours-table td { text-align: left; padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--line); }
.hours-table td { text-align: right; font-variant-numeric: tabular-nums; }
.hours-table tr.is-today { background: linear-gradient(to right, color-mix(in srgb, var(--accent) 14%, transparent), transparent); font-weight: 650; }
.hours-table tr.is-today th::after { content: " (today)"; font-weight: 400; color: var(--muted); }
.open-status--page { font-size: 1.25rem; }
.open-status--page[data-state]::before { background: #1f8a46; }
.open-status--page[data-state="closed"]::before { background: var(--muted); }
@media (min-width: 900px) { .hours-grid { grid-template-columns: 1fr 1.4fr; gap: 4rem; } }

/* area */
.area { background: var(--surface); }
.area-lede { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.4rem, 4.6vw, 2.4rem); line-height: 1.25; max-width: 30ch; }
.area-lede strong { color: var(--accent); font-weight: 600; }

/* reviews: one big quote leads, two smaller follow */
.quotes { display: grid; gap: 2rem; margin-top: 2rem; }
.quote { margin: 0; }
.quote blockquote { margin: 0 0 0.6rem; }
.quote p { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 1.3rem; line-height: 1.35; margin: 0; }
.quote--lead p { font-size: clamp(1.7rem, 5.4vw, 2.7rem); line-height: 1.18; }
.quote figcaption { color: var(--muted); font-size: 0.95rem; }
@media (min-width: 900px) {
  .quotes { grid-template-columns: 1fr 1fr; column-gap: 4rem; }
  .quote--lead { grid-column: 1 / -1; max-width: 26ch; }
}

/* order form */
.order { background: var(--surface); border-top: 1px solid var(--line); }
.order-grid { display: grid; gap: 1.5rem; }
.order-form { display: grid; gap: 1rem; max-width: 34rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid #8a807b;
  border-radius: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }
.field [aria-invalid="true"] { border-color: #b3261e; }
.field [data-valid="true"] { border-color: #1f8a46; }
.field-msg { min-height: 1.3em; margin: 0.3rem 0 0; font-size: 0.92rem; color: #b3261e; }
@media (prefers-color-scheme: dark) {
  .field [aria-invalid="true"] { border-color: #ff8a80; }
  .field-msg { color: #ff8a80; }
  .field [data-valid="true"] { border-color: #6fd08c; }
}
.order-form .btn { justify-self: start; }
.form-done { padding: 1rem; border-left: 3px solid var(--accent); background: var(--bg); }
@media (min-width: 900px) { .order-grid { grid-template-columns: 1fr 1.4fr; gap: 4rem; } }

/* footer */
.site-footer { background: var(--walnut); color: var(--bone); padding: 2.5rem 0 3rem; font-size: 0.95rem; }
.footer-grid { display: grid; gap: 1rem; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* scroll scenes, CSS only, only where the browser supports scroll timelines.
   Menu lines step in one after another; today's opening hours line sweeps in. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .menu-list li {
      animation: step-in linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 30%;
    }
    .hours-table tr.is-today {
      background-size: 100% 100%;
      animation: sweep linear both;
      animation-timeline: view();
      animation-range: entry 20% cover 40%;
    }
  }
}
/* transform only: the text keeps full contrast in every frame */
@keyframes step-in { from { transform: translateX(-1.5rem); } to { transform: none; } }
@keyframes sweep { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }
.hours-table tr.is-today { background-repeat: no-repeat; }

.section, .site-footer { content-visibility: auto; contain-intrinsic-size: auto 600px; }
