/* =========================================================
   Eduardo Martini — Mobile Game Designer portfolio
   Editorial, neutral palette with one coral accent.
   ========================================================= */

:root {
  --bg: #f4f2ed;
  --surface: #fbfaf7;
  --surface-2: #efece5;
  --ink: #121317;
  --ink-2: #33343b;
  --muted: #5f6068;
  --line: #e2ded4;
  --line-2: #cbc6b9;
  --bar: #b9b4a8;
  --accent: #ff5a36;
  --accent-ink: #c2381a;
  --accent-big: #e8461f;
  --accent-soft: #ffe6dd;
  --dark: #111216;
  --dark-2: #1a1b20;
  --dark-line: #2b2c33;
  --dark-text: #ecebe6;
  --dark-muted: #a3a3ab;

  --f-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --pad: clamp(20px, 5vw, 48px);
  --header-h: 68px;
  --radius: 18px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --measure: 760px;
  --wide: 1120px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 64px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-display);
  font-size: 1rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { overflow-x: clip; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
strong { font-weight: 650; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent-soft); color: var(--ink); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 16px; top: -60px; z-index: 100; padding: 12px 18px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none; transition: top .2s;
}
.skip:focus { top: 12px; }

.container { width: 100%; max-width: calc(1200px + 2 * var(--pad)); margin-inline: auto; padding-inline: var(--pad); }
.container--wide { max-width: calc(var(--wide) + 2 * var(--pad)); }

/* ---------- Shared UI ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 1.5px solid var(--ink);
  background: var(--ink); color: var(--bg); font: 600 0.95rem/1 var(--f-display); text-decoration: none;
  transition: transform .25s var(--ease), background-color .25s, color .25s, border-color .25s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); background: #000; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); }
.btn--small { min-height: 44px; padding: 10px 18px; font-size: .875rem; }

.link-arrow {
  font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 2px; text-underline-offset: 4px; transition: color .2s;
  display: inline-flex; align-items: center; min-height: 44px;
}
.link-arrow:hover { color: var(--accent-ink); }

.kicker, .eyebrow, .fig__kicker {
  font-family: var(--f-mono); font-size: .75rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.eyebrow { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .6em 1em; }
.eyebrow__num { color: var(--accent-ink); }

.tag {
  display: inline-flex; align-items: center; gap: .4em; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  font: 500 .6875rem/1.2 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.tag--quiet { background: transparent; }
.tag--dev { border-style: dashed; border-color: var(--ink-2); background: transparent; }
.tag--dev::before { content: ''; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid currentColor; }

.vtag {
  display: inline-block; padding: 2px 7px; border-radius: 6px; background: var(--ink); color: var(--bg);
  font: 500 .75rem/1.4 var(--f-mono); white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s, background-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner {
  height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  max-width: calc(1200px + 2 * var(--pad)); margin-inline: auto; padding-inline: var(--pad);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; }
.brand__mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font: 700 .875rem/1 var(--f-display); letter-spacing: -.02em;
  position: relative;
}
.brand__mark::after {
  content: ''; position: absolute; right: -3px; bottom: -3px; width: 10px; height: 10px; border-radius: 3px;
  background: var(--accent); border: 2px solid var(--bg);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font-size: .95rem; }
.brand__text span { font-size: .75rem; color: var(--muted); }

.nav { display: flex; align-items: center; gap: 28px; }
.nav__list { display: flex; gap: 4px; list-style: none; }
.nav__list a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px;
  text-decoration: none; font-weight: 500; font-size: .9375rem; color: var(--ink-2); transition: background-color .2s, color .2s;
}
.nav__list a:hover { background: var(--surface-2); color: var(--ink); }

.menu-toggle {
  display: none; width: 48px; height: 48px; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--surface); cursor: pointer; place-items: center; color: var(--ink);
}
.menu-toggle__bars, .menu-toggle__bars::before, .menu-toggle__bars::after {
  display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s;
}
.menu-toggle__bars { position: relative; }
.menu-toggle__bars::before, .menu-toggle__bars::after { content: ''; position: absolute; left: 0; }
.menu-toggle__bars::before { top: -6px; }
.menu-toggle__bars::after { top: 6px; }
.menu-toggle[aria-expanded='true'] .menu-toggle__bars { background: transparent; }
.menu-toggle[aria-expanded='true'] .menu-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded='true'] .menu-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: var(--header-h) 0 0 0; background: var(--bg); overflow-y: auto;
  padding: 24px var(--pad) 40px; opacity: 0; transition: opacity .3s var(--ease);
}
.mobile-menu.is-open { opacity: 1; }
.mobile-menu ul { list-style: none; }
.mobile-menu li { border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(12px); transition: opacity .4s var(--ease), transform .4s var(--ease); transition-delay: calc(var(--i) * 50ms); }
.mobile-menu.is-open li { opacity: 1; transform: none; }
.mobile-menu li a {
  display: flex; align-items: center; justify-content: space-between; min-height: 64px;
  font-size: 1.75rem; font-weight: 600; letter-spacing: -.02em; text-decoration: none;
}
.mobile-menu li a::after { content: '→'; color: var(--accent-ink); font-size: 1.25rem; }
.mobile-menu__foot { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 28px; }
.mobile-menu__foot .btn { margin-bottom: 8px; }
body.menu-open { overflow: hidden; }

@media (max-width: 960px) {
  .nav { display: none; }
  .menu-toggle { display: grid; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(80px, 11vw, 140px); }
.section-intro { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-intro h2 { font-size: clamp(2rem, 4.4vw, 3.25rem); margin-top: 12px; }
.section-intro p:not(.kicker) { margin-top: 16px; font-size: 1.125rem; color: var(--muted); max-width: 60ch; }
.kicker { color: var(--accent-ink); }

/* ---------- Home: hero ---------- */
.hero {
  position: relative; padding-top: calc(var(--header-h) + clamp(40px, 8vw, 96px)); padding-bottom: clamp(56px, 8vw, 110px);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 70% at 30% 40%, transparent 0%, var(--bg) 78%);
}
.hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero__text .eyebrow { color: var(--ink-2); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #2bb673; box-shadow: 0 0 0 0 rgba(43,182,115,.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(43,182,115,0); } 100% { box-shadow: 0 0 0 0 rgba(43,182,115,0); } }
.hero__title { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.hero__name { font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-weight: 600; letter-spacing: -.01em; color: var(--ink-2); }
.hero__role { font-size: clamp(3rem, 8.4vw, 7rem); font-weight: 750; line-height: .92; letter-spacing: -.045em; }
.accent { color: var(--accent-big); }
.hero__lede { margin-top: 28px; max-width: 34em; font-size: clamp(1.0625rem, 1.6vw, 1.25rem); color: var(--ink-2); line-height: 1.55; }
.hero__lede strong { color: var(--ink); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__facts { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: .9375rem; color: var(--muted); }
.hero__facts strong { color: var(--ink); }

.hero__visual { position: relative; aspect-ratio: 1; max-width: 520px; width: 100%; justify-self: center; }
.board {
  position: absolute; inset: 14% 8%; display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px;
  transform: rotateX(58deg) rotateZ(-42deg); transform-style: preserve-3d;
  padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-2);
  box-shadow: 0 40px 60px -30px rgba(18,19,23,.35);
}
.board__cell { aspect-ratio: 1; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); transition: transform .4s var(--ease); }
.board__cell.is-on { background: var(--ink); border-color: var(--ink); box-shadow: 0 6px 0 -1px #000; transform: translateZ(10px); }
.board__cell.is-hot { background: var(--accent); border-color: var(--accent); box-shadow: 0 6px 0 -1px #b8321a; animation: hop 3.2s var(--ease) infinite; animation-delay: calc(var(--d) * 90ms); }
@keyframes hop { 0%, 60%, 100% { transform: translateZ(10px); } 75% { transform: translateZ(26px); } }
.chip {
  position: absolute; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 14px 30px -18px rgba(18,19,23,.4);
  max-width: 210px; animation: bob 6s ease-in-out infinite;
}
.chip strong { font: 600 1.25rem/1.1 var(--f-display); letter-spacing: -.02em; }
.chip span { font-size: .75rem; color: var(--muted); line-height: 1.3; }
.chip--a { top: 4%; left: 0; }
.chip--b { top: 42%; right: -2%; animation-delay: -2s; }
.chip--b strong { color: var(--accent-ink); }
.chip--c { bottom: 4%; left: 8%; animation-delay: -4s; }
@keyframes bob { 50% { transform: translateY(-8px); } }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { max-width: 440px; }
}
@media (max-width: 600px) {
  .chip { padding: 9px 12px; max-width: 170px; }
  .chip strong { font-size: 1.0625rem; }
  .chip span { font-size: .6875rem; }
  .chip--b { top: auto; bottom: 22%; right: 0; }
  .board { inset: 18% 6%; }
  .hero__visual { max-width: 340px; }
}

/* ---------- Home: work ---------- */
.work__list { display: grid; gap: 28px; }
.work-card {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); border-radius: 24px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s;
}
.work-card:hover { transform: translateY(-4px); box-shadow: 0 30px 60px -36px rgba(18,19,23,.35); border-color: var(--line-2); }
.work-card__text { padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; }
.work-card__meta { display: flex; align-items: center; gap: 12px; font: 500 .75rem/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.work-card__n { font-size: .875rem; color: var(--accent-ink); }
.work-card__title { margin-top: 16px; font-size: clamp(1.5rem, 2.6vw, 2.125rem); }
.work-card__title a { text-decoration: none; }
.stretched::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.work-card__sub { margin-top: 14px; color: var(--muted); font-size: 1rem; max-width: 52ch; }
.work-card__stats { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.work-card__stats strong { display: block; font-size: clamp(1.25rem, 2vw, 1.6rem); letter-spacing: -.02em; }
.work-card__stats span { display: block; font-size: .8125rem; color: var(--muted); line-height: 1.35; margin-top: 4px; }
.work-card__foot { margin-top: auto; padding-top: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.work-card__cta { font-weight: 600; display: inline-flex; gap: 6px; }
.work-card__cta span { transition: transform .3s var(--ease); color: var(--accent-ink); }
.work-card:hover .work-card__cta span { transform: translateX(4px); }
.work-card__visual { background: var(--dark); color: var(--dark-text); padding: clamp(24px, 3.5vw, 40px); display: flex; align-items: center; }

.mini { width: 100%; }
.mini__cap { margin-top: 16px; font: 500 .6875rem/1.4 var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--dark-muted); }
.mini--funnel { display: flex; flex-direction: column; gap: 6px; }
.mini--funnel span {
  display: flex; align-items: center; justify-content: flex-end; height: 26px; width: var(--w); border-radius: 5px;
  background: linear-gradient(90deg, #3a3b43, #55565f); padding-right: 8px;
  transform-origin: left; transition: transform .9s var(--ease); transition-delay: calc(var(--i) * 70ms);
}
.mini--funnel span:nth-child(3) { background: var(--accent); }
.mini--funnel em { font: 500 .6875rem/1 var(--f-mono); font-style: normal; color: #fff; }
.mini__plot { position: relative; display: flex; align-items: flex-end; gap: 8px; height: 220px; border-bottom: 1px solid var(--dark-line); }
.mini__plot::before { content: ''; position: absolute; left: 0; right: 0; bottom: var(--ref); border-top: 1.5px dashed #8d8d96; }
.mini--bars span {
  position: relative; flex: 1; height: var(--h); border-radius: 5px 5px 0 0; background: #4a4b54;
  transform-origin: bottom; transition: transform .9s var(--ease); transition-delay: calc(var(--i) * 60ms);
}
.mini--bars span.is-accent { background: var(--accent); }
.mini--bars em { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font: 500 .6875rem/1 var(--f-mono); font-style: normal; color: var(--dark-muted); }
.mini--bars .mini__cap { margin-top: 32px; }
.js .reveal:not(.is-visible) .mini--funnel span { transform: scaleX(0); }
.js .reveal:not(.is-visible) .mini--bars span { transform: scaleY(0); }

@media (max-width: 900px) {
  .work-card { grid-template-columns: minmax(0, 1fr); }
  .work-card .tag { white-space: normal; }
  .work-card__visual { order: -1; }
  .mini__plot { height: 160px; }
}
@media (max-width: 520px) {
  .work-card__stats { grid-template-columns: 1fr; gap: 12px; }
  .work-card__stats li { display: flex; align-items: baseline; gap: 12px; }
  .work-card__stats strong { min-width: 6.5em; }
  .work-card__stats span { margin-top: 0; }
}

/* ---------- Home: approach (dark) ---------- */
.approach { background: var(--dark); color: var(--dark-text); }
.approach .section-intro p:not(.kicker) { color: var(--dark-muted); }
.approach .kicker { color: var(--accent); }
.principles { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--dark-line); }
.principle { padding: 28px 28px 8px 0; border-right: 1px solid var(--dark-line); }
.principle + .principle { padding-left: 28px; }
.principle:last-child { border-right: 0; }
.principle__n { font: 500 .8125rem/1 var(--f-mono); color: var(--accent); }
.principle h3 { margin-top: 28px; font-size: 1.375rem; }
.principle p { margin-top: 12px; color: var(--dark-muted); font-size: .9688rem; }
@media (max-width: 1000px) {
  .principles { grid-template-columns: 1fr 1fr; }
  .principle, .principle + .principle { padding: 28px 24px 28px 0; border-right: 0; border-bottom: 1px solid var(--dark-line); }
  .principle:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--dark-line); }
}
@media (max-width: 600px) {
  .principles { grid-template-columns: 1fr; }
  .principle:nth-child(even) { padding-left: 0; border-left: 0; }
}

/* ---------- Home: about & skills ---------- */
.about__grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.about__media { position: sticky; top: calc(var(--header-h) + 32px); }
.about__photo { width: 100%; border-radius: 22px; }
img.about__photo { aspect-ratio: 4/5; object-fit: cover; }
.about__bio p { font-family: var(--f-serif); font-size: 1.1875rem; line-height: 1.7; color: var(--ink-2); }
.about__bio p + p { margin-top: 1em; }
.about__facts { list-style: none; margin-top: 36px; border-top: 1px solid var(--line); }
.about__facts li { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.about__facts span { font: 500 .75rem/1.6 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.skills { margin-top: clamp(64px, 8vw, 104px); }
.skills__title { font-size: 1.5rem; margin-bottom: 24px; }
.skills__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skills__group { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.skills__group h4 { font: 500 .75rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); margin-bottom: 16px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 7px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: .875rem; }
@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__media { position: static; max-width: 340px; }
  .skills__grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .about__facts li { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Home: experience ---------- */
.experience { background: var(--surface); border-block: 1px solid var(--line); }
.timeline { list-style: none; }
.job { display: grid; grid-template-columns: 220px 1fr; gap: 32px; }
.job__when span { position: sticky; top: calc(var(--header-h) + 24px); display: inline-block; font: 500 .8125rem/1.4 var(--f-mono); color: var(--ink-2); padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; }
.job__title { font-size: clamp(1.375rem, 2.4vw, 1.75rem); }
.job__org { margin-top: 6px; color: var(--accent-ink); font-weight: 600; }
.job ul { margin-top: 20px; padding-left: 1.1em; color: var(--ink-2); max-width: 70ch; }
.job li { padding-left: .3em; margin-top: 10px; }
.job li::marker { color: var(--accent); }
.job__links { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 4px 28px; }
@media (max-width: 760px) { .job { grid-template-columns: 1fr; gap: 16px; } }

/* ---------- Home: contact ---------- */
.contact { text-align: center; }
.contact__inner { max-width: 900px; }
.contact h2 { margin-top: 14px; font-size: clamp(2.25rem, 6vw, 4.5rem); letter-spacing: -.04em; }
.contact__lede { margin: 20px auto 0; max-width: 44ch; color: var(--muted); font-size: 1.125rem; }
.contact__email {
  display: inline-block; margin-top: 36px; font-size: clamp(1.375rem, 4vw, 2.5rem); font-weight: 600; letter-spacing: -.03em;
  text-decoration: none; background-image: linear-gradient(var(--accent), var(--accent)); background-size: 100% 3px;
  background-repeat: no-repeat; background-position: 0 100%; padding-bottom: 4px; transition: background-size .4s var(--ease); word-break: break-word;
}
.contact__email:hover { background-size: 100% 100%; color: #fff; }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 40px; }
.site-footer__inner { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.site-footer__name { font-weight: 650; }
.site-footer__role, .site-footer__copy { font-size: .875rem; color: var(--muted); }
.site-footer__links { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer__links a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 500; }
.site-footer__links a:hover { color: var(--accent-ink); }
.site-footer__copy { grid-column: 1 / -1; }
@media (max-width: 700px) { .site-footer__inner { grid-template-columns: 1fr; } }

/* =========================================================
   Case study pages
   ========================================================= */
.progress { position: fixed; top: var(--header-h); left: 0; right: 0; height: 3px; z-index: 49; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }

.case-hero { padding-top: calc(var(--header-h) + clamp(28px, 5vw, 56px)); }
.case-hero > .container:first-child { max-width: calc(var(--wide) + 2 * var(--pad)); }
.back {
  display: flex; width: max-content; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 20px;
  font-weight: 600; font-size: .9375rem; text-decoration: none; color: var(--ink-2);
}
.back span { transition: transform .3s var(--ease); }
.back:hover span { transform: translateX(-4px); }
.case-hero__title { margin-top: 18px; max-width: 18ch; font-size: clamp(2.25rem, 5.4vw, 4.25rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.02; }
.case-hero__lede { margin-top: 22px; max-width: 46em; font-family: var(--f-serif); font-size: clamp(1.125rem, 1.8vw, 1.375rem); line-height: 1.55; color: var(--ink-2); }

.kpis { margin-top: 40px; }
.kpis__context { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: .875rem; color: var(--muted); }
.kpis__list { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 22px 22px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.kpi__value { font-size: clamp(2rem, 3.6vw, 2.75rem); font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.kpi:first-child .kpi__value { color: var(--accent-big); }
.kpi__label { font-weight: 600; font-size: .9375rem; line-height: 1.35; }
.kpi__note { font: 500 .75rem/1.4 var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.case-meta { display: grid; grid-template-columns: 1.2fr 1.8fr 1.2fr .6fr; gap: 24px; margin: 36px 0 0; padding: 24px 0; border-top: 1px solid var(--line); }
.case-meta dt { font: 500 .6875rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.case-meta dd { margin: 0; font-size: .9375rem; line-height: 1.5; color: var(--ink-2); }
.case-hero__links { margin-top: 4px; }
.case-hero__media { margin-top: 24px; }

@media (max-width: 1000px) { .case-meta { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) {
  .kpis__list { grid-template-columns: 1fr; }
  .kpi { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 14px; }
  .kpi__value { min-width: 4.2em; }
  .kpi__label { flex: 1; min-width: 12em; }
  .kpi__note { width: 100%; }
}
@media (max-width: 520px) { .case-meta { grid-template-columns: 1fr; gap: 18px; } }

/* Section navigation */
.case-nav { position: sticky; top: var(--header-h); z-index: 40; margin-top: clamp(40px, 6vw, 72px); }
.case-nav__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px var(--pad); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-block: 1px solid var(--line);
}
.case-nav__current { font: 500 .75rem/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-nav__toggle {
  flex: none; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface);
  font: 600 .875rem/1 var(--f-display); color: var(--ink); cursor: pointer;
}
.toc { display: none; }
.case-nav.is-open .toc {
  display: block; position: absolute; left: var(--pad); right: var(--pad); top: calc(100% + 8px);
  padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2);
  box-shadow: 0 24px 40px -24px rgba(18,19,23,.35); max-height: 70vh; overflow-y: auto;
}
.toc__title { font: 500 .6875rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 10px; }
.toc ol { list-style: none; }
.toc a {
  display: flex; gap: 12px; align-items: baseline; padding: 10px; min-height: 44px; border-radius: 10px;
  text-decoration: none; font-size: .9375rem; color: var(--ink-2); line-height: 1.3; transition: background-color .2s, color .2s;
}
.toc a span { font: 500 .75rem/1 var(--f-mono); color: var(--muted); }
.toc a:hover { background: var(--surface-2); color: var(--ink); }
.toc a.is-active { color: var(--ink); font-weight: 600; }
.toc a.is-active span { color: var(--accent-ink); }

@media (min-width: 1560px) {
  .case-nav { position: static; margin-top: clamp(40px, 6vw, 72px); height: 0; }
  .case-nav__bar { display: none; }
  .toc {
    display: block; position: fixed; top: calc(var(--header-h) + 56px); left: calc(50% - var(--measure) / 2 - 300px);
    width: 220px; opacity: 0; visibility: hidden; transform: translateX(-8px);
    transition: opacity .3s, transform .3s var(--ease), visibility .3s;
  }
  .case-nav.is-active .toc { opacity: 1; visibility: visible; transform: none; }
  .toc a { padding: 7px 10px; min-height: 36px; font-size: .875rem; }
}

/* Body */
.case-body { padding-bottom: clamp(48px, 8vw, 96px); }
.case-section { max-width: calc(var(--measure) + 2 * var(--pad)); margin-inline: auto; padding: clamp(56px, 8vw, 96px) var(--pad) 0; }
.section-head { display: grid; gap: 12px; margin-bottom: 28px; }
.section-head__num { font: 500 .875rem/1 var(--f-mono); color: var(--accent-ink); display: flex; align-items: center; gap: 12px; }
.section-head__num::after { content: ''; height: 1px; width: 48px; background: var(--line-2); }
.section-head h2 { font-size: clamp(1.625rem, 3.2vw, 2.25rem); letter-spacing: -.03em; }
.section-head__tags { display: flex; flex-wrap: wrap; gap: 8px; }

.prose { font-family: var(--f-serif); font-size: clamp(1.0625rem, 1.3vw, 1.1875rem); line-height: 1.7; color: var(--ink-2); }
.prose > p + p, .prose > p + ul, .prose > ul + p { margin-top: 1.1em; }
.prose > p strong, .prose > ul strong, .note strong { color: var(--ink); font-weight: 600; }
.prose > ul { padding-left: 1.2em; }
.prose .p-lead { padding-left: 20px; border-left: 2px solid var(--line-2); }
.prose .p-lead strong:first-child { font-family: var(--f-display); font-weight: 650; letter-spacing: -.01em; }
.prose > .fig, .prose > .gallery, .prose > .annotated, .prose > .note, .prose > .pull { margin-block: clamp(36px, 5vw, 56px); }
.prose > .fig + .fig, .prose > .fig + .gallery, .prose > .annotated + .fig { margin-top: 24px; }

.pull { margin-inline: 0; padding: 8px 0 8px 28px; border-left: 4px solid var(--accent); }
.pull p { font-family: var(--f-display); font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2; font-weight: 600; letter-spacing: -.025em; color: var(--ink); text-wrap: balance; }

.note { padding: 22px 24px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ink); font-size: 1rem; }
.note__label { font: 500 .6875rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }

/* Figures */
.fig { margin: 0; }
.fig--wide { --w: min(var(--wide), calc(100vw - 2 * var(--pad))); width: var(--w); margin-left: calc((100% - var(--w)) / 2) !important; margin-right: 0 !important; }
.fig__frame { padding: clamp(18px, 3vw, 36px); border-radius: 22px; background: var(--surface); border: 1px solid var(--line); font-family: var(--f-display); }
.fig__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: clamp(20px, 3vw, 30px); }
.fig__head .fig__kicker { width: 100%; }
.fig__title { font-size: clamp(1.1875rem, 2vw, 1.5rem); letter-spacing: -.02em; }
.fig__sub { width: 100%; font-size: .9375rem; color: var(--muted); }
.fig__caption { margin-top: 14px; font-family: var(--f-display); font-size: .875rem; line-height: 1.55; color: var(--muted); max-width: 78ch; }
.fig__data { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 12px; }
.fig__data summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; font: 500 .75rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.fig__data summary:hover { color: var(--accent-ink); }
.table-scroll { overflow-x: auto; margin-top: 8px; }
.fig table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.fig th, .fig td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.fig thead th { font: 500 .6875rem/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fig td { font-family: var(--f-mono); font-size: .8125rem; }
.fig tbody th { font-weight: 500; }

/* Horizontal bar chart */
.hbar { position: relative; }
.hbar__row { display: grid; grid-template-columns: minmax(170px, 32%) 1fr 64px; column-gap: 18px; align-items: center; }
.hbar__row:not(.hbar__row--ref):not(.hbar__row--axis) { padding: 6px 0; }
.hbar__label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; line-height: 1.25; }
.hbar__name { font-size: .9375rem; font-weight: 550; }
.hbar__meta { width: 100%; font: 400 .75rem/1.3 var(--f-mono); color: var(--muted); }
.hbar__tag { font: 500 .75rem/1.4 var(--f-mono); padding: 1px 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); }
.is-accent .hbar__tag { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.hbar__track {
  position: relative; align-self: stretch; min-height: 30px;
  background-image: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px var(--grid, 25%));
  border-right: 1px solid var(--line);
}
.hbar__bar {
  position: absolute; left: 0; top: 50%; height: 22px; margin-top: -11px; width: var(--w); border-radius: 0 6px 6px 0;
  background: var(--bar); transform-origin: left; transition: transform 1s var(--ease);
}
.is-accent .hbar__bar { background: var(--accent); }
.hbar__value { font: 500 .875rem/1 var(--f-mono); font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; }
.is-accent .hbar__value { color: var(--accent-ink); font-weight: 600; }
.hbar.has-ref .hbar__track::after { content: ''; position: absolute; top: 0; bottom: 0; left: var(--ref); border-left: 1.5px dashed var(--ink); }
.hbar__row--ref .hbar__track { background: none; border-right-color: transparent; min-height: 0; padding-bottom: 6px; }
.hbar__ref-label { display: block; margin-left: auto; width: max-content; max-width: var(--ref); margin-right: calc(100% - var(--ref)); padding-right: 8px; text-align: right; font: 500 .75rem/1.3 var(--f-mono); color: var(--ink); }
.hbar__row--axis .hbar__track { background: none; border-right-color: transparent; min-height: 26px; border-top: 1px solid var(--line-2); }
.hbar.has-ref .hbar__row--axis .hbar__track::after, .hbar.has-ref .hbar__row--ref .hbar__track::after { display: none; }
.hbar__axis span { position: absolute; top: 6px; transform: translateX(-50%); font: 400 .75rem/1 var(--f-mono); color: var(--muted); white-space: nowrap; }
.hbar__axis span:first-child { transform: none; }
.hbar__axis span:last-child { transform: translateX(-100%); }
.hbar__note { display: grid; grid-template-columns: minmax(170px, 32%) 1fr; column-gap: 18px; margin: 2px 0 8px; }
.hbar__note p { font-size: .8125rem; line-height: 1.45; color: var(--ink-2); padding: 8px 12px; border-left: 2px solid var(--line-2); background: var(--bg); border-radius: 0 8px 8px 0; }
.hbar__note.is-accent p { border-left-color: var(--accent); background: var(--accent-soft); }
.hbar--compact .hbar__row, .hbar--compact .hbar__note { grid-template-columns: minmax(220px, 44%) 1fr 56px; }
.hbar--compact .hbar__bar { height: 16px; margin-top: -8px; }
.hbar--compact .hbar__track { min-height: 24px; }
.hbar--compact .hbar__row:not(.hbar__row--axis) { padding: 3px 0; }
.js .reveal:not(.is-visible) .hbar__bar { transform: scaleX(0); }
.hbar__row:nth-child(3) .hbar__bar { transition-delay: 60ms; }
.hbar__row:nth-child(4) .hbar__bar { transition-delay: 120ms; }
.hbar__row:nth-child(5) .hbar__bar { transition-delay: 180ms; }
.hbar__row:nth-child(6) .hbar__bar { transition-delay: 240ms; }
.hbar__row:nth-child(7) .hbar__bar { transition-delay: 300ms; }
.hbar__row:nth-child(8) .hbar__bar { transition-delay: 360ms; }
.hbar__row:nth-child(9) .hbar__bar { transition-delay: 420ms; }
.hbar__row:nth-child(10) .hbar__bar { transition-delay: 480ms; }

@media (max-width: 640px) {
  .hbar__row { grid-template-columns: 1fr 56px; column-gap: 10px; }
  .hbar__label { grid-column: 1 / -1; padding-bottom: 4px; }
  .hbar__meta { width: auto; }
  .hbar__row > span:first-child:empty { display: none; }
  .hbar__note { grid-template-columns: 1fr; }
  .hbar__note > span { display: none; }
  .hbar__note p { margin-right: 66px; }
  .hbar__row--ref .hbar__track, .hbar__row--axis .hbar__track { grid-column: 1; }
  .hbar__row:not(.hbar__row--ref):not(.hbar__row--axis) { padding: 8px 0 4px; }
}

/* Vertical comparison */
.compare { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(20px, 4vw, 48px); align-items: center; }
.vbars { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding-top: 36px; }
.vbars__col { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.vbars__track { position: relative; height: 240px; border-bottom: 1.5px solid var(--ink); background-image: repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px 25%); }
.vbars__bar { position: absolute; left: 14%; right: 14%; bottom: 0; height: var(--h); border-radius: 8px 8px 0 0; background: var(--bar); transform-origin: bottom; transition: transform 1s var(--ease); }
.vbars__col.is-accent .vbars__bar { background: var(--accent); transition-delay: .15s; }
.vbars__value { position: absolute; left: 0; right: 0; bottom: calc(var(--h) + 8px); text-align: center; font: 700 clamp(1.5rem, 3vw, 2.25rem)/1 var(--f-display); letter-spacing: -.03em; }
.vbars__col.is-accent .vbars__value { color: var(--accent-ink); }
.vbars__label { text-align: center; font-size: .875rem; font-weight: 550; color: var(--ink-2); }
.vbars__delta { position: absolute; top: 0; left: 50%; transform: translateX(-50%); }
.vbars__delta span { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: var(--bg); font: 500 .8125rem/1 var(--f-mono); white-space: nowrap; }
.compare__axis { margin-top: 10px; font: 400 .75rem/1.3 var(--f-mono); color: var(--muted); text-align: center; }
.js .reveal:not(.is-visible) .vbars__bar { transform: scaleY(0); }
.metric-card { padding: 26px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--bg); }
.metric-card__value { font: 700 clamp(2.5rem, 5vw, 3.5rem)/1 var(--f-display); letter-spacing: -.04em; }
.metric-card__label { margin-top: 10px; font-weight: 650; font-size: 1.0625rem; }
.metric-card__note { margin-top: 8px; font-size: .875rem; color: var(--muted); line-height: 1.5; }
@media (max-width: 720px) { .compare { grid-template-columns: 1fr; } .vbars__track { height: 200px; } }

/* Flow lanes (C1-DG01) */
.lanes { display: grid; gap: 18px; }
.lane { padding: 20px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.lane--after { border-color: var(--line-2); background: #fff; }
.lane__label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-weight: 650; font-size: .9375rem; margin-bottom: 16px; }
.lane__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bar); }
.lane--after .lane__dot { background: var(--accent); }
.flow { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.flow__step span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); font-weight: 550; font-size: .9375rem; }
.flow__step.is-break span { border-style: dashed; border-color: var(--ink-2); background: transparent; color: var(--ink-2); }
.flow--after .flow__step span { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.flow__arrow { color: var(--muted); }
.arrow { width: 20px; height: 20px; }
.lane__note { margin-top: 14px; font-size: .875rem; color: var(--muted); }
@media (max-width: 640px) {
  .flow { flex-direction: column; align-items: stretch; }
  .flow__step span { width: 100%; }
  .flow__arrow { align-self: center; transform: rotate(90deg); }
}

/* Chapters (C1-DG02) */
.chapters { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; counter-reset: ch; }
.chapter { position: relative; display: flex; flex-direction: column; padding: 18px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.chapter:not(:last-child)::after { content: ''; position: absolute; top: 32px; right: -13px; width: 14px; height: 2px; background: var(--line-2); }
.chapter__num { align-self: flex-start; font: 500 .75rem/1 var(--f-mono); padding: 5px 8px; border-radius: 6px; background: var(--ink); color: var(--bg); }
.chapter:last-child .chapter__num { background: var(--accent); color: var(--ink); }
.chapter__title { margin-top: 14px; font-size: 1rem; letter-spacing: -.01em; }
.chapter__learn { margin-top: 8px; font-size: .875rem; line-height: 1.5; color: var(--ink-2); }
.chapter__reward { margin-top: auto; padding-top: 14px; font-size: .8125rem; line-height: 1.4; font-weight: 550; }
.chapter__reward span { display: block; font: 500 .625rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); margin-bottom: 5px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.chapters__after { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; margin-top: 12px; }
.after-node { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: 16px; border: 1.5px dashed var(--line-2); }
.after-node--accent { border: 1.5px solid var(--ink); background: var(--ink); color: var(--bg); }
.after-node__k { font: 500 .625rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.after-node strong { font-size: 1.0625rem; }
.after-node span:last-child { font-size: .875rem; opacity: .8; line-height: 1.45; }
.after-arrow { display: grid; place-items: center; color: var(--muted); }
@media (max-width: 1000px) {
  .chapters { grid-template-columns: 1fr; gap: 10px; padding-left: 22px; position: relative; }
  .chapters::before { content: ''; position: absolute; left: 6px; top: 20px; bottom: 20px; width: 2px; background: var(--line-2); }
  .chapter::before { content: ''; position: absolute; left: -22px; top: 22px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); }
  .chapter:not(:last-child)::after { display: none; }
  .chapter__reward { margin-top: 10px; }
  .chapters__after { grid-template-columns: 1fr; }
  .after-arrow { transform: rotate(90deg); }
}

/* Concept families (C2-VZ01) */
.families { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.family { display: flex; flex-direction: column; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.family__visual { border-bottom: 1px solid var(--line); background: #fff; }
.family__visual img { width: 100%; aspect-ratio: 5/3; object-fit: cover; }
.schematic { position: relative; padding: 14px 12px 10px; }
.schematic svg { width: 100%; height: auto; overflow: visible; }
.schematic__label { display: block; margin-top: 8px; font: 400 .625rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.family__body { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.family__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.family__title { font-size: 1.0625rem; margin-top: 4px; }
.family__mech { font: 500 .75rem/1.3 var(--f-mono); color: var(--accent-ink); text-transform: uppercase; letter-spacing: .04em; }
.family__desc { font-size: .875rem; line-height: 1.5; color: var(--ink-2); }
.s-cell rect, .s-slot { fill: none; stroke: var(--line-2); stroke-width: 1.2; }
.s-slot.is-open { fill: var(--ink); stroke: var(--ink); }
.s-fill { fill: var(--ink); }
.s-acc circle, .s-acc { fill: var(--accent); }
.s-enemy { fill: var(--ink-2); }
.s-dash { stroke: var(--line-2); stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; }
.s-line { stroke: var(--ink-2); stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.s-card rect { fill: #fff; stroke: var(--ink-2); stroke-width: 1.4; }
.s-card rect.is-on { fill: var(--accent-soft); stroke: var(--accent); }
.s-block rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.6; }
.s-t { font: 500 9px var(--f-mono); fill: var(--muted); }
.s-fill + .s-t, text.s-t[x='25'] { fill: #fff; }
.s-on text { fill: #fff; font-weight: 700; }
@media (max-width: 1100px) { .families { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .families { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .families { grid-template-columns: 1fr; } .family { flex-direction: row; } .family__visual { width: 42%; flex: none; border-bottom: 0; border-right: 1px solid var(--line); display: flex; align-items: center; } .schematic { padding: 10px 8px; } .schematic__label { font-size: .5625rem; } }

/* Pipeline (C2-MT01) */
.pipeline { list-style: none; display: flex; align-items: stretch; gap: 8px; }
.pipe { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.pipe strong { font-size: 1rem; line-height: 1.25; }
.pipe span:not(.pipe__n) { font-size: .8125rem; color: var(--ink-2); line-height: 1.45; }
.pipe__n { align-self: flex-start; font: 500 .6875rem/1 var(--f-mono); padding: 4px 7px; border-radius: 6px; background: var(--ink); color: var(--bg); margin-bottom: 4px; }
.pipe--split { flex: 1.6; flex-direction: row; gap: 10px; padding: 10px; background: transparent; border-style: dashed; }
.pipe--split > div { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.pipe--split em { margin-top: auto; padding-top: 8px; font: 500 .625rem/1 var(--f-mono); font-style: normal; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); }
.pipe--accent { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pipe--accent span:not(.pipe__n) { color: #c9c8c2; }
.pipe--accent .pipe__n { background: var(--accent); color: var(--ink); }
.pipe__arrow { display: grid; place-items: center; color: var(--muted); }
@media (max-width: 960px) {
  .pipeline { flex-direction: column; }
  .pipe__arrow { transform: rotate(90deg); }
}
@media (max-width: 480px) { .pipe--split { flex-direction: column; } }

/* Observations (C2-DG01) */
.obs { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.obs__card { display: flex; flex-direction: column; padding: 18px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.obs__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.obs__n { font: 500 .8125rem/1 var(--f-mono); color: var(--muted); }
.obs dl { margin: 0; display: flex; flex-direction: column; flex: 1; }
.obs dl > div { padding: 10px 0; border-top: 1px solid var(--line); }
.obs dt { font: 500 .625rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.obs dd { margin: 0; font-size: .875rem; line-height: 1.45; color: var(--ink-2); }
.obs__dec { margin-top: auto; border-top: 0 !important; padding: 12px 14px !important; border-radius: 12px; background: var(--ink); }
.obs__dec dt { color: var(--accent); }
.obs__dec dd { color: var(--bg); font-weight: 650; font-size: .9375rem; font-family: var(--f-display); }
@media (max-width: 1100px) { .obs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .obs { grid-template-columns: 1fr; } }

/* Systems map (C2-DG02) */
.sysmap { display: grid; grid-template-columns: 1fr 1.25fr; gap: 16px; }
.sysmap__panel { padding: 20px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.sysmap__k { font: 500 .6875rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); margin-bottom: 16px; }
.sysmap__inputs { list-style: none; display: grid; gap: 8px; }
.sysmap__inputs li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-size: .9375rem; font-weight: 550; }
.sysmap__merge { display: grid; place-items: center; padding: 8px 0; color: var(--muted); transform: rotate(90deg); }
.sysmap__core { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 12px; background: var(--ink); color: var(--bg); }
.sysmap__core strong { font-size: 1.0625rem; }
.sysmap__core span { font-size: .8125rem; color: #c9c8c2; line-height: 1.45; }
.loop { list-style: none; display: grid; gap: 8px; position: relative; }
.loop__step { display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.loop__step strong { font-size: .9688rem; align-self: center; }
.loop__step span:last-child { grid-column: 2; font-size: .8125rem; color: var(--ink-2); line-height: 1.45; margin-top: 2px; }
.loop__n { grid-row: span 2; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--ink); font: 500 .8125rem/1 var(--f-mono); }
.loop__step:last-child .loop__n { background: var(--accent); border-color: var(--accent); }
.loop__back { margin-top: 12px; display: flex; gap: 10px; align-items: flex-start; font: 400 .8125rem/1.45 var(--f-mono); color: var(--ink-2); }
.loop__back span { font-size: 1.25rem; line-height: 1; color: var(--accent-ink); }
@media (max-width: 860px) { .sysmap { grid-template-columns: 1fr; } }

/* Media: shots, galleries, placeholders */
.shot { margin: 0; }
.shot img { width: 100%; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); }
.shot figcaption { margin-top: 10px; font-family: var(--f-display); font-size: .8125rem; line-height: 1.45; color: var(--muted); }
.shot--hero img { border-radius: 22px; aspect-ratio: 16/9; object-fit: cover; }
.ph {
  position: relative; aspect-ratio: var(--ratio); width: 100%; display: grid; place-items: center; text-align: center;
  border-radius: 16px; border: 1.5px dashed var(--line-2); overflow: hidden;
  background: repeating-linear-gradient(-45deg, var(--surface) 0 12px, var(--surface-2) 12px 13px);
}
.shot--hero .ph { border-radius: 22px; }
.ph__inner { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 34ch; padding: 16px; font-family: var(--f-display); }
.ph__id { font: 600 .75rem/1 var(--f-mono); padding: 5px 9px; border-radius: 6px; background: var(--ink); color: var(--bg); }
.ph__status { font: 500 .625rem/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); }
.ph__what { font-size: .875rem; line-height: 1.4; color: var(--ink-2); }
.ph__file { font: 400 .6875rem/1.3 var(--f-mono); color: var(--muted); word-break: break-all; }
.about__photo.ph { border-radius: 22px; }

.gallery__k { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font: 500 .75rem/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 16px; }
.gallery { --w: min(920px, calc(100vw - 2 * var(--pad))); }
.gallery__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gallery--two { --w: min(680px, calc(100vw - 2 * var(--pad))); }
.gallery--two .gallery__grid { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) { .gallery__grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
@media (max-width: 420px) { .gallery__grid .ph__what, .gallery__grid .ph__file { font-size: .6875rem; } .gallery__grid .ph__inner { padding: 10px; gap: 6px; } }

.annotated { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: clamp(20px, 4vw, 40px); align-items: center; padding: clamp(18px, 3vw, 32px); border-radius: 22px; background: var(--surface); border: 1px solid var(--line); font-family: var(--f-display); }
.annotated .fig__title { margin-top: 6px; }
.callouts { list-style: none; margin-top: 18px; display: grid; gap: 12px; }
.callouts li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; font-size: .9375rem; line-height: 1.45; color: var(--ink-2); }
.callouts span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--ink); font: 600 .8125rem/1 var(--f-mono); }
@media (max-width: 640px) { .annotated { grid-template-columns: 1fr; } .annotated .shot { max-width: 280px; } }

.video video { width: 100%; border-radius: 18px; background: #000; }

/* Next case */
.next-case { max-width: calc(var(--wide) + 2 * var(--pad)); padding-bottom: clamp(56px, 8vw, 96px); }
.next-case__card {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; align-items: center; padding: clamp(24px, 4vw, 44px);
  border-radius: 24px; background: var(--dark); color: var(--dark-text); text-decoration: none;
  transition: transform .4s var(--ease);
}
.next-case__card:hover { transform: translateY(-4px); }
.next-case__k { font: 500 .75rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.next-case__title { grid-column: 1; font-size: clamp(1.375rem, 3vw, 2.25rem); font-weight: 650; letter-spacing: -.03em; line-height: 1.12; }
.next-case__go { grid-row: 1 / span 2; grid-column: 2; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--ink); font-size: 1.5rem; transition: transform .3s var(--ease); }
.next-case__card:hover .next-case__go { transform: translateX(6px); }
.next-case__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 20px; }
.next-case__contact { font-size: .9375rem; color: var(--muted); }
.next-case__contact a { color: var(--ink); font-weight: 600; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* 404 */
.notfound { min-height: 80vh; display: grid; align-items: center; padding-top: var(--header-h); }
.notfound__title { margin: 16px 0 20px; font-size: clamp(2.75rem, 8vw, 6rem); letter-spacing: -.045em; line-height: .95; }
.notfound p:not(.kicker) { color: var(--muted); font-size: 1.125rem; }

/* Reveal animation */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .case-nav, .progress, .menu-toggle, .next-case__card { display: none !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  body { background: #fff; }
}
