/* ============================================================================
   Ducey Renos. Black, bone and construction orange. Anton echoes the wordmark;
   Archivo carries everything a person has to read. One radius (4px), one
   accent, and the chalk line as the recurring brand detail.
   ========================================================================== */

@font-face {
  font-family: "Anton";
  src: url("../fonts/anton-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --sc-canvas:     #111110;
  --sc-surface:    #1c1b19;
  --sc-ink:        #f4f1ec;
  --sc-ink-soft:   #ada69b;
  --sc-accent:     #f2690d;
  --sc-accent-ink: #111110;
  --sc-font-display: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  --sc-font-text:    "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sc-shadow-color: 30 12% 3%;

  --hush:        #0b0b0a;   /* the quiet act before the peak */
  --paper:       #eeeae2;   /* work-order paper */
  --paper-2:     #f8f6f1;
  --paper-ink:   #171614;
  --paper-soft:  #5a554d;
  --accent-deep: #a84a08;   /* the accent's light-ground stop: text + focus on paper */
  --accent-hot:  #ff7d26;
  --danger:      #b42318;

  --r: 4px;
  --bar-h: 72px;
  --dock-h: 0px;
  --gutter: clamp(1.25rem, 4.6vw, 5rem);
}
@media (max-width: 899px) {
  :root { --bar-h: 60px; --dock-h: 76px; }
}

/* The engine writes --sc-p on every act, every frame. As a plain custom
   property it inherits, so each new value restyles every element in the act,
   and the build and the work rail are big. Registered as a number that does
   not inherit, it restyles the act alone; the one rule that reads it lower
   down (.fear) passes it on itself. */
@property --sc-p { syntax: "<number>"; inherits: false; initial-value: 0; }

html { scroll-padding-top: var(--bar-h); }
body {
  font-stretch: 100%;
  letter-spacing: 0;
  padding-bottom: var(--dock-h);
}
:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 3px; border-radius: var(--r); }
a { text-decoration-color: color-mix(in oklab, currentColor 45%, transparent); }
a:hover { text-decoration-color: var(--sc-accent); }

.ico {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: square; stroke-linejoin: miter;
}

/* condensed label voice, borrowed from the wordmark */
.label, .starter__q, .build__eyebrow, .order__count, .quote__who, .sheet__title {
  font-family: var(--sc-font-text);
  font-stretch: 72%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  line-height: 1.2;
}

.display {
  font-family: var(--sc-font-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: 0.002em;
  text-wrap: balance;
  margin: 0;
}

.skip {
  position: fixed; left: var(--gutter); top: 0.75rem; z-index: 200;
  padding: 0.75rem 1rem; background: var(--sc-accent); color: var(--sc-accent-ink);
  font-weight: 700; border-radius: var(--r); text-decoration: none;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

/* ---------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 48px; padding: 0 1.25rem;
  border: 1.5px solid transparent; border-radius: var(--r);
  font: 700 1rem/1 var(--sc-font-text); letter-spacing: 0.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 140ms var(--sc-ease-out), border-color 140ms var(--sc-ease-out),
              color 140ms var(--sc-ease-out), transform 120ms var(--sc-ease-out);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { cursor: progress; opacity: 0.7; }
.btn--accent { background: var(--sc-accent); color: var(--sc-accent-ink); }
.btn--accent:hover { background: var(--accent-hot); }
.btn--ghost { color: inherit; border-color: color-mix(in oklab, currentColor 34%, transparent); background: transparent; }
.btn--ghost:hover { border-color: var(--sc-accent); }
.btn--block { width: 100%; min-height: 54px; font-size: 1.05rem; }
.btn .ico { width: 1.15em; height: 1.15em; }

/* ------------------------------------------------------------------- bar -- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-inline: var(--gutter);
  background: var(--sc-canvas);
  border-bottom: 1px solid var(--sc-hairline);
}
.bar__logo img { height: 30px; width: auto; }
.bar__actions { display: flex; align-items: center; gap: 1.5rem; }
.bar__phone {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--sc-ink); font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums;
}
.bar__phone .ico { color: var(--sc-accent); }
.bar__phone:hover { color: var(--sc-accent); }
@media (max-width: 899px) {
  .bar__logo img { height: 24px; }
  .bar__actions { display: none; }
}

/* ------------------------------------------------------------------ hero -- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48vw;
  min-height: 100svh;
  max-height: 1080px;
  background: var(--sc-canvas);
  overflow: clip;
}
.hero__copy {
  position: relative; z-index: 1;
  align-self: center;
  padding: calc(var(--bar-h) + clamp(2rem, 5vh, 4rem)) clamp(1.5rem, 4vw, 4.5rem) clamp(2rem, 6vh, 4.5rem) var(--gutter);
  max-width: 58rem;
}
.hero__title {
  font-family: var(--sc-font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.8rem, 0.9rem + 4.3vw, 5.8rem);
  line-height: 0.9;
  letter-spacing: 0.002em;
  margin: 0;
  text-wrap: balance;
}
.hero__word { display: block; }
.brag { position: relative; display: inline-block; }
.brag__line {
  position: absolute; left: -3%; width: 106%; bottom: -0.07em; height: 0.16em;
  overflow: visible; pointer-events: none;
}
.brag__line path {
  fill: none; stroke: var(--sc-accent); stroke-width: max(3px, 0.055em);
  stroke-linecap: round; vector-effect: non-scaling-stroke;
  filter: url(#chalk);
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: chalk-draw 520ms var(--sc-ease-out) 450ms forwards;
}
@keyframes chalk-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .brag__line path { animation: none; stroke-dashoffset: 0; }
}
.hero__sub {
  margin: clamp(1rem, 2.4vh, 1.5rem) 0 0;
  max-width: 34ch;
  font-size: clamp(1.06rem, 0.98rem + 0.35vw, 1.3rem);
  line-height: 1.5;
  color: var(--sc-ink-soft);
  text-wrap: pretty;
}

.starter { margin-top: clamp(1.75rem, 4.4vh, 3rem); }
.starter__q { margin: 0 0 0.85rem; color: var(--sc-accent); font-size: 0.85rem; }
.starter__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; max-width: 34rem; }
.tile {
  display: flex; align-items: center; gap: 0.65rem;
  min-height: 58px; padding: 0.6rem 0.85rem;
  background: var(--sc-surface); color: var(--sc-ink);
  border: 1px solid var(--sc-hairline); border-radius: var(--r);
  font: 600 0.98rem/1.15 var(--sc-font-text); text-align: left; cursor: pointer;
  box-shadow: var(--sc-edge);
  transition: border-color 140ms var(--sc-ease-out), background-color 140ms var(--sc-ease-out), transform 120ms var(--sc-ease-out);
}
.tile .ico { color: var(--sc-accent); width: 1.4rem; height: 1.4rem; }
.tile:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .tile:hover { border-color: var(--sc-accent); background: color-mix(in oklab, var(--sc-surface) 86%, var(--sc-accent)); }
}
.starter__call { margin: 0.95rem 0 0; color: var(--sc-ink-soft); font-size: 0.95rem; }
.starter__call a { color: var(--sc-ink); font-weight: 600; white-space: nowrap; }

.hero__frame {
  position: relative;
  container-type: size;
  overflow: clip;
  background: #1a1916;
}
.planes {
  --ar: 0.75;
  position: absolute; left: 50%; top: 50%;
  width: max(100cqw, calc(100cqh * var(--ar)));
  aspect-ratio: var(--ar);
  translate: -50% -50%;
  scale: 1.06;
}
.planes[data-scene="bathroom"] { --ar: 0.8; }
.planes[data-scene="basement"] { --ar: 1.5; }
.planes[data-scene="deck"]     { --ar: 1; }
.plane {
  position: absolute; inset: 0;
  width: 100%; height: 100%; max-width: none;
  object-fit: cover;
  will-change: transform;
  transform-origin: 50% 50%;
}
.plane--pendant { transform-origin: var(--pivot-x) var(--pivot-y); }
/* the seam between copy and photo, softened only on the photo's edge */
.hero__frame::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 18%;
  background: linear-gradient(90deg, var(--sc-canvas), transparent);
  pointer-events: none;
}

@media (max-width: 899px) {
  .hero { grid-template-columns: 1fr; max-height: none; min-height: 0; }
  .hero__frame { order: -1; height: clamp(300px, 50svh, 520px); margin-top: var(--bar-h); }
  .hero__frame::after {
    inset: auto 0 0 0; width: auto; height: 22%;
    background: linear-gradient(0deg, var(--sc-canvas), transparent);
  }
  .hero__copy { padding: 1.1rem var(--gutter) 2.5rem; }
  .hero__title { font-size: clamp(2.6rem, 11.6vw, 3.6rem); margin-top: -1.6rem; position: relative; }
  .hero__sub { font-size: 1.05rem; }
  .fear__list li { font-size: 1.22rem; }
  .starter__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile { flex-direction: column; justify-content: center; text-align: center; gap: 0.35rem; min-height: 78px; padding: 0.55rem 0.35rem; font-size: 0.86rem; }
}

/* --------------------------------------------------------- 2 · the fear -- */
.fear {
  --fear-p: var(--sc-p);
  /* when each line is crossed out, in the act's progress: the first line's
     start, the step to the next line, and how long one stroke takes */
  --strike-at: 0.44; --strike-gap: 0.025; --strike-len: 0.06;
  background: var(--hush);
  padding-block: clamp(6rem, 16vw, 13rem) clamp(5rem, 13vw, 11rem);
}
.fear__inner { max-width: 72rem; }
.fear__title {
  font-family: var(--sc-font-display);
  font-weight: 400; text-transform: uppercase;
  font-size: clamp(2.6rem, 1.4rem + 5vw, 6rem);
  line-height: 0.92; margin: 0; max-width: 12ch;
}
.fear__list {
  list-style: none; margin: clamp(2rem, 5vw, 3.5rem) 0 0; padding: 0;
  display: grid; gap: 0.4rem;
}
.fear__list li {
  position: relative; width: fit-content;
  font-size: clamp(1.3rem, 0.95rem + 1.5vw, 2.2rem);
  font-weight: 500; line-height: 1.25; letter-spacing: -0.01em;
  color: var(--sc-ink-soft);
}
/* the turn crosses every horror story out with a chalk line */
.fear__list li::after {
  content: ""; position: absolute; left: -2%; right: -2%; top: 54%; height: 0.14em;
  background: var(--sc-accent); border-radius: 2px;
  transform-origin: 0 50%;
  transform: scaleX(clamp(0, calc((var(--fear-p, 0) - var(--strike-at) - var(--i) * var(--strike-gap)) / var(--strike-len)), 1)) rotate(-1.2deg);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='12'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.4 1.9'/%3E%3C/filter%3E%3Crect width='160' height='12' filter='url(%23n)'/%3E%3C/svg%3E") repeat-x left center / auto 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='12'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.4 1.9'/%3E%3C/filter%3E%3Crect width='160' height='12' filter='url(%23n)'/%3E%3C/svg%3E") repeat-x left center / auto 100%;
}
.fear__list li:nth-child(1) { --i: 0; }
.fear__list li:nth-child(2) { --i: 1; }
.fear__list li:nth-child(3) { --i: 2; }
.fear__turn {
  margin: clamp(2.5rem, 6vw, 4.5rem) 0 0;
  font-family: var(--sc-font-display); text-transform: uppercase;
  font-size: clamp(2.2rem, 1.2rem + 4vw, 4.8rem); line-height: 0.95;
  color: var(--sc-accent);
}
/* On a phone the act is short, so the whole turn happened in about 120 px of
   scroll, a flick: the stories were struck while the last was still fading
   in, all three at once, with the type sliding up the screen the whole time.
   Here the type holds mid-screen for most of a screen of scroll (the spacer
   is the room it holds through), the three stories finish arriving, and only
   then is each struck in turn, about 100 px of scroll apiece, the turn landing
   as the last stroke ends. */
@media (max-width: 899px) and (prefers-reduced-motion: no-preference) {
  .fear { --strike-at: 0.48; --strike-gap: 0.045; --strike-len: 0.05; }
  .fear__inner { position: sticky; top: max(var(--bar-h) + 0.5rem, calc(50svh - 11rem)); }
  .fear::after { content: ""; display: block; height: 70svh; }
}

/* ------------------------------------------------------ 3 · the build ---- */
/* Pinned acts get their scroll length in CSS too (the engine writes the same
   value on mount). Without it the page is short until the script runs: lazy
   images far down load on arrival and everything below shifts. */
.build { height: 480vh; background: var(--sc-canvas); }
.build__stage {
  display: grid;
  grid-template-columns: minmax(0, 34fr) minmax(0, 66fr);
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.5rem);
  padding: var(--bar-h) var(--gutter) 0;
  background: var(--sc-canvas);
}
.build__copy { max-width: 30rem; }
.build__eyebrow { margin: 0 0 1.25rem; color: var(--sc-accent); font-size: 0.85rem; }
.build__steps { list-style: none; margin: 0; padding: 0; }
.build__steps li {
  font-family: var(--sc-font-display); text-transform: uppercase;
  font-size: clamp(2.6rem, 1.2rem + 3.6vw, 5.2rem); line-height: 1;
  color: color-mix(in oklab, var(--sc-ink) 22%, transparent);
  transition: color 260ms var(--sc-ease-out);
}
.build__steps li.is-done { color: color-mix(in oklab, var(--sc-ink) 44%, transparent); }
.build__steps li.is-active { color: var(--sc-ink); }
/* the active step gets the roof chevron from the logo, pointing at it */
.build__steps li { position: relative; padding-left: 0.42em; transform-origin: 0.42em 60%; }
.build__steps li::before {
  content: ""; position: absolute; left: 0; top: 0.36em; width: 0.2em; height: 0.3em;
  background: var(--sc-accent);
  clip-path: polygon(0 0, 100% 50%, 0 100%, 0 72%, 56% 50%, 0 28%);
  opacity: 0; transform: translateX(-0.12em);
  transition: opacity 200ms var(--sc-ease-out), transform 200ms var(--sc-ease-out);
}
.build__steps li.is-active::before { opacity: 1; transform: none; }
.build__notes { display: grid; margin-top: clamp(1.25rem, 3vh, 2rem); min-height: 5.2em; }
/* cued by site.js against the build's own progress, so they keep step with it */
.js .build__notes > * { opacity: 0; will-change: opacity, transform; }
.build__notes > * {
  grid-area: 1 / 1;
  margin: 0; max-width: 32ch;
  font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.25rem); line-height: 1.5;
  color: var(--sc-ink-soft); text-wrap: pretty;
}
.build__meter { display: none; }

/* The frame is the 1020x816 crop of Ryan's photo. The model, the storage
   overlay and the door are all drawn in that crop's pixels, so every layer
   is a box placed in percentages of it. site.js drives the frame through
   these; only the frame reads them, so only the frame restyles. */
.build__frame {
  --model: 1; --layout: 0; --marks: 0; --storage: 0;
  --real: 0; --door: 0; --store: 0; --built: 0;
  position: relative; margin: 0;
  justify-self: center;
  width: min(100%, calc((100svh - var(--bar-h) - 7rem) * 1.25));
  aspect-ratio: 1020 / 816;
  background: #0d0c0b;
  box-shadow: var(--sc-e3);
  container-type: inline-size;
}
.build__model, .build__real { position: absolute; inset: 0; overflow: hidden; }
.build__model { opacity: var(--model); }
.model__site { position: absolute; inset: 0; width: 100%; height: 100%; }
/* The chalk is two pictures (scripts/bake_chalk.mjs drew them through #chalk),
   and each line is stroked with its own, wide enough to take in the chalk's
   rough edge: drawing a line on reveals it. Filtered live, Safari redrew the
   noise on the CPU whenever the plan repainted, which on a phone was most of a
   second. Near the size they were drawn at (2 picture px per frame px) the
   pictures are point-sampled, as the filter's noise was, so the grain stays
   crisp; a phone shows them at a half to a third of that, where point-sampling
   drops the grain into dots, so there they are smoothed. */
@media (min-width: 900px) { .model__site image { image-rendering: pixelated; } }
.site__layout path, .site__marks path {
  fill: none; stroke-width: 6px; stroke-linecap: round;
  stroke-dasharray: 1;
}
.site__layout path { stroke: url(#chalk-layout); stroke-dashoffset: calc(1 - clamp(0, var(--layout) * var(--n) - var(--i), 1)); }
.site__marks path  { stroke: url(#chalk-marks); stroke-dashoffset: calc(1 - clamp(0, var(--marks) * var(--n) - var(--i), 1)); }

/* Each layer is a picture of its own; site.js moves it as a whole. Made into a
   layer only once the act is close, so the pictures are not held in memory
   for the rest of the page. */
.part { position: absolute; }
.part > img { display: block; width: 100%; height: 100%; max-width: none; }
.build.is-near .part { will-change: transform; }
/* the space under the deck fills from the ground up as it lights */
.part--storage { opacity: var(--storage); clip-path: inset(calc((1 - var(--storage)) * 100%) 0 0 0); }
.part--storage > img { animation: store-pulse 1.4s var(--sc-ease-out) infinite alternate paused; }
.build.is-storage .part--storage > img { animation-play-state: running; }
@keyframes store-pulse { from { opacity: 1; } to { opacity: 0.62; } }
.part__mark { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; opacity: 0; transition: opacity 200ms var(--sc-ease-out); }
.part__mark polygon { fill: none; stroke: var(--sc-accent); stroke-width: 3px; stroke-linejoin: round; }
.part--door.is-tagged .part__mark { opacity: 1; }

/* Labels pin to a point on their layer and sit beside it on a short leader.
   Shown for the stage that just landed. */
.part__tag {
  position: absolute; left: var(--x); top: var(--y);
  padding: 0.3em 0.5em; border-radius: 2px;
  background: color-mix(in oklab, var(--sc-canvas) 88%, transparent);
  color: var(--sc-ink);
  font-family: var(--sc-font-text); font-stretch: 72%; font-weight: 700;
  font-size: clamp(0.62rem, 0.5rem + 0.3vw, 0.78rem); letter-spacing: 0.08em; text-transform: uppercase;
  line-height: 1.2; white-space: nowrap;
  opacity: 0; transition: opacity 180ms var(--sc-ease-out);
  pointer-events: none;
}
.part__tag::after { content: ""; position: absolute; background: currentColor; opacity: 0.7; }
.part__tag--l { transform: translate(calc(-100% - 14px), -50%); }
.part__tag--l::after { left: 100%; top: 50%; width: 14px; height: 1px; }
.part__tag--r { transform: translate(14px, -50%); }
.part__tag--r::after { right: 100%; top: 50%; width: 14px; height: 1px; }
.part__tag--u { transform: translate(-50%, calc(-100% - 14px)); }
.part__tag--u::after { top: 100%; left: 50%; width: 1px; height: 14px; }
.part__tag--c { transform: translate(-50%, -50%); font-size: clamp(0.8rem, 0.6rem + 0.6vw, 1.1rem); padding: 0.4em 0.7em; }
.part__tag--c::after { display: none; }
.part__tag--hot { color: var(--sc-accent); }
.model__tags { position: absolute; inset: 0; pointer-events: none; }
.part__tag.is-on, .build.is-storage .part__tag[data-tag="storage"] { opacity: 1; }
/* one line for the whole stage, for screens too small for a label per layer */
.build__stage-tag { display: none; }

/* The real deck. Parked until the act is close, then held under the model
   until the last layer lands. Its perspective is the photo's own camera: a
   wide-angle lens, 734 crop px of focal length on the 1020 px crop, centred
   at (620, 402), so the door swings out of the picture the way it would. */
.build__real {
  display: none;
  opacity: var(--real);
  transform: scale(calc(1.035 - 0.035 * var(--real)));
  perspective: 71.96cqw; perspective-origin: 60.78% 49.26%;
}
.build.is-near .build__real { display: block; }
.build__photo { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.build__store { position: absolute; inset: 0; width: 100%; height: 100%; }
.store__faces { opacity: var(--store); }
.store__faces polygon { fill: url(#store-hatch); stroke: var(--sc-accent); stroke-width: 2.5px; stroke-linejoin: round; }
.store__doorway { fill: #0a0908; opacity: clamp(0, calc(var(--door) * 40), 1); }
/* The door on its hinges: the cut-out door turns about its left edge, where
   the T-hinges are, and swings out toward the yard: its free edge comes
   forward and drops onto the grass. It darkens as it turns from the light.
   The cut-out lies flat in the picture while the real door's face recedes
   about 30 degrees, so 64 here is the door standing a little past square. */
.build__door {
  position: absolute; left: 49.02%; top: 55.02%; width: 14.71%; height: 17.89%;
  transform-origin: 0 50%;
  transform: rotateY(calc(var(--door) * -64deg));
}
.build__door img { display: block; width: 100%; height: 100%; max-width: none; }
.build__door::after {
  content: ""; position: absolute; inset: 0; background: #000;
  opacity: calc(var(--door) * 0.4);
  clip-path: polygon(0 2.7%, 100% 0, 100% 81.5%, 0 100%);
}
.build__tag {
  position: absolute; left: 55%; top: 80%; margin: 0;
  padding: 0.4em 0.7em; border-radius: 2px;
  background: color-mix(in oklab, var(--sc-canvas) 86%, transparent);
  color: var(--sc-accent);
  font-family: var(--sc-font-text); font-stretch: 72%; font-weight: 700;
  font-size: clamp(0.8rem, 0.6rem + 0.6vw, 1.1rem); letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap;
  opacity: var(--store);
  transform: translate(-50%, 0);
}
.build__tag::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 1px; height: 1.4em; background: currentColor; }
.build__flash { position: absolute; inset: 0; background: #fff6ea; opacity: 0; pointer-events: none; }
.build__dust { position: absolute; inset: -6% -12%; width: 124%; height: 112%; pointer-events: none; }
.build__caption {
  position: absolute; left: 0; top: calc(100% + 0.75rem);
  font-size: 0.85rem; color: var(--sc-ink-soft);
  opacity: var(--built);
}

/* without scripts the page still reads: copy shown, the real deck shown */
html:not(.js) [data-sc-cue], html:not(.js) [data-sc-in], html:not(.js) [data-sc-stagger] > * { opacity: 1; transform: none; }
html:not(.js) .build__real { display: block; opacity: 1; transform: none; }
html:not(.js) .build__model { display: none; }
html:not(.js) .build__notes { gap: 0.6em; }
html:not(.js) .build__notes > * { grid-area: auto; }

@media (max-width: 899px) {
  .build__stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    align-items: start;
    padding: calc(var(--bar-h) + 1rem) var(--gutter) calc(var(--dock-h) + 0.5rem);
    gap: 1.25rem;
  }
  .build__frame { order: -1; width: 100%; box-shadow: var(--sc-e2); }
  .build__caption { display: none; }
  .build__eyebrow { display: none; }
  .build__steps { display: flex; justify-content: space-between; gap: 0.5rem; }
  .build__steps li { font-size: clamp(1.25rem, 5.4vw, 1.7rem); }
  .build__steps li { padding-left: 0; }
  .build__steps li::before { display: none; }
  .build__notes { margin-top: 0.6rem; min-height: 4.6em; }
  .build__notes > * { font-size: 1rem; max-width: none; }
  .build__meter {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem;
    list-style: none; margin: 0.6rem 0 0; padding: 0;
  }
  .build__meter li { height: 3px; background: color-mix(in oklab, var(--sc-ink) 18%, transparent); border-radius: 2px; }
  .build__meter li.is-on { background: var(--sc-accent); }
  .part__tag { display: none; }
  .build__stage-tag {
    display: block; position: absolute; left: 0.6rem; top: 0.6rem; margin: 0;
    padding: 0.35em 0.6em; border-radius: 2px;
    background: color-mix(in oklab, var(--sc-canvas) 86%, transparent);
    color: var(--sc-ink);
    font-family: var(--sc-font-text); font-stretch: 72%; font-weight: 700;
    font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
    opacity: 0; transition: opacity 180ms var(--sc-ease-out);
  }
  .build__stage-tag.is-on { opacity: 1; }
  .build__stage-tag.is-hot { color: var(--sc-accent); }
  .build__tag { font-size: 0.72rem; top: 79%; }
}

/* The reduced-motion build: nothing travels. Each stage fades in where it
   stands, the photo crossfades in, and the door is shown open, not swung. */
@media (prefers-reduced-motion: reduce) {
  .part { transition: opacity 220ms var(--sc-ease-out); }
  .build__real { transform: none; }
  .build__door { transform: none; opacity: calc(1 - var(--door)); }
  .build__dust, .build__flash { display: none; }
  .part--storage > img { animation: none; }
}

/* ------------------------------------------------------- 4 · the work ---- */
.work { height: 360vh; background: var(--sc-canvas); }
.work__stage {
  --ih: clamp(240px, 50svh, 560px);
  display: flex; flex-direction: column; justify-content: center; gap: clamp(1.5rem, 4vh, 3rem);
  padding-top: var(--bar-h);
  background: var(--sc-canvas);
}
.work__head {
  display: flex; align-items: end; justify-content: space-between; gap: 1.5rem 2rem; flex-wrap: wrap;
  padding-inline: var(--gutter);
}
.work__title {
  font-family: var(--sc-font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2.2rem, 1.2rem + 3.4vw, 4.4rem); line-height: 0.92; margin: 0;
}
.work__index { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.work__index button {
  min-height: 40px; padding: 0 0.9rem;
  background: transparent; color: var(--sc-ink-soft);
  border: 1px solid var(--sc-hairline); border-radius: var(--r);
  font: 600 0.9rem/1 var(--sc-font-text); cursor: pointer;
  transition: color 140ms var(--sc-ease-out), border-color 140ms var(--sc-ease-out), background-color 140ms var(--sc-ease-out);
}
.work__index button:hover { color: var(--sc-ink); border-color: var(--sc-hairline-strong); }
.work__index button[aria-current="true"] { color: var(--sc-accent-ink); background: var(--sc-ink); border-color: var(--sc-ink); }

.work__rail {
  align-items: stretch; gap: clamp(0.9rem, 1.6vw, 1.5rem);
  padding-inline: var(--gutter);
  width: max-content;
}
.work__lead {
  flex: none; align-self: end; width: min(19rem, 70vw); margin: 0;
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem); line-height: 1.45; color: var(--sc-ink-soft);
  padding-right: clamp(0.5rem, 2vw, 2rem);
}
/* At least its share of the rail, and wide enough that its button and link
   each stay on one line: narrower, the button ran into the next photo and the
   link wrapped with its arrow left at the far edge. */
.work__group {
  flex: none; width: max-content; min-width: clamp(11rem, 16vw, 15rem); height: var(--ih);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 1rem;
  padding-left: 1.25rem; margin-left: clamp(0.5rem, 2vw, 2rem);
  border-left: 3px solid var(--sc-accent);
}
.work__group h3 {
  contain: inline-size;          /* wraps to the group; only the actions widen it */
  font-family: var(--sc-font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2rem, 1.3rem + 2vw, 3.2rem); line-height: 0.92; margin: 0;
}
.work__group .btn { align-self: flex-start; min-height: 44px; font-size: 0.92rem; }
/* the door into a case study: one job, every step */
.work__case {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; align-self: flex-start;
  color: var(--sc-ink); font-weight: 650; font-size: 0.92rem; line-height: 1.25;
  text-decoration: underline; text-underline-offset: 0.22em; text-decoration-thickness: 1.5px;
}
.work__case .ico { color: var(--sc-accent); flex: none; transition: transform 140ms var(--sc-ease-out); }
@media (hover: hover) and (pointer: fine) { .work__case:hover .ico { transform: translateX(3px); } }
/* The placeholder tone sits on the figure, behind the photo, so the img has no
   box decoration of its own and the browser can hand the decoded image straight
   to its layer instead of painting it into one. */
.work__item {
  flex: none; margin: 0; width: calc(var(--ih) * var(--ar));
  background: linear-gradient(var(--sc-surface), var(--sc-surface)) top / 100% var(--ih) no-repeat;
}
.work__item img { width: 100%; height: var(--ih); max-width: none; object-fit: cover; }
.work__item figcaption { margin-top: 0.6rem; font-size: 0.86rem; line-height: 1.35; color: var(--sc-ink-soft); }
.work__end {
  flex: none; align-self: center; width: clamp(14rem, 22vw, 20rem);
  display: grid; gap: 1rem; justify-items: start; padding-left: clamp(1rem, 3vw, 3rem);
}
.work__end p { margin: 0; font-family: var(--sc-font-display); text-transform: uppercase; font-size: clamp(2rem, 1.4rem + 2vw, 3.4rem); line-height: 0.92; }
/* Each photo its own layer: the arrival fade is then a layer property, not a
   repaint of the whole moving rail under it. */
@media (prefers-reduced-motion: no-preference) {
  .work__item img { opacity: calc(0.62 + 0.38 * var(--seen, 1)); will-change: opacity; }
}
/* Reduced motion: no sideways travel at all. The rail becomes an ordinary
   wrapped gallery and the section stops pinning, so every job is reachable
   with plain scrolling. */
@media (prefers-reduced-motion: reduce) {
  .work { height: auto !important; }
  .work__stage {
    --ih: clamp(170px, 26vw, 300px);
    height: auto; overflow: visible !important; padding-block: calc(var(--bar-h) + 3rem) 4rem;
  }
  .work__rail { flex-wrap: wrap; width: auto; transform: none !important; row-gap: 1.75rem; }
  .work__lead { width: 100%; align-self: auto; }
  .work__group {
    width: 100%; height: auto; margin: 1.5rem 0 0; padding: 0 0 0 1rem;
    flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between;
  }
  .work__group h3 { contain: none; }
  .work__end { width: 100%; padding: 1rem 0 0; }
}
@media (max-width: 899px) {
  /* The band follows the screen's width (its height still caps it on a short
     phone), so the rail's length scales with the width too, and the act's
     height below can hold the same pace on every phone. */
  .work__stage { --ih: clamp(220px, min(72vw, 42svh), 420px); gap: 1.25rem; padding-bottom: var(--dock-h); }
  /* No photo wider than the screen. A landscape job ran half again as wide as
     a phone, so it was never seen whole and its caption was cut by the edge;
     now it is trimmed at its sides and fits. */
  .work__item { max-width: calc(100vw - 2 * var(--gutter)); }
  .work__lead { width: 60vw; font-size: 1.05rem; }
  /* Its button is wider than the desktop column and ran off the screen. */
  .work__end { width: max-content; }
  .work__index { flex-wrap: nowrap; gap: 0.3rem; }
  .work__index button { min-height: 36px; padding: 0 0.6rem; font-size: 0.8rem; white-space: nowrap; }
}
/* The pace on a phone. With the act's own 3.6 screens of scroll the rail went
   2.6 to 3 px sideways for every px of thumb, and a flick threw a whole kind
   of job past before a photo could be looked at. The rail is about 12.7 screen
   widths long on any phone, so its travel is given in vw as well: about 1.4 px
   of rail per px of scroll on every phone, held there on a tablet by the cap.
   The engine measures the act's real height, so this overrides its inline one. */
@media (max-width: 899px) and (prefers-reduced-motion: no-preference) {
  .work { height: calc(100vh + min(820vw, 4400px)) !important; }
}

/* ------------------------------------------------------- 5 · Ryan -------- */
.ryan {
  --sc-ink: var(--paper-ink); --sc-ink-soft: var(--paper-soft);
  --sc-hairline: color-mix(in oklab, var(--paper-ink) 14%, transparent);
  color: var(--paper-ink);
  background: var(--paper);
  padding-block: clamp(5rem, 11vw, 10rem);
}
.ryan :focus-visible { outline-color: var(--accent-deep); }
.ryan__grid {
  display: grid; grid-template-columns: minmax(0, 38.2fr) minmax(0, 61.8fr);
  gap: clamp(2.5rem, 6vw, 6.5rem); align-items: start;
}
.ryan__photo { margin: 0; position: sticky; top: calc(var(--bar-h) + 2rem); }
.ryan__wipe { overflow: hidden; }
.ryan__wipe img { width: 100%; height: auto; aspect-ratio: 1100 / 1425; object-fit: cover; }
.ryan__photo figcaption { margin-top: 0.7rem; font-size: 0.86rem; color: var(--paper-soft); }
.ryan__title {
  font-family: var(--sc-font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2.6rem, 1.4rem + 4.4vw, 5.4rem); line-height: 0.92; margin: 0;
}
.ryan__lede { font-size: clamp(1.1rem, 1rem + 0.4vw, 1.35rem); line-height: 1.55; color: var(--paper-soft); max-width: 40ch; text-wrap: pretty; }

/* the door into the case study, under the claim it proves: two small prints,
   the corner before and after, the finished one laid over the first */
.ryan__case {
  display: inline-grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.1rem;
  max-width: 26rem; padding: 0.75rem 1.1rem 0.75rem 0.9rem;
  border: 1px solid var(--sc-hairline); border-radius: var(--r);
  background: var(--paper-2);
  color: var(--paper-ink); text-decoration: none;
  transition: border-color 160ms var(--sc-ease-out), transform 120ms var(--sc-ease-out);
}
.sc-stack > .ryan__case { margin-top: clamp(1.5rem, 3vw, 2rem); }
.ryan__case:hover { border-color: var(--accent-deep); }
.ryan__case:active { transform: translateY(1px); }
.ryan__case-prints { position: relative; width: 5.6rem; height: 3.9rem; flex: none; }
.ryan__case-prints img {
  position: absolute; top: 0.2rem; width: 3.4rem; height: 3.4rem; object-fit: cover;
  border: 3px solid #fff; border-radius: 1px;
  box-shadow: 0 1px 2px rgba(23, 22, 20, 0.2), 0 6px 12px -4px rgba(23, 22, 20, 0.35);
  transition: transform 220ms var(--sc-ease-out);
}
.ryan__case-prints img:first-child { left: 0; transform: rotate(-5deg); }
.ryan__case-prints img:last-child { left: 1.9rem; transform: rotate(4deg); }
.ryan__case-text { display: grid; gap: 0.2rem; }
.ryan__case-kicker {
  font: 700 0.7rem/1.1 var(--sc-font-text); font-stretch: 72%;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-deep);
}
.ryan__case-title { font-weight: 700; font-size: 1.02rem; line-height: 1.3; text-wrap: balance; }
.ryan__case-go { color: var(--accent-deep); transition: transform 140ms var(--sc-ease-out); }
@media (hover: hover) and (pointer: fine) {
  .ryan__case:hover .ryan__case-go { transform: translateX(3px); }
  .ryan__case:hover .ryan__case-prints img:last-child { transform: translate(-0.55rem, -0.1rem) rotate(1deg); }
}
@media (prefers-reduced-motion: reduce) { .ryan__case-prints img { transition: none; } }

.quotes { list-style: none; margin: clamp(2.5rem, 5vw, 4rem) 0 0; padding: 0; display: grid; gap: 0; }
.quote {
  display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); column-gap: 1.25rem; row-gap: 0.4rem;
  padding: 1.5rem 0; border-top: 1px solid var(--sc-hairline);
}
.quote:last-child { border-bottom: 1px solid var(--sc-hairline); }
.quote img { grid-row: span 2; width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: 2px; }
.quote blockquote { margin: 0; }
.quote blockquote p { margin: 0; font-size: clamp(1.02rem, 0.98rem + 0.2vw, 1.15rem); line-height: 1.5; color: var(--paper-ink); text-wrap: pretty; }
.quote strong { font-weight: 700; }
.quote__who { margin: 0; font-size: 0.78rem; color: var(--paper-ink); }
.quote__who span { margin-left: 0.5rem; color: var(--paper-soft); }

@media (max-width: 899px) {
  .ryan__grid { grid-template-columns: 1fr; }
  .ryan__photo { position: static; max-width: 30rem; }
}

/* ------------------------------------------------------- 6 · the close --- */
.close {
  background: var(--sc-canvas);
  padding-top: clamp(5rem, 11vw, 9.5rem);
}
.close__grid {
  display: grid; grid-template-columns: minmax(0, 61.8fr) minmax(0, 38.2fr);
  gap: clamp(2.5rem, 6vw, 6rem); align-items: start;
}
.close__title {
  font-family: var(--sc-font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2.6rem, 1.4rem + 4.4vw, 5.4rem); line-height: 0.92; margin: 0;
}
.close__lede { margin: 1rem 0 0; font-size: clamp(1.06rem, 1rem + 0.3vw, 1.25rem); color: var(--sc-ink-soft); max-width: 40ch; }
.order-home { margin-top: clamp(1.75rem, 4vw, 2.75rem); }
.order__noscript { padding: 1.5rem; background: var(--paper); color: var(--paper-ink); border-radius: var(--r); }

/* the work order: paper on the dark ground, so the eye lands here */
.order {
  --sc-ink: var(--paper-ink); --sc-ink-soft: var(--paper-soft);
  --sc-hairline: color-mix(in oklab, var(--paper-ink) 16%, transparent);
  color: var(--paper-ink);
  background: var(--paper);
  border-radius: var(--r);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  box-shadow: var(--sc-e3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  max-width: 40rem;
}
.order :focus-visible { outline-color: var(--accent-deep); }
.order__top { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.5rem 1rem; margin-bottom: 1.25rem; }
.order__back {
  display: inline-flex; align-items: center; gap: 0.35rem; min-height: 40px; padding: 0 0.6rem 0 0.3rem;
  background: transparent; border: 0; border-radius: var(--r); color: var(--paper-ink);
  font: 600 0.92rem/1 var(--sc-font-text); cursor: pointer;
}
.order__back:hover { color: var(--accent-deep); }
.order__back[hidden] { display: none; }
.order__back[hidden] + .order__count { grid-column: 1 / -1; }
.order__count { margin: 0; justify-self: end; color: var(--paper-soft); font-size: 0.74rem; }
.order__back[hidden] + .order__count { justify-self: start; }
.order__progress { grid-column: 1 / -1; width: 100%; height: 12px; overflow: visible; }
.order__track { stroke: color-mix(in oklab, var(--paper-ink) 12%, transparent); stroke-width: 3px; vector-effect: non-scaling-stroke; fill: none; stroke-linecap: round; }
.order__fill {
  /* no non-scaling-stroke here: with it, Chrome measures the dash in screen
     pixels but pathLength in viewBox units, and a full bar stops short */
  stroke: var(--sc-accent); stroke-width: 4px; fill: none; stroke-linecap: round;
  filter: url(#chalk);
  stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--progress, 0.2));
  transition: stroke-dashoffset 380ms var(--sc-ease-out);
}
.order__step { border: 0; margin: 0; padding: 0; min-width: 0; }
.order__step[hidden] { display: none; }
.order__step legend {
  padding: 0; margin-bottom: 1.1rem;
  font-family: var(--sc-font-display); text-transform: uppercase;
  font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.4rem); line-height: 0.98;
}
.order__step legend:focus { outline: none; }
.order__step.is-entering { animation: step-in 260ms var(--sc-ease-out); }
@keyframes step-in { from { opacity: 0; transform: translate3d(12px, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .order__step.is-entering { animation-name: step-fade; } @keyframes step-fade { from { opacity: 0; } } }
.order__hint { margin: -0.5rem 0 1rem; color: var(--paper-soft); font-size: 0.95rem; }

.choices { display: grid; gap: 0.5rem; }
.choices--tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices--pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice--wide { grid-column: 1 / -1; }
.choice {
  position: relative;
  display: flex; align-items: center; gap: 0.65rem;
  min-height: 56px; padding: 0.7rem 1rem;
  background: var(--paper-2);
  border: 1.5px solid color-mix(in oklab, var(--paper-ink) 16%, transparent);
  border-radius: var(--r);
  font-weight: 600; font-size: 1rem; line-height: 1.2; cursor: pointer;
  transition: border-color 140ms var(--sc-ease-out), background-color 140ms var(--sc-ease-out), transform 120ms var(--sc-ease-out);
}
.choices--tiles .choice { flex-direction: column; justify-content: center; text-align: center; gap: 0.45rem; min-height: 92px; padding: 0.75rem 0.5rem; font-size: 0.95rem; }
.choice .ico { width: 1.6rem; height: 1.6rem; color: var(--paper-ink); }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .choice:hover { border-color: color-mix(in oklab, var(--paper-ink) 40%, transparent); } }
.choice:has(input:checked) { border-color: var(--sc-accent); background: #fff1e6; box-shadow: inset 0 0 0 1px var(--sc-accent); }
.choice:has(input:checked) .ico { color: var(--accent-deep); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.order__next-choice { margin-top: 1rem; }
.order__step:not(:has(input:checked)) .order__next-choice { display: none; }

.field { display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field label span { font-weight: 400; color: var(--paper-soft); margin-left: 0.35rem; }
.field input, .field textarea {
  width: 100%; min-height: 52px; padding: 0.75rem 0.9rem;
  background: #fff; color: var(--paper-ink);
  border: 1.5px solid color-mix(in oklab, var(--paper-ink) 24%, transparent); border-radius: var(--r);
  font: 400 1rem/1.4 var(--sc-font-text);
  transition: border-color 140ms var(--sc-ease-out);
}
.field textarea { resize: vertical; min-height: 92px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent-deep); box-shadow: 0 0 0 3px color-mix(in oklab, var(--sc-accent) 28%, transparent); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field__error { margin: 0; color: var(--danger); font-size: 0.9rem; font-weight: 500; }
.field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.order__small { margin: 0.9rem 0 0; font-size: 0.86rem; color: var(--paper-soft); }
.order__small a { color: var(--paper-ink); }

.order__fail { padding: 0.25rem 0 0; }
.order__fail:focus { outline: none; }
.order__fail-title { margin: 0 0 0.4rem; font-family: var(--sc-font-display); text-transform: uppercase; font-size: 2rem; line-height: 1; }
.order__fail p { margin: 0 0 0.9rem; color: var(--paper-soft); }
.order__fail-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.order__retry { margin-top: 1rem; background: none; border: 0; padding: 0.4rem 0; color: var(--paper-ink); font: 600 0.92rem var(--sc-font-text); text-decoration: underline; text-underline-offset: 0.22em; cursor: pointer; }

/* ------------------------------------------------- the instant estimate --- */
/* size, finish and the sharpening questions: a name, a hint underneath */
.choice--row { justify-content: space-between; }
.choice__text { display: grid; gap: 0.15rem; }
.choice__hint { font-weight: 400; font-size: 0.88rem; color: var(--paper-soft); }
/* the finish level, three rising bars */
.choice__level { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; flex: none; }
.choice__level i { width: 5px; border-radius: 1px; background: color-mix(in oklab, var(--paper-ink) 14%, transparent); }
.choice__level i:nth-child(1) { height: 7px; }
.choice__level i:nth-child(2) { height: 11px; }
.choice__level i:nth-child(3) { height: 16px; }
.choice__level[data-level="1"] i:nth-child(-n+1),
.choice__level[data-level="2"] i:nth-child(-n+2),
.choice__level[data-level="3"] i { background: var(--paper-ink); }
.choice:has(input:checked) .choice__level[data-level="1"] i:nth-child(-n+1),
.choice:has(input:checked) .choice__level[data-level="2"] i:nth-child(-n+2),
.choice:has(input:checked) .choice__level[data-level="3"] i { background: var(--accent-deep); }
.order__skip {
  display: block; margin: 0.75rem auto 0; padding: 0.5rem 0.75rem;
  background: none; border: 0; border-radius: var(--r); cursor: pointer;
  color: var(--paper-soft); font: 600 0.9rem var(--sc-font-text);
  text-decoration: underline; text-underline-offset: 0.22em; text-decoration-color: color-mix(in oklab, currentColor 40%, transparent);
}
.order__skip:hover { color: var(--paper-ink); }

/* the range, live, while the questions sharpen it */
.order__live {
  grid-column: 1 / -1; margin: 0.35rem 0 0;
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
}
.order__live[hidden] { display: none; }
/* the range, said once (the count-up animation is for the eyes only) */
.order__sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.order__live-label { font-size: 0.8rem; font-stretch: 72%; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--paper-soft); }
.order__live-range { font-family: var(--sc-font-display); font-size: 1.6rem; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.order__live.is-changed .order__live-range { animation: live-hit 900ms var(--sc-ease-out); }
@keyframes live-hit { 0%, 30% { color: var(--accent-deep); } }

/* the gate: the estimate is right there, just not readable yet */
.peek {
  margin: -0.25rem 0 1rem; padding: 0.9rem 1rem 0.85rem;
  background: var(--paper-2);
  border: 1.5px dashed color-mix(in oklab, var(--paper-ink) 22%, transparent);
  border-radius: var(--r);
}
.peek[hidden] { display: none; }
.peek__what { margin: 0; font-size: 0.78rem; font-stretch: 72%; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-deep); }
.peek__range {
  margin: 0.3rem 0 0.25rem;
  font-family: var(--sc-font-display); font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.5rem); line-height: 1.05;
  filter: blur(7px); user-select: none; -webkit-user-select: none;
}
.peek__how { margin: 0; font-size: 0.88rem; color: var(--paper-soft); }

/* the tally: before the number lands, the takeoff behind it is written out
   like a work order (label, the dotted leader run across, the quantity),
   while the chalk line fills under it, one line item at a time */
.tally__title {
  margin: 0 0 1.1rem;
  font-family: var(--sc-font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.4rem); line-height: 0.98;
}
.tally__title:focus { outline: none; }
.tally__lines div { animation: row-in 300ms var(--sc-ease-out) both; animation-delay: calc(var(--i, 0) * var(--gap, 150ms)); }
.tally__lines div::after { transform-origin: left; animation: leader-run 240ms var(--sc-ease-out) both; animation-delay: calc(var(--i, 0) * var(--gap, 150ms) + 90ms); }
.tally__lines dd { animation: tally-fade 200ms var(--sc-ease-out) both; animation-delay: calc(var(--i, 0) * var(--gap, 150ms) + 280ms); }
@keyframes leader-run { from { transform: translateY(-0.28em) scaleX(0); } }
@keyframes tally-fade { from { opacity: 0; } }
.tally__line { display: block; width: 100%; height: 12px; margin: 0.9rem 0 0; overflow: visible; }
.tally__line path {
  fill: none; stroke: var(--sc-accent); stroke-width: 4px; stroke-linecap: round;
  filter: url(#chalk);
  stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--k, 0));
}
.tally__count {
  display: flex; align-items: center; gap: 0.4rem; min-height: 1.5rem; margin: 0.6rem 0 0;
  font-size: 0.78rem; font-stretch: 72%; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--paper-soft); font-variant-numeric: tabular-nums;
}
.tally__count .ico { display: none; width: 1.1rem; height: 1.1rem; stroke-width: 2.4; }
.tally.is-done .tally__count { color: var(--accent-deep); }
.tally.is-done .tally__count .ico { display: block; animation: tally-fade 240ms var(--sc-ease-out); }
@media (prefers-reduced-motion: reduce) {
  .tally__lines div, .tally__lines div::after, .tally__lines dd, .tally.is-done .tally__count .ico { animation: none; }
}

/* the reveal */
.est:focus { outline: none; }
.est__eyebrow {
  margin: 0 0 0.4rem;
  font: 700 0.8rem/1.2 var(--sc-font-text); font-stretch: 72%; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent-deep);
}
.est__eyebrow:focus { outline: none; }
.est__range {
  margin: 0;
  font-family: var(--sc-font-display); font-weight: 400;
  font-size: clamp(2.35rem, 1.5rem + 3.4vw, 3.5rem); line-height: 0.98;
  font-variant-numeric: tabular-nums;
}
.est__to { font-family: var(--sc-font-text); font-size: 0.36em; font-weight: 600; color: var(--paper-soft); vertical-align: 0.5em; margin: 0 0.15em; }
.est__line { display: block; width: min(100%, 21rem); height: 12px; margin: 0.35rem 0 0; overflow: visible; }
.est__line path {
  fill: none; stroke: var(--sc-accent); stroke-width: 4px; stroke-linecap: round;
  filter: url(#chalk);
  stroke-dasharray: 1; stroke-dashoffset: 0;
}
.est__meta { margin: 0.55rem 0 0; color: var(--paper-soft); font-size: 0.95rem; line-height: 1.45; }
.est__block { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--sc-hairline); }
.est__label { margin: 0 0 0.75rem; font-size: 0.78rem; font-stretch: 72%; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--paper-soft); }

/* where the money goes: one stacked bar, a 2px paper gap between segments,
   colours checked for colour-blind separation between neighbours, and the
   legend carries every label and number (colour is never the only cue) */
.est { --g-labour: #2f6db5; --g-finishes: #e8650c; --g-trades: #16987a; --g-materials: #d49500; --g-fees: #7a5fd0; }
.est__bar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; }
.est__seg { flex-basis: 0; min-width: 3px; background: var(--g); }
[data-group="labour"]    { --g: var(--g-labour); }
[data-group="finishes"]  { --g: var(--g-finishes); }
[data-group="trades"]    { --g: var(--g-trades); }
[data-group="materials"] { --g: var(--g-materials); }
[data-group="fees"]      { --g: var(--g-fees); }
.est__legend { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 0.35rem 1.5rem; }
.est__legend li { display: flex; align-items: center; gap: 0.55rem; font-size: 0.92rem; }
.est__legend li::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--g); }
.est__legend b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

/* by the numbers: a takeoff with dotted leaders, like a work order */
.est__takeoff { margin: 0; display: grid; }
.est__takeoff div { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.28rem 0; font-size: 0.95rem; }
.est__takeoff div::after {
  content: ""; order: 1; flex: 1; min-width: 1rem;
  border-bottom: 2px dotted color-mix(in oklab, var(--paper-ink) 26%, transparent);
  transform: translateY(-0.28em);
}
.est__takeoff dt { order: 0; }
.est__takeoff dd { order: 2; margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.est__takeoff div:last-child { margin-top: 0.2rem; padding-top: 0.5rem; border-top: 1px solid var(--sc-hairline); }
.est__takeoff div:last-child::after { display: none; }
.est__takeoff div:last-child dd { margin-left: auto; }
.est__rest { margin-top: 0.6rem; }
.est__rest summary { display: inline-flex; align-items: center; min-height: 40px; cursor: pointer; font-weight: 600; font-size: 0.92rem; text-decoration: underline; text-underline-offset: 0.22em; text-decoration-color: color-mix(in oklab, currentColor 35%, transparent); }
.est__rest p { margin: 0.2rem 0 0; color: var(--paper-soft); font-size: 0.9rem; line-height: 1.5; }

.est__nudge { margin: 0.5rem 0 0; text-align: center; color: var(--paper-soft); font-size: 0.86rem; text-wrap: balance; }
/* "Send it to Ryan" stays in reach while the estimate scrolls */
.est__next {
  position: sticky; bottom: 0; z-index: 1;
  margin: 1.5rem calc(clamp(1.25rem, 3vw, 2.25rem) * -1) calc(clamp(1.25rem, 3vw, 2.25rem) * -1);
  padding: 0.9rem clamp(1.25rem, 3vw, 2.25rem) calc(0.9rem + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--sc-hairline);
  border-radius: 0 0 var(--r) var(--r);
}

/* accuracy, and the three ways to sharpen it */
.sharpen { margin-top: 1.4rem; padding: 1rem 1rem 0.5rem; background: var(--paper-2); border: 1px solid var(--sc-hairline); border-radius: var(--r); }
.sharpen__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.sharpen__head .est__label { margin: 0; }
.sharpen__pct { margin: 0; font-family: var(--sc-font-display); font-size: 1.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.sharpen__meter { position: relative; height: 10px; margin-top: 0.6rem; border-radius: 5px; overflow: hidden; background: color-mix(in oklab, var(--paper-ink) 10%, transparent); }
.sharpen__meter span {
  position: absolute; inset: 0; transform-origin: left;
  transform: scaleX(var(--acc, 0.06));
  background: var(--sc-accent);
  transition: transform 700ms var(--sc-ease-out);
}
/* the meter reads in quarters, like marks on a tape */
.sharpen__meter::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent calc(25% - 1px), var(--paper-2) calc(25% - 1px), var(--paper-2) calc(25% + 1px), transparent calc(25% + 1px),
    transparent calc(50% - 1px), var(--paper-2) calc(50% - 1px), var(--paper-2) calc(50% + 1px), transparent calc(50% + 1px),
    transparent calc(75% - 1px), var(--paper-2) calc(75% - 1px), var(--paper-2) calc(75% + 1px), transparent calc(75% + 1px));
}
.sharpen__ends { display: flex; justify-content: space-between; margin: 0.35rem 0 0.4rem; font-size: 0.74rem; font-stretch: 72%; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--paper-soft); }
.sharpen__list { list-style: none; margin: 0; padding: 0; }
.sharpen__list li + li { border-top: 1px solid var(--sc-hairline); }
.spoke {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 0.75rem;
  width: 100%; min-height: 60px; padding: 0.6rem 0;
  background: none; border: 0; color: var(--paper-ink); text-align: left; cursor: pointer;
  font: inherit;
}
.spoke::after {
  content: ""; width: 8px; height: 8px; margin-right: 4px;
  border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg);
  color: var(--paper-soft);
}
.spoke__ico { width: 1.5rem; height: 1.5rem; color: var(--accent-deep); }
.spoke__text { display: grid; gap: 0.1rem; }
.spoke__name { font-weight: 700; }
.spoke__note { font-size: 0.88rem; color: var(--paper-soft); }
.spoke__gain { font-size: 0.82rem; font-weight: 700; color: var(--accent-deep); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .spoke:hover .spoke__name { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-color: var(--sc-accent); } }
.spoke:focus-visible { outline-offset: 2px; }
/* done: the icon becomes a check, chalk-orange */
.spoke.is-done .spoke__ico { color: #fff; background: var(--sc-accent); border-radius: 50%; padding: 0.2rem; }

/* back on the hub, sharper: the range and the meter say so */
.est.is-sharpened .est__range { animation: live-hit 1100ms var(--sc-ease-out); }
.est.is-sharpened .sharpen__pct { animation: live-hit 1100ms var(--sc-ease-out); }

/* measurements */
.measure { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 0 0.75rem; }
.measure[hidden], [data-measure-sqft][hidden] { display: none; }
.measure__x { margin-bottom: 1rem; padding-bottom: 0.85rem; font: 400 1.5rem/1 var(--sc-font-text); color: var(--paper-soft); }
/* the hub has its own accuracy meter; the step counter steps aside */
.order.is-hub .order__top { display: none; }
.unit { position: relative; }
.unit input { padding-right: 3.6rem; font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.unit span { position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--paper-soft); font-weight: 600; pointer-events: none; }
.measure__out { margin: -0.25rem 0 0.9rem; min-height: 1.6rem; font-family: var(--sc-font-display); font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.measure__out:empty { visibility: hidden; }

/* photos */
.drop {
  position: relative; display: grid; justify-items: center; gap: 0.3rem;
  padding: 1.6rem 1rem; margin-bottom: 0.9rem;
  background: var(--paper-2);
  border: 2px dashed color-mix(in oklab, var(--paper-ink) 26%, transparent);
  border-radius: var(--r);
  text-align: center; cursor: pointer;
  transition: border-color 140ms var(--sc-ease-out), background-color 140ms var(--sc-ease-out);
}
.drop[hidden] { display: none; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop:has(input:focus-visible) { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.drop.is-over, .drop:hover { border-color: var(--sc-accent); background: #fff1e6; }
.drop__ico { width: 2rem; height: 2rem; color: var(--accent-deep); }
.drop__title { font-weight: 700; font-size: 1.05rem; }
.drop__hint { color: var(--paper-soft); font-size: 0.9rem; }
.drop__off { margin: 0 0 0.9rem; padding: 0.8rem 1rem; background: var(--paper-2); border-left: 3px solid var(--sc-accent); font-size: 0.95rem; }
.drop__off[hidden] { display: none; }
.thumbs { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: 0.5rem; }
.thumbs:empty { display: none; }
.thumb { position: relative; aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: var(--paper-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-up img { opacity: 0.45; }
.thumb.is-failed img { opacity: 0.25; filter: grayscale(1); }
.thumb__state { position: absolute; inset: auto 0 0 0; padding: 0.25rem; background: color-mix(in oklab, var(--paper) 88%, transparent); font-size: 0.72rem; font-weight: 700; text-align: center; }
.thumb.is-failed .thumb__state { color: var(--danger); }
.thumb__x {
  position: absolute; top: 4px; right: 4px; display: grid; place-items: center;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(17, 17, 16, 0.72); color: #fff; cursor: pointer;
}
.thumb__x .ico { width: 1rem; height: 1rem; stroke-width: 2.2; }

/* the live range waits on the server for a moment */
.order__live.is-busy .order__live-range { opacity: 0.55; transition: opacity 200ms 120ms; }
.est__status:empty { display: none; }
.est__status { margin-top: 1.1rem; }
.est__sent { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-weight: 600; font-size: 0.95rem; }
.est__sent .ico { color: var(--accent-deep); stroke-width: 2.4; }
.est__unsent { padding: 0.9rem 1rem; background: var(--paper-2); border-left: 3px solid var(--danger); border-radius: 0 var(--r) var(--r) 0; }
.est__unsent p { margin: 0 0 0.75rem; font-size: 0.95rem; }
.est__fine { margin: 1rem 0 0; color: var(--paper-soft); font-size: 0.84rem; line-height: 1.5; }

/* the reveal, once: the numbers count up, the chalk line snaps under them,
   the bar fills left to right and the rows land in order */
.est.is-revealing .est__line path { stroke-dashoffset: 1; animation: chalk-draw 560ms var(--sc-ease-out) 820ms forwards; }
.est.is-revealing .est__bar { animation: bar-fill 760ms var(--sc-ease-out) 380ms both; }
.est.is-revealing .est__legend li,
.est.is-revealing .est__takeoff div { animation: row-in 420ms var(--sc-ease-out) both; animation-delay: calc(620ms + var(--i, 0) * 55ms); }
@keyframes bar-fill { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes row-in { from { opacity: 0; transform: translate3d(0, 6px, 0); } }

.close__side { padding-top: clamp(0rem, 1vw, 0.5rem); }
.close__faq-title { margin: 0 0 0.75rem; font-size: 1rem; font-weight: 700; }
.faq details { border-top: 1px solid var(--sc-hairline); }
.faq details:last-child { border-bottom: 1px solid var(--sc-hairline); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  min-height: 52px; padding: 0.8rem 0;
  font-weight: 600; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 12px; height: 12px;
  background: linear-gradient(var(--sc-accent), var(--sc-accent)) center / 12px 2px no-repeat,
              linear-gradient(var(--sc-accent), var(--sc-accent)) center / 2px 12px no-repeat;
  transition: transform 180ms var(--sc-ease-out);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 1rem; color: var(--sc-ink-soft); max-width: 44ch; }
.contact { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 0.75rem; }
.contact a { display: flex; align-items: center; gap: 0.9rem; color: var(--sc-ink); text-decoration: none; }
.contact a:hover strong { color: var(--sc-accent); }
.contact .ico { width: 2.75rem; height: 2.75rem; padding: 0.7rem; color: var(--sc-accent); background: var(--sc-surface); border-radius: var(--r); }
.contact span { display: grid; font-variant-numeric: tabular-nums; }
.contact strong { font-size: 0.8rem; font-stretch: 72%; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sc-ink-soft); transition: color 140ms var(--sc-ease-out); }

.foot { margin-top: clamp(4rem, 9vw, 7rem); border-top: 1px solid var(--sc-hairline); }
.foot__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 2rem; padding-block: 2rem; color: var(--sc-ink-soft); font-size: 0.9rem; }
.foot__inner p { margin: 0; }
.foot__inner a { color: var(--sc-ink); }
.foot__logo { height: 20px; width: auto; }
.foot__small { margin-left: auto !important; }

@media (max-width: 899px) {
  .close__grid { grid-template-columns: 1fr; }
  .order { margin-inline: calc(var(--gutter) * -0.5); }
  .choices--tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot__small { margin-left: 0 !important; }
}

/* --------------------------------------------------------------- dock ---- */
.dock { display: none; }
@media (max-width: 899px) {
  .dock {
    position: fixed; inset: auto 0 0 0; z-index: 70;
    display: grid; grid-template-columns: auto 1fr; gap: 0.5rem;
    padding: 0.6rem var(--gutter) calc(0.6rem + env(safe-area-inset-bottom));
    background: color-mix(in oklab, var(--sc-canvas) 96%, transparent);
    border-top: 1px solid var(--sc-hairline);
    transition: transform 260ms var(--sc-ease-out);
  }
  .dock.is-hidden { transform: translateY(110%); }
  .dock__call {
    display: inline-flex; align-items: center; gap: 0.5rem;
    min-height: 54px; padding: 0 1.15rem;
    background: var(--sc-surface); color: var(--sc-ink);
    border: 1px solid var(--sc-hairline); border-radius: var(--r);
    font-weight: 700; text-decoration: none;
  }
  .dock__call .ico { color: var(--sc-accent); }
  .dock__quote { min-height: 54px; font-size: 1.05rem; min-width: 0; white-space: nowrap; }
}
/* the full label doesn't fit beside Call on the narrowest phones */
@media (max-width: 399px) {
  .dock__long { display: none; }
}

/* -------------------------------------------------------------- sheet ---- */
.sheet {
  width: min(36rem, calc(100vw - 2rem));
  max-height: min(92svh, 56rem);
  padding: 0; border: 0; border-radius: var(--r);
  background: var(--paper); color: var(--paper-ink);
  box-shadow: var(--sc-e3);
  overscroll-behavior: contain;
}
.sheet::backdrop { background: rgba(10, 10, 9, 0.74); }
.sheet[open] { animation: sheet-in 260ms var(--sc-ease-out); }
@keyframes sheet-in { from { opacity: 0; transform: translate3d(0, 18px, 0); } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation-name: step-fade; } }
.sheet__head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.6rem 0.4rem clamp(1.25rem, 3vw, 2.25rem);
  background: var(--paper);
}
.sheet__title { margin: 0; color: var(--accent-deep); }
.sheet__close {
  display: grid; place-items: center; width: 44px; height: 44px;
  background: transparent; border: 0; border-radius: var(--r); color: var(--paper-ink); cursor: pointer;
}
.sheet__close:hover { background: color-mix(in oklab, var(--paper-ink) 8%, transparent); }
.sheet__close:focus-visible { outline-color: var(--accent-deep); }
.sheet .order { box-shadow: none; max-width: none; padding-top: 0.25rem; margin: 0; border-radius: 0; }
html.is-sheet-open { overflow: hidden; }
@media (max-width: 899px) {
  .sheet { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .sheet[open] { animation-name: sheet-up; }
  @keyframes sheet-up { from { transform: translate3d(0, 6%, 0); opacity: 0; } }
}
