/* Kellbrook Developers: sample site by GravenReach Media. Stone, slate, clay; sand, dusk and brass added in the polish round. */
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-roman-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@view-transition { navigation: auto; }

:root {
  /* Colour, polish round: the 15 tokens of polish/palette.json (contract C1). Every palette colour is set here and nowhere else; ratios in DESIGN-RECORD.md. */
  --stone: #eeeae3; --paper: #f7f5f0; --rule: #cfc8bb; --sand: #ddcdb0;
  --slate: #2c3a37; --slate-2: #4b5955; --sage: #7b8a72;
  --clay: #b0603a; --clay-ink: #8e4424; --clay-deep: #94482a; --laterite: #5e301f; --brass: #c9a25a;
  --dusk: #17211e; --dusk-2: #22302c; --mist: #aab6b1;
  /* derived and kept names, so every page and pack piece keeps working */
  --stone-2: #e5e0d6; --line: var(--rule); --line-2: #b9b1a2; --clay-l: #e9cdbb; --clay-wash: #f6e9df;
  --slate-3: var(--slate-2); /* the old #6c7a76 measured 3.74:1 on stone, under 4.5:1 at 14 px: retired as its own colour */
  --clay-d: var(--clay-ink);  /* clay at text size */
  --serif: "Fraunces", Georgia, serif; --sans: "Inter", system-ui, sans-serif;
  --pad: clamp(20px, 4.4vw, 64px); --max: 1280px; --ease: cubic-bezier(.22,1,.36,1); --ease-x: cubic-bezier(.65,0,.35,1); /* one easing family (ART-DIRECTION.md, Motion): ease-out for moves and reveals, ease-in-out for cross-fades */
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--stone); color: var(--slate); font: 400 17px/1.6 var(--sans); overflow-x: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
/* photographs, renders and product art keep their own colour: no filter, blend or tint is ever set on them */
img, picture, video { filter: none; mix-blend-mode: normal; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; font-variation-settings: "opsz" 72, "SOFT" 50, "WONK" 0; letter-spacing: -0.01em; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(40px, 5.2vw, 80px); }
h2 { font-size: clamp(32px, 4.2vw, 58px); }
h3 { font-size: clamp(22px, 2vw, 28px); line-height: 1.2; }
p { margin: 0 0 1em; max-width: 62ch; }
.mono { font-family: var(--sans); font-feature-settings: "tnum" 1, "ss01" 1; }
.kicker { font: 600 14px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--slate-3); }
.lede { font-size: clamp(18px, 1.5vw, 21px); color: var(--slate-2); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* moving ground: survey contours */
#ground { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; opacity: .9; }

/* header */
.top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--stone) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.top.scrolled { border-bottom-color: var(--line); }
.top .wrap { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand svg { width: 34px; height: 34px; }
.brand svg path { stroke: var(--slate); stroke-width: 2.2; fill: none; stroke-dasharray: 140; stroke-dashoffset: 140; animation: draw 1.6s var(--ease) .1s forwards; }
.brand b { font: 500 22px/1 var(--serif); letter-spacing: .005em; }
.brand small { display: block; font: 500 14px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--slate-3); margin-top: 4px; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { text-decoration: none; font-size: 15px; font-weight: 500; padding: 10px 12px; border-radius: 8px; position: relative; transition: background .2s, color .2s; }
.nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 1.5px; background: var(--clay); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.nav a:hover { background: var(--stone-2); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a:active { background: var(--line); }
.menu-btn { display: none; }

/* buttons */
.btn { --bg: var(--slate); --fg: var(--paper); display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 13px 22px; border-radius: 999px; background: var(--bg); color: var(--fg); font: 600 16px/1.2 var(--sans); text-decoration: none; border: 1.5px solid var(--bg); cursor: pointer; position: relative; overflow: hidden; isolation: isolate; transition: transform .2s var(--ease), box-shadow .25s; box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 6px 18px -8px rgba(44,58,55,.45); }
.btn::before { content: ""; position: absolute; inset: 0; background: var(--laterite); transform: translateY(101%); transition: transform .45s var(--ease); z-index: -1; }
.btn:hover::before { transform: translateY(0); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.98); box-shadow: none; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--clay); outline-offset: 3px; }
.btn .arr { transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn.cta { --bg: var(--clay-deep); }
.btn.ghost { --bg: transparent; --fg: var(--slate); border-color: var(--slate); box-shadow: none; }
.btn.ghost:hover { --fg: var(--paper); color: var(--paper); }
.btn.wa { --bg: #fff; --fg: var(--slate); border-color: var(--line-2); box-shadow: none; }
.btn.wa:hover { color: var(--paper); }
.btn.wa svg { width: 20px; height: 20px; }
.textlink { color: var(--clay-d); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; transition: color .2s, text-underline-offset .2s; }
.textlink:hover { color: var(--slate); text-underline-offset: 6px; }
.textlink:active { color: var(--laterite); }

/* sheet frame: the signature device (a drawing sheet title block) */
.sheet { position: relative; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--paper) 70%, transparent); }
.sheet::before, .sheet::after { content: ""; position: absolute; width: 14px; height: 14px; border: 1.5px solid var(--slate); }
.sheet::before { top: -7px; left: -7px; border-right: 0; border-bottom: 0; }
.sheet::after { bottom: -7px; right: -7px; border-left: 0; border-top: 0; }
.titleblock { display: grid; grid-template-columns: repeat(4, auto); border-top: 1px solid var(--line-2); font-size: 14px; background: var(--sand); color: var(--slate); }
.titleblock > div { padding: 10px 14px; border-right: 1px solid var(--line-2); }
.titleblock > div:last-child { border-right: 0; }
.titleblock span { display: block; color: var(--slate-3); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.titleblock b { font-weight: 600; }

/* hero */
.hero { padding: clamp(28px, 5vw, 64px) 0 clamp(40px, 6vw, 80px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: stretch; }
@media (min-width: 961px) { .hero-grid.villa { grid-template-columns: .9fr 1.1fr; } }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }
.hero h1 .line > span { display: inline-block; transform: translateY(105%); animation: rise 1s var(--ease) forwards; }
.hero h1 .line:nth-child(2) > span { animation-delay: .09s; }
.hero h1 .line:nth-child(3) > span { animation-delay: .18s; }
@keyframes rise { to { transform: none; } }
.hero h1 em { font-style: italic; color: var(--clay-d); font-variation-settings: "opsz" 72, "SOFT" 100, "WONK" 1; }
.hero .lede { margin-top: 22px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; align-items: center; }
.stage { position: relative; min-height: 440px; overflow: hidden; }
.stage canvas.three { position: absolute; inset: 0; width: 100% !important; height: 100% !important; cursor: grab; touch-action: pan-y; }
.stage canvas.three:active { cursor: grabbing; }
.stage .fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; }
.stage .hud { position: absolute; left: 14px; right: 14px; top: 12px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; font-size: 14px; color: var(--slate-2); }
.stage .hud b { color: var(--slate); }
.stage .hint { position: absolute; right: 14px; bottom: 12px; font-size: 14px; color: var(--slate-3); pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--clay); box-shadow: 0 0 0 0 var(--clay); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(176,96,58,.5); } 70% { box-shadow: 0 0 0 10px rgba(176,96,58,0); } 100% { box-shadow: 0 0 0 0 rgba(176,96,58,0); } }
.demo { font: 700 14px/1 var(--sans); letter-spacing: .08em; color: var(--clay-d); border: 1px solid var(--clay-l); background: var(--clay-wash); padding: 3px 6px; border-radius: 4px; vertical-align: middle; white-space: nowrap; }
.samplenote { font-size: 14px; color: var(--slate-3); }

/* sections */
section { padding: clamp(56px, 8vw, 120px) 0; }
.sec-head { display: grid; grid-template-columns: 220px 1fr; gap: 24px; margin-bottom: clamp(28px, 4vw, 48px); align-items: start; }
.sec-head .no { font: 500 15px/1.4 var(--sans); color: var(--slate-3); padding-top: 12px; border-top: 1.5px solid var(--slate); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 40px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.4vw, 28px); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: clamp(20px, 2.4vw, 32px); position: relative; transition: transform .35s var(--ease), box-shadow .35s, border-color .3s; }
a.card { text-decoration: none; display: block; }
a.card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -24px rgba(44,58,55,.4); border-color: var(--slate-3); }
a.card:active { transform: translateY(-1px); }
.card .more { margin-top: 18px; display: inline-flex; gap: 8px; color: var(--clay-d); font-weight: 600; border-bottom: 1.5px solid currentColor; padding-bottom: 2px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 16px 0 0; font-size: 16px; }
.facts dt, .facts dd { margin: 0; padding: 9px 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--slate-3); padding-right: 18px; }
.facts dd { font-weight: 500; text-align: right; font-feature-settings: "tnum" 1; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); }
.steps li::before { content: counter(s, decimal-leading-zero); font: 400 32px/1 var(--serif); color: var(--clay-d); }
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; color: var(--slate-2); }

/* reveal */
.mo .rv { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.rv.in { opacity: 1; transform: none; }
.rv-d1 { transition-delay: .08s; } .rv-d2 { transition-delay: .16s; } .rv-d3 { transition-delay: .24s; }

/* plans (drawn) */
.plan { width: 100%; height: auto; }
.plan .wall { fill: none; stroke: var(--slate); stroke-width: 3; stroke-linejoin: round; }
.plan .thin { fill: none; stroke: var(--slate-2); stroke-width: 1.2; }
.plan .room { fill: transparent; transition: fill .25s; }
.plan .room:hover, .plan .room.hl { fill: rgba(176,96,58,.12); }
.plan text { font-family: var(--sans); font-size: 15px; fill: var(--slate); }
.plan text.dim { fill: var(--slate-3); font-size: 14px; }
.plan .draw { stroke-dasharray: var(--len, 2000); stroke-dashoffset: var(--len, 2000); transition: stroke-dashoffset 2.2s var(--ease); }
.plan.in .draw { stroke-dashoffset: 0; }
.plan .lbl { opacity: 0; transition: opacity .6s .9s; }
.plan.in .lbl { opacity: 1; }
.plan .door { fill: none; stroke: var(--slate-3); stroke-width: 1; }
.plan .accent { stroke: var(--clay); }

/* compare */
.picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.picker button { font: 500 15px/1 var(--sans); padding: 12px 16px; min-height: 44px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--paper); color: var(--slate); cursor: pointer; transition: background .2s, border-color .2s, transform .15s; }
.picker button:hover { border-color: var(--slate); }
.picker button:active { transform: scale(.97); }
.picker button[aria-pressed="true"] { background: var(--slate); color: var(--paper); border-color: var(--slate); }
.table-wrap { width: 100%; }
table.cmp { width: 100%; border-collapse: collapse; font-size: 16px; background: var(--paper); }
table.cmp th, table.cmp td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.cmp thead th { font: 600 14px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--slate-3); background: var(--stone-2); position: sticky; top: 72px; }
table.cmp td { font-feature-settings: "tnum" 1; transition: background .4s; }
table.cmp tr:hover td { background: #f1ede5; }
table.cmp td.diff { background: var(--clay-wash); }
table.cmp .row-h { font-weight: 600; }
.cmp-pair { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.cmp-pair > div { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 16px; }
.cmp-pair > div:first-child { color: var(--slate-3); }
.cmp-pair .diff { background: var(--clay-wash); font-weight: 600; }
.cmp-pair.head > div { font-weight: 600; background: var(--stone-2); }

/* forms */
form.enq { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.field input, .field select, .field textarea { font: 400 17px/1.4 var(--sans); padding: 13px 14px; border: 1.5px solid var(--line-2); border-radius: 6px; background: #fff; color: var(--slate); min-height: 50px; transition: border-color .2s, box-shadow .2s; width: 100%; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--slate-3); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--slate); box-shadow: 0 0 0 4px rgba(44,58,55,.1); outline: none; }
.field .err { color: #a02c1c; font-size: 14px; min-height: 0; }
.field.bad input, .field.bad select { border-color: #a02c1c; }
.notice { border-left: 3px solid var(--clay); background: #f6ede6; padding: 12px 16px; font-size: 15px; }
.formdone { display: none; padding: 16px; background: var(--paper); border: 1px solid var(--line); }
.formdone.show { display: block; animation: rise2 .5s var(--ease); }
@keyframes rise2 { from { opacity: 0; transform: translateY(10px); } }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.slots button { font: 500 15px/1.3 var(--sans); padding: 12px 10px; border: 1.5px solid var(--line-2); border-radius: 6px; background: #fff; cursor: pointer; color: var(--slate); text-align: left; transition: border-color .2s, background .2s, transform .15s; min-height: 64px; }
.slots button small { display: block; color: var(--slate-3); font-size: 14px; }
.slots button:hover { border-color: var(--slate); }
.slots button:active { transform: scale(.97); }
.slots button[aria-pressed="true"] { background: var(--slate); color: var(--paper); border-color: var(--slate); }
.slots button[aria-pressed="true"] small { color: var(--clay-l); }
.slots button:disabled { opacity: .45; cursor: not-allowed; text-decoration: line-through; }

/* progress bars */
.prog { display: grid; gap: 14px; }
.prog .row { display: grid; grid-template-columns: 110px 1fr 120px; gap: 14px; align-items: center; font-size: 15px; }
.prog .bar { height: 10px; background: var(--stone-2); border-radius: 6px; overflow: hidden; }
.prog .bar i { display: block; height: 100%; width: 0; background: var(--slate); transition: width 1.6s var(--ease); }
.prog.in .bar i { width: var(--w); }
input[type="range"].scrub { width: 100%; accent-color: var(--clay); height: 32px; cursor: pointer; }

/* map (drawn) */
.map text { font-family: var(--sans); font-size: 15px; fill: var(--slate); }
.map .road { fill: none; stroke: #fff; stroke-linecap: round; }
.map .road-edge { fill: none; stroke: var(--line-2); stroke-linecap: round; }
.map .route { fill: none; stroke: var(--clay); stroke-width: 3; stroke-dasharray: 8 7; animation: march 1.2s linear infinite; }
@keyframes march { to { stroke-dashoffset: -30; } }

/* footer */
.foot { border-top: 1px solid var(--slate); padding: 48px 0 110px; margin-top: 40px; background: var(--slate); color: var(--paper); }
.foot .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.foot h4 { margin: 0 0 10px; font: 600 14px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--mist); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.foot a { text-decoration: none; display: inline-block; padding: 4px 0; border-bottom: 1px solid transparent; transition: border-color .2s, color .2s; }
.foot a:hover { border-bottom-color: var(--sand); color: var(--sand); }
.foot a:focus-visible { outline-color: var(--sand); }
.foot .brand svg path { stroke: var(--paper); }
.foot .brand small { color: var(--mist); }
.foot .sample { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--slate-2); font-size: 14px; color: var(--mist); display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* grounds of the polish round: at most one sand band and one dusk chapter per page, placed by each page */
.g-sand { background: var(--sand); color: var(--slate); }
.g-sand .kicker, .g-sand .lede, .g-sand .facts dt { color: var(--slate); }
.g-dusk { background: var(--dusk); color: var(--stone); }
.g-dusk-2 { background: var(--dusk-2); color: var(--stone); }
.g-dusk .lede, .g-dusk p, .g-dusk .samplenote, .g-dusk-2 p, .g-dusk-2 .samplenote { color: var(--mist); }
.g-dusk .kicker, .g-dusk .sec-head .no, .g-dusk .facts dt, .g-dusk-2 .kicker { color: var(--brass); }
.g-dusk .sec-head .no { border-top-color: var(--brass); }
.g-dusk h1 em, .g-dusk h2 em, .g-dusk .num, .g-dusk .steps li::before { color: var(--sand); }
.g-dusk .textlink, .g-dusk .card .more { color: var(--sand); }
.g-dusk .facts dt, .g-dusk .facts dd { border-top-color: var(--dusk-2); }
.g-dusk .sheet { border-color: var(--slate-2); background: var(--dusk-2); }
.g-dusk .sheet::before, .g-dusk .sheet::after { border-color: var(--brass); }
.g-dusk .btn.ghost { --fg: var(--stone); border-color: var(--stone); }
.g-dusk a:focus-visible, .g-dusk button:focus-visible { outline-color: var(--brass); }

/* sticky phone bar */
.mbar { display: none; }

/* page transition flourish */
::view-transition-old(root) { animation: vt-out .24s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .36s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

@media (max-width: 960px) {
  .hero-grid, .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .sec-head { grid-template-columns: 1fr; gap: 14px; }
  .foot .cols { grid-template-columns: 1fr 1fr; }
  .stage { min-height: 360px; }
}
@media (max-width: 860px) {
  .nav { position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px var(--pad) 20px; transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .25s, transform .3s var(--ease), visibility .25s; }
  .nav.open { opacity: 1; transform: none; visibility: visible; }
  .nav a { padding: 14px 4px; font-size: 18px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav a::after { display: none; }
  .menu-btn { display: inline-flex; align-items: center; gap: 8px; font: 600 15px/1 var(--sans); background: var(--paper); border: 1.5px solid var(--slate); color: var(--slate); padding: 10px 14px; border-radius: 999px; cursor: pointer; min-height: 44px; }
  .menu-btn:active { background: var(--stone-2); }
  .menu-btn i { width: 16px; height: 10px; position: relative; display: inline-block; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; transition: transform .3s; }
  .menu-btn[aria-expanded="true"] i { transform: rotate(90deg); }
  .mbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 50; padding: 8px; background: rgba(247,245,240,.94); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 10px 30px -12px rgba(44,58,55,.5); }
  .mbar a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border-radius: 999px; font: 600 15px/1 var(--sans); text-decoration: none; border: 1.5px solid var(--line-2); background: #fff; transition: background .2s; }
  .mbar a:active { background: var(--stone-2); }
  .mbar a svg { width: 18px; height: 18px; }
  .titleblock { grid-template-columns: 1fr 1fr; }
  .titleblock > div:nth-child(2) { border-right: 0; }
  .titleblock > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-2); }
  table.cmp thead th { top: 72px; }
  .prog .row { grid-template-columns: 76px 1fr 96px; gap: 10px; }
}
/* reduced motion: every reveal at its end state, nothing loops, no parallax, no morph (html.rm is set in the head from
   prefers-reduced-motion or ?rm=1; the media query below holds even if that script never runs) */
@media (prefers-reduced-motion: reduce) {
  html:not(.mo) *, html:not(.mo) *::before, html:not(.mo) *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}
html.rm *, html.rm *::before, html.rm *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
html.rm .rv { opacity: 1; transform: none; }
html.rm .ph.bleed .frame { clip-path: none; }
html.rm .ph.bleed img { transform: none; height: 100%; }

/* drawing labels: readable at 360 px, calmer on desktop */
.plan text { font-size: 21px; }
.plan text.dim { font-size: 21px; } /* C13: was 19.5, which drew room sizes at 13.5 px on a 290 px plan at 360 wide */
.map text { font-size: 21px; }
@media (min-width: 961px) { .plan text { font-size: 16px; } .plan text.dim { font-size: 15px; } .map text { font-size: 17px; } }
.facts dd, table.cmp td, .cmp-pair > div, .titleblock b { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  table.cmp.stack thead { display: none; }
  table.cmp.stack, table.cmp.stack tbody, table.cmp.stack tr, table.cmp.stack td { display: block; width: 100%; }
  table.cmp.stack tr { border: 1px solid var(--line); margin-bottom: 14px; background: var(--paper); }
  table.cmp.stack td { display: grid; grid-template-columns: 42% 1fr; gap: 10px; padding: 10px 14px; }
  table.cmp.stack td::before { content: attr(data-l); color: var(--slate-3); font-weight: 400; }
  .cmp-pair > div { padding: 10px 8px; font-size: 15px; }
  table.cmp th, table.cmp td { padding: 11px 10px; }
}
@media (max-width: 600px) {
  .stage .hud { flex-direction: column; align-items: flex-start; }
  .stage .hud .chip:first-child:not(:only-child) { display: none; }
  .stage .hint { left: 14px; right: auto; }
}
.hero-grid > .sheet:not(.stage) { align-self: start; }

/* photographs and renders (polish round, contract C5). Images keep their own colour; frames hold the slot's aspect. */
.ph { margin: 0; }
.ph .frame, .card .frame { position: relative; overflow: hidden; background: var(--stone-2); }
.ph picture, .ph img, .card .frame picture, .card .frame img { display: block; width: 100%; height: 100%; }
.ph img, .card .frame img { object-fit: cover; transition: transform .6s var(--ease); }
.ph figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--slate-2); max-width: 70ch; }
.tag { position: absolute; left: 12px; bottom: 12px; z-index: 1; font: 600 14px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 7px 10px; border-radius: 999px; background: rgba(23,33,30,.72); color: var(--stone); pointer-events: none; }
.ph.bleed .frame { width: 100%; min-height: 220px; }
.ph.bleed figcaption { max-width: var(--max); margin: 10px auto 0; padding: 0 var(--pad); }
.hero .ph.wide { margin-top: clamp(24px, 3.6vw, 44px); }
.card.has-img { padding: 0; overflow: hidden; }
.card.has-img .body { padding: clamp(20px, 2.4vw, 32px); }
a.card:hover .frame img { transform: scale(1.03); }
.tb-over { margin-top: -40px; position: relative; z-index: 2; }
.model-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.proof-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
.proof-stack { display: grid; gap: clamp(20px, 3vw, 32px); }
.prog-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
.book-grid { display: grid; grid-template-columns: .7fr 1.3fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 2vw, 24px); }
.step-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 2vw, 24px); margin-bottom: clamp(24px, 3vw, 40px); }
.stage .poster { position: absolute; inset: 0; transition: opacity 1.2s var(--ease); }
.stage .poster img { width: 100%; height: 100%; object-fit: cover; }
.stage.live .poster { opacity: 0; pointer-events: none; }
.stage canvas.three { z-index: 1; }
.stage .hud, .stage .hint { z-index: 2; }
.closing .wrap { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(48px, 7vw, 88px); }
.closing h2 em { font-style: italic; }
.hero.nf { position: relative; padding: 0; min-height: calc(100vh - 72px); display: grid; align-items: end; overflow: hidden; }
.nf-bg { position: absolute; inset: 0; }
.nf-bg picture, .nf-bg img { width: 100%; height: 100%; object-fit: cover; }
.nf-wrap { position: relative; width: 100%; padding-top: 40vh; padding-bottom: clamp(32px, 6vw, 72px); }
.nf-card { background: var(--paper); border: 1px solid var(--line-2); padding: clamp(24px, 4vw, 48px); max-width: 640px; }
@media (max-width: 960px) {
  .model-grid, .proof-grid, .prog-grid, .book-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .book-grid > .ph { order: 2; }
  .tb-over { margin-top: -24px; }
}
@media (max-width: 560px) { .step-photos figcaption { font-size: 14px; } .nf-wrap { padding-top: 34vh; } }
main:has(> .closing:last-child) + .foot, main:has(> .ph.bleed:last-child) + .foot { margin-top: 0; }
main:has(> .hero.nf:last-child) + .foot { margin-top: 0; }

/* ---------- authored motion, polish round (contract C6; values in polish/ART-DIRECTION.md, record in polish/MOTION-SITE.md) ---------- */
/* Load: the hero image is painted from the first frame and settles from 1.06 to 1.0 over 1.6 s; never a fade from blank. */
.mo .hero img[fetchpriority="high"], .mo .nf-bg img { animation: settle 1.6s var(--ease) both; }
.mo .nf-bg img { transform-origin: 100% 50%; } /* full-bleed: grows to the left only, so the box never crosses the right edge */
@keyframes settle { from { transform: scale(1.06); } }
/* Home hero day to dusk: the day render of the same camera lies over the dusk render in the same frame (absolute, so no
   height is added) and fades out as the reader scrolls (motion.js sets --day from 1 to 0; opacity only). Without motion
   (html.rm, or no script) the day layer is not shown: the dusk frame is the still. */
.ph.xf .xf-day { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.mo .ph.xf .xf-day { opacity: var(--day, 1); will-change: opacity; }
html:not(.mo) .ph.xf .xf-day { display: none; }
/* Scroll: a full-bleed image opens with a clip from its bottom edge (top inset 12 per cent to 0, 0.9 s) when a quarter
   of it is in view, then drifts at most 6 per cent of its height (motion.js sets --py from -3% to 3%). */
.mo .ph.bleed .frame { clip-path: inset(12% 0 0 0); transition: clip-path .9s var(--ease); }
.mo .ph.bleed.on .frame { clip-path: inset(0 0 0 0); }
.mo .ph.bleed img { height: 107%; transform: translate3d(0, calc(var(--py, 0%) - 3.27%), 0); transition: none; will-change: transform; } /* 7% taller, centred (3.27% of its own height = 3.5% of the frame); the 3% drift stays inside the spare; the box never widens */
/* Hover (pointer devices only, so a tap never leaves a stuck state): the image zooms inside its frame, the card's rule
   grows. Nothing on hover changes the layout. */
.card .more { border-bottom: 0; position: relative; }
.card .more::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: currentColor; transform: scaleX(.35); transform-origin: left; transition: transform .6s var(--ease); }
a.card:hover .more::after, a.card:focus-visible .more::after { transform: none; }
@media (hover: none) { a.card:hover .frame img { transform: none; } .card .more::after { transform: none; } }
/* Transitions: a project card's image morphs into the project hero (same name on both pages; motion.js names the
   clicked card on the way out). */
body[data-sheet="KB-03"] .hero .ph.wide .frame, body[data-sheet="KB-04"] .hero .ph.wide .frame { view-transition-name: kb-hero; }
::view-transition-group(kb-hero) { animation-duration: .5s; animation-timing-function: var(--ease); }
::view-transition-old(kb-hero), ::view-transition-new(kb-hero) { height: 100%; width: 100%; object-fit: cover; overflow: hidden; }
::view-transition-old(kb-hero) { animation: vt-fade .5s var(--ease-x) both; }
::view-transition-new(kb-hero) { animation: vt-fade .5s var(--ease-x) reverse both; }
@keyframes vt-fade { to { opacity: 0; } }
