:root {
  --ink: #0f1622;
  --panel: #151e2c;
  --line: #273244;
  --ivory: #ede6d8;
  --mist: #a3abb8;
  --brass: #c29b5f;
  --brass-soft: rgba(194, 155, 95, 0.14);
  --serif: "Bodoni Moda", "Didot", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, sans-serif;
  --wrap: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  background: var(--ink);
  color: var(--ivory);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* Header */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(15, 22, 34, 0.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; justify-content: space-between; align-items: center; height: 68px; }
.logo { font-family: var(--serif); font-size: 1.35rem; text-decoration: none; letter-spacing: 0.01em; }
.nav nav { display: flex; gap: 28px; }
.nav nav a { text-decoration: none; color: var(--mist); font-size: 0.95rem; transition: color .2s; }
.nav nav a:hover { color: var(--brass); }

/* Type */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.08; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 4.5vw, 3rem); }
h3 { font-size: 1.45rem; }
.rule { width: 56px; height: 1px; background: var(--brass); border: 0; margin: 28px 0; }

/* Buttons */
.actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 13px 26px; text-decoration: none; font-size: 0.95rem; font-weight: 500;
  border: 1px solid var(--brass); color: var(--brass); border-radius: 2px; transition: background .2s, color .2s;
}
.btn:hover { background: var(--brass); color: var(--ink); }
.btn.solid { background: var(--brass); color: var(--ink); }
.btn.solid:hover { background: transparent; color: var(--brass); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; min-height: calc(100vh - 68px); padding: 64px 0; }
.hero .where { color: var(--mist); font-size: 1rem; }
.hero h1 { font-size: clamp(3.6rem, 10vw, 7.5rem); margin: 18px 0 0; font-weight: 400; }
.hero .tagline { font-size: 1.2rem; color: var(--mist); max-width: 34ch; margin-bottom: 36px; }
.drawing { width: 100%; height: auto; color: var(--brass); }
.drawing .thin { stroke: currentColor; stroke-width: 1; fill: none; }
.drawing .center { stroke: currentColor; stroke-width: .75; stroke-dasharray: 10 4 2 4; fill: none; opacity: .55; }
.drawing .dim { stroke: var(--mist); stroke-width: .75; fill: none; }
.drawing text { fill: var(--mist); font-family: var(--sans); font-size: 11px; letter-spacing: .04em; }
.drawing .draw { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 2.4s cubic-bezier(.6,.1,.3,1) forwards; }
.drawing .late { opacity: 0; animation: fade .8s ease 1.9s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .drawing .draw { animation: none; stroke-dashoffset: 0; }
  .drawing .late { animation: none; opacity: 1; }
}

/* Sections */
.section { padding: 120px 0; border-top: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 280px 1fr; gap: 48px; }
.split > h2 { position: sticky; top: 100px; align-self: start; }
.lead { font-size: 1.3rem; line-height: 1.6; max-width: 58ch; }

.facts { margin-top: 48px; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 160px 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--mist); }

/* Featured project */
.featured {
  display: grid; grid-template-columns: 1fr 1fr; text-decoration: none;
  border: 1px solid var(--line); background: var(--panel); margin-bottom: 72px; transition: border-color .25s;
}
.featured:hover { border-color: var(--brass); }
.featured .numbers { padding: 48px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.figure { display: flex; align-items: baseline; gap: 16px; }
.figure .n { font-family: var(--serif); font-size: clamp(3.4rem, 7vw, 5.5rem); line-height: 1; }
.figure .n.old { color: var(--mist); font-size: clamp(2.2rem, 4vw, 3rem); }
.figure .l { color: var(--mist); font-size: .95rem; max-width: 18ch; line-height: 1.4; }
.featured .text { padding: 48px; display: flex; flex-direction: column; justify-content: center; }
.featured .tools { color: var(--brass); font-size: .9rem; margin-bottom: 12px; }
.featured h3 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); margin-bottom: 16px; }
.featured p { color: var(--mist); }
.featured .open { color: var(--brass); margin-top: 28px; font-weight: 500; }

/* Project list */
.list-title { font-family: var(--sans); font-size: 1rem; color: var(--mist); font-weight: 500; margin-bottom: 8px; }
.work { list-style: none; border-top: 1px solid var(--line); }
.work li { display: grid; grid-template-columns: 1.1fr 1.6fr 0.9fr; gap: 32px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.work h3 { font-size: 1.5rem; }
.work p { color: var(--mist); }
.work .tools { color: var(--brass); font-size: .9rem; text-align: right; }

/* Leadership */
.roles { list-style: none; }
.roles > li { padding: 32px 0; border-bottom: 1px solid var(--line); }
.roles > li:first-child { padding-top: 0; }
.roles .org { color: var(--brass); font-size: .95rem; margin: 6px 0 10px; }
.roles ul { margin-left: 18px; color: var(--mist); }
.roles p { color: var(--mist); }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.skills-grid h3 { font-size: 1.25rem; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--brass); }
.skills-grid ul { list-style: none; color: var(--mist); display: grid; gap: 6px; }

/* Contact */
.contact .mail { font-family: var(--serif); font-size: clamp(1.6rem, 5vw, 3.6rem); text-decoration: none; display: inline-block; margin: 24px 0 32px; border-bottom: 1px solid var(--brass); line-height: 1.2; transition: color .2s; overflow-wrap: anywhere; }
.contact .mail:hover { color: var(--brass); }

footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--mist); font-size: .9rem; }
footer .wrap { display: flex; justify-content: space-between; }

/* Case study page */
.case { max-width: 860px; margin: 0 auto; padding: 56px 24px 96px; }
.back { display: inline-block; color: var(--mist); text-decoration: none; margin-bottom: 48px; transition: color .2s; }
.back:hover { color: var(--brass); }
.case-head .tools { color: var(--brass); }
.case-head h1 { font-size: clamp(2.8rem, 8vw, 5.2rem); font-weight: 400; margin: 14px 0 24px; }
.case-head .lead { color: var(--mist); }
.case-head .lead strong { color: var(--ivory); font-weight: 600; }

.result { margin: 72px 0; padding: 48px; background: var(--panel); border: 1px solid var(--line); }
.result h2 { font-size: 1.6rem; margin-bottom: 32px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.compare .n { font-family: var(--serif); font-size: clamp(3.2rem, 9vw, 5.5rem); line-height: 1; }
.compare .old .n { color: var(--mist); }
.compare .label { color: var(--mist); margin: 10px 0 18px; }
.meter { height: 2px; background: var(--line); }
.meter span { display: block; height: 100%; background: var(--brass); }
.compare .old .meter span { background: var(--mist); }
.caption { color: var(--mist); font-size: .9rem; margin-top: 32px; }

.case-section { padding: 56px 0; border-top: 1px solid var(--line); }
.case-section h2 { font-size: 1.9rem; margin-bottom: 18px; }
.case-section p { color: var(--mist); max-width: 64ch; }
.points { margin-left: 20px; color: var(--mist); display: grid; gap: 8px; max-width: 64ch; }

.shot { margin: 0; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.shot img, .shot video { width: 100%; height: auto; }
.shot.placeholder { aspect-ratio: 16 / 9; display: grid; place-items: center; color: var(--mist); font-size: .95rem;
  background: repeating-linear-gradient(135deg, transparent 0 14px, var(--brass-soft) 14px 15px), var(--panel); }
.hero-shot { margin-top: 48px; }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
.shots .shot.placeholder { aspect-ratio: 4 / 3; }

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 56px 0 80px; }
  .hero .drawing { max-width: 420px; }
  .split { grid-template-columns: 1fr; gap: 28px; }
  .split > h2 { position: static; }
  .featured { grid-template-columns: 1fr; }
  .featured .numbers { border-right: 0; border-bottom: 1px solid var(--line); }
  .work li { grid-template-columns: 1fr; gap: 8px; }
  .work .tools { text-align: left; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .shots { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .nav .wrap { flex-direction: column; height: auto; padding-top: 14px; padding-bottom: 14px; gap: 8px; }
  .nav nav { gap: 18px; flex-wrap: wrap; justify-content: center; font-size: .9rem; }
  .section { padding: 80px 0; }
  .featured .numbers, .featured .text, .result { padding: 28px; }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .skills-grid { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .case { padding: 40px 16px 72px; }
  footer .wrap { flex-direction: column; gap: 4px; }
}

/* Case study: figures, design path, downloads */
.shot figcaption { padding: 12px 16px; color: var(--mist); font-size: .88rem; border-top: 1px solid var(--line); }
.drawing-frame img { padding: 24px; aspect-ratio: 4 / 5; object-fit: contain; }
.sim-frame img { background: #fff; aspect-ratio: 4 / 5; object-fit: contain; padding: 12px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.aside-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: start; }
.path { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.path li { counter-increment: step; }
.path .drawing-frame img { padding: 16px; }
.path h3 { font-size: 1.2rem; margin: 16px 0 6px; }
.path h3::before { content: counter(step) ". "; color: var(--brass); }
.path p { font-size: .92rem; }
.downloads { list-style: none; margin-top: 24px; border-top: 1px solid var(--line); }
.downloads a { display: flex; justify-content: space-between; gap: 16px; padding: 16px 4px; border-bottom: 1px solid var(--line); text-decoration: none; transition: color .2s, padding .2s; }
.downloads a:hover { color: var(--brass); padding-left: 10px; }
.downloads .size { color: var(--mist); font-size: .9rem; white-space: nowrap; }
@media (max-width: 900px) {
  .path { grid-template-columns: 1fr 1fr; }
  .aside-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .pair, .path { grid-template-columns: 1fr; }
}

/* 3D viewer */
.viewer { position: relative; margin-top: 28px; aspect-ratio: 4 / 3; background: var(--panel); border: 1px solid var(--line);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px; background-position: center; cursor: grab; touch-action: none; }
.viewer:active { cursor: grabbing; }
.viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.viewer-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 32px; }
@media (max-width: 640px) { .viewer { aspect-ratio: 1 / 1; } }
.viewer-toggle { position: absolute; right: 16px; bottom: 16px; z-index: 2; padding: 10px 18px; font: 500 .9rem var(--sans);
  color: var(--brass); background: rgba(15, 22, 34, .7); backdrop-filter: blur(8px); border: 1px solid var(--brass); border-radius: 2px; cursor: pointer; transition: background .2s, color .2s; }
.viewer:not(.is-live) .viewer-toggle { display: none; }
@media (hover: hover) { .viewer-toggle:hover { background: var(--brass); color: var(--ink); } }
.github-link { margin-top: 28px; }

/* Hero name: one line on wider screens */
.hero h1 { font-size: clamp(3.4rem, 7vw, 5.8rem); }
@media (min-width: 901px) { .hero h1 { white-space: nowrap; } }
