/* =========================================================
   PWN-ALL — styles.css
   Editorial / bento aesthetic · 2025–2026
   Warm cream canvas, sharp ink typography, indigo + rust accents.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Canvas */
  --bg:        #fbfbfc;       /* cool near-white */
  --bg-2:      #f0f1f3;       /* slightly deeper */
  --card:      #ffffff;       /* card surface */
  --card-2:    #f0f1f3;       /* softer card */
  --ink:       #15171c;       /* near-black */
  --ink-2:     #3a4048;
  --muted:     #565b62;
  --subtle:    #6a7077;       /* faint muted */
  --line:      #e2e8f1;       /* hairline */
  --line-2:    #d4dce8;

  /* Brand accents — cool slate, desaturated */
  --rust:      #5b6470;       /* signature (warm-neutral slate) */
  --rust-ink:  #475569;
  --rust-soft: #eef0f3;

  --py:        #475569;       /* cooler slate */
  --py-ink:    #3a4656;
  --py-soft:   #eceff4;

  --good:      #4f6b5d;
  --bad:       #b3303f;

  /* Industry accent tints for downtime cards */
  --accent-a:  #5b6470;   /* auto / manufacturing (warm-neutral slate) */
  --accent-b:  #475569;   /* finance / retail (cooler slate) */

  /* Soft gradient tints used on language + destination cards */
  --lang-rust-tint: #f3f4f6;
  --lang-py-tint:   #eceff4;

  /* Ambient orb colours */
  --orb-a: #c2c8d2;
  --orb-b: #ccd2dc;
  --orb-c: #d2d7df;

  /* Type */
  --f-display: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-sans:    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-mono:    ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;

  /* Rhythm */
  --wrap: 1280px;
  --gutter: clamp(20px, 4vw, 48px);
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;

  /* Motion */
  --ease:   cubic-bezier(.2,.7,.2,1);
  --spring: cubic-bezier(.34,1.56,.64,1);

  /* Elevation — soft paper shadows */
  --sh-1: 0 1px 2px rgba(21,23,28,.04), 0 2px 6px rgba(21,23,28,.04);
  --sh-2: 0 2px 6px rgba(21,23,28,.04), 0 10px 30px -8px rgba(21,23,28,.08);
  --sh-3: 0 4px 12px rgba(21,23,28,.06), 0 20px 60px -10px rgba(21,23,28,.12);
}

/* Dark theme — auto via OS preference. Same structure, re-toned. */
:root[data-theme="dark"] {
    --bg:        #16171a;
    --bg-2:      #1d1f23;
    --card:      #1d1f23;
    --card-2:    #25282e;
    --ink:       #e7e8ec;
    --ink-2:     #c4c8ce;
    --muted:     #9aa0aa;
    --subtle:    #9197a0;
    --line:      #2c2f36;
    --line-2:    #353941;

    --rust:      #9aa0aa;      /* cool slate, lighter for contrast on dark */
    --rust-ink:  #aab2bd;
    --rust-soft: #25282e;

    --py:        #aab2bd;
    --py-ink:    #c4c8ce;
    --py-soft:   #22262d;

    --good:      #8aa79a;
    --bad:       #e08a78;

    --accent-a:  #9aa0aa;
    --accent-b:  #aab2bd;

    --lang-rust-tint: #1d1f23;
    --lang-py-tint:   #22262d;

    --orb-a: #3a3e46;
    --orb-b: #383d47;
    --orb-c: #34383f;

    --sh-1: 0 1px 2px rgba(0,0,0,.4),  0 2px 8px rgba(0,0,0,.25);
    --sh-2: 0 2px 6px rgba(0,0,0,.35), 0 14px 36px -8px rgba(0,0,0,.45);
    --sh-3: 0 4px 14px rgba(0,0,0,.4), 0 24px 70px -12px rgba(0,0,0,.6);
}

/* No-JS fallback: honor the OS dark preference for the whole token set, not
   just the totem badge/CTA overrides below — otherwise a no-JS OS-dark visitor
   gets a light page with dark-flipped badge text (a contrast regression). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #16171a;
    --bg-2:      #1d1f23;
    --card:      #1d1f23;
    --card-2:    #25282e;
    --ink:       #e7e8ec;
    --ink-2:     #c4c8ce;
    --muted:     #9aa0aa;
    --subtle:    #9197a0;
    --line:      #2c2f36;
    --line-2:    #353941;

    --rust:      #9aa0aa;
    --rust-ink:  #aab2bd;
    --rust-soft: #25282e;

    --py:        #aab2bd;
    --py-ink:    #c4c8ce;
    --py-soft:   #22262d;

    --good:      #8aa79a;
    --bad:       #e08a78;

    --accent-a:  #9aa0aa;
    --accent-b:  #aab2bd;

    --lang-rust-tint: #1d1f23;
    --lang-py-tint:   #22262d;

    --orb-a: #3a3e46;
    --orb-b: #383d47;
    --orb-c: #34383f;

    --sh-1: 0 1px 2px rgba(0,0,0,.4),  0 2px 8px rgba(0,0,0,.25);
    --sh-2: 0 2px 6px rgba(0,0,0,.35), 0 14px 36px -8px rgba(0,0,0,.45);
    --sh-3: 0 4px 14px rgba(0,0,0,.4), 0 24px 70px -12px rgba(0,0,0,.6);
  }
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.55;
  position: relative;
  min-height: 100vh;
  font-feature-settings: "ss01", "cv11";
}

/* Clip overflow on the main wrapper so sticky stays working */
main { overflow-x: clip; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
  transition: color .2s var(--ease);
}
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

::selection { background: var(--ink); color: var(--bg); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  position: relative;
}

/* Accent text helpers */
.t-rust { color: var(--rust-ink); }
.t-py   { color: var(--py-ink); }


/* =========================================================
   AMBIENT BACKGROUND — soft moving orbs, NO grid
   ========================================================= */

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
  will-change: transform;
}
.orb-1 {
  width: 620px; height: 620px;
  top: -180px; left: -160px;
  background: radial-gradient(circle at 50% 50%, var(--orb-a) 0%, transparent 60%);
  animation: drift-1 28s ease-in-out infinite;
}
.orb-2 {
  width: 520px; height: 520px;
  top: 40vh; right: -200px;
  background: radial-gradient(circle at 50% 50%, var(--orb-b) 0%, transparent 60%);
  animation: drift-2 34s ease-in-out infinite;
}
.orb-3 {
  width: 480px; height: 480px;
  bottom: -180px; left: 30vw;
  background: radial-gradient(circle at 50% 50%, var(--orb-c) 0%, transparent 60%);
  animation: drift-3 40s ease-in-out infinite;
  opacity: .25;
}
@keyframes drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(80px, 60px) scale(1.1); }
}
@keyframes drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-60px, 40px) scale(1.15); }
}
@keyframes drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-50px, -40px) scale(1.05); }
}

/* Content above ambient */
main { position: relative; z-index: 1; }

/* Soften ambient orbs in dark mode — they read too hot on dark bg */
[data-theme="dark"] .orb-1 { opacity: .20; }
[data-theme="dark"] .orb-2 { opacity: .22; }
[data-theme="dark"] .orb-3 { opacity: .14; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 22px;
  color: var(--ink);
}
@media (max-width: 420px) {
  .brand { font-size: 19px; }
}


/* =========================================================
   SECTION HEADS
   ========================================================= */

section {
  padding-block: clamp(80px, 10vw, 140px);
}

.sec-head {
  margin-bottom: 64px;
  max-width: 900px;
}
.sec-head-left {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}
.sec-num {
  font-family: var(--f-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}
.sec-num::before {
  content: "§";
  color: var(--subtle);
  margin-right: 4px;
}
.sec-kicker {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: -0.01em;
  padding: 4px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.sec-title {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  letter-spacing: -0.035em;
  margin-bottom: 18px;
  line-height: 1;
}
.sec-lede {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  color: var(--muted);
  line-height: 1.55;
  max-width: 64ch;
}
.sec-lede em { font-style: normal; font-weight: 600; color: var(--ink); }


/* =========================================================
   HERO
   ========================================================= */

.eyebrow-dot {
  width: 8px; height: 8px;
  background: var(--good);
  border-radius: 50%;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 50%, transparent);
  animation: dot-pulse 2.2s var(--ease) infinite;
}
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 50%, transparent); }
  50%      { box-shadow: 0 0 0 8px color-mix(in srgb, var(--good) 0%, transparent); }
}

/* Visually hidden (screen-reader only) */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: all .2s var(--ease);
  cursor: pointer;
  font-family: var(--f-sans);
}
.btn-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .3s var(--ease);
}
.btn:hover .btn-arrow { transform: translateX(3px); }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--rust);
}
.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--ink);
  background: var(--card);
}
.btn-xl {
  padding: 16px 28px;
  font-size: 15px;
}

/* =========================================================
   TOTEM HERO — cinematic hero, theme-adaptive
   Uses the page's own CSS variables so it follows light/dark mode.
   ========================================================= */

.totem-hero {
  --th-py:          #475569;
  --th-py-glow:     rgba(71, 85, 105, 0.45);
  --th-py-dim:      rgba(71, 85, 105, 0.08);
  --th-py-border:   rgba(71, 85, 105, 0.28);
  --th-rust:        #5b6470;
  --th-rust-glow:   rgba(91, 100, 112, 0.45);
  --th-rust-dim:    rgba(91, 100, 112, 0.08);
  --th-rust-border: rgba(91, 100, 112, 0.28);

  background: var(--bg);
  color: var(--ink);
  padding-block: 0 !important;
  margin: 0;
  overflow: hidden;
  position: relative;
}

/* Three-column inner grid */
.totem-inner {
  display: grid;
  grid-template-columns: minmax(200px, 460px) minmax(380px, 460px) minmax(200px, 460px);
  max-width: 1380px;
  margin-inline: auto;
  min-height: calc(100svh - 72px);
}

/* ── Side columns ── */
.totem-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 44px 28px 32px;
  position: relative;
}
.totem-rust-side {
  align-items: flex-end;
}

/* Rust side — content on the right edge, mirroring snake on the left */
.totem-rust-side .totem-side-info { text-align: right; }
.totem-rust-side .totem-lang-badge { margin-left: auto; }

/* Info sits above the animal (z-index) */
.totem-side-info {
  position: relative;
  z-index: 1;
}

/* Animal images — absolute, same height so both appear equal size */
.totem-animal-img {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 64%;
  max-width: none;
  max-inline-size: none;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.35s ease;
}
.totem-snake-img {
  left: 41%;
  height: 57.6%;
  opacity: 0.35;
  aspect-ratio: 306.86 / 343.69;
  filter:
    drop-shadow(0 0 28px var(--th-py-glow))
    drop-shadow(0 0 60px rgba(71, 85, 105, 0.18));
}
.totem-crab-img {
  left: 59%;
  height: 52%;
  opacity: 0.35;
  aspect-ratio: 394.54 / 358.84;
  filter:
    drop-shadow(0 0 28px var(--th-rust-glow))
    drop-shadow(0 0 60px rgba(91, 100, 112, 0.18));
}
.totem-py-side:hover .totem-snake-img   { opacity: 0.9; }
.totem-rust-side:hover .totem-crab-img  { opacity: 0.9; }

/* Language badge */
.totem-lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
  width: fit-content;
}
.totem-py-badge {
  background: var(--th-py-dim);
  border: 1px solid var(--th-py-border);
  color: var(--th-py);
}
.totem-rust-badge {
  background: var(--th-rust-dim);
  border: 1px solid var(--th-rust-border);
  color: var(--th-rust);
}
/* Dark: badge text + primary-button text need light/dark flips for WCAG AA
   (--th-py/--th-rust slate too dark on the dark page; --rust button bg is light slate) */
:root[data-theme="dark"] .totem-py-badge,
:root[data-theme="dark"] .totem-rust-badge { color: #aab2bd; }
:root[data-theme="dark"] .totem-btn-primary { color: #15171c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .totem-py-badge,
  :root:not([data-theme="light"]) .totem-rust-badge { color: #aab2bd; }
  :root:not([data-theme="light"]) .totem-btn-primary { color: #15171c; }
}

.totem-lang-sub {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px 0;
}

/* ── Center column ── */
.totem-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  position: relative;
  z-index: 2;
  background: transparent;
}
.totem-center-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}


.totem-headline {
  font-family: var(--f-display);
  font-size: clamp(1.55rem, 2.3vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.06;
  color: var(--ink);
  text-transform: uppercase;
  margin: 0;
}
.totem-headline em {
  font-style: normal;
  color: var(--rust);
}

/* Choice cards */
.totem-choices {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.totem-or {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--subtle);
  flex-shrink: 0;
}

.totem-tagline {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
  max-width: 28ch;
}

/* CTAs */
.totem-ctas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.totem-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--rust);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 13px 20px;
  border-radius: 999px;
  transition: background .25s, box-shadow .25s, transform .25s;
}
.totem-btn-primary:hover {
  background: var(--rust-ink);
  box-shadow: 0 6px 28px color-mix(in srgb, var(--rust) 45%, transparent);
  transform: translateY(-2px);
  color: #fff;
}
.totem-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--line-2);
  transition: color .2s;
}
.totem-btn-ghost:hover { color: var(--ink); }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .totem-inner { grid-template-columns: minmax(200px, 380px) minmax(320px, 420px) minmax(200px, 380px); }
}
@media (max-width: 820px) {
  .totem-inner {
    --totem-side-track: 64px;
    grid-template-columns: var(--totem-side-track) minmax(0, 1fr) var(--totem-side-track);
    max-width: 100%;
    min-height: calc(100svh - 64px);
  }
  .totem-side {
    padding: 0;
    min-height: calc(100svh - 64px);
    overflow: visible;
    pointer-events: none;
    z-index: 1;
  }
  .totem-side-info {
    position: absolute;
    top: max(10px, calc(50svh - 35vw - 40px));
    z-index: 3;
    display: block;
    width: max-content;
    pointer-events: none;
  }
  .totem-py-side .totem-side-info {
    left: 0;
    transform: translateX(10px);
  }
  .totem-rust-side .totem-side-info {
    right: 0;
    transform: translateX(-10px);
  }
  .totem-lang-badge {
    margin-bottom: 0;
    padding: 7px 10px;
    font-size: 10px;
    letter-spacing: 0.1em;
    background: color-mix(in srgb, var(--card) 82%, transparent);
    -webkit-backdrop-filter: blur(10px) saturate(125%);
    backdrop-filter: blur(10px) saturate(125%);
  }
  .totem-lang-sub { display: none; }
  .totem-center {
    padding: 40px 20px;
    z-index: 2;
  }
  .totem-animal-img { top: 50svh; height: auto; }
  .totem-snake-img,
  .totem-crab-img {
    width: calc(60vw - 2px);
  }
}
@media (max-width: 480px) {
  .totem-inner { --totem-side-track: 44px; }
  .totem-headline { font-size: 1.55rem; }
}


/* =========================================================
   LANGUAGES
   ========================================================= */

.lang-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}
.lang {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px;
  box-shadow: var(--sh-1);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
  position: relative;
  overflow: hidden;
}
.lang:hover {
  box-shadow: var(--sh-2);
  transform: translateY(-2px);
}
.lang-rust-card {
  background: linear-gradient(180deg, var(--card) 0%, var(--lang-rust-tint) 100%);
}
.lang-py-card {
  background: linear-gradient(180deg, var(--card) 0%, var(--lang-py-tint) 100%);
}

.lang-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.lang-glyph {
  width: 72px; height: 72px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
}
.lang-glyph-rust { color: var(--rust); background: var(--rust-soft); }
.lang-glyph-py   { color: var(--py);   background: var(--py-soft); }

.lang-title-block { min-width: 0; }
.lang-eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: block;
  margin-bottom: 6px;
}
.lang-title {
  font-size: clamp(2rem, 3vw, 2.6rem);
  letter-spacing: -0.03em;
}
.lang-rust-card .lang-title { color: var(--rust-ink); }
.lang-py-card   .lang-title { color: var(--py-ink); }

.lang-score {
  text-align: right;
  line-height: 1;
}
.lang-score-v {
  font-family: var(--f-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  display: block;
  margin-bottom: 4px;
}
.lang-rust-card .lang-score-v { color: var(--rust-ink); }
.lang-py-card   .lang-score-v { color: var(--py-ink); }
.lang-score-k {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.lang-lede {
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 28px;
}
.lang-lede em { font-style: normal; color: var(--ink); font-weight: 600; }

.lang-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.lang-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.lang-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-2);
}
.lang-list li {
  padding-left: 22px;
  position: relative;
  line-height: 1.5;
}
.lang-list-plus li::before {
  content: "+";
  position: absolute; left: 0; top: 0;
  color: var(--good);
  font-weight: 700;
  font-size: 15px;
}
.lang-list-minus li::before {
  content: "−";
  position: absolute; left: 0; top: 0;
  color: var(--subtle);
  font-weight: 700;
  font-size: 15px;
}
.lang-list em { font-style: normal; font-weight: 600; color: var(--ink); }

.synergy-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 48px;
  padding: 20px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--sh-1);
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  font-weight: 500;
  color: var(--ink-2);
  text-align: center;
}
.synergy-piece strong { font-weight: 700; }
.synergy-piece-end { color: var(--ink); font-weight: 700; }
.synergy-sep {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--subtle);
  border-radius: 50%;
}

@media (max-width: 900px) {
  .lang-pair { grid-template-columns: 1fr; }
  .lang-body { grid-template-columns: 1fr; gap: 20px; }
  .lang-head { grid-template-columns: auto 1fr; }
  .lang-score { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; }
  .lang-score-v { margin: 0; font-size: 1.5rem; }
}


/* =========================================================
   MIGRATIONS
   ========================================================= */

.mig-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.mig-source {
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--card);
  box-shadow: var(--sh-1);
  transition: all .2s var(--ease);
  letter-spacing: -0.01em;
}
.mig-source:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}
.mig-source.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  font-weight: 600;
}

.mig-board {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--card) 92%, var(--lang-rust-tint) 8%) 0%, transparent 46%),
    linear-gradient(180deg, transparent 58%, color-mix(in srgb, var(--card) 90%, var(--lang-py-tint) 10%) 100%),
    var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2);
  padding: clamp(22px, 3vw, 34px);
}
.mig-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.mig-board-title {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
}
.mig-board-sub {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
}
.mig-legend {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px 14px;
  min-width: min(100%, 440px);
  padding-top: 5px;
}
.mig-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.legend-line {
  width: 30px;
  height: 0;
  border-top: 3px solid currentColor;
  border-radius: 999px;
}
.legend-rust { color: var(--rust); }
.legend-python { color: var(--py); }
.legend-base {
  color: var(--muted);
  border-top-style: dashed;
}
.mig-charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.mig-chart-card {
  min-width: 0;
  background: color-mix(in srgb, var(--card) 88%, var(--bg) 12%);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  padding: 16px 16px 12px;
}
.mig-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.mig-chart-title {
  font-size: 15px;
  letter-spacing: -0.02em;
}
.mig-chart-direction {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mig-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}
.mig-grid-line {
  stroke: var(--line-2);
  stroke-width: 1;
}
.mig-axis-label,
.mig-tick-label {
  fill: var(--muted);
  font-family: var(--f-sans);
  font-size: 10px;
}
.mig-value-label {
  font-family: var(--f-sans);
  font-size: 10px;
  font-weight: 800;
  paint-order: stroke;
  stroke: var(--card);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.mig-series {
  fill: none;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mig-series-rust { stroke: var(--rust); }
.mig-series-python { stroke: var(--py); }
.mig-series-base {
  stroke: var(--muted);
  stroke-width: 2.2;
  stroke-dasharray: 6 5;
}
.mig-point {
  stroke: var(--card);
  stroke-width: 2;
}
.mig-point-rust { fill: var(--rust); }
.mig-point-python { fill: var(--py); }
.mig-point-base {
  fill: var(--muted);
  opacity: .75;
}
.mig-label-rust { fill: var(--rust-ink); }
.mig-label-python { fill: var(--py-ink); }
.mig-label-base { fill: var(--muted); }
.mig-factors {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.mig-factors-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.mig-factors-head h4 {
  font-size: 18px;
  letter-spacing: -0.02em;
}
.mig-factors-head p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  max-width: 58ch;
}
.mig-factor-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.mig-factor-card {
  min-width: 0;
  padding: 14px;
  background: color-mix(in srgb, var(--card) 84%, var(--bg) 16%);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
}
.mig-factor-card h5 {
  font-size: 13px;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.mig-factor-values {
  display: grid;
  gap: 7px;
}
.mig-factor-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
}
.mig-factor-value b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}
.mig-factor-value strong {
  font-family: var(--f-display);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.factor-rust strong { color: var(--rust-ink); }
.factor-python strong { color: var(--py-ink); }
.factor-base {
  color: var(--muted);
  border-style: dashed;
}
.mig-board-note {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.6;
}

.mig-method {
  margin-top: 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.mig-method summary {
  list-style: none;
  padding: 18px 22px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.mig-method summary::-webkit-details-marker { display: none; }
.method-toggle {
  width: 24px; height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  position: relative;
  transition: transform .3s var(--ease);
  flex-shrink: 0;
}
.method-toggle::before,
.method-toggle::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  background: var(--ink);
  border-radius: 1px;
  transition: transform .3s var(--ease);
}
.method-toggle::before { width: 10px; height: 1.5px; transform: translate(-50%, -50%); }
.method-toggle::after  { width: 1.5px; height: 10px; transform: translate(-50%, -50%); }
.mig-method[open] .method-toggle::after { transform: translate(-50%, -50%) scaleY(0); }
.mig-method p {
  padding: 0 22px 22px;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
}

@media (max-width: 1000px) {
  .mig-board-head { flex-direction: column; }
  .mig-legend { justify-content: flex-start; min-width: 0; }
  .mig-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mig-factors-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .mig-factor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .mig-board { padding: 18px; }
  .mig-charts { grid-template-columns: 1fr; gap: 12px; }
  .mig-factor-grid { grid-template-columns: 1fr; }
  .mig-chart-card { padding: 14px 12px 10px; }
  .mig-chart-head { align-items: flex-start; }
  .mig-chart-title { font-size: 14px; }
  .mig-chart-direction { font-size: 10px; }
}


/* =========================================================
   PERFORMANCE CHART
   ========================================================= */

.chart {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px;
  box-shadow: var(--sh-1);
}
.chart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}
.chart-row {
  display: grid;
  grid-template-columns: 24px 180px 1fr 150px;
  gap: 20px;
  align-items: center;
  font-size: 14px;
}
.chart-rank {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
}
.chart-label {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.chart-label .t-rust,
.chart-label .t-py { font-weight: 700; }
.chart-sub {
  font-weight: 400;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 12px;
}

.chart-track {
  position: relative;
  height: 32px;
  background: var(--bg-2);
  border-radius: 8px;
  overflow: hidden;
}
.chart-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  border-radius: 8px;
  transform-origin: left;
  animation: chart-grow 1.4s var(--ease) forwards;
  animation-play-state: paused;
  position: relative;
  overflow: hidden;
}
.chart-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,.25) 50%,
    transparent 100%
  );
  animation: chart-shimmer 2.4s ease-in-out infinite;
  animation-play-state: paused;
}
.chart.is-visible .chart-fill,
.chart.is-visible .chart-fill::after { animation-play-state: running; }

.chart-row.is-rust .chart-fill { background: var(--rust); }
.chart-row.is-py   .chart-fill { background: var(--py); }

.chart-100 .chart-fill { --pct: 100%; }
.chart-70  .chart-fill { --pct:  70%; }
.chart-44  .chart-fill { --pct:  44%; }
.chart-34  .chart-fill { --pct:  34%; }
.chart-17  .chart-fill { --pct:  17%; }
.chart-6   .chart-fill { --pct:   6%; }
.chart-3   .chart-fill { --pct:   3%; }

@keyframes chart-grow {
  from { width: 0; }
  to   { width: var(--pct, 50%); }
}
@keyframes chart-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.chart-row:nth-child(1) .chart-fill { animation-delay: 0s; }
.chart-row:nth-child(2) .chart-fill { animation-delay: .1s; }
.chart-row:nth-child(3) .chart-fill { animation-delay: .2s; }
.chart-row:nth-child(4) .chart-fill { animation-delay: .3s; }
.chart-row:nth-child(5) .chart-fill { animation-delay: .4s; }
.chart-row:nth-child(6) .chart-fill { animation-delay: .5s; }
.chart-row:nth-child(7) .chart-fill { animation-delay: .6s; }

.chart-val {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 15px;
  text-align: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.chart-val small {
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  font-family: var(--f-mono);
}

.perf-note {
  margin-top: 24px;
  padding: 20px 24px;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
  max-width: 72ch;
}
.perf-note em {
  font-style: normal;
  color: var(--ink);
  font-weight: 700;
}
.perf-note strong { color: var(--ink); }
.perf-src-link {
  color: var(--rust-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.perf-src-link:hover { color: var(--rust); }

@media (max-width: 720px) {
  .chart-row {
    grid-template-columns: 24px 1fr;
    grid-template-areas:
      "r l"
      ". t"
      ". v";
    gap: 8px 14px;
  }
  .chart-rank  { grid-area: r; }
  .chart-label { grid-area: l; }
  .chart-track { grid-area: t; }
  .chart-val   { grid-area: v; text-align: left; }
}


/* =========================================================
   DOWNTIME COST — industry stats
   ========================================================= */

.dt-ticker {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 22px 24px;
  box-shadow: var(--sh-1);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.dt-ticker::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg,
    transparent, var(--rust) 20%, var(--rust) 80%, transparent);
  animation: tick-shimmer 3s ease-in-out infinite;
}
@keyframes tick-shimmer {
  0%, 100% { opacity: .4; }
  50%      { opacity: 1; }
}

.dt-ticker-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.dt-ticker-dot {
  width: 8px; height: 8px;
  background: var(--rust);
  border-radius: 50%;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--rust) 45%, transparent);
  animation: dot-pulse 1.6s var(--ease) infinite;
}
.dt-ticker-k {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.dt-ticker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.dt-tick {
  background: var(--card-2);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dt-tick-lbl {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.dt-tick-val {
  font-family: var(--f-display);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--rust-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.dt-tick-rate {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 820px) {
  .dt-ticker-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 460px) {
  .dt-ticker-grid { grid-template-columns: 1fr; }
}

.dt-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-top: 28px;
}
.dt-card {
  grid-column: span 2;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 26px;
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
  position: relative;
  overflow: hidden;
}
.dt-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-2);
  border-color: color-mix(in srgb, var(--ink) 15%, var(--line));
}
.dt-card-xl {
  grid-column: span 6;
  background: linear-gradient(135deg, var(--card) 0%, var(--card-2) 100%);
}
.dt-card-xl::after {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, color-mix(in srgb, var(--rust) 20%, transparent), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.dt-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}
.dt-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}
.dt-hour {
  font-family: var(--f-display);
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--rust-ink);
  font-variant-numeric: tabular-nums;
}
.dt-hour small {
  font-size: 0.55em;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}
.dt-card-xl .dt-hour {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
}
.dt-copy {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
  flex: 1;
}
.dt-meter {
  height: 4px;
  background: var(--line-2);
  border-radius: 2px;
  overflow: hidden;
}
.dt-meter-fill {
  display: block;
  height: 100%;
  background: var(--rust);
  border-radius: 2px;
  transform-origin: left;
  transform: scaleX(0);
  animation: dt-grow 1.4s var(--ease) forwards;
  animation-play-state: paused;
}
.dt-grid.is-visible .dt-meter-fill { animation-play-state: running; }

@keyframes dt-grow {
  to { transform: scaleX(1); }
}
.dt-meter-100 { width: 100%; }
.dt-meter-80  { width:  80%; }
.dt-meter-46  { width:  46%; }
.dt-meter-28  { width:  28%; }
.dt-meter-6   { width:   6%; }
.dt-meter-3   { width:   3%; }
.dt-src {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.4;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

@media (max-width: 980px) {
  .dt-grid { grid-template-columns: repeat(4, 1fr); }
  .dt-card     { grid-column: span 2; }
  .dt-card-xl  { grid-column: span 4; }
}
@media (max-width: 640px) {
  .dt-grid { grid-template-columns: 1fr; }
  .dt-card, .dt-card-xl { grid-column: span 1; }
}

.dt-quote {
  margin-top: 32px;
  padding: 28px 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-1);
  max-width: 800px;
  position: relative;
}
.dt-quote::before {
  content: "\201C";
  position: absolute;
  top: 8px;
  left: 20px;
  font-family: var(--f-display);
  font-size: 4rem;
  color: var(--rust);
  line-height: 1;
  opacity: .4;
  font-weight: 800;
}
.dt-quote p {
  padding-left: 40px;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.6;
  color: var(--ink);
  font-weight: 500;
  margin: 0 0 14px 0;
}
.dt-quote cite {
  display: block;
  padding-left: 40px;
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* =========================================================
   CASE STUDIES
   ========================================================= */

.cases-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  counter-reset: case-counter;
}
.case {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 36px 40px;
  box-shadow: var(--sh-1);
  transition: box-shadow .3s var(--ease);
  position: relative;
  overflow: hidden;
}
.case:hover {
  box-shadow: var(--sh-2);
}
.case::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 4px; height: 0;
  background: var(--rust);
  transition: height .5s var(--ease);
}
.case:hover::before {
  height: 100%;
}

.case-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.case-num {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.case-num::before {
  content: "#";
  color: var(--subtle);
  margin-right: 2px;
}
.case-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.case-tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bg-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.case-tag-rust {
  background: var(--lang-rust-tint);
  color: var(--rust-ink);
  border-color: color-mix(in srgb, var(--rust) 30%, var(--line));
}
.case-tag-py {
  background: var(--lang-py-tint);
  color: var(--py-ink);
  border-color: color-mix(in srgb, var(--py) 30%, var(--line));
}

.case-body {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: start;
}

.case-summary { min-width: 0; }
.case-title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 18px;
  color: var(--ink);
}
.case-title em {
  font-style: normal;
  color: var(--rust-ink);
  font-weight: 700;
}
.case-brief {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.65;
  margin-bottom: 24px;
}
.case-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.case-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-2);
}
.case-list li {
  padding-left: 22px;
  position: relative;
  line-height: 1.55;
}
.case-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--rust);
  font-weight: 700;
}
.case-list code {
  font-family: var(--f-mono);
  font-size: 0.92em;
  padding: 1px 6px;
  background: var(--bg-2);
  border-radius: 4px;
  color: var(--ink);
}

.case-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 22px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.case-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--card);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  min-width: 0;
}
.case-metric-span { grid-column: span 2; }
.case-metric-k {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.case-metric-v {
  font-family: var(--f-display);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.case-metric-v-single {
  display: block;
}
.case-metric-from {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent);
  font-weight: 700;
}
.case-metric-arrow {
  color: var(--rust);
  font-weight: 500;
  font-size: 0.9em;
}
.case-metric-to {
  color: var(--ink);
}
.case-to-good {
  color: var(--good);
}
.case-metric-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 2px;
}

.case-outcome {
  margin-top: 28px;
  padding: 20px 24px;
  background: color-mix(in srgb, var(--rust) 4%, var(--card));
  border-left: 3px solid var(--rust);
  border-radius: var(--r-md);
  display: flex;
  gap: 18px;
  align-items: start;
}
.case-outcome-k {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--rust-ink);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-top: 2px;
  min-width: 72px;
}
.case-outcome p {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

@media (max-width: 900px) {
  .case { padding: 28px 24px; }
  .case-body { grid-template-columns: 1fr; gap: 28px; }
  .case-metrics { grid-template-columns: 1fr; }
  .case-metric-span { grid-column: span 1; }
  .case-outcome { flex-direction: column; gap: 8px; }
  .case-outcome-k { min-width: 0; }
}


/* =========================================================
   PROCESS LAB
   ========================================================= */

.lab {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}

.lab-controls {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--sh-1);
  position: sticky;
  top: 90px;
}
.lab-controls-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.lab-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.lab-reset {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 500;
  transition: all .2s var(--ease);
}
.lab-reset:hover { color: var(--ink); border-color: var(--ink); }

.dial-block {
  margin-bottom: 22px;
}
.dial-block label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  gap: 10px;
}
.dial-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.dial-val {
  font-family: var(--f-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--rust-ink);
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
  text-align: right;
  line-height: 1;
}

/* Modern slider */
.dial {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  background: transparent;
  outline: none;
  cursor: pointer;
  margin: 0;
  padding: 0;
}
/* Track */
.dial::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(to right,
    var(--ink) 0 var(--p, 50%),
    var(--line-2) var(--p, 50%) 100%);
  border-radius: 3px;
}
.dial::-moz-range-track {
  height: 6px;
  background: linear-gradient(to right,
    var(--ink) 0 var(--p, 50%),
    var(--line-2) var(--p, 50%) 100%);
  border-radius: 3px;
}
/* Thumb */
.dial::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--ink);
  margin-top: -7px;
  box-shadow: var(--sh-1);
  transition: transform .2s var(--spring), background .2s var(--ease);
  cursor: grab;
}
.dial::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: var(--sh-1);
  cursor: grab;
}
.dial:hover::-webkit-slider-thumb { transform: scale(1.15); background: var(--rust); border-color: var(--rust); }
.dial:hover::-moz-range-thumb     { background: var(--rust); border-color: var(--rust); }
.dial:active::-webkit-slider-thumb { cursor: grabbing; }

.dial-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 8px;
}

.lab-summary {
  margin-top: 4px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.lab-summary-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}
.lab-summary-list {
  display: grid;
  gap: 10px;
  margin: 0;
}
.lab-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.lab-summary-row:last-child { border-bottom: 0; padding-bottom: 0; }
.lab-summary-row dt {
  color: var(--muted);
  margin: 0;
  font-weight: 400;
}
.lab-summary-row dd {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  text-align: right;
  letter-spacing: -0.01em;
  transition: color .3s var(--ease);
}
.lab-summary-rec dd {
  color: var(--rust-ink);
}

/* Stages */
.lab-stages {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px;
  box-shadow: var(--sh-1);
}
.lab-stages-grid {
  display: grid;
  gap: 14px;
  position: relative;
}
.lab-stages-ruler {
  display: none; /* reserved for future numeric ruler */
}

.stage {
  padding: 20px 22px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: all .3s var(--ease);
  position: relative;
  overflow: hidden;
}
.stage::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--rust);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.stage.is-high {
  background: var(--card);
  border-color: var(--line-2);
  box-shadow: var(--sh-2);
  transform: translateX(4px);
}
.stage.is-high::before { opacity: 1; }
.stage.is-low { opacity: .9; }

.stage-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.stage-num {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--rust-ink);
  padding: 3px 9px;
  background: var(--rust-soft);
  border-radius: 999px;
  letter-spacing: 0;
}
.stage-name {
  font-size: 1.1rem;
  color: var(--ink);
  letter-spacing: -0.02em;
  flex: 1;
  font-weight: 700;
}
.stage-weeks {
  font-family: var(--f-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  transition: color .3s var(--ease);
}

.stage-track {
  height: 2px;
  background: var(--line-2);
  border-radius: 1px;
  margin-bottom: 12px;
  overflow: hidden;
}
.stage-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--ink);
  border-radius: 1px;
  transform-origin: left;
  transform: scaleX(var(--w, 1));
  transition: transform .5s var(--ease);
}
.stage.is-high .stage-fill { background: var(--rust); }

.stage-desc {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
  margin-bottom: 10px;
}
.stage-tasks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s var(--ease);
}
.stage:hover .stage-tasks,
.stage.is-high .stage-tasks { max-height: 200px; }
.stage-tasks li {
  font-size: 12px;
  color: var(--muted);
  padding-left: 18px;
  position: relative;
}
.stage-tasks li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--rust);
  font-weight: 600;
}

@media (max-width: 980px) {
  .lab { grid-template-columns: 1fr; }
  .lab-controls { position: static; }
}


/* =========================================================
   CODE FLIPPER
   ========================================================= */

.flip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.flip-switch {
  display: flex;
  padding: 6px;
  background: var(--card-2);
  border-bottom: 1px solid var(--line);
  position: relative;
  gap: 2px;
}
.flip-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color .3s var(--ease);
  position: relative;
  z-index: 1;
  letter-spacing: -0.01em;
  text-align: center;
}
.flip-btn.is-active { color: var(--bg); font-weight: 600; }
.flip-indicator {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: calc(50% - 7px);
  background: var(--py);
  border-radius: var(--r-md);
  transition: transform .4s var(--spring), background .4s var(--ease);
  z-index: 0;
  box-shadow: var(--sh-1);
}
.flip.is-rust .flip-indicator {
  transform: translateX(calc(100% + 2px));
  background: var(--rust);
}

.flip-stage {
  position: relative;
  min-height: 480px;
  background: #16171a;
  overflow: hidden;
}
.flip-code {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 28px 32px;
  font-family: var(--f-mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: #e7e8ec;
  overflow: auto;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
  white-space: pre;
  tab-size: 4;
}
.flip-code:not(.is-visible) {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}
.flip-code.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* Syntax colours on dark bg */
.k { color: #ff9d6b; }          /* keyword */
.t { color: #7fd7ff; }          /* type    */
.f { color: #c8b1ff; }          /* function name */
.s { color: #b5e88b; }          /* string  */
.a { color: #8a8a94; }          /* annotation */

.flip-stats {
  display: grid;
  /* minmax(0,1fr) lets columns shrink below their content so a long i18n label
     (e.g. hu "Áteresztőképesség") doesn't force the grid wider than the viewport */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}
.flip-stat {
  background: var(--card-2);
  padding: 18px 22px;
  min-width: 0;
}
.flip-stat-k {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
  overflow-wrap: break-word;
}
.flip-stat-pair {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  /* localized values like hu "21 030 kérelem/másodperc" are long — let them wrap/break
     instead of forcing the stat cell wider than the viewport */
  flex-wrap: wrap;
}
.flip-stat-py, .flip-stat-rs, .flip-stat-vs { min-width: 0; overflow-wrap: anywhere; }
.flip-stat-py  { color: var(--py-ink); font-size: 15px; }
.flip-stat-rs  { color: var(--rust-ink); font-size: 15px; }
.flip-stat-vs  { color: var(--subtle); font-size: 13px; font-weight: 400; }

@media (max-width: 720px) {
  .flip-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* =========================================================
   CTA
   ========================================================= */

.cta { padding-bottom: clamp(100px, 12vw, 180px); }

.cta-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(40px, 6vw, 80px);
  box-shadow: var(--sh-3);
  text-align: center;
  max-width: 980px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}
.cta-card::before {
  content: "";
  position: absolute;
  width: 380px; height: 380px;
  top: -140px; right: -140px;
  background: radial-gradient(circle, color-mix(in srgb, var(--rust) 18%, transparent), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.cta-card::after {
  content: "";
  position: absolute;
  width: 380px; height: 380px;
  bottom: -140px; left: -140px;
  background: radial-gradient(circle, color-mix(in srgb, var(--py) 16%, transparent), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.cta-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 8px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.cta-title {
  font-size: clamp(2.2rem, 6vw, 5rem);
  letter-spacing: -0.04em;
  margin-bottom: 20px;
  line-height: 1;
  position: relative;
  z-index: 1;
}
.cta-title em {
  font-style: normal;
  color: var(--rust-ink);
  position: relative;
  font-weight: 800;
}
.cta-title em::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.08em;
  height: 0.12em;
  background: var(--rust-soft);
  z-index: -1;
  border-radius: 2px;
}

.cta-sub {
  color: var(--muted);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  max-width: 56ch;
  margin: 0 auto 40px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.cta-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
}

.cta-promises {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 12px 28px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  position: relative;
  z-index: 1;
}
.cta-promises li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cta-promises li::before {
  content: "";
  width: 5px; height: 5px;
  background: var(--good);
  border-radius: 50%;
}


/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
