/*!
 * Azimuth v1.0.0 — architecture studio template
 * Fonts: Jura and Instrument Sans, SIL Open Font License 1.1 (see assets/fonts).
 *
 * Contents
 *  1. Fonts and tokens       6. Work index        11. Studio
 *  2. Day and night themes   7. Method, ledger    12. Services
 *  3. Base                   8. Journal           13. Contact brief
 *  4. Header and menu        9. Projects index    14. Footer
 *  5. Hero and scrubber     10. Project page      15. Utilities, motion
 */

/* 1. Fonts and tokens ------------------------------------------------ */

@font-face { font-family: 'Jura'; src: url('../fonts/Jura-Light.woff') format('woff'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Jura'; src: url('../fonts/Jura-Medium.woff') format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/InstrumentSans-Regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/InstrumentSans-Italic.woff') format('woff'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/InstrumentSans-Bold.woff') format('woff'); font-weight: 600 700; font-display: swap; }

:root {
  --font-display: 'Jura', 'Eurostile', 'Bahnschrift', system-ui, sans-serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.4rem, 1.2rem + 0.8vw, 1.85rem);
  --step-3: clamp(1.8rem, 1.35rem + 1.7vw, 2.75rem);
  --step-4: clamp(2.3rem, 1.5rem + 3.2vw, 4.4rem);
  --step-5: clamp(2.8rem, 1.3rem + 6vw, 8rem);

  --gutter: clamp(20px, 4vw, 56px);
  --wrap: 1440px;
  --section: clamp(88px, 11vw, 176px);
  --header-h: 76px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* overwritten live by core.js */
  --sky-zenith: #0b1433;
  --sky-horizon: #272a5c;
  --sky-glow: #3d2f66;
  --daylight: 0;
  --ft: #27345f; --f0: #1f2a52; --f1: #1f2a52; --f2: #1f2a52; --f3: #1f2a52; --f4: #1f2a52; --f5: #1f2a52; --f6: #1f2a52; --f7: #1f2a52;
}

/* 2. Day and night themes ------------------------------------------- */

:root,
[data-light='night'] {
  --bg: #0a1029;
  --bg-2: #0f173a;
  --bg-3: #172150;
  --ink: #e9edf8;
  --ink-2: #b0b9d4;
  --ink-3: #8390b2;
  --line: rgba(205, 215, 245, 0.13);
  --line-2: rgba(205, 215, 245, 0.26);
  --draw: rgba(222, 230, 255, 0.62);
  --sun: #ffc46b;
  --sun-text: #ffc46b;
  --btn: #ffc46b;
  --btn-ink: #1b1404;
  --focus: #ffc46b;
  --tint: #4f74d0;
  --green: #4f8a62;
  --error: #ffab9c;
  --shadow-ink: #02040e;
  color-scheme: dark;
}

[data-light='day'] {
  --bg: #eceff3;
  --bg-2: #f7f8fa;
  --bg-3: #dfe4eb;
  --ink: #0f1730;
  --ink-2: #434e6c;
  --ink-3: #5b6683;
  --line: rgba(15, 23, 48, 0.12);
  --line-2: rgba(15, 23, 48, 0.24);
  --draw: rgba(15, 23, 48, 0.58);
  --sun: #b86e00;
  --sun-text: #8a4f00;
  --btn: #0f1730;
  --btn-ink: #f7f8fa;
  --focus: #0f1730;
  --tint: #a9c2e2;
  --green: #a3bf93;
  --error: #b42318;
  --shadow-ink: #1a2440;
  color-scheme: light;
}

/* Text placed over the live sky */
:root { --sky-ink: #f2f4fb; --sky-ink-2: rgba(242, 244, 251, 0.78); --sky-scrim: rgba(6, 10, 32, 0.52); --sky-line: rgba(242, 244, 251, 0.22); }
[data-sky='day'] { --sky-ink: #0d1530; --sky-ink-2: rgba(13, 21, 48, 0.78); --sky-scrim: rgba(240, 245, 250, 0.58); --sky-line: rgba(13, 21, 48, 0.2); }

/* 3. Base ------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.9s var(--ease), color 0.9s var(--ease);
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
h1, h2, h3, h4 { margin: 0; font-weight: 300; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--sun); color: #0a1029; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(var(--wrap), 100% - var(--gutter) * 2); margin-inline: auto; }
.section { padding-block: var(--section) 0; }
.section:last-of-type { padding-bottom: var(--section); }
.page { padding-top: calc(var(--header-h) + clamp(48px, 8vw, 120px)); padding-bottom: var(--section); }

.section-head { display: grid; gap: 16px; max-width: 60ch; margin-bottom: clamp(36px, 5vw, 72px); }
.section-head-row { display: flex; max-width: none; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap; }
.section-title { font-family: var(--font-display); font-weight: 300; font-size: var(--step-3); line-height: 1.08; letter-spacing: -0.01em; }
.section-lede { color: var(--ink-2); font-size: var(--step-1); line-height: 1.45; max-width: 56ch; }
.section-foot { margin-top: 40px; }

.page-head { display: grid; gap: 24px; max-width: 1100px; margin-left: max(var(--gutter), (100% - var(--wrap)) / 2); margin-bottom: clamp(48px, 7vw, 110px); }
.page-title { font-family: var(--font-display); font-weight: 300; font-size: var(--step-4); line-height: 1.02; letter-spacing: -0.015em; text-wrap: balance; }
.page-lede { color: var(--ink-2); font-size: var(--step-1); line-height: 1.5; max-width: 60ch; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.97rem; letter-spacing: 0.005em; text-decoration: none; white-space: nowrap;
  transition: transform 0.4s var(--ease-out), background-color 0.3s, color 0.3s, border-color 0.3s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--btn); color: var(--btn-ink); }
.btn-primary:hover { background: color-mix(in oklab, var(--btn) 86%, var(--ink)); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-small { min-height: 38px; padding: 0 16px; font-size: 0.88rem; border-color: var(--line-2); background: transparent; color: var(--ink); }
.btn-small:hover { border-color: var(--ink); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.link-arrow { font-weight: 600; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; padding-bottom: 3px; transition: background-size 0.45s var(--ease-out); }
.link-arrow:hover { background-size: 40% 1px; }

.crumbs { display: flex; gap: 10px; color: var(--ink-2); font-size: var(--step--1); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.prose { max-width: 66ch; }
.prose p { font-size: 1.125rem; line-height: 1.72; color: var(--ink); }
.prose p + p { margin-top: 1.1em; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Axonometric drawings: faces lit by the live sun (see core.js) */
[id^='ax-'] * { vector-effect: non-scaling-stroke; stroke: var(--draw); stroke-width: 0.75px; stroke-linejoin: round; }
[id^='ax-'] .t { fill: var(--ft); }
[id^='ax-'] .t.gr { fill: color-mix(in oklab, var(--ft) 45%, var(--green)); }
[id^='ax-'] .s0 { fill: var(--f0); } [id^='ax-'] .s1 { fill: var(--f1); } [id^='ax-'] .s2 { fill: var(--f2); } [id^='ax-'] .s3 { fill: var(--f3); }
[id^='ax-'] .s4 { fill: var(--f4); } [id^='ax-'] .s5 { fill: var(--f5); } [id^='ax-'] .s6 { fill: var(--f6); } [id^='ax-'] .s7 { fill: var(--f7); }
[id^='ax-'] .g.s0 { fill: color-mix(in oklab, var(--f0) 70%, var(--tint)); } [id^='ax-'] .g.s1 { fill: color-mix(in oklab, var(--f1) 70%, var(--tint)); }
[id^='ax-'] .g.s2 { fill: color-mix(in oklab, var(--f2) 70%, var(--tint)); } [id^='ax-'] .g.s3 { fill: color-mix(in oklab, var(--f3) 70%, var(--tint)); }
[id^='ax-'] .g.s4 { fill: color-mix(in oklab, var(--f4) 70%, var(--tint)); } [id^='ax-'] .g.s5 { fill: color-mix(in oklab, var(--f5) 70%, var(--tint)); }
[id^='ax-'] .g.s6 { fill: color-mix(in oklab, var(--f6) 70%, var(--tint)); } [id^='ax-'] .g.s7 { fill: color-mix(in oklab, var(--f7) 70%, var(--tint)); }
[id^='ax-'] .fl { fill: none; stroke: var(--draw); stroke-width: 0.5px; opacity: 0.5; }
[id^='ax-'] .site { fill: none; stroke: var(--line-2); stroke-dasharray: 4 4; }
.ax { width: 100%; height: auto; overflow: visible; }
/* Drawings rise from the ground the first time they are seen (a mask, so IntersectionObserver still sees them). */
@property --rise { syntax: '<percentage>'; inherits: false; initial-value: 130%; }
.ax.draw { --rise: -30%; -webkit-mask-image: linear-gradient(to top, #000 var(--rise), transparent calc(var(--rise) + 30%)); mask-image: linear-gradient(to top, #000 var(--rise), transparent calc(var(--rise) + 30%)); transition: --rise 1.8s var(--ease-out); }
.ax.draw.is-drawn { --rise: 130%; }

/* 4. Header and menu ------------------------------------------------- */

.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 12px 18px; background: var(--btn); color: var(--btn-ink); border-radius: 999px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 16px; }

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--header-h);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 32px;
  padding-inline: max(var(--gutter), (100% - var(--wrap)) / 2);
  color: var(--ink);
  transition: background-color 0.4s, box-shadow 0.4s, color 0.6s;
}
.site-header.is-scrolled { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 1px 0 var(--line); }
[data-page='home'] .site-header:not(.is-scrolled) { color: var(--sky-ink); --line-2: var(--sky-line); }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-glyph { width: 30px; height: 22px; overflow: visible; }
.glyph-arc { fill: none; stroke: currentColor; stroke-width: 1.1; stroke-dasharray: 1.5 1.6; opacity: 0.7; }
.glyph-horizon { stroke: currentColor; stroke-width: 1.2; }
.glyph-sun { fill: var(--sun); transition: cx 0.6s var(--ease), cy 0.6s var(--ease); }
[data-page='home'] .site-header:not(.is-scrolled) .glyph-sun { fill: #ffc46b; }
.brand-name { font-family: var(--font-display); font-weight: 500; font-size: 1.32rem; letter-spacing: 0.04em; }

.nav-primary ul { display: flex; gap: clamp(18px, 2.4vw, 36px); justify-content: center; }
.nav-primary a { position: relative; text-decoration: none; font-size: 0.97rem; padding: 8px 0; }
.nav-primary a::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--sun); transform: scale(0); transition: transform 0.35s var(--ease-out); }
.nav-primary a:hover::after, .nav-primary a[aria-current='page']::after { transform: scale(1); }
[data-page='home'] .site-header:not(.is-scrolled) .nav-primary a::after { background: #ffc46b; }

.header-tools { display: flex; align-items: center; gap: 20px; }
.readout { display: flex; gap: 10px; font-family: var(--font-display); font-weight: 500; font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-time { min-width: 3.1em; }
.readout-alt { opacity: 0.8; }

.mode-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; }
.mode-switch button { border: 0; background: transparent; padding: 5px 11px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; transition: background-color 0.3s, color 0.3s; }
.mode-switch button[aria-pressed='true'] { background: currentColor; }
.mode-switch button[aria-pressed='true'] { background: var(--ink); color: var(--bg); }
[data-page='home'] .site-header:not(.is-scrolled) .mode-switch button[aria-pressed='true'] { background: var(--sky-ink); color: var(--sky-zenith); }

.menu-toggle { display: none; align-items: center; gap: 10px; border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 0 14px 0 16px; height: 42px; font-weight: 600; font-size: 0.92rem; position: relative; z-index: 60; }
.menu-icon { position: relative; width: 16px; height: 10px; }
.menu-icon i { position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform 0.4s var(--ease-out), top 0.4s var(--ease-out); }
.menu-icon i:first-child { top: 1px; } .menu-icon i:last-child { top: 7.5px; }
.menu-toggle[aria-expanded='true'] .menu-icon i:first-child { top: 4.25px; transform: rotate(45deg); }
.menu-toggle[aria-expanded='true'] .menu-icon i:last-child { top: 4.25px; transform: rotate(-45deg); }

.site-menu {
  position: fixed; inset: 0; z-index: 45;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--header-h) + 32px) var(--gutter) 32px;
  background: var(--bg); color: var(--ink);
  clip-path: circle(0 at calc(100% - 52px) 38px);
  visibility: hidden;
  transition: clip-path 0.7s var(--ease-out), visibility 0s linear 0.7s;
}
.site-menu[data-open='true'] { clip-path: circle(150% at calc(100% - 52px) 38px); visibility: visible; transition: clip-path 0.8s var(--ease-out), visibility 0s; }
.menu-links { display: grid; gap: 6px; }
.menu-links a { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.4rem, 11vw, 4.2rem); line-height: 1.1; text-decoration: none; }
.menu-links a[aria-current='page'] { color: var(--sun-text); }
.menu-foot { display: grid; gap: 18px; color: var(--ink-2); }
body.menu-open { overflow: hidden; }
body.menu-open .site-header { color: var(--ink); background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
body.menu-open .site-header .brand, body.menu-open .site-header .menu-toggle { --line-2: var(--line-2); }

@media (max-width: 1240px) { .readout { display: none; } }
@media (max-width: 999px) {
  .nav-primary, .header-tools > .mode-switch { display: none; }
  .menu-toggle { display: inline-flex; }
  .site-header { grid-template-columns: 1fr auto; }
}

/* 5. Hero and scrubber ---------------------------------------------- */

.hero {
  position: relative; isolation: isolate;
  min-height: max(680px, 100svh);
  display: grid; grid-template-rows: 1fr auto;
  color: var(--sky-ink);
  background: linear-gradient(var(--sky-zenith), var(--sky-horizon));
  overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero-veil { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, var(--sky-scrim) 0%, color-mix(in srgb, var(--sky-scrim) 55%, transparent) 34%, transparent 62%),
    linear-gradient(0deg, var(--sky-scrim) 0%, transparent 30%);
  transition: background 0.8s;
}
.hero-grid { align-self: end; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 40px; align-items: end; padding-top: calc(var(--header-h) + 40px); padding-bottom: 36px; }
.hero-copy { display: grid; gap: 28px; max-width: 900px; }
.hero-title { font-family: var(--font-display); font-weight: 300; font-size: var(--step-5); line-height: 0.96; letter-spacing: -0.025em; text-wrap: balance; }
.hero-lede { font-size: var(--step-1); line-height: 1.5; max-width: 46ch; color: var(--sky-ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .btn-primary { background: #ffc46b; color: #1b1404; }
.hero .btn-primary:hover { background: #ffd593; }
.hero .btn-ghost { color: var(--sky-ink); border-color: var(--sky-line); }
.hero .btn-ghost:hover { border-color: var(--sky-ink); }

.instrument {
  justify-self: end; width: min(100%, 360px);
  padding: 20px 22px 22px;
  border: 1px solid var(--sky-line); border-radius: 18px;
  background: color-mix(in srgb, var(--sky-scrim) 70%, transparent);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.instrument-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; margin-bottom: 14px; }
.state { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-body); font-size: 0.78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--sky-line); }
.state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.state.is-live::before { background: #6ee7a8; opacity: 1; box-shadow: 0 0 0 3px rgba(110, 231, 168, 0.25); }
.instrument-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.instrument-grid dt { font-size: 0.78rem; color: var(--sky-ink-2); }
.instrument-grid dd { font-family: var(--font-display); font-weight: 500; font-size: 1.18rem; font-variant-numeric: tabular-nums; line-height: 1.25; }

.scrubber { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding-block: 18px 34px; border-top: 1px solid var(--sky-line); }
.scrubber-label { display: flex; gap: 10px; align-items: baseline; font-size: 0.9rem; color: var(--sky-ink-2); white-space: nowrap; }
.scrubber-label output { font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; color: var(--sky-ink); font-variant-numeric: tabular-nums; min-width: 3.1em; }
.scrubber-track { position: relative; height: 44px; display: flex; align-items: center; }
.scrubber-track::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 8px; margin-top: -4px; border-radius: 99px; background: var(--day-strip, linear-gradient(90deg, #0c1434, #8fbde9, #0c1434)); box-shadow: inset 0 0 0 1px var(--sky-line); }
.scrubber input[type='range'] { position: relative; z-index: 2; width: 100%; height: 44px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: grab; }
.scrubber input[type='range']:active { cursor: grabbing; }
.scrubber input[type='range']::-webkit-slider-runnable-track { height: 44px; background: transparent; }
.scrubber input[type='range']::-moz-range-track { height: 44px; background: transparent; }
.scrubber input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: 11px; border-radius: 50%; background: #ffc46b; border: 3px solid #fff6e2; box-shadow: 0 0 0 6px rgba(255, 196, 107, 0.22), 0 0 24px rgba(255, 196, 107, 0.7); }
.scrubber input[type='range']::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #ffc46b; border: 3px solid #fff6e2; box-shadow: 0 0 0 6px rgba(255, 196, 107, 0.22), 0 0 24px rgba(255, 196, 107, 0.7); }
.scrubber input[type='range']:focus-visible { outline: none; }
.scrubber input[type='range']:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--sky-ink), 0 0 24px rgba(255, 196, 107, 0.8); }
.scrubber input[type='range']:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--sky-ink); }
.mark { position: absolute; top: 50%; z-index: 1; width: 1px; height: 18px; margin-top: 6px; background: var(--sky-ink-2); pointer-events: none; }
.mark span { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font-family: var(--font-display); font-weight: 500; font-size: 0.74rem; color: var(--sky-ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.scrubber .btn-small { color: var(--sky-ink); border-color: var(--sky-line); }

@media (max-width: 999px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .instrument { justify-self: start; width: 100%; max-width: 520px; }
  .instrument-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .hero-grid { padding-top: max(46svh, 340px); }
  .hero-veil { background: linear-gradient(0deg, var(--sky-scrim) 0%, color-mix(in srgb, var(--sky-scrim) 70%, transparent) 55%, transparent 85%); }
  .instrument { padding: 16px; }
  .instrument-grid { grid-template-columns: 1fr 1fr 1fr; gap: 10px 12px; }
  .instrument-grid dd { font-size: 1rem; }
  .scrubber { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }
  .scrubber-label { white-space: normal; flex-wrap: wrap; min-width: 0; }
  .scrubber-track { grid-column: 1 / -1; grid-row: 2; }
  .mark[data-mark='noon'] { display: none; }
}

/* 6. Work index ------------------------------------------------------ */

.work-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 96px); align-items: start; }
.work-list { counter-reset: work; border-bottom: 1px solid var(--line); }
.work-item { border-top: 1px solid var(--line); }
.work-link { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; padding: clamp(18px, 2.4vw, 30px) 0; text-decoration: none; position: relative; }
.work-name { font-family: var(--font-display); font-weight: 300; font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3.6rem); line-height: 1.04; letter-spacing: -0.015em; transition: transform 0.6s var(--ease-out), color 0.4s; color: var(--ink-2); }
.work-meta { grid-column: 1; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-2); font-size: 0.92rem; }
.work-thumb { display: none; }
.work-item.is-active .work-name, .work-link:hover .work-name, .work-link:focus-visible .work-name { color: var(--ink); transform: translateX(14px); }
.work-link::before { content: ''; position: absolute; left: -2px; top: clamp(30px, 3.6vw, 48px); width: 6px; height: 6px; border-radius: 50%; background: var(--sun); transform: scale(0); transition: transform 0.4s var(--ease-out); }
.work-item.is-active .work-link::before { transform: scale(1); }

.work-preview { position: sticky; top: calc(var(--header-h) + 32px); display: grid; }
.work-frame { grid-area: 1 / 1; display: grid; gap: 20px; opacity: 0; transform: translateY(10px); transition: opacity 0.5s var(--ease), transform 0.7s var(--ease-out); pointer-events: none; }
.work-frame.is-active { opacity: 1; transform: none; }
.work-frame .ax { aspect-ratio: 1 / 1; object-fit: contain; max-height: 62vh; }
.work-frame figcaption { color: var(--ink-2); max-width: 44ch; }

@media (max-width: 899px) {
  .work-layout { grid-template-columns: 1fr; }
  .work-preview { display: none; }
  .work-link { grid-template-columns: 1fr 96px; align-items: center; }
  .work-name { grid-column: 1; color: var(--ink); }
  .work-thumb { display: block; grid-column: 2; grid-row: 1 / span 2; width: 96px; }
  .work-item.is-active .work-name, .work-link:hover .work-name { transform: none; }
  .work-link::before { display: none; }
}

/* 7. Method and ledger ---------------------------------------------- */

.method-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(40px, 6vw, 120px); align-items: center; }
.method-copy { display: grid; gap: 24px; }
.steps { counter-reset: step; display: grid; gap: 0; margin-top: 16px; border-top: 1px solid var(--line); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 56px 1fr; gap: 4px 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(step, decimal-leading-zero); grid-row: span 2; font-family: var(--font-display); font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; padding-top: 3px; }
.steps h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; }
.steps p { color: var(--ink-2); }

.sunpath { display: grid; gap: 20px; }
.sunpath svg { width: 100%; max-width: 620px; justify-self: center; overflow: visible; }
.sp-grid circle, .sp-grid line { fill: none; stroke: var(--line-2); stroke-width: 0.8; }
.sp-grid .sp-horizon { stroke: var(--draw); stroke-width: 1.2; }
.sp-label { font-family: var(--font-display); font-weight: 500; font-size: 13px; fill: var(--ink-2); }
.sp-small { font-size: 10px; fill: var(--ink-3); }
.sp-path { fill: none; stroke-width: 1.6; stroke-linecap: round; }
.sp-june { stroke: var(--ink-2); }
.sp-equinox { stroke: var(--ink-3); stroke-dasharray: 4 5; }
.sp-december { stroke: var(--tint); }
.sp-today { stroke: var(--sun); stroke-width: 2.6; }
.sp-paths.draw .sp-path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2.4s var(--ease-out); }
.sp-paths.draw .sp-equinox { stroke-dasharray: 1; }
.sp-paths.draw.is-drawn .sp-path { stroke-dashoffset: 0; }
.sp-paths.draw.is-drawn .sp-equinox { stroke-dasharray: 0.012 0.016; transition: stroke-dashoffset 2.4s var(--ease-out), stroke-dasharray 0s 2.4s; }
.sp-hours circle { fill: var(--sun); }
.sp-sun { transition: opacity 0.6s; }
.sp-sun-dot { fill: var(--sun); }
.sp-sun-halo { fill: var(--sun); opacity: 0.22; }
.sunpath-key { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; font-size: 0.88rem; color: var(--ink-2); }
.key { display: inline-flex; align-items: center; gap: 8px; }
.key::before { content: ''; width: 22px; height: 0; border-top: 2px solid; }
.key-today::before { border-color: var(--sun); border-top-width: 3px; }
.key-june::before { border-color: var(--ink-2); }
.key-equinox::before { border-color: var(--ink-3); border-top-style: dashed; }
.key-december::before { border-color: var(--tint); }

.ledger-table th, .ledger-table td { text-align: left; padding: 22px 16px 22px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ledger-table thead th { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); padding-block: 0 14px; }
.ledger-table tbody th { font-weight: 400; font-size: 1.05rem; }
.ledger-table tbody td:nth-child(2) { font-family: var(--font-display); font-weight: 500; font-size: var(--step-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-table tbody td:nth-child(3) { color: var(--ink-2); white-space: nowrap; }
.ledger-table .bar { width: 28%; }
.ledger-table .bar i { display: block; height: 2px; background: linear-gradient(90deg, var(--sun) calc(var(--v) * 100%), var(--line-2) calc(var(--v) * 100%)); }
@media (max-width: 899px) {
  .method-grid { grid-template-columns: 1fr; }
  .ledger-table thead { display: none; }
  .ledger-table, .ledger-table tbody, .ledger-table tr { display: block; }
  .ledger-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: baseline; gap: 4px 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
  .ledger-table th, .ledger-table td { border: 0; padding: 0; }
  .ledger-table tbody th { grid-column: 1 / -1; }
  .ledger-table tbody td:nth-child(2) { white-space: normal; }
  .ledger-table tbody td:nth-child(3) { white-space: normal; text-align: right; font-size: 0.88rem; }
  .ledger-table tbody td:nth-child(3)::before { content: 'Local code: '; }
  .ledger-table .bar { grid-column: 1 / -1; width: auto; padding-top: 10px; }
}

/* 8. Journal --------------------------------------------------------- */

.jlist { border-top: 1px solid var(--line); }
.jitem { border-bottom: 1px solid var(--line); }
.jlink { display: grid; grid-template-columns: 180px minmax(0, 1fr) 200px; gap: 8px 32px; padding: 28px 0; text-decoration: none; align-items: baseline; }
.jlink time { color: var(--ink-2); font-size: 0.92rem; }
.jtitle { font-family: var(--font-display); font-weight: 300; font-size: var(--step-2); line-height: 1.15; transition: color 0.3s; }
.jexcerpt { grid-column: 2; color: var(--ink-2); max-width: 60ch; }
.jmeta { grid-column: 3; grid-row: 1; display: flex; gap: 14px; justify-content: flex-end; color: var(--ink-2); font-size: 0.88rem; }
.jlink:hover .jtitle { color: var(--sun-text); }
.jlist-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(20px, 3vw, 48px); border-top: 0; }
.jlist-row .jitem { border-top: 1px solid var(--line); border-bottom: 0; }
.jlist-row .jlink { grid-template-columns: 1fr; gap: 14px; }
.jlist-row .jexcerpt, .jlist-row .jmeta { grid-column: 1; grid-row: auto; justify-content: flex-start; }
@media (max-width: 899px) {
  .jlink { grid-template-columns: 1fr; gap: 10px; }
  .jexcerpt, .jmeta { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .jlist-row { grid-template-columns: 1fr; }
}

.featured { margin-bottom: var(--section); }
.featured-link { display: grid; gap: 22px; padding: clamp(28px, 5vw, 72px); border-radius: 28px; text-decoration: none; color: var(--sky-ink); background: linear-gradient(160deg, var(--sky-zenith), var(--sky-horizon) 70%, var(--sky-glow)); position: relative; overflow: hidden; }
.featured-link::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--sky-scrim), transparent 75%); z-index: 0; }
.featured-link > * { position: relative; z-index: 1; }
.featured-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.92rem; color: var(--sky-ink-2); }
.featured-title { font-family: var(--font-display); font-weight: 300; font-size: var(--step-4); line-height: 1.02; max-width: 18ch; text-wrap: balance; }
.featured-excerpt { font-size: var(--step-1); max-width: 52ch; color: var(--sky-ink-2); }
.featured .link-arrow { justify-self: start; }
.journal-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 32px; }

/* Article */
.read-progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 60; pointer-events: none; }
.read-progress i { display: block; height: 100%; background: var(--sun); transform-origin: 0 50%; transform: scaleX(0); }
.article-head { display: grid; gap: 22px; max-width: 1000px; margin-bottom: clamp(48px, 7vw, 96px); }
.article-meta { display: flex; gap: 20px; color: var(--ink-2); font-size: 0.92rem; }
.article-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 8fr); gap: clamp(32px, 6vw, 120px); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 32px); }
.toc-title { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 14px; }
.toc ol { display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 1px solid transparent; text-decoration: none; color: var(--ink-2); font-size: 0.95rem; transition: color 0.3s, border-color 0.3s; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current] { color: var(--ink); border-left-color: var(--sun); }
.article-body h2 { font-family: var(--font-display); font-weight: 300; font-size: var(--step-3); line-height: 1.1; margin: 1.6em 0 0.6em; scroll-margin-top: calc(var(--header-h) + 24px); }
.article-body h2:first-child { margin-top: 0; }
.article-body h2:focus { outline: none; }
.article-body blockquote { margin: 1.6em 0; padding: 4px 0 4px 28px; border-left: 2px solid var(--sun); }
.article-body blockquote p { font-family: var(--font-display); font-weight: 300; font-size: var(--step-3); line-height: 1.15; }
@media (max-width: 899px) { .article-layout { grid-template-columns: 1fr; } .toc { position: static; } }

/* 9. Projects index -------------------------------------------------- */

.index-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; padding: 18px 0; border-block: 1px solid var(--line); margin-bottom: 28px; position: sticky; top: var(--header-h); z-index: 5; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-label { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); margin-right: 4px; }
.chip, .view-switch button, .seg button, .tabs [role='tab'] {
  border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 7px 14px; font-size: 0.88rem; font-weight: 600; min-height: 36px;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}
.chip:hover, .view-switch button:hover, .seg button:hover, .tabs [role='tab']:hover { border-color: var(--ink); }
.chip[aria-pressed='true'], .view-switch button[aria-pressed='true'], .seg button[aria-pressed='true'], .tabs [role='tab'][aria-selected='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.index-right { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.view-switch, .seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.select select { appearance: none; -webkit-appearance: none; border: 1px solid var(--line-2); border-radius: 999px; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 14px center; padding: 7px 36px 7px 14px; font-size: 0.88rem; font-weight: 600; min-height: 36px; }
.select select option { background: var(--bg); color: var(--ink); }
.index-count { color: var(--ink-2); font-size: 0.92rem; margin-bottom: 20px; }

.pgrid[data-view-mode='grid'] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 3vw, 48px) clamp(20px, 2.4vw, 36px); }
.pcard-link { display: grid; gap: 18px; text-decoration: none; }
.pcard-media { display: grid; place-items: center; aspect-ratio: 4 / 3.4; padding: 8%; border-radius: 22px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; transition: border-color 0.4s; }
.pcard-media .ax { width: 100%; height: 100%; transition: transform 0.9s var(--ease-out); }
.pcard-link:hover .pcard-media { border-color: var(--line-2); }
.pcard-link:hover .pcard-media .ax { transform: scale(1.04) translateY(-1.5%); }
.pcard-body { display: grid; gap: 8px; }
.pcard-name { font-family: var(--font-display); font-weight: 300; font-size: var(--step-2); line-height: 1.1; }
.pcard-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.88rem; color: var(--ink-2); }
.pcard-summary { color: var(--ink-2); max-width: 46ch; }
.pcard-status { display: inline-flex; align-items: center; gap: 7px; }
.pcard-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--sun); }
.pcard-status[data-s='built']::before { background: var(--sun); }
.pcard-status[data-s='on-site']::before { background: linear-gradient(90deg, var(--sun) 50%, transparent 50%); }

.pgrid[data-view-mode='list'] { display: grid; border-top: 1px solid var(--line); }
.pgrid[data-view-mode='list'] .pcard { border-bottom: 1px solid var(--line); }
.pgrid[data-view-mode='list'] .pcard-link { grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 28px; padding: 16px 0; }
.pgrid[data-view-mode='list'] .pcard-media { aspect-ratio: 1; padding: 10px; border-radius: 14px; }
.pgrid[data-view-mode='list'] .pcard-body { grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr); align-items: baseline; gap: 6px 28px; }
.pgrid[data-view-mode='list'] .pcard-summary { grid-column: 1 / -1; }
.pgrid .pcard[hidden] { display: none; }
.empty { display: grid; gap: 16px; justify-items: start; padding: 48px 0; color: var(--ink-2); }
@media (max-width: 1099px) { .pgrid[data-view-mode='grid'] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 699px) {
  .pgrid[data-view-mode='grid'] { grid-template-columns: 1fr; }
  .pgrid[data-view-mode='list'] .pcard-link { grid-template-columns: 72px minmax(0, 1fr); gap: 16px; }
  .pgrid[data-view-mode='list'] .pcard-body { grid-template-columns: 1fr; }
  .pgrid[data-view-mode='list'] .pcard-summary { display: none; }
  .index-tools { position: static; }
  .index-right { margin-left: 0; }
}

/* 10. Project page --------------------------------------------------- */

.project-head { display: grid; gap: 18px; margin-bottom: clamp(32px, 5vw, 64px); }
.project-sub { color: var(--ink-2); font-size: var(--step-1); }
.project-hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 96px); align-items: center; }
.project-figure { padding: clamp(16px, 4vw, 56px); border-radius: 28px; background: radial-gradient(120% 90% at 30% 10%, var(--bg-2), var(--bg) 70%); border: 1px solid var(--line); }
.project-figure .ax { max-height: 76vh; margin-inline: auto; }
.project-intro { display: grid; gap: 36px; }
.project-summary { font-family: var(--font-display); font-weight: 300; font-size: var(--step-2); line-height: 1.25; }
.facts { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.fact { padding: 16px 12px 16px 0; border-bottom: 1px solid var(--line); }
.fact dt { font-size: 0.82rem; color: var(--ink-2); }
.fact dd { font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; font-variant-numeric: tabular-nums; margin-top: 2px; }
.project-story { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 96px); padding-top: var(--section); }
.drawings { padding-top: var(--section); }
.drawings-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab-panel { border-radius: 28px; border: 1px solid var(--line); background: var(--bg-2); padding: clamp(16px, 3vw, 48px); }
.tab-panel:focus-visible { outline-offset: 4px; }
.plan, .elev { width: 100%; max-height: 72vh; margin-inline: auto; overflow: visible; }
.plan *, .elev * { vector-effect: non-scaling-stroke; }
.plan .grid { stroke: var(--line-2); stroke-width: 1px; stroke-dasharray: 3 4; fill: none; }
.plan text, .elev text { font-family: var(--font-display); font-weight: 500; fill: var(--ink-2); stroke: none; }
.plan .fp { fill: var(--bg-3); stroke: var(--draw); stroke-width: 0.8px; fill-opacity: 0.55; }
.plan .fp.gr { fill: var(--green); fill-opacity: 0.6; }
.plan .fp.col { fill: var(--ink); }
.plan .north circle { fill: none; stroke: var(--draw); stroke-width: 1px; }
.plan .north path { fill: var(--sun); stroke: none; }
.plan .scale path { fill: none; stroke: var(--ink); stroke-width: 1.4px; }
.elev .el { fill: var(--bg-3); stroke: var(--draw); stroke-width: 0.8px; }
.elev .el.g { fill: color-mix(in oklab, var(--bg-3) 70%, var(--tint)); }
.elev .el.gr { fill: var(--green); fill-opacity: 0.7; }
.elev .hatch { stroke: var(--line-2); stroke-width: 1px; fill: none; }
.elev .ground { stroke: var(--ink); stroke-width: 1.6px; }
.elev .lvl path { fill: var(--ink); stroke: var(--ink); stroke-width: 1px; }
.plan.draw, .elev.draw { opacity: 0; transform: translateY(12px); transition: opacity 0.8s var(--ease), transform 1s var(--ease-out); }
.plan.draw.is-drawn, .elev.draw.is-drawn { opacity: 1; transform: none; }

.sunstudy { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.sunstudy-plan { width: 100%; max-width: 600px; aspect-ratio: 1; margin-inline: auto; border-radius: 50%; overflow: hidden; }
.ss-ground { fill: var(--bg-3); fill-opacity: 0.5; }
.ss-ring { fill: none; stroke: var(--line-2); vector-effect: non-scaling-stroke; }
.ss-shadow { fill: var(--shadow-ink); fill-opacity: 0.34; transition: fill-opacity 0.4s; }
.ss-fp { fill: var(--bg-2); stroke: var(--draw); vector-effect: non-scaling-stroke; stroke-width: 0.8px; }
.ss-fp.gr { fill: color-mix(in oklab, var(--bg-2) 50%, var(--green)); }
.ss-ray { stroke: var(--sun); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; stroke-width: 1.2px; }
.ss-sun { fill: var(--sun); }
.ss-n { font-family: var(--font-display); font-weight: 500; fill: var(--ink-2); }
.sunstudy.is-night .ss-ray, .sunstudy.is-night .ss-sun { opacity: 0.35; }
.sunstudy-controls { display: grid; gap: 26px; }
.sunstudy-time { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; color: var(--ink-2); font-size: 0.92rem; }
.sunstudy-time output { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.sunstudy-time input { grid-column: 1 / -1; }
.sunstudy-read { font-family: var(--font-display); font-weight: 300; font-size: var(--step-2); line-height: 1.25; min-height: 2.5em; }

input[type='range'].std, .sunstudy-time input[type='range'], .brief input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: transparent; margin: 0; }
.sunstudy-time input[type='range']::-webkit-slider-runnable-track, .brief input[type='range']::-webkit-slider-runnable-track { height: 2px; background: var(--line-2); border-radius: 2px; }
.sunstudy-time input[type='range']::-moz-range-track, .brief input[type='range']::-moz-range-track { height: 2px; background: var(--line-2); }
.sunstudy-time input[type='range']::-webkit-slider-thumb, .brief input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -9px; border-radius: 50%; background: var(--sun); border: 3px solid var(--bg-2); box-shadow: 0 0 0 1px var(--sun); }
.sunstudy-time input[type='range']::-moz-range-thumb, .brief input[type='range']::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--sun); border: 3px solid var(--bg-2); }

.materials, .timeline { padding-top: var(--section); }
.materials .section-lede { margin: 14px 0 28px; }
.mtable th, .mtable td, .rtable th, .rtable td, .ctable th, .ctable td { text-align: left; padding: 18px 20px 18px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.mtable thead th, .rtable thead th, .ctable thead th { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); border-bottom-color: var(--line-2); }
.mtable tbody th { font-weight: 600; }
.mtable td { color: var(--ink-2); }
.mtable { min-width: 640px; }

.phases { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(130px, 1fr); margin-top: 32px; overflow-x: auto; padding-bottom: 8px; }
.phase { position: relative; display: grid; gap: 6px; padding: 28px 16px 0 0; }
.phase::before { content: ''; position: absolute; top: 6px; left: 0; right: 0; height: 1px; background: var(--line-2); }
.phase::after { content: ''; position: absolute; top: 0; left: 0; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--bg); }
.phase.is-done::before { background: var(--sun); }
.phase.is-done::after { background: var(--sun); border-color: var(--sun); }
.phase.is-current::after { border-color: var(--sun); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sun) 25%, transparent); }
.phase-year { font-family: var(--font-display); font-weight: 500; font-variant-numeric: tabular-nums; }
.phase-name { color: var(--ink-2); font-size: 0.95rem; }

.next-project, .next-article { padding-top: var(--section); }
.next-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 32px; padding: clamp(28px, 4vw, 56px) 0; border-block: 1px solid var(--line); text-decoration: none; align-items: center; }
.next-label { font-size: 0.85rem; color: var(--ink-2); font-weight: 600; }
.next-name { font-family: var(--font-display); font-weight: 300; font-size: var(--step-4); line-height: 1; transition: transform 0.7s var(--ease-out); }
.next-meta { color: var(--ink-2); }
.next-media { grid-column: 2; grid-row: 1 / span 3; width: clamp(120px, 18vw, 260px); }
.next-link:hover .next-name { transform: translateX(16px); }
@media (max-width: 899px) {
  .project-hero, .project-story, .sunstudy { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .next-media { width: 96px; }
}

/* 11. Studio --------------------------------------------------------- */

.principles, .people, .recognition, .careers { padding-top: var(--section); }
.principles-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(28px, 5vw, 96px); margin-top: 40px; }
.principles-list li { display: grid; gap: 12px; padding: 32px 0; border-top: 1px solid var(--line); }
.principles-list h3 { font-family: var(--font-display); font-weight: 300; font-size: var(--step-3); line-height: 1.08; }
.principles-list p { color: var(--ink-2); max-width: 48ch; }
.people-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px clamp(20px, 3vw, 48px); }
.person { display: grid; gap: 6px; justify-items: start; }
.monogram { display: grid; place-items: center; width: 96px; height: 96px; margin-bottom: 14px; border-radius: 50%; font-family: var(--font-display); font-weight: 500; font-size: 1.6rem; letter-spacing: 0.06em; color: var(--sky-ink); background: radial-gradient(circle at 50% 120%, var(--sky-glow), var(--sky-horizon) 45%, var(--sky-zenith)); box-shadow: inset 0 0 0 1px var(--line-2); }
.person-name { font-weight: 600; font-size: 1.1rem; }
.person-role { color: var(--ink-2); }
.rtable td:first-child { font-family: var(--font-display); font-weight: 500; font-variant-numeric: tabular-nums; width: 90px; }
.rtable { margin-top: 28px; min-width: 560px; }
.careers-inner { display: grid; gap: 20px; justify-items: start; max-width: 60ch; padding: clamp(28px, 5vw, 64px); border-radius: 28px; border: 1px solid var(--line); background: var(--bg-2); }
.careers-inner p { color: var(--ink-2); font-size: var(--step-1); }
@media (max-width: 899px) { .principles-list { grid-template-columns: 1fr; } .people-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .people-list { grid-template-columns: 1fr; } }

/* 12. Services ------------------------------------------------------- */

.process, .models, .faq { padding-top: var(--section); }
.process-list { margin-top: 40px; border-top: 1px solid var(--line); }
.pstep { display: grid; grid-template-columns: minmax(80px, 2fr) minmax(0, 10fr); gap: 24px; padding: 32px 0; border-bottom: 1px solid var(--line); }
.pstep-n { font-family: var(--font-display); font-weight: 300; font-size: var(--step-4); line-height: 0.9; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pstep > div { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 6px 40px; }
.pstep h3 { font-family: var(--font-display); font-weight: 300; font-size: var(--step-3); line-height: 1.05; }
.pstep-time { grid-column: 1; color: var(--sun-text); font-weight: 600; font-size: 0.92rem; }
.pstep p:not(.pstep-time) { grid-column: 2; grid-row: 1 / span 2; color: var(--ink-2); max-width: 56ch; }
.ctable { margin-top: 32px; min-width: 760px; }
.ctable tbody th { font-weight: 600; width: 18%; }
.ctable td { color: var(--ink-2); }
.yes, .no { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.yes::before, .no::before { content: ''; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--sun); }
.yes::before { background: var(--sun); }
.no { color: var(--ink-2); }
.no::before { border-color: var(--ink-3); }
.faq-list { margin-top: 32px; border-top: 1px solid var(--line); max-width: 900px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 0; cursor: pointer; font-family: var(--font-display); font-weight: 300; font-size: var(--step-2); line-height: 1.2; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; flex: none; width: 14px; height: 14px; background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat, linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat; transition: transform 0.4s var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 26px; color: var(--ink-2); max-width: 64ch; font-size: 1.05rem; }
@media (max-width: 899px) {
  .pstep { grid-template-columns: 1fr; gap: 10px; }
  .pstep > div { grid-template-columns: 1fr; }
  .pstep p:not(.pstep-time) { grid-column: 1; grid-row: auto; }
}

/* 13. Contact brief -------------------------------------------------- */

.contact-layout { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: clamp(40px, 6vw, 120px); align-items: start; }
.brief { display: grid; gap: 36px; scroll-margin-top: calc(var(--header-h) + 24px); }
.brief-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; counter-reset: bp; }
.brief-progress li { counter-increment: bp; display: grid; gap: 10px; font-size: 0.85rem; color: var(--ink-2); }
.brief-progress li::before { content: ''; height: 2px; background: var(--line-2); border-radius: 2px; transition: background-color 0.4s; }
.brief-progress li span::before { content: counter(bp) '  '; font-family: var(--font-display); font-weight: 500; white-space: pre; }
.brief-progress li[aria-current='step'] { color: var(--ink); font-weight: 600; }
.brief-progress li[aria-current='step']::before, .brief-progress li.is-done::before { background: var(--sun); }
.brief-step { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 26px; }
.brief-step legend { font-family: var(--font-display); font-weight: 300; font-size: var(--step-3); line-height: 1.1; margin-bottom: 26px; padding: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 14px 18px; border: 1px solid var(--line-2); border-radius: 16px; font-weight: 600; transition: border-color 0.25s, background-color 0.25s; }
.choice span::before { content: ''; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--ink-3); transition: background-color 0.25s, border-color 0.25s, box-shadow 0.25s; }
.choice:hover span { border-color: var(--ink); }
.choice input:checked + span { border-color: var(--sun); background: color-mix(in srgb, var(--sun) 9%, transparent); }
.choice input:checked + span::before { background: var(--sun); border-color: var(--sun); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sun) 22%, transparent); }
.choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 3px; }
.field { display: grid; gap: 8px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.field label { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; font-weight: 600; color: var(--ink-2); }
.field label output { font-family: var(--font-display); font-weight: 500; color: var(--ink); font-size: 1.05rem; }
.optional { font-weight: 400; }
.field input:not([type='range']), .field select, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 14px; background: color-mix(in srgb, var(--bg-2) 60%, transparent);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.field select option { background: var(--bg); color: var(--ink); }
.field input:not([type='range']):hover, .field select:hover, .field textarea:hover { border-color: var(--ink-3); }
.field input:not([type='range']):focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }
[aria-invalid='true'] { border-color: var(--error) !important; }
.field-error { color: var(--error); font-size: 0.88rem; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--sun); }
.brief-nav { display: flex; gap: 12px; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--line); padding-top: 24px; }
.brief-nav [data-prev] { margin-right: auto; }
.brief-summary { border-radius: 18px; border: 1px solid var(--line); background: var(--bg-2); padding: 22px 24px; }
.brief-summary:empty { display: none; }
.brief-summary-title { font-weight: 600; margin-bottom: 12px; }
.brief-summary dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; }
.brief-summary dt { color: var(--ink-2); font-size: 0.92rem; }
.brief-done { display: grid; gap: 20px; justify-items: start; padding: clamp(28px, 4vw, 48px); border-radius: 24px; background: var(--bg-2); border: 1px solid var(--line); }
.brief-done:focus { outline: none; }
.brief-done p { color: var(--ink-2); font-size: var(--step-1); max-width: 52ch; }
.brief-fail { color: var(--error); font-weight: 600; }
.contact-aside { display: grid; gap: 14px; position: sticky; top: calc(var(--header-h) + 32px); }
.contact-mail { font-family: var(--font-display); font-weight: 300; font-size: var(--step-2); text-decoration: none; overflow-wrap: anywhere; }
.contact-mail:hover { text-decoration: underline; }
.offices-stack { margin-top: 18px; grid-template-columns: 1fr !important; }
@media (max-width: 999px) { .contact-layout { grid-template-columns: 1fr; } .contact-aside { position: static; } }
@media (max-width: 640px) {
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .brief-progress li span { font-size: 0; }
  .brief-progress li span::before { font-size: 0.85rem; }
  .brief-progress li[aria-current='step'] span { font-size: 0.85rem; }
  .brief-progress li[aria-current='step'] span::before { content: counter(bp) '  '; }
}

/* 14. Footer --------------------------------------------------------- */

.site-footer { position: relative; isolation: isolate; border-top: 1px solid var(--line); }
.footer-sky { position: absolute; inset: 0 0 auto; height: clamp(420px, 56vh, 620px); z-index: -1; background: linear-gradient(var(--sky-zenith), var(--sky-horizon) 72%, var(--sky-glow)); }
.footer-sky::after { content: ''; position: absolute; inset: auto 0 0; height: 45%; background: linear-gradient(transparent, var(--bg)); }
.footer-cta { position: relative; display: grid; gap: 24px; justify-items: start; padding-block: clamp(96px, 12vw, 180px) clamp(72px, 9vw, 140px); color: var(--sky-ink); }
.footer-arc { position: absolute; right: 0; bottom: clamp(72px, 9vw, 140px); width: min(44%, 560px); height: auto; overflow: visible; pointer-events: none; }
.footer-arc path { vector-effect: non-scaling-stroke; }
.footer-arc .glyph-arc { stroke-width: 1.2px; stroke-dasharray: 3 7; opacity: 0.55; }
.footer-arc .glyph-horizon { stroke-width: 1.2px; opacity: 0.55; }
.footer-arc .glyph-sun { fill: #ffc46b; filter: drop-shadow(0 0 0.8px #ffc46b) drop-shadow(0 0 2px rgba(255, 196, 107, 0.7)); }
@media (max-width: 899px) { .footer-arc { position: relative; right: auto; bottom: auto; width: 70%; order: -1; margin-bottom: 8px; } }
.footer-title { font-family: var(--font-display); font-weight: 300; font-size: var(--step-5); line-height: 0.96; letter-spacing: -0.025em; max-width: 12ch; }
.footer-lede { font-size: var(--step-1); max-width: 48ch; color: var(--sky-ink-2); }
.site-footer .footer-cta .btn-primary { background: #ffc46b; color: #1b1404; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 6fr) repeat(3, minmax(0, 2fr)); gap: 40px; padding-block: 48px; border-top: 1px solid var(--line); }
.footer-head { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 16px; }
.footer-nav ul { display: grid; gap: 8px; }
.footer-nav a, .footer-contact a { text-decoration: none; }
.footer-nav a:hover, .footer-contact a:hover { text-decoration: underline; }
.offices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.office { display: grid; gap: 2px; align-content: start; }
.office-city { font-weight: 600; }
.office-time { font-family: var(--font-display); font-weight: 500; font-size: 1.8rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.office-light { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 0.9rem; }
.office-light::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--sun) calc(var(--office-day, 0) * 100%), var(--ink-3)); }
.office-address { color: var(--ink-2); font-size: 0.88rem; margin-top: 6px; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; padding-block: 24px 40px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 0.88rem; }
@media (max-width: 1099px) { .footer-grid { grid-template-columns: 1fr 1fr 1fr; } .footer-grid > section:first-child { grid-column: 1 / -1; } }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } .offices { grid-template-columns: 1fr; } .footer-contact { grid-column: 1 / -1; } }

/* 404 */
.notfound-inner { display: grid; gap: 28px; justify-items: start; padding-block: clamp(40px, 8vw, 120px); }
.notfound-glyph { width: min(360px, 80%); overflow: visible; }
.nf-arc { fill: none; stroke: var(--draw); stroke-width: 1.2; stroke-dasharray: 4 6; }
.nf-horizon { stroke: var(--ink); stroke-width: 1.2; }
.nf-sun { fill: var(--sun); }

/* 15. Utilities and motion ------------------------------------------ */

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.45s; animation-timing-function: var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .ax.draw { -webkit-mask-image: none; mask-image: none; }
  .plan.draw, .elev.draw { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}

@media print {
  .site-header, .site-menu, .hero-canvas, .scrubber, .footer-sky, .read-progress, .index-tools { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Page-specific adjustments */
.next-label, .next-name, .next-meta { grid-column: 1; }
[data-page='contact'] .footer-cta, [data-page='contact'] .footer-sky { display: none; }
[data-page='contact'] .footer-grid { border-top: 0; }
