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

/* ---------- Tokens ---------- */
:root {
  /* Canvas */
  --bg:        #f5f2ea;       /* warm paper cream */
  --bg-2:      #efeadd;       /* slightly deeper */
  --card:      #ffffff;       /* card surface */
  --card-2:    #fbf8f1;       /* softer card */
  --ink:       #0e0e12;       /* near-black */
  --ink-2:     #2a2a32;
  --muted:     #6b6b74;
  --subtle:    #a8a59a;       /* paper-toned muted */
  --line:      #dcd6c4;       /* hairline, paper-toned */
  --line-2:    #e6e0ce;

  /* Brand accents */
  --rust:      #e8491d;       /* signature */
  --rust-ink:  #c63a14;
  --rust-soft: #ffe7dc;

  --py:        #4c5fd5;       /* indigo instead of yellow — reads serious */
  --py-ink:    #3a4bb8;
  --py-soft:   #e4e8ff;

  --good:      #2b7a4e;
  --bad:       #c23b3b;

  /* Industry accent tints for downtime cards */
  --accent-a:  #b5582c;   /* auto / manufacturing */
  --accent-b:  #2f6b8a;   /* finance / retail */

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

  /* Ambient orb colours */
  --orb-a: #ffb892;
  --orb-b: #c8d0ff;
  --orb-c: #ffd8b6;

  /* 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(14,14,18,.04), 0 2px 6px rgba(14,14,18,.04);
  --sh-2: 0 2px 6px rgba(14,14,18,.04), 0 10px 30px -8px rgba(14,14,18,.08);
  --sh-3: 0 4px 12px rgba(14,14,18,.06), 0 20px 60px -10px rgba(14,14,18,.12);
}

/* Dark theme — auto via OS preference. Same structure, re-toned. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0c0c10;
    --bg-2:      #14141a;
    --card:      #17171e;
    --card-2:    #1c1c24;
    --ink:       #f1f1f3;
    --ink-2:     #c4c4cc;
    --muted:     #8a8a94;
    --subtle:    #5c5c68;
    --line:      #262630;
    --line-2:    #313140;

    --rust:      #ff6a3c;      /* slightly brighter for contrast on dark */
    --rust-ink:  #ff8a5c;
    --rust-soft: #2a1610;

    --py:        #7a8dff;
    --py-ink:    #9aa9ff;
    --py-soft:   #191e38;

    --good:      #3ecb81;
    --bad:       #ff6b6b;

    --accent-a:  #ff9a5c;
    --accent-b:  #8ed0f0;

    --lang-rust-tint: #1c1410;
    --lang-py-tint:   #141628;

    --orb-a: #ff6a3c;
    --orb-b: #6a7cff;
    --orb-c: #ff9a5c;

    --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 */
.site-header, main, .site-footer { position: relative; z-index: 1; }

/* Soften ambient orbs in dark mode — they read too hot on dark bg */
@media (prefers-color-scheme: dark) {
  .orb-1 { opacity: .20; }
  .orb-2 { opacity: .22; }
  .orb-3 { opacity: .14; }
}


/* =========================================================
   HEADER
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
  border-bottom: 1px solid var(--line);
}
.header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.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);
}
.brand-mark {
  width: 28px; height: 28px;
  background: var(--ink);
  border-radius: 8px;
  position: relative;
  display: inline-block;
  overflow: hidden;
}
.brand-mark-o {
  position: absolute;
  inset: 4px;
  background: var(--rust);
  border-radius: 50%;
  transform-origin: center;
  animation: brand-spin 7s var(--ease) infinite;
}
@keyframes brand-spin {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(2px, -2px); }
  50%      { transform: translate(0, 0); }
  75%      { transform: translate(-2px, 2px); }
}
.brand-slash { color: var(--rust); }

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  font-weight: 500;
}
.nav a {
  color: var(--ink-2);
  position: relative;
  padding: 4px 10px;
  letter-spacing: -0.01em;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1.5px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }

.nav-pill {
  background: var(--ink);
  color: var(--bg) !important;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  transition: background .2s var(--ease), transform .2s var(--spring);
}
.nav-pill::after { display: none; }
.nav-pill:hover {
  background: var(--rust);
  transform: translateY(-1px);
}

@media (max-width: 820px) {
  .nav { gap: 10px; }
  .nav a:not(.nav-pill) { display: none; }
  .nav-pill {
    padding: 10px 14px;
    font-size: 13px;
  }
}
@media (max-width: 420px) {
  /* At phone width, collapse "Start a project ↗" to a compact label */
  .nav-pill .nav-pill-label { display: none; }
  .nav-pill {
    padding: 10px 14px;
    font-size: 14px;
  }
  .header-wrap { gap: 12px; }
  .brand { font-size: 19px; }
  .brand-mark { width: 26px; height: 26px; }
}


/* =========================================================
   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: italic; color: var(--ink); }


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

.hero {
  padding-block: clamp(40px, 8vw, 100px) clamp(60px, 8vw, 120px);
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 48px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 12px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}
.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); }
}
.eyebrow-meta {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
}

.hero-title {
  font-size: clamp(2.6rem, 7.5vw, 7.2rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.95;
  margin-bottom: 56px;
}
.hero-row {
  display: block;
  opacity: 0;
  transform: translateY(18px);
  animation: row-in 1s var(--ease) forwards;
}
.hero-row-1 { animation-delay: .05s; }
.hero-row-2 { animation-delay: .20s; }
.hero-row-3 { animation-delay: .35s; color: var(--muted); }

.hero-underline {
  position: relative;
  display: inline-block;
  padding: 0 0.08em;
  color: var(--ink);
}
.hero-underline::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.06em;
  height: 0.18em;
  background: var(--rust);
  z-index: -1;
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: left;
  animation: em-in 1s var(--ease) 1.1s forwards;
}
@keyframes row-in { to { opacity: 1; transform: none; } }
@keyframes em-in  { to { transform: scaleX(1); } }

/* 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;
}

/* Inline animated language swap chip inside hero title */
.hero-swap {
  display: inline-block;
  height: 0.82em;
  overflow: hidden;
  border-radius: 0.18em;
  vertical-align: baseline;
  line-height: 1;
  min-width: 3.2em;
  transform: translateY(0.05em);
  position: relative;
}
.swap-stack {
  display: flex;
  flex-direction: column;
  animation: swap-cycle 5s cubic-bezier(.75,.05,.25,1) infinite;
}
.swap-item {
  flex-shrink: 0;
  height: 0.82em;
  padding: 0 0.22em;
  display: flex;
  align-items: center;
  font-weight: 800;
  letter-spacing: -0.04em;
  white-space: nowrap;
  box-sizing: border-box;
  color: var(--bg);
}
.swap-rust { background: var(--rust); }
.swap-py   { background: var(--py);   color: var(--bg); }

@keyframes swap-cycle {
  0%, 38%   { transform: translateY(0); }
  50%, 88%  { transform: translateY(-0.82em); }
  100%      { transform: translateY(-1.64em); }
}

/* BENTO grid */
.hero-bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(140px, auto);
  gap: 14px;
}
.bento {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--sh-1);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
  opacity: 0;
  transform: translateY(16px);
  animation: row-in .8s var(--ease) .55s forwards;
  position: relative;
  overflow: hidden;
}
.bento:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-2);
  border-color: var(--line-2);
}

.bento-lede {
  grid-column: span 7;
  grid-row: span 2;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--ink-2);
  line-height: 1.5;
}
.bento-lede p { max-width: 42ch; }
.bento-lede strong { font-weight: 700; }

.hero-ctas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.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;
}

/* Stat cards */
.bento-stat {
  grid-column: span 5;
  grid-row: span 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
}
.bento-stat-1 { grid-column: 8 / span 5; grid-row: 1; }
.bento-stat-2 { grid-column: 8 / span 5; grid-row: 2; }
.bento-stat-3 { grid-column: 1 / span 4; grid-row: 3; }
.bento-stat-4 { grid-column: 5 / span 4; grid-row: 3; }

.stat-key {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.stat-val {
  font-family: var(--f-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  margin: 8px 0;
  font-variant-numeric: tabular-nums;
}
.stat-zero { color: var(--good); }
.stat-foot {
  font-size: 13px;
  color: var(--muted);
}

.bento-logos {
  grid-column: 9 / span 4;
  grid-row: 3;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.logos-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 24px;
}
.logos-marquee {
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0, #000 10%, #000 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 10%, #000 90%, transparent 100%);
  flex: 1;
  display: flex;
  align-items: center;
}
.logos-track {
  display: flex;
  gap: 28px;
  align-items: center;
  font-family: var(--f-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-2);
  white-space: nowrap;
  animation: marquee 28s linear infinite;
}
.logos-track span:nth-child(2n) {
  color: var(--subtle);
  font-weight: 300;
  font-size: 18px;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

@media (max-width: 900px) {
  .hero-bento {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
  }
  .bento-lede,
  .bento-stat-1, .bento-stat-2, .bento-stat-3, .bento-stat-4,
  .bento-logos { grid-column: span 2; grid-row: auto; }
}


/* =========================================================
   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: italic; 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: italic; 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; }
}


/* =========================================================
   COMPARISON
   ========================================================= */

.compare-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  width: fit-content;
  max-width: 100%;
  box-shadow: var(--sh-1);
  position: relative;
}
.compare-toolbar::-webkit-scrollbar { display: none; }

@media (max-width: 720px) {
  /* On phones, don't wrap — scroll horizontally with a fade mask on the edge */
  .compare-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    width: 100%;
    max-width: 100%;
    border-radius: 999px;
    -webkit-mask-image: linear-gradient(to right,
      #000 0, #000 calc(100% - 24px), transparent 100%);
            mask-image: linear-gradient(to right,
      #000 0, #000 calc(100% - 24px), transparent 100%);
    scroll-padding-right: 28px;
  }
  .compare-toolbar::after {
    /* A little grey hint that there's more to scroll */
    content: "";
    position: sticky;
    right: 0;
    min-width: 0;
    display: block;
  }
}

.pill {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: all .2s var(--ease);
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.pill:hover {
  color: var(--ink);
  background: var(--bg-2);
}
.pill.is-active {
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}

.compare-frame {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--sh-1);
  overflow-x: auto;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 760px;
  table-layout: auto;
}
.compare-table thead th {
  text-align: left;
  padding: 20px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
}
.compare-table thead th.col-rust { color: var(--rust-ink); }
.compare-table thead th.col-py   { color: var(--py-ink); }
.compare-table .col-first { min-width: 240px; padding-left: 24px; }

.compare-table tbody th {
  text-align: left;
  padding: 16px 14px 16px 24px;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  font-family: var(--f-sans);
  font-size: 14px;
  letter-spacing: -0.01em;
}
.compare-table tbody th small {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}
.compare-table tbody td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: middle;
}
.compare-table tbody td:last-child { padding-right: 24px; }
.compare-table tbody tr {
  transition: background .25s var(--ease);
}
.compare-table tbody tr:hover {
  background: var(--card-2);
}
.compare-table tbody tr.is-hl {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--rust) 6%, transparent),
    color-mix(in srgb, var(--py) 6%, transparent));
}
.compare-table tbody tr.is-hl td.col-rust {
  background: color-mix(in srgb, var(--rust) 14%, transparent);
}
.compare-table tbody tr.is-hl td.col-py {
  background: color-mix(in srgb, var(--py) 14%, transparent);
}

/* Score dots */
.dots {
  display: inline-flex;
  gap: 3px;
  margin-right: 10px;
  vertical-align: middle;
}
.dots::before {
  content: "";
  display: inline-flex;
  gap: 3px;
  --dot: 8px;
}
/* Build 10 dots via CSS custom counter using a pseudo trick: simpler to use inline content */
.dots {
  --dot-size: 7px;
  --on: var(--ink);
  --off: var(--line-2);
}
.col-rust .dots { --on: var(--rust); }
.col-py   .dots { --on: var(--py); }

.dots {
  padding: 0;
  height: var(--dot-size);
  background:
    linear-gradient(90deg,
      var(--on)  calc(var(--score, 0) * 10% - 5%),
      var(--off) calc(var(--score, 0) * 10% - 5%));
  -webkit-mask: radial-gradient(circle, #000 40%, transparent 42%) 0 50% / 9px var(--dot-size);
  mask: radial-gradient(circle, #000 40%, transparent 42%) 0 50% / 9px var(--dot-size);
  width: 90px;
  display: inline-block;
  transform: translateY(-1px);
  opacity: 0;
  animation: dots-in .8s var(--ease) forwards;
}
.dots[data-score="1"]  { --score: 1; }
.dots[data-score="2"]  { --score: 2; }
.dots[data-score="3"]  { --score: 3; }
.dots[data-score="4"]  { --score: 4; }
.dots[data-score="5"]  { --score: 5; }
.dots[data-score="6"]  { --score: 6; }
.dots[data-score="7"]  { --score: 7; }
.dots[data-score="8"]  { --score: 8; }
.dots[data-score="9"]  { --score: 9; }
.dots[data-score="10"] { --score: 10; }

@keyframes dots-in {
  from { opacity: 0; transform: translateY(-1px) scale(.85); }
  to   { opacity: 1; transform: translateY(-1px) scale(1); }
}

.score {
  display: inline-block;
  min-width: 1.4ch;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}

.compare-note {
  margin-top: 32px;
  padding: 28px 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex;
  align-items: flex-start;
  gap: 18px;
  box-shadow: var(--sh-1);
  position: relative;
}
.compare-note::before {
  content: "";
  flex-shrink: 0;
  width: 6px;
  align-self: stretch;
  background: var(--rust);
  border-radius: 3px;
}
.compare-note-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.compare-note-k {
  font-size: 11px;
  font-weight: 600;
  color: var(--rust-ink);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
.compare-note p {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.65;
  margin: 0;
  max-width: 78ch;
}
.compare-note em { font-style: italic; color: var(--ink); font-weight: 700; }

@media (max-width: 640px) {
  .compare-note {
    padding: 22px 20px;
    gap: 14px;
  }
  .compare-note::before { width: 4px; }
}


/* =========================================================
   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 {
  display: grid;
  grid-template-columns: 1.1fr 120px 1.5fr;
  gap: 20px;
  align-items: stretch;
}

.mig-from {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px;
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mig-from-k {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.mig-from-name {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  letter-spacing: -0.04em;
  line-height: 1;
  transition: opacity .2s var(--ease);
}
.mig-from-blurb {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
  transition: opacity .2s var(--ease);
}
.mig-from-pain {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  transition: opacity .2s var(--ease);
}
.mig-from-pain > span {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: block;
  margin-bottom: 10px;
}
.mig-from-pain ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mig-from-pain li {
  padding: 5px 12px;
  background: var(--bg-2);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 12px;
}

.mig-flow {
  position: relative;
  min-height: 240px;
}
.mig-flow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.flow-path {
  stroke-dasharray: 6 4;
  animation: dash-flow 4s linear infinite;
}
@keyframes dash-flow {
  to { stroke-dashoffset: -40; }
}

.mig-to {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 20px;
}

.mig-dest {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--sh-1);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.mig-dest:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.mig-dest-rust { background: linear-gradient(180deg, var(--card) 0%, var(--lang-rust-tint) 100%); }
.mig-dest-py   { background: linear-gradient(180deg, var(--card) 0%, var(--lang-py-tint) 100%); }

.mig-dest-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.mig-dest-k {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.mig-dest-name {
  font-size: 1.8rem;
  letter-spacing: -0.03em;
}
.mig-dest-rust .mig-dest-name { color: var(--rust-ink); }
.mig-dest-py   .mig-dest-name { color: var(--py-ink); }

.mig-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
  margin-bottom: 18px;
}
.metric { min-width: 0; }
.metric-k {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.metric-v {
  display: block;
  font-family: var(--f-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
  transition: opacity .15s var(--ease);
}
.mig-dest-rust .metric-v { color: var(--rust-ink); }
.mig-dest-py   .metric-v { color: var(--py-ink); }

.metric-bar {
  height: 4px;
  background: var(--line-2);
  border-radius: 2px;
  overflow: hidden;
}
.metric-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width .8s var(--ease);
}
.mig-dest-rust .metric-bar-fill { background: var(--rust); }
.mig-dest-py   .metric-bar-fill { background: var(--py); }

.mig-dest-note {
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
  transition: opacity .2s var(--ease);
}

.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 { grid-template-columns: 1fr; gap: 14px; }
  .mig-flow  { display: none; } /* hide curves entirely on mobile — they overlap content otherwise */
}


/* =========================================================
   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: italic;
  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: italic;
  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 {
  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: .55; }

.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: #0e0e12;
  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: #e8e8ec;
  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;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}
.flip-stat {
  background: var(--card-2);
  padding: 18px 22px;
}
.flip-stat-k {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.flip-stat-pair {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.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, 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: italic;
  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%;
}


/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
}
.footer-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 700;
  color: var(--ink);
}
.footer-brand a { color: var(--rust-ink); }
.footer-brand a:hover { text-decoration: underline; }
.footer-sep { color: var(--subtle); }
.footer-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}


/* =========================================================
   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;
  }
}
