/* ========================================================================
   guji-web — styles
   Token architecture + theme set adapted from Mariana Design System v2.
   See STYLE_GUIDE.md.
   ======================================================================== */

/* ---- Tokens: Light (default) ---- */
:root {
  --surface-0: #ffffff;
  --surface-1: #fafafa;
  --surface-2: #f4f4f5;
  --surface-3: #e4e4e7;

  --text-1: #18181b;
  --text-2: #52525b;
  --text-3: #a1a1aa;

  --border-1: #e4e4e7;
  --border-2: #d4d4d8;

  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.1);
  --accent-fg: #ffffff;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 50px -10px rgba(0,0,0,0.15), 0 8px 16px -6px rgba(0,0,0,0.08);
  --backdrop-blur: blur(12px);
  --shine-top: rgba(255,255,255,0.7);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;

  --pad-1: 8px;
  --pad-2: 12px;
  --pad-3: 16px;
  --pad-4: 20px;

  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Monaco, Consolas, monospace;
  --font-base: 16px;

  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);

  --content-max: 1080px;
  --prose-max: 760px;
}

/* ---- Themes ---- */
[data-theme="dark"] {
  --surface-0: #0a0a0a; --surface-1: #131316; --surface-2: #1c1c20; --surface-3: #2a2a2f;
  --text-1: #fafafa; --text-2: #a1a1aa; --text-3: #71717a;
  --border-1: #27272a; --border-2: #3f3f46;
  --accent: #60a5fa; --accent-soft: rgba(96,165,250,0.15); --accent-fg: #0a0a0a;
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 50px -10px rgba(0,0,0,0.6);
  --shine-top: rgba(255,255,255,0.05);
}
[data-theme="monochrome"] {
  --surface-0: #ffffff; --surface-1: #f5f5f5; --surface-2: #ebebeb; --surface-3: #d4d4d4;
  --text-1: #0a0a0a; --text-2: #404040; --text-3: #737373;
  --border-1: #d4d4d4; --border-2: #a3a3a3;
  --accent: #0a0a0a; --accent-soft: rgba(0,0,0,0.08); --accent-fg: #ffffff;
}
[data-theme="catppuccin-latte"] {
  --surface-0: #eff1f5; --surface-1: #e6e9ef; --surface-2: #dce0e8; --surface-3: #ccd0da;
  --text-1: #4c4f69; --text-2: #6c6f85; --text-3: #8c8fa1;
  --border-1: #ccd0da; --border-2: #bcc0cc;
  --accent: #1e66f5; --accent-soft: rgba(30,102,245,0.12); --accent-fg: #ffffff;
}
[data-theme="catppuccin-mocha"] {
  --surface-0: #1e1e2e; --surface-1: #181825; --surface-2: #313244; --surface-3: #45475a;
  --text-1: #cdd6f4; --text-2: #bac2de; --text-3: #a6adc8;
  --border-1: #313244; --border-2: #45475a;
  --accent: #cba6f7; --accent-soft: rgba(203,166,247,0.15); --accent-fg: #1e1e2e;
}
[data-theme="tokyo-night"] {
  --surface-0: #1a1b26; --surface-1: #16161e; --surface-2: #24283b; --surface-3: #414868;
  --text-1: #c0caf5; --text-2: #a9b1d6; --text-3: #787c99;
  --border-1: #24283b; --border-2: #414868;
  --accent: #7aa2f7; --accent-soft: rgba(122,162,247,0.15); --accent-fg: #1a1b26;
}
[data-theme="tokyo-midnight"] {
  --surface-0: #06060d; --surface-1: #0a0a14; --surface-2: #10101e; --surface-3: #1a1a2e;
  --text-1: #e8eaf6; --text-2: #c5c8e8; --text-3: #7b7fa8;
  --border-1: #1a1a2e; --border-2: #2a2a4a;
  --accent: #82aaff; --accent-soft: rgba(130,170,255,0.18); --accent-fg: #06060d;
  --shadow-md: 0 4px 16px rgba(0,0,0,0.6);
  --shadow-lg: 0 20px 50px -10px rgba(0,0,0,0.8), 0 8px 16px -6px rgba(0,0,0,0.5);
  --shine-top: rgba(130,170,255,0.06);
}
[data-theme="tokyo-night-light"] {
  --surface-0: #e1e2e7; --surface-1: #d5d6db; --surface-2: #cbccd1; --surface-3: #b7b9c5;
  --text-1: #343b58; --text-2: #4f566a; --text-3: #6c6e75;
  --border-1: #b7b9c5; --border-2: #9699a3;
  --accent: #2959aa; --accent-soft: rgba(41,89,170,0.12); --accent-fg: #ffffff;
}
[data-theme="rose-pine"] {
  --surface-0: #191724; --surface-1: #1f1d2e; --surface-2: #26233a; --surface-3: #393552;
  --text-1: #e0def4; --text-2: #908caa; --text-3: #6e6a86;
  --border-1: #26233a; --border-2: #393552;
  --accent: #ebbcba; --accent-soft: rgba(235,188,186,0.15); --accent-fg: #191724;
}
[data-theme="rose-pine-moon"] {
  --surface-0: #232136; --surface-1: #2a273f; --surface-2: #393552; --surface-3: #44415a;
  --text-1: #e0def4; --text-2: #908caa; --text-3: #6e6a86;
  --border-1: #393552; --border-2: #44415a;
  --accent: #c4a7e7; --accent-soft: rgba(196,167,231,0.15); --accent-fg: #232136;
}
[data-theme="rose-pine-dawn"] {
  --surface-0: #faf4ed; --surface-1: #fffaf3; --surface-2: #f2e9e1; --surface-3: #dfdad9;
  --text-1: #575279; --text-2: #797593; --text-3: #9893a5;
  --border-1: #dfdad9; --border-2: #cecacd;
  --accent: #b4637a; --accent-soft: rgba(180,99,122,0.12); --accent-fg: #ffffff;
}
[data-theme="gruvbox-dark"] {
  --surface-0: #282828; --surface-1: #1d2021; --surface-2: #3c3836; --surface-3: #504945;
  --text-1: #ebdbb2; --text-2: #d5c4a1; --text-3: #a89984;
  --border-1: #3c3836; --border-2: #504945;
  --accent: #fabd2f; --accent-soft: rgba(250,189,47,0.15); --accent-fg: #282828;
}
[data-theme="gruvbox-light"] {
  --surface-0: #fbf1c7; --surface-1: #f2e5bc; --surface-2: #ebdbb2; --surface-3: #d5c4a1;
  --text-1: #3c3836; --text-2: #504945; --text-3: #7c6f64;
  --border-1: #d5c4a1; --border-2: #bdae93;
  --accent: #af3a03; --accent-soft: rgba(175,58,3,0.12); --accent-fg: #fbf1c7;
}
[data-theme="dracula"] {
  --surface-0: #282a36; --surface-1: #21222c; --surface-2: #44475a; --surface-3: #6272a4;
  --text-1: #f8f8f2; --text-2: #bfbfbf; --text-3: #6272a4;
  --border-1: #44475a; --border-2: #6272a4;
  --accent: #bd93f9; --accent-soft: rgba(189,147,249,0.15); --accent-fg: #282a36;
}
[data-theme="one-dark"] {
  --surface-0: #282c34; --surface-1: #21252b; --surface-2: #2c313a; --surface-3: #3e4451;
  --text-1: #abb2bf; --text-2: #828997; --text-3: #5c6370;
  --border-1: #3e4451; --border-2: #4b5263;
  --accent: #61afef; --accent-soft: rgba(97,175,239,0.15); --accent-fg: #282c34;
}
[data-theme="everforest"] {
  --surface-0: #2d353b; --surface-1: #232a2e; --surface-2: #343f44; --surface-3: #4f585e;
  --text-1: #d3c6aa; --text-2: #a7c080; --text-3: #859289;
  --border-1: #343f44; --border-2: #4f585e;
  --accent: #a7c080; --accent-soft: rgba(167,192,128,0.15); --accent-fg: #2d353b;
}
[data-theme="kanagawa-wave"] {
  --surface-0: #1f1f28; --surface-1: #16161d; --surface-2: #2a2a37; --surface-3: #363646;
  --text-1: #dcd7ba; --text-2: #c8c093; --text-3: #727169;
  --border-1: #2a2a37; --border-2: #363646;
  --accent: #7e9cd8; --accent-soft: rgba(126,156,216,0.15); --accent-fg: #1f1f28;
}
[data-theme="solarized-dark"] {
  --surface-0: #002b36; --surface-1: #073642; --surface-2: #094352; --surface-3: #586e75;
  --text-1: #eee8d5; --text-2: #93a1a1; --text-3: #839496;
  --border-1: #073642; --border-2: #586e75;
  --accent: #268bd2; --accent-soft: rgba(38,139,210,0.15); --accent-fg: #fdf6e3;
}
[data-theme="nord"] {
  --surface-0: #2e3440; --surface-1: #3b4252; --surface-2: #434c5e; --surface-3: #4c566a;
  --text-1: #eceff4; --text-2: #d8dee9; --text-3: #a0a8b8;
  --border-1: #3b4252; --border-2: #4c566a;
  --accent: #88c0d0; --accent-soft: rgba(136,192,208,0.15); --accent-fg: #2e3440;
}
[data-theme="synthwave"] {
  --surface-0: #241b2f; --surface-1: #1a1325; --surface-2: #34294f; --surface-3: #495495;
  --text-1: #ffffff; --text-2: #f0c8ff; --text-3: #b893ce;
  --border-1: #34294f; --border-2: #495495;
  --accent: #f97e72; --accent-soft: rgba(249,126,114,0.18); --accent-fg: #241b2f;
  --shadow-md: 0 4px 16px rgba(249,126,114,0.2);
}
[data-theme="github-light"] {
  --surface-0: #ffffff; --surface-1: #f6f8fa; --surface-2: #eaeef2; --surface-3: #d0d7de;
  --text-1: #1f2328; --text-2: #656d76; --text-3: #8c959f;
  --border-1: #d0d7de; --border-2: #afb8c1;
  --accent: #0969da; --accent-soft: rgba(9,105,218,0.1); --accent-fg: #ffffff;
}

/* ---- Font overrides ---- */
[data-font="system"] { --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
[data-font="inter"]  { --font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif; }
[data-font="serif"]  { --font-family: Georgia, "Times New Roman", serif; }
[data-font="monospace"] { --font-family: var(--font-mono); }

/* ---- Reset ---- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: var(--font-base); scroll-behavior: smooth; }
body {
  font-family: var(--font-family);
  background: var(--surface-0);
  color: var(--text-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition), color var(--transition);
}
[data-reduce-motion="true"] *,
[data-reduce-motion="true"] *::before,
[data-reduce-motion="true"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}
::selection { background: var(--accent-soft); color: var(--text-1); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- Header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  height: 60px; padding: 0 var(--pad-4);
  background: color-mix(in srgb, var(--surface-0), transparent 20%);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-1);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; color: var(--text-1); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; color: var(--accent); }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a {
  padding: 7px 12px; border-radius: var(--radius-md);
  color: var(--text-2); font-size: 0.92rem; font-weight: 500;
  transition: all var(--transition);
}
.nav-links a:hover { background: var(--surface-2); color: var(--text-1); text-decoration: none; }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); }
.header-spacer { flex: 1; }
.header-actions { display: flex; align-items: center; gap: 4px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-md);
  font-size: 0.95rem; font-weight: 600; font-family: inherit;
  cursor: pointer; border: 1px solid transparent;
  transition: all var(--transition); position: relative; overflow: hidden;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(to bottom, var(--shine-top) 0%, transparent 55%);
  pointer-events: none;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary { background: var(--surface-2); color: var(--text-1); border-color: var(--border-1); }
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-2); }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; background: transparent; border: none;
  border-radius: var(--radius-md); color: var(--text-2); cursor: pointer;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--surface-2); color: var(--text-1); }
.btn-icon:active { transform: scale(0.95); }
.icon { width: 18px; height: 18px; display: inline-block; vertical-align: middle; pointer-events: none; }

/* ---- Layout ---- */
main { min-height: calc(100vh - 60px); }
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--pad-4); }
.page { display: none; }
.page.active { display: block; animation: fade-in 0.25s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Hero ---- */
.hero { text-align: center; padding: 96px 0 64px; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; margin-bottom: 24px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--radius-full); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.02em;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent), #ec4899 55%));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p.lead { max-width: 640px; margin: 24px auto 36px; font-size: 1.2rem; color: var(--text-2); }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---- Code blocks ---- */
.code-card {
  margin: 40px auto 0; max-width: var(--prose-max);
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border-1); background: #0d1117;
  box-shadow: var(--shadow-lg); text-align: left;
}
.code-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: rgba(0,0,0,0.35);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-family: var(--font-mono); font-size: 0.72rem; color: #8b949e;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.code-dot { width: 11px; height: 11px; border-radius: 50%; }
.code-dot.r { background: #ff5f57; } .code-dot.y { background: #febc2e; } .code-dot.g { background: #28c840; }
.code-head .lang { margin-left: auto; font-weight: 600; }
pre.code { margin: 0; padding: 18px 20px; overflow-x: auto; }
pre.code, pre.code code {
  font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.65;
  color: #e6edf3; background: transparent;
}
/* guji syntax tokens (lightweight tokenizer in app.js) */
.tok-kw { color: #ff7b72; }
.tok-str { color: #a5d6ff; }
.tok-com { color: #8b949e; font-style: italic; }
.tok-sig { color: #79c0ff; }
.tok-num { color: #d2a8ff; }
.tok-fn  { color: #d2a8ff; }
.tok-re  { color: #7ee787; }
.tok-ty  { color: #ffa657; }

/* ---- Feature grid ---- */
.section { padding: 64px 0; }
.section-title { text-align: center; margin-bottom: 12px; font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
.section-sub { text-align: center; color: var(--text-2); max-width: 560px; margin: 0 auto 48px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card {
  padding: 24px; background: var(--surface-1);
  border: 1px solid var(--border-1); border-radius: var(--radius-lg);
  transition: all var(--transition);
}
.card:hover { border-color: var(--border-2); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card .card-icon { width: 28px; height: 28px; color: var(--accent); margin-bottom: 14px; }
.card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.01em; }
.card p { color: var(--text-2); font-size: 0.95rem; }

/* ---- Prose (learn / docs / dl) ---- */
.prose { max-width: var(--prose-max); margin: 0 auto; padding: 56px 0 96px; }
.prose h1 { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.025em; margin-bottom: 8px; }
.prose .subtitle { color: var(--text-2); font-size: 1.1rem; margin-bottom: 40px; }
.prose h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.015em; margin: 44px 0 14px; padding-top: 8px; }
.prose h3 { font-size: 1.15rem; font-weight: 600; margin: 28px 0 10px; }
.prose p { margin: 14px 0; color: var(--text-1); }
.prose ul, .prose ol { margin: 14px 0; padding-left: 1.4em; }
.prose li { margin: 6px 0; color: var(--text-1); }
.prose code:not(pre code) {
  font-family: var(--font-mono); font-size: 0.875em;
  background: var(--surface-2); color: var(--accent);
  padding: 0.15em 0.4em; border-radius: 4px; border: 1px solid var(--border-1);
}
.prose pre.code { margin: 20px 0; }
.prose .note {
  margin: 20px 0; padding: 14px 18px;
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 var(--radius-md) var(--radius-md) 0; color: var(--text-1);
}
.prose table { border-collapse: collapse; width: 100%; margin: 20px 0; font-size: 0.92rem; border: 1px solid var(--border-1); border-radius: var(--radius-md); overflow: hidden; }
.prose th, .prose td { padding: 9px 13px; text-align: left; border-bottom: 1px solid var(--border-1); }
.prose th { background: var(--surface-2); font-weight: 600; }
.prose tr:last-child td { border-bottom: none; }

/* ---- Docs layout (sidebar + content) ---- */
.docs-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 40px; max-width: var(--content-max); margin: 0 auto; padding: 40px var(--pad-4) 96px; }
.docs-nav { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; }
.docs-nav .nav-group { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); font-weight: 700; margin: 18px 0 6px; }
.docs-nav a { display: block; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 0.9rem; }
.docs-nav a:hover { background: var(--surface-2); color: var(--text-1); text-decoration: none; }
.docs-nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.docs-content { min-width: 0; }
.docs-content .prose { padding-top: 0; margin: 0; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border-1); background: var(--surface-1);
  padding: 40px var(--pad-4); margin-top: 40px;
}
.footer-inner { max-width: var(--content-max); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.footer-inner .muted { color: var(--text-3); font-size: 0.85rem; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-2); font-size: 0.9rem; }

/* ---- Theme menu ---- */
.menu-wrap { position: relative; }
.theme-menu {
  position: absolute; right: 0; top: 46px; z-index: 60;
  width: 230px; max-height: 70vh; overflow-y: auto;
  background: var(--surface-0); border: 1px solid var(--border-1);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 8px; display: none;
}
.theme-menu.open { display: block; animation: fade-in 0.15s ease; }
.theme-menu .menu-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: 700; padding: 8px 8px 4px; }
.theme-menu button.theme-opt {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 8px; border: none; background: transparent; cursor: pointer;
  border-radius: var(--radius-sm); color: var(--text-1); font-size: 0.88rem;
  font-family: inherit; text-align: left; transition: background var(--transition);
}
.theme-menu button.theme-opt:hover { background: var(--surface-2); }
.theme-menu button.theme-opt.active { color: var(--accent); font-weight: 600; }
.swatch-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border-2); flex-shrink: 0; }

.sun-moon .icon-moon { display: none; }
[data-mode="dark"] .sun-moon .icon-sun { display: none; }
[data-mode="dark"] .sun-moon .icon-moon { display: inline-block; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .docs-wrap { grid-template-columns: 1fr; }
  .docs-nav { position: static; max-height: none; border-bottom: 1px solid var(--border-1); padding-bottom: 16px; margin-bottom: 8px; }
  .nav-links { display: none; }
}

/* ---- Home uplift ---- */
.hero { position: relative; }
.hero-glow {
  position: absolute; top: -120px; left: 50%; transform: translateX(-50%);
  width: min(900px, 100vw); height: 480px; pointer-events: none; z-index: -1;
  background:
    radial-gradient(ellipse 55% 50% at 50% 30%, var(--accent-soft), transparent 70%),
    radial-gradient(ellipse 35% 40% at 65% 20%, color-mix(in srgb, #ec4899, transparent 88%), transparent 70%);
  filter: blur(2px);
}
.btn-ghost-line {
  background: transparent; color: var(--text-2); border-color: var(--border-1);
}
.btn-ghost-line:hover { color: var(--accent); border-color: var(--accent); }
.hero-badges {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-top: 26px; font-size: 0.82rem; color: var(--text-3);
}
.hero-badges span { white-space: nowrap; }
.hero-badges i { font-style: normal; color: var(--border-2); }

.card { position: relative; overflow: hidden; }
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent), #ec4899 60%));
  opacity: 0; transition: opacity var(--transition);
}
.card:hover::before { opacity: 1; }

.principles-band {
  background: var(--surface-1); border: 1px solid var(--border-1);
  border-radius: var(--radius-xl); padding: 48px clamp(20px, 5vw, 56px);
  max-width: calc(var(--content-max) - 2 * var(--pad-4));
}
.principles { list-style: none; counter-reset: pr; max-width: 720px; margin: 0 auto; }
.principles li {
  counter-increment: pr; position: relative;
  padding: 14px 0 14px 56px; color: var(--text-2);
  border-bottom: 1px solid var(--border-1); font-size: 0.97rem; line-height: 1.55;
}
.principles li:last-child { border-bottom: none; }
.principles li b { color: var(--text-1); }
.principles li::before {
  content: counter(pr, decimal-leading-zero); position: absolute; left: 0; top: 14px;
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 700;
  color: var(--accent); background: var(--accent-soft);
  padding: 4px 8px; border-radius: var(--radius-sm);
}

/* Footer columns */
.footer-cols {
  max-width: var(--content-max); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
}
.footer-col h4 {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-3); font-weight: 700; margin-bottom: 12px;
}
.footer-col a { display: block; padding: 4px 0; color: var(--text-2); font-size: 0.9rem; }
.footer-col a:hover { color: var(--accent); text-decoration: none; }
.footer-brandcol .brand { margin-bottom: 10px; }
.footer-brandcol p { font-size: 0.85rem; line-height: 1.55; max-width: 300px; }
@media (max-width: 860px) {
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-brandcol { grid-column: 1 / -1; }
}

/* ---- Learn: tutorial series ---- */
.learn-wrap { max-width: var(--prose-max); margin: 0 auto; padding: 56px var(--pad-4) 96px; }
.learn-hero h1 { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.025em; margin: 14px 0 8px; }
.learn-hero .subtitle { color: var(--text-2); font-size: 1.1rem; margin-bottom: 32px; }

.prereq-box {
  background: var(--surface-1); border: 1px solid var(--border-1);
  border-radius: var(--radius-lg); padding: 22px 24px; margin-bottom: 36px;
}
.prereq-box h3 {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-3); font-weight: 700; margin-bottom: 12px;
}
.prereq-box ul { list-style: none; }
.prereq-box li {
  padding: 7px 0 7px 26px; position: relative;
  color: var(--text-2); font-size: 0.93rem; line-height: 1.55;
}
.prereq-box li b { color: var(--text-1); }
.prereq-box li::before {
  content: '✓'; position: absolute; left: 2px; top: 7px;
  color: var(--accent); font-weight: 700;
}

.series-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.series-item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px; background: var(--surface-1);
  border: 1px solid var(--border-1); border-radius: var(--radius-lg);
  transition: all var(--transition);
}
.series-item:hover { border-color: var(--accent); transform: translateX(3px); text-decoration: none; }
.series-no {
  font-family: var(--font-mono); font-weight: 700; font-size: 0.95rem;
  width: 36px; height: 36px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--radius-md);
}
.series-info { flex: 1; min-width: 0; }
.series-info b { display: block; color: var(--text-1); font-size: 0.97rem; font-weight: 600; letter-spacing: -0.01em; }
.series-info small { display: block; color: var(--text-2); font-size: 0.84rem; margin-top: 2px; line-height: 1.45; }
.series-mins {
  flex-shrink: 0; font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--text-3); padding: 3px 9px;
  border: 1px solid var(--border-1); border-radius: var(--radius-full);
}
.muted-note { margin-top: 28px; color: var(--text-3); font-size: 0.9rem; }

/* Tutorial part pages */
.learn-prose { padding: 0; }
.part-meta {
  font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent); margin-bottom: 10px;
}
.learn-prose h1 { font-size: 1.9rem; margin-bottom: 14px; }
.step { display: flex; gap: 18px; margin: 30px 0; }
.step-no {
  font-family: var(--font-mono); font-weight: 700;
  width: 32px; height: 32px; flex-shrink: 0; margin-top: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-fg);
  border-radius: var(--radius-full); font-size: 0.85rem;
}
.step-body { flex: 1; min-width: 0; }
.step-body h3 { font-size: 1.15rem; font-weight: 650; margin: 4px 0 10px; letter-spacing: -0.01em; }
.step-body p { margin: 10px 0; color: var(--text-1); }

pre.code.console { background: #161b22; }
pre.code.console .cmd { color: #7ee787; font-weight: 700; user-select: none; }
pre.code.console .cmd-text { color: #e6edf3; font-weight: 600; }
pre.code.console .cmd-out { color: #8b949e; }

.explain {
  margin: 14px 0; padding: 14px 18px;
  background: var(--surface-1); border: 1px solid var(--border-1);
  border-left: 3px solid var(--accent); border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.explain h4 {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-3); font-weight: 700; margin-bottom: 8px;
}
.explain ul { list-style: none; }
.explain li {
  padding: 5px 0 5px 18px; position: relative;
  color: var(--text-2); font-size: 0.9rem; line-height: 1.55;
}
.explain li::before { content: '–'; position: absolute; left: 0; color: var(--accent); }

.next-up { margin-top: 28px; color: var(--text-2); font-style: italic; }

.finish-box {
  margin-top: 36px; padding: 24px 26px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
  border: 1px solid var(--border-1); border-radius: var(--radius-xl);
}
.finish-box h3 { font-size: 1.25rem; margin-bottom: 10px; letter-spacing: -0.01em; }
.finish-box p { color: var(--text-2); margin-bottom: 10px; }
.finish-box ul { list-style: none; }
.finish-box li { padding: 4px 0 4px 18px; position: relative; color: var(--text-2); font-size: 0.93rem; }
.finish-box li::before { content: '→'; position: absolute; left: 0; color: var(--accent); }

.learn-pager { display: flex; gap: 12px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--border-1); }
.pager-link {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; background: var(--surface-1);
  border: 1px solid var(--border-1); border-radius: var(--radius-md);
  color: var(--text-2); transition: all var(--transition);
}
.pager-link:hover { border-color: var(--accent); text-decoration: none; }
.pager-link:hover b { color: var(--accent); }
.pager-link small { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.pager-link b { display: block; font-size: 0.88rem; font-weight: 600; color: var(--text-1); }
.pager-link.pager-right { justify-content: flex-end; text-align: right; }
.pager-link.pager-center { flex: 0 0 auto; text-align: center; }

@media (max-width: 600px) {
  .step { gap: 12px; }
  .series-mins { display: none; }
  .learn-pager { flex-wrap: wrap; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--radius-full); border: 2px solid var(--surface-0); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

.hidden { display: none !important; }
