/* =========================================================
   pretext.cool — Redesign v2.0
   Tokens follow the brief §7.2 exactly.
   ========================================================= */
:root {
  --bg: #08080C;
  --surface: #111118;
  --surface2: #16161F;
  --surface3: #1C1C28;
  --border: #252533;
  --border-hover: #3A3A50;
  --text: #EEEDF0;
  --text-secondary: #B0ADB8;
  --muted: #8B889A;            /* nudged from #78758A → passes WCAG AA at 14px+ */
  --accent: #6EE7B7;
  --accent-bright: #34D399;
  --accent-dim: rgba(110, 231, 183, 0.10);
  --accent-dim2: rgba(110, 231, 183, 0.18);

  /* Category palette — brief §7.2 */
  --cat-games: #FBBF24;
  --cat-creative: #A78BFA;
  --cat-bench: #60A5FA;
  --cat-ui: #34D399;
  --cat-ai: #22D3EE;
  --cat-tools: #FB7185;

  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --r-pill: 100px;

  --maxw: 1200px;
  --maxw-text: 1100px;

  --shadow-card: 0 14px 40px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px rgba(110, 231, 183, 0.15);

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ==== Reset ==== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
code, pre, kbd { font-family: var(--font-mono); }

/* a11y: skip to content */
.skip-link {
  position: absolute; left: 0; top: 0;
  background: var(--accent-bright); color: #000;
  padding: 8px 14px; border-radius: 0 0 8px 0;
  font-weight: 700; font-size: 14px;
  transform: translateY(-110%); transition: transform 120ms ease;
  z-index: 1000;
}
.skip-link:focus { transform: translateY(0); outline: 2px solid var(--accent); }

/* Reusable */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-text { max-width: var(--maxw-text); margin: 0 auto; padding: 0 24px; }

/* Section rhythm */
section { scroll-margin-top: 80px; }
.section { padding: 80px 0; }
.section--tight { padding: 56px 0; }
@media (max-width: 720px) { .section { padding: 56px 0; } .section--tight { padding: 40px 0; } }

/* Section header — uppercase eyebrow + h2 */
.s-head { margin-bottom: 32px; }
.s-eye {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent);
}
.s-eye::before {
  content: ""; width: 14px; height: 1px; background: var(--accent); display: inline-block;
}
.s-title {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.18;
  margin-top: 10px;
  max-width: 800px;
  text-wrap: balance;
}
.s-sub {
  margin-top: 12px; color: var(--text-secondary);
  font-size: 1rem; max-width: 680px; line-height: 1.6;
  text-wrap: pretty;
}

/* =========================================================
   Nav (sticky)
   ========================================================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  background: rgba(8, 8, 12, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, background 200ms ease;
}
.nav.is-stuck {
  border-bottom-color: var(--border);
  background: rgba(8, 8, 12, 0.92);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 24px;
}
.nav__brand { display: flex; align-items: center; gap: 10px; }
.nav__logo {
  width: 30px; height: 30px; border-radius: 8px; overflow: hidden;
  background: var(--surface2);
}
.nav__logo img { width: 100%; height: 100%; object-fit: cover; }
.nav__name { font-weight: 800; letter-spacing: -0.02em; font-size: 15px; }
.nav__name .dot-tld { color: var(--accent); }

.nav__links { display: flex; align-items: center; gap: 2px; }
.nav__links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  transition: background 120ms ease, color 120ms ease;
}
.nav__links a:hover { background: var(--surface2); color: var(--text); }
.nav__links a[aria-current="page"] { color: var(--text); background: var(--surface2); }
.nav__links svg { opacity: 0.7; }

.nav__right { display: flex; align-items: center; gap: 8px; }
.nav__lang {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 100px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.nav__lang button {
  padding: 2px 6px; border-radius: 100px; font-size: 12px; font-weight: 700;
  color: var(--muted);
  transition: background 120ms ease, color 120ms ease;
}
.nav__lang button:hover { color: var(--text); }
.nav__lang button[aria-pressed="true"] { background: var(--surface3); color: var(--text); }
.nav__cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text);
  transition: border-color 120ms ease, background 120ms ease;
}
.nav__cta:hover { border-color: var(--border-hover); background: var(--surface3); }
.nav__cta .star {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 100px;
  background: var(--accent-dim); color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.nav__burger { display: none; }

@media (max-width: 980px) {
  .nav__links, .nav__lang { display: none; }
  .nav__burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--surface2); border: 1px solid var(--border);
  }
}

/* Mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(8, 8, 12, 0.92); backdrop-filter: blur(12px);
  display: none; flex-direction: column;
  padding: 80px 24px 24px;
}
.drawer.is-open { display: flex; }
.drawer__close {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
}
.drawer a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 18px; font-weight: 600;
}
.drawer a:hover { color: var(--accent); }
.drawer__lang {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 8px; padding-top: 18px;
  border-top: 1px solid var(--border);
}
.drawer__lang button {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface2); min-height: 44px;
  font-size: 14px; font-weight: 700;
  color: var(--text-secondary);
}
.drawer__lang button[aria-pressed="true"] {
  color: var(--text); border-color: var(--border-hover); background: var(--surface3);
}

/* =========================================================
   Hero (left text + right interactive demo)
   ========================================================= */
.hero { padding: 64px 0 32px; position: relative; }
@media (max-width: 720px) { .hero { padding: 32px 0 16px; } }
.hero__grid {
  display: grid; grid-template-columns: 1.1fr 1fr;
  gap: 56px; align-items: center;
}
@media (max-width: 980px) { .hero__grid { grid-template-columns: 1fr; gap: 40px; } }

.hero__badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 100px;
  background: var(--accent-dim); border: 1px solid var(--accent-dim2);
  font-size: 12px; font-weight: 600; color: var(--accent);
  letter-spacing: 0.02em;
}
.hero__badge .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-bright); position: relative;
}
.hero__badge .pulse::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  background: var(--accent-bright); opacity: 0.4;
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(2.4); opacity: 0; }
}

.hero__h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900; line-height: 1.04; letter-spacing: -0.035em;
  margin-top: 20px; max-width: 14ch;
  text-wrap: balance;
}
.hero__h1 .grad {
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 50%, #93f1d6 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero__sub {
  margin-top: 20px; max-width: 56ch;
  font-size: 1.1rem; line-height: 1.6; color: var(--text-secondary);
  text-wrap: pretty;
}
.hero__sub strong { color: var(--text); font-weight: 600; }
.hero__disclaim {
  margin-top: 14px; font-size: 13px; color: var(--muted); line-height: 1.5;
}
.hero__disclaim a { color: var(--text-secondary); border-bottom: 1px dashed var(--border-hover); }
.hero__disclaim a:hover { color: var(--accent); border-color: var(--accent); }

.hero__actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  border: 1px solid transparent;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, color 120ms ease;
  min-height: 44px; /* hit target */
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn--primary { background: var(--accent-bright); color: #062018; }
.btn--primary:hover { background: var(--accent); box-shadow: 0 8px 24px rgba(52,211,153,0.25); }
.btn--ghost { background: var(--surface2); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--border-hover); background: var(--surface3); }
.btn--icon { padding: 12px 16px; }

.hero__chips {
  margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px;
  padding-top: 24px; border-top: 1px solid var(--border);
}
.hero__chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 100px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-secondary); font-weight: 500;
}
.hero__chip strong { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.hero__chip .ico { color: var(--accent); font-size: 14px; }

/* ===== Live reflow demo (right column) ===== */
.reflow {
  position: relative;
  background: linear-gradient(180deg, var(--surface2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 460px;
  display: flex; flex-direction: column;
}
.reflow__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.reflow__title {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.reflow__title .led { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-bright); box-shadow: 0 0 8px var(--accent-bright); }
.reflow__pill {
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
  padding: 3px 8px; border-radius: 100px; background: var(--accent-dim);
}
.reflow__stage {
  position: relative; flex: 1;
  padding: 28px 28px 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.reflow__box {
  position: relative;
  background: var(--surface3);
  border-radius: 10px;
  padding: 22px 24px;
  font-size: 18px; line-height: 1.5;
  color: var(--text);
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
  width: var(--w, 320px);
  max-width: 100%;
  transition: width 60ms linear;
  border: 1px solid var(--border);
}
.reflow__handle {
  position: absolute; right: -10px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 60px; border-radius: 6px;
  background: var(--accent-bright); color: #062018;
  display: flex; align-items: center; justify-content: center;
  cursor: ew-resize; font-size: 10px; font-weight: 800;
  box-shadow: 0 0 0 4px rgba(52,211,153,0.18);
  user-select: none; touch-action: none;
}
.reflow__handle:hover { box-shadow: 0 0 0 6px rgba(52,211,153,0.24); }
.reflow__meta {
  margin-top: 18px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  width: 100%;
}
.reflow__metric {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
}
.reflow__metric-l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.reflow__metric-v { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--text); margin-top: 2px; font-variant-numeric: tabular-nums; }
.reflow__metric-v em { color: var(--accent); font-style: normal; font-size: 12px; }
.reflow__hint { margin-top: 10px; font-size: 11px; color: var(--muted); font-family: var(--font-mono); text-align: center; }
.reflow__hint kbd {
  display: inline-block; padding: 1px 5px; border-radius: 4px;
  background: var(--surface3); border: 1px solid var(--border); color: var(--text-secondary);
  font-size: 10px;
}

/* =========================================================
   Stats Bar
   ========================================================= */
.statbar {
  margin-top: 16px;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
}
@media (max-width: 720px) {
  .statbar { grid-template-columns: repeat(2, 1fr); }
  .statbar > div:nth-child(5) { grid-column: 1 / -1; }
}
.statbar > div {
  padding: 20px 18px; text-align: left;
  border-right: 1px solid var(--border);
  position: relative;
}
.statbar > div:last-child { border-right: none; }
@media (max-width: 720px) {
  .statbar > div { border-right: none; border-bottom: 1px solid var(--border); }
  .statbar > div:nth-child(odd) { border-right: 1px solid var(--border); }
}
.stat__n {
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.stat__n .unit { font-size: 0.65em; color: var(--text-secondary); font-weight: 700; margin-left: 2px; }
.stat__l { margin-top: 8px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; }
.stat__delta { display: inline-block; margin-left: 6px; font-size: 10px; color: var(--accent); }
.stat--load .stat__n { color: var(--muted); position: relative; }
.stat--load .stat__n::after {
  content: ""; position: absolute; inset: 4px 0; background: linear-gradient(90deg, transparent, var(--surface3), transparent); border-radius: 4px;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); } 100% { transform: translateX(100%); }
}

/* =========================================================
   Featured Demos
   ========================================================= */
.featured__grid {
  display: grid; gap: 16px;
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "big big a"
    "big big b"
    "c   d   e";
  align-items: stretch;
}
@media (max-width: 980px) {
  .featured__grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "big big" "a b" "c d" "e e";
  }
}
@media (max-width: 640px) {
  .featured__grid { grid-template-columns: 1fr; grid-template-areas: "big" "a" "b" "c" "d" "e"; }
}
.fc {
  position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.fc:hover { transform: translateY(-2px); border-color: var(--border-hover); box-shadow: var(--shadow-card); }
.fc:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.fc--big { grid-area: big; }
.fc__media {
  position: relative; aspect-ratio: 16/9; background: var(--surface3);
  overflow: hidden;
}
.fc--big .fc__media { aspect-ratio: 16/9; }
.fc__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.fc:hover .fc__media img { transform: scale(1.04); }
.fc__chip {
  position: absolute; top: 12px; left: 12px;
  font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.08em;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(8px);
  border: 1px solid currentColor;
  color: var(--cat, var(--accent));
}
.fc__new {
  position: absolute; top: 12px; right: 12px;
  font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 6px;
  background: var(--accent-bright); color: #062018;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.fc__body { padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.fc__title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.fc--big .fc__title { font-size: 22px; }
.fc__credit { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.fc__desc { font-size: 13.5px; color: var(--text-secondary); line-height: 1.55; flex: 1; text-wrap: pretty; }
.fc--big .fc__desc { font-size: 15px; line-height: 1.6; }
.fc__foot {
  padding: 12px 18px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.fc__try {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--accent);
}
.fc:hover .fc__try { color: var(--accent-bright); }
.fc__source {
  font-size: 11px; color: var(--muted); font-family: var(--font-mono);
  padding: 4px 8px; border-radius: 6px;
}
.fc__source:hover { background: var(--surface2); color: var(--text-secondary); }
.fc__link { position: absolute; inset: 0; z-index: 1; }
.fc__source, .fc__try { position: relative; z-index: 2; }
.fc__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.fc__tag {
  font-size: 10.5px; font-weight: 500; padding: 2px 7px; border-radius: 100px;
  background: var(--surface3); color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* =========================================================
   Filter bar (sticky under nav)
   ========================================================= */
.filter {
  position: sticky; top: 64px; z-index: 30;
  margin: 0 -24px; padding: 14px 24px;
  background: rgba(8, 8, 12, 0.85);
  backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.filter__inner {
  display: flex; align-items: center; gap: 12px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 32px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 32px), transparent);
  padding-left: 4px; padding-right: 4px;
}
.filter__inner::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 100px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 600;
  transition: all 120ms ease;
  white-space: nowrap;
  min-height: 36px;
}
.chip:hover { color: var(--text); border-color: var(--border-hover); }
.chip[aria-pressed="true"] {
  color: var(--text); background: var(--surface3);
  border-color: var(--cat, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cat, var(--accent)) 14%, transparent);
}
.chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cat, var(--accent)); }
.chip__count {
  font-size: 11px; font-family: var(--font-mono); color: var(--muted);
  padding: 1px 6px; border-radius: 100px; background: rgba(255,255,255,0.04);
}
.chip[aria-pressed="true"] .chip__count { color: var(--text); background: rgba(255,255,255,0.08); }

.filter__search {
  margin-left: auto; flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 100px;
  background: var(--surface2); border: 1px solid var(--border);
  min-width: 220px;
}
.filter__search input {
  background: none; border: none; outline: none; color: var(--text);
  font-size: 13px; flex: 1; min-width: 0;
}
.filter__search input::placeholder { color: var(--muted); }
.filter__search svg { color: var(--muted); flex-shrink: 0; }
@media (max-width: 720px) { .filter__search { display: none; } }

/* =========================================================
   Demo grid (full)
   ========================================================= */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-top: 24px;
}
.card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--border-hover); box-shadow: var(--shadow-card); }
.card:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.card__link { position: absolute; inset: 0; z-index: 1; }
.card__media {
  aspect-ratio: 16/10; background: var(--surface3); overflow: hidden;
  position: relative;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.card:hover .card__media img { transform: scale(1.03); }
.card__chip {
  position: absolute; top: 10px; left: 10px;
  font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.08em;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  border: 1px solid currentColor; color: var(--cat, var(--accent));
}
.card__body { padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card__title { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.card__credit { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.card__desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin-top: 4px; flex: 1; }
.card__foot {
  padding: 10px 14px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px;
}
.card__foot .try { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.card__foot .src { color: var(--muted); font-family: var(--font-mono); position: relative; z-index: 2; padding: 2px 6px; border-radius: 4px; }
.card__foot .src:hover { color: var(--text-secondary); background: var(--surface2); }

/* Empty state */
.grid__empty {
  grid-column: 1 / -1;
  text-align: center; padding: 48px 24px;
  border: 1px dashed var(--border); border-radius: var(--r-md);
  background: var(--surface);
}
.grid__empty h3 { font-size: 1.1rem; margin-bottom: 6px; }
.grid__empty p { color: var(--muted); font-size: 14px; }
.grid__empty button { margin-top: 16px; }

/* =========================================================
   Why Pretext + bottleneck
   ========================================================= */
.why {
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent));
}
.why__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  align-items: start;
}
@media (max-width: 900px) { .why__grid { grid-template-columns: 1fr; } }

.why__card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 28px 28px;
  position: relative;
}
.why__card h3 {
  font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.why__card h3 .num {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent-dim); color: var(--accent);
  font-family: var(--font-mono); font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.why__card p { color: var(--text-secondary); font-size: 14.5px; line-height: 1.65; }
.why__card p + p { margin-top: 12px; }
.why__card code {
  background: var(--surface3); padding: 1px 6px; border-radius: 4px;
  font-size: 0.9em; color: var(--accent);
}
.why__card strong { color: var(--text); font-weight: 600; }

.bottleneck {
  margin-top: 28px;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px;
  align-items: stretch;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px;
}
@media (max-width: 720px) {
  .bottleneck { grid-template-columns: 1fr; }
  .bottleneck__arrow { transform: rotate(90deg); justify-self: center; }
}
.bottleneck__side h4 {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.bottleneck__side--dom h4 { color: #FB7185; }
.bottleneck__side--pt h4 { color: var(--accent); }
.bottleneck__side ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.bottleneck__side li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--text-secondary); line-height: 1.45;
}
.bottleneck__side li::before {
  content: ""; flex-shrink: 0; width: 14px; height: 14px; border-radius: 4px;
  margin-top: 2px;
}
.bottleneck__side--dom li::before {
  background: rgba(251, 113, 133, 0.14); border: 1px solid rgba(251,113,133,0.4);
  background-image: linear-gradient(45deg, transparent 45%, #fb7185 45%, #fb7185 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, #fb7185 45%, #fb7185 55%, transparent 55%);
  background-size: 100% 100%;
}
.bottleneck__side--pt li::before {
  background: rgba(110,231,183,0.14); border: 1px solid rgba(110,231,183,0.45);
  background-image: linear-gradient(135deg, transparent 50%, #6ee7b7 50%);
  background-size: 12px 12px; background-repeat: no-repeat;
  background-position: 2px 2px;
}
.bottleneck__arrow {
  align-self: center; color: var(--muted);
  font-family: var(--font-mono);
}

/* =========================================================
   Quickstart code
   ========================================================= */
.quick__shell {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7;
}
.quick__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.quick__file {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.quick__file::before {
  content: ""; width: 10px; height: 10px; border-radius: 2px;
  background: linear-gradient(135deg, #3178c6, #4f8cd9);
}
.quick__copy {
  font-size: 11px; padding: 5px 10px; border-radius: 6px;
  background: var(--surface3); color: var(--text-secondary);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 6px;
}
.quick__copy:hover { color: var(--text); border-color: var(--border-hover); }
.quick__copy.is-copied { color: var(--accent); border-color: var(--accent); }
.quick__body {
  padding: 20px 24px;
  overflow-x: auto;
  white-space: pre;
  color: var(--text);
}
.quick__body .c-key { color: #c084fc; }
.quick__body .c-fn  { color: #93c5fd; }
.quick__body .c-str { color: #6ee7b7; }
.quick__body .c-num { color: #fbbf24; }
.quick__body .c-cmt { color: var(--muted); font-style: italic; }
.quick__body .c-var { color: #f9a8d4; }

.quick__steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-top: 24px;
}
@media (max-width: 720px) { .quick__steps { grid-template-columns: 1fr; } }
.qstep {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px 18px;
}
.qstep__n {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); font-weight: 700;
}
.qstep__t { font-size: 14px; font-weight: 700; margin-top: 4px; }
.qstep__d { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; margin-top: 4px; }

/* =========================================================
   Use cases
   ========================================================= */
.uc__grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 980px) { .uc__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .uc__grid { grid-template-columns: 1fr; } }
.uc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 20px 20px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color 160ms ease, transform 160ms ease;
}
.uc:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.uc__ico {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--accent-dim); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.uc__h { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.uc__p { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.uc__kw { font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--border); }

/* =========================================================
   Comparison table
   ========================================================= */
.cmp__shell {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
}
.cmp__wrap { overflow-x: auto; }
table.cmp {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
table.cmp th, table.cmp td {
  padding: 14px 18px; text-align: left;
  border-bottom: 1px solid var(--border);
}
table.cmp th {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted);
  background: var(--surface2);
}
table.cmp th:nth-child(2) { color: #FB7185; }
table.cmp th:nth-child(3) { color: var(--accent); }
table.cmp tbody tr:last-child td { border-bottom: none; }
table.cmp td:first-child { color: var(--text); font-weight: 600; font-size: 13px; }
table.cmp td .bad { color: #FB7185; }
table.cmp td .good { color: var(--accent); }

/* =========================================================
   GitHub live stats
   ========================================================= */
.gh {
  background: linear-gradient(180deg, var(--surface2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 28px;
}
.gh__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.gh__title {
  display: flex; align-items: center; gap: 10px;
  font-size: 1rem; font-weight: 700;
}
.gh__title .live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--accent); font-family: var(--font-mono); }
.gh__title .live .led { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-bright); box-shadow: 0 0 6px var(--accent-bright); }
.gh__btn {
  font-size: 12px; font-weight: 600;
  padding: 8px 12px; border-radius: 8px;
  background: var(--surface3); border: 1px solid var(--border); color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 6px;
}
.gh__btn:hover { color: var(--text); border-color: var(--border-hover); }
.gh__stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-top: 18px;
}
@media (max-width: 640px) { .gh__stats { grid-template-columns: repeat(2, 1fr); } }
.gh__stat {
  padding: 16px;
  border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--surface);
}
.gh__stat-n { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.gh__stat-l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; margin-top: 6px; }
.gh__stat--load .gh__stat-n {
  display: inline-block; min-width: 60px; height: 22px; border-radius: 4px;
  background: linear-gradient(90deg, var(--surface3), var(--surface2), var(--surface3));
  background-size: 200% 100%; animation: shimmer 1.6s linear infinite; color: transparent;
}

/* =========================================================
   Blog
   ========================================================= */
.blog__grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) { .blog__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .blog__grid { grid-template-columns: 1fr; } }
.post {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 22px 22px;
  transition: border-color 160ms ease, transform 160ms ease;
  min-height: 200px;
}
.post:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.post:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.post__link { position: absolute; inset: 0; }
.post__tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 100px;
  text-transform: uppercase; letter-spacing: 0.1em;
  background: var(--accent-dim); color: var(--accent);
  align-self: flex-start;
}
.post__tag.is-zh { background: rgba(251, 113, 133, 0.14); color: #fb7185; }
.post__t { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; margin-top: 12px; }
.post__d { font-size: 13px; color: var(--text-secondary); line-height: 1.55; margin-top: 8px; flex: 1; }
.post__m { display: flex; gap: 10px; font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.post__m span + span { padding-left: 10px; border-left: 1px solid var(--border); }

/* =========================================================
   SEO links
   ========================================================= */
.seolinks {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
}
.seolinks__grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 720px) { .seolinks__grid { grid-template-columns: 1fr; } }
.seolinks a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: var(--r-sm);
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 13.5px; font-weight: 600;
  transition: all 120ms ease;
  min-height: 48px;
}
.seolinks a:hover {
  background: var(--surface3); border-color: var(--accent);
  color: var(--accent);
  transform: translateX(2px);
}
.seolinks a .kw { font-family: var(--font-mono); font-size: 11px; color: var(--muted); font-weight: 500; }
.seolinks a:hover .kw { color: var(--accent); }

/* =========================================================
   UGCFast (low key)
   ========================================================= */
.also {
  margin-top: 24px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 20px;
  align-items: center;
  padding: 20px 24px;
  border-radius: var(--r-md);
  background: linear-gradient(120deg, rgba(99,102,241,0.10), rgba(168,85,247,0.06));
  border: 1px solid rgba(167, 139, 250, 0.2);
}
@media (max-width: 640px) {
  .also { grid-template-columns: auto 1fr; gap: 16px; }
  .also__cta { grid-column: 1 / -1; }
}
.also__ico {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.also__lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 700; }
.also__t { font-size: 15px; font-weight: 700; margin-top: 2px; }
.also__d { font-size: 13px; color: var(--text-secondary); margin-top: 2px; line-height: 1.5; max-width: 600px; }
.also__cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff;
  font-size: 13px; font-weight: 700;
  white-space: nowrap;
  min-height: 40px;
}
.also__cta:hover { box-shadow: 0 8px 24px rgba(99,102,241,0.35); }

/* =========================================================
   Footer
   ========================================================= */
footer.footer {
  margin-top: 80px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer__grid {
  padding: 56px 0 40px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px;
}
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 540px) { .footer__grid { grid-template-columns: 1fr; } }
.footer__brand { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; }
.footer__about { color: var(--text-secondary); font-size: 13px; line-height: 1.55; margin-top: 10px; max-width: 36ch; }
.footer__col h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text); font-weight: 700; margin-bottom: 14px;
}
.footer__col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer__col a { color: var(--text-secondary); font-size: 13.5px; transition: color 120ms ease; }
.footer__col a:hover { color: var(--accent); }
.footer__col a .ext { color: var(--muted); font-size: 10px; margin-left: 4px; }
.footer__bottom {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  padding: 20px 0 32px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
}
.footer__bottom .legal { display: flex; gap: 16px; flex-wrap: wrap; }
.footer__bottom .legal a:hover { color: var(--text-secondary); }
.footer__open-launch {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 18px;
}
.footer__open-launch a {
  display: inline-flex;
  opacity: 0.42;
  filter: saturate(0.75);
  transition: opacity 120ms ease, filter 120ms ease;
}
.footer__open-launch a:hover,
.footer__open-launch a:focus-visible {
  opacity: 0.78;
  filter: saturate(1);
}
.footer__open-launch a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.footer__open-launch img {
  width: 120px;
  height: auto;
}
@media (max-width: 540px) {
  .footer__open-launch { justify-content: flex-start; }
}

/* =========================================================
   Toast
   ========================================================= */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120%);
  padding: 12px 20px; border-radius: 100px;
  background: var(--surface3); border: 1px solid var(--accent);
  color: var(--text); font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-card); z-index: 100;
  transition: transform 240ms cubic-bezier(.2,.9,.3,1.4);
  display: inline-flex; align-items: center; gap: 8px;
}
.toast .check {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-bright); color: #062018;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 900;
}
.toast.is-show { transform: translateX(-50%) translateY(0); }

/* =========================================================
   Scroll-triggered fade
   ========================================================= */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
