/* ==========================================================================
   Dan Wabno — Portfolio
   Tokens first, then base, layout, components, pages.
   ========================================================================== */

:root {
  --bg: #faf7f1;
  --surface: #ffffff;
  --surface-2: #f1ede4;
  --text: #1c1917;
  --text-muted: #5c564d;
  --border: #e3dccf;
  --accent: #c2410c;
  --accent-soft: #fdebdc;
  --accent-text: #9a3412;
  --good: #1f7a4d;
  --good-soft: #e3f3ea;
  --warn: #9a5b00;
  --warn-soft: #fbefdc;
  --code-bg: #f1ede4;

  /* DAW-style arrangement + chapter colors */
  --console: #1b1613;
  --console-2: #251e1a;
  --console-text: #f1ece3;
  --console-muted: #a89f92;
  --lane-sound: #e9a23b;
  --lane-training: #e0685a;
  --lane-teach: #45a7a0;
  --lane-ai: #8aa4ff;
  --studio-edge: transparent;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 18, 12, 0.04), 0 6px 24px rgba(20, 18, 12, 0.06);
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14110f;
    --surface: #1d1916;
    --surface-2: #26211d;
    --text: #efebe4;
    --text-muted: #aea79b;
    --border: #342d27;
    --accent: #fb923c;
    --accent-soft: #3a2314;
    --accent-text: #fdba74;
    --good: #6fd19e;
    --good-soft: #17301f;
    --warn: #f0b35e;
    --warn-soft: #33260f;
    --code-bg: #22252a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 24px rgba(0, 0, 0, 0.35);
    --studio-edge: #4a3f36;
  }
}

:root[data-theme="dark"] {
  --bg: #14110f;
  --surface: #1d1916;
  --surface-2: #26211d;
  --text: #efebe4;
  --text-muted: #aea79b;
  --border: #342d27;
  --accent: #fb923c;
  --accent-soft: #3a2314;
  --accent-text: #fdba74;
  --good: #6fd19e;
  --good-soft: #17301f;
  --warn: #f0b35e;
  --warn-soft: #33260f;
  --code-bg: #22252a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 24px rgba(0, 0, 0, 0.35);
  --studio-edge: #4a3f36;
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1, h2 { font-family: var(--font-serif); font-weight: 600; }
h1 { font-size: clamp(2.3rem, 5.5vw, 3.8rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.2rem; font-weight: 650; }

p { margin: 0 0 1em; }

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus { left: 8px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 0.8rem;
}

.muted { color: var(--text-muted); }

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }

.nav-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }

.menu-btn { display: none; }

@media (max-width: 760px) {
  .menu-btn { display: inline-grid; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px var(--gutter) 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.97rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #0e1530; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary { color: #0e1530; }
}
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }

/* ---------- Sections ---------- */

section { padding: clamp(56px, 9vw, 104px) 0; }
section + section { border-top: 1px solid var(--border); }

.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head p { color: var(--text-muted); font-size: 1.08rem; }

/* ---------- Hero ---------- */

.hero { padding-top: clamp(56px, 10vw, 120px); }
.hero h1 { max-width: 17ch; }
.hero .lede {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: 28px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 56px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat { background: var(--surface); padding: 22px 20px; }
.stat strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 6px;
}
.stat span { color: var(--text-muted); font-size: 0.92rem; line-height: 1.4; display: block; }

@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .stat { padding: 16px 14px; }
  .stat strong { font-size: 1.5rem; }
  .stat span { font-size: 0.84rem; }
}

/* ---------- Approach ---------- */

.principles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 760px) { .principles { grid-template-columns: 1fr; } }

.principle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}
.principle .num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-text);
  font-weight: 600;
}
.principle h3 { margin-top: 8px; }
.principle p { color: var(--text-muted); margin: 0; }

.pipeline {
  margin-top: 36px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 12px;
}
.pipe-step {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 20px;
}
.pipe-step .tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.pipe-step h4 { margin: 6px 0 4px; font-size: 1.05rem; }
.pipe-step p { margin: 0; font-size: 0.93rem; color: var(--text-muted); }
.pipe-arrow {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 1.4rem;
}
@media (max-width: 860px) {
  .pipeline { grid-template-columns: 1fr; }
  .pipe-arrow { transform: rotate(90deg); padding: 2px 0; }
}

/* ---------- Project cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  text-decoration: none;
}
.card-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 1.3rem; margin-bottom: 6px; }
.card .summary { color: var(--text-muted); margin-bottom: 16px; }
.card ul { margin: 0 0 18px; padding-left: 1.1em; font-size: 0.95rem; }
.card li { margin-bottom: 4px; }
.card .more { margin-top: auto; font-weight: 600; color: var(--accent-text); font-size: 0.95rem; }

.card.feature { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .card.feature { flex-direction: row; }
  .card.feature .shot { flex: 1 1 50%; aspect-ratio: auto; min-height: 280px; border-bottom: 0; border-right: 1px solid var(--border); }
  .card.feature .card-body { flex: 1 1 50%; }
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
}
.chip.ai { background: var(--accent-soft); color: var(--accent-text); }
.chip.live { background: var(--good-soft); color: var(--good); }
.chip.proto { background: var(--warn-soft); color: var(--warn); }

/* Screenshot slot. Swap the placeholder for an <img> when assets exist. */
.shot {
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, var(--accent-soft), var(--surface-2));
  border-bottom: 1px solid var(--border);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.shot .placeholder {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 16px;
  max-width: 34ch;
  border: 1px dashed color-mix(in srgb, var(--text-muted) 40%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

/* ---------- Assessment table ---------- */

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 960px) { .skill-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .skill-grid { grid-template-columns: 1fr; } }

.skill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.skill .skill-tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--good);
  margin-bottom: 8px;
}
.skill h3 { font-size: 1.08rem; margin-bottom: 4px; }
.skill .for { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 10px; }
.skill p { font-size: 0.94rem; margin: 0; }

/* ---------- More projects ---------- */

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 960px) { .mini-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .mini-grid { grid-template-columns: 1fr; } }

.mini {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
}
.mini h3 { font-size: 1.02rem; margin-bottom: 4px; }
.mini p { font-size: 0.92rem; color: var(--text-muted); margin: 0; }

/* ---------- About / contact ---------- */

.about {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 860px) { .about { grid-template-columns: 1fr; gap: 28px; } }

.about-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}
.about-panel h3 { font-size: 1rem; margin-bottom: 12px; }
.about-panel ul { margin: 0; padding-left: 1.1em; }
.about-panel li { margin-bottom: 6px; font-size: 0.96rem; }

.contact {
  text-align: center;
}
.contact h2 { max-width: 20ch; margin-left: auto; margin-right: auto; }
.contact p { color: var(--text-muted); max-width: 52ch; margin: 0 auto 28px; }
.contact .hero-actions { justify-content: center; margin-bottom: 0; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---------- Case study pages ---------- */

.cs-hero { padding-bottom: 40px; }
.back-link {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 0.93rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 28px;
}
.cs-hero h1 { max-width: 20ch; font-size: clamp(2.1rem, 5vw, 3.2rem); }
.cs-hero .lede { font-size: 1.2rem; color: var(--text-muted); max-width: 62ch; }

.meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 32px;
}
.meta div { background: var(--surface); padding: 16px 18px; }
.meta dt {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.meta dd { margin: 0; font-size: 0.95rem; font-weight: 500; }
@media (max-width: 760px) { .meta { grid-template-columns: repeat(2, 1fr); } }

.cs-shot {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 8px 0 0;
}
.cs-shot .shot { border-bottom: 0; }
.cs-shot figcaption {
  padding: 10px 16px;
  font-size: 0.86rem;
  color: var(--text-muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.cs-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  padding-top: 56px;
}
@media (max-width: 900px) { .cs-body { grid-template-columns: minmax(0, 1fr); gap: 0; } }

.toc {
  position: sticky;
  top: 88px;
  align-self: start;
  font-size: 0.9rem;
}
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.toc a {
  display: block;
  padding: 6px 14px;
  color: var(--text-muted);
  text-decoration: none;
  margin-left: -2px;
  border-left: 2px solid transparent;
}
.toc a:hover { color: var(--text); border-left-color: var(--accent); }
@media (max-width: 900px) { .toc { display: none; } }

.prose { max-width: 68ch; }
.prose h2 {
  font-size: 1.6rem;
  margin-top: 56px;
  scroll-margin-top: 90px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 28px; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }

.evidence {
  margin: 22px 0;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 16px 20px;
}
.evidence .label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 6px;
  display: block;
}
.evidence blockquote {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.55;
}
.evidence .source { font-size: 0.82rem; color: var(--text-muted); margin-top: 8px; }

.callout {
  margin: 24px 0;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--good-soft);
  color: var(--text);
}
.callout strong { color: var(--good); }

.check-list { list-style: none; padding-left: 0 !important; }
.check-list li {
  position: relative;
  padding-left: 30px;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 5px var(--accent);
}

.cs-next {
  margin-top: 72px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cs-next a {
  text-decoration: none;
  font-weight: 600;
}
.cs-next small { display: block; color: var(--text-muted); font-weight: 500; font-size: 0.8rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn { transition: none; }
}

/* ---------- Eval case study ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 20px 0 24px;
}
.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.results th,
.results td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.results tr:last-child td { border-bottom: 0; }
.results th {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
}
.results td.num { font-family: var(--font-mono); white-space: nowrap; }
.results .good { color: var(--good); font-weight: 600; }
.results .bad { color: var(--warn); font-weight: 600; }
.results tfoot td { font-weight: 600; background: var(--surface-2); }

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 18px 0 26px;
}
.pair > div { background: var(--surface); padding: 14px 16px; font-size: 0.94rem; }
.pair .lbl {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.pair .verdict {
  grid-column: 1 / -1;
  background: var(--surface-2);
  font-size: 0.88rem;
}
.pair .verdict strong { color: var(--warn); }
.pair .verdict strong.ok { color: var(--good); }
@media (max-width: 620px) { .pair { grid-template-columns: 1fr; } }

.code-block {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  background: var(--code-bg);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre;
  margin: 16px 0;
}


/* ==========================================================================
   v2 — story-first redesign
   ========================================================================== */

/* ---------- Hero ---------- */

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.hero .eyebrow { letter-spacing: 0.14em; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; padding: 0; list-style: none; }
.hero-badges li {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

/* ---------- Career arrangement (DAW-style timeline) ---------- */

.arrange {
  background: var(--console);
  color: var(--console-text);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  margin: 8px 0 28px;
  overflow-x: auto;
  box-shadow: var(--shadow);
}
.arrange-inner { min-width: 760px; position: relative; }
.arrange-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--console-muted);
  letter-spacing: 0.04em;
}
.arrange-head strong { color: var(--console-text); font-weight: 600; }
.rec { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lane-training); margin-right: 8px; }
.ruler, .lane { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; }
.ruler .track { height: 22px; }
.ruler span {
  position: absolute;
  top: 3px;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--console-muted);
}
.lane { border-top: 1px solid rgba(255, 255, 255, 0.08); height: 46px; }
.lane-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--console-muted);
  padding-right: 8px;
}
.track {
  position: relative;
  height: 100%;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: calc(100% / 17) 100%;
}
.clip {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: var(--l);
  width: var(--w);
  min-width: 6px;
  background: var(--c);
  color: #1b1410;
  border-radius: 6px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}
.clip.sound { --c: var(--lane-sound); }
.clip.training { --c: var(--lane-training); }
.clip.teach { --c: var(--lane-teach); }
.clip.ai { --c: var(--lane-ai); }
.playhead {
  position: absolute;
  top: 26px;
  bottom: 0;
  left: calc(112px + (100% - 112px) * 0.9882);
  width: 2px;
  background: var(--console-text);
  opacity: 0.9;
  animation: sweep 2.6s cubic-bezier(0.22, 0.7, 0.2, 1) both;
}
.playhead::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -5px;
  border: 6px solid transparent;
  border-top-color: var(--console-text);
}
@keyframes sweep { from { left: 112px; } }
@media (prefers-reduced-motion: reduce) { .playhead { animation: none; } }
.arrange-note { margin: 10px 0 0; font-size: 0.78rem; color: var(--console-muted); font-family: var(--font-mono); }

/* ---------- Chapters ---------- */

.chapters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 760px) { .chapters { grid-template-columns: 1fr; } }
.chapter {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 26px 22px 30px;
  overflow: hidden;
}
.chapter::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--c);
}
.chapter.sound { --c: var(--lane-sound); }
.chapter.training { --c: var(--lane-training); }
.chapter.teach { --c: var(--lane-teach); }
.chapter.ai { --c: var(--lane-ai); }
.chapter .when { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.04em; }
.chapter h3 { font-family: var(--font-serif); font-size: 1.4rem; margin: 4px 0 8px; }
.chapter p { color: var(--text-muted); font-size: 0.97rem; }
.chapter .carry {
  margin: 14px 0 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  color: var(--text);
}
.chapter .carry b { display: block; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 2px; }
.chapter .see { font-size: 0.9rem; font-weight: 600; }

/* ---------- Quote visual (for cards without screenshots) ---------- */

.shot.quote {
  background: linear-gradient(140deg, var(--console), var(--console-2));
  padding: 28px;
  place-items: center start;
}
.shot.quote blockquote {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--console-text);
  max-width: 44ch;
}
.shot.quote blockquote::before {
  content: attr(data-src);
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lane-sound);
  margin-bottom: 10px;
}
.shot.quote em { font-style: normal; color: var(--lane-sound); }

/* two-up screenshot (before / after) */
.shot.duo { grid-template-columns: 1fr 1fr; gap: 0; place-items: stretch; background: var(--surface-2); }
.shot.duo figure { margin: 0; position: relative; overflow: hidden; }
.shot.duo figure + figure { border-left: 1px solid var(--border); }
.shot.duo figcaption {
  position: absolute; left: 8px; bottom: 8px;
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600;
  padding: 3px 8px; border-radius: 999px; background: var(--console); color: var(--console-text); border-top: 0;
}
.shot.fit img { object-fit: contain; object-position: center; background: var(--surface-2); }

/* ---------- Work page ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.filter {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.filter:hover { background: var(--surface-2); }
.filter[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.work-count { color: var(--text-muted); font-size: 0.9rem; margin: -12px 0 24px; }

.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 960px) { .work-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .work-grid { grid-template-columns: 1fr; } }
.work-item[hidden] { display: none; }
.work-item {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: inherit;
  text-decoration: none;
}
a.work-item:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow); }
.work-item .chips { margin-bottom: 10px; }
.work-item h3 { font-size: 1.08rem; margin-bottom: 6px; }
.work-item p { font-size: 0.93rem; color: var(--text-muted); margin: 0 0 12px; }
.work-item .more { margin-top: auto; font-size: 0.9rem; font-weight: 600; color: var(--accent-text); }
.work-item .stage { margin-top: auto; font-size: 0.82rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ---------- Story / résumé page ---------- */

.story-intro { max-width: 68ch; font-size: 1.12rem; }
.story-intro p:first-child { font-size: 1.3rem; font-family: var(--font-serif); line-height: 1.45; }

.xp { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 32px; padding: 26px 0; border-top: 1px solid var(--border); }
.xp:first-of-type { border-top: 0; }
@media (max-width: 700px) { .xp { grid-template-columns: 1fr; } }
.xp .dates { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); padding-top: 4px; }
.xp h3 { margin: 0; font-size: 1.15rem; }
.xp .org { color: var(--text-muted); margin: 2px 0 10px; font-size: 0.95rem; }
.xp ul { margin: 0; padding-left: 1.15em; font-size: 0.97rem; }
.xp li { margin-bottom: 4px; }
.xp .tagline { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 8px; }
.xp.sound { --c: var(--lane-sound); } .xp.training { --c: var(--lane-training); }
.xp.teach { --c: var(--lane-teach); } .xp.ai { --c: var(--lane-ai); }
.xp.verify .dates::after { content: " · confirm"; color: var(--warn); }

.edu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .edu-grid { grid-template-columns: 1fr; } }
.edu { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.edu .yr { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent-text); font-weight: 600; }
.edu h3 { font-size: 1.05rem; margin: 6px 0 4px; }
.edu p { color: var(--text-muted); font-size: 0.93rem; margin: 0; }

.skill-cols { columns: 2; column-gap: 40px; padding-left: 1.1em; }
@media (max-width: 700px) { .skill-cols { columns: 1; } }
.skill-cols li { margin-bottom: 6px; break-inside: avoid; }

/* strip of credentials on home */
.cred-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
@media (max-width: 860px) { .cred-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .cred-strip { grid-template-columns: 1fr; } }
.cred-strip div { background: var(--surface); padding: 20px; }
.cred-strip strong { display: block; font-family: var(--font-serif); font-size: 1.05rem; margin-bottom: 4px; }
.cred-strip span { font-size: 0.9rem; color: var(--text-muted); }

/* "text link" row */
.more-link { margin-top: 28px; font-weight: 600; }

/* ---------- Print (résumé page) ---------- */
@media print {
  .site-header, .site-footer, .skip-link, .no-print, .hero-actions { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  section { padding: 18px 0; }
  .xp { break-inside: avoid; padding: 12px 0; }
  a { color: #000; text-decoration: none; }
}

.swipe-hint { display: none; font-size: 0.82rem; margin: -18px 0 24px; }
@media (max-width: 800px) { .swipe-hint { display: block; } }

/* ---------- Philosophy ---------- */
.big-quote {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 20px;
  padding-left: 20px;
  border-left: 5px solid var(--accent);
}
#philosophy .principle .num { letter-spacing: 0.08em; font-size: 0.72rem; }
.section-head .big-quote { color: var(--text); font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
.section-head { max-width: 760px; }


/* ==========================================================================
   v3 — studio home (scoped to .home / .studio so other pages are untouched)
   ========================================================================== */

/* ---------- Track-label eyebrows (DAW channel names) ---------- */

.eyebrow.trk {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}
.eyebrow.trk::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c, var(--lane-sound));
  transition: box-shadow 0.35s ease;
}
.t-sound { --c: var(--lane-sound); }
.t-training { --c: var(--lane-training); }
.t-teach { --c: var(--lane-teach); }
.t-ai { --c: var(--lane-ai); }

/* ---------- Section rhythm ---------- */

.home section { padding: clamp(64px, 10vw, 128px) 0; }
.home h2 { font-size: clamp(1.85rem, 3.9vw, 2.85rem); line-height: 1.12; }
.home .section-head { margin-bottom: clamp(32px, 5vw, 52px); }
.home main section[id] { scroll-margin-top: 130px; }
.home .more-link { margin-top: 32px; }

/* ---------- Studio hero (full-bleed console band) ---------- */

.hero.studio {
  background:
    radial-gradient(900px 420px at 88% -10%, rgba(138, 164, 255, 0.16), transparent 62%),
    radial-gradient(760px 380px at 4% 112%, rgba(233, 162, 59, 0.12), transparent 60%),
    var(--console);
  color: var(--console-text);
  border-top: 1px solid var(--studio-edge);
  border-bottom: 1px solid var(--studio-edge);
  padding: clamp(28px, 3.6vw, 40px) 0 clamp(32px, 4vw, 48px);
}
.studio .eyebrow.trk { color: var(--console-muted); }
.studio h1 { color: var(--console-text); max-width: 17ch; margin-bottom: 0.35em; }
@media (min-width: 900px) { .studio h1 { max-width: 24ch; font-size: clamp(2.6rem, 4.4vw, 3.5rem); } }
.studio .role-line {
  font-size: clamp(1.15rem, 2.3vw, 1.5rem);
  line-height: 1.4;
  font-weight: 500;
  color: var(--console-text);
  max-width: 34ch;
  margin-bottom: 10px;
}
.disciplines {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--console-muted);
}
.disciplines li { display: inline-flex; align-items: center; gap: 8px; }
.disciplines li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.disciplines .d-id { --c: var(--lane-sound); }
.disciplines .d-ai { --c: var(--lane-ai); }
.disciplines .d-tr { --c: var(--lane-training); }
.studio .lede { color: var(--console-muted); max-width: 62ch; margin-bottom: 20px; }
.studio .hero-actions { align-items: center; margin-bottom: 24px; }
.studio .btn-ghost {
  background: transparent;
  color: var(--console-text);
  border-color: rgba(241, 236, 227, 0.35);
}
.studio .btn-ghost:hover { background: rgba(241, 236, 227, 0.08); }
.studio .link-quiet {
  color: var(--console-text);
  font-weight: 600;
  font-size: 0.95rem;
  text-underline-offset: 4px;
  padding: 8px 4px;
}
.studio :focus-visible { outline-color: var(--lane-sound); }
.studio .btn-primary:focus-visible { outline-color: #fff; }

.studio .arrange {
  background: var(--console-2);
  border: 1px solid rgba(241, 236, 227, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  margin: 0 0 28px;
}
.studio .swipe-hint { color: var(--console-muted); margin: -16px 0 20px; }
.studio .hero-badges { margin: 0; gap: 6px 8px; }
.studio .hero-badges li {
  background: transparent;
  border-color: rgba(241, 236, 227, 0.14);
  color: var(--console-muted);
  font-weight: 500;
  font-size: 0.78rem;
  padding: 5px 11px;
}

/* clips: lift on hover / focus */
.clip {
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.clip:hover, .clip:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18), 0 6px 14px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

/* ---------- Stats band ---------- */

.home .stats-band { padding: clamp(36px, 5vw, 56px) 0 0; border-top: 0; }
.stats-band + section { border-top: 0; }

/* ---------- Solo-a-track role lens ---------- */

.lensbar {
  position: sticky;
  top: 64px;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.lensbar-inner { display: flex; align-items: center; gap: 14px; padding-top: 9px; padding-bottom: 9px; }
.lens-label {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.lens-group { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }

.solo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 4px 16px 4px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.solo:hover { background: var(--surface-2); }
.solo-badge {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.solo[aria-pressed="true"] {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text);
  background: var(--surface);
}
.solo[aria-pressed="true"] .solo-badge {
  background: var(--lane-sound);
  border-color: var(--lane-sound);
  color: #1b1410;
  box-shadow: 0 0 12px color-mix(in srgb, var(--lane-sound) 75%, transparent);
}

.lens-pitch-wrap { padding-top: 22px; }
.lens-pitch {
  margin: 0;
  max-width: 72ch;
  padding-left: 14px;
  border-left: 3px solid var(--lane-sound);
  font-size: 1.05rem;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .lensbar { position: static; }
  .lensbar-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* muted / lit tagged elements. Muted ones stay focusable and clickable. */
main [data-lens] { transition: opacity 0.35s ease, filter 0.35s ease; }
body[data-lens="id"] main [data-lens]:not([data-lens~="id"]),
body[data-lens="ai"] main [data-lens]:not([data-lens~="ai"]),
body[data-lens="training"] main [data-lens]:not([data-lens~="training"]) {
  opacity: 0.45;
  filter: saturate(0.2);
}
body[data-lens="id"] main [data-lens]:not([data-lens~="id"]):is(:hover, :focus-within),
body[data-lens="ai"] main [data-lens]:not([data-lens~="ai"]):is(:hover, :focus-within),
body[data-lens="training"] main [data-lens]:not([data-lens~="training"]):is(:hover, :focus-within) {
  opacity: 0.85;
  filter: saturate(0.6);
}

/* lit track dot on matching sections */
body[data-lens="id"] section[data-lens~="id"] .eyebrow.trk::before,
body[data-lens="ai"] section[data-lens~="ai"] .eyebrow.trk::before,
body[data-lens="training"] section[data-lens~="training"] .eyebrow.trk::before {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent), 0 0 12px var(--c);
}

/* ---------- Cards: consistent hover + lit accent edge ---------- */

.card { position: relative; }
.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
  opacity: 0;
  z-index: 2;
  transition: opacity 0.2s ease;
}
.card:hover::before,
.card:focus-visible::before,
body[data-lens="id"] .card[data-lens~="id"]::before,
body[data-lens="ai"] .card[data-lens~="ai"]::before,
body[data-lens="training"] .card[data-lens~="training"]::before { opacity: 1; }
body[data-lens="id"] .card[data-lens~="id"],
body[data-lens="ai"] .card[data-lens~="ai"],
body[data-lens="training"] .card[data-lens~="training"] {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.card-more {
  justify-content: center;
  background: linear-gradient(140deg, var(--console), var(--console-2));
  color: var(--console-text);
  border-color: var(--studio-edge);
}
.card-more .eyebrow.trk { color: var(--console-muted); }
.card-more .summary { color: var(--console-muted); }
.card-more .more { color: var(--lane-sound); }

/* ---------- Impact: Kirkpatrick level meters ---------- */

.meters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 1000px) { .meters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .meters { grid-template-columns: minmax(0, 1fr); } }

.meter {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.meter:hover { border-color: color-mix(in srgb, var(--c) 60%, var(--border)); box-shadow: var(--shadow); }
.meter .vu { display: flex; gap: 4px; margin: 0 0 16px; }
.meter .vu i {
  flex: 1;
  height: 10px;
  border-radius: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.meter .vu i.on {
  background: var(--c);
  border-color: var(--c);
  box-shadow: 0 0 8px color-mix(in srgb, var(--c) 55%, transparent);
}
.meter .lvl {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.meter h3 { font-family: var(--font-serif); font-size: 1.5rem; margin: 2px 0 10px; }
.meter p { font-size: 0.97rem; margin: 0 0 12px; }
.meter-link { margin-top: auto; font-size: 0.9rem; font-weight: 600; }

/* ---------- Merged philosophy + story ---------- */

.home #philosophy { margin-bottom: clamp(40px, 6vw, 72px); }
.home .chapter { transition: border-color 0.18s ease; }
.home .chapter:hover { border-color: color-mix(in srgb, var(--c) 60%, var(--border)); }
.home .skill { transition: border-color 0.18s ease; }
.home .skill:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

/* ---------- Print + reduced motion ---------- */

@media print { .lensbar, .lens-pitch-wrap { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  main [data-lens], .solo, .solo-badge, .clip, .meter, .card::before, .eyebrow.trk::before,
  .home .chapter, .home .skill { transition: none; }
  .clip:hover, .clip:focus-visible { transform: none; }
}

/* ---------- Instructional design case study ---------- */
/* Scoped with the adg- prefix. Phase colors reuse the studio lane palette; text on them is always the dark console color. */

.adg-s1 { --c: #e9a23b; }
.adg-s2 { --c: #e0685a; }
.adg-s3 { --c: #45a7a0; }
.adg-s4 { --c: #8aa4ff; }
.adg-s5 { --c: #7fcf9f; }

.adg-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.adg-track {
  background: var(--console);
  color: var(--console-text);
  border-radius: var(--radius);
  padding: 14px 14px 16px;
  margin-top: 32px;
}
.adg-track-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--console-muted);
}
.adg-lanes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.adg-lanes li { margin: 0; }
.adg-seg {
  display: block;
  height: 100%;
  padding: 11px 12px 13px;
  border-radius: 8px;
  border-top: 4px solid rgba(0, 0, 0, 0.3);
  background: var(--c);
  color: #1b1613;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.adg-seg:hover { filter: brightness(1.08); transform: translateY(-1px); text-decoration: none; }
.adg-seg:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.adg-seg .adg-n {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.adg-seg strong { display: block; font-size: 1.02rem; line-height: 1.25; }
.adg-seg small { display: block; margin-top: 2px; font-size: 0.8rem; line-height: 1.3; color: #2a211c; }
@media (max-width: 760px) {
  .adg-lanes { grid-template-columns: 1fr; }
  .adg-seg { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; padding: 10px 12px; }
  .adg-seg .adg-n { display: inline; }
  .adg-seg strong { display: inline; }
  .adg-seg small { flex-basis: 100%; margin-top: 0; }
}

.adg-tag {
  display: inline-block;
  margin: 56px 0 10px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--c);
  color: #1b1613;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.prose .adg-tag + h2 { margin-top: 0; }
.prose .adg-tag.first { margin-top: 0; }

.adg-note { font-size: 0.9rem; color: var(--text-muted); }

.adg-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0 24px;
}
@media (max-width: 700px) { .adg-grid2 { grid-template-columns: 1fr; } }

.adg-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 16px 18px;
  font-size: 0.95rem;
}
.adg-card .adg-kicker {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.adg-card h4 { margin: 0 0 8px; font-size: 1.05rem; }
.adg-card p { margin: 0 0 10px; }
.adg-card p:last-child { margin-bottom: 0; }
.adg-card .adg-pit,
.adg-card .adg-cue {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
}
.adg-card .adg-pit { background: var(--warn-soft); }
.adg-card .adg-cue { background: var(--good-soft); }
.adg-card .adg-pit b { color: var(--warn); }
.adg-card .adg-cue b { color: var(--good); }

.adg-ladder { list-style: none; margin: 18px 0 24px; padding: 0 !important; display: grid; gap: 8px; }
.adg-ladder li {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.95rem;
}
.adg-ladder b {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.adg-ladder li:nth-child(1) { border-left: 4px solid var(--accent); }
.adg-ladder li:nth-child(2) { border-left: 4px solid var(--lane-teach); }
.adg-ladder li:nth-child(3) { border-left: 4px solid var(--border); }
@media (max-width: 480px) { .adg-ladder li { grid-template-columns: 1fr; gap: 2px; } }

.adg-quiz { margin: 18px 0 24px; }
.adg-quiz ul { list-style: none; margin: 8px 0 12px; padding: 0 !important; display: grid; gap: 4px; }
.adg-quiz li { margin: 0; padding: 6px 10px; border-radius: 6px; background: var(--surface-2); font-size: 0.92rem; }
.adg-quiz li.right { background: var(--good-soft); font-weight: 600; }
.adg-quiz li.right::after { content: " (correct)"; font-weight: 500; color: var(--good); }
.adg-quiz .why { margin: 0; font-size: 0.9rem; color: var(--text-muted); }

.adg-status { font-weight: 700; white-space: nowrap; }
.adg-status.direct { color: var(--good); }
.adg-status.partial { color: var(--warn); }
.adg-status.gap { color: var(--text); background: var(--warn-soft); padding: 1px 8px; border-radius: 999px; }

.adg-pair ul { margin: 0; padding-left: 1.1em; }
.adg-pair li { margin-bottom: 4px; }

.adg-plan { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--warn); }

@media (prefers-reduced-motion: reduce) {
  .adg-seg { transition: none; }
  .adg-seg:hover { transform: none; }
}

/* Alignment matrix: stack each row as a card on small screens instead of scrolling sideways. */
@media (max-width: 700px) {
  .adg-matrix, .adg-matrix tbody, .adg-matrix tr, .adg-matrix td { display: block; width: 100%; }
  .adg-matrix thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .adg-matrix tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .adg-matrix tr:last-child { border-bottom: 0; }
  .adg-matrix td { padding: 3px 0; border-bottom: 0; }
  .adg-matrix td.num { font-size: 1rem; font-weight: 700; padding-bottom: 6px; }
  .adg-matrix td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
}

/* story.html: chapter labels (h2) keep the look of the old h3 job-chapter headings */
.chapter-label { font-family: var(--font-sans); font-size: 1.2rem; font-weight: 650; line-height: 1.2; letter-spacing: -0.01em; }
