/* ============================================================
   Homepage - editorial engineering system.
   Self-contained: the sub-pages still run css/styles.css, so this
   file carries its own tokens rather than inheriting them.
   ============================================================ */

:root {
  --bg:        #FAFAFA;
  --bg-2:      #F5F3F0;
  --ink:       #0A0A0A;
  --ink-2:     #46454A;
  --ink-3:     #86848C;
  --rule:      rgba(10,10,10,.12);
  --rule-soft: rgba(10,10,10,.07);
  --red:       #DC2626;

  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans:    'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1440px;
  --gut:  clamp(20px, 4.4vw, 72px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; font-weight: 400; line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  background: var(--ink); color: var(--bg); padding: 10px 16px;
  font-size: .85rem; transform: translateY(-160%); transition: transform .3s var(--ease);
}
.skip-link:focus { transform: none; }

/* ---------- Type scale ---------- */
.display {
  font-family: var(--display); font-optical-sizing: auto;
  font-weight: 600; letter-spacing: -.028em; line-height: .98;
}
.eyebrow {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-3);
}
.lede { font-size: clamp(1.02rem, 1.1vw, 1.16rem); line-height: 1.7; color: var(--ink-2); max-width: 56ch; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), padding .3s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--rule); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; height: clamp(64px, 5vw, 86px);
  transition: height .3s var(--ease);
}
.nav.is-stuck .nav-inner { height: clamp(56px, 4vw, 66px); }
.nav-name {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .14em;
  text-transform: uppercase; font-weight: 500;
}
.nav-links { display: flex; gap: clamp(18px, 2.4vw, 40px); align-items: center; }
.nav-links a {
  position: relative; font-family: var(--mono); font-size: .72rem;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-2);
  padding: 4px 0; transition: color .25s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--ink); transition: right .35s var(--ease);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.is-active::after { right: 0; }
.nav-cta { color: var(--red) !important; }
.nav-cta::after { background: var(--red) !important; }

.menu-btn { display: none; width: 40px; height: 34px; position: relative; }
.menu-btn span {
  position: absolute; left: 8px; right: 8px; height: 1.5px; background: var(--ink);
  transition: transform .35s var(--ease), opacity .2s;
}
.menu-btn span:nth-child(1) { top: 13px; }
.menu-btn span:nth-child(2) { top: 20px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 88; background: var(--bg);
  display: grid; align-content: center; padding: 0 var(--gut);
  clip-path: inset(0 0 100% 0); transition: clip-path .6s var(--ease);
}
.menu.is-open { clip-path: inset(0 0 0 0); }
.menu a {
  font-family: var(--display); font-size: clamp(2.2rem, 11vw, 4rem);
  font-weight: 600; letter-spacing: -.03em; padding: 10px 0;
  border-bottom: 1px solid var(--rule-soft);
  opacity: 0; transform: translateY(24px);
}
.menu.is-open a { opacity: 1; transform: none; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.menu.is-open a:nth-child(1) { transition-delay: .12s; }
.menu.is-open a:nth-child(2) { transition-delay: .18s; }
.menu.is-open a:nth-child(3) { transition-delay: .24s; }
.menu.is-open a:nth-child(4) { transition-delay: .30s; }
.menu.is-open a:nth-child(5) { transition-delay: .36s; }

/* ---------- Sections ---------- */
.sec { padding: clamp(72px, 11vw, 168px) 0; position: relative; }
.sec-alt { background: var(--bg-2); }
.sec-head { display: grid; gap: 22px; margin-bottom: clamp(44px, 6vw, 84px); }
.sec-head .eyebrow { display: block; }
.sec-title { font-family: var(--display); font-optical-sizing: auto; font-size: clamp(1.9rem, 3.6vw, 3rem); max-width: 18ch; }
.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* ---------- 01 Hero ---------- */
.hero { padding: clamp(140px, 18vw, 230px) 0 clamp(60px, 8vw, 110px); position: relative; }
.hero-meta { display: flex; gap: 18px; align-items: center; margin-bottom: clamp(28px, 4vw, 46px); }
.hero-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); flex: none; }
.hero-title { font-size: clamp(2.9rem, 9.4vw, 8.6rem); max-width: 14ch; }
.hero-title .ln { display: block; overflow: hidden; }
.hero-title .ln > span { display: block; }
.hero-foot {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(28px, 5vw, 80px); align-items: end;
  margin-top: clamp(38px, 5vw, 64px);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 26px; font-family: var(--mono); font-size: .74rem;
  letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--ink); transition: background .3s var(--ease), color .3s var(--ease);
  will-change: transform;
}
.btn svg { width: 14px; height: 14px; }
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { background: var(--red); border-color: var(--red); }
.btn-line:hover { background: var(--ink); color: var(--bg); }
.hero-sig { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; color: var(--ink-3); text-align: right; line-height: 2; }
.hero-sig strong { display: block; color: var(--ink); font-weight: 500; letter-spacing: .14em; }

/* Instrument field: a coordinate grid with sparse markers. Not decoration -
   it is the measuring surface the headline talks about. */
.hero-field { position: absolute; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.hero-field svg { position: absolute; right: -4%; top: 8%; width: min(62%, 900px); height: auto; opacity: .5; }
.hf-grid { stroke: var(--ink); stroke-width: .5; opacity: .1; }
.hf-axis { stroke: var(--ink); stroke-width: .8; opacity: .22; }
.hf-trace { fill: none; stroke: var(--ink); stroke-width: 1.4; opacity: .5; }
.hf-node { fill: var(--red); }
.hf-tick { stroke: var(--ink); stroke-width: 1; opacity: .3; }

/* ---------- 02 Selected work ---------- */
.work-item { border-top: 1px solid var(--rule); padding: clamp(46px, 6vw, 96px) 0; }
.work-idx { font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; color: var(--ink-3); }
.work-title { font-family: var(--display); font-optical-sizing: auto; font-size: clamp(2rem, 5vw, 4.2rem); margin-top: 14px; }
.work-chain { font-family: var(--mono); font-size: .76rem; letter-spacing: .06em; color: var(--red); margin-top: 18px; }
.work-desc { margin-top: 22px; font-size: 1.02rem; line-height: 1.72; color: var(--ink-2); max-width: 50ch; }
.work-link {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 30px;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  padding-bottom: 6px; border-bottom: 1px solid var(--ink);
  transition: gap .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.work-link:hover { gap: 18px; color: var(--red); border-bottom-color: var(--red); }
.work-link svg { width: 14px; height: 14px; }

/* Each project gets its own composition. */
.work-split { display: grid; gap: clamp(30px, 5vw, 76px); align-items: center; }
.w-text-left  { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.w-text-right { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.w-text-right .work-copy { order: 2; }
.w-full { display: block; }
.work-figure { position: relative; }
.work-figure img { width: 100%; height: auto; }
.work-cap { margin-top: 14px; font-family: var(--mono); font-size: .68rem; color: var(--ink-3); line-height: 1.7; }

/* ---------- 03 Philosophy ---------- */
.phil-statement {
  font-family: var(--display); font-optical-sizing: auto;
  font-size: clamp(2rem, 6.4vw, 5.2rem); font-weight: 600;
  letter-spacing: -.03em; line-height: 1.04; max-width: 17ch;
}
.phil-statement em { font-style: normal; color: var(--red); }
.phil-quote {
  margin-top: clamp(44px, 6vw, 80px); padding-top: 30px; border-top: 1px solid var(--rule);
  font-family: var(--display); font-size: clamp(1.2rem, 2.2vw, 1.9rem);
  font-weight: 500; letter-spacing: -.02em; max-width: 24ch;
}
.phil-quote span { display: block; margin-top: 14px; font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }

.process { margin-top: clamp(56px, 7vw, 100px); display: grid; gap: 0; }
.proc-step {
  display: grid; grid-template-columns: 64px minmax(0, 220px) minmax(0, 1fr);
  gap: clamp(14px, 3vw, 40px); align-items: baseline;
  padding: 26px 0; border-top: 1px solid var(--rule-soft);
  opacity: .38; transition: opacity .5s var(--ease);
}
.proc-step.is-active { opacity: 1; }
.proc-n { font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; color: var(--red); }
.proc-name { font-family: var(--display); font-size: clamp(1.1rem, 1.9vw, 1.6rem); font-weight: 600; letter-spacing: -.02em; }
.proc-line { font-size: .95rem; color: var(--ink-2); line-height: 1.7; }

/* ---------- 04 Proof ---------- */
.proof-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(34px, 6vw, 90px); align-items: start; }
.bench { display: grid; gap: 34px; }
.bench-row { display: grid; gap: 12px; }
.bench-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.bench-name { font-family: var(--mono); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; }
.bench-val { font-family: var(--display); font-size: clamp(1.7rem, 3.4vw, 2.8rem); font-weight: 600; letter-spacing: -.02em; }
.bench-track { height: 3px; background: var(--rule-soft); position: relative; }
.bench-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ink); }
.bench-row.is-subject .bench-fill { background: var(--red); }
.bench-row.is-subject .bench-val { color: var(--red); }
.bench-note { font-family: var(--mono); font-size: .7rem; color: var(--ink-3); line-height: 1.8; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 28px; margin-top: 8px; }
.metric-v { font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2.2rem); font-weight: 600; letter-spacing: -.02em; }
.metric-k { margin-top: 8px; font-size: .88rem; color: var(--ink-2); }
.metric-n { margin-top: 4px; font-family: var(--mono); font-size: .68rem; color: var(--ink-3); line-height: 1.7; }

/* ---------- 05 Technical range ---------- */
.range { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: clamp(30px, 4vw, 64px); }
.domain { border-top: 1px solid var(--rule); padding-top: 26px; transition: opacity .4s var(--ease); }
.range.has-focus .domain { opacity: .35; }
.range.has-focus .domain.is-focus { opacity: 1; }
.domain-name { font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2.2rem); font-weight: 600; letter-spacing: -.024em; }
.domain-list { margin-top: 22px; display: grid; gap: 11px; }
.domain-list li { font-family: var(--mono); font-size: .82rem; color: var(--ink-2); letter-spacing: .02em; }
.domain-list li.is-lang { color: var(--ink); font-weight: 500; }
.lang-row {
  margin-bottom: clamp(40px, 5vw, 66px); padding-bottom: clamp(32px, 4vw, 48px);
  border-bottom: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: clamp(18px, 3vw, 48px); align-items: baseline;
}
.lang-row .eyebrow { flex: 0 0 100%; margin-bottom: 8px; }
.lang {
  font-family: var(--display); font-size: clamp(1.4rem, 3.2vw, 2.6rem);
  font-weight: 600; letter-spacing: -.026em;
}

/* ---------- 06 Portrait ---------- */
.portrait-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 90px); align-items: center; }
.portrait-fig { position: relative; overflow: hidden; }
.portrait-fig img { width: 100%; height: auto; filter: grayscale(1) contrast(1.03); transition: filter .8s var(--ease); }
.portrait-fig:hover img { filter: grayscale(0) contrast(1); }
.portrait-name { font-family: var(--display); font-size: clamp(2rem, 4.6vw, 3.6rem); font-weight: 600; letter-spacing: -.03em; }
.portrait-role { margin-top: 14px; font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.portrait-body { margin-top: 28px; display: grid; gap: 18px; color: var(--ink-2); line-height: 1.75; max-width: 46ch; }

/* ---------- 07 Experience ---------- */
.tl { position: relative; display: grid; gap: 0; }
.tl::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--rule); }
.tl::after { content: ""; position: absolute; left: 0; top: 0; width: 1px; height: var(--tl, 0%); background: var(--ink); }
.tl-row {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(16px, 3vw, 44px); align-items: baseline;
  padding: 28px 0 28px clamp(22px, 3vw, 40px);
  border-bottom: 1px solid var(--rule-soft);
  opacity: .45; transition: opacity .5s var(--ease);
}
.tl-row.is-active { opacity: 1; }
.tl-date { font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; color: var(--ink-3); }
.tl-role { font-family: var(--display); font-size: clamp(1.05rem, 1.8vw, 1.45rem); font-weight: 600; letter-spacing: -.02em; }
.tl-org { display: block; margin-top: 6px; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; color: var(--red); }
.tl-line { font-size: .95rem; color: var(--ink-2); line-height: 1.7; }

/* ---------- 08 Contact ---------- */
.contact-title { font-size: clamp(2.4rem, 8.4vw, 7rem); max-width: 13ch; }
.contact-links { margin-top: clamp(46px, 6vw, 80px); display: grid; }
.contact-links a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  padding: 24px 0; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
  transition: color .3s var(--ease), padding-left .35s var(--ease);
}
.contact-links a:last-child { border-bottom: 1px solid var(--rule); }
.contact-links a:hover { color: var(--red); padding-left: 14px; }
.contact-links .cv { font-family: var(--sans); font-size: .9rem; letter-spacing: 0; text-transform: none; color: var(--ink-3); }

/* ---------- Footer ---------- */
.foot { padding: clamp(40px, 5vw, 64px) 0; border-top: 1px solid var(--rule); }
.foot-inner { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; color: var(--ink-3); }

/* ---------- Cursor ---------- */
.cursor { position: fixed; top: 0; left: 0; z-index: 300; pointer-events: none; mix-blend-mode: difference; }
.cursor-dot { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); }
.cursor-ring {
  position: absolute; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.7);
  transform: translate(-50%, -50%) scale(.4); opacity: 0;
  transition: transform .35s var(--ease), opacity .35s var(--ease);
}
.cursor.is-hot .cursor-ring { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.cursor.is-hot .cursor-dot { opacity: 0; }

/* ---------- Reveal ---------- */
.js .rv { opacity: 0; transform: translateY(26px); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .proof-grid { grid-template-columns: 1fr; }
  .portrait-grid { grid-template-columns: 1fr; }
  .tl-row { grid-template-columns: 100px minmax(0, 1fr); }
  .tl-line { grid-column: 2; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .menu-btn { display: block; }
  .w-text-left, .w-text-right { grid-template-columns: 1fr; }
  .w-text-right .work-copy { order: 0; }
  .hero-foot { grid-template-columns: 1fr; align-items: start; }
  .hero-sig { text-align: left; }
  .hero-field svg { width: 120%; right: -30%; top: auto; bottom: 4%; opacity: .3; }
  .proc-step { grid-template-columns: 44px minmax(0, 1fr); }
  .proc-line { grid-column: 2; }
  .cursor { display: none; }
}
@media (max-width: 560px) {
  .tl-row { grid-template-columns: 1fr; gap: 10px; }
  .tl-line { grid-column: 1; }
  .contact-links a { flex-direction: column; gap: 8px; }
}
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .js .rv { opacity: 1; transform: none; }
  .cursor { display: none; }
  .proc-step, .tl-row { opacity: 1; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .nav, .menu, .cursor, .hero-field { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Architecture SVGs ---------- */
[data-arch] { width: 100%; height: auto; }
.arch-node rect { fill: var(--bg); stroke: var(--ink); stroke-width: 1; }
.sec-alt .arch-node rect { fill: var(--bg-2); }
.arch-node text { fill: var(--ink); font-family: var(--sans); font-size: 13px; font-weight: 500; }
.arch-node .arch-sm { fill: var(--ink-3); font-family: var(--mono); font-size: 10.5px; font-weight: 400; }
.arch-metal rect { fill: var(--ink); }
.arch-metal text { fill: var(--bg); }
.arch-wire { stroke: var(--ink); stroke-width: 1; fill: none; opacity: .55; }
.arch-live { stroke: var(--red); stroke-width: 1.6; opacity: 1; stroke-dasharray: 10 220; }
.arch-sm { fill: var(--ink-3); font-family: var(--mono); font-size: 10.5px; }
.arch-bar-bg { fill: var(--rule-soft); }
.arch-bar { fill: var(--ink); }
.arch-bar-warn { fill: var(--red); opacity: .82; }
.sp-line { display: block; }

/* A portrait-format board photo would otherwise set the height of its whole
   row. Cap it and centre it so the composition stays balanced. */
.work-figure img { max-height: 560px; width: auto; margin-inline: auto; }
@media (max-width: 860px) { .work-figure img { max-height: 420px; } }
