/* The homepage: one scene, an acequia valley, scrolled through. */

:root {
  --paper: #f4f0e6;
  --ink: #1b1915;
  --ink-2: #4d483e;
  --ink-3: #655f53;
  --rust: #c0532a;
  --rust-ink: #9a4526;
  --auto: #3d6b5a;
  --stall: #94640f;
  --display: 'Newsreader', Georgia, serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --g: clamp(1rem, 4vw, 2.75rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; border-radius: 6px; }
a { color: inherit; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* film: vignette, grain, letterbox bars for the moving shots */
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(40, 24, 14, 0.28) 100%); }
#grain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; opacity: 0.09; mix-blend-mode: overlay; }
/* a soft wash on the left so the words always sit on calm ground */
.vignette::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(244, 236, 224, 0.62), rgba(244, 236, 224, 0.2) 36%, transparent 50%); }
@media (max-width: 44rem) { .vignette::after { display: none; } }
.bars { position: fixed; inset: 0; z-index: 4; pointer-events: none; --bar: 0px; }
.bars i { position: absolute; left: 0; right: 0; height: var(--bar); background: #120d09; }
.bars i:first-child { top: 0; }
.bars i:last-child { bottom: 0; }
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
.lbl {
  position: absolute; transform: translate(-50%, -100%); white-space: nowrap;
  font: 500 0.72rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
  background: rgba(251, 249, 243, 0.86); border: 1px solid rgba(27, 25, 21, 0.12);
  padding: 0.25rem 0.5rem; border-radius: 999px; transition: opacity 0.4s ease;
  display: flex; align-items: center; gap: 0.4rem;
}
.lbl.you { background: var(--rust); color: #fff; border-color: transparent; font-size: 0.8rem; }
.lbl b { font-weight: 500; }
.lbl b:empty { display: none; }

.top {
  position: fixed; z-index: 20; transition: color 0.6s ease, background-color 0.4s ease; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: max(0.9rem, env(safe-area-inset-top)) var(--g) 0.9rem;
}
.mark { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; font-family: var(--display); font-size: 1.2rem; font-weight: 500; }
.mark svg { width: 26px; height: 26px; }
.top-cta {
  font: 500 0.92rem var(--body); color: var(--paper); background: var(--ink); text-decoration: none;
  border-radius: 999px; padding: 0.62rem 1.1rem;
}

.dots { position: fixed; z-index: 3; right: var(--g); top: 50%; transform: translateY(-50%); list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.dots li { width: 8px; height: 8px; border-radius: 50%; background: rgba(27, 25, 21, 0.2); transition: background 0.3s ease, transform 0.3s ease; }
.dots li.on { background: var(--rust); transform: scale(1.4); }

main { position: relative; z-index: 5; pointer-events: none; }
.step { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 6rem var(--g) 3rem; }
.card {
  pointer-events: auto; width: min(30rem, 100%);
  background: rgba(251, 249, 243, 0.86); backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(27, 25, 21, 0.1); border-radius: 18px;
  padding: clamp(1.25rem, 3vw, 2rem); box-shadow: 0 20px 60px rgba(43, 31, 24, 0.12);
}
.card.hero { background: none; border: 0; box-shadow: none; backdrop-filter: none; padding: 0; width: min(36rem, 100%); }
.kicker { font: 500 0.72rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--rust-ink); margin: 0 0 0.8rem; }
h1 { font-family: var(--display); font-weight: 400; letter-spacing: -0.03em; font-size: clamp(3rem, 7vw, 6rem); line-height: 0.98; margin: 0 0 1.1rem; max-width: 10ch; }
h2 { font-family: var(--display); font-weight: 400; letter-spacing: -0.02em; font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.1; margin: 0 0 0.8rem; }
.card p { color: var(--ink-2); margin: 0 0 1rem; }
.card p:last-child { margin-bottom: 0; }
.hero p:not(.kicker):not(.scroll) { font-size: clamp(1.1rem, 1.6vw, 1.3rem); max-width: 26rem; }
.scroll { font: 500 0.72rem var(--mono) !important; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3) !important; margin-top: 2.5rem !important; }
.scroll::after { content: ' ↓'; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 1rem var(--body); color: var(--paper); background: var(--ink); text-decoration: none;
  border: 0; border-radius: 999px; padding: 0.95rem 1.6rem; min-height: 50px; cursor: pointer;
}
.btn:disabled { opacity: 0.6; }
.btn.wide { width: 100%; margin-top: 0.6rem; }

.key { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem 1rem; }
.key li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; color: var(--ink-2); }
[data-tag]::before { content: ''; width: 12px; height: 12px; flex: none; box-sizing: border-box; display: inline-block; }
[data-tag='AUTO']::before { border: 2.5px solid var(--auto); border-radius: 50%; }
[data-tag='MANUAL']::before { background: var(--ink); border-radius: 50%; }
[data-tag='STALL']::before { background: var(--stall); border-radius: 2px; }
[data-tag='RISK']::before { background: var(--rust); transform: rotate(45deg) scale(0.88); }
.lbl b[data-tag]::before { width: 9px; height: 9px; }

.step-book { justify-content: flex-start; }
.card-form { width: min(32rem, 100%); }
form label { display: block; font-size: 0.88rem; font-weight: 500; margin: 0.8rem 0 0.3rem; }
input, select, textarea {
  width: 100%; font: 400 1rem/1.5 var(--body); color: var(--ink); background: #fff;
  border: 1px solid rgba(27, 25, 21, 0.45); border-radius: 10px; padding: 0.7rem 0.9rem; min-height: 48px;
}
select { appearance: none; -webkit-appearance: none; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rust); box-shadow: 0 0 0 3px rgba(192, 83, 42, 0.2); }
.two { display: grid; gap: 0 0.9rem; }
@media (min-width: 30rem) { .two { grid-template-columns: 1fr 1fr; } }
.muted { color: var(--ink-3); font-weight: 400; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.status { min-height: 1.4em; font-size: 0.92rem; margin: 0.7rem 0 0 !important; }
.status[data-state='error'] { color: var(--rust-ink); }

@media (max-width: 44rem) {
  .step { align-items: flex-end; padding: 5rem var(--g) 1.5rem; }
  .card.hero { background: linear-gradient(transparent, rgba(244, 240, 230, 0.94) 25%); margin: 0 calc(-1 * var(--g)) -1.5rem; padding: 3rem var(--g) 1.5rem; width: auto; }
  .dots { display: none; }
  .lbl { font-size: 0.6rem; padding: 0.15rem 0.4rem; }
  .step-book { align-items: flex-start; padding-top: 4.5rem; }
}

.no-gl #stage { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}

.who { font-size: 0.88rem; color: var(--ink-3) !important; margin-top: 1.1rem !important; }
/* the header turns light once the scene reaches dusk */
.dusk .top .mark, .bars-on .top .mark { color: #f4ece0; }
.bars-on .top-cta { background: #f4ece0; color: #1b1915; }
.dusk .dots li { background: rgba(244, 236, 224, 0.35); }
.dusk .scroll { color: #f4ece0 !important; }
.hero h1, .hero p { text-shadow: 0 0 30px rgba(244, 236, 224, 0.9); }
@media (max-width: 44rem) {
  .card.hero { background: linear-gradient(transparent, rgba(244, 236, 224, 0.92) 25%); }
  .hero h1, .hero p { text-shadow: none; }
}

h1 em { font-style: italic; font-weight: 300; color: var(--rust); }

/* let each card settle where the camera holds */
html { scroll-snap-type: y proximity; }
.step { scroll-snap-align: start; }
.hero p:not(.kicker):not(.scroll) { max-width: 30rem; }

/* ── footer: the credits, over the held dusk frame ───── */
.foot { position: relative; z-index: 5; background: #17130f; color: #e9e1d2; padding: 4rem var(--g) max(2rem, env(safe-area-inset-bottom)); }
.foot-cols { display: grid; gap: 2.5rem; max-width: 72rem; }
@media (min-width: 52rem) { .foot-cols { grid-template-columns: 1.2fr 1fr 0.8fr; } }
.foot .kicker { color: #e3a27c; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.foot a { color: #f6efe2; text-underline-offset: 3px; }
.foot .work li { color: #b9b0a0; font-size: 0.95rem; }
.foot .work a { display: block; font-family: var(--display); font-size: 1.35rem; color: #f6efe2; }
.foot .roster li { font-family: var(--display); font-size: 1.15rem; }
.foot .roster span { display: block; font: 400 0.82rem var(--body); color: #9c9383; }
.legal { margin: 3rem 0 0; font-size: 0.85rem; color: #9c9383; }
.dusk .top-cta { box-shadow: 0 0 0 1px rgba(244, 236, 224, 0.35); }
.past .top { background: #17130f; }
.past .top .mark { color: #f4ece0; }
.past .top-cta { background: #f4ece0; color: #1b1915; box-shadow: none; }
