@font-face { font-family: 'Schibsted Grotesk'; src: url('/fonts/schibsted-grotesk.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Martian Mono'; src: url('/fonts/martian-mono.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #F8F7F4;
  --surface: #FFFFFF;
  --ink: #0E1116;
  --ink-2: #4A4F57;
  --ink-3: #6B7078;
  --line: #E2E3DF;
  --line-strong: #CFD1CC;
  --accent: #0A7A55;
  --accent-deep: #075E41;
  --accent-tint: #E2F1EA;
  --sans: 'Schibsted Grotesk', system-ui, sans-serif;
  --mono: 'Martian Mono', ui-monospace, monospace;
  --gutter: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: var(--line-strong) var(--bg); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); caret-color: var(--accent); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--accent-tint); color: var(--accent-deep); }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border: 3px solid var(--bg); border-radius: 6px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ol, ul { margin: 0; padding: 0; list-style: none; }
.shell { width: min(100%, 1280px); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: 6px; }
.skip:focus { top: 12px; }
.icon { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Header: just a name and a few words. */
.top-inner { display: flex; align-items: baseline; gap: 28px; padding-block: 28px; }
.brand { margin-right: auto; font-weight: 600; letter-spacing: -.01em; text-decoration: none; }
nav[aria-label="Main"] { display: flex; gap: 24px; font-size: .95rem; }
nav[aria-label="Main"] a { color: var(--ink-2); text-decoration: none; white-space: nowrap; transition: color .2s; }
nav[aria-label="Main"] a:hover, nav[aria-label="Main"] a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
@media (max-width: 560px) { .top-inner { flex-wrap: wrap; row-gap: 10px; padding-block: 20px; } nav[aria-label="Main"] { width: 100%; } }

/* Links and the few buttons left (detail pages, 404). */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 500; text-decoration: none; transition: border-color .2s; }
.button:hover { border-color: var(--ink); }
.button.primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.button .icon, .hello-links .icon, .note-go .icon { transition: translate .25s var(--ease); }
.button:hover .icon { translate: 3px 0; }

/* Hero: a tagline, a hello, and a Now note. */
.hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 112px); align-items: end; padding-block: clamp(40px, 7vw, 104px) clamp(56px, 7vw, 96px); }
.hero h1 { max-width: 13ch; font-size: clamp(2.6rem, 5.4vw, 4.8rem); line-height: 1; letter-spacing: -.042em; }
.hero h1 em { font-style: normal; color: var(--accent-deep); }
.hello { margin-top: clamp(28px, 3.4vw, 44px); display: grid; gap: 14px; max-width: 33rem; font-size: clamp(1.08rem, 1.35vw, 1.2rem); line-height: 1.6; color: var(--ink-2); }
.hello p:first-child { color: var(--ink); }
.hello-links { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 28px; }
.hello-links a { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; text-decoration-color: var(--line-strong); text-underline-offset: .3em; transition: text-decoration-color .2s; }
.hero .hello-links a:first-child { color: var(--accent-deep); text-decoration-color: currentColor; }
.hello-links a:hover { text-decoration-color: currentColor; }
.hero .hello-links a:first-child:hover .icon { translate: 3px 0; }

.now { padding: 24px 24px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 1px 2px rgb(14 17 22 / .03), 0 30px 50px -36px rgb(14 17 22 / .22); rotate: 1deg; }
.now-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.now-head h2 { font-size: 1.05rem; }
.now-clock { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.now-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
.now-list { margin: 0; display: grid; }
.now-list div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 12px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.now-list dt { font-size: .9rem; color: var(--ink-3); }
.now-list dd { margin: 0; line-height: 1.45; }
.now-foot { padding-top: 14px; font-size: .9rem; color: var(--ink-3); }
@media (max-width: 960px) { .hero { grid-template-columns: 1fr; align-items: start; } .now { rotate: 0deg; max-width: 34rem; } }
@media (max-width: 420px) { .now-list div { grid-template-columns: 1fr; gap: 2px; } }

/* The trace */
.trace { --cols: 6.5rem minmax(0, 1fr) minmax(0, 1.3fr) 4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgb(14 17 22 / .04), 0 24px 48px -32px rgb(14 17 22 / .2); font-size: .94rem; overflow: hidden; }
.trace-head, .trace-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 13px 22px; font: 400 .78rem/1.4 var(--mono); color: var(--ink-3); }
.trace-head { border-bottom: 1px solid var(--line); }
.trace-head b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.trace-foot { border-top: 1px solid var(--line); }
.trace-toggle { background: none; border: 0; padding: 2px 0; font: inherit; color: var(--ink-2); text-decoration: underline; text-underline-offset: .25em; cursor: pointer; }
.trace-toggle:hover { color: var(--ink); }
.trace-axis, .span { display: grid; grid-template-columns: var(--cols); column-gap: 24px; align-items: center; padding-inline: 22px; }
.trace-axis { padding-block: 12px 6px; font: 400 .75rem/1 var(--mono); color: var(--ink-3); }
.ticks { grid-column: 3; display: flex; justify-content: space-between; }
.span { min-height: 60px; border-top: 1px solid var(--line); transition: background .35s; }
.spans li:first-child { border-top: 0; }
.span-stage { font-weight: 600; }
.span-note { color: var(--ink-2); line-height: 1.35; padding-block: 10px; }
.span-track { width: 100%; height: 22px; display: block; background: linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / calc(100% / 3) 100%; border-right: 1px solid var(--line); }
.span-bar { fill: var(--ink); transform-box: fill-box; transform-origin: left; }
.span.agent .span-bar { fill: var(--accent); }
.span-time { font: 400 .78rem/1 var(--mono); font-variant-numeric: tabular-nums; text-align: right; color: var(--ink-2); }
.span.skipped .span-stage, .span.skipped .span-note, .span.skipped .span-time { color: var(--ink-3); }
.span.skipped .span-stage { font-weight: 500; }
.trace.animating .span-bar:not(.grow) { transform: scaleX(0); }
.trace.animating .span-bar.grow { transform: scaleX(1); transition: transform .6s var(--ease); }
.span.live { background: var(--accent-tint); }
.span.live .span-stage { color: var(--accent-deep); }
@container (max-width: 640px) {
  .trace-axis { display: none; }
  .span { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'stage time' 'note note' 'track track'; row-gap: 4px; padding: 14px 16px; }
  .span-stage { grid-area: stage; } .span-time { grid-area: time; } .span-note { grid-area: note; padding: 0; } .span-track { grid-area: track; margin-top: 6px; height: 14px; }
  .trace-head, .trace-foot { padding-inline: 16px; }
}

/* Sections: a small title on the left, the content on the right. */
.section { padding-block: clamp(48px, 6vw, 80px); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr); gap: 20px clamp(32px, 6vw, 96px); border-top: 1px solid var(--line); }
.row > h2 { font-size: 1.05rem; letter-spacing: -.01em; padding-top: .2em; }
.row-body { max-width: 46rem; }
.prose { font-size: 1.1rem; line-height: 1.65; color: var(--ink-2); }
.prose p + p { margin-top: 1em; }
@media (max-width: 760px) { .row { grid-template-columns: 1fr; } }

.areas { display: grid; gap: 22px; }
.areas h3 { font-size: 1.1rem; letter-spacing: -.01em; }
.areas p { margin-top: 4px; color: var(--ink-2); }
.trace-figure { margin: 40px 0 0; container-type: inline-size; }
.trace-figure figcaption { margin-bottom: 14px; font-size: .95rem; color: var(--ink-3); max-width: 60ch; }

.notes-list { border-top: 1px solid var(--line); }
.notes-list li { border-bottom: 1px solid var(--line); }
.notes-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; padding: 20px 0; text-decoration: none; }
.note-title { font-size: 1.2rem; font-weight: 600; letter-spacing: -.02em; transition: color .2s; }
.note-kind { margin-left: 8px; font-size: .85rem; font-weight: 400; letter-spacing: 0; color: var(--ink-3); }
.note-sum { grid-column: 1; color: var(--ink-2); }
.note-go { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--ink-3); }
.notes-list a:hover .note-title { color: var(--accent-deep); }
.notes-list a:hover .note-go { color: var(--accent); }
.notes-list a:hover .note-go .icon { translate: 4px 0; }
.aside-note { margin-top: 16px; font-size: .92rem; color: var(--ink-3); }

/* Work list */
.work-list { margin-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--ink); }
.work-list > li { border-bottom: 1px solid var(--line); }
.work-item { display: grid; grid-template-columns: 10rem minmax(0, 1.25fr) minmax(0, 1fr) 2rem; gap: 12px 32px; align-items: start; padding: 28px 0; text-decoration: none; }
.work-kind { font-size: .86rem; color: var(--ink-3); padding-top: .4em; }
.work-main strong { display: block; font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.15; letter-spacing: -.025em; font-weight: 600; transition: color .2s; }
.work-main span { display: block; margin-top: 8px; color: var(--ink-2); max-width: 46ch; }
.work-go { justify-self: end; padding-top: .5em; color: var(--ink-3); transition: color .2s, translate .3s var(--ease); }
.work-item:hover .work-go { color: var(--accent); translate: 4px 0; }
.work-item:hover .work-main strong { color: var(--accent-deep); }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; padding-top: .3em; font-size: .84rem; color: var(--ink-2); }
.flow li { display: inline-flex; align-items: center; white-space: nowrap; }
.flow li::after { content: ''; width: 14px; height: 1px; margin-inline: 8px; background: var(--ink-3); }
.flow li:last-child::after { display: none; }
.flow li:last-child { color: var(--accent-deep); font-weight: 500; }
@media (max-width: 900px) {
  .work-item { grid-template-columns: minmax(0, 1fr) 2rem; gap: 10px 20px; }
  .work-kind, .work-main, .work-item .flow { grid-column: 1; padding-top: 0; }
  .work-go { grid-column: 2; grid-row: 1 / span 3; }
}

/* About */
.journey { margin-top: 32px; display: grid; border-top: 1px solid var(--line); }
.journey li { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: 4px 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.journey h3 { font-size: 1rem; letter-spacing: -.01em; }
.journey li:last-child h3 { color: var(--accent-deep); }
.journey p { color: var(--ink-2); font-size: .98rem; }
@media (max-width: 640px) { .journey li { grid-template-columns: 1fr; } }

/* Say hello */
.mail-line { margin-top: 22px; }
.mail { font-size: clamp(1.5rem, 3.2vw, 2.4rem); letter-spacing: -.03em; font-weight: 600; color: var(--accent-deep); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .18em; overflow-wrap: anywhere; transition: color .2s; }
.mail:hover { color: var(--ink); }
.hello-again .hello-links { margin-top: 18px; }
.contact-links { display: grid; gap: 14px; justify-items: start; }
.contact-links a { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }

/* Detail pages */
.detail { padding-block: 40px clamp(72px, 9vw, 120px); }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.back:hover { color: var(--ink); }
.detail-head { padding-block: clamp(40px, 6vw, 72px) clamp(36px, 5vw, 56px); border-bottom: 1px solid var(--ink); }
.detail-head .work-kind { padding: 0; }
.detail-head h1 { margin-top: 12px; font-size: clamp(2.6rem, 6vw, 4.8rem); line-height: 1; letter-spacing: -.04em; }
.lede { margin-top: 20px; max-width: 40ch; font-size: clamp(1.1rem, 1.5vw, 1.3rem); color: var(--ink-2); }
.detail-flow { margin-top: 28px; }
.detail-flow .flow { font-size: .95rem; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); gap: clamp(32px, 6vw, 96px); margin-top: clamp(40px, 5vw, 64px); }
.detail-prose { display: grid; gap: 36px; max-width: 66ch; }
.detail-prose h2 { font-size: 1.3rem; letter-spacing: -.02em; margin-bottom: 8px; }
.detail-prose p { color: var(--ink-2); font-size: 1.06rem; }
.detail-side { align-self: start; position: sticky; top: 92px; display: grid; gap: 16px; justify-items: start; }
.detail-side h2 { font-size: 1.08rem; }
.detail-side ul { width: 100%; }
.detail-side li { padding: 9px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.more { margin-top: clamp(64px, 8vw, 112px); }
.more h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); letter-spacing: -.03em; }
.more .work-list { margin-top: 24px; }
.more .work-item { grid-template-columns: 10rem minmax(0, 1fr) 2rem; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } .detail-side { position: static; } .more .work-item { grid-template-columns: minmax(0, 1fr) 2rem; } }

/* Writing, contact, 404 */
.page { padding-block: clamp(64px, 9vw, 128px); display: grid; gap: 20px; justify-items: start; }
.page h1 { max-width: 16ch; font-size: clamp(2.8rem, 6.4vw, 5rem); line-height: 1; letter-spacing: -.04em; }
.page .lede { margin-top: 0; }
.page .contact-links, .page .actions { margin-top: 20px; }
.empty { width: 100%; margin-top: 28px; padding: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.empty p { max-width: 52ch; color: var(--ink-2); }

/* Footer */
.foot { margin-top: clamp(40px, 6vw, 80px); border-top: 1px solid var(--line); }
.foot-inner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 32px; padding-block: 32px 40px; font-size: .92rem; color: var(--ink-2); }
.foot-sign { margin-right: auto; color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
.foot-links { display: flex; gap: 20px; }
.foot-links a { color: var(--ink); }

/* Rows settle in as they arrive. Only for elements that start below the fold. */
.notes-list li.pre, .journey li.pre, .areas li.pre { opacity: 0; translate: 0 10px; }
.notes-list li.in, .journey li.in, .areas li.in { opacity: 1; translate: 0 0; transition: opacity .8s var(--ease), translate .8s var(--ease); }
