:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f2f4;
  --border: #e4e6ea;
  --ink: #0b0f17;
  --ink-2: #4a5160;
  --ink-3: #6b7280;
  --accent: #256abf;
  --accent-ink: #1c5cab;
  --accent-soft: #e8f1fc;
  --track: #e9ebef;
  --fill: #2a78d6;
  /* heatmap and bars: one blue hue, light -> dark = more */
  --h0: #eef0f3;
  --h1: #b7d3f6;
  --h2: #6da7ec;
  --h3: #2a78d6;
  --h4: #104281;
  /* status (reserved): done / in progress / not started */
  --good: #0ca30c;
  --good-ink: #006300;
  --good-soft: #e3f6e3;
  --warn: #fab219;
  --warn-ink: #7a5200;
  --warn-soft: #fff4dc;
  --idle: #c9cdd4;
  --tip-bg: #0b0f17;
  --tip-ink: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --hero-1: #0b1f3f;
  --hero-2: #104281;
  --hero-3: #2a78d6;
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  /* ambient light and card spotlight (decorative, never data) */
  --amb-1: rgba(42, 120, 214, .20);
  --amb-2: rgba(124, 92, 255, .13);
  --amb-3: rgba(20, 184, 166, .10);
  --spot: rgba(42, 120, 214, .09);
  --glass: rgba(255, 255, 255, .78);
  --glass-border: rgba(16, 24, 40, .10);
  --glass-solid: rgba(255, 255, 255, .96);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --surface: #151b24;
    --surface-2: #1c2430;
    --border: #2a3340;
    --ink: #f2f4f7;
    --ink-2: #c3c8d0;
    --ink-3: #8f97a3;
    --accent: #6da7ec;
    --accent-ink: #9ec5f4;
    --accent-soft: #16263b;
    --track: #2a3340;
    --fill: #3987e5;
    /* dark: low values near the surface, high values light */
    --h0: #1f2733;
    --h1: #184f95;
    --h2: #2a78d6;
    --h3: #6da7ec;
    --h4: #b7d3f6;
    --good: #0ca30c;
    --good-ink: #5fd35f;
    --good-soft: #10291a;
    --warn: #fab219;
    --warn-ink: #fab219;
    --warn-soft: #2e2510;
    --idle: #3a4350;
    --tip-bg: #f2f4f7;
    --tip-ink: #0b0f17;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --hero-1: #07142a;
    --hero-2: #0d366b;
    --hero-3: #1c5cab;
    --amb-1: rgba(42, 120, 214, .30);
    --amb-2: rgba(124, 92, 255, .20);
    --amb-3: rgba(20, 184, 166, .14);
    --spot: rgba(109, 167, 236, .13);
    --glass: rgba(21, 27, 36, .72);
    --glass-border: rgba(255, 255, 255, .10);
    --glass-solid: rgba(21, 27, 36, .97);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #151b24;
  --surface-2: #1c2430;
  --border: #2a3340;
  --ink: #f2f4f7;
  --ink-2: #c3c8d0;
  --ink-3: #8f97a3;
  --accent: #6da7ec;
  --accent-ink: #9ec5f4;
  --accent-soft: #16263b;
  --track: #2a3340;
  --fill: #3987e5;
  /* dark: low values near the surface, high values light */
  --h0: #1f2733;
  --h1: #184f95;
  --h2: #2a78d6;
  --h3: #6da7ec;
  --h4: #b7d3f6;
  --good: #0ca30c;
  --good-ink: #5fd35f;
  --good-soft: #10291a;
  --warn: #fab219;
  --warn-ink: #fab219;
  --warn-soft: #2e2510;
  --idle: #3a4350;
  --tip-bg: #f2f4f7;
  --tip-ink: #0b0f17;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --hero-1: #07142a;
  --hero-2: #0d366b;
  --hero-3: #1c5cab;
  --amb-1: rgba(42, 120, 214, .30);
  --amb-2: rgba(124, 92, 255, .20);
  --amb-3: rgba(20, 184, 166, .14);
  --spot: rgba(109, 167, 236, .13);
  --glass: rgba(21, 27, 36, .72);
  --glass-border: rgba(255, 255, 255, .10);
  --glass-solid: rgba(21, 27, 36, .97);
  color-scheme: dark;
}

/* ---------- Colour themes ----------
   Each palette sets one single-hue ramp (heatmap, bars) plus accent and hero colours, for light and dark.
   Status colours (done / in progress / not started) never change. Default: aurora. */
:root[data-palette="ocean"] {
  --accent: #256abf;
  --accent-ink: #1c5cab;
  --accent-soft: #e8f1fc;
  --fill: #2a78d6;
  --h1: #b7d3f6;
  --h2: #6da7ec;
  --h3: #2a78d6;
  --h4: #104281;
  --hero-1: #0b1f3f;
  --hero-2: #104281;
  --hero-3: #2a78d6;
  --g1: #2a78d6;
  --g2: #7c5cff;
  --g3: #38bdf8;
  --glow: #a9cfff;
  --amb-1: rgba(42, 120, 214, .20);
  --amb-2: rgba(124, 92, 255, .13);
  --amb-3: rgba(20, 184, 166, .10);
  --spot: rgba(42, 120, 214, .09);
}
:root:not([data-palette]), :root[data-palette="aurora"] {
  --accent: #6d28d9;
  --accent-ink: #5b21b6;
  --accent-soft: #f1ebff;
  --fill: #7c3aed;
  --h1: #ddd0ff;
  --h2: #b197fc;
  --h3: #7c3aed;
  --h4: #4c1d95;
  --hero-1: #0f0a2e;
  --hero-2: #2e1a7a;
  --hero-3: #6d28d9;
  --g1: #7c3aed;
  --g2: #ec4899;
  --g3: #22d3ee;
  --glow: #e2d4ff;
  --amb-1: rgba(124, 58, 237, .18);
  --amb-2: rgba(236, 72, 153, .11);
  --amb-3: rgba(34, 211, 238, .11);
  --spot: rgba(124, 58, 237, .09);
}
:root[data-palette="sunset"] {
  --accent: #e11d48;
  --accent-ink: #be123c;
  --accent-soft: #ffe8ec;
  --fill: #e11d48;
  --h1: #fecdd3;
  --h2: #fb7185;
  --h3: #e11d48;
  --h4: #881337;
  --hero-1: #2a0a1f;
  --hero-2: #7a1442;
  --hero-3: #e2553a;
  --g1: #f43f5e;
  --g2: #fb923c;
  --g3: #a855f7;
  --glow: #ffd9c2;
  --amb-1: rgba(244, 63, 94, .16);
  --amb-2: rgba(251, 146, 60, .13);
  --amb-3: rgba(168, 85, 247, .09);
  --spot: rgba(244, 63, 94, .08);
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="ocean"]:not([data-theme="light"]) {
    --accent: #6da7ec;
    --accent-ink: #9ec5f4;
    --accent-soft: #16263b;
    --fill: #3987e5;
    --h1: #184f95;
    --h2: #2a78d6;
    --h3: #6da7ec;
    --h4: #b7d3f6;
    --hero-1: #07142a;
    --hero-2: #0d366b;
    --hero-3: #1c5cab;
    --g1: #3987e5;
    --g2: #8b6cff;
    --g3: #38bdf8;
    --glow: #a9cfff;
    --amb-1: rgba(42, 120, 214, .30);
    --amb-2: rgba(124, 92, 255, .20);
    --amb-3: rgba(20, 184, 166, .14);
    --spot: rgba(109, 167, 236, .13);
  }
}
:root[data-palette="ocean"][data-theme="dark"] {
  --accent: #6da7ec;
  --accent-ink: #9ec5f4;
  --accent-soft: #16263b;
  --fill: #3987e5;
  --h1: #184f95;
  --h2: #2a78d6;
  --h3: #6da7ec;
  --h4: #b7d3f6;
  --hero-1: #07142a;
  --hero-2: #0d366b;
  --hero-3: #1c5cab;
  --g1: #3987e5;
  --g2: #8b6cff;
  --g3: #38bdf8;
  --glow: #a9cfff;
  --amb-1: rgba(42, 120, 214, .30);
  --amb-2: rgba(124, 92, 255, .20);
  --amb-3: rgba(20, 184, 166, .14);
  --spot: rgba(109, 167, 236, .13);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-palette]):not([data-theme="light"]), :root[data-palette="aurora"]:not([data-theme="light"]) {
    --accent: #b197fc;
    --accent-ink: #d0bfff;
    --accent-soft: #221a3d;
    --fill: #8b5cf6;
    --h1: #3b2370;
    --h2: #6d28d9;
    --h3: #a78bfa;
    --h4: #ddd0ff;
    --hero-1: #0a0620;
    --hero-2: #24125e;
    --hero-3: #5b21b6;
    --g1: #8b5cf6;
    --g2: #ec4899;
    --g3: #22d3ee;
    --glow: #e2d4ff;
    --amb-1: rgba(124, 58, 237, .30);
    --amb-2: rgba(236, 72, 153, .16);
    --amb-3: rgba(34, 211, 238, .14);
    --spot: rgba(167, 139, 250, .13);
  }
}
:root:not([data-palette])[data-theme="dark"], :root[data-palette="aurora"][data-theme="dark"] {
  --accent: #b197fc;
  --accent-ink: #d0bfff;
  --accent-soft: #221a3d;
  --fill: #8b5cf6;
  --h1: #3b2370;
  --h2: #6d28d9;
  --h3: #a78bfa;
  --h4: #ddd0ff;
  --hero-1: #0a0620;
  --hero-2: #24125e;
  --hero-3: #5b21b6;
  --g1: #8b5cf6;
  --g2: #ec4899;
  --g3: #22d3ee;
  --glow: #e2d4ff;
  --amb-1: rgba(124, 58, 237, .30);
  --amb-2: rgba(236, 72, 153, .16);
  --amb-3: rgba(34, 211, 238, .14);
  --spot: rgba(167, 139, 250, .13);
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="sunset"]:not([data-theme="light"]) {
    --accent: #fb7185;
    --accent-ink: #fda4af;
    --accent-soft: #3a1420;
    --fill: #f43f5e;
    --h1: #5c1027;
    --h2: #be123c;
    --h3: #fb7185;
    --h4: #fecdd3;
    --hero-1: #1a0612;
    --hero-2: #5c0f33;
    --hero-3: #c2410c;
    --g1: #f43f5e;
    --g2: #fb923c;
    --g3: #a855f7;
    --glow: #ffd9c2;
    --amb-1: rgba(244, 63, 94, .26);
    --amb-2: rgba(251, 146, 60, .16);
    --amb-3: rgba(168, 85, 247, .14);
    --spot: rgba(251, 113, 133, .12);
  }
}
:root[data-palette="sunset"][data-theme="dark"] {
  --accent: #fb7185;
  --accent-ink: #fda4af;
  --accent-soft: #3a1420;
  --fill: #f43f5e;
  --h1: #5c1027;
  --h2: #be123c;
  --h3: #fb7185;
  --h4: #fecdd3;
  --hero-1: #1a0612;
  --hero-2: #5c0f33;
  --hero-3: #c2410c;
  --g1: #f43f5e;
  --g2: #fb923c;
  --g3: #a855f7;
  --glow: #ffd9c2;
  --amb-1: rgba(244, 63, 94, .26);
  --amb-2: rgba(251, 146, 60, .16);
  --amb-3: rgba(168, 85, 247, .14);
  --spot: rgba(251, 113, 133, .12);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--accent); }
code, .mono { font-family: var(--mono); font-size: .84em; }
main { max-width: 1120px; margin: 0 auto; padding: 0 24px 64px; position: relative; }

/* ---------- Hero ---------- */
.hero {
  color: #fff; position: relative; overflow: hidden;
  background:
    radial-gradient(900px 400px at 85% -10%, color-mix(in srgb, var(--g1) 35%, transparent), transparent 60%),
    radial-gradient(600px 300px at 0% 110%, color-mix(in srgb, var(--g1) 35%, transparent), transparent 60%),
    linear-gradient(135deg, var(--hero-1), var(--hero-2) 60%, var(--hero-3));
  padding: calc(var(--bar-h) + 40px) 24px 88px;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image: radial-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}
.hero-in, .journey { max-width: 1072px; margin: 0 auto; position: relative; z-index: 1; }
.hero-in { display: flex; gap: 40px; align-items: center; justify-content: space-between; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; opacity: .8; margin: 0 0 12px; }
.hero h1 { font-size: clamp(28px, 4.6vw, 46px); line-height: 1.08; letter-spacing: -.025em; margin: 0 0 14px; font-weight: 800; max-width: 760px; }
.who { font-size: 17px; opacity: .9; max-width: 640px; margin: 0 0 20px; }
.who a { color: #fff; text-decoration-color: rgba(255, 255, 255, .5); text-underline-offset: 3px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #5fd35f; box-shadow: 0 0 0 0 rgba(95, 211, 95, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(95, 211, 95, 0); } 100% { box-shadow: 0 0 0 0 rgba(95, 211, 95, 0); } }

.ring { width: 180px; height: 180px; flex: none; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .25)); }
.ring-track { fill: rgba(255, 255, 255, .06); stroke: rgba(255, 255, 255, .18); stroke-width: 12; }
.ring-fill { fill: none; stroke: #fff; stroke-width: 12; stroke-linecap: round; transition: stroke-dasharray 1.2s ease; }
.ring-num { fill: #fff; font: 800 34px var(--font); text-anchor: middle; }
.ring-lab { fill: rgba(255, 255, 255, .8); font: 600 13px var(--font); text-anchor: middle; letter-spacing: .06em; text-transform: uppercase; }

/* journey bar */
.journey { margin-top: 40px; }
.segs { display: flex; gap: 3px; height: 34px; border-radius: 10px; overflow: hidden; }
.seg {
  display: flex; align-items: center; justify-content: center; min-width: 0;
  font: 700 11px var(--font); letter-spacing: .02em; color: rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .12);
}
.seg.completed { background: var(--good); color: #fff; }
.seg.in_progress { background: var(--warn); color: #1d1500; }
.seg span { overflow: hidden; white-space: nowrap; text-overflow: clip; padding: 0 2px; }
.you { position: absolute; top: -6px; height: 46px; border-left: 2px solid #fff; }
.you span {
  position: absolute; top: 50px; left: -1px; transform: translateX(-12px); white-space: nowrap;
  font: 700 12px var(--font); background: #fff; color: var(--hero-2); padding: 3px 9px; border-radius: 6px;
}
.you span::before { content: ""; position: absolute; top: -5px; left: 7px; border: 5px solid transparent; border-top: 0; border-bottom-color: #fff; }
.jlegend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 44px; font-size: 13px; opacity: .9; }
.jlegend .k { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.k.completed { background: var(--good); } .k.in_progress { background: var(--warn); } .k.not_started { background: rgba(255, 255, 255, .25); }
.jlegend .muted { opacity: .7; }

/* ---------- Tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-top: -44px; position: relative; z-index: 2; }
.tile { perspective: 1100px; border-radius: var(--radius); outline: none; cursor: pointer; }
.tile .inner { display: grid; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.3, 1.3, .45, 1); }
.face {
  grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; display: flex; flex-direction: column; min-width: 0;
}
.face.back {
  transform: rotateY(180deg); color: #fff; border-color: transparent; padding: 14px 16px;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--g2) 45%, transparent), transparent 60%), linear-gradient(150deg, var(--hero-1), var(--hero-2) 55%, var(--hero-3));
}
@media (hover: hover) { .tile:hover .inner { transform: rotateY(180deg); } }
.tile:focus-visible .inner, .tile.flipped .inner, .tile.peek .inner { transform: rotateY(180deg); }
.tile:focus-visible .face { outline: 2px solid var(--accent); outline-offset: 2px; }
.fliphint { position: absolute; top: 12px; right: 12px; color: var(--ink-3); opacity: .55; }
.fliphint .ico { width: 15px; height: 15px; margin: 0; color: currentColor; }
.back h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.bl { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.bl li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed rgba(255, 255, 255, .16); }
.bl li:last-child { border-bottom: 0; }
.bl span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .92; }
.bl b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bfoot { margin: 8px 0 0; font-size: 12px; opacity: .8; }
.tile .ico { width: 22px; height: 22px; color: var(--accent); margin-bottom: 10px; }
.tile .num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .lab { font-size: 14px; font-weight: 600; }
.tile .sub { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }

/* ---------- Blocks ---------- */
.block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 26px; margin-top: 22px; }
.block h2 { font-size: 22px; letter-spacing: -.015em; margin: 0 0 4px; }
.note { color: var(--ink-3); font-size: 14px; margin: 0 0 18px; max-width: 780px; }
.block, .mpanel, .mtabs-wrap { scroll-margin-top: calc(var(--bar-h) + 16px); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

/* ---------- Roadmap: overview table + tabbed topic tables ---------- */
.sub-h { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 22px 0 10px; font-weight: 700; }
.mid { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; background: var(--surface-2); color: var(--ink-2); }
.completed .mid { background: var(--good-soft); color: var(--good-ink); }
.in_progress .mid { background: var(--warn-soft); color: var(--warn-ink); }
.status { font-size: 12px; font-weight: 700; white-space: nowrap; padding: 4px 10px; border-radius: 999px; display: inline-block; }
.s-completed { color: var(--good-ink); background: var(--good-soft); }
.s-in_progress { color: var(--warn-ink); background: var(--warn-soft); }
.s-not_started { color: var(--ink-3); background: var(--surface-2); }
.meter { height: 8px; flex: 1; background: var(--track); border-radius: 999px; overflow: hidden; min-width: 60px; }
.meter .fill { height: 100%; background: var(--fill); border-radius: 999px; }
.count { font-size: 12px; color: var(--ink-3); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; min-width: 36px; }
.now { font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }
.ev { font-family: var(--mono); font-size: 11.5px; text-decoration: none; padding: 1px 6px; border-radius: 5px; background: var(--accent-soft); word-break: break-all; }
.ev:hover { text-decoration: underline; }
.more { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.mark { display: inline-block; width: 18px; font-weight: 800; flex: none; }
.yes .mark { color: var(--good-ink); }
.no .mark { color: var(--ink-3); }

/* overview table */
.mtable-wrap { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.mtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.mtable thead th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; background: var(--surface-2); padding: 10px 14px; }
.mtable tbody th, .mtable td { padding: 9px 14px; border-top: 1px solid var(--border); vertical-align: middle; text-align: left; font-weight: 400; }
.mtable tbody tr { transition: background .2s; position: relative; }
.mtable tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.mrow > th { box-shadow: inset 4px 0 0 var(--idle); }
.mrow.completed > th { box-shadow: inset 4px 0 0 var(--good); }
.mrow.in_progress > th { box-shadow: inset 4px 0 0 var(--warn); }
.mopen { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.mopen:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.mname { font-weight: 650; line-height: 1.3; }
.mname small { display: none; font-weight: 500; font-size: 12px; color: var(--ink-3); }
.mopen:hover .mname { color: var(--accent-ink); }
.c-weeks { color: var(--ink-3); white-space: nowrap; font-size: 13px; }
.mprog { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.pmark { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.pmark.yes { color: var(--good-ink); font-weight: 700; }

/* module tabs */
.mtabs-wrap { position: relative; margin: 0 -4px; }
.mtabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px 4px 10px; position: relative; scroll-snap-type: x proximity; }
.mtabs::-webkit-scrollbar { display: none; }
.mtab {
  flex: none; display: inline-flex; align-items: center; gap: 7px; scroll-snap-align: start; cursor: pointer; position: relative; z-index: 1;
  font: 600 13px var(--font); color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 7px 13px;
  transition: color .25s, background .25s, border-color .25s, transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.mtab b { font-weight: 800; }
.mtab span { font-weight: 500; }
.mtab:hover { transform: translateY(-2px); border-color: var(--accent); }
.mtab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mtab[aria-selected="true"] { color: #fff; background: transparent; border-color: transparent; }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--idle); flex: none; }
.mtab.completed .sdot { background: var(--good); }
.mtab.in_progress .sdot { background: var(--warn); }
.mtab[aria-selected="true"] .sdot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.tab-ink {
  position: absolute; z-index: 0; top: 4px; left: 0; height: 0; width: 0; border-radius: 999px; pointer-events: none;
  background: linear-gradient(120deg, var(--hero-2), var(--hero-3) 60%, var(--g2)); box-shadow: 0 6px 18px color-mix(in srgb, var(--g1) 35%, transparent);
  transition: transform .45s cubic-bezier(.3, 1.25, .5, 1), width .45s cubic-bezier(.3, 1.25, .5, 1);
}
/* without JS no tab is selected visually by the ink, so the selected tab keeps a solid fill */
:root:not(.tabs-on) .mtabs { display: none; }
:root:not(.tabs-on) .mpanel + .mpanel { margin-top: 18px; }
.tabs-on .mpanel:not(.active) { display: none; }

/* topic panel */
.mpanel { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.phead { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-soft) 80%, transparent), transparent 70%); }
.ptext { flex: 1; min-width: 0; }
.ptitle { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.psched { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.twrap { overflow-x: auto; }
.ttable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ttable thead th { white-space: nowrap; text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 10px 16px 6px; }
.ttable td { padding: 9px 16px; border-top: 1px solid var(--border); vertical-align: top; }
.ttable tbody tr { transition: background .2s; }
.ttable tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.tcell { display: flex; gap: 4px; }
.ttable tr.no .tcell { color: var(--ink-2); }
.ttable th:nth-child(2), .ttable td:nth-child(2) { width: 120px; }
.ttable th:nth-child(3), .ttable td:nth-child(3) { width: 34%; }
.src { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.s-code { color: var(--accent-ink); background: var(--accent-soft); }
.s-notes, .s-docs, .s-readme { color: var(--good-ink); background: var(--good-soft); }
.s-none { color: var(--ink-3); }
.proof { overflow-wrap: anywhere; }
.projrow td { background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; }
.projrow b { margin-right: 6px; color: var(--ink); }

/* heatmap */
.heat-wrap { overflow-x: auto; padding-bottom: 4px; }
.heat { display: block; width: 100%; max-width: 900px; min-width: 520px; height: auto; }
.heat .axis { fill: var(--ink-3); font-size: 10px; font-family: var(--font); }
.heat rect { stroke: var(--surface); stroke-width: 1; }
.heat rect:hover { stroke: var(--ink); stroke-width: 1.5; }
.l0 { fill: var(--h0); } .l1 { fill: var(--h1); } .l2 { fill: var(--h2); } .l3 { fill: var(--h3); } .l4 { fill: var(--h4); }
.heat .future { fill: transparent; stroke: var(--track); stroke-dasharray: 2 2; }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); margin-top: 10px; flex-wrap: wrap; }
.heat-legend .lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg.l0 { background: var(--h0); } .lg.l1 { background: var(--h1); } .lg.l2 { background: var(--h2); } .lg.l3 { background: var(--h3); } .lg.l4 { background: var(--h4); }
.lgk { margin-left: 10px; }
.table-view { margin-top: 12px; font-size: 14px; }
.table-view summary { cursor: pointer; color: var(--accent); }
.table-view table { border-collapse: collapse; margin-top: 8px; min-width: 260px; }
.table-view th, .table-view td { text-align: left; padding: 4px 16px 4px 0; border-bottom: 1px solid var(--border); }

/* projects */
.pcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.pcard {
  position: relative; display: flex; flex-direction: column; gap: 5px; padding: 18px 18px 16px; border: 1px solid var(--border);
  border-radius: 12px; text-decoration: none; color: var(--ink); background: var(--surface); overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.pcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--h4), var(--h3), var(--h2)); }
.pcard:hover { box-shadow: var(--shadow); border-color: var(--accent); }
.pcard h3 { margin: 4px 0 0; font-size: 16.5px; letter-spacing: -.01em; }
.pcard h3::after { content: " →"; color: var(--accent); opacity: 0; transition: opacity .15s; }
.pcard:hover h3::after { opacity: 1; }
.pcard p { margin: 0; font-size: 14px; color: var(--ink-2); }
.pcard .path { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.pcard .meta { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.libs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.libs code { background: var(--surface-2); padding: 2px 8px; border-radius: 6px; font-size: 11.5px; }
.muted { color: var(--ink-3); font-size: 13px; }

/* libraries bar chart */
.liblist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.liblist li { display: grid; grid-template-columns: minmax(120px, 42%) 1fr 22px; gap: 10px; align-items: center; }
.liblist code { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbar { height: 10px; background: var(--track); border-radius: 0 6px 6px 0; overflow: hidden; }
.lbar span { display: block; height: 100%; background: var(--fill); border-radius: 0 4px 4px 0; }
.lcount { font-size: 12.5px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* commits timeline */
.commits { list-style: none; margin: 0; padding: 0; position: relative; }
.commits::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--track); }
.commits li { display: grid; grid-template-columns: 12px 1fr; gap: 14px; padding: 7px 0; position: relative; }
.cdot { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--fill); margin-top: 5px; }
.commits .msg { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.commits .when { font-size: 12px; color: var(--ink-3); }
.commits .when a { text-decoration: none; }

footer { margin-top: 40px; color: var(--ink-3); font-size: 13px; text-align: center; }

/* tooltip */
.tip { position: fixed; z-index: 10; pointer-events: none; background: var(--tip-bg); color: var(--tip-ink); font-size: 12px; padding: 5px 9px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -130%); }


/* ---------- Interactive pieces (work with or without motion) ---------- */
.seg { border: 0; padding: 0; cursor: pointer; font: 700 11px var(--font); transition: filter .2s, box-shadow .2s; }
.seg:hover, .seg:focus-visible { filter: brightness(1.15); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); outline: none; }
.ring { cursor: pointer; }

/* card spotlight follows the pointer (app.js sets --mx/--my) */
.spot { background-image: radial-gradient(420px circle at var(--mx, -999px) var(--my, -999px), var(--spot), transparent 45%); }

/* scroll progress */
.sprog {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none; transform-origin: left;
  transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--g3), var(--g1) 50%, var(--g2));
}

/* top bar: always there. Over the hero it's see-through with white text; once you scroll it turns solid. */
:root { --bar-h: 52px; }
.minibar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 55; color: var(--ink);
  background: var(--glass-solid); border-bottom: 1px solid var(--glass-border); box-shadow: 0 10px 30px rgba(16, 24, 40, .12);
  transition: background-color .35s, border-color .35s, box-shadow .35s, color .35s;
}
.minibar.top { background-color: transparent; border-bottom-color: transparent; box-shadow: none; color: #fff; }
.minibar.top .mb-brand, .minibar.top .mb-nav a { color: #fff; }
.minibar.top .mb-brand small { color: rgba(255, 255, 255, .75); }
.minibar.top .mb-ring .t { stroke: rgba(255, 255, 255, .25); }
.minibar.top .mb-ring .f { stroke: #fff; }
.minibar.top .mb-nav a:hover { background: rgba(255, 255, 255, .14); }
.mb-brand:focus-visible, .mb-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.mb-in { max-width: 1120px; height: var(--bar-h); margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 18px; }
.mb-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; flex: none; }
.mb-brand b { display: block; font-size: 14px; white-space: nowrap; }
.mb-brand small { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.mb-ring { width: 34px; height: 34px; flex: none; }
.mb-ring circle { fill: none; stroke-width: 5; }
.mb-ring .t { stroke: var(--track); }
.mb-ring .f { stroke: var(--fill); stroke-linecap: round; }
.mb-nav { margin-left: auto; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.mb-nav::-webkit-scrollbar { display: none; }
.mb-nav a { font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; padding: 6px 12px; border-radius: 999px; white-space: nowrap; transition: color .25s, background .25s; }
.mb-nav a:hover { background: var(--surface-2); }
.mb-nav a.on { color: #fff; background: linear-gradient(120deg, var(--hero-2), var(--hero-3)); }

/* tooltip pops in */
.tip { box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.tip:not([hidden]) { animation: tipPop .18s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes tipPop { from { opacity: 0; transform: translate(-50%, -100%) scale(.85); } }

/* settings dock: tucks away while scrolling down, comes back when scrolling up */
.dock { position: fixed; left: 16px; bottom: 16px; z-index: 40; display: flex; gap: 8px; transition: transform .4s cubic-bezier(.3, 1.2, .5, 1), opacity .3s; }
.dock.away { transform: translateY(90px); opacity: 0; }
.dbtn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0;
  color: var(--ink); background: var(--glass-solid); border: 1px solid var(--glass-border); box-shadow: var(--shadow);
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), opacity .25s;
}
.dbtn:hover { transform: translateY(-3px) scale(1.06); }
.dbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dbtn .ico { width: 19px; height: 19px; margin: 0; }
#theme-btn .ico { display: none; }
:root:not([data-theme]) #theme-btn .ico:nth-child(1), :root[data-theme="light"] #theme-btn .ico:nth-child(2),
:root[data-theme="dark"] #theme-btn .ico:nth-child(3) { display: block; }
#motion-btn[aria-pressed="true"] { color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2)); border-color: transparent; }
.swatch { width: 20px; height: 20px; border-radius: 50%; background: conic-gradient(var(--g1), var(--g2), var(--g3), var(--g1)); box-shadow: 0 0 0 2px var(--surface); }
#top-btn { opacity: 0; pointer-events: none; transform: translateY(10px) scale(.8); }
#top-btn.show { opacity: 1; pointer-events: auto; transform: none; }

/* latest-push toast */
.toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 45; width: min(360px, calc(100vw - 32px)); overflow: hidden;
  display: grid; grid-template-columns: 12px 1fr 24px; gap: 12px; align-items: start; padding: 14px 14px 16px;
  color: var(--ink); background: var(--glass-solid); border: 1px solid var(--glass-border); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, .22);
}
.toast[hidden] { display: none; }
.tdot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--good); animation: pulse 2s infinite; }
.tbody { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.tbody b { font-size: 13px; }
.tbody .ago { color: var(--ink-3); font-weight: 500; }
.tmsg { color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tbody a { font-size: 12px; text-decoration: none; }
.tclose { all: unset; cursor: pointer; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; color: var(--ink-3); }
.tclose:hover { background: var(--surface-2); color: var(--ink); }
.tclose:focus-visible { outline: 2px solid var(--accent); }
.tbar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left; background: linear-gradient(90deg, var(--g1), var(--g2)); }
.motion .toast.in { animation: toastIn .6s cubic-bezier(.3, 1.4, .5, 1); }
.motion .toast.out { animation: toastOut .35s ease-in forwards; }
.motion .toast.in .tbar { animation: drain var(--toast-ms, 9000ms) linear forwards; }
.toast:hover .tbar { animation-play-state: paused; }
@keyframes toastIn { from { opacity: 0; transform: translateY(30px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px) scale(.95); } }
@keyframes drain { to { transform: scaleX(0); } }

/* Frosted glass only where it's cheap and reliable (desktop pointers); on phones it can flicker while scrolling. */
@media (hover: hover) and (pointer: fine) {
  .dbtn, .toast, .minibar:not(.top) { background: var(--glass); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); }
}

/* module pop-up */
.modal {
  border: 0; padding: 0; border-radius: 22px; width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  color: var(--ink); background: var(--surface); box-shadow: 0 40px 120px rgba(0, 0, 0, .4); overflow: auto;
}
.modal::backdrop { background: rgba(6, 14, 30, .55); }
.mhead {
  position: relative; overflow: hidden; color: #fff; padding: 22px 56px 20px 22px; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--g2) 50%, transparent), transparent 55%), linear-gradient(140deg, var(--hero-1), var(--hero-2) 55%, var(--hero-3));
}
.mhead .mk { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .8; margin: 0 0 4px; }
.mhead h3 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.015em; }
.mhead .msched { margin: 6px 0 0; font-size: 13.5px; opacity: .85; }
.mhead .status { margin-top: 10px; }
.mring { width: 96px; height: 96px; }
.mring circle { fill: none; stroke-width: 9; }
.mring .t { stroke: rgba(255, 255, 255, .18); }
.mring .f { stroke: #fff; stroke-linecap: round; transition: stroke-dasharray 1.1s cubic-bezier(.2, .7, .2, 1); }
.mring text { fill: #fff; font: 800 20px var(--font); text-anchor: middle; }
.mclose {
  all: unset; position: absolute; top: 12px; right: 12px; z-index: 1; cursor: pointer; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px; color: #fff; background: rgba(255, 255, 255, .14);
}
.mclose:hover { background: rgba(255, 255, 255, .26); }
.mclose:focus-visible { outline: 2px solid #fff; }
.mbody { padding: 6px 4px 0; }
.mnav { display: flex; justify-content: space-between; gap: 8px; padding: 12px 16px 18px; }
.mnav button {
  cursor: pointer; font: 600 13px var(--font); color: var(--accent-ink); background: var(--accent-soft); border: 0; border-radius: 999px; padding: 8px 14px;
  transition: transform .2s;
}
.mnav button:hover { transform: translateY(-2px); }
.mnav button:disabled { visibility: hidden; }
.motion .modal[open] { animation: modalIn .5s cubic-bezier(.3, 1.35, .5, 1); }
.motion .modal[open]::backdrop { animation: fadeIn .3s ease; }
.motion .modal.closing { animation: modalOut .22s ease-in forwards; }
.motion .modal.swap .mcontent { animation: swapIn .4s cubic-bezier(.2, .7, .2, 1); }
.motion .modal[open] .ttable tbody td { animation: fadeUp .45s backwards; animation-delay: calc(.12s + var(--k, 0) * 40ms); }
@keyframes modalIn { from { opacity: 0; transform: translateY(40px) scale(.9); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(20px) scale(.94); } }
@keyframes swapIn { from { opacity: 0; transform: translateX(var(--dir, 30px)); } }
@keyframes fadeIn { from { opacity: 0; } }

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 1000; }

/* ---------- Ambient + motion ----------
   Everything that moves is opt-in: app.js adds .motion to <html> once a probe shows the browser really runs CSS
   animations, and only if the visitor hasn't turned animations off (dock button, or the OS reduced-motion setting).
   Without .motion the page is fully visible and static.
   Mobile-safe by construction: moving layers only animate transform/opacity, carry no blur filters, and are sized in
   vw / lvh so they don't resize when the phone's address bar shows or hides while scrolling. */

.motion-probe { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; animation: probe 1ms linear; }
@keyframes probe { from { opacity: 0; } to { opacity: .01; } }

/* page-wide aurora: three soft lights drifting behind everything */
.amb { position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; z-index: -1; pointer-events: none; overflow: hidden; contain: strict; }
.amb i { position: absolute; border-radius: 50%; width: max(560px, 70vw); aspect-ratio: 1; will-change: transform; }
.amb i:nth-child(1) { left: -22vw; top: -14vw; background: radial-gradient(circle, var(--amb-1), transparent 62%); }
.amb i:nth-child(2) { right: -24vw; top: 30%; background: radial-gradient(circle, var(--amb-2), transparent 62%); }
.amb i:nth-child(3) { left: 18vw; bottom: -40vw; background: radial-gradient(circle, var(--amb-3), transparent 62%); }
.motion .amb i:nth-child(1) { animation: float1 26s ease-in-out infinite alternate; }
.motion .amb i:nth-child(2) { animation: float2 32s ease-in-out infinite alternate; }
.motion .amb i:nth-child(3) { animation: float3 38s ease-in-out infinite alternate; }
@keyframes float1 { 50% { transform: translate(22vw, 14vw) scale(1.2); } 100% { transform: translate(8vw, 30vw) scale(.9); } }
@keyframes float2 { 50% { transform: translate(-24vw, -12vw) scale(1.15); } 100% { transform: translate(-10vw, 20vw) scale(.95); } }
@keyframes float3 { 50% { transform: translate(18vw, -20vw) scale(1.25); } 100% { transform: translate(-16vw, -8vw) scale(1); } }

/* hero: aurora sweep, drifting light, starfield canvas, pointer parallax */
.fx {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  transform: translate3d(calc(var(--px, 0) * -28px), calc(var(--py, 0) * -18px), 0); transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}
/* the blur sits on a child that never moves, so the rotating layer is rasterised once instead of re-blurred every frame */
.aurora { position: absolute; inset: -40%; opacity: .6; will-change: transform; }
.aurora::before {
  content: ""; position: absolute; inset: 0; filter: blur(60px);
  background: conic-gradient(from 0deg at 50% 50%, transparent 0 12%, color-mix(in srgb, var(--g1) 55%, transparent) 22%, transparent 34% 50%,
    color-mix(in srgb, var(--g2) 45%, transparent) 62%, transparent 74% 84%, color-mix(in srgb, var(--g3) 45%, transparent) 92%, transparent);
}
.motion .aurora { animation: spin 46s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; opacity: 0; transition: opacity 1.2s; }
.motion .sky.on { opacity: 1; }
.blob { position: absolute; border-radius: 50%; will-change: transform; }
.b1 { width: 520px; height: 520px; top: -200px; right: 6%; background: radial-gradient(circle, color-mix(in srgb, var(--g1) 75%, transparent), transparent 65%); }
.b2 { width: 460px; height: 460px; bottom: -240px; left: -110px; background: radial-gradient(circle, color-mix(in srgb, var(--g2) 55%, transparent), transparent 65%); }
.b3 { width: 340px; height: 340px; top: 25%; left: 42%; background: radial-gradient(circle, color-mix(in srgb, var(--g3) 40%, transparent), transparent 65%); }
.motion .b1 { animation: drift1 16s ease-in-out infinite alternate; }
.motion .b2 { animation: drift2 20s ease-in-out infinite alternate; }
.motion .b3 { animation: drift3 24s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(-160px, 100px) scale(1.2); } }
@keyframes drift2 { to { transform: translate(220px, -80px) scale(.85); } }
@keyframes drift3 { to { transform: translate(-140px, -70px) scale(1.35); } }
/* the dot grid drifts by moving the layer (compositor) rather than its background (repaint every frame) */
.hero::after { inset: -22px 0 0 -22px; }
.motion .hero::after { animation: dots 6s linear infinite; }
@keyframes dots { to { transform: translate(22px, 22px); } }

/* hero entrance + a light sweep across the title */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } }
.motion .hero-text > * { animation: fadeUp .8s cubic-bezier(.2, .7, .2, 1) both; }
.motion .hero-text > :nth-child(2) { animation-delay: .1s; }
.motion .hero-text > :nth-child(3) { animation-delay: .2s; }
.motion .hero-text > :nth-child(4) { animation-delay: .3s; }
.motion .hero .hero-text > h1 {
  background: linear-gradient(110deg, #fff 0 40%, var(--glow) 47%, #fff 50%, var(--glow) 53%, #fff 60% 100%);
  background-size: 260% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: fadeUp .8s .1s cubic-bezier(.2, .7, .2, 1) both, shine 2.4s 1.2s ease-in-out both;
}
@media (hover: hover) and (pointer: fine) {
  .motion .hero .hero-text > h1 { animation: fadeUp .8s .1s cubic-bezier(.2, .7, .2, 1) both, shine 7s 1.2s ease-in-out infinite; }
}
@keyframes shine { 0% { background-position: 100% 0; } 30%, 100% { background-position: 0 0; } }
.motion .pill { animation: popIn .5s backwards; }
.motion .pill:nth-child(1) { animation-delay: .45s; } .motion .pill:nth-child(2) { animation-delay: .55s; } .motion .pill:nth-child(3) { animation-delay: .65s; }
@keyframes popIn { from { opacity: 0; transform: scale(.6) translateY(8px); } }
.motion .ring { animation: ringIn 1s .2s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes ringIn { from { opacity: 0; transform: scale(.6) rotate(-40deg); } }
.ring-fill { stroke: url(#ringg); transition: stroke-dasharray 1.8s cubic-bezier(.2, .7, .2, 1); }

/* journey: segments fill in one after another, done ones shimmer */
@keyframes grow { from { transform: scaleX(0); opacity: 0; } }
.motion .seg { transform-origin: left center; animation: grow .55s cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: calc(.4s + var(--i, 0) * .08s); }
.motion .seg.completed, .motion .seg.in_progress {
  background-image: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%); background-size: 300% 100%; background-repeat: no-repeat;
  animation: grow .55s cubic-bezier(.2, .7, .2, 1) backwards, shimmer 4s ease-in-out infinite;
  animation-delay: calc(.4s + var(--i, 0) * .08s), calc(2s + var(--i, 0) * .15s);
}
@keyframes shimmer { 0% { background-position: 120% 0; } 40%, 100% { background-position: -20% 0; } }
.motion .you { animation: fadeUp .5s 1.3s backwards; }
.motion .you span { animation: bob 2.8s 1.9s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateX(-12px) translateY(-4px); } }

/* stat cards flip into place; Safari needs the explicit 3D transforms on both faces or it flickers */
.tile .inner { -webkit-transform-style: preserve-3d; }
.face.front { transform: rotateY(0deg); }
.motion .tile { animation: flipIn .9s cubic-bezier(.3, 1.3, .45, 1) both; animation-delay: calc(.35s + var(--i, 0) * .09s); transform-origin: 50% 0; }
@keyframes flipIn { from { opacity: 0; transform: rotateX(-80deg) translateY(24px); } }
.motion .tile:hover .face { box-shadow: 0 18px 40px rgba(16, 24, 40, .18); }
.motion .fliphint .ico { animation: hintSpin 3.5s 3s ease-in-out infinite; }
@keyframes hintSpin { 0%, 70% { transform: none; } 85%, 100% { transform: rotate(360deg); } }
.tile .num { display: inline-block; }
.motion .tile .num.pop { animation: numPop .45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes numPop { 40% { transform: scale(1.18); } }

/* effects that play once, when a section is first seen (app.js adds .seen) */
.block h2::after { content: ""; display: block; width: 44px; height: 3px; border-radius: 3px; margin-top: 8px; background: linear-gradient(90deg, var(--accent), var(--g2)); transform-origin: left; }
.motion .block h2::after { transition: transform .9s .3s cubic-bezier(.2, .7, .2, 1); }
.motion .block:not(.seen) h2::after { transform: scaleX(0); }
.meter .fill, .lbar span { transition: width 1.2s cubic-bezier(.2, .7, .2, 1); }
.motion .lbar span { transition-delay: calc(.2s + var(--k, 0) * 70ms); background-image: linear-gradient(90deg, var(--fill), var(--h2)); }
.motion .mtable .meter .fill { transition-delay: calc(.2s + var(--k, 0) * 60ms); }
.motion .block:not(.seen) .meter .fill, .motion .block:not(.seen) .lbar span { width: 0 !important; }
.heat rect { transform-box: fill-box; transform-origin: center; }
.motion .heat rect { transition: opacity .45s ease, transform .18s cubic-bezier(.3, 1.6, .5, 1); transition-delay: calc(var(--d, 0) * 20ms), 0s; }
.motion .heat rect:hover { transform: scale(1.45); }
.motion .block:not(.seen) .heat rect { opacity: 0; }
.motion .commits li:first-child .cdot { animation: pulseBlue 2s infinite; }
@keyframes pulseBlue { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--g1) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
.motion .mrow.completed .mid { animation: glowGood 3s ease-in-out infinite; animation-delay: calc(var(--k, 0) * .4s); }
@keyframes glowGood { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 22%, transparent); } }

/* switching module tabs: the panel slides in from the side of the tab you came from, rows cascade */
.motion .mpanel.enter { animation: panelIn .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes panelIn { from { opacity: 0; transform: translateX(var(--dir, 30px)) scale(.985); } }
.motion .mpanel.enter .ttable tbody td, .motion .mpanel.enter .projrow td { animation: fadeUp .45s backwards; animation-delay: calc(.08s + var(--k, 0) * 35ms); }
.motion .mtable tbody tr { transition: background .2s, transform .25s; }
.motion .mtable tbody tr:hover { transform: translateX(4px); }

/* project cards: 3D tilt toward the pointer and a spinning gradient border */
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.pcard::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: conic-gradient(from var(--ang), var(--g1), var(--g2), var(--g3), var(--g1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.pcard:hover::after { opacity: 1; }
.motion .pcard:hover::after { animation: spinAng 3s linear infinite; }
@keyframes spinAng { to { --ang: 360deg; } }
.pcards { perspective: 1200px; }
.motion .pcard { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0)); transition: transform .2s ease-out, box-shadow .2s, border-color .2s; }
.motion .pcard:hover { --lift: -4px; box-shadow: 0 22px 50px rgba(16, 24, 40, .18); }

/* ---------- Scrolling, both ways ----------
   Where the browser has scroll-driven animations, effects are tied to scroll position, so they play forward when
   scrolling down and rewind when scrolling back up. Elsewhere (.no-sda), sections fade up once as they appear. */
@supports (animation-timeline: view()) {
  /* hero sinks back and fades as you scroll away from it; its light layer moves slower (parallax) */
  .motion .hero-in { animation: heroAway linear both; animation-timeline: scroll(root); animation-range: 0 85vh; }
  @keyframes heroAway { to { translate: 0 110px; scale: .92; opacity: .1; } }
  .motion .journey { animation: journeyAway linear both; animation-timeline: scroll(root); animation-range: 0 70vh; }
  @keyframes journeyAway { to { translate: 0 60px; opacity: .15; } }
  .motion .fx { animation: fxAway linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
  @keyframes fxAway { to { translate: 0 200px; } }
  .motion .amb i:nth-child(1) { animation: float1 26s ease-in-out infinite alternate, ambA linear both; animation-timeline: auto, scroll(root); }
  .motion .amb i:nth-child(2) { animation: float2 32s ease-in-out infinite alternate, ambB linear both; animation-timeline: auto, scroll(root); }
  @keyframes ambA { to { translate: 30vw 40vw; } }
  @keyframes ambB { to { translate: -30vw -20vw; } }

  /* stat cards tip back as they leave the top of the screen */
  .motion .tiles { animation: tilesAway linear both; animation-timeline: view(); animation-range: exit -20% exit 100%; transform-origin: 50% 100%; }
  @keyframes tilesAway { to { opacity: .1; translate: 0 -50px; scale: .9; rotate: x 35deg; } }

  /* sections rise and sharpen as they enter, and settle back as they leave */
  .motion .block {
    animation: blockIn linear both, blockOut linear both; animation-timeline: view(), view();
    animation-range: entry 0% entry 45%, exit 70% exit 100%;
  }
  @keyframes blockIn { from { opacity: 0; translate: 0 80px; scale: .93; } }
  @keyframes blockOut { to { opacity: .2; scale: .95; translate: 0 -30px; } }

  /* overview rows sweep in from alternating sides */
  .motion .mtable tbody tr > * { animation: rowIn linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
  .motion .mtable tbody tr:nth-child(even) > * { --dx: 50px; }
  @keyframes rowIn { from { opacity: 0; translate: var(--dx, -50px) 0; } }

  /* project cards flip up, commits and library bars slide in, all tied to scroll */
  .motion .pcard { animation: cardIn linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
  @keyframes cardIn { from { opacity: 0; translate: 0 80px; rotate: x 28deg; scale: .9; } }
  .motion .commits li { animation: slideIn linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
  .motion .commits li:nth-child(even) { --dx: 40px; }
  @keyframes slideIn { from { opacity: 0; translate: var(--dx, -40px) 0; } }
  .motion .liblist li { animation: slideIn linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
  .motion .heat-wrap { animation: heatIn linear both; animation-timeline: view(); animation-range: entry 0% cover 35%; }
  @keyframes heatIn { from { opacity: 0; scale: .9; rotate: x 30deg; } }
}
.motion.no-sda .block { transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.motion.no-sda .block:not(.seen) { opacity: 0; transform: translateY(26px) scale(.985); }
.motion.no-sda .block.seen .pcard { animation: popIn .7s cubic-bezier(.3, 1.4, .5, 1) backwards; animation-delay: calc(.15s + var(--k, 0) * 110ms); }
.motion.no-sda .block.seen .commits li { animation: fadeUp .55s backwards; animation-delay: calc(.15s + var(--k, 0) * 70ms); }
.motion.no-sda .block.seen .mtable tbody tr > * { animation: fadeUp .5s backwards; animation-delay: calc(.15s + var(--k, 0) * 50ms); }

/* theme switch: circular reveal (View Transitions, where supported) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* No .motion = nothing moves. The OS reduced-motion setting also stops the few always-on touches,
   unless the visitor switched animations back on with the dock button (which adds .motion). */
@media (prefers-reduced-motion: reduce) {
  :root:not(.motion) *:not(.motion-probe), :root:not(.motion) *::before, :root:not(.motion) *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 860px) {
  .hero { padding: calc(var(--bar-h) + 24px) 16px 76px; }
  .hero-in { flex-direction: column-reverse; align-items: flex-start; gap: 20px; }
  .ring { width: 130px; height: 130px; }
  .seg span { display: none; }
  .two { grid-template-columns: 1fr; }
  .c-weeks, .c-proj { display: none; }
  .mname small { display: block; }
  .mb-brand small { display: none; }
  .mb-in { padding: 0 12px; gap: 10px; }
  .aurora { inset: -25%; }
}
@media (max-width: 600px) {
  .mb-long { display: none; }
  .mb-in { gap: 6px; }
  .mb-nav { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px; }
  .mb-nav a { padding: 6px 10px; }
  /* overview rows become two lines: module + status, then the progress bar */
  .mtable thead { display: none; }
  .mtable tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; padding: 11px 12px 11px 14px; border-top: 1px solid var(--border); }
  .mtable tbody tr:first-child { border-top: 0; }
  .mtable tbody th, .mtable td { padding: 0; border: 0; }
  .mtable tbody td:nth-child(4) { grid-column: 1 / -1; padding-left: 46px; }
  .mrow > th, .mrow.completed > th, .mrow.in_progress > th { box-shadow: none; }
  .mrow { box-shadow: inset 4px 0 0 var(--idle); }
  .mrow.completed { box-shadow: inset 4px 0 0 var(--good); }
  .mrow.in_progress { box-shadow: inset 4px 0 0 var(--warn); }
  .mopen { gap: 12px; }
  .mname { font-size: 14px; }
  .mtable .status { padding: 3px 8px; }
  .slbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* topic tables stack: topic on one line, source + proof below */
  .ttable thead { display: none; }
  .ttable tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; padding: 10px 14px; border-top: 1px solid var(--border); }
  .ttable tbody td { padding: 0; border: 0; width: auto !important; }
  .ttable tbody td.tcell { grid-column: 1 / -1; }
  .ttable tbody td:nth-child(2) { padding-left: 22px; }
  .phead { flex-wrap: wrap; }
  .ptext { flex: 1 1 calc(100% - 50px); }
  .phead .status { margin-left: 48px; }
  .mb-brand b { font-size: 13px; }
}
@media (max-width: 520px) {
  .dock { left: 12px; bottom: 12px; gap: 6px; }
  .dbtn { width: 38px; height: 38px; }
  .toast { right: 12px; bottom: 62px; width: calc(100vw - 24px); }
  .mhead { grid-template-columns: 1fr; }
  .mring { width: 76px; height: 76px; }
  main { padding: 0 14px 48px; }
  .block { padding: 18px 14px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile .num { font-size: 26px; }
  .pcards { grid-template-columns: 1fr; }
}
@media (forced-colors: active) {
  .meter .fill, .lbar span, .seg.completed, .seg.in_progress { background: Highlight; }
}
