/* mauriya.me — Ryan Mahato, Product Manager
   Palette: cool paper, deep ink navy, teal accent, one amber "signal".
   Type: Schibsted Grotesk (headings, interface) + Source Serif 4 (reading). */

@font-face { font-family: "Schibsted Grotesk"; src: url("../fonts/SchibstedGrotesk.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../fonts/SourceSerif4.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../fonts/SourceSerif4-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --paper: #f3f6f5;
  --paper-2: #e7eeeb;
  --surface: #ffffff;
  --ink: #14233a;
  --ink-2: #34445a;
  --muted: #5b697c;
  --line: #d2dbe1;
  --accent: #12705e;
  --accent-ink: #0b5546;
  --accent-soft: #d6ebe5;
  --signal: #d4951c;
  --danger: #b3261e;
  --ok: #12705e;

  --sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --wrap: 1140px;
  --narrow: 760px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 22px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1828;
    --paper-2: #142036;
    --surface: #162337;
    --ink: #e8edf3;
    --ink-2: #c4cedb;
    --muted: #97a5b8;
    --line: #2a3a52;
    --accent: #4cc0a3;
    --accent-ink: #84dbc5;
    --accent-soft: #143b37;
    --signal: #f0b94a;
    --danger: #ff8a80;
    --ok: #4cc0a3;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--sans); color: var(--ink); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); font-weight: 750; letter-spacing: -.03em; line-height: 1.04; }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.15rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 650; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow > * { max-width: var(--narrow); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius-s); font-family: var(--sans); }
.skip:focus { top: 12px; }

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--sans); font-weight: 600; font-size: 1rem; line-height: 1;
  padding: .95em 1.4em; border-radius: 999px; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary:hover { color: #08221c; } }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 1.2em 0 0; }
.chips li { font-family: var(--sans); font-size: .85rem; padding: .35em .8em; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); }

.open-to { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.open-to li { font-family: var(--sans); font-size: .85rem; font-weight: 600; padding: .3em .75em; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--paper); font-family: var(--sans); font-weight: 800; font-size: .9rem; letter-spacing: .02em; position: relative; }
.brand-mark::after { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--signal); top: 1px; right: 1px; box-shadow: 0 0 0 2px var(--paper); }
.brand-text { display: flex; flex-direction: column; font-family: var(--sans); line-height: 1.15; }
.brand-text strong { font-size: 1.02rem; font-weight: 700; }
.brand-text span { font-size: .8rem; color: var(--muted); }

.site-nav ul { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.site-nav a { display: block; font-family: var(--sans); font-weight: 500; font-size: .98rem; color: var(--ink-2); text-decoration: none; padding: .55em .85em; border-radius: 999px; transition: background .15s, color .15s; }
.site-nav a:hover { background: var(--paper-2); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--paper-2); }
.site-nav .nav-cta { background: var(--ink); color: var(--paper); margin-left: 8px; font-weight: 600; }
.site-nav .nav-cta:hover, .site-nav .nav-cta[aria-current="page"] { background: var(--accent); color: #fff; }

.nav-toggle { display: none; align-items: center; gap: 10px; background: none; border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px; font-family: var(--sans); font-weight: 600; color: var(--ink); cursor: pointer; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .25s var(--ease), background .2s; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { position: absolute; top: 72px; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 20px; display: none; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav a { padding: .8em 1em; font-size: 1.05rem; }
  .site-nav .nav-cta { margin: 8px 0 0; text-align: center; }
  .brand-text span { display: none; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section + .section { padding-top: 0; }
.section-head { max-width: 640px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head p { color: var(--muted); font-size: 1.1rem; }
.section-more { margin-top: 28px; font-family: var(--sans); font-weight: 600; }

.page-hero { padding: clamp(48px, 8vw, 96px) 0 clamp(32px, 5vw, 56px); }
.page-hero h1 { max-width: 16ch; }
.lede { font-size: clamp(1.12rem, 1.6vw, 1.3rem); color: var(--ink-2); max-width: 60ch; line-height: 1.55; }
.crumbs { font-family: var(--sans); font-size: .95rem; margin-bottom: 1.2em; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a::before { content: "← "; }
.crumbs a:hover { color: var(--ink); }

.callout-band { background: var(--ink); color: var(--paper); padding: clamp(56px, 8vw, 96px) 0 !important; }
.callout-band h2 { color: var(--paper); }
.callout-band p { color: color-mix(in srgb, var(--paper) 82%, transparent); font-size: 1.15rem; }
.callout-band .btn-primary { background: var(--paper); color: var(--ink); }
.callout-band .btn-primary:hover { background: var(--signal); color: #1a1405; }
@media (prefers-color-scheme: dark) {
  .callout-band { background: var(--paper-2); border-block: 1px solid var(--line); }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 104px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-hello { font-family: var(--sans); font-weight: 600; color: var(--accent-ink); font-size: 1.1rem; margin-bottom: .8em; }
.hero-title { font-size: clamp(2.4rem, 5.6vw, 4.35rem); max-width: 14ch; margin-bottom: .45em; }
.hero-intro { font-size: clamp(1.1rem, 1.5vw, 1.25rem); color: var(--ink-2); max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 32px; }
.hero-cv { align-self: center; font-family: var(--sans); font-weight: 600; font-size: .98rem; margin-left: 6px; }
.hero-open { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-family: var(--sans); font-size: .92rem; color: var(--muted); }
.hero-loop { margin: 0; }
.hero-loop figcaption { font-family: var(--sans); font-size: .92rem; color: var(--muted); text-align: center; margin-top: 12px; }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-loop { max-width: 360px; margin: 8px auto 0; }
}

/* ---------- The product loop (signature element) ---------- */
.loop-svg { width: 100%; height: auto; overflow: visible; }
.loop-track { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 2 7; stroke-linecap: round; }
.loop-path { fill: none; stroke: none; }
.loop-orbit { fill: none; stroke: var(--line); stroke-width: 1; opacity: .55; }
.loop-dot { fill: var(--signal); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--signal) 60%, transparent)); }
.loop-node circle { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; transition: fill .35s var(--ease), stroke .35s var(--ease), r .35s var(--ease); }
.loop-node text { font-family: var(--sans); font-size: 12.5px; font-weight: 650; fill: var(--ink-2); transition: fill .35s var(--ease); pointer-events: none; }
.loop-node.is-active circle { fill: var(--ink); stroke: var(--ink); }
.loop-node.is-active text { fill: var(--paper); }
.loop-c1 { font-family: var(--serif); font-style: italic; font-size: 17px; fill: var(--muted); }
.loop-c2 { font-family: var(--sans); font-size: 26px; font-weight: 800; fill: var(--ink); letter-spacing: -.02em; }
[data-cycle] .loop-node { cursor: pointer; }
[data-cycle] .loop-node:hover circle { stroke: var(--accent); stroke-width: 2.5; }
[data-cycle] .loop-node.is-active:hover circle { stroke: var(--ink); }

/* ---------- Home: career thread ---------- */
.thread-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.thread-list li { border-bottom: 1px solid var(--line); }
.thread-row {
  display: grid; grid-template-columns: 110px 190px 1fr 1fr 28px; gap: 24px; align-items: baseline;
  padding: 26px 8px; text-decoration: none; color: var(--ink); position: relative; transition: background .2s var(--ease);
}
.thread-row:hover { background: var(--surface); }
.thread-when { font-family: var(--sans); font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.thread-name { font-family: var(--sans); font-weight: 700; font-size: 1.15rem; }
.thread-learned { color: var(--ink); }
.thread-did { color: var(--muted); }
.thread-go, .case-go { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); position: relative; align-self: center; transition: background .2s, border-color .2s; }
.thread-go::after, .case-go::after { content: ""; position: absolute; inset: 0; margin: auto; width: 8px; height: 8px; border-top: 2px solid var(--ink); border-right: 2px solid var(--ink); transform: translateX(-1px) rotate(45deg); }
.thread-row:hover .thread-go, .case-row a:hover .case-go { background: var(--ink); border-color: var(--ink); }
.thread-row:hover .thread-go::after, .case-row a:hover .case-go::after { border-color: var(--paper); }
@media (max-width: 900px) {
  .thread-row { grid-template-columns: 1fr 28px; gap: 6px 16px; }
  .thread-when { grid-column: 1; order: 1; }
  .thread-name { grid-column: 1; order: 2; }
  .thread-learned { grid-column: 1; order: 3; }
  .thread-did { grid-column: 1; order: 4; }
  .thread-go { grid-column: 2; grid-row: 1 / span 4; }
}

/* ---------- Home: what I bring ---------- */
.bring-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 48px); }
.bring-item { border-top: 3px solid var(--ink); padding-top: 22px; }
.bring-item:nth-child(2) { border-top-color: var(--accent); }
.bring-item:nth-child(3) { border-top-color: var(--signal); }
.bring-item p { color: var(--ink-2); }


/* ---------- FAQ ---------- */
.faq-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:first-child { border-top: 1px solid var(--line); }
.faq-list summary { list-style: none; cursor: pointer; font-family: var(--sans); font-weight: 650; font-size: 1.1rem; padding: 20px 44px 20px 0; position: relative; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px; margin-top: -8px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); transition: transform .25s var(--ease); }
.faq-list details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq-list details p { color: var(--ink-2); padding-right: 32px; }
@media (max-width: 820px) { .faq-grid { grid-template-columns: 1fr; } }

/* ---------- Approach: interactive cycle ---------- */
.cycle-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.cycle-visual { position: sticky; top: 100px; }
.cycle-hint { font-family: var(--sans); font-size: .88rem; color: var(--muted); text-align: center; margin-top: 10px; }
.cycle-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 26px; }
.cycle-tabs button {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-weight: 600; font-size: .95rem;
  padding: .55em .95em .55em .55em; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.cycle-tabs button:hover { border-color: var(--ink); color: var(--ink); }
.tab-n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--paper-2); font-size: .78rem; font-variant-numeric: tabular-nums; }
.cycle-tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.cycle-tabs button[aria-selected="true"] .tab-n { background: var(--signal); color: #1a1405; }
.cycle-panel { min-height: 300px; }
.js .cycle-panel[hidden] { display: none; }
.cycle-panel.entering { animation: panel-in .35s var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.panel-step { font-family: var(--sans); font-size: .9rem; color: var(--muted); margin-bottom: .4em; }
.cycle-panel h3 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); font-weight: 700; letter-spacing: -.02em; }
.cycle-panel > p { font-size: 1.12rem; color: var(--ink-2); }
.panel-case { font-family: var(--sans); font-size: .95rem; margin-top: 1.4em !important; color: var(--muted); }
/* Without JavaScript every panel shows, stacked */
html:not(.js) .cycle-tabs { display: none; }
html:not(.js) .cycle-panel { min-height: 0; margin-bottom: 40px; }
@media (max-width: 880px) {
  .cycle-grid { grid-template-columns: 1fr; }
  .cycle-visual { position: static; max-width: 340px; margin: 0 auto; }
  .cycle-panel { min-height: 0; }
}

.belief-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 clamp(28px, 5vw, 64px); margin: 0; }
.belief-list > div { padding: 22px 0; border-top: 1px solid var(--line); }
.belief-list dt { font-family: var(--sans); font-weight: 700; font-size: 1.15rem; margin-bottom: 4px; }
.belief-list dd { margin: 0; color: var(--ink-2); }
@media (max-width: 720px) { .belief-list { grid-template-columns: 1fr; } }

/* ---------- Work list ---------- */
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 28px; }
.filter-label { font-family: var(--sans); color: var(--muted); font-size: .95rem; margin-right: 6px; }
.filter-btn { font-family: var(--sans); font-weight: 600; font-size: .92rem; padding: .5em 1em; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--ink-2); cursor: pointer; transition: all .2s; }
.filter-btn:hover { border-color: var(--ink); color: var(--ink); }
.filter-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.case-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.case-row { border-bottom: 1px solid var(--line); transition: opacity .3s var(--ease); }
.case-row.is-hidden { display: none; }
.case-row a { display: grid; grid-template-columns: 220px 1fr 28px; gap: 28px; padding: 32px 8px; text-decoration: none; color: var(--ink); transition: background .2s; }
.case-row a:hover { background: var(--surface); }
.case-meta { display: flex; flex-direction: column; gap: 4px; font-family: var(--sans); }
.case-client { font-weight: 700; font-size: 1.05rem; }
.case-period { color: var(--muted); font-size: .9rem; }
.case-title { display: block; font-family: var(--sans); font-weight: 700; font-size: clamp(1.25rem, 2vw, 1.55rem); line-height: 1.2; letter-spacing: -.015em; margin-bottom: 8px; }
.case-summary { display: block; color: var(--ink-2); margin-bottom: 14px; max-width: 64ch; }
.case-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-family: var(--sans); font-size: .78rem; font-weight: 600; padding: .25em .7em; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.tag::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--muted); vertical-align: .05em; }
.tag-product::before { background: var(--ink); }
.tag-growth::before { background: var(--accent); }
.tag-analytics::before { background: #4a6fa5; }
.tag-ai::before { background: var(--signal); }
.tag-technical::before { background: #8a6bb0; }
@media (max-width: 760px) {
  .case-row a { grid-template-columns: 1fr 28px; gap: 10px 16px; }
  .case-meta { grid-column: 1; flex-direction: row; gap: 12px; align-items: baseline; }
  .case-main { grid-column: 1; }
  .case-go { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---------- Case study ---------- */
.case-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 36px 0 0; border-top: 1px solid var(--line); }
.case-facts > div { padding: 16px 16px 0 0; }
.case-facts dt { font-family: var(--sans); font-size: .85rem; color: var(--muted); }
.case-facts dd { margin: 2px 0 0; font-family: var(--sans); font-weight: 600; }
@media (max-width: 760px) { .case-facts { grid-template-columns: 1fr 1fr; gap: 0 12px; } }

.case-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); padding-bottom: clamp(56px, 8vw, 104px); }
.case-toc { position: sticky; top: 100px; align-self: start; font-family: var(--sans); }
.case-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.case-toc a { display: block; padding: 8px 0 8px 16px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: .95rem; transition: color .2s, border-color .2s; }
.case-toc a:hover { color: var(--ink); }
.case-toc a.is-current { color: var(--ink); border-left-color: var(--signal); font-weight: 600; }
.toc-extra { margin-top: 20px; font-size: .95rem; }
.case-content { max-width: 70ch; }
.case-part { padding: 8px 0 40px; }
.case-part h2 { display: flex; align-items: center; gap: 14px; font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
.part-n { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ink); font-size: .95rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.case-part-key { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 28px 30px 20px; margin-bottom: 40px; }
.case-part-key .part-n { background: var(--signal); border-color: var(--signal); color: #1a1405; }
.prose ul { padding-left: 1.1em; margin: 0 0 1em; }
.prose li { margin-bottom: .6em; padding-left: .3em; }
.prose li::marker { color: var(--accent); }
.result-text { font-size: 1.2rem; line-height: 1.55; color: var(--ink); }
@media (max-width: 860px) {
  .case-body { grid-template-columns: 1fr; }
  .case-toc { position: static; }
  .case-toc ol { display: flex; flex-wrap: wrap; gap: 4px 0; border-left: 0; }
  .case-toc a { border-left: 0; padding: 6px 14px 6px 0; margin: 0; }
  .case-part-key { padding: 22px 20px 12px; }
}

.next-case { border-top: 1px solid var(--line); }
.next-case a { display: flex; flex-direction: column; gap: 4px; padding: clamp(36px, 6vw, 64px) 0; text-decoration: none; color: var(--ink); }
.next-label { font-family: var(--sans); color: var(--muted); font-size: .95rem; }
.next-name { font-family: var(--sans); font-weight: 750; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.03em; transition: color .2s; }
.next-title { color: var(--ink-2); }
.next-case a:hover .next-name { color: var(--accent-ink); }

.earlier-list { list-style: none; margin: 0; padding: 0; }
.earlier-list li { padding: 30px 0; border-top: 1px solid var(--line); }
.earlier-list h2 { font-size: 1.35rem; margin-bottom: .2em; }
.earlier-where { font-family: var(--sans); color: var(--muted); font-size: .95rem; }
.earlier-list dl { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 12px 0 0; }
.earlier-list dt { font-family: var(--sans); font-weight: 650; font-size: .92rem; color: var(--accent-ink); margin-bottom: 2px; }
.earlier-list dd { margin: 0; color: var(--ink-2); }
@media (max-width: 680px) { .earlier-list dl { grid-template-columns: 1fr; gap: 12px; } }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 6vw, 72px) clamp(28px, 5vw, 64px); }
.skill-group h2 { font-size: 1.5rem; padding-top: 18px; border-top: 3px solid var(--ink); }
.skill-group:nth-child(2) h2 { border-top-color: var(--accent); }
.skill-group:nth-child(3) h2 { border-top-color: var(--signal); }
.skill-group:nth-child(4) h2 { border-top-color: #8a6bb0; }
.skill-intro { color: var(--muted); }
.skill-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.skill-list li { display: contents; }
.skill { font-family: var(--sans); font-size: .95rem; font-weight: 550; padding: .5em .95em; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
button.skill { cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
button.skill::after { content: "+"; margin-left: 8px; color: var(--muted); font-weight: 700; }
button.skill:hover { border-color: var(--ink); }
button.skill[aria-expanded="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button.skill[aria-expanded="true"]::after { content: "–"; color: var(--signal); }
.skill-plain { background: transparent; color: var(--ink-2); }
.skill-used { flex-basis: 100%; margin: 2px 0 10px; padding: 12px 16px; background: var(--accent-soft); border-radius: var(--radius-m); font-family: var(--sans); font-size: .95rem; color: var(--ink); }
.js .skill-used[hidden] { display: none; }
html:not(.js) button.skill::after { content: none; }
html:not(.js) .skill-used { display: none; }
@media (max-width: 760px) { .skills-grid { grid-template-columns: 1fr; } }

/* ---------- About ---------- */
.about-hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .7fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.portrait img, .monogram { width: 100%; max-width: 300px; aspect-ratio: 1; border-radius: 50%; margin-left: auto; object-fit: cover; }
.monogram { display: grid; place-items: center; background: var(--ink); position: relative; }
.monogram span { font-family: var(--sans); font-weight: 800; font-size: clamp(3rem, 8vw, 5.5rem); color: var(--paper); letter-spacing: -.02em; }
.monogram::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 2px dashed var(--line); }
.monogram::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: var(--signal); top: 6%; right: 14%; box-shadow: 0 0 0 5px var(--paper); }
@media (max-width: 760px) { .about-hero-grid { grid-template-columns: 1fr; } .portrait img, .monogram { max-width: 200px; margin: 8px 0 0; } }
.prose h2 { margin-top: 1.6em; }
.prose p { max-width: 68ch; }

.timeline { list-style: none; margin: 28px 0 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 118px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 100px 1fr; gap: 40px; padding-bottom: 32px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 112px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
.timeline li:last-child::before { background: var(--signal); border-color: var(--signal); }
.tl-when { font-family: var(--sans); font-weight: 650; font-size: .92rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; margin: 0; }
.tl-body h3 { margin-bottom: .1em; }
.tl-where { font-family: var(--sans); color: var(--accent-ink); font-size: .95rem; margin-bottom: .5em; }
.tl-body p:last-child { color: var(--ink-2); margin: 0; }
@media (max-width: 600px) {
  .timeline::before { left: 6px; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; padding-left: 32px; }
  .timeline li::before { left: 0; }
  .tl-when { text-align: left; }
}

.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 56px); border-top: 1px solid var(--line); padding-top: 40px; }
.edu-grid h2 { font-size: 1.35rem; }
.edu-degree { font-family: var(--sans); font-weight: 650; font-size: 1.1rem; margin-bottom: .2em; }
@media (max-width: 680px) { .edu-grid { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.contact-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: clamp(22px, 4vw, 40px); }
.field { margin: 0 0 22px; border: 0; padding: 0; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.field label, .field legend { display: block; font-family: var(--sans); font-weight: 600; font-size: .98rem; margin-bottom: 8px; padding: 0; }
.optional { color: var(--muted); font-weight: 400; }
.field input[type="text"], .field input[type="email"], .field textarea {
  width: 100%; font: inherit; font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-m); padding: 13px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 150px; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-family: var(--sans); font-size: .9rem; margin: 6px 0 0; }
.hint { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin: 6px 0 0; text-align: right; font-variant-numeric: tabular-nums; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: inline-block; font-family: var(--sans); font-weight: 550; font-size: .95rem; padding: .55em 1em; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); transition: all .2s; }
.choice:hover span { border-color: var(--ink); }
.choice input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.choice input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn-send { width: 100%; padding: 1.1em; font-size: 1.05rem; }
.btn-send[disabled] { opacity: .7; cursor: progress; }
.btn-send.is-busy .btn-label::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-note { font-family: var(--sans); font-size: .88rem; color: var(--muted); text-align: center; margin: 14px 0 0; }
.notice { border-radius: var(--radius-m); padding: 16px 20px; margin-bottom: 20px; font-family: var(--sans); }
.notice p { margin: 0; }
.notice-ok { background: var(--accent-soft); color: var(--ink); border-left: 4px solid var(--ok); }
.notice-err { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--ink); border-left: 4px solid var(--danger); }
.contact-form.is-sent > :not(.notice-live) { display: none; }
.contact-form.is-sent .notice-live .notice { margin: 0; }

.contact-aside { display: flex; flex-direction: column; gap: 28px; }
.aside-block h2 { font-size: 1rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; letter-spacing: 0; }
.aside-block p { margin: 0; }
.big-link { font-family: var(--sans); font-weight: 650; font-size: 1.15rem; word-break: break-all; }
.copy-btn { margin-top: 8px; background: none; border: 0; padding: 0; font-family: var(--sans); font-size: .9rem; color: var(--muted); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.copy-btn:hover { color: var(--ink); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.lost-links { font-family: var(--sans); font-weight: 600; font-size: 1.1rem; padding-left: 1.2em; }
.lost-links li { margin-bottom: .5em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--paper-2); border-top: 1px solid var(--line); padding: clamp(48px, 7vw, 80px) 0 28px; margin-top: 0; }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); }
.footer-title { font-family: var(--sans); font-weight: 750; font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.02em; line-height: 1.15; margin-bottom: .4em; color: var(--ink); }
.footer-lead p:not(.footer-title) { color: var(--ink-2); }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.footer-h { font-family: var(--sans); font-weight: 650; color: var(--muted); font-size: .92rem; margin-bottom: 10px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; font-family: var(--sans); }
.footer-cols li { margin-bottom: 8px; }
.footer-cols a { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.footer-cols a:hover { text-decoration: underline; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); font-family: var(--sans); font-size: .85rem; color: var(--muted); }
.footer-base p { margin: 0; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; } }


/* ---------- AI products page ---------- */
.ai-hero h1 { max-width: 18ch; }
.ai-hero .hero-actions { margin-bottom: 0; }

.build-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.build-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr); gap: clamp(16px, 4vw, 56px); padding: 30px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 96px; }
.build-row h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 700; letter-spacing: -.015em; margin: 0; }
.build-row:target h3 { color: var(--accent-ink); }
.build-body p { margin-bottom: .6em; color: var(--ink-2); max-width: 62ch; }
.build-body p:first-child { color: var(--ink); font-size: 1.08rem; }
.build-fit, .build-proof { font-family: var(--sans); font-size: .95rem; }
.build-fit span { font-weight: 650; color: var(--ink); margin-right: 4px; }
.build-proof { color: var(--muted) !important; }
@media (max-width: 760px) { .build-row { grid-template-columns: 1fr; gap: 10px; } }

.chooser-sec { background: var(--paper-2); padding-top: clamp(56px, 8vw, 104px) !important; border-block: 1px solid var(--line); }
.chooser-sec + .section { padding-top: clamp(56px, 8vw, 104px); }
.chooser-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.chooser { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.chooser-options { display: flex; flex-direction: column; gap: 8px; }
.chooser-opt { text-align: left; font-family: var(--sans); font-size: .98rem; font-weight: 550; line-height: 1.35; color: var(--ink-2); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.chooser-opt:hover { border-color: var(--ink); color: var(--ink); }
.chooser-opt[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chooser-answers { position: relative; }
.chooser-answer { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--signal); border-radius: var(--radius-m); padding: 22px 24px; }
.js .chooser-answer[data-hidden] { display: none; }
html:not(.js) .chooser-answer { margin-bottom: 12px; }
.chooser-answer.entering { animation: panel-in .3s var(--ease); }
.chooser-label { font-family: var(--sans); font-size: .9rem; color: var(--muted); margin-bottom: .2em; }
.chooser-result { font-family: var(--sans); font-weight: 750; font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.02em; line-height: 1.15; margin-bottom: .5em; }
.chooser-answer p:last-child { color: var(--ink-2); margin: 0; }
@media (max-width: 980px) { .chooser-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .chooser { grid-template-columns: 1fr; } }

.process-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px clamp(24px, 4vw, 48px); counter-reset: none; }
.process-list li { position: relative; padding-top: 52px; }
.process-list li::before { content: ""; position: absolute; left: 44px; right: -24px; top: 18px; height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 10px); }
.process-list li:nth-child(3n)::before, .process-list li:last-child::before { display: none; }
.process-n { position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--ink); font-family: var(--sans); font-weight: 700; font-variant-numeric: tabular-nums; background: var(--paper); }
.process-list li:last-child .process-n { background: var(--signal); border-color: var(--signal); color: #1a1405; }
.process-list h3 { margin-bottom: .35em; }
.process-list p { color: var(--ink-2); margin: 0; }
@media (max-width: 900px) { .process-list { grid-template-columns: 1fr 1fr; } .process-list li::before { display: none; } }
@media (max-width: 560px) { .process-list { grid-template-columns: 1fr; gap: 28px; } }

.ai-stack h2 { margin-bottom: .3em; }
.ai-stack p { color: var(--ink-2); }

/* ---------- Home: four strengths ---------- */
.bring-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 48px) clamp(28px, 5vw, 64px); }
.bring-item:nth-child(4) { border-top-color: #8a6bb0; }
.bring-item .bring-more { font-family: var(--sans); font-weight: 600; font-size: .95rem; }
.skill-group:nth-child(5) h2 { border-top-color: #4a6fa5; }

/* ---------- Consent banner (only when Google Analytics is set) ---------- */
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.footer-base a { color: inherit; }
.consent { position: fixed; z-index: 80; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin-left: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: 0 18px 50px -12px rgba(20, 35, 58, .35); padding: 20px 22px; font-family: var(--sans); }
.consent[hidden] { display: none; }
.consent p { margin: 0 0 14px; font-size: .95rem; line-height: 1.5; color: var(--ink-2); }
.consent-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.consent .btn { padding: .75em 1.2em; font-size: .95rem; }

/* Page-load moment: the hero loop draws in once */
.js .hero .loop-node { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.6); }
.js .hero.ready .loop-node { opacity: 1; transform: none; transition: opacity .5s var(--ease), transform .5s var(--ease); transition-delay: calc(var(--i, 0) * 70ms + 150ms); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}

@media (max-width: 820px) { .bring-grid { grid-template-columns: 1fr; } }

@media print {
  .consent { display: none !important; }
  .site-header, .site-footer, .hero-loop, .cycle-visual, .filter, .next-case, .contact-form { display: none !important; }
  body { background: #fff; color: #000; }
}
