/*
 * site.css
 *
 * Single-theme, deliberately. This is a warm room at 7am rendered by a
 * physically-motivated light rig; a light mode would mean relighting the whole
 * scene, not swapping a palette. So every colour is stated explicitly and
 * nothing is inherited from the host.
 */

:root {
  --ink:        #141110;   /* matches the canvas clear colour */
  --ink-deep:   #0d0b0a;
  --paper:      #f6efe6;
  --muted:      #b3a294;
  --faint:      #7d6d61;
  --amber:      #f5af2d;
  --ember:      #d4622a;
  --sage:       #8ea86a;
  --line:       rgba(214, 190, 166, 0.16);

  --display: "Fraunces", "Hoefler Text", Georgia, serif;
  --sans: "Work Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Roboto Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --measure: 32rem;
}

*, *::before, *::after { box-sizing: border-box; }

/* The UA rule is `[hidden] { display: none }`, a plain attribute selector that
   any class setting `display` outranks. Without this, hiding an element in JS
   silently does nothing. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--amber); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--paper); }

:where(a, button):focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: fixed;
  top: 0.75rem; left: 0.75rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--paper);
  color: var(--ink);
  font: 500 0.8rem/1 var(--mono);
  border-radius: 3px;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}
.skip:focus { transform: none; }

/* ------------------------------------------------------------- the scene */

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

/* Film grain. A clean render of a smooth surface bands visibly in its
   gradients; a static noise overlay breaks it up for far less than dithering
   in the shader would cost, and it suits the room. */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Legibility scrim behind the copy column. The food is lit and bright; white
   text over the highlight on a bun is genuinely hard to read. Darkening one
   side costs nothing and leaves the dish untouched. */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    rgba(20, 17, 16, 0.90) 0%,
    rgba(20, 17, 16, 0.72) 22%,
    rgba(20, 17, 16, 0.24) 46%,
    rgba(20, 17, 16, 0) 64%
  );
}

.track { height: 820vh; position: relative; z-index: 3; pointer-events: none; }

/* -------------------------------------------------------------- masthead */

.masthead {
  position: fixed;
  z-index: 6;
  top: clamp(1.5rem, 4vh, 2.75rem);
  left: var(--gutter);
  will-change: opacity, transform;
}

.wordmark {
  margin: 0;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--paper);
}
.tagline {
  margin: 0.35rem 0 0;
  font: 400 0.68rem/1.4 var(--mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--faint);
}

/* -------------------------------------------------------------- chapters */

.stage { position: fixed; inset: 0; z-index: 5; pointer-events: none; }

.chapter {
  position: absolute;
  left: var(--gutter);
  top: 50%;
  width: min(var(--measure), calc(100vw - 2 * var(--gutter)));
  /* Two custom properties composed into one transform, so the scroll rig can
     drive the drift without ever clobbering the centring translate. */
  transform: translateY(calc(-50% + var(--shift, 0px)));
  opacity: 0;
  filter: blur(var(--blur, 0px));
  will-change: opacity, transform, filter;
}

.eyebrow {
  margin: 0 0 1rem;
  font: 400 0.68rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}

.chapter h2 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -0.018em;
  white-space: pre-line;   /* the copy carries its own line breaks */
}

.chapter p:not(.eyebrow) {
  margin: 0;
  max-width: 27rem;
  color: #ddd0c2;
}

/* -------------------------------------------------------------- callouts */

/* A label with a rule running out toward the layer it names. Positioned on the
   right, opposite the copy column, so the two never collide. */
.callout {
  position: fixed;
  z-index: 6;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}
.callout-rule {
  display: block;
  width: clamp(2rem, 7vw, 5rem);
  height: 1px;
  background: linear-gradient(to left, var(--amber), transparent);
}
.callout-body { text-align: right; }
.callout-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.1rem, 2.1vw, 1.45rem);
  line-height: 1.15;
  color: var(--paper);
}
.callout-note {
  margin: 0.25rem 0 0;
  max-width: 15rem;
  font-size: 0.83rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ------------------------------------------------------------- price tag */

.tag {
  position: fixed;
  z-index: 6;
  right: var(--gutter);
  bottom: clamp(1.5rem, 5vh, 3rem);
  text-align: right;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}
.tag-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.2;
}
.tag-blurb {
  margin: 0.25rem 0 0;
  max-width: 17rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}
.tag-price {
  margin: 0.5rem 0 0;
  font: 400 0.78rem/1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--amber);
}

/* ------------------------------------------------------------------ rail */

.rail {
  position: fixed;
  z-index: 6;
  left: var(--gutter);
  bottom: clamp(1.5rem, 5vh, 3rem);
  width: clamp(4rem, 9vw, 7rem);
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  transition: opacity 200ms ease;
}
.rail-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(to right, var(--ember), var(--amber));
  border-radius: 2px;
}

/* ---------------------------------------------------------------- reader */

.reader {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.reader.shown {
  position: relative;
  z-index: 7;
  width: auto; height: auto;
  margin: 0 auto;
  padding: clamp(3rem, 9vh, 6rem) var(--gutter) 0;
  max-width: 42rem;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
}
.reader.shown .reader-heading {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.1;
  margin: 0 0 2.5rem;
}
.reader.shown section { margin: 0 0 2.8rem; }
.reader.shown h2 {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.55rem, 3.2vw, 2.1rem);
  line-height: 1.12;
  white-space: pre-line;
}
.reader.shown h3 {
  margin: 1.4rem 0 0.3rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
}
.reader.shown p { margin: 0; color: #ddd0c2; }
.reader.shown ul { margin: 0.6rem 0 0; padding-left: 1.1rem; color: #ddd0c2; }
.reader.shown li { margin: 0.35rem 0; }

.fallback { position: relative; z-index: 7; padding: var(--gutter) var(--gutter) 0; }
.fallback-note {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--amber);
  border-radius: 3px;
  font: 400 0.85rem/1.5 var(--mono);
  color: var(--muted);
}

/* The degraded layout, as one class rather than JS writing inline styles onto
   six elements — which is how the overlays get forgotten and end up painting
   over the readable page. */
body.no-gl .grain,
body.no-gl .scrim,
body.no-gl .callout,
body.no-gl .tag { display: none; }

body.no-gl .masthead {
  position: static;
  padding: clamp(2.5rem, 8vh, 4rem) var(--gutter) 0;
  max-width: 42rem;
  margin: 0 auto;
  opacity: 1 !important;
  transform: none !important;
}

/* ----------------------------------------------------------------- outro */

.outro {
  position: relative;
  z-index: 7;
  background: linear-gradient(to bottom, rgba(20, 17, 16, 0) 0%, var(--ink) 18%, var(--ink-deep) 100%);
  padding: 24vh var(--gutter) clamp(4rem, 10vh, 7rem);
}
.outro-inner { max-width: 46rem; margin: 0 auto; }
.outro h2 {
  margin: 0 0 2.5rem;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(2.2rem, 5.2vw, 3.4rem);
  line-height: 1.04;
}

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cols h3 {
  margin: 0 0 0.6rem;
  font: 400 0.68rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}
.cols p { margin: 0; color: #ddd0c2; }

.colophon { margin-top: 3.5rem; }
.colophon > p:not(.eyebrow) { margin: 0 0 2rem; color: var(--muted); font-size: 0.94rem; }

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1.5rem 2rem;
  margin: 0 0 2.4rem;
}
.specs b {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  line-height: 1;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}
.specs span {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

.links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 2.4rem; }
.btn {
  display: inline-block;
  padding: 0.72rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  font: 500 0.82rem/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--paper);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}
.btn:hover { border-color: var(--amber); color: var(--amber); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn.primary:hover { background: var(--paper); border-color: var(--paper); }

.sig { margin: 0; font: 400 0.78rem/1.7 var(--mono); color: var(--faint); }

/* ---------------------------------------------------------------- mobile */

@media (max-width: 820px) {
  /* The copy sits low on a narrow screen, so the scrim has to follow it. */
  .scrim {
    background: linear-gradient(
      to top,
      rgba(20, 17, 16, 0.94) 0%,
      rgba(20, 17, 16, 0.82) 26%,
      rgba(20, 17, 16, 0.30) 50%,
      rgba(20, 17, 16, 0) 72%
    );
  }
  .chapter {
    top: auto;
    bottom: 14vh;
    transform: translateY(var(--shift, 0px));
  }
  /* The callout and the price tag both want the bottom-right corner, and on a
     phone there is only one of those. The callout wins during the build; the
     tag is simply not shown at all rather than fought over. */
  .callout {
    right: auto;
    left: var(--gutter);
    top: auto;
    bottom: 6vh;
    transform: none;
    flex-direction: row-reverse;
  }
  .callout-body { text-align: left; }
  .callout-rule { background: linear-gradient(to right, var(--amber), transparent); }
  .tag { display: none; }
  .rail { bottom: 2vh; }
}

@media (max-height: 560px) {
  .tagline { display: none; }
}

/* -------------------------------------------------------- reduced motion */

/* The sequence stays: it is driven by the reader's own scrolling, and removing
   it would leave a still image and no way to see the page. What goes is
   everything that moves on its own — the steam and the shader time, handled in
   JS — plus the scroll smoothing and the chapter blur. */
@media (prefers-reduced-motion: reduce) {
  .chapter { filter: none !important; }
  * { scroll-behavior: auto !important; transition: none !important; }
}
