@font-face {
  font-family: "Hanken Grotesk";
  src: url("/assets/fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f3f3ef;
  --paper-2: #e9eae4;
  --ink: #101418;
  --muted: #565d63;
  --line: #d6d8d0;
  --blue: #2740e8;
  --blue-press: #1b2fc0;
  --on-blue: #ffffff;
  --work-bg: #101418;
  --work-ink: #eef0ec;
  --work-muted: #a4abb0;
  --work-line: #2a3036;
  --sun: #f2b632;
  --mint: #bfe3cf;
  --display: "Bricolage Grotesque", "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --text: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1240px;
  color-scheme: light dark;
}
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --work-line: #2c333a;
    --paper: #0e1114;
    --paper-2: #161a1e;
    --ink: #eceeea;
    --muted: #9aa1a6;
    --line: #272d33;
    --blue: #7c8dff;
    --blue-press: #98a5ff;
    --on-blue: #0b0e22;
    --work-bg: #161b21;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--text);
  font-feature-settings: "ss01", "tnum" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scrollbar-color: var(--muted) var(--paper);
}
::selection { background: var(--blue); color: var(--on-blue); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 3px; }
p { margin: 0 0 1em; max-width: 62ch; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; text-wrap: balance; }

.skip {
  position: absolute; left: var(--gutter); top: -60px; z-index: 20;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 6px;
}
.skip:focus { top: 12px; }

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

/* ------------------------------------------------------------------ header */
.site-head {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--display); font-weight: 650; font-size: 19px; letter-spacing: -0.01em; }
.brand svg { width: 28px; height: 28px; }
.brand svg rect { fill: var(--blue); }
.brand svg path { fill: var(--on-blue); }
.nav { display: flex; gap: clamp(14px, 2.4vw, 32px); font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); padding: 8px 0; transition: color .15s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a.cta { color: var(--ink); font-weight: 560; }

/* -------------------------------------------------------------------- hero */
.hero { padding: clamp(56px, 9vw, 120px) 0 0; }
.hero h1 {
  font-size: clamp(2.9rem, 8.4vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 640;
  max-width: 15ch;
}
.hero-meta {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px);
  margin-top: clamp(40px, 6vw, 72px); padding-top: 28px; border-top: 1px solid var(--line);
  align-items: start;
}
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.5; color: var(--ink); max-width: 36ch; margin: 0; }
.hero-act { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.hero-act p { color: var(--muted); font-size: 15px; margin: 0; max-width: 34ch; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--blue); color: var(--on-blue);
  font: 560 16px/1 var(--text); text-decoration: none;
  padding: 16px 22px; border-radius: 999px;
  transition: background .15s, transform .15s;
}
.btn:hover { background: var(--blue-press); transform: translateY(-1px); text-decoration: none; }
.btn svg { width: 16px; height: 16px; transition: transform .2s cubic-bezier(.2,.7,.2,1); }
.btn:hover svg { transform: translateX(3px); }

/* ------------------------------------------------------------------- work */
.work { border-top: 1px solid var(--work-line); background: var(--work-bg); color: var(--work-ink); margin-top: clamp(64px, 9vw, 120px); padding: clamp(64px, 9vw, 112px) 0 clamp(72px, 10vw, 128px); }
.work :focus-visible { outline-color: var(--sun); }
.work h2, .section-title { font-size: clamp(2rem, 4.6vw, 3.4rem); letter-spacing: -0.03em; line-height: 1.02; }
.work-intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: end; margin-bottom: clamp(40px, 6vw, 72px); }
.work-intro p { color: var(--work-muted); margin: 0; max-width: 40ch; }
.proj { display: grid; gap: 20px; }
.proj .art { border-radius: 14px; overflow: hidden; transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.proj:hover .art { transform: translateY(-4px); }
.proj .art svg { width: 100%; height: auto; }
.proj h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -0.02em; font-weight: 620; }
.proj .what { color: var(--work-muted); margin: 6px 0 0; font-size: 16px; max-width: 46ch; }
.proj .stack { color: var(--work-muted); font-size: 14px; margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--work-line); max-width: 46ch; }
.proj-lead { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: end; margin-bottom: clamp(56px, 8vw, 104px); }
.proj-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.proj-pair .proj:nth-child(2) { margin-top: clamp(40px, 6vw, 88px); }
.fine { margin: clamp(40px, 6vw, 72px) 0 0; color: var(--work-muted); font-size: 14px; max-width: 70ch; }

/* ---------------------------------------------------------------- sections */
.block { padding: clamp(72px, 10vw, 128px) 0 0; }
.block-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(24px, 5vw, 80px); }
.block-head h2 { position: sticky; top: 100px; align-self: start; font-size: clamp(1.9rem, 3.6vw, 2.8rem); letter-spacing: -0.028em; line-height: 1.05; }
.defs { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.defs li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.defs h3 { font-size: 1.35rem; letter-spacing: -0.015em; font-weight: 600; }
.defs p { margin: 0; color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; border-top: 1px solid var(--line); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px 20px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(step); font: 600 15px/1 var(--display); color: var(--blue); width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; grid-row: span 2; }
.steps h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.012em; }
.steps p { margin: 0; color: var(--muted); }

.about p { font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.5; max-width: 44ch; }
.about p + p { font-size: 17px; color: var(--muted); max-width: 58ch; }
.principles { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.principles li { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 14ch) minmax(0, 1fr); gap: 16px; }
.principles strong { font-family: var(--display); font-weight: 600; }
.principles span { color: var(--muted); }

.contact { margin-top: clamp(72px, 10vw, 128px); background: var(--paper-2); padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--line); }
.contact h2 { font-size: clamp(2rem, 5vw, 3.8rem); letter-spacing: -0.032em; line-height: 1; max-width: 16ch; }
.contact .mail { display: inline-block; margin-top: 28px; font: 600 clamp(1.3rem, 3.4vw, 2.4rem)/1.15 var(--display); letter-spacing: -0.02em; color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: 0.18em; overflow-wrap: anywhere; }
.contact .mail:hover { text-decoration-thickness: 4px; }
.contact-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 5vw, 72px); margin-top: 40px; max-width: 880px; }
.contact-notes h3 { font-size: 1rem; font-family: var(--text); font-weight: 600; margin-bottom: 8px; }
.contact-notes p { margin: 0; color: var(--muted); font-size: 16px; }

/* ----------------------------------------------------------------- footer */
.site-foot { padding: 28px 0 56px; color: var(--muted); font-size: 14px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; }
.site-foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--ink); text-decoration: underline; }

/* ------------------------------------------------------------ text pages */
.doc { padding-top: clamp(48px, 8vw, 104px); }
.doc h1 { font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -0.032em; line-height: 1; }
.doc .updated { color: var(--muted); font-size: 15px; margin: 16px 0 0; }
.doc-body { margin-top: 48px; border-top: 1px solid var(--line); }
.doc-body h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.012em; }
.doc-body .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(16px, 5vw, 80px); padding: 28px 0; border-bottom: 1px solid var(--line); }
.doc-body .row p:last-child { margin-bottom: 0; }
.missing { padding-top: clamp(80px, 14vw, 180px); }
.missing h1 { font-size: clamp(4rem, 16vw, 11rem); letter-spacing: -0.05em; line-height: 0.9; color: var(--blue); }
.missing p { margin-top: 24px; font-size: 1.2rem; }

/* ----------------------------------------------------------------- motion */
@media (prefers-reduced-motion: no-preference) {
  .hero h1 { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
  .hero-meta { animation: rise .9s .12s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .hero-meta, .work-intro, .proj-lead, .proj-pair, .block-head, .defs li, .contact-notes, .doc-body .row, .principles li { grid-template-columns: minmax(0, 1fr); }
  .proj-pair .proj:nth-child(2) { margin-top: 0; }
  .block-head h2 { position: static; margin-bottom: 8px; }
  .nav a:not(.cta):not([data-keep]) { display: none; }
  .principles li { gap: 4px; }
}
@media (max-width: 860px) {
  .proj-lead .art { aspect-ratio: 4 / 3; }
  .proj-lead .art svg { width: 170%; max-width: none; margin-left: -6%; }
}
@media (max-width: 520px) {
  body { font-size: 16.5px; }
  .site-head .wrap { min-height: 60px; }
}
