/* ============================================================
   Coding Challenges — design system
   Warm "paper" temperature inspired by Claude marketing pages.
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "MYC Sans";
  src: url("../fonts/myc-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MYC Sans";
  src: url("../fonts/myc-sans-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "MYC Serif";
  src: url("../fonts/myc-serif.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MYC Serif";
  src: url("../fonts/myc-serif-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "MYC Mono";
  src: url("../fonts/myc-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MYC Mono";
  src: url("../fonts/myc-mono-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* ---------- Theme tokens ---------- */
:root {
  --sans: "MYC Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "MYC Serif", ui-serif, Georgia, "Times New Roman", serif;
  --mono: "MYC Mono", ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  /* Claude clay — the single brand temperature accent, used sparingly */
  --clay: #c15f3c;
  --clay-soft: #d2785a;
  /* tint derived from --clay, so re-theming the accent (or [data-accent="off"]) cascades automatically */
  --clay-tint: color-mix(in oklab, var(--clay) 10%, transparent);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 34px;

  /* layout rhythm — fluid, so most breakpoints fall out of the clamps */
  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
  --section-y: clamp(72px, 9vw, 140px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

[data-theme="light"] {
  --paper: #faf9f5;
  --paper-2: #f3f0e7;
  --surface: #fbfaf5;
  --surface-2: #f7f5ee;
  --ink: #1a1916;
  --ink-2: #57544c;
  --ink-3: #8a857a;
  --hairline: #e7e2d4;
  --hairline-2: #efebe0;
  --shadow: 0 1px 2px rgba(40, 36, 28, 0.04), 0 18px 40px -24px rgba(40, 36, 28, 0.22);
  --shadow-lg: 0 2px 4px rgba(40, 36, 28, 0.05), 0 40px 80px -40px rgba(40, 36, 28, 0.30);
  --grid-line: rgba(26, 25, 22, 0.06);
  color-scheme: light;
}

/* Dark */
[data-theme="dark"] {
  --paper: #1b1a17;
  --paper-2: #211f1b;
  --surface: #25221a;
  --surface-2: #2c2a25;
  --ink: #f3efe6;
  --ink-2: #b1ac9f;
  --ink-3: #837e72;
  --hairline: #36332c;
  --hairline-2: #312e28;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -24px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.35), 0 40px 80px -40px rgba(0, 0, 0, 0.7);
  --grid-line: rgba(243, 239, 230, 0.06);
  --clay: #d2785a;
  --clay-soft: #de8d72;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}
::selection { background: var(--clay-tint); }
a { color: inherit; text-decoration: none; }

/* keyboard navigation: branded focus ring + hidden-until-focused skip link */
:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; border-radius: 2px; }
.skip-link {
  position: fixed; top: 0; left: 0; z-index: 200;
  transform: translateY(-110%);
  padding: 11px 20px; background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em;
  border-radius: 0 0 10px 0;
  transition: transform 0.2s var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); outline-offset: -4px; }

/* ---------- Pattern constellation ---------- */
/* Two columns: the graph stage + a fixed inspector. The inspector replaces the
   old floating tooltip (which occluded nodes/links): info always reads in the
   same place, never on top of the data. */
.const-box {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  height: 490px;            /* fixed so swapping inspector content never resizes the box */
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.const-stage { position: relative; min-width: 0; }
.const-inspector {
  border-left: 1px solid var(--hairline);
  padding: 26px;
  display: flex; flex-direction: column;
  min-width: 0;
  overflow-y: auto;         /* scroll a rare oversized detail instead of growing the box */
}
.ins-rest, .ins-detail { display: flex; flex-direction: column; gap: 13px; flex: 1; }
.ins-rest { justify-content: center; gap: 16px; }
.ins-stats { display: flex; gap: 30px; }
.ins-stats b { font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1; display: block; }
.ins-stats span { font-size: 12.5px; color: var(--ink-3); }
.ins-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.ins-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.ins-hint { font-size: 13px; color: var(--ink-3); max-width: 34ch; line-height: 1.5; }
.ins-detail { animation: insIn 0.3s var(--ease); }
@keyframes insIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.ins-meta { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.ins-title { font-family: var(--serif); font-weight: 400; font-size: clamp(21px, 2.2vw, 28px); line-height: 1.1; letter-spacing: -0.02em; }
.ins-block { display: flex; flex-direction: column; gap: 8px; }
.ins-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.ins-chip {
  font-family: var(--mono); font-size: 11.5px; padding: 4px 10px;
  border: 1px solid var(--hairline); border-radius: 999px; color: var(--ink-2);
  transition: border-color 0.2s, color 0.2s;
}
.ins-chip:hover { border-color: var(--clay); color: var(--clay); }
.ins-topics { font-size: 12px; color: var(--ink-3); }
.ins-open { align-self: flex-start; margin-top: auto; }
@media (max-width: 760px) {
  .const-box { grid-template-columns: 1fr; height: auto; }
  .const-stage { height: 320px; }
  .const-inspector { height: 500px; border-left: none; border-top: 1px solid var(--hairline); }
}
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }
p { margin: 0; }

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.eyebrow::before {
  content: "";
  width: 20px; height: 2px;
  background: var(--clay);
  border-radius: 1px;
  display: inline-block;
}

.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); }
.clay { color: var(--clay); }

/* ---------- Reveal animation (gated on JS readiness so content is visible if JS fails) ---------- */
.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}
.reveal-ready .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal-ready .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
    border-color 0.25s var(--ease), color 0.25s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--clay); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-ghost:hover { border-color: var(--ink); background: var(--surface); }
.btn-arrow { transition: transform 0.3s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.nav.scrolled { border-color: var(--hairline); }
/* full-bleed bar: brand pinned to the page's left edge, actions to the right;
   the centered wrap only applies to the page content below */
.nav-inner {
  width: 100%;
  padding-block: 14px; padding-inline: clamp(16px, 2.5vw, 32px);
  display: flex; align-items: center; gap: 26px;
  position: relative;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 500; }
.brand-mark {
  width: 28px; height: 28px; color: var(--ink);
  display: grid; place-items: center;
}
.brand-mark svg { display: block; }
.brand-name { font-size: 15.5px; letter-spacing: -0.01em; }
.brand-name b { font-weight: 600; }
/* centered on the page itself (absolute), not between brand and actions */
.nav-links { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; }
@media (max-width: 1150px) { .nav-links { display: none; } }
.nav-link {
  font-size: 14.5px; color: var(--ink-2); padding: 8px 13px; border-radius: 8px;
  transition: color 0.2s;
  position: relative;
}
.nav-link:hover { color: var(--ink); }
/* hover = a loading-style ring: a clay arc spinning over a hairline track,
   drawn by a masked conic gradient so only the 1.5px border is painted */
@property --nl-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.nav-link::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--nl-angle),
    var(--clay) 0 90deg, var(--hairline) 90deg 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0; transition: opacity 0.2s;
  pointer-events: none;
}
.nav-link:hover::after { opacity: 1; animation: nl-spin 1.1s linear infinite; }
@keyframes nl-spin { to { --nl-angle: 360deg; } }
@media (prefers-reduced-motion: reduce) { .nav-link:hover::after { animation: none; } }
.nav-spacer { flex: 1; }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* mobile menu — the hamburger replaces the centered links below 1150px
   (scoped selector: it must outrank .theme-toggle's display, declared later) */
.nav-actions .nav-menu-btn { display: none; }
@media (max-width: 1150px) { .nav-actions .nav-menu-btn { display: inline-grid; } }
.nav-sheet {
  display: flex; flex-direction: column;
  padding: 8px clamp(16px, 2.5vw, 32px) 14px;
  border-top: 1px solid var(--hairline);
}
.nav-sheet-link {
  padding: 13px 4px; font-size: 15.5px; color: var(--ink-2);
  border-bottom: 1px solid var(--hairline-2); transition: color 0.2s;
}
.nav-sheet-link:last-child { border-bottom: none; }
.nav-sheet-link:hover { color: var(--ink); }

/* compact bar on small screens: tighter gutters, icon-only GitHub, then
   logo-only brand — keeps every nav (home + inner pages) inside 375px */
@media (max-width: 640px) {
  .nav-inner { gap: 12px; padding-inline: 14px; }
  .nav-gh { padding-left: 12px; padding-right: 12px; }
  .nav-gh .nav-gh-label { display: none; }
  .cback { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 480px) {
  /* collapse the nav brand to just the mark on small screens; the footer
     brand keeps its name (scoped so it isn't hidden too). */
  .nav .brand-name { display: none; }
}

.theme-toggle {
  width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--surface);
  cursor: pointer; display: grid; place-items: center; color: var(--ink);
  transition: border-color 0.2s, transform 0.4s var(--ease);
}
.theme-toggle:hover { border-color: var(--ink-2); }
.theme-toggle svg { width: 17px; height: 17px; }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; padding: 86px 0 64px; overflow: hidden; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em;
  padding: 7px 14px 7px 11px; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--surface);
  color: var(--ink-2); box-shadow: var(--shadow);
  max-width: max-content;
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--clay); box-shadow: 0 0 0 4px var(--clay-tint); }
.hero-grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(120% 90% at 70% 10%, #000 30%, transparent 78%);
  mask-image: radial-gradient(120% 90% at 70% 10%, #000 30%, transparent 78%);
}
.hero-inner { position: relative; z-index: 1; }
.hero-top { display: flex; flex-direction: column; gap: 22px; max-width: 900px; }
.hero-title {
  font-family: var(--serif);
  font-weight: 460;
  font-size: clamp(42px, 7.2vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero-title em { font-style: italic; color: var(--clay); }
.hero-sub {
  font-size: clamp(17px, 2vw, 21px);
  color: var(--ink-2); max-width: 600px; line-height: 1.55;
}
.lede { font-size: clamp(18px, 2vw, 22px); color: var(--ink-2); line-height: 1.5; text-wrap: pretty; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.hero-meta {
  margin-top: 16px; display: flex; gap: 22px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-3);
  letter-spacing: 0.04em;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta span::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--clay); opacity: 0.8;
}

/* ============================================================
   STATS STRIP
   ============================================================ */
.stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden; margin-top: 54px;
  box-shadow: var(--shadow);
}
@media (max-width: 980px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 26px 28px; border-right: 1px solid var(--hairline); }
.stat:last-child { border-right: none; }
@media (max-width: 980px) {
  .stat { border-bottom: 1px solid var(--hairline); }
}
@media (max-width: 720px) {
  .stat:nth-child(2n) { border-right: none; }
}
.stat-num {
  font-family: var(--serif); font-size: 46px; line-height: 1;
  letter-spacing: -0.03em; font-feature-settings: "tnum";
}
.stat-num small { font-size: 24px; color: var(--clay); }
.stat-label {
  margin-top: 9px; font-family: var(--mono); font-size: 11.5px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3);
}
.stat-sub { margin-top: 5px; font-size: 11px; color: var(--ink-3); opacity: 0.75; letter-spacing: 0.02em; }

/* ============================================================
   SECTION scaffolding
   ============================================================ */
section { position: relative; }
.section { padding-block: var(--section-y); transition: background 0.5s var(--ease); }
/* alternating section bands — odd sections take the tinted ground tone, so the
   page stays striped automatically no matter how sections are added/reordered */
.section:nth-of-type(odd) { background: var(--paper-2); }
.band-tint { background: var(--paper-2); }
.section-head { max-width: 760px; margin-bottom: 46px; }
.section-head h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(30px, 4.4vw, 52px); line-height: 1.04;
  letter-spacing: -0.03em; margin-top: 16px; text-wrap: balance;
}
.section-head p { margin-top: 16px; font-size: 18px; color: var(--ink-2); max-width: 620px; }
.rule { height: 1px; background: var(--hairline); border: 0; margin: 0; }

/* ---------- Global search (home) ---------- */
#search.section { padding-block: calc(var(--section-y) * 0.6); }
.gsearch-head { max-width: 640px; margin-inline: auto; text-align: center; }
.gsearch-head h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(26px, 3.6vw, 40px); line-height: 1.06;
  letter-spacing: -0.03em; margin-top: 14px; text-wrap: balance;
}
.gsearch-head p { margin-top: 12px; font-size: 16.5px; color: var(--ink-2); }
.gsearch-box { max-width: 620px; margin: 28px auto 0; height: 52px; box-shadow: var(--shadow); }
.gsearch-box input { font-size: 16px; }
.gsearch-results { margin-top: 4px; }
.gsearch-results .ptable { margin-top: 10px; }
.gsearch-results .prow:first-child { border-radius: var(--r-md) var(--r-md) 0 0; }

/* ---------- Principles ---------- */
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 980px) { .principles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .principles { grid-template-columns: 1fr; } }
.principle {
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: 24px 22px; background: var(--surface);
  transition: transform 0.4s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.principle:hover { transform: translateY(-4px); border-color: var(--ink-3); box-shadow: var(--shadow); }
.principle-idx { font-family: var(--mono); font-size: 12px; color: var(--clay); letter-spacing: 0.1em; }
.principle h3 { font-size: 19px; margin-top: 16px; font-weight: 550; }
.principle p { margin-top: 9px; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }

/* ============================================================
   ARCHITECTURE DIAGRAM
   ============================================================ */
.arch {
  border: 1px solid var(--hairline); border-radius: var(--r-xl);
  background: var(--surface); padding: 40px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.arch-grid-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 30px 30px;
}
.arch-inner { position: relative; z-index: 1; }
.arch-root {
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--mono); font-size: 14px; padding: 10px 16px;
  border: 1px solid var(--hairline); border-radius: 999px; background: var(--paper);
  margin: 0 auto 8px; 
}
.arch-root b { color: var(--clay); }
.arch-layers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
@media (max-width: 860px) { .arch-layers { grid-template-columns: 1fr; } }
.layer {
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  background: var(--paper); padding: 22px; position: relative;
  transition: border-color 0.3s, transform 0.4s var(--ease);
}
.layer:hover { border-color: var(--clay); transform: translateY(-3px); }
.layer-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--clay);
}
.layer h4 { font-size: 18px; margin-top: 8px; font-weight: 550; }
.layer-desc { font-size: 13.5px; color: var(--ink-2); margin-top: 7px; line-height: 1.5; }
.layer-list { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 7px; }
.node {
  font-family: var(--mono); font-size: 12px; color: var(--ink-2);
  padding: 4px 10px; border-radius: 7px; background: var(--surface-2);
  border: 1px solid var(--hairline-2);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.layer:hover .node { border-color: var(--hairline); }
.node:hover { color: var(--ink); border-color: var(--clay); }
.arch-flow {
  margin-top: 26px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-3);
}
.arch-flow .pill {
  padding: 6px 12px; border: 1px dashed var(--hairline); border-radius: 999px;
}
.arch-flow .arrow { color: var(--clay); }

/* ============================================================
   PROJECTS / PLATFORMS GRID
   ============================================================ */
.grid-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-cards { grid-template-columns: 1fr; } }
.pcard {
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  background: var(--surface); padding: 22px; cursor: pointer;
  display: flex; flex-direction: column; min-height: 168px;
  transition: transform 0.4s var(--ease), border-color 0.3s, box-shadow 0.3s, background 0.3s;
  position: relative; overflow: hidden;
}
.pcard:hover { transform: translateY(-5px); border-color: var(--ink-3); box-shadow: var(--shadow-lg); }
.pcard-top { display: flex; align-items: center; justify-content: space-between; }
.pcard-icon {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  font-family: var(--mono); font-weight: 600; font-size: 17px; color: #fff;
  letter-spacing: -0.02em;
}
.pcard-count {
  font-family: var(--mono); font-size: 12px; color: var(--ink-3);
  border: 1px solid var(--hairline); border-radius: 999px; padding: 3px 9px;
}
.pcard h3 { font-size: 18px; margin-top: 18px; font-weight: 550; }
.pcard p { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.5; flex: 1; }
.pcard-foot {
  margin-top: 16px; display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.pcard-go {
  margin-left: auto; color: var(--clay); transition: transform 0.3s var(--ease); opacity: 0;
}
.pcard:hover .pcard-go { opacity: 1; transform: translateX(2px); }

/* ============================================================
   SOLUTION PREVIEW (explorable)
   ============================================================ */
.sol {
  border: 1px solid var(--hairline); border-radius: var(--r-xl);
  background: var(--surface); overflow: hidden; box-shadow: var(--shadow-lg);
}
.sol-head {
  display: flex; align-items: center; gap: 14px; padding: 18px 22px;
  border-bottom: 1px solid var(--hairline); background: var(--surface-2);
}
.sol-dots { display: flex; gap: 7px; }
.sol-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--hairline); display: block; }
.sol-path { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.sol-path b { color: var(--ink); }
.sol-badge {
  margin-left: auto; font-family: var(--mono); font-size: 11px; padding: 4px 10px;
  border-radius: 999px; background: var(--clay-tint); color: var(--clay); letter-spacing: 0.06em;
}
.sol-tabs { display: flex; gap: 2px; padding: 12px 18px 0; border-bottom: 1px solid var(--hairline); flex-wrap: wrap; }
.sol-tab {
  font-family: var(--mono); font-size: 12.5px; padding: 9px 14px; cursor: pointer;
  color: var(--ink-3); border-radius: 8px 8px 0 0; position: relative;
  transition: color 0.2s, background 0.2s; display: flex; align-items: center; gap: 8px;
}
.sol-tab:hover { color: var(--ink-2); background: var(--surface-2); }
.sol-tab.active { color: var(--ink); }
.sol-tab.active::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px;
  background: var(--clay); border-radius: 2px;
}
.sol-tab .dot { width: 7px; height: 7px; border-radius: 50%; }
.sol-body { display: grid; grid-template-columns: 1.35fr 1fr; min-height: 360px; }
@media (max-width: 820px) { .sol-body { grid-template-columns: 1fr; } }
.sol-code {
  margin: 0; padding: 22px 24px; font-family: var(--mono); font-size: 13px;
  line-height: 1.7; overflow: auto; color: var(--ink); tab-size: 2;
  background: var(--surface);
}
.sol-code .ln { color: var(--ink-3); user-select: none; display: inline-block; width: 28px; }
/* highlight.js tokens mapped onto the warm palette (keyword=clay, string=green,
   number=violet, comment=faint italic). Scoped to .sol-code so the plain-text
   homepage preview is untouched. */
.sol-code .hljs-keyword, .sol-code .hljs-built_in, .sol-code .hljs-literal,
.sol-code .hljs-type, .sol-code .hljs-name, .sol-code .hljs-tag,
.sol-code .hljs-selector-tag, .sol-code .hljs-meta .hljs-keyword { color: var(--clay); }
.sol-code .hljs-title, .sol-code .hljs-title.function_, .sol-code .hljs-title.class_,
.sol-code .hljs-section { color: var(--ink); font-weight: 600; }
.sol-code .hljs-string, .sol-code .hljs-regexp, .sol-code .hljs-char.escape_,
.sol-code .hljs-meta .hljs-string, .sol-code .hljs-addition { color: #5b8a72; }
.sol-code .hljs-number, .sol-code .hljs-symbol, .sol-code .hljs-bullet,
.sol-code .hljs-link, .sol-code .hljs-deletion { color: #9a7bd0; }
.sol-code .hljs-comment, .sol-code .hljs-quote { color: var(--ink-3); font-style: italic; }
.sol-code .hljs-attr, .sol-code .hljs-attribute, .sol-code .hljs-property,
.sol-code .hljs-variable, .sol-code .hljs-template-variable, .sol-code .hljs-params { color: var(--ink-2); }
.sol-code .hljs-meta { color: var(--ink-3); }
[data-theme="dark"] .sol-code .hljs-string, [data-theme="dark"] .sol-code .hljs-regexp,
[data-theme="dark"] .sol-code .hljs-char.escape_, [data-theme="dark"] .sol-code .hljs-meta .hljs-string,
[data-theme="dark"] .sol-code .hljs-addition { color: #8fc0a3; }
[data-theme="dark"] .sol-code .hljs-number, [data-theme="dark"] .sol-code .hljs-symbol,
[data-theme="dark"] .sol-code .hljs-bullet, [data-theme="dark"] .sol-code .hljs-link,
[data-theme="dark"] .sol-code .hljs-deletion { color: #b79ae0; }
.sol-side {
  border-left: 1px solid var(--hairline); padding: 22px 24px; background: var(--surface-2);
  overflow: auto;
}
@media (max-width: 820px) { .sol-side { border-left: none; border-top: 1px solid var(--hairline); } }
.sol-side h5 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 6px; }
.sol-side h5:not(:first-child) { margin-top: 22px; }
.sol-side p { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.cx-row { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 13px; padding: 7px 0; border-bottom: 1px dashed var(--hairline); }
.cx-row b { color: var(--clay); }

/* ============================================================
   PATTERNS
   ============================================================ */
.pat-cloud { display: flex; flex-wrap: wrap; gap: 11px; }
.pat {
  font-family: var(--mono); font-size: 14px; padding: 10px 16px;
  border: 1px solid var(--hairline); border-radius: 999px; background: var(--surface);
  color: var(--ink-2); cursor: default;
  transition: transform 0.3s var(--ease), border-color 0.3s, color 0.3s, background 0.3s;
  display: inline-flex; align-items: center; gap: 9px;
}
.pat:hover { transform: translateY(-3px); border-color: var(--clay); color: var(--ink); }
.pat .c { font-size: 11px; color: var(--ink-3); }
.pat:hover .c { color: var(--clay); }

/* ============================================================
   LANGUAGES marquee
   ============================================================ */
.lang-marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.lang-track { display: flex; gap: 14px; width: max-content; animation: scrollx 38s linear infinite; }
.lang-marquee:hover .lang-track { animation-play-state: paused; }
@keyframes scrollx { to { transform: translateX(-50%); } }
.lang {
  font-family: var(--mono); font-size: 15px; padding: 12px 20px;
  border: 1px solid var(--hairline); border-radius: var(--r-sm); background: var(--surface);
  white-space: nowrap; display: inline-flex; align-items: center; gap: 10px;
}
.lang .sw { width: 9px; height: 9px; border-radius: 2px; }

/* ============================================================
   ROADMAP / FOOTER
   ============================================================ */
.road { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
@media (max-width: 900px) { .road { grid-template-columns: 1fr; } }
.phase { padding: 24px 22px 24px 0; border-top: 2px solid var(--hairline); position: relative; }
.phase::before {
  content: ""; position: absolute; top: -6px; left: 0; width: 10px; height: 10px;
  border-radius: 50%; background: var(--clay);
}
.phase.future::before { background: var(--ink-3); }
.phase-n { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.1em; }
.phase h4 { font-size: 16px; margin-top: 10px; font-weight: 550; }
.phase ul { margin: 12px 0 0; padding: 0; list-style: none; }
.phase li { font-size: 13px; color: var(--ink-2); padding: 3px 0; }
.phase-item { display: flex; align-items: center; gap: 8px; }
.phase-tick { display: inline-flex; width: 13px; height: 13px; flex: none; color: var(--clay); }
.phase-item.is-done { color: var(--ink); }
.phase-item:not(.is-done) .phase-tick::before {
  content: ""; width: 7px; height: 7px; margin: auto; border-radius: 50%;
  border: 1.5px solid var(--hairline-2);
}

/* ---------- Learning timeline ---------- */
.tl { border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--surface); padding: 26px 26px 22px; box-shadow: var(--shadow); }
.tl-stats { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 26px 44px; padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid var(--hairline); }
.tl-n { font-family: var(--serif); font-size: 32px; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.tl-span { font-family: var(--serif); font-size: 19px; line-height: 1.1; letter-spacing: -0.01em; color: var(--ink); }
.tl-l { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-top: 7px; }
.tl-range { margin-left: auto; text-align: right; }
.tl-chart { display: flex; align-items: flex-end; gap: 6px; height: 184px; }
.tl-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; }
.tl-bar-wrap { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.tl-count { font-size: 11px; color: var(--ink-3); }
.tl-bar { width: 100%; max-width: 44px; min-height: 3px; background: var(--clay); border-radius: 5px 5px 0 0; }
.tl-bar.empty { background: var(--hairline-2); min-height: 2px; }
.tl-bar.future { opacity: 0.38; }
.tl-x.future { opacity: 0.5; }
.tl-bar.peak { background: var(--ink); }
.tl-x { font-size: 10.5px; color: var(--ink-3); margin-top: 9px; white-space: nowrap; }
.tl-axis { display: flex; justify-content: space-between; margin-top: 12px; font-size: 11px; color: var(--ink-3); }
.tl-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.tl-cap { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.tl-head .psel select { height: 38px; padding: 8px 34px 8px 13px; font-size: 13.5px; }
.tl-empty { margin-top: 14px; font-size: 12px; color: var(--ink-3); letter-spacing: 0.06em; }

/* technical article reader (src/article.html) */
.art { max-width: 760px; margin: 0 auto; }
.art-head { margin-bottom: 36px; }
.art-head h1 { font-size: clamp(30px, 4.6vw, 44px); line-height: 1.12; letter-spacing: -0.02em; margin-top: 16px; }
.art-meta { display: flex; gap: 9px; margin-top: 16px; font-size: 12px; letter-spacing: 0.08em; color: var(--ink-3); }
.art-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.art-summary { margin-top: 20px; font-size: 17.5px; line-height: 1.6; color: var(--ink-2); font-style: italic; border-left: 3px solid var(--clay); padding-left: 16px; }
.art-body { font-size: 16.5px; }
.art-more { max-width: 760px; margin: 56px auto 0; padding-top: 28px; border-top: 1px solid var(--hairline); }
.art-more-t { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.art-row { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding: 13px 2px; border-bottom: 1px solid var(--hairline-2); text-decoration: none; }
.art-row:hover .art-row-title { color: var(--clay); }
.art-row-title { color: var(--ink); font-weight: 500; transition: color 0.2s; }
.art-row-meta { flex: none; font-size: 11.5px; color: var(--ink-3); }

/* writing index (src/articles.html) */
.artl { max-width: 860px; margin: 0 auto; }
.artl-head { margin-bottom: 30px; }
.artl-head h1 { font-size: clamp(28px, 4.2vw, 40px); line-height: 1.12; letter-spacing: -0.02em; margin-top: 16px; }
.artl-head p { margin-top: 14px; color: var(--ink-2); max-width: 560px; line-height: 1.6; }
.artl-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 28px;
  padding: 24px 2px; border-bottom: 1px solid var(--hairline); text-decoration: none;
}
.artl-row:first-of-type { border-top: 1px solid var(--hairline); }
.artl-row h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); transition: color 0.2s; }
.artl-row:hover h3 { color: var(--clay); }
.artl-row p { margin-top: 8px; color: var(--ink-2); line-height: 1.55; font-size: 14.5px; max-width: 560px; }
.artl-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.artl-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 11.5px; color: var(--ink-3); padding-top: 4px; white-space: nowrap; }
@media (max-width: 700px) {
  .artl-row { flex-direction: column; gap: 12px; }
  .artl-meta { flex-direction: row; align-items: baseline; gap: 12px; }
}

/* skill-gap analysis */
.gap { border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--surface); padding: 26px; box-shadow: var(--shadow); }
.gap-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 34px; }
.gap-t { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin-bottom: 16px; }
.gap-row { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.gap-dl { width: 64px; flex: none; font-size: 13.5px; color: var(--ink-2); }
.gap-track { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--hairline-2); overflow: hidden; }
.gap-fill { height: 100%; border-radius: 99px; min-width: 2px; }
.gap-dn { flex: none; font-size: 11.5px; color: var(--ink-3); min-width: 64px; text-align: right; }
.gap-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.gap-chips a.node { text-decoration: none; }
.gap-miss { border-style: dashed; background: none; color: var(--ink-3); }
.gap-none { font-size: 12px; color: var(--ink-3); }
.gap-foot { display: flex; flex-wrap: wrap; gap: 10px 30px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--hairline); font-size: 11.5px; letter-spacing: 0.07em; color: var(--ink-3); }
@media (max-width: 880px) {
  .gap-grid { grid-template-columns: 1fr; gap: 26px; }
}

/* GitHub-style heatmap (timeline "last year" window) */
.hm { display: flex; gap: 10px; }
.hm-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; padding-top: 18px; font-size: 9.5px; color: var(--ink-3); }
.hm-days span { display: flex; align-items: center; }
.hm-scroll { flex: 1; min-width: 0; overflow-x: auto; }
.hm-months { display: grid; gap: 3px; height: 15px; margin-bottom: 3px; font-size: 10px; color: var(--ink-3); }
.hm-months span { white-space: nowrap; overflow: visible; }
.hm-grid { display: grid; gap: 3px; }
.hm-week { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.hm-cell { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--clay); }
.hm-cell.zero { background: var(--hairline-2); }
.hm-cell.peak { background: var(--ink); }
.hm-cell.pad { background: var(--hairline-2); opacity: 0.55; }
@media (max-width: 640px) {
  .tl { padding: 20px 18px 18px; }
  .tl-chart { height: 140px; gap: 3px; }
  .tl-x { font-size: 9px; margin-top: 6px; }
  .tl-range { margin-left: 0; text-align: left; }
}

/* dark "fat footer" — a Claude near-black band that closes the page (both themes) */
.footer {
  background: #1a1712; color: var(--paper);
  padding: 80px 0 44px; margin-top: 0;
  --grid-line: rgba(243, 239, 230, 0.05);
}
.footer-cta {
  border: 1px solid rgba(243, 239, 230, 0.12); border-radius: var(--r-xl);
  background: rgba(243, 239, 230, 0.04);
  padding: 52px 44px; text-align: center; position: relative; overflow: hidden;
}
.footer-cta h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 5vw, 54px); letter-spacing: -0.03em; color: var(--paper); }
.footer-cta p { margin: 16px auto 0; color: rgba(243, 239, 230, 0.66); max-width: 480px; }
.footer-cta .hero-cta { justify-content: center; margin-top: 26px; }
.footer .eyebrow { color: rgba(243, 239, 230, 0.62); }
.footer .btn-primary { background: var(--paper); color: #1a1712; }
.footer .btn-primary:hover { background: var(--clay); color: #fff; }
.footer .btn-ghost { color: var(--paper); border-color: rgba(243, 239, 230, 0.25); }
.footer .btn-ghost:hover { border-color: var(--paper); background: rgba(243, 239, 230, 0.08); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-top: 48px; padding-top: 26px; border-top: 1px solid rgba(243, 239, 230, 0.1);
  flex-wrap: wrap; font-size: 13.5px; color: rgba(243, 239, 230, 0.5);
}
/* the band inverts ink/paper per theme, so var(--paper) is the right
   foreground in both light (cream on dark) and dark (dark on cream). */
.footer-bottom .brand { color: var(--paper); }
.footer-bottom .brand img { width: 26px; height: 26px; border-radius: 50%; display: block; object-fit: cover; }
.footer-bottom .brand-name { font-size: 15px; font-weight: 500; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--paper); opacity: 0.66; transition: opacity 0.2s, color 0.2s; }
.footer-links a:hover { opacity: 1; color: var(--clay); }
.footer-note { color: var(--paper); opacity: 0.5; }
@media (max-width: 640px) {
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* On the dark theme the closing band inverts to a light palette card —
   var(--ink)/var(--paper) swap roles, so the cream/near-black pairing of the
   light theme is mirrored instead of stacking dark on dark. */
[data-theme="dark"] .footer {
  background: var(--ink); color: var(--paper);
  --grid-line: rgba(27, 26, 23, 0.07);
}
[data-theme="dark"] .footer-cta { border-color: rgba(27, 26, 23, 0.14); background: rgba(27, 26, 23, 0.05); }
[data-theme="dark"] .footer-cta p { color: rgba(27, 26, 23, 0.68); }
[data-theme="dark"] .footer .eyebrow { color: rgba(27, 26, 23, 0.62); }
[data-theme="dark"] .footer .btn-primary { background: var(--paper); color: var(--ink); }
[data-theme="dark"] .footer .btn-primary:hover { background: var(--clay); color: #fff; }
[data-theme="dark"] .footer .btn-ghost { color: var(--paper); border-color: rgba(27, 26, 23, 0.3); }
[data-theme="dark"] .footer .btn-ghost:hover { border-color: var(--paper); background: rgba(27, 26, 23, 0.06); }
[data-theme="dark"] .footer-bottom { border-top-color: rgba(27, 26, 23, 0.14); color: rgba(27, 26, 23, 0.55); }

/* ============================================================
   Variant: Terminal  (data-variant="terminal")
   ============================================================ */
[data-variant="terminal"] {
  --paper: #f4f1e8;
}
[data-variant="terminal"][data-theme="dark"] { --paper: #16150f; }
[data-variant="terminal"] .hero-title { font-family: var(--mono); font-weight: 500; font-size: clamp(34px, 5.4vw, 70px); letter-spacing: -0.02em; line-height: 1.05; }
[data-variant="terminal"] .hero-title em { font-style: normal; }
[data-variant="terminal"] .section-head h2,
[data-variant="terminal"] .footer-cta h2,
[data-variant="terminal"] .hero-title { }
[data-variant="terminal"] .section-head h2 { font-family: var(--mono); font-weight: 500; letter-spacing: -0.01em; }
[data-variant="terminal"] .stat-num { font-family: var(--mono); }
[data-variant="terminal"] .pcard, [data-variant="terminal"] .principle,
[data-variant="terminal"] .arch, [data-variant="terminal"] .layer { border-radius: 6px; }
[data-variant="terminal"] .hero-grid-bg { background-size: 32px 32px; opacity: 0.9; }

/* ============================================================
   Variant: Index  (data-variant="index")  — magazine / numbered
   ============================================================ */
[data-variant="index"] .section-head { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start; max-width: 920px; }
[data-variant="index"] .section-head .sec-no {
  font-family: var(--serif); font-size: 54px; line-height: 0.9; color: var(--clay); opacity: 0.5;
}
[data-variant="index"] .hero-title { font-size: clamp(54px, 9vw, 120px); }
.sec-no { display: none; }
[data-variant="index"] .sec-no { display: block; }

/* accent off — pure warm monochrome */
[data-accent="off"] {
  --clay: var(--ink);
  --clay-soft: var(--ink-2);
  --clay-tint: var(--surface-2);
}
[data-accent="off"] .brand-mark::after { opacity: 0; }
[data-accent="off"] .sol-code .hljs-keyword, [data-accent="off"] .sol-code .hljs-built_in,
[data-accent="off"] .sol-code .hljs-literal, [data-accent="off"] .sol-code .hljs-type,
[data-accent="off"] .sol-code .hljs-name, [data-accent="off"] .sol-code .hljs-tag,
[data-accent="off"] .sol-code .hljs-meta .hljs-keyword { color: var(--ink); font-weight: 600; }
[data-accent="off"] .sol-code .hljs-string, [data-accent="off"] .sol-code .hljs-regexp,
[data-accent="off"] .sol-code .hljs-number, [data-accent="off"] .sol-code .hljs-symbol { color: var(--ink-2); }

/* utility */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.hide { display: none !important; }

/* ============================================================
   CHALLENGE DETAIL PAGE
   ============================================================ */
.cpage { padding-top: 40px; animation: cc-page-in 0.55s var(--ease) both; }
@keyframes cc-page-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .cpage { animation: none; } }
.crumb {
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); letter-spacing: 0.03em;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.crumb a { color: var(--ink-3); transition: color 0.2s; }
.crumb a:hover { color: var(--clay); }
.crumb b { color: var(--ink-2); }
.crumb .sep { opacity: 0.5; }
.chead { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.cid-pill {
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: 0.04em; color: var(--clay);
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid color-mix(in oklch, var(--clay) 38%, transparent);
  background: color-mix(in oklch, var(--clay) 8%, transparent);
}
.chead h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 6vw, 66px);
  letter-spacing: -0.03em; line-height: 1.0; margin-top: 4px;
}
.chead h1 .num { color: var(--clay); }
.cmeta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chip {
  font-family: var(--mono); font-size: 12.5px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 7px;
}
.chip .d { width: 7px; height: 7px; border-radius: 50%; }
.chip.solid { color: #fff; border-color: transparent; }

.clayout { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 44px; align-items: start; }
@media (max-width: 940px) { .clayout { grid-template-columns: 1fr; } }
.cpanel-sticky { position: sticky; top: 84px; }

/* code viewer reuse .sol styles; bigger here */
.cviewer .sol-body { grid-template-columns: 1fr; min-height: 0; }
.cviewer .sol-code { min-height: 420px; max-height: 560px; }

/* markdown reader */
.md { max-width: 100%; }
.md h2 {
  font-family: var(--serif); font-weight: 400; font-size: 27px; letter-spacing: -0.02em;
  margin: 36px 0 14px; line-height: 1.2;
}
.md h2:first-child { margin-top: 0; }
.md h3 { font-size: 16px; font-weight: 600; margin: 26px 0 10px; letter-spacing: 0; }
.md p { font-size: 15.5px; color: var(--ink-2); line-height: 1.72; margin: 0 0 14px; }
.md ul, .md ol { margin: 0 0 16px; padding-left: 22px; }
.md li { font-size: 15.5px; color: var(--ink-2); line-height: 1.7; margin: 5px 0; }
.md li::marker { color: var(--clay); }
.md strong { color: var(--ink); font-weight: 600; }
.md em { font-style: italic; }
.md a { color: var(--clay); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.md code {
  font-family: var(--mono); font-size: 13px; background: var(--surface-2);
  border: 1px solid var(--hairline-2); padding: 1px 6px; border-radius: 6px; color: var(--ink);
}
.md blockquote {
  margin: 0 0 16px; padding: 14px 18px; border-left: 2px solid var(--clay);
  background: var(--clay-tint); border-radius: 0 10px 10px 0;
}
.md blockquote p { margin: 0; color: var(--ink); font-style: italic; }
.md pre.block {
  margin: 0 0 18px; padding: 18px 20px; background: var(--surface-2);
  border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: auto;
  font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--ink); tab-size: 2;
}
.md hr { border: 0; border-top: 1px solid var(--hairline); margin: 28px 0; }

/* Complexity comparison: one card per proposal — the file name + goal in the
   header, Time/Space as a small stat grid below. The card background alternates
   between proposals so each proposal reads as a distinct unit. */
.cxfacets { display: flex; flex-direction: column; gap: 12px; }
.cxcard {
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  background: var(--surface); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 13px;
}
.cxcard.alt { background: var(--surface-2); }
.cxcard-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; }
.cxcard-name { font-family: var(--mono); font-size: 13.5px; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.cxcard-name .d { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cxcard-goal {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-2); border: 1px solid var(--hairline); border-radius: 999px; padding: 3px 10px;
}
.cxcard-stats { display: flex; flex-direction: column; gap: 11px; }
.cxstat { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cxstat-l { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.cxstat-v { font-family: var(--mono); font-size: 13px; color: var(--clay); overflow-wrap: anywhere; }

/* Project-repo card: project-style challenges link out to GitHub instead of
   inlining code. Shown in the Solution tab when metadata.json has a `repo`. */
.proj-card {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; border: 1px solid var(--hairline); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.proj-card:hover { border-color: var(--clay); background: var(--surface-2); }
.proj-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--paper-2); color: var(--ink); }
.proj-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.proj-kicker { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.proj-title { font-family: var(--serif); font-size: 18px; }
.proj-desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.proj-url { font-size: 12px; color: var(--clay); overflow-wrap: anywhere; margin-top: 2px; }
.proj-arrow { flex: none; color: var(--ink-3); transition: transform 0.2s var(--ease), color 0.2s var(--ease); }
.proj-card:hover .proj-arrow { color: var(--clay); transform: translateX(3px); }

.cback {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px;
  color: var(--ink-2); padding: 7px 13px; border: 1px solid var(--hairline); border-radius: 999px;
  transition: border-color 0.2s, color 0.2s;
}
.cback:hover { border-color: var(--ink-2); color: var(--ink); }
.cback svg { transform: rotate(180deg); }

/* loading / error / notes extras */
.cloading {
  display: flex; align-items: center; gap: 12px; padding: 80px 0; color: var(--ink-2);
  font-family: var(--mono); font-size: 14px;
}
.spin {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--hairline);
  border-top-color: var(--clay); animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.cerror { padding: 70px 0; }
.cnote {
  font-size: 15px; color: var(--ink-2); line-height: 1.6; width: 100%;
  padding: 14px 18px; background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--r-md);
}
.md .mdh1 { display: none; } /* notes.md repeats the title as H1 — page header already shows it */
.md h4.mdh4 { font-size: 15px; font-weight: 600; margin: 20px 0 8px; }

/* per-variant rationale panel */
.vrat { margin-top: 16px; border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 18px 20px; background: var(--surface-2); }
.vrat-cx { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; margin-bottom: 6px; }
.vrat-cx .cx-row { border-bottom: none; padding: 4px 0; }
.vrat h5 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin: 16px 0 6px; }
.vrat p { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; margin: 0; }

.cgrid2 { display: grid; grid-template-columns: 1fr 1.1fr; gap: 26px; align-items: start; }
@media (max-width: 940px) { .cgrid2 { grid-template-columns: 1fr; } }
.md-compact h2 { font-size: 20px; margin: 20px 0 8px; }
.md-compact h2:first-child { margin-top: 0; }
.md-compact p, .md-compact li { font-size: 13.5px; }
.md-compact pre.block { font-size: 12px; padding: 10px 14px; }

.cback-wide { }

/* ============================================================
   PLATFORM INDEX PAGE
   ============================================================ */
.phead { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; margin-top: 24px; }
@media (max-width: 640px) { .phead { grid-template-columns: auto 1fr; } .phead-count { display: none; } }
.phead-icon { width: 58px; height: 58px; border-radius: 15px; font-size: 22px; }
.phead h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 5vw, 50px); letter-spacing: -0.03em; line-height: 1; }
.phead p { color: var(--ink-2); margin-top: 8px; font-size: 15.5px; max-width: 560px; }
.phead-count { text-align: right; }
.phead-count .n { font-family: var(--serif); font-size: 44px; line-height: 1; letter-spacing: -0.03em; }
.phead-count .l { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }

.pcontrols { display: flex; gap: 14px; align-items: center; margin-top: 34px; flex-wrap: wrap; }
.psearch {
  flex: 1; min-width: 240px; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--hairline); background: var(--surface); border-radius: 999px;
  padding: 0 16px; color: var(--ink-3); height: 44px; transition: border-color 0.2s;
}
.psearch:focus-within { border-color: var(--ink-3); }
.psearch input { flex: 1; border: none; background: none; outline: none; font-family: var(--sans); font-size: 15px; color: var(--ink); height: 100%; }
.psearch input::placeholder { color: var(--ink-3); }
.psearch-x { border: none; background: none; cursor: pointer; color: var(--ink-3); display: grid; place-items: center; padding: 4px; border-radius: 50%; }
.psearch-x:hover { color: var(--ink); background: var(--surface-2); }
.pfilters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 999px; padding: 3px; }
.seg-b {
  font-family: var(--sans); font-size: 13.5px; padding: 7px 14px; border: none; background: none;
  cursor: pointer; color: var(--ink-2); border-radius: 999px; transition: background 0.2s, color 0.2s;
}
.seg-b:hover { color: var(--ink); }
.seg-b.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.psel { position: relative; display: inline-flex; align-items: center; }
.psel select {
  appearance: none; -webkit-appearance: none; font-family: var(--sans); font-size: 14px;
  padding: 10px 36px 10px 14px; border: 1px solid var(--hairline); background: var(--surface);
  color: var(--ink); border-radius: 999px; cursor: pointer; height: 44px;
}
.psel svg { position: absolute; right: 13px; transform: rotate(90deg); pointer-events: none; color: var(--ink-3); }

.pcount { margin-top: 20px; font-size: 12px; color: var(--ink-3); letter-spacing: 0.06em; }

/* platform index stats panel (per-platform breakdowns from the index) */
.pstats {
  margin-top: 28px;
  display: grid; grid-template-columns: minmax(210px, 1fr) minmax(170px, 0.9fr) minmax(260px, 1.7fr);
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  background: var(--surface); overflow: hidden; box-shadow: var(--shadow);
}
@media (max-width: 820px) { .pstats { grid-template-columns: 1fr; } }
.pstat-col { padding: 20px 22px; border-right: 1px solid var(--hairline); }
.pstat-col:last-child { border-right: none; }
@media (max-width: 820px) {
  .pstat-col { border-right: none; border-bottom: 1px solid var(--hairline); }
  .pstat-col:last-child { border-bottom: none; }
}
.pstat-h {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 14px; display: flex; align-items: baseline; gap: 8px;
}
.pstat-n { text-transform: none; letter-spacing: 0.02em; opacity: 0.7; font-size: 10.5px; }
.pstat-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.pstat-bar > span { display: block; min-width: 4px; }
.pstat-legend { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.pstat-leg { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.pstat-leg b { color: var(--ink); font-weight: 600; }
.pstat-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.pchip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-2);
  padding: 4px 9px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--hairline-2);
}
.pchip b { color: var(--ink); font-weight: 600; }
.lchip { display: inline-flex; align-items: center; gap: 6px; }

.ptable { margin-top: 12px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--surface); }
.ptable-head {
  display: grid; grid-template-columns: 78px 1fr 130px 150px 1.1fr 46px;
  position: sticky; top: 60px; z-index: 10; background: var(--surface-2);
  border-bottom: 1px solid var(--hairline); border-radius: var(--r-md) var(--r-md) 0 0;
}
.th {
  display: inline-flex; align-items: center; gap: 5px; padding: 13px 16px; border: none; background: none;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3); cursor: pointer; text-align: left; transition: color 0.2s;
}
.th:hover { color: var(--ink-2); }
.th.active { color: var(--clay); }
.th-caret { display: inline-flex; transition: transform 0.2s, opacity 0.2s; }
.c-go { cursor: default; }

.prow {
  display: grid; grid-template-columns: 78px 1fr 130px 150px 1.1fr 46px; align-items: center;
  border-bottom: 1px solid var(--hairline-2); transition: background 0.16s; color: var(--ink);
}
.prow:last-child { border-bottom: none; border-radius: 0 0 var(--r-md) var(--r-md); }
.prow:hover { background: var(--surface-2); }
.prow > div { padding: 14px 16px; }
.c-id { font-size: 13px; color: var(--ink-3); }
.prow-title { display: block; font-size: 15.5px; font-weight: 500; letter-spacing: -0.01em; }
.prow-pats { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.c-diff { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.ddot { width: 8px; height: 8px; border-radius: 50%; }
.c-lang { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.ldot { width: 9px; height: 9px; border-radius: 2px; }
.c-type { display: flex; gap: 6px; flex-wrap: wrap; }
.c-go { color: var(--ink-3); display: flex; justify-content: flex-end; }
.prow:hover .c-go { color: var(--clay); }
.pempty { padding: 50px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* staggered row entrance on the index pages (scoped to .cpage so the home
   global-search results don't replay it on every keystroke) */
.cpage .prow { animation: cc-row-in 0.45s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes cc-row-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .cpage .prow { animation: none; } }

@media (max-width: 820px) {
  .ptable-head { grid-template-columns: 60px 1fr 110px 40px; }
  .prow { grid-template-columns: 60px 1fr 110px 40px; }
  .c-lang, .th.c-lang, .c-type, .th.c-type { display: none; }
}
@media (max-width: 480px) {
  .ptable-head { grid-template-columns: 48px 1fr 90px 32px; }
  .prow { grid-template-columns: 48px 1fr 90px 32px; }
  .prow > div, .th { padding: 12px 9px; min-width: 0; }
  .prow-title { font-size: 14.5px; overflow-wrap: anywhere; }
  .c-diff { font-size: 12.5px; gap: 6px; }
}

/* ---------- challenge language selector ---------- */
.clang-bar { display: flex; align-items: center; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.clang-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.clang-tabs { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.clang-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border: 1px solid var(--hairline); border-radius: 999px;
  background: var(--surface); color: var(--ink-2); font-family: var(--mono); font-size: 13px;
  cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.clang-tab .d { width: 9px; height: 9px; border-radius: 2px; }
.clang-tab:hover { border-color: var(--clay); color: var(--ink); }
.clang-tab.active { border-color: var(--clay); color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--clay); }

.csection-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.csection-label::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.cblock { margin-top: 56px; }

/* ============================================================
   CHALLENGE — tabbed document workspace
   ============================================================ */
.cpage { padding-bottom: 96px; }

/* segmented view switcher */
.cviews {
  display: flex; gap: 4px; margin-top: 40px; padding: 5px;
  /*border: 1px solid var(--hairline); border-radius: 999px; background: var(--surface-2);*/
  width: max-content; max-width: 100%; flex-wrap: wrap;
  z-index: 5; box-shadow: var(--shadow);
}
.cview-tab {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em;
  padding: 9px 18px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: var(--ink-3);
  transition: color 0.2s, background 0.25s var(--ease), border-color 0.2s;
}
.cview-tab:hover { color: var(--ink-2); }
.cview-tab .cview-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--hairline);
  transition: background 0.25s, transform 0.25s var(--ease);
}
.cview-tab.active {
  background: var(--surface); color: var(--ink); border-color: var(--hairline);
  box-shadow: 0 1px 2px rgba(40,36,28,0.05);
}
.cview-tab.active .cview-dot { background: var(--clay); transform: scale(1.35); }
.cview-n {
  font-size: 11px; color: var(--ink-3); background: var(--surface-2);
  border: 1px solid var(--hairline); border-radius: 999px; padding: 1px 7px; margin-left: 2px;
}
.cview-tab.active .cview-n { color: var(--clay); border-color: color-mix(in oklch, var(--clay) 30%, transparent); }

.cview-panel { margin-top: 30px; animation: viewfade 0.4s var(--ease) both; }
@keyframes viewfade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* empty-state placeholder — shown by file-backed tabs when a source is missing */
.cempty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 13px; padding: 72px 32px;
  border: 1px dashed var(--hairline); border-radius: var(--r-md);
  background: var(--surface-2);
}
.cempty-compact { padding: 40px 24px; gap: 10px; }
.cempty-mark {
  display: grid; place-items: center; width: 54px; height: 54px;
  border-radius: 50%; background: var(--surface); color: var(--ink-3);
  border: 1px solid var(--hairline); box-shadow: var(--shadow);
}
.cempty-compact .cempty-mark { width: 44px; height: 44px; }
.cempty-kick {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--clay);
}
.cempty-title { font-size: 23px; font-weight: 400; letter-spacing: -0.02em; color: var(--ink); margin: 0; }
.cempty-compact .cempty-title { font-size: 19px; }
.cempty-msg { font-size: 14px; color: var(--ink-2); line-height: 1.65; max-width: 460px; margin: 0; }
.cempty-compact .cempty-msg { font-size: 13px; }
.cempty .cempty-title .mono { font-size: 0.88em; color: var(--clay); }
.cempty code.mono { font-size: 0.92em; color: var(--ink); background: var(--surface); border: 1px solid var(--hairline); border-radius: 5px; padding: 1px 5px; }

/* discussion — giscus embedded in native panel chrome */
.discuss { max-width: 1052px; }
.discuss-mount { min-height: 220px; }
.discuss-mount .giscus, .discuss-mount .giscus-frame { width: 100%; }
.discuss-mount .giscus-frame { color-scheme: light dark; }
.discuss-foot {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; color: var(--ink-3);
}
.discuss-foot svg { color: var(--ink-2); }

/* full-width code panel */
.code-full { width: 100%; }
.code-full .sol-body { grid-template-columns: 1fr; min-height: 0; }
.code-full .sol-code {
  min-height: 0; max-height: min(62vh, 640px);
  font-size: 13.5px; line-height: 1.75; padding: 26px 30px;
}
.code-full .sol-code .ln { width: 34px; }

/* rationale strip beneath the code */
.sol-rationale {
  margin-top: 22px; display: grid; grid-template-columns: 300px 1fr; gap: 30px;
  align-items: start;
}
@media (max-width: 820px) { .sol-rationale { grid-template-columns: 1fr; gap: 22px; } }
.sol-rationale .vrat-cx {
  display: block; border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: 6px 18px; background: var(--surface-2);
}
.sol-rationale .vrat-cx .cx-row { padding: 11px 0; }
.sol-rationale .vrat-cx .cx-row:last-child { border-bottom: none; }
.sol-reason { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 720px) { .sol-reason { grid-template-columns: 1fr; gap: 20px; } }
.sol-reason h5 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 8px;
}
.sol-reason p { font-size: 14.5px; color: var(--ink-2); line-height: 1.66; margin: 0; }

/* ---------- notes reader (paginated) ---------- */
.notes-reader { display: grid; grid-template-columns: 230px 1fr; gap: 44px; align-items: start; }
@media (max-width: 860px) { .notes-reader { grid-template-columns: 1fr; gap: 26px; } }

.notes-toc { position: sticky; top: 150px; }
@media (max-width: 860px) { .notes-toc { position: static; } }
.notes-toc-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 14px; padding-left: 14px;
}
.notes-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--hairline); }
.notes-toc li { margin: 0; }
.notes-toc button {
  display: flex; align-items: baseline; gap: 11px; width: 100%; text-align: left;
  background: transparent; border: 0; cursor: pointer; padding: 8px 12px 8px 14px;
  margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-3);
  transition: color 0.2s, border-color 0.2s;
}
.notes-toc button .n { font-family: var(--mono); font-size: 11px; color: var(--ink-3); flex-shrink: 0; }
.notes-toc button .t { font-size: 14px; line-height: 1.4; }
.notes-toc button:hover { color: var(--ink-2); }
.notes-toc button.active { color: var(--ink); border-left-color: var(--clay); }
.notes-toc button.active .n { color: var(--clay); }

.notes-stage { min-width: 0; }
.notes-page {
  max-width: none; min-height: 380px;
  animation: pagein 0.35s var(--ease) both;
}
@keyframes pagein { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.notes-page-kick {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; color: var(--ink-3);
}
.notes-page-kick .sep { width: 22px; height: 1px; background: var(--hairline); }
.notes-page-title {
  font-weight: 400; font-size: clamp(26px, 3.5vw, 36px); letter-spacing: -0.025em;
  line-height: 1.1; margin: 12px 0 22px; text-wrap: balance;
}
.notes-page .md h2:first-child { display: none; } /* title already shown */

.notes-pager {
  display: flex; align-items: center; gap: 18px; margin-top: 38px; padding-top: 22px;
  border-top: 1px solid var(--hairline);
}
.np-btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  background: transparent; border: 1px solid var(--hairline); border-radius: 999px;
  padding: 9px 16px; color: var(--ink-2); font-size: 13.5px; max-width: 42%;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.np-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-btn svg { transform: rotate(180deg); flex-shrink: 0; color: var(--clay); }
.np-next svg { transform: none; }
.np-btn:hover:not(:disabled) { border-color: var(--ink-2); color: var(--ink); background: var(--surface); }
.np-btn:disabled { opacity: 0.4; cursor: default; }
.np-next { margin-left: auto; }
.np-dots { display: flex; gap: 7px; align-items: center; }
.np-dot {
  width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: var(--hairline); transition: background 0.2s, transform 0.2s var(--ease);
}
.np-dot:hover { background: var(--ink-3); }
.np-dot.active { background: var(--clay); transform: scale(1.4); }
@media (max-width: 620px) { .np-dots { display: none; } .np-btn { max-width: 48%; } }

/* ---------- reasoning view ---------- */
.reason-hero { max-width: none; }
.reason-hero p {
  font-weight: 400; font-size: clamp(22px, 3vw, 30px); line-height: 1.4;
  letter-spacing: -0.015em; color: var(--ink); margin-top: 4px; text-wrap: pretty;
}
.reason-hero p::first-letter { color: var(--clay); }

/* cross-reference cards — sibling solutions of the same problem */
.xref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 12px; }
.xref {
  display: block; text-decoration: none; color: var(--ink);
  padding: 14px 16px; border: 1px solid var(--hairline); border-radius: var(--r-md);
  background: var(--surface); transition: border-color 0.25s, transform 0.3s var(--ease), box-shadow 0.3s;
}
a.xref:hover { border-color: var(--clay); transform: translateY(-2px); box-shadow: var(--shadow); }
.xref-top { display: flex; align-items: center; gap: 9px; }
.xref-top .d { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.xref-file { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xref-role {
  margin-left: auto; flex: none; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
}
.xref-cx { display: flex; gap: 16px; margin-top: 11px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.xref-cx b { color: var(--ink-2); font-weight: 600; }
