/*
 * Atelier Brenner: one raising day, first light in the hero, night at the close.
 * The timber house (frame.js) is a fixed layer behind the page; sections carry the sky,
 * content sits over it. Timing tokens come from MOTION.md. Keep the stacking rules at the end.
 */
:root {
  color-scheme: light;
  --paper: #f2eee6;
  --ink: #1e1c19;
  --ink-2: #5a544b;
  --ink-3: rgba(30, 28, 25, 0.28);
  --line: rgba(30, 28, 25, 0.18);
  --card: rgba(242, 238, 230, 0.78);
  --card-line: rgba(255, 255, 255, 0.7);
  --bar: rgba(242, 238, 230, 0.9);
  --accent: #1e1c19;
  --accent-ink: #f2eee6;
  --larch: #9a5a28;
  --dawn-1: #c2cad0;
  --dawn-2: #dbd8d1;
  --dawn-3: #ebe2d3;
  --dusk-1: #e0b38f;
  --dusk-2: #9a6762;
  --night-1: #221f29;
  --night-2: #141319;
  /* the colour the scene's fog fades into, per section (frame.js reads --fog) */
  --fog-dawn: #e2dcd2;
  --fog-day: #f2eee6;
  --fog-dusk: #b37f74;
  --fog-night: #1d1b23;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --page: 1180px;
  --gutter: clamp(18px, 4vw, 48px);
  --header: 82px;
  --dur-hover: 180ms;
  --dur-reveal: 360ms;
  --dur-mark: 720ms;
  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
  --stagger: 40ms;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; --paper: #171612; --ink: #ece5d8; --ink-2: #a69e91; --ink-3: rgba(236, 229, 216, 0.26); --line: rgba(236, 229, 216, 0.16); --card: rgba(29, 27, 23, 0.78); --card-line: rgba(255, 255, 255, 0.07); --bar: rgba(29, 27, 23, 0.88); --accent: #ece5d8; --accent-ink: #171612; --larch: #d0915a; --dawn-1: #0e1116; --dawn-2: #15161a; --dawn-3: #1f1c18; --dusk-1: #3a2a24; --dusk-2: #2c2027; --fog-dawn: #1b1a18; --fog-day: #171612; --fog-dusk: #2e2226; }
}
:root[data-theme="dark"] { color-scheme: dark; --paper: #171612; --ink: #ece5d8; --ink-2: #a69e91; --ink-3: rgba(236, 229, 216, 0.26); --line: rgba(236, 229, 216, 0.16); --card: rgba(29, 27, 23, 0.78); --card-line: rgba(255, 255, 255, 0.07); --bar: rgba(29, 27, 23, 0.88); --accent: #ece5d8; --accent-ink: #171612; --larch: #d0915a; --dawn-1: #0e1116; --dawn-2: #15161a; --dawn-3: #1f1c18; --dusk-1: #3a2a24; --dusk-2: #2c2027; --fog-dawn: #1b1a18; --fog-day: #171612; --fog-dusk: #2e2226; }
/* Evening sections are night in the story, so they keep their own ink in both themes */
.on-night { --ink: #eee7dc; --ink-2: rgba(238, 231, 220, 0.74); --ink-3: rgba(238, 231, 220, 0.26); --line: rgba(238, 231, 220, 0.16); --card: rgba(30, 28, 37, 0.74); --card-line: rgba(255, 255, 255, 0.08); --accent: #eee7dc; --accent-ink: #1b1a21; --larch: #d8995f; color: var(--ink); color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--font-body); overflow-x: clip; -webkit-font-smoothing: antialiased; }
img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 350; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 1.3rem + 3.7vw, 4.7rem); line-height: 1.02; letter-spacing: -0.025em; font-weight: 300; }
h2 { font-size: clamp(2rem, 1.35rem + 2.3vw, 3.3rem); line-height: 1.05; letter-spacing: -0.02em; font-weight: 300; }
h3 { font-size: 1.32rem; line-height: 1.2; letter-spacing: -0.005em; }
p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--larch); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: calc(var(--page) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.eyebrow, .meta, .step-n, .titleblock, .caption, .address, .site-footer p:not(.footer-mark) { font: 400 0.74rem/1.5 var(--font-mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-2); }
.lead { font-size: 1.22rem; line-height: 1.5; color: var(--ink-2); max-width: 32em; }
.section { --pad: clamp(88px, 11vw, 150px); padding-block: var(--pad); }
.stack { display: grid; gap: 20px; justify-items: start; }
.section-head { margin-bottom: clamp(28px, 4vw, 48px); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 60; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.skip:focus { top: 12px; }

/* Buttons: an ink pill with a round knob; the knob turns on hover */
.button { display: inline-flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 6px 0 1.4rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 500 0.8rem/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.knob-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-ink); color: var(--accent); font-size: 1rem; transition: transform var(--dur-hover) var(--ease-out); }
.button:hover .knob-dot, .button:focus-visible .knob-dot { transform: rotate(-45deg); }
.text-link { font: 400 0.8rem/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.text-link:hover { border-color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 8px; }

/* Header: a frosted bar; the mark is a bent whose rafters swing up once */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; padding-block: 12px; }
.bar { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 6px 6px 6px 16px; border-radius: 999px; background: var(--bar); -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2); box-shadow: inset 0 0 0 1px var(--card-line), 0 1px 0 var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; color: var(--ink); text-decoration: none; font: 400 1.22rem/1 var(--font-display); letter-spacing: -0.01em; white-space: nowrap; }
.mark { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: square; overflow: visible; }
.mark .rafter { transform-box: view-box; animation: var(--dur-mark) var(--ease-out) calc(var(--stagger) * 4) both; }
.mark .rafter-l { transform-origin: 4.5px 18px; animation-name: raise-left; }
.mark .rafter-r { transform-origin: 27.5px 18px; animation-name: raise-right; }
@keyframes raise-left { from { transform: rotate(42deg); } }
@keyframes raise-right { from { transform: rotate(-42deg); } }
.nav { display: flex; gap: 4px; margin-right: 6px; }
.nav a { padding: 10px 12px; border-radius: 999px; font: 400 0.76rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); }
.nav a:hover { color: var(--ink); }
.theme-toggle { display: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.theme-toggle path { fill: currentColor; stroke: none; }
.js .theme-toggle { display: grid; place-items: center; }

/* Skies, one raising day: dawn, day, dusk, night. --fog is the colour behind the house. */
.hero { --fog: var(--fog-dawn); position: relative; min-height: 100svh; margin-top: calc(-1 * var(--header)); padding-top: var(--header); display: grid; align-items: center; background: linear-gradient(180deg, var(--dawn-1) 0%, var(--dawn-2) 46%, var(--dawn-3) 82%, var(--paper) 100%); }
#practice, #houses, #public { --fog: var(--fog-day); background: var(--paper); }
.interlude { --fog: var(--fog-dusk); position: relative; min-height: 80vh; padding-block: calc(var(--header) + 48px) 56px; background: linear-gradient(180deg, var(--paper) 0%, var(--dusk-1) 36%, var(--dusk-2) 64%, var(--night-1) 100%); }
.night { --fog: var(--fog-night); background: var(--night-1); }
#studio { background: linear-gradient(180deg, var(--night-1), var(--night-2)); }
#contact { background: var(--night-2); }
.sky-stars::before { content: ""; position: absolute; inset: 0 0 35% 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1100' height='520' fill='white'%3E%3Ccircle cx='0' cy='260' r='0.79' fill-opacity='0.73'/%3E%3Ccircle cx='135' cy='83' r='1.22' fill-opacity='0.84'/%3E%3Ccircle cx='997' cy='395' r='0.73' fill-opacity='0.82'/%3E%3Ccircle cx='867' cy='342' r='0.51' fill-opacity='0.34'/%3E%3Ccircle cx='827' cy='76' r='0.73' fill-opacity='0.46'/%3E%3Ccircle cx='1025' cy='25' r='0.65' fill-opacity='0.71'/%3E%3Ccircle cx='85' cy='6' r='1.10' fill-opacity='0.55'/%3E%3Ccircle cx='994' cy='168' r='0.74' fill-opacity='0.59'/%3E%3Ccircle cx='1085' cy='469' r='1.29' fill-opacity='0.44'/%3E%3Ccircle cx='22' cy='193' r='1.16' fill-opacity='0.86'/%3E%3Ccircle cx='763' cy='348' r='1.08' fill-opacity='0.49'/%3E%3Ccircle cx='417' cy='198' r='0.50' fill-opacity='0.79'/%3E%3Ccircle cx='200' cy='152' r='0.95' fill-opacity='0.35'/%3E%3Ccircle cx='569' cy='116' r='1.16' fill-opacity='0.40'/%3E%3Ccircle cx='268' cy='29' r='0.72' fill-opacity='0.39'/%3E%3Ccircle cx='207' cy='305' r='1.15' fill-opacity='0.34'/%3E%3Ccircle cx='821' cy='200' r='0.55' fill-opacity='0.73'/%3E%3Ccircle cx='8' cy='209' r='0.91' fill-opacity='0.48'/%3E%3Ccircle cx='291' cy='189' r='0.55' fill-opacity='0.79'/%3E%3Ccircle cx='966' cy='495' r='0.88' fill-opacity='0.68'/%3E%3Ccircle cx='801' cy='199' r='0.74' fill-opacity='0.35'/%3E%3Ccircle cx='546' cy='500' r='1.29' fill-opacity='0.77'/%3E%3Ccircle cx='1089' cy='459' r='0.84' fill-opacity='0.79'/%3E%3Ccircle cx='736' cy='391' r='0.68' fill-opacity='0.34'/%3E%3Ccircle cx='912' cy='514' r='0.59' fill-opacity='0.84'/%3E%3Ccircle cx='230' cy='463' r='0.87' fill-opacity='0.53'/%3E%3Ccircle cx='1013' cy='448' r='0.70' fill-opacity='0.68'/%3E%3Ccircle cx='170' cy='245' r='0.62' fill-opacity='0.43'/%3E%3Ccircle cx='591' cy='480' r='1.20' fill-opacity='0.90'/%3E%3Ccircle cx='39' cy='22' r='0.96' fill-opacity='0.59'/%3E%3Ccircle cx='802' cy='113' r='0.55' fill-opacity='0.82'/%3E%3Ccircle cx='562' cy='253' r='1.16' fill-opacity='0.63'/%3E%3Ccircle cx='481' cy='17' r='1.18' fill-opacity='0.53'/%3E%3Ccircle cx='942' cy='492' r='0.76' fill-opacity='0.52'/%3E%3Ccircle cx='545' cy='418' r='0.63' fill-opacity='0.34'/%3E%3Ccircle cx='233' cy='79' r='0.95' fill-opacity='0.79'/%3E%3Ccircle cx='751' cy='399' r='1.06' fill-opacity='0.74'/%3E%3Ccircle cx='869' cy='147' r='1.15' fill-opacity='0.46'/%3E%3Ccircle cx='434' cy='414' r='0.55' fill-opacity='0.87'/%3E%3Ccircle cx='448' cy='194' r='1.15' fill-opacity='0.46'/%3E%3Ccircle cx='780' cy='27' r='0.82' fill-opacity='0.82'/%3E%3Ccircle cx='593' cy='69' r='0.58' fill-opacity='0.72'/%3E%3Ccircle cx='2' cy='414' r='0.89' fill-opacity='0.80'/%3E%3Ccircle cx='826' cy='43' r='0.78' fill-opacity='0.86'/%3E%3Ccircle cx='889' cy='295' r='1.20' fill-opacity='0.69'/%3E%3Ccircle cx='705' cy='309' r='0.80' fill-opacity='0.72'/%3E%3C/svg%3E") 0 0 / 1100px 520px; -webkit-mask-image: linear-gradient(180deg, #000, transparent); mask-image: linear-gradient(180deg, #000, transparent); pointer-events: none; }

/* Layout: copy on one side, the house framed on the other */
.hero-grid, .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.hero-grid { padding-block: clamp(32px, 6vh, 72px); }
.hero .copy { max-width: 36rem; }
.view { position: relative; display: grid; align-content: end; min-height: clamp(320px, 56vh, 620px); }
.split > .view { align-self: stretch; }
.titleblock { display: grid; gap: 2px; justify-self: end; padding: 10px 14px; border-radius: 4px 14px 14px 4px; border-left: 1px solid var(--ink-2); background: var(--card); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); line-height: 1.55; }
.titleblock span:first-child { color: var(--ink); }

/* Practice: four steps on ruled lines */
.steps { display: grid; }
.steps li { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 4px 12px; padding-block: 20px 22px; }
.steps .step-n { padding-top: 0.45rem; color: var(--larch); }
.steps p { margin-top: 6px; color: var(--ink-2); max-width: 30em; }

/* The project index and the people: ruled rows */
.index li, .people li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; padding-block: 20px 22px; }
.index .meta, .people .meta { align-self: baseline; text-align: right; }
.index p:not(.meta), .people p:not(.meta) { grid-column: 1 / -1; color: var(--ink-2); max-width: 34em; }

/* Ruled hairlines: drawn at rest; ruled left to right as they enter, where scroll-driven CSS exists */
.ruled { position: relative; }
.ruled::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: var(--line); transform-origin: left center; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .ruled::before { animation: rule linear both; animation-timeline: view(); animation-range: entry 0% entry 80%; }
  }
}
@keyframes rule { from { transform: scaleX(0); } }

/* Interlude: the sky goes down; one caption on the light part, nothing on the mid-tones */
.caption { max-width: 26em; color: var(--ink-2); }

/* Material: the statement and the numbers */
.statement { max-width: 22em; margin: 18px 0 clamp(40px, 6vw, 72px); font: 300 clamp(1.7rem, 1.15rem + 1.8vw, 2.7rem)/1.18 var(--font-display); letter-spacing: -0.015em; }
.js .statement .word { color: var(--ink-3); transition: color var(--dur-reveal) var(--ease-out); }
.js .statement .word.on { color: var(--ink); }
.numbers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.numbers div { padding-block: 22px 26px; }
.numbers dt { font: 300 clamp(2.8rem, 2rem + 2.6vw, 4.6rem)/1 var(--font-display); letter-spacing: -0.03em; white-space: nowrap; }
.numbers dd { margin-top: 10px; color: var(--ink-2); font-size: 1rem; max-width: 18em; }

/* Contact */
#contact .copy { max-width: 34rem; }
.address { line-height: 1.8; }

/* Footer: the name, large and still */
.site-footer { position: relative; overflow: hidden; padding-block: 36px 0; background: var(--night-2); border-top: 1px solid var(--line); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer-mark { position: relative; z-index: 1; margin: 24px 0 -0.12em; text-align: center; font: 300 clamp(5rem, 1rem + 19vw, 19rem)/0.8 var(--font-display); letter-spacing: -0.05em; color: transparent; -webkit-text-stroke: 1px var(--line); user-select: none; }

/* Drawn stand-ins: the page's rest state without WebGL */
.standin-art { width: 100%; height: auto; }
.ln-base { fill: none; stroke: var(--ink-2); stroke-width: 1.1; }
.ln-light { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.ln-heavy { fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: square; }
.ln-dim { fill: none; stroke: var(--larch); stroke-width: 1; }
.dim-text { font: 500 10px var(--font-mono); fill: var(--larch); text-anchor: middle; }
.el-tree { fill: #0f0f14; }
.el-plinth { fill: #3a3735; }
.el-fascia { fill: #3a3430; }
.el-reveal { fill: #7d5f45; }
.el-glass { fill: #ffc684; }
.el-halo, .el-pool { fill: #ff9a4a; opacity: 0.45; filter: blur(12px); }
.el-ground { stroke: rgba(255, 255, 255, 0.16); }
.standin { transition: opacity var(--dur-reveal) var(--ease-out), visibility 0s; }
.has-scene .standin { opacity: 0; visibility: hidden; transition: opacity var(--dur-reveal) var(--ease-out), visibility 0s var(--dur-reveal); }

/* Phones and narrow windows: the house sits in the top of the screen, text on frosted panels */
@media (max-width: 860px) {
  .nav, .button .long { display: none; }
  .hero-grid, .split { grid-template-columns: minmax(0, 1fr); }
  .split > .view { display: none; }
  .hero { align-items: end; }
  .hero .view { order: -1; min-height: 36svh; }
  .hero .titleblock { display: none; }
  .split > .copy, .interlude .caption { padding: 22px; border-radius: 22px; background: var(--card); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px var(--card-line); }
  .section { --pad: 72px; }
  #contact .view { display: grid; min-height: 0; }
  .has-scene #contact .view { display: none; }
  /* with the scene running, each section opens on a clear view of the house, then its text */
  .has-scene .section[data-stage] > .wrap { padding-top: 40svh; }
  .numbers { grid-template-columns: minmax(0, 1fr); }
  .index li, .people li { grid-template-columns: minmax(0, 1fr); }
  .index .meta, .people .meta { text-align: left; }
}

/* Stacking for the fixed scene layer. Keep these. */
.hero, .section, .interlude { position: relative; }
.wrap { position: relative; z-index: 1; }
.scene-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.scene-layer canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; opacity: 0; transition: opacity var(--dur-reveal) var(--ease-out); }
.has-scene .scene-layer canvas { opacity: 1; }

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