/* Single-glyph subset (青) so the nav mark renders identically on every
   OS, instead of falling back to whatever CJK font the system picks. */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@900&text=%E9%9D%92&display=swap');

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Dark mode tokens (default) ────────────────────────────────────── */
:root {
  --ink:       #F8F8F8;
  --ink-soft:  #B5B5B5;
  --ink-mute:  #6E6E6E;
  --ink-ghost: #3A3A3A;

  --surface:   #0F0F0F;
  --surface-1: #191919;
  --surface-2: #222222;
  --surface-3: #2A2A2A;
  --surface-4: #313131;

  --border:      #1F1F1F;
  --border-mid:  #2A2A2A;
  --border-soft: rgba(255,255,255,0.06);

  --nav-bg:        rgba(15,15,15,0.72);
  --glyph-color:   white;
  --grain-opacity: 0.035;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Geist', -apple-system, sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, monospace;

  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);

  --surface-inset: rgba(255, 255, 255, 0.04);
  --border-dashed: rgba(255, 255, 255, 0.10);

  --tok-key:  #7FB5FF;
  --tok-str:  #FFA07A;
  --tok-kw:   #C586C0;
  --tok-type: #4EC9B0;
  --tok-com:  #6A9955;
  --tok-fn:   #DCDCAA;
  --tok-num:  var(--brand);
  --code-kw:  #A8C4E0;
  --code-str: #C8D89E;
}

/* ── Light mode tokens ──────────────────────────────────────────────── */
[data-theme="light"] {
  --ink:       #0A0A0A;
  --ink-soft:  #444444;
  --ink-mute:  #6B6B6B;
  --ink-ghost: #757575;

  --surface:   #F7F7F7;
  --surface-1: #EFEFEF;
  --surface-2: #E5E5E5;
  --surface-3: #DADADA;
  --surface-4: #CFCFCF;

  --border:      #E0E0E0;
  --border-mid:  #D5D5D5;
  --border-soft: rgba(0,0,0,0.07);

  --nav-bg:        rgba(247,247,247,0.85);
  --glyph-color:   black;
  --grain-opacity: 0.02;

  --surface-inset: rgba(0, 0, 0, 0.03);
  --border-dashed: rgba(0, 0, 0, 0.12);

  --tok-key:  #0550AE;
  --tok-str:  #953800;
  --tok-kw:   #AF00DB;
  --tok-type: #007366;
  --tok-com:  #516918;
  --tok-fn:   #795E26;
  --code-kw:  #0550AE;
  --code-str: #0A6E0A;
}

/* ── Base ───────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Grain ──────────────────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: var(--grain-opacity);
  pointer-events: none;
  z-index: 1000;
}

/* ── Progress bar ───────────────────────────────────────────────────── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--brand), color-mix(in oklch, var(--brand) 50%, white));
  z-index: 999;
  transition: width 0.1s linear;
}

/* ── SVG utility ────────────────────────────────────────────────────── */
.svg-icon { display: inline-block; flex-shrink: 0; }

/* ── Case study images ──────────────────────────────────────────────── */
.cs-img { width: 100%; height: auto; display: block; }
.cs-video { width: 100%; height: auto; display: block; }

/* ── Code syntax tokens ───────────────────────────────────────────── */
.tok-key  { color: var(--tok-key); }
.tok-str  { color: var(--tok-str); }
.tok-num  { color: var(--tok-num); }
.tok-kw   { color: var(--tok-kw); }
.tok-type { color: var(--tok-type); }
.tok-com  { color: var(--tok-com); }
.tok-fn   { color: var(--tok-fn); }
.code-note .comment,
.code-note .tok-com { color: var(--tok-com); }
.code-note .value   { color: var(--brand); }
.code-note .kw      { color: var(--code-kw); }
.code-note .str     { color: var(--code-str); }

/* ── Nav ────────────────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-soft);
}
.nav-start {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.nav-back {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-mute);
  text-decoration: none;
  padding: 0.25rem;
  margin-left: -0.25rem;
  transition: color 0.2s;
  flex-shrink: 0;
}
.nav-back:hover { color: var(--ink); }
.nav-divider {
  width: 1px;
  height: 1.125rem;
  background: var(--border);
  flex-shrink: 0;
}
.nav-mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}
/* Fixed stack (not --font-display): the display fonts are Latin-only and
   each case study overrides the variable, so 青 would fall back to a
   different system CJK font per page — and italic would be synthesized. */
.nav-glyph {
  font-family: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  font-size: 1.375rem;
  font-weight: 900;
  font-style: normal;
  color: var(--brand);
  line-height: 1;
  transition: color 0.35s ease;
}
.nav-mark-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav-icon {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 0.375rem;
}
.nav-icon-light { display: none; }
[data-theme="light"] .nav-icon-dark { display: none; }
[data-theme="light"] .nav-icon-light { display: block; }
/* Scoped as `nav > .nav-links` so page-embedded design-system styles
   (e.g. mom.css on the MooooM case study, which has its own .nav-links
   component) can't override the site header */
nav > .nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  /* True center of the header, independent of the widths of the
     logo (left) and controls (right) that space-between flanks it with */
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.nav-links a {
  font-size: 0.8125rem;
  color: var(--ink-mute);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--ink); }
.nav-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-border);
  transition: color 0.35s ease, background 0.35s ease, border-color 0.35s ease;
}

/* ── Theme toggle button ────────────────────────────────────────────── */
.nav-theme-btn {
  background: none;
  border: none;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  flex-shrink: 0;
}
.nav-theme-btn:hover { color: var(--ink); }
/* dark → show sun (click to go light); light → show moon (click to go dark) */
.icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ── Layout ─────────────────────────────────────────────────────────── */
.wrap      { max-width: 760px;  margin: 0 auto; padding: 0 2rem; }
.wrap-wide { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

/* ── Section utilities ──────────────────────────────────────────────── */
.section-gap { padding: 7rem 0; }
.section-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  margin-bottom: 3rem;
}

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 6rem;
  padding-top: 8rem;
  position: relative;
  overflow: hidden;
  text-align: left;
}
.hero-overline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: color 0.35s ease;
}
.hero-overline::before {
  content: '';
  display: block;
  width: 2rem;
  height: 1px;
  background: var(--brand);
  opacity: 0.6;
  transition: background 0.35s ease;
}
.hero-headline {
  font-family: var(--font-display);
  /* One size for every case study; --hero-scale is a per-case optical
     correction for display faces that render larger at equal rem
     (set alongside --font-display in the case's styles.css) */
  font-size: calc(clamp(2.5rem, 6.5vw, 4rem) * var(--hero-scale, 1));
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 2rem;
}
.hero-headline em { font-style: italic; color: var(--ink-soft); }
.hero-sub {
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 3.5rem;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.hero-meta-item {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--ink-ghost);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
a.hero-meta-item {
  color: var(--ink-mute);
  text-decoration: none;
  transition: color 0.2s ease;
}
a.hero-meta-item:hover {
  color: var(--brand);
}
.hero-meta-sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--border-mid);
}
.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-ghost);
  animation: scrollBounce 2.4s ease-in-out infinite;
  transition: opacity 0.3s ease;
}
.hero-scroll-hint span {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
@keyframes scrollBounce {
  0%, 100% { opacity: 0.3; transform: translateX(-50%) translateY(0); }
  50%       { opacity: 0.6; transform: translateX(-50%) translateY(6px); }
}

/* ── Reveal ─────────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ── Hero entrance ──────────────────────────────────────────────────────
   Hero content cascades in on load. Held at frame 0 while html has the
   fonts-loading class (set inline in each page head, removed when
   document.fonts.ready resolves, 2s safety timeout) so the headline never
   flashes in a fallback face before animating in. */
@keyframes heroRise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.hero .wrap > * { animation: heroRise 0.7s var(--ease-out) both; }
.hero .wrap > :nth-child(2) { animation-delay: 0.08s; }
.hero .wrap > :nth-child(3) { animation-delay: 0.16s; }
.hero .wrap > :nth-child(n+4) { animation-delay: 0.24s; }
html.fonts-loading .hero .wrap > * { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .hero .wrap > * { animation-name: heroFade; }
}

/* ── Metrics ────────────────────────────────────────────────────────── */
.metrics { padding: 6rem 0; }
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
}
.metric-card {
  background: var(--surface-1);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: background 0.3s;
}
.metric-card:hover { background: var(--surface-2); }
.metric-value {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 300;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.metric-value sup {
  font-size: 0.45em;
  font-weight: 400;
  color: var(--brand);
  vertical-align: super;
  transition: color 0.35s ease;
}
.metric-label {
  font-size: 0.8125rem;
  color: var(--ink-mute);
  letter-spacing: 0.01em;
  line-height: 1.4;
}
.metric-note {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--ink-ghost);
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

/* ── Spacers ────────────────────────────────────────────────────────── */
.spacer    { height: 3rem; }
.spacer-lg { height: 4rem; }

/* ── Footer base ────────────────────────────────────────────────────── */
footer { padding: 4rem 0 3rem; }
.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}
.footer-note {
  font-size: 0.875rem;
  color: var(--ink-ghost);
  max-width: 300px;
  line-height: 1.6;
}
.footer-nav {
  display: flex;
  gap: 3rem;
  padding-top: 0.5rem;
}
.footer-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
}
.footer-nav-next { text-align: right; }
.footer-nav-dir {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-ghost);
}
.footer-nav-name {
  font-size: 0.875rem;
  color: var(--ink-mute);
  transition: color 0.2s;
}
.footer-nav-link:hover .footer-nav-name { color: var(--ink); }
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--ink-ghost);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  nav { padding: 1rem 1.25rem; }
  nav > .nav-links { display: none; }
  .wrap, .wrap-wide { padding: 0 1.25rem; }
  .section-gap { padding: 4.5rem 0; }
}

/* ── Chapter layout ──────────────────────────────────────────────────── */
.chapter { padding: 7.5rem 0; }
.chapter-header { margin-bottom: 4rem; }
.chapter-num {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  margin-bottom: 1rem;
}
.chapter-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.chapter-title em { font-style: italic; color: var(--ink-soft); }

/* ── Body copy ───────────────────────────────────────────────────────── */
.body-copy {
  font-size: 1.0625rem;
  font-weight: 300;
  color: var(--ink-soft);
  line-height: 1.8;
  margin-bottom: 1.75rem;
  max-width: 66ch; /* reading measure; the wrap is wider than comfortable prose */
}
.body-copy + .body-copy { margin-top: 0; }
.body-copy strong { font-weight: 500; color: var(--ink); }

/* ── Pull quote ──────────────────────────────────────────────────────── */
.pull-quote {
  border-left: 2px solid var(--brand);
  padding: 1.5rem 2.25rem;
  margin: 3.5rem 0;
  transition: border-color 0.35s ease;
}
.pull-quote p {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 300;
  font-style: italic;
  color: var(--ink);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* ── Code note ───────────────────────────────────────────────────────── */
.code-note {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 2rem 0;
}
.code-note-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.code-note-lang {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.code-note-tag {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--brand);
  letter-spacing: 0.06em;
  transition: color 0.35s ease;
}
.code-note pre {
  padding: 1.5rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--ink-soft);
  overflow-x: auto;
  white-space: pre;
}

/* ── Figma placeholder ───────────────────────────────────────────────── */
.figma-placeholder {
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  margin: 2.5rem 0;
  background: var(--surface-1);
}
.figma-placeholder-tag {
  display: block;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.figma-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 2rem;
  min-height: 220px;
  color: var(--ink-ghost);
}
.figma-placeholder-icon { opacity: 0.3; }
.figma-placeholder-label {
  font-size: 0.875rem;
  color: var(--ink-mute);
  text-align: center;
  font-weight: 500;
}
.figma-placeholder-desc {
  font-size: 0.8125rem;
  color: var(--ink-ghost);
  text-align: center;
  max-width: 400px;
  line-height: 1.5;
}

/* ── Brand button ────────────────────────────────────────────────────── */
.btn-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 2rem;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  color: var(--brand);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.35s ease;
}
.btn-brand:hover {
  background: var(--brand-soft-hover);
  border-color: var(--brand-border-hover);
}
.btn-brand svg { flex-shrink: 0; }

/* ── Exec summary ────────────────────────────────────────────────────── */
.exec-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
}
.exec-cell {
  background: var(--surface-1);
  padding: 2.25rem 2rem;
}
.exec-label {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  margin-bottom: 0.875rem;
}
.exec-text {
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--ink-mute);
}
.exec-text strong { font-weight: 500; color: var(--ink); }

/* ── Hero background glyph ───────────────────────────────────────────── */
.hero-bg-glyph {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -52%);
  font-family: var(--font-display);
  font-size: clamp(300px, 45vw, 600px);
  font-weight: 500;
  font-style: italic;
  color: var(--glyph-color);
  opacity: 0.022;
  pointer-events: none;
  line-height: 1;
  user-select: none;
}
.hero-bg-svg {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -52%);
  width: clamp(280px, 38vw, 520px);
  color: var(--glyph-color);
  opacity: 0.03;
  pointer-events: none;
  user-select: none;
}
.hero-bg-svg svg { display: block; width: 100%; height: auto; }

/* ── Chip grid ───────────────────────────────────────────────────────── */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}
.chip {
  font-size: 0.8125rem;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  border: 1px solid var(--border-mid);
  color: var(--ink-mute);
  white-space: nowrap;
}
.chip.highlight {
  background: var(--brand-soft);
  border-color: var(--brand-border);
  color: var(--brand);
  transition: background 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

/* ── Theme switcher ──────────────────────────────────────────────────── */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}
.ts-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  margin-right: 0.25rem;
}
.ts-chip {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  border: 1px solid var(--border-mid);
  background: transparent;
  color: var(--ink-mute);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ts-chip-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ts-chip:hover { border-color: var(--border-soft); color: var(--ink-soft); }
.ts-chip.active {
  background: var(--brand-soft);
  border-color: var(--brand-border);
  color: var(--brand);
}

/* ── Stack cards ─────────────────────────────────────────────────────── */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 2rem 0;
}
.stack-card {
  background: var(--surface-1);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: background 0.25s;
}
.stack-card:hover { background: var(--surface-2); }
.stack-card-icon { color: var(--brand); margin-bottom: 0.25rem; transition: color 0.35s ease; }
.stack-card-title { font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.stack-card-desc  { font-size: 0.8125rem; color: var(--ink-mute); line-height: 1.5; }
.stack-card-tag {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.08em;
  color: var(--ink-ghost);
  margin-top: 0.25rem;
}

/* ── Compare grid ────────────────────────────────────────────────────── */
.compare-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 2rem 0;
}
.compare-cell {
  background: var(--surface-1);
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
}
.compare-cell.head {
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  padding: 0.75rem 1.25rem;
}
.compare-cell.feature { font-weight: 500; color: var(--ink-soft); }
.compare-cell.yes { color: var(--brand); transition: color 0.35s ease; }
.compare-cell.no  { color: var(--ink-ghost); }
@media (max-width: 768px) {
  .compare-grid {
    overflow-x: auto;
    grid-template-columns: minmax(10rem, 1.5fr) minmax(7rem, 1fr) minmax(7rem, 1fr);
  }
}

/* ── Footer icon ─────────────────────────────────────────────────────── */
.footer-icon {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}
.footer-icon-light { display: none; }
[data-theme="light"] .footer-icon-dark { display: none; }
[data-theme="light"] .footer-icon-light { display: block; }
