.process-page {
  --header-h: 102px;
  --rail-h: 56px;
  --gutter: clamp(20px, 5vw, 84px);
  --rail-ink: #262f30;
}

.journey-hero {
  isolation: isolate;
  position: relative;
  display: grid;
  align-items: end;
  overflow: hidden;
  min-height: 510px;
  height: min(740px, calc(94svh - var(--header-h)));
  color: #fffaf1;
  background: #363b32;
}
.hero-room, .hero-wash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.hero-room { object-fit: cover; object-position: center 53%; }
.hero-wash {
  background: linear-gradient(90deg, rgb(16 25 24 / .86), rgb(17 24 23 / .56) 40%, transparent 79%),
              linear-gradient(0deg, rgb(14 19 17 / .43), transparent 30%);
}
.journey-title {
  padding: clamp(50px, 8vh, 100px) var(--gutter);
  max-width: 1120px;
}
.journey-title .eyebrow { letter-spacing: .20em; }
.journey-title h1 {
  font-size: clamp(62px, 7.8vw, 126px);
  line-height: .98;
  margin: 22px 0;
}
.journey-title > p:not(.eyebrow) {
  max-width: 42ch;
  font-size: clamp(15px, 1.2vw, 19px);
  line-height: 1.58;
}
.hero-actions { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-top: 28px; }
.hero-actions .button { background: #f5f0e5; color: #252d29; }
.hero-actions .button:hover { background: white; }
.journey-start { display: inline-flex; align-items: center; gap: 13px; padding: 9px 0; border-bottom: 1px solid #fff9; font-size: 13px; }
.journey-start span { font-size: 19px; }
.hero-credit { position: absolute; right: var(--gutter); bottom: 14px; color: white; background: #1c2423ba; padding: 3px 6px; font-size: 10px; }

.journey { position: relative; }
.chapter-rail {
  position: sticky;
  top: var(--header-h);
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 var(--gutter);
  background: #f8f6f0;
  border-bottom: 1px solid #d8d5cc;
}
.chapter-rail a {
  min-height: var(--rail-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  color: #494f49;
  font-size: 14px;
}
.rail-number, .chapter-marker, .journey-scene figcaption span, .material-tag span {
  font-family: ui-monospace, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.rail-number { font-size: 10px; color: #7d6359; }
.chapter-rail a::after {
  content: "";
  position: absolute;
  bottom: -1px; right: 12%; left: 12%; height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left center;
}
.chapter-rail a:hover::after, .chapter-rail a:focus-visible::after,
.chapter-rail [aria-current="step"]::after { transform: scaleX(1); }
.chapter-rail [aria-current="step"] { color: var(--ink); font-weight: 650; }
.journey-layout { padding: 0 var(--gutter); }
.chapter {
  display: grid;
  grid-template-columns: 1.46fr 1fr;
  gap: clamp(28px, 5vw, 84px);
  align-items: center;
  padding: 42px 0;
  scroll-margin-top: calc(var(--rail-h) + 12px);
}
.chapter-copy { grid-column: 2; grid-row: 1; max-width: 530px; }
.chapter-marker {
  display: flex; align-items: center; gap: 12px;
  text-transform: uppercase; letter-spacing: .12em;
  font-size: 12px; font-weight: 600; color: #795043;
}
.chapter-marker span { width: 34px; height: 1px; background: currentColor; }
.chapter h2 {
  margin: 21px 0 22px;
  font-size: clamp(36px, 4vw, 68px);
  line-height: 1.02;
}
.chapter-copy > p:not(.chapter-marker) { max-width: 43ch; color: #4c5750; line-height: 1.72; font-size: clamp(15px, 1.13vw, 18px); }
.chapter-copy > p + p { margin-top: 12px; }
.chapter-copy .text-link { color: var(--blue); margin-top: 15px; }
.scene-dock, .finish-controls { display: none; }
.journey-scene {
  grid-column: 1; grid-row: 1;
  display: flex; flex-direction: column;
  margin: 0; min-width: 0; overflow: hidden; isolation: isolate;
  background: #e4dfd3;
}
.art-field { position: relative; flex: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; }
.journey-scene svg { display: block; width: 100%; height: 100%; }
.chapter .art-field { aspect-ratio: 1.43; }
.journey-scene figcaption {
  display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 2px 10px;
  padding: 14px 19px; font-size: 13px;
  background: #f0ede4; color: #333c37; border-top: 1px solid #686c6529;
}
.journey-scene figcaption span { font-size: 10px; letter-spacing: .035em; }
.drawing-scene { background: #233a44; }
.drawing-scene figcaption { background: #1e323a; color: #e2e8e0; border-color: #e6e9dd35; }
.materials-scene { background: #d9d1c1; }
.material-desk { background: linear-gradient(135deg, #e2d9c8, #d3c6af 58%, #e9dfcb); }
.material-finish, .material-door, .material-tag { position: absolute; }
.material-finish {
  width: 49%; aspect-ratio: 1; right: 10%; bottom: 13%;
  transform: rotate(9deg);
  filter: drop-shadow(4px 8px 6px #33281550);
}
.material-finish img { width: 100%; height: 100%; object-fit: contain; }
.material-door {
  width: 81%; height: 116%; left: -4%; top: -12%;
  object-fit: contain; transform: rotate(-9deg);
  filter: drop-shadow(4px 9px 6px #33281552);
}
.material-tag { right: 8%; bottom: 6%; background: #fff9e9; min-width: 26%; padding: 8px 16px; transform: rotate(-3deg); box-shadow: 2px 4px 7px #352c1b35; }
.material-tag span { display: block; text-transform: uppercase; letter-spacing: .1em; font-size: 9px; }
.material-tag strong { font: italic clamp(19px, 2vw, 33px)/1.25 Georgia, serif; }
.process-ready .finish-controls { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 17px 0 0; }
.finish-controls legend { padding: 0 0 8px; font-size: 13px; font-weight: 600; }
.finish-controls label {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 10px; min-height: 38px; cursor: pointer;
  border: 1px solid #bdbab0; color: #384039; font-size: 12px;
}
.finish-controls label:has(input:checked) { box-shadow: inset 0 0 0 1px #394a42; border-color: #394a42; }
.finish-controls label:focus-within { outline: 2px solid var(--red); outline-offset: 2px; }
.finish-controls input { position: absolute; inset: 0; z-index: 1; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.chip { display: block; width: 13px; height: 13px; border: 1px solid #5556; border-radius: 50%; }
.chip-natural { background: #b68861; }.chip-linen { background: #e7e1d2; }.chip-basil { background: #242c1d; }
.build-scene { background-color: #e5e0d3; background-image: radial-gradient(#b9b3a3 .65px, transparent .8px); background-size: 12px 12px; }
.assembly-counter { transform: translateY(-46px); }
.assembly-case { transform: translateY(-14px); }
.project-credit { padding: 15px var(--gutter) 35px; color: #62685f; font-size: 11px; }
.process-page footer { border-top: 1px solid var(--line); }

.scrolly .journey-layout {
  display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr);
  gap: clamp(28px, 5vw, 84px); align-items: start;
}
.scrolly .scene-dock {
  position: sticky; display: block;
  top: calc(var(--header-h) + var(--rail-h) + 18px);
  margin: 18px 0;
  height: clamp(238px, calc(100svh - var(--header-h) - var(--rail-h) - 38px), 730px);
  max-height: 49vw;
  isolation: isolate;
}
.scene-dock .journey-scene {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility 0s .5s;
}
.scene-dock .is-current { opacity: 1; visibility: visible; transition-delay: 0s; }
.scrolly .chapter { display: flex; min-height: max(460px, 86svh); align-items: center; }
.scrolly .hero-room { transform: translateY(var(--hero-shift,0px)) scale(1.09); }
.scrolly .plan-ink { clip-path: inset(0 var(--drawing-mask, 0%) 0 0); }
.scrolly .plan-route { clip-path: inset(0 var(--route-mask, 0%) 0 0); }
.scrolly .assembly-counter { transform: translateY(var(--counter-lift,-66px)); }
.scrolly .assembly-case { transform: translateY(var(--case-lift,-22px)); }
.scrolly .material-door { transform: translateY(var(--door-shift, 0px)) rotate(var(--door-angle,-9deg)); }
.scrolly .material-finish { transform: translateY(var(--finish-shift,0px)) rotate(var(--finish-angle,9deg)); }

@media (max-width: 960px) { .process-page { --header-h: 90px; } }
@media (max-width: 760px) {
  .process-page { --header-h: 82px; --rail-h: 44px; --gutter: 20px; }
  .journey-hero { min-height: 450px; height: clamp(450px, 74svh, 680px); }
  .hero-room { object-position: 60% center; }
  .hero-wash { background: linear-gradient(0deg, rgb(18 26 23 / .89), rgb(16 26 21 / .58) 53%, rgb(10 20 18 / .04) 100%); }
  .journey-title { padding: 44px var(--gutter); }
  .journey-title h1 { font-size: clamp(49px, 10vw, 78px); margin: 12px 0 14px; }
  .journey-title > p:not(.eyebrow) { max-width: 36ch; font-size: 15px; }
  .hero-actions { gap: 12px 20px; margin-top: 20px; }
  .hero-actions .button { padding: 13px; gap: 13px; }
  .journey-start { font-size: 12px; gap: 6px; }
  .hero-credit { bottom: 6px; font-size: 9px; }
  .chapter-rail { padding: 0 5px; }
  .chapter-rail a { font-size: 13px; gap: 5px; }
  .rail-number { font-size: 9px; }
  .chapter { display: flex; flex-direction: column; align-items: stretch; gap: 20px; }
  .chapter h2 { margin: 13px 0 15px; font-size: clamp(35px,7vw,50px); }
  .chapter-copy { max-width: 580px; }
  .chapter-copy > p:not(.chapter-marker) { max-width: 55ch; font-size: 15px; }
  .journey-scene figcaption { padding: 7px 10px; font-size: 11px; }
  .journey-scene figcaption span { font-size: 9px; }
  .scrolly .journey-layout { display: block; padding: 0; }
  .scrolly .scene-dock {
    top: calc(var(--header-h) + var(--rail-h));
    z-index: 3;
    height: clamp(172px, 33svh, 285px);
    max-height: none; margin: 0; background: var(--paper);
  }
  .scrolly .chapters { padding: 0 var(--gutter); }
  .scrolly .chapter {
    min-height: max(375px, 65svh);
    display: block; padding: 26px 0 42px;
    scroll-margin-top: calc(var(--rail-h) + var(--scene-h, 200px));
  }
  .scrolly .chapter + .chapter { border-top: 1px solid var(--line); }
  .material-tag { padding: 5px 9px; }
  .scrolly .material-desk { background: linear-gradient(125deg,#eae2d0,#c9baa0); }
  .scrolly .material-door { height: 135%; }
  .scrolly .material-finish { width: min(43%, 22svh); right: 16%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .journey-scene, .journey-scene * { transition: none !important; }
}

/* The last chapter opens the small study into a room-wide matched reveal. */
.chapter.finale, .scrolly .chapter.finale { display: block; min-height: 0; padding: 0; scroll-margin-top: var(--rail-h); }
.finale-frame { position: relative; margin: 0; height: min(68vw, 710px); overflow: hidden; background: #d5c9b6; }
.finale-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }
.sketch-curtain { position: absolute; inset: 0; clip-path: inset(0 65% 0 0); }
.finale-frame figcaption { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; gap: 10px; align-items: end; padding: 15px var(--gutter); pointer-events: none; }
.finale-frame figcaption span { font-size: 11px; background: #28332eed; color: #fff9ed; padding: 5px 9px; }
.finale-copy { padding: clamp(38px,6vw,86px) var(--gutter) 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 7vw; align-items: start; }
.finale-copy h2 { font-size: clamp(48px, 6vw, 98px); }
.finale-copy p:not(.chapter-marker) { font-size: 17px; color: #4c5750; max-width: 52ch; }
.finale-copy .text-link { color: var(--blue); margin-top: 20px; }
.scrolly .reveal-track { position: relative; height: 142svh; }
.scrolly .finale-frame { position: sticky; top: calc(var(--header-h) + var(--rail-h)); height: calc(100svh - var(--header-h) - var(--rail-h)); }
.scrolly .sketch-curtain { clip-path: inset(0 var(--photo-amount, 12%) 0 0); }
.scrolly .sketch-curtain::after { content: ""; position: absolute; top: 0; bottom: 0; right: var(--photo-amount,12%); width: 2px; background: #faf6e6; }
.scrolly .finale-frame figcaption span:first-child { opacity: var(--sketch-label,1); }
@media (max-width: 760px) {
  .finale-copy { grid-template-columns: 1fr; gap: 0; }
  .finale-frame { min-height: 275px; }
  .finale-frame figcaption { padding: 10px; }
  .finale-frame figcaption span { font-size: 9px; padding: 4px 6px; }
  .scrolly .reveal-track { height: 118svh; }
  .scrolly .finale-frame { height: min(63svh, 565px); }
}
.finale-copy .journey-phone { margin-top: 12px; font-size: 14px; }
.journey-phone a { text-decoration: underline; text-underline-offset: 3px; }
