/* Editorial / Nordic: warm paper, near-black ink, one burgundy accent, lots of air. */
:root {
  --bg-1: #faf8f4;
  --bg-2: #e8e3da;
  --surface: #f4f1eb;
  --ink: #171513;
  --ink-soft: #5f5a53;
  --ink-faint: #979087;
  --line: rgba(23, 21, 19, 0.12);
  --accent: #862a3d;
  --glass: rgba(250, 248, 244, 0.62);
  --glass-edge: rgba(255, 255, 255, 0.9);
  --card-shadow: 0 10px 30px rgba(60, 45, 30, 0.12);
  --viz-bg: #ebe6dd;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --sans: "Geist", "Helvetica Neue", Arial, sans-serif;
  --display: "Bricolage Grotesque", var(--sans);
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-1: #1f1d1a; --bg-2: #0d0c0b; --surface: #11100f;
    --ink: #efebe4; --ink-soft: #a7a097; --ink-faint: #6f6961; --line: rgba(239, 235, 228, 0.11);
    --accent: #dc8193;
    --glass: rgba(30, 28, 25, 0.58); --glass-edge: rgba(239, 235, 228, 0.14);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); --viz-bg: #191715;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg-1: #1f1d1a; --bg-2: #0d0c0b; --surface: #11100f;
  --ink: #efebe4; --ink-soft: #a7a097; --ink-faint: #6f6961; --line: rgba(239, 235, 228, 0.11);
  --accent: #dc8193;
  --glass: rgba(30, 28, 25, 0.58); --glass-edge: rgba(239, 235, 228, 0.14);
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); --viz-bg: #191715;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
html.lenis { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--ink); color: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 12px; }

.wrap { max-width: 1240px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 48px); }

/* ---------- top bar ---------- */
.bar {
  position: fixed; z-index: 20; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 8px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) clamp(16px, 3vw, 32px) 14px;
  transition: background .35s ease, border-color .35s ease;
  border-bottom: 1px solid transparent;
}
.bar.solid {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  border-bottom-color: var(--line);
}
.wordmark { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; margin-right: auto; }
.lockup {
  display: block; height: 24px; aspect-ratio: 3969 / 749; background: var(--ink);
  -webkit-mask: url(assets/logo-lockup.svg) no-repeat center / contain; mask: url(assets/logo-lockup.svg) no-repeat center / contain;
}
.wm-mono { font-family: var(--mono); font-size: .64rem; letter-spacing: .32em; color: var(--ink-soft); }
.bar-nav { display: flex; gap: 2px; margin-right: 12px; opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility 0s .35s; }
.bar.solid .bar-nav { opacity: 1; visibility: visible; transition: opacity .35s ease; }
.bar-nav a { text-decoration: none; font-size: .9rem; color: var(--ink-soft); padding: 6px 12px; border-radius: 999px; transition: color .2s ease; }
.bar-nav a:hover, .bar-nav a.on { color: var(--ink); }
.bar-nav a.on { background: var(--line); }
.lang, .theme {
  height: 36px; min-width: 36px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--glass); color: var(--ink); cursor: pointer; display: grid; place-items: center;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.lang { padding-inline: 11px; font: 500 .74rem var(--mono); letter-spacing: .08em; text-decoration: none; transition: border-color .2s ease; }
.lang:hover, .theme:hover { border-color: var(--ink-faint); }
.theme svg { width: 17px; height: 17px; fill: currentColor; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: none; }
  :root:not([data-theme="light"]) .theme .moon { display: block; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden;
  background: radial-gradient(110% 85% at 50% 42%, var(--bg-1) 0%, var(--bg-2) 100%);
  background-color: var(--bg-2);
}
.stage { position: absolute; inset: 0; z-index: 1; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 100; pointer-events: none; display: block; opacity: 0; }
/* No z-index here on purpose: cards compete with the canvas in the stage's stacking context. */
.cards { position: absolute; inset: 0; pointer-events: none; }

.card {
  position: absolute; left: 0; top: 0;
  width: 180px; padding: 13px 16px 15px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--card-shadow);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  color: var(--ink); text-decoration: none;
  pointer-events: auto; opacity: 0;
  will-change: transform, opacity;
  transition: box-shadow .25s ease, border-color .25s ease;
}
.card i { display: block; font-style: normal; font-family: var(--mono); font-size: .64rem; letter-spacing: .2em; color: var(--accent); margin-bottom: 4px; }
.card strong { display: block; font-family: var(--display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em; }
.card span { display: block; margin-top: 2px; font-size: .8rem; line-height: 1.3; color: var(--ink-soft); }
.card:hover, .card:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--card-shadow); outline: none; }
/* No WebGL / no JS: cards sit in a tidy grid instead of orbiting. */
.cards.static, .no-js .cards { display: grid; grid-template-columns: repeat(2, 180px); gap: 14px; place-content: center; padding-bottom: 28vh; z-index: 3; }
.cards.static .card, .no-js .card { position: relative; opacity: 1; }
.no-js .reveal, .no-js .intro { opacity: 1; transform: none; }

.intro {
  position: absolute; z-index: 3; left: clamp(16px, 4vw, 48px); bottom: clamp(28px, 6vh, 64px);
  max-width: 36rem; opacity: 0; transform: translateY(10px);
  transition: opacity 1s ease, transform 1s ease;
  pointer-events: none;
}
.intro.on { opacity: 1; transform: none; }
.intro h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(3rem, 7vw, 6rem); line-height: .92; letter-spacing: -0.045em; }
.intro .tag { margin: 1rem 0 0; font-size: 1.05rem; line-height: 1.5; color: var(--ink-soft); max-width: 29rem; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 1.1rem; font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; color: var(--ink-soft); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: ping 2.4s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); } 80%, 100% { box-shadow: 0 0 0 8px transparent; } }

.scroll-cue { position: absolute; z-index: 3; right: clamp(16px, 4vw, 48px); bottom: clamp(28px, 6vh, 64px); width: 24px; height: 40px; border-radius: 14px; border: 1.5px solid var(--ink-faint); display: grid; justify-items: center; padding-top: 7px; }
.scroll-cue span { width: 3px; height: 8px; border-radius: 2px; background: var(--ink-soft); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- sections ---------- */
.section { padding-block: clamp(96px, 13vw, 176px); }
.section + .section { border-top: 1px solid var(--line); }
.kicker { display: flex; gap: 12px; margin: 0 0 28px; font-family: var(--mono); font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); }
.kicker span:first-child { color: var(--accent); }
/* Editorial two-column: the kicker hangs in a narrow left column, content takes the rest. */
.cols { display: grid; grid-template-columns: minmax(150px, 1fr) 4fr; gap: 0 clamp(24px, 4vw, 64px); }
.cols > .kicker { padding-top: .9rem; }
.sec-head { display: grid; grid-template-columns: minmax(150px, 1fr) 4fr; gap: 0 clamp(24px, 4vw, 64px); align-items: baseline; margin-bottom: clamp(48px, 7vw, 88px); }
.title { margin: 0; font-family: var(--display); font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 600; max-width: 18ch; }
.title.big { font-size: clamp(2.8rem, 7.5vw, 6.2rem); line-height: .95; max-width: 14ch; }
.lede { max-width: 38rem; font-size: 1.12rem; color: var(--ink-soft); margin: 32px 0 0; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .dot, .scroll-cue span { animation: none; }
  .intro, .item, .item .viz canvas { transition: none; }
}

/* ---------- work: one large row per product ---------- */
.work-list { display: grid; gap: clamp(20px, 3vw, 32px); }
.item {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: stretch;
  border-radius: var(--radius); overflow: hidden; text-decoration: none;
  background: color-mix(in srgb, var(--bg-1) 55%, var(--surface)); border: 1px solid var(--line);
  transition: border-color .35s ease, transform .5s cubic-bezier(.2,.7,.2,1), opacity .9s cubic-bezier(.2,.7,.2,1);
}
.item:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.item-text { display: flex; flex-direction: column; padding: clamp(24px, 3.4vw, 44px); min-height: clamp(300px, 34vw, 440px); }
.item-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; color: var(--ink-faint); }
.item-meta .n { color: var(--accent); margin-right: 6px; }
.status { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #c99a3e; }
.status.live::before { background: #4f9a68; }
.item h3 { margin: auto 0 0; padding-top: 40px; font-family: var(--display); font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1; letter-spacing: -0.04em; font-weight: 600; }
.item-line { margin: 14px 0 0; color: var(--ink-soft); max-width: 30rem; }
.item-go { margin-top: 28px; font-size: .92rem; font-weight: 500; color: var(--ink); display: inline-flex; gap: 8px; }
.item-go span { transition: transform .25s ease; color: var(--accent); }
.item:hover .item-go span { transform: translateX(4px); }
.viz { position: relative; background: var(--viz-bg); border-left: 1px solid var(--line); overflow: hidden; }
.viz canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.item:hover .viz canvas { transform: scale(1.02); }

/* ---------- approach ---------- */
.define { margin: 0 0 40px; font-family: var(--mono); font-size: .86rem; color: var(--ink-soft); line-height: 1.7; }
.define b { color: var(--ink); font-weight: 500; }
.define i { color: var(--accent); font-style: normal; }
.define .meaning { font-family: var(--sans); font-size: 1rem; }
.statement { margin: 0; font-family: var(--display); font-size: clamp(2.2rem, 4.6vw, 3.8rem); line-height: 1.05; letter-spacing: -0.04em; font-weight: 600; max-width: 22ch; }
.statement em { font-style: normal; color: var(--accent); }
.principles { list-style: none; margin: clamp(64px, 8vw, 104px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 44px); counter-reset: p; }
.principles li { border-top: 1px solid var(--ink); padding-top: 20px; counter-increment: p; }
.principles li::before { content: "0" counter(p); display: block; font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; color: var(--accent); margin-bottom: 14px; }
.principles h3 { margin: 0 0 8px; font-family: var(--display); font-size: 1.3rem; letter-spacing: -0.02em; font-weight: 600; }
.principles p { margin: 0; color: var(--ink-soft); font-size: .96rem; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.about-grid .lede { margin-top: 32px; }
.timeline { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 2px 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.timeline .when { grid-row: span 2; font-family: var(--mono); font-size: .74rem; color: var(--ink-faint); padding-top: 3px; }
.timeline .what { font-weight: 500; }
.timeline .where { font-size: .9rem; color: var(--ink-soft); }
.tools { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 56px 0 0; font-size: .95rem; color: var(--ink-soft); }
.tools span:first-child { font-family: var(--mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); padding-top: 3px; }

/* ---------- contact ---------- */
.contact .lede { margin-top: 24px; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 40px 0 0; }
.mail-btn { display: inline-flex; align-items: center; gap: 10px; padding: 15px 24px; border-radius: 999px; background: var(--ink); color: var(--surface); text-decoration: none; font-weight: 500; font-size: 1.02rem; transition: background .2s ease; }
.mail-btn:hover { background: var(--accent); }
.mail-btn span:last-child { transition: transform .2s ease; }
.mail-btn:hover span:last-child { transform: translateX(3px); }
.copy-btn { font: 500 .88rem var(--mono); color: var(--ink-soft); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 14px 18px; cursor: pointer; transition: color .2s ease, border-color .2s ease; }
.copy-btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.copy-btn[data-state="copied"] { color: var(--accent); border-color: var(--accent); }
.link-row { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 56px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line); }
.link-row a { text-decoration: none; color: var(--ink-soft); transition: color .2s ease; }
.link-row a:hover { color: var(--ink); }
.link-row span { color: var(--accent); }

.foot { border-top: 1px solid var(--line); padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); color: var(--ink-faint); font-size: .84rem; }
.foot-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .cols, .sec-head { grid-template-columns: 1fr; }
  .cols > .kicker { padding-top: 0; }
  .sec-head { margin-bottom: 40px; }
  .item { grid-template-columns: 1fr; }
  .item .viz { order: -1; aspect-ratio: 16 / 9; border-left: 0; border-bottom: 1px solid var(--line); }
  .item-text { min-height: 0; }
  .item h3 { padding-top: 28px; }
  .principles { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  /* Phones: no orbiting cards around the desk; the hero is just Martin and his name. */
  .cards { display: none !important; }
  .bar-nav { display: none; }
  .intro { right: 16px; }
  .intro .tag { font-size: .95rem; }
  .scroll-cue { display: none; }
  .item .viz { aspect-ratio: 4 / 3; }
  .timeline li { grid-template-columns: 1fr; }
  .timeline .when { grid-row: auto; padding: 0 0 2px; }
}
