/* ============================================================
   GENERATED tokens — Local Arch brand, derived by scripts/brand.py
   from the user's palette: P #CA9C68 (Amber Autumn, the paper),
   D #13191F (River Styx, the ink). All maths in OKLCH.
   ============================================================ */
:root {
  --paper: #ca9c68;
  --paper-2: #c0935f;
  --ink: #050a0f;
  --ink-2: #010305;
  --accent: #004ba8;
  --accent-light: #2caaff;
  --warm: #b56300;
  --line: rgba(19, 25, 31, 0.16);
  --line-dark: rgba(44, 170, 255, 0.14);
  --font-display: "Urbanist", system-ui, sans-serif;
  --font-body: "Urbanist", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
}

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

html { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100%;
}

img, video { max-width: 100%; display: block; }

/* Dormant mounts. A class, never the [hidden] attribute: any layout class
   (display:flex) outranks the UA's [hidden] rule and the mount leaks. */
.mount { display: none !important; }

/* ---------- fixed furniture ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 60; pointer-events: none;
}
.progress-fill {
  display: block; height: 100%; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: 0 50%;
}

header.site {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.4rem 2.2rem;
  mix-blend-mode: difference; color: #fff;
  visibility: hidden; opacity: 0;   /* hidden until the hero lands */
}
header.site a {
  color: #fff; text-decoration: none; letter-spacing: 0.08em;
  /* Safari: difference blending fails over video; the shadow saves the text */
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}
header.site a:focus-visible,
.city-btn:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }

.grain {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  mix-blend-mode: multiply; opacity: 0.05;
  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.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- the story: one pinned stage ---------- */
section.story { position: relative; height: 100vh; overflow: hidden; }
.story video, .story img.drawing, .story img.built {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.story video, .story img.built { opacity: 0; }
.story video.intro { opacity: 1; }   /* the loader film plays in the open */

/* the technical-label register: DM Mono, everywhere a drafting hand would write */
.anno, .kicker, .cue, .fig, .day-label, .phase, .loader-file,
.number .l, header.site a {
  font-family: var(--font-mono);
}

.anno {
  position: absolute; font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink); opacity: 0;
}

/* the user's drawing is white-on-navy, so the hero writes in pale ink on it:
   headline in brand paper (4.26:1 on the measured mean, large text), the
   small lines in white (10.56:1). numbers from scripts, see BUILD-LOG. */
.story.on-dark { color: rgba(255, 255, 255, 0.92); }
.story.on-dark .headline { color: var(--paper); text-shadow: 0 2px 24px rgba(4, 12, 28, 0.55); }
/* white fought the drawing's own white line work — the small hero lines
   are pale amber (9.8:1 on the navy field) inside a navy halo that keeps
   them legible where the drawing's lines run underneath */
.story.on-dark .kicker, .story.on-dark .sub, .story.on-dark .cue,
.story.on-dark .anno {
  color: #f9cfa2;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(4, 12, 28, 0.9), 0 0 14px rgba(4, 12, 28, 0.85),
               0 0 30px rgba(4, 12, 28, 0.6);
}
.anno-1 { top: 7vh; left: 4vw; }
.anno-2 { top: 7vh; right: 4vw; text-align: right; }
.anno-3 { bottom: 7vh; left: 4vw; }
.anno-4 { bottom: 7vh; right: 4vw; text-align: right; }

.prop { position: absolute; width: 9vw; min-width: 90px; opacity: 0; will-change: transform; }
.prop-1 { top: 12vh; left: 7vw; }
.prop-2 { top: 16vh; right: 9vw; }
.prop-3 { bottom: 14vh; left: 11vw; }
.prop-4 { bottom: 10vh; right: 6vw; }

.hero {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 6vw; pointer-events: none;
}
.kicker {
  font-size: 0.8rem; letter-spacing: 0.22em; text-transform: uppercase;
  margin-bottom: 1.2rem; opacity: 0;
}
.headline {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em;
  text-transform: uppercase;
  font-size: clamp(2.4rem, 7.5vw, 6.5rem); line-height: 1.02;
  max-width: 14ch;
}
.headline .w { display: inline-block; overflow: hidden; vertical-align: bottom; }
.headline .w > span { display: inline-block; transform: translateY(112%); }
.sub { margin-top: 1.4rem; max-width: 42ch; font-size: 1.05rem; opacity: 0; }
.cue {
  position: absolute; bottom: 5vh; left: 50%; transform: translateX(-50%);
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0;
}

.caption {
  position: absolute; left: 6vw; bottom: 14vh; z-index: 6;
  font-family: var(--font-display); font-size: clamp(1.2rem, 2.6vw, 2rem);
  max-width: 24ch; color: #fff; opacity: 0;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
}

.day, .phase {
  position: absolute; z-index: 6; color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}
.day { right: 5vw; bottom: 8vh; text-align: right; }
.day-n { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 4rem); display: block; }
.day-label { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; }
.phase {
  left: 5vw; top: 10vh; font-size: 0.72rem; letter-spacing: 0.18em;
  text-transform: uppercase; padding: 0.45rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 999px;
}

.loader {
  position: absolute; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: 7vh; color: #fff; pointer-events: none;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}
.loader-pct { font-family: var(--font-display); font-size: 2rem; }
.loader-bar {
  width: min(320px, 60vw); height: 2px; margin: 0.8rem 0 0.5rem;
  background: rgba(255, 255, 255, 0.25);
}
.loader-bar-fill {
  display: block; height: 100%; width: 100%;
  background: #fff; transform: scaleX(0); transform-origin: 0 50%;
}
.loader-file { font-size: 0.7rem; letter-spacing: 0.12em; opacity: 0.8; }

/* ---------- the diptych: the second pinned stage, UNDER the story ---------- */
section.diptych {
  position: relative; height: 100vh; overflow: hidden;
  margin-top: -100vh; z-index: 0; background: var(--paper);
}
section.story { z-index: 1; }
.diptych img.finished {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.cutout-wrap {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
}
.cutout-wrap img { will-change: transform; }
.ink-panel {
  position: absolute; top: 0; bottom: 0; left: 0; width: 50%;
  background: var(--ink-2); z-index: 2;
  display: flex; align-items: center; justify-content: center;
  transform: translateX(-101%);
}
.ink-panel img {
  opacity: 0; will-change: transform;
  /* the twin is navy-on-transparent; inverted it reads pale on the dark
     panel — measured 10.79:1 against --ink-2 (gate 3:1, see BUILD-LOG) */
  filter: invert(1);
}
.midline {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 1px;
  background: var(--line); z-index: 4; transform: scaleY(0); transform-origin: 50% 0;
}
.fig {
  position: absolute; bottom: 5vh; z-index: 5;
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0;
}
.fig-a { left: 25%; transform: translateX(-50%); color: var(--accent-light); }
.fig-b { left: 75%; transform: translateX(-50%); color: var(--ink); }

.belt {
  position: absolute; top: 0; width: 50%; z-index: 6;
  will-change: transform;
}
.belt-l { left: 0; }
.belt-r { left: 50%; }
.belt-cell {
  height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 0 8%;
  text-align: center;
}
/* each cell is a whole pair: one headline size, one subtext size, and the
   headline's colour answers its background — paper on the dark half, ink
   on the gold half. subtext keeps its own colour on each side (measured:
   #2caaff on the panel 8.17:1 · #003175 on the paper 4.99:1). */
.belt-cell h3 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.8rem); line-height: 1.12;
}
.belt-cell p {
  margin-top: 1.1rem; max-width: 34ch;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
}
.belt-l .belt-cell h3 { color: var(--paper); }
.belt-l .belt-cell p  { color: #2caaff; }
.belt-r .belt-cell h3 { color: var(--ink); }
.belt-r .belt-cell p  { color: #003175; }

/* ---------- mobile pairs (CSS swap, no JS branch) ---------- */
section.pairs-mobile { display: none !important; }

/* ---------- craft rows ---------- */
section.craft { position: relative; padding: 16vh 6vw; background: var(--paper); }
.craft-row {
  position: relative; overflow: hidden;
  display: flex; align-items: baseline; justify-content: space-between; gap: 2rem;
  padding: 2.6rem 2rem; border-top: 1px solid var(--line);
  cursor: default;
}
.craft-row:last-child { border-bottom: 1px solid var(--line); }
.craft-row .row-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 0.35s ease;
  pointer-events: none; z-index: 0;
  /* the duotone: land every photograph in the accent's blueprint hue, dark
     enough that paper text clears 4.5:1 (brightness term measured — see
     BUILD-LOG contrast check) */
  filter: grayscale(1) sepia(1) saturate(2.2) hue-rotate(208deg) brightness(0.235);
}
.craft-row > h3, .craft-row > p {
  position: relative; z-index: 1;
  transition: color 0.35s ease;
}
.craft-row h3 { font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2.4rem); }
.craft-row.is-hot .row-photo { opacity: 1; }
.craft-row.is-hot > h3, .craft-row.is-hot > p { color: var(--paper); }

.numbers {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem;
  margin-top: 12vh;
}
.number { text-align: center; }
.number .n { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 4rem); display: block; }
.number .l { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; }

/* ---------- the window ---------- */
section.life { position: relative; padding: 0; }
.life-window {
  width: 100vw; max-width: none; margin: 0;  /* full width means FULL width */
  height: 80vh; overflow: hidden; position: relative;
  /* the hole in the page is the silhouette of THEIR house, traced from
     cutout.png's alpha by scripts (48 columns, top+bottom edges) */
  clip-path: polygon(0.0% 12.1%, 2.1% 12.1%, 23.4% 12.1%, 25.5% 6.9%, 68.0% 7.0%, 70.2% 0.0%, 72.3% 0.0%, 74.5% 6.9%, 76.6% 6.9%, 78.7% 12.0%, 97.9% 12.0%, 100.0% 12.1%, 97.9% 48.9%, 95.7% 81.9%, 74.5% 81.9%, 72.3% 82.4%, 66.0% 82.2%, 63.8% 99.9%, 36.1% 100.0%, 34.0% 82.2%, 31.9% 81.9%, 6.4% 81.9%, 4.2% 49.7%, 2.1% 48.8%, 0.0% 12.3%);
}
.life-photo {
  position: absolute; left: 0; top: 0; width: 100%;
  object-fit: cover;   /* FAMILY_OVER sets the height; cover keeps proportion */
  will-change: transform;
}

/* ---------- the cursor city ---------- */
section.city { position: relative; height: 100vh; overflow: hidden; background: var(--ink-2); }
.city-stage, .city-stage img, .city-stage video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.city-front {
  z-index: 2;
  /* the homes rise INSIDE their own shapes: the mask alone does the work.
     no wipe, ever — an inset() following the cursor draws a hard line. */
  -webkit-mask-image: url("assets/city-mask.png");
  mask-image: url("assets/city-mask.png");
  -webkit-mask-size: cover; mask-size: cover;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.city-copy {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2rem; text-align: center; padding: 0 6vw;
  pointer-events: none;
}
.city-title {
  font-family: var(--font-display); color: var(--paper);
  text-transform: uppercase;
  font-size: clamp(2rem, 6vw, 5rem); line-height: 1.05;
  text-shadow: 0 0 34px rgba(255, 255, 255, 0.25), 0 1px 12px rgba(0, 0, 0, 0.35);
}
.city-btn {
  pointer-events: auto;
  padding: 1rem 2.6rem; border-radius: 999px; text-decoration: none;
  background: var(--paper); color: var(--ink); letter-spacing: 0.06em;
}

/* ---------- responsive ---------- */
@media (max-width: 780px) {
  .numbers { grid-template-columns: repeat(2, 1fr); }
  .prop { width: 16vw; min-width: 70px; }

  /* the belts cannot hold a readable line below DESKTOP_MIN: CSS swaps
     them for stacked pair-cards, no JavaScript branch needed */
  section.diptych .belt { display: none; }
  section.pairs-mobile.live { display: block !important; padding: 12vh 6vw; }
  .pair-card {
    border: 1px solid var(--line); border-radius: 6px;
    padding: 2rem; margin-bottom: 1.4rem;
  }
  .pair-card h3 { font-family: var(--font-display); font-size: 1.3rem; }
  .pair-card p { margin-top: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .headline .w > span { transform: none; }
  .kicker, .sub, .anno, .cue { opacity: 1; }
}
