/* Claude Code Academy — design system
   Warm ivory canvas, clay primary, Anthropic illustration palette for accents.
   Serif display (Newsreader) / grotesk UI (Geist) / mono (JetBrains Mono). */

@view-transition { navigation: auto; }

:root {
  --ivory: #FAF9F5;
  --ivory-2: #F5F4EE;
  --paper: #FFFFFF;
  --oat: #E8E6DC;
  --oat-2: #DEDBCE;
  --line: #E3E0D4;
  --ink: #141413;
  --ink-2: #3D3D3A;
  --ink-3: #6B6A63;
  --ink-4: #8F8E86;

  --clay: #D97757;
  --clay-deep: #C15F3C;
  --clay-ink: #A84F2E;      /* clay for text on light surfaces (>=4.5:1) */
  --clay-btn: #B85735;      /* clay for buttons with white text (>=4.5:1) */
  --olive-ink: #4F5F38;
  --sky-ink: #3F6C99;
  --clay-soft: #F4D9CC;
  --kraft: #D4A27F;
  --manilla: #EBDBBC;
  --sky: #6A9BCC;
  --sky-soft: #D6E4F1;
  --olive: #788C5D;
  --olive-soft: #DDE5D1;
  --cactus: #BCD1CA;
  --heather: #CBCADB;
  --fig: #C46686;
  --fig-soft: #F1D6DF;
  --coral: #EBCECE;

  --bg: var(--ivory);
  --bg-2: var(--ivory-2);
  --surface: var(--paper);
  --surface-2: #FBFAF7;
  --text: var(--ink);
  --text-2: var(--ink-2);
  --muted: var(--ink-3);
  --border: var(--line);
  --primary: var(--clay);
  --primary-ink: #FFFFFF;
  --focus: #2C84DB;

  --term-bg: #1F1E1D;
  --term-bg-2: #262624;
  --term-text: #E8E6DC;
  --term-dim: #9C9A92;

  --ff-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --ff-ui: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ff-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(20,20,19,.05), 0 1px 1px rgba(20,20,19,.03);
  --shadow-2: 0 6px 24px -8px rgba(20,20,19,.14), 0 2px 6px rgba(20,20,19,.05);
  --shadow-3: 0 30px 80px -24px rgba(60,40,20,.28), 0 10px 30px -10px rgba(20,20,19,.12);
  --ease: cubic-bezier(.2,.7,.2,1);
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1F1E1D; --bg-2: #262624; --surface: #2A2927; --surface-2: #30302E;
    --text: #F0EEE6; --text-2: #D6D3C8; --muted: #A6A399; --border: #3B3A37;
    --oat: #34332F; --oat-2: #403E3A; --clay-soft: #4A3128; --sky-soft: #24323F;
    --olive-soft: #2D3527; --fig-soft: #41282F; --primary-ink: #FFFFFF;
    --shadow-2: 0 6px 24px -8px rgba(0,0,0,.5); --shadow-3: 0 30px 80px -24px rgba(0,0,0,.6);
    --term-bg: #141413; --term-bg-2: #1B1B19;
    --clay-ink: #E59A80; --olive-ink: #A9C08A; --sky-ink: #8DB6DE;
  }
}
:root[data-theme="dark"] {
  --bg: #1F1E1D; --bg-2: #262624; --surface: #2A2927; --surface-2: #30302E;
  --text: #F0EEE6; --text-2: #D6D3C8; --muted: #A6A399; --border: #3B3A37;
  --oat: #34332F; --oat-2: #403E3A; --clay-soft: #4A3128; --sky-soft: #24323F;
  --olive-soft: #2D3527; --fig-soft: #41282F; --primary-ink: #FFFFFF;
  --shadow-2: 0 6px 24px -8px rgba(0,0,0,.5); --shadow-3: 0 30px 80px -24px rgba(0,0,0,.6);
  --term-bg: #141413; --term-bg-2: #1B1B19;
  --clay-ink: #E59A80; --olive-ink: #A9C08A; --sky-ink: #8DB6DE;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.6 var(--ff-ui); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--clay) 55%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--clay-ink); }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--clay) 30%, transparent); }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--border); margin: 48px 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--ink); color: var(--ivory); padding: 10px 16px; border-radius: 10px; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Type ---------- */
h1, h2, h3, .display { font-family: var(--ff-display); font-weight: 500; letter-spacing: -.02em; line-height: 1.08; margin: 0 0 .5em; font-optical-sizing: auto; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); line-height: 1.2; }
h4 { font: 600 1.02rem/1.3 var(--ff-ui); margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.lede { font-size: clamp(1.08rem, 1.6vw, 1.3rem); color: var(--text-2); line-height: 1.55; max-width: 62ch; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 .78rem/1 var(--ff-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--clay-ink); }
:root[data-theme="dark"] .eyebrow { color: var(--kraft); }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--clay); transform: rotate(45deg); }
.italic { font-style: italic; }
.grad {
  background: linear-gradient(100deg, var(--clay) 0%, var(--fig) 35%, var(--sky) 70%, var(--olive) 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradshift 9s var(--ease) infinite alternate;
}
@keyframes gradshift { to { background-position: 100% 0; } }
code, kbd, pre, .mono { font-family: var(--ff-mono); }
:not(pre) > code { font-size: .86em; background: var(--oat); padding: .14em .42em; border-radius: 6px; color: var(--text); }
kbd { font-size: .78em; padding: .15em .5em; border: 1px solid var(--oat-2); border-bottom-width: 2.5px; border-radius: 6px; background: var(--surface); }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--ink); --c: var(--ivory);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 0 22px; border-radius: var(--r-pill); border: 1px solid transparent;
  background: var(--b); color: var(--c); font-weight: 600; font-size: .97rem; text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s;
  position: relative; isolation: isolate; white-space: nowrap;
}
.btn:hover { color: var(--c); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(0); }
.btn-clay { --b: var(--clay-btn); --c: #fff; box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--clay) 80%, transparent), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-clay:hover { --b: #A04A2C; }
.btn-ghost { --b: transparent; --c: var(--text); border-color: var(--oat-2); }
.btn-ghost:hover { --b: var(--surface); }
.btn-light { --b: var(--ivory); --c: var(--ink); }
.btn-sm { min-height: 36px; padding: 0 15px; font-size: .88rem; }
.btn-lg { min-height: 56px; padding: 0 30px; font-size: 1.05rem; }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-shine::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  background-size: 250% 100%; animation: shine 3.6s infinite;
}
@keyframes shine { 0%,60% { background-position: 150% 0; } 100% { background-position: -100% 0; } }

/* ---------- Announcement + header ---------- */
.announce {
  position: relative; z-index: 60; background: var(--ink); color: var(--ivory);
  font-size: .88rem; text-align: center; padding: 9px 44px;
}
.announce a { color: var(--manilla); font-weight: 600; }
.announce .spark { color: var(--clay); margin-right: 6px; }
.announce-x { position: absolute; right: 10px; top: 50%; translate: 0 -50%; background: none; border: 0; color: var(--ivory); opacity: .7; width: 30px; height: 30px; border-radius: 8px; }
.announce-x:hover { opacity: 1; background: rgba(255,255,255,.1); }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s;
}
.site-header.scrolled { border-color: var(--border); }
.nav { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand img { width: 36px; height: 36px; transition: transform .5s var(--ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.brand-name { font: 500 1.22rem/1 var(--ff-display); letter-spacing: -.02em; }
.brand-name b { font-weight: 600; }
.brand-name span { color: var(--muted); font-style: italic; }
.nav-links { display: flex; gap: 2px; margin-left: 18px; }
.nav-links a { white-space: nowrap; text-decoration: none; padding: 8px 13px; border-radius: 10px; font-size: .94rem; color: var(--text-2); font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--oat); color: var(--text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-trigger {
  display: inline-flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 13px;
  border: 1px solid var(--border); background: var(--surface); border-radius: 11px; color: var(--muted); font-size: .9rem; min-width: 200px;
}
.search-trigger kbd { margin-left: auto; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); }
.icon-btn:hover { background: var(--oat); }
.stat-chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px; border-radius: var(--r-pill); background: var(--oat); font: 600 .82rem/1 var(--ff-mono); text-decoration: none; color: var(--text); }
.stat-chip .flame { color: var(--clay); }
.menu-btn { display: none; }
.mobile-nav { display: none; }

@media (max-width: 1480px) { .search-trigger .label, .search-trigger kbd { display: none; } .search-trigger { min-width: 0; width: 38px; padding: 0; justify-content: center; } .nav-links { margin-left: 6px; } .nav-links a { padding: 8px 10px; } }
@media (max-width: 1180px) { .nav-right .btn-ghost { display: none; } }
@media (max-width: 1040px) {
  .nav-links, .search-trigger .label, .search-trigger kbd { display: none; }
  .search-trigger { min-width: 0; width: 38px; padding: 0; justify-content: center; }
  .menu-btn { display: inline-grid; }
  .mobile-nav { position: fixed; inset: 68px 0 auto 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 12px var(--gutter) 22px; box-shadow: var(--shadow-2); z-index: 49; }
  .mobile-nav.open { display: grid; gap: 2px; }
  .mobile-nav a { padding: 13px 10px; border-radius: 10px; text-decoration: none; font-weight: 500; }
  .mobile-nav a:hover { background: var(--oat); }
  .mobile-nav .btn { margin-top: 10px; }
}
@media (max-width: 560px) { .nav-right .btn-ghost, .stat-chip .xp { display: none; } .brand-name span { display: none; } .nav { gap: 10px; } .nav-right { gap: 6px; } }
@media (max-width: 440px) { .nav-right .btn-clay { display: none; } .brand-name { font-size: 1.08rem; } .announce { font-size: .8rem; padding: 8px 40px 8px 14px; } }
.prose > h2:first-child { margin-top: .4em; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 64px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.02fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(2.7rem, 6.2vw, 5.4rem); line-height: .98; margin-top: 14px; margin-bottom: 22px; }
.hero h1 em { font-style: italic; font-weight: 400; }
.hero .lede { margin-bottom: 30px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: .9rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta i { width: 8px; height: 8px; border-radius: 50%; background: var(--olive); display: inline-block; box-shadow: 0 0 0 4px color-mix(in srgb, var(--olive) 22%, transparent); }
.blobs { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 18s ease-in-out infinite alternate; }
.blob.b1 { width: 420px; height: 420px; background: var(--clay-soft); top: -120px; right: 8%; }
.blob.b2 { width: 340px; height: 340px; background: var(--sky-soft); bottom: -80px; right: 34%; animation-delay: -6s; }
.blob.b3 { width: 280px; height: 280px; background: var(--manilla); top: 30%; left: -100px; animation-delay: -11s; }
.blob.b4 { width: 220px; height: 220px; background: var(--fig-soft); top: 8%; left: 38%; animation-delay: -3s; opacity: .4; }
@keyframes float { to { transform: translate(40px, 30px) scale(1.12); } }
.grain::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; } }

/* ---------- Terminal (Claude Code look) ---------- */
.term {
  background: var(--term-bg); color: var(--term-text); border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow-3), 0 0 0 1px rgba(255,255,255,.04) inset;
  font: 400 13.5px/1.62 var(--ff-mono); position: relative;
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--term-bg-2); border-bottom: 1px solid rgba(255,255,255,.05); }
.term-bar .dots { display: flex; gap: 7px; }
.term-bar .dots i { width: 11px; height: 11px; border-radius: 50%; background: #3A3936; }
.term-bar .dots i:nth-child(1) { background: #E9695C; } .term-bar .dots i:nth-child(2) { background: #E5BF4C; } .term-bar .dots i:nth-child(3) { background: #7FBF62; }
.term-bar .title { flex: 1; text-align: center; color: var(--term-dim); font-size: 12px; margin-right: 44px; }
.term-replay { background: none; border: 1px solid rgba(255,255,255,.1); color: var(--term-dim); font: 500 11px/1 var(--ff-mono); padding: 5px 9px; border-radius: 7px; }
.term-replay:hover { color: var(--term-text); border-color: rgba(255,255,255,.25); }
.term-body { padding: 18px 20px 20px; min-height: 340px; max-height: 520px; overflow: auto; scrollbar-width: thin; }
.term-body .ln { white-space: pre-wrap; word-break: break-word; min-height: 1.62em; }
.t-welcome { border: 1px solid var(--clay); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; color: var(--term-text); }
.t-welcome b { color: var(--clay); font-weight: 600; }
.t-welcome .dim { color: var(--term-dim); }
.t-prompt { color: var(--term-text); background: rgba(255,255,255,.04); border-left: 2px solid var(--term-dim); padding: 2px 10px; margin: 6px 0 10px; border-radius: 0 6px 6px 0; }
.t-prompt::before { content: "> "; color: var(--term-dim); }
.t-shell::before { content: "$ "; color: var(--olive); }
.t-shell { color: #E8E6DC; }
.t-claude { color: #F0EEE6; }
.t-claude::before { content: "● "; color: #F0EEE6; font-size: .8em; }
.term code { background: rgba(255,255,255,.09) !important; color: #F3D2C4 !important; font-size: .95em; }
.t-tool::before { content: "● "; color: #7FBF62; font-size: .8em; }
.t-tool b { font-weight: 600; color: #F0EEE6; }
.t-tool { color: var(--term-dim); }
.t-res { color: var(--term-dim); padding-left: 14px; }
.t-res::before { content: "⎿  "; }
.t-think { color: var(--clay); font-style: italic; }
.t-think::before { content: "✻ "; font-style: normal; display: inline-block; animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.t-add { color: #9AD08A; background: rgba(127,191,98,.10); padding-left: 14px; }
.t-del { color: #F09A8E; background: rgba(233,105,92,.10); padding-left: 14px; }
.t-add::before { content: "+ "; opacity: .7; } .t-del::before { content: "- "; opacity: .7; }
.t-dim { color: var(--term-dim); }
.t-ok { color: #9AD08A; }
.t-warn { color: #E5BF4C; }
.t-perm { border: 1px solid rgba(106,155,204,.55); border-radius: 8px; padding: 8px 12px; margin: 8px 0; color: var(--term-text); }
.t-perm .opt { color: var(--sky); }
.t-status { color: var(--term-dim); border-top: 1px dashed rgba(255,255,255,.1); margin-top: 12px; padding-top: 8px; font-size: 12px; }
.t-status b { color: var(--olive); font-weight: 500; }
.caret { display: inline-block; width: 8px; height: 1.1em; background: var(--clay); vertical-align: -3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term-float { position: relative; }
.term-float .chip {
  position: absolute; z-index: 2; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 14px; font-size: .85rem; box-shadow: var(--shadow-2); display: flex; gap: 10px; align-items: center;
  animation: bob 6s ease-in-out infinite;
}
.term-float .chip b { display: block; font-size: .95rem; }
.term-float .chip small { color: var(--muted); }
.term-float .chip .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 1.1rem; }
.term-float .c1 { left: -34px; bottom: -26px; }
.term-float .c2 { right: -18px; top: -22px; animation-delay: -3s; }
@keyframes bob { 50% { transform: translateY(-10px); } }
@media (max-width: 700px) { .term-float .chip { display: none; } .term { font-size: 12px; } }

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--border); padding: 18px 0; overflow: hidden; background: var(--bg-2); }
.marquee-track { display: flex; gap: 44px; width: max-content; animation: marq 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font: 500 1.15rem/1 var(--ff-display); white-space: nowrap; color: var(--text-2); display: inline-flex; align-items: center; gap: 44px; }
.marquee span::after { content: "✻"; color: var(--clay); font-size: .9rem; }
@keyframes marq { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 104px) 0; position: relative; }
.section-tight { padding: clamp(40px, 6vw, 72px) 0; }
.section-head { max-width: 760px; margin-bottom: 48px; }
.section-head.center { text-align: center; margin-inline: auto; }
.section-head.center .lede { margin-inline: auto; }
.bg-2 { background: var(--bg-2); }
.ink-section { background: var(--ink); color: var(--ivory); }
.ink-section .lede, .ink-section p { color: #CFCCC1; }
.ink-section .eyebrow { color: var(--kraft); }

/* ---------- Cards / bento ---------- */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 26px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s; position: relative;
}
a.card { text-decoration: none; color: inherit; display: block; }
.card:hover { box-shadow: var(--shadow-2); }
a.card:hover { transform: translateY(-4px); border-color: var(--oat-2); color: inherit; }
.card h3 { font-size: 1.35rem; }
.card p { color: var(--text-2); margin-bottom: 0; }
.card .ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 18px; font-size: 1.3rem; }
.ic.clay { background: var(--clay-soft); color: var(--clay-deep); } .ic.sky { background: var(--sky-soft); color: var(--sky); }
.ic.olive { background: var(--olive-soft); color: var(--olive); } .ic.fig { background: var(--fig-soft); color: var(--fig); }
.ic.kraft { background: color-mix(in srgb, var(--kraft) 30%, transparent); color: #9A6A44; } .ic.heather { background: color-mix(in srgb, var(--heather) 55%, transparent); color: #5D5B83; }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(190px, auto); gap: 18px; }
.bento > * { grid-column: span 2; }
.bento .w3 { grid-column: span 3; } .bento .w4 { grid-column: span 4; } .bento .h2 { grid-row: span 2; }
@media (max-width: 960px) { .bento { grid-template-columns: repeat(2, 1fr); } .bento > *, .bento .w3, .bento .w4 { grid-column: span 2; } .bento .h2 { grid-row: auto; } }
.tile { border-radius: var(--r-xl); padding: 28px; position: relative; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.tile h3 { font-size: 1.5rem; margin-bottom: .35em; }
.tile p { color: var(--text-2); }
.tile.t-clay { background: linear-gradient(160deg, #C4643F, #A84F2E 60%, #8E4125); color: #fff; border: 0; }
.tile.t-clay p { color: rgba(255,255,255,.95); }
.tile.t-ink { background: var(--ink); color: var(--ivory); border: 0; }
.tile.t-ink p { color: #CFCCC1; }
.tile.t-sky { background: var(--sky-soft); border: 0; } .tile.t-olive { background: var(--olive-soft); border: 0; }
.tile.t-manilla { background: var(--manilla); border: 0; color: var(--ink); } .tile.t-manilla p { color: var(--ink-2); }
.tile.t-fig { background: var(--fig-soft); border: 0; } .tile.t-cactus { background: var(--cactus); border: 0; color: var(--ink); }
.tile.t-cactus, .tile.t-manilla { --text: var(--ink); --text-2: var(--ink-2); --muted: #4F4E49; --border: rgba(20,20,19,.2); --surface: var(--paper); --oat: rgba(20,20,19,.08); }
.tile.t-cactus p { color: var(--ink-2); }
.tile .big { font: 500 clamp(3rem, 6vw, 4.6rem)/1.1 var(--ff-display); letter-spacing: -.03em; margin: 6px 0 4px; }
.tile .big .emo { font-size: .62em; vertical-align: .12em; margin-right: .1em; letter-spacing: 0; }
.tile .deco { position: absolute; right: -20px; bottom: -20px; font-size: 9rem; opacity: .14; line-height: 1; pointer-events: none; }

/* ---------- Learning path ---------- */
.path { position: relative; display: grid; gap: 20px; }
.path-unit {
  display: grid; grid-template-columns: 88px 1fr auto; gap: 24px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 22px 26px;
  text-decoration: none; color: inherit; transition: transform .35s var(--ease), box-shadow .35s;
  position: relative; overflow: hidden;
}
.path-unit::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--uc, var(--clay)); }
.path-unit:hover { transform: translateX(6px); box-shadow: var(--shadow-2); color: inherit; }
.path-num { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; font: 500 2rem/1 var(--ff-display); background: color-mix(in srgb, var(--uc) 18%, transparent); color: var(--ut, var(--uc)); position: relative; }
.path-num svg { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); }
.path-unit h3 { margin: 0 0 4px; font-size: 1.45rem; }
.path-unit p { margin: 0; color: var(--muted); font-size: .95rem; }
.path-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag { font: 500 .74rem/1 var(--ff-mono); padding: 6px 9px; border-radius: 7px; background: var(--oat); color: var(--text-2); white-space: nowrap; }
.tag.free { background: var(--olive-soft); color: var(--olive-ink); }
.tag.pro { background: var(--clay-soft); color: #94421F; }
:root[data-theme="dark"] .tag.pro { color: var(--kraft); }
.path-meta { text-align: right; color: var(--muted); font: 500 .85rem/1.5 var(--ff-mono); white-space: nowrap; }
@media (max-width: 720px) { .path-unit { grid-template-columns: 64px 1fr; } .path-num { width: 56px; height: 56px; font-size: 1.5rem; border-radius: 17px; } .path-meta { grid-column: 1 / -1; text-align: left; } }

.lesson-list { display: grid; gap: 10px; }
.lesson-row {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: center; padding: 16px 18px;
  border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: inherit;
  transition: background .2s, transform .25s var(--ease);
}
.lesson-row:hover { background: var(--surface-2); transform: translateX(4px); color: inherit; }
.lesson-row .n { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--oat); font: 600 .9rem/1 var(--ff-mono); }
.lesson-row.done .n { background: var(--olive); color: #fff; }
.lesson-row.done .n::after { content: "✓"; }
.lesson-row.done .n span { display: none; }
.lesson-row h4 { margin: 0 0 2px; font-size: 1.02rem; }
.lesson-row small { color: var(--muted); }
.lock { color: var(--muted); font-size: .9rem; }

/* ---------- Pricing ---------- */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 960px) { .pricing { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; } }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 32px; display: flex; flex-direction: column; position: relative; }
.plan.featured { background: var(--ink); color: var(--ivory); border-color: var(--ink); box-shadow: var(--shadow-3); transform: scale(1.03); }
@media (max-width: 960px) { .plan.featured { transform: none; } }
.plan.featured p, .plan.featured li { color: #D6D3C8; }
.plan .badge { position: absolute; top: -13px; left: 32px; background: var(--clay-btn); color: #fff; font: 600 .74rem/1 var(--ff-mono); letter-spacing: .06em; text-transform: uppercase; padding: 8px 12px; border-radius: var(--r-pill); }
.plan h3 { font-size: 1.6rem; margin-bottom: 6px; }
.price { font: 500 3.6rem/1 var(--ff-display); letter-spacing: -.03em; margin: 18px 0 4px; }
.price small { font: 500 1rem/1 var(--ff-ui); color: var(--muted); letter-spacing: 0; }
.plan.featured .price small { color: #A6A399; }
.plan ul { list-style: none; padding: 0; margin: 22px 0 28px; display: grid; gap: 11px; flex: 1; }
.plan li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: .96rem; }
.plan li::before { content: "✓"; color: var(--olive); font-weight: 700; }
.plan.featured li::before { color: var(--clay); }
.plan li.no { color: var(--muted); } .plan li.no::before { content: "—"; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 0 22px; transition: background .2s; }
.faq details[open] { background: var(--surface-2); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.5rem/1 var(--ff-ui); color: var(--clay); transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 20px; color: var(--text-2); }

/* ---------- Lesson layout (claude.ai-like) ---------- */
.learn { display: grid; grid-template-columns: 290px minmax(0, 1fr) 240px; gap: 0; min-height: calc(100vh - 68px); }
.learn-side { border-right: 1px solid var(--border); background: var(--bg-2); position: sticky; top: 68px; height: calc(100vh - 68px); overflow: auto; padding: 20px 14px 40px; scrollbar-width: thin; }
.learn-side .course-title { font: 500 1.1rem/1.2 var(--ff-display); padding: 4px 10px 14px; }
.side-prog { margin: 0 10px 18px; }
.bar { height: 7px; background: var(--oat); border-radius: 9px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--clay), var(--fig)); border-radius: inherit; transition: width .8s var(--ease); }
.side-prog small { display: flex; justify-content: space-between; color: var(--muted); font: 500 .76rem/1 var(--ff-mono); margin-top: 8px; }
.side-unit { margin-bottom: 8px; }
.side-unit > summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; font: 600 .84rem/1.3 var(--ff-ui); color: var(--text-2); }
.side-unit > summary::-webkit-details-marker { display: none; }
.side-unit > summary:hover { background: var(--oat); }
.side-unit > summary i { width: 10px; height: 10px; border-radius: 3px; background: var(--uc); flex-shrink: 0; }
.side-unit a { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px 7px 30px; border-radius: 9px; text-decoration: none; font-size: .88rem; color: var(--text-2); line-height: 1.35; }
.side-unit a:hover { background: var(--oat); color: var(--text); }
.side-unit a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-1); }
.side-unit a .st { width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--oat-2); margin-top: 1px; display: grid; place-items: center; font-size: 10px; }
.side-unit a.done .st { background: var(--olive); border-color: var(--olive); color: #fff; }
.side-unit a.done .st::after { content: "✓"; }
.side-unit a .lk { margin-left: auto; font-size: .75rem; opacity: .6; }
.learn-main { padding: clamp(28px, 4vw, 56px) clamp(18px, 5vw, 72px) 96px; min-width: 0; }
.learn-toc { position: sticky; top: 68px; height: calc(100vh - 68px); overflow: auto; padding: 40px 20px; border-left: 1px solid var(--border); }
.learn-toc h4 { font: 600 .74rem/1 var(--ff-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.learn-toc a { display: block; text-decoration: none; font-size: .86rem; color: var(--muted); padding: 6px 0 6px 12px; border-left: 2px solid var(--border); }
.learn-toc a.active, .learn-toc a:hover { color: var(--text); border-color: var(--clay); }
.toc-xp { margin-top: 28px; padding: 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); font-size: .85rem; }
.toc-xp b { font: 500 1.6rem/1 var(--ff-display); display: block; margin: 4px 0; }
@media (max-width: 1240px) { .learn { grid-template-columns: 270px minmax(0,1fr); } .learn-toc { display: none; } }
@media (max-width: 880px) {
  .learn { grid-template-columns: 1fr; }
  .learn-side { position: fixed; inset: 68px auto 0 0; width: min(320px, 88vw); z-index: 45; transform: translateX(-102%); transition: transform .35s var(--ease); box-shadow: var(--shadow-3); }
  .learn-side.open { transform: none; }
}
.outline-btn { display: none; }
@media (max-width: 880px) { .outline-btn { display: inline-flex; margin-bottom: 18px; } }
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 70; background: linear-gradient(90deg, var(--clay), var(--fig), var(--sky)); }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .84rem; color: var(--muted); margin-bottom: 22px; }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--text); }
.crumbs span[aria-hidden] { opacity: .5; }
.lesson-head { margin-bottom: 36px; max-width: 760px; }
.lesson-head h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); margin-bottom: 16px; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.lesson-meta .tag { font-size: .78rem; padding: 7px 10px; }
.objectives { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 26px; margin: 0 0 40px; max-width: 760px; }
.objectives h4 { display: flex; gap: 8px; align-items: center; }
.objectives ul { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.objectives li { display: grid; grid-template-columns: 24px 1fr; color: var(--text-2); }
.objectives li::before { content: "◆"; color: var(--clay); font-size: .7rem; padding-top: 5px; }

.prose { max-width: 760px; font: 400 1.12rem/1.72 var(--ff-display); color: var(--text); }
.prose > * + * { margin-top: 0; }
.prose h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin: 2.2em 0 .6em; scroll-margin-top: 90px; }
.prose h3 { font-size: 1.38rem; margin: 1.8em 0 .5em; }
.prose p, .prose li { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; padding-left: .2em; }
.prose li::marker { color: var(--clay); }
.prose strong { font-weight: 600; }
.prose a { color: var(--clay-ink); }
:root[data-theme="dark"] .prose a { color: var(--kraft); }
.prose table { width: 100%; border-collapse: collapse; font: 400 .93rem/1.5 var(--ff-ui); margin: 1.4em 0 1.8em; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font-weight: 600; background: var(--bg-2); white-space: nowrap; }
.prose tr:hover td { background: var(--surface-2); }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--clay); font-style: italic; color: var(--text-2); }

.codeblock { position: relative; margin: 1.4em 0 1.8em; border-radius: 14px; overflow: hidden; background: var(--term-bg); box-shadow: var(--shadow-2); }
.codeblock .cb-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; background: var(--term-bg-2); color: var(--term-dim); font: 500 .76rem/1 var(--ff-mono); }
.codeblock .cb-head .fn { color: #D6D3C8; }
.copy-btn { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: #BDBBB3; border-radius: 7px; font: 500 .74rem/1 var(--ff-mono); padding: 6px 10px; }
.copy-btn:hover { color: #fff; }
.copy-btn.ok { color: #9AD08A; border-color: rgba(154,208,138,.5); }
.codeblock pre { margin: 0; padding: 16px 18px; overflow-x: auto; color: var(--term-text); font: 400 .86rem/1.65 var(--ff-mono); tab-size: 2; }
.tok-c { color: #8F8E86; font-style: italic; } .tok-s { color: #D4A27F; } .tok-k { color: #E5906E; } .tok-n { color: #A9C6E3; } .tok-p { color: #9AD08A; } .tok-f { color: #CBCADB; }

.callout { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 18px 20px; border-radius: var(--r-md); margin: 1.6em 0; font: 400 1rem/1.6 var(--ff-ui); background: var(--bg-2); border: 1px solid var(--border); }
.callout .ci { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: .95rem; }
.callout p:last-child { margin-bottom: 0; }
.callout b.ct { display: block; margin-bottom: 4px; }
.callout.tip { background: color-mix(in srgb, var(--olive-soft) 70%, var(--bg)); border-color: color-mix(in srgb, var(--olive) 30%, transparent); } .callout.tip .ci { background: var(--olive); color: #fff; }
.callout.warn { background: color-mix(in srgb, var(--clay-soft) 60%, var(--bg)); border-color: color-mix(in srgb, var(--clay) 35%, transparent); } .callout.warn .ci { background: var(--clay); color: #fff; }
.callout.note { background: color-mix(in srgb, var(--sky-soft) 70%, var(--bg)); border-color: color-mix(in srgb, var(--sky) 30%, transparent); } .callout.note .ci { background: var(--sky); color: #fff; }
.callout.pro { background: color-mix(in srgb, var(--fig-soft) 65%, var(--bg)); border-color: color-mix(in srgb, var(--fig) 30%, transparent); } .callout.pro .ci { background: var(--fig); color: #fff; }

/* ---------- Interactive modules ---------- */
.module { margin: 2.2em 0; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); overflow: hidden; font-family: var(--ff-ui); }
.module-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.module-head .mi { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--ink); color: var(--ivory); font-size: .85rem; }
.module-head b { font-size: .95rem; }
.module-head small { margin-left: auto; color: var(--muted); font: 500 .74rem/1 var(--ff-mono); }
.module-body { padding: 22px; }

.quiz-q { margin-bottom: 26px; }
.quiz-q:last-of-type { margin-bottom: 8px; }
.quiz-q > p { font-weight: 600; font-size: 1.04rem; margin-bottom: 12px; }
.quiz-q .qn { font: 600 .74rem/1 var(--ff-mono); color: var(--clay-ink); display: block; margin-bottom: 6px; }
.opts { display: grid; gap: 8px; }
.opt {
  text-align: left; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center;
  padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg); font-size: .97rem; line-height: 1.45;
  transition: border-color .2s, background .2s, transform .15s;
}
.opt:hover:not(:disabled) { border-color: var(--clay); transform: translateX(3px); }
.opt .k { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--oat); font: 600 .8rem/1 var(--ff-mono); }
.opt.correct { border-color: var(--olive); background: var(--olive-soft); } .opt.correct .k { background: var(--olive); color: #fff; }
.opt.wrong { border-color: var(--clay); background: var(--clay-soft); animation: shake .4s; } .opt.wrong .k { background: var(--clay); color: #fff; }
.opt:disabled { cursor: default; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.explain { display: none; margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: var(--bg-2); color: var(--text-2); font-size: .93rem; }
.explain.show { display: block; animation: fadeUp .4s var(--ease); }
.quiz-score { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 20px; border-top: 1px solid var(--border); background: var(--surface-2); font-weight: 600; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }

.flips { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.flip { perspective: 900px; height: 170px; background: none; border: 0; padding: 0; text-align: left; }
.flip-in { position: relative; width: 100%; height: 100%; transition: transform .6s var(--ease); transform-style: preserve-3d; }
.flip.on .flip-in { transform: rotateY(180deg); }
.flip-f, .flip-b { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 14px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; }
.flip-f { background: var(--ink); color: var(--ivory); }
.flip-f b { font: 500 1.25rem/1.25 var(--ff-display); }
.flip-f small, .flip-b small { font: 500 .7rem/1 var(--ff-mono); opacity: .95; text-transform: uppercase; letter-spacing: .08em; }
.flip-b { background: var(--clay-soft); color: var(--text); transform: rotateY(180deg); font-size: .93rem; line-height: 1.5; overflow: auto; }
.flip:nth-child(4n+2) .flip-f { background: #A84F2E; } .flip:nth-child(4n+3) .flip-f { background: #4F6E8F; } .flip:nth-child(4n+4) .flip-f { background: #5B6B45; }

.order-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.order-item { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg); cursor: grab; user-select: none; font-size: .96rem; transition: border-color .2s, background .2s; }
.order-item.dragging { opacity: .5; border-style: dashed; }
.order-item .grip { color: var(--muted); letter-spacing: -2px; }
.order-item .mv { display: flex; gap: 4px; }
.order-item .mv button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); font-size: .8rem; }
.order-item.ok { border-color: var(--olive); background: var(--olive-soft); }
.order-item.bad { border-color: var(--clay); background: var(--clay-soft); }

.cmd-input { display: flex; align-items: center; gap: 10px; background: var(--term-bg); border-radius: 12px; padding: 4px 6px 4px 16px; font-family: var(--ff-mono); }
.cmd-input span { color: var(--clay); }
.cmd-input input { flex: 1; background: none; border: 0; outline: 0; color: var(--term-text); font: 400 .95rem/1 var(--ff-mono); padding: 12px 0; min-width: 0; }
.cmd-input button { border: 0; background: var(--clay-btn); color: #fff; border-radius: 9px; padding: 9px 14px; font: 600 .85rem/1 var(--ff-ui); }
.cmd-feedback { margin-top: 10px; font-size: .92rem; min-height: 1.4em; }
.cmd-feedback.ok { color: var(--olive); font-weight: 600; } .cmd-feedback.no { color: var(--clay-deep); }
.hint-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: .85rem; padding: 0; margin-top: 6px; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist label { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; padding: 11px 14px; border-radius: 11px; background: var(--bg); border: 1px solid var(--border); cursor: pointer; font-size: .97rem; }
.checklist input { width: 18px; height: 18px; accent-color: var(--olive); margin-top: 3px; }
.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }

.sorter { display: grid; gap: 14px; }
.sort-card { padding: 16px 18px; border-radius: 12px; background: var(--bg); border: 1.5px solid var(--border); font-size: .98rem; }
.sort-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sort-btns button { border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--r-pill); padding: 8px 14px; font: 500 .85rem/1 var(--ff-mono); }
.sort-btns button:hover:not(:disabled) { border-color: var(--clay); }
.sort-btns button.correct { background: var(--olive); color: #fff; border-color: var(--olive); }
.sort-btns button.wrong { background: var(--clay-soft); border-color: var(--clay); }

.complete-box { margin: 48px 0 0; max-width: 760px; padding: 32px; border-radius: var(--r-xl); background: linear-gradient(150deg, var(--clay-soft), var(--fig-soft) 55%, var(--sky-soft)); text-align: center; position: relative; overflow: hidden; }
.complete-box h3 { font-size: 1.9rem; }
.complete-box p { color: var(--text-2); }
.complete-box.is-done .btn-complete { background: var(--olive); }
.takeaways { max-width: 760px; margin: 48px 0 0; padding: 28px; border-radius: var(--r-lg); background: var(--ink); color: var(--ivory); }
.takeaways h3 { color: var(--ivory); }
.takeaways ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.takeaways li { display: grid; grid-template-columns: 26px 1fr; color: #DAD7CC; }
.takeaways li::before { content: "✻"; color: var(--clay); }
.pager { max-width: 760px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 32px; }
.pager a { padding: 18px 20px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: inherit; transition: transform .25s var(--ease), box-shadow .25s; }
.pager a:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); color: inherit; }
.pager small { display: block; color: var(--muted); font: 500 .74rem/1 var(--ff-mono); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.pager b { font: 500 1.08rem/1.3 var(--ff-display); }
.pager .next { text-align: right; grid-column: 2; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 28px; max-width: 760px; }
.share-row span { font-size: .85rem; color: var(--muted); margin-right: 6px; }
.share-row a, .share-row button { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; text-decoration: none; font: 600 .8rem/1 var(--ff-mono); color: var(--text); }
.share-row a:hover, .share-row button:hover { background: var(--oat); }

/* ---------- Paywall ---------- */
.gated { position: relative; }
.gated.locked .gate-content { max-height: 420px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 30%, transparent); mask-image: linear-gradient(#000 30%, transparent); pointer-events: none; user-select: none; }
.paywall { display: none; max-width: 760px; margin: -40px 0 0; position: relative; z-index: 2; }
.gated.locked .paywall { display: block; }
.gated.locked ~ .complete-box, .gated.locked ~ .takeaways, .gated.locked ~ .share-row { display: none; }
.paywall-card { border-radius: var(--r-xl); padding: clamp(26px, 4vw, 44px); background: var(--ink); color: var(--ivory); box-shadow: var(--shadow-3); position: relative; overflow: hidden; }
.paywall-card::after { content: "✻"; position: absolute; right: -10px; top: -40px; font-size: 13rem; color: var(--clay); opacity: .18; line-height: 1; }
.paywall-card h3 { font-size: clamp(1.7rem, 3vw, 2.3rem); color: var(--ivory); }
.paywall-card p { color: #CFCCC1; max-width: 52ch; }
.paywall-card ul { list-style: none; padding: 0; margin: 18px 0 26px; display: grid; gap: 9px; grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (max-width: 600px) { .paywall-card ul { grid-template-columns: 1fr; } }
.paywall-card li { color: #E8E6DC; font-size: .95rem; }
.paywall-card li::before { content: "✓ "; color: var(--clay); font-weight: 700; }
.paywall-card .row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.paywall-card small { color: #A6A399; }

/* ---------- Modal / popup / toast / cookie ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 16px; }
.modal.open { display: grid; }
.modal-bg { position: absolute; inset: 0; background: rgba(20,20,19,.55); backdrop-filter: blur(6px); animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.modal-card { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3); animation: pop .45s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.97); } }
.modal-x { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--oat); z-index: 2; }
.lead-art { background: linear-gradient(140deg, #A84F2E, #8E4A63 60%, #3F6C99); padding: 30px 30px 26px; color: #fff; position: relative; overflow: hidden; }
.lead-art .eyebrow { color: #fff; } .lead-art .eyebrow::before { background: #fff; }
.lead-art h3 { color: #fff; font-size: 2rem; margin: 12px 0 0; }
.lead-art .mini-term { margin-top: 18px; background: rgba(20,20,19,.75); border-radius: 12px; padding: 12px 14px; font: 400 .8rem/1.6 var(--ff-mono); }
.lead-body { padding: 26px 30px 30px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .9rem; }
.field input, .field textarea, .field select { width: 100%; padding: 13px 15px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg); transition: border-color .2s, box-shadow .2s; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: var(--clay); box-shadow: 0 0 0 4px color-mix(in srgb, var(--clay) 18%, transparent); }
.field small { color: var(--muted); }
.form-note { font-size: .82rem; color: var(--muted); margin-top: 10px; }
.form-msg { margin-top: 12px; font-weight: 600; font-size: .93rem; }
.form-msg.ok { color: var(--olive); } .form-msg.err { color: var(--clay-deep); }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 8px; top: 50%; translate: 0 -50%; border: 0; background: none; color: var(--muted); font-size: .82rem; padding: 6px; }

.toasts { position: fixed; z-index: 120; right: 18px; bottom: 18px; display: grid; gap: 10px; }
.toast { background: var(--ink); color: var(--ivory); padding: 13px 16px; border-radius: 14px; box-shadow: var(--shadow-3); display: flex; gap: 12px; align-items: center; animation: toastIn .5s var(--ease); font-size: .93rem; max-width: 340px; }
.toast .ti { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--clay); font: 700 .8rem/1 var(--ff-mono); flex-shrink: 0; }
.toast.out { animation: toastOut .4s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

.cookie { position: fixed; z-index: 90; left: 18px; bottom: 18px; width: min(420px, calc(100% - 36px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-3); display: none; font-size: .9rem; }
.cookie.show { display: block; animation: toastIn .5s var(--ease); }
.cookie p { color: var(--text-2); margin-bottom: 14px; }
.cookie .row { display: flex; gap: 8px; flex-wrap: wrap; }

.sticky-cta { position: fixed; z-index: 40; left: 12px; right: 12px; bottom: 12px; display: none; }
@media (max-width: 720px) { .sticky-cta.show { display: flex; } .sticky-cta .btn { flex: 1; box-shadow: var(--shadow-3); } }

/* ---------- Command palette ---------- */
.palette { position: fixed; inset: 0; z-index: 110; display: none; padding: 12vh 16px 16px; }
.palette.open { display: block; }
.palette-card { position: relative; margin: 0 auto; width: min(640px, 100%); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-3); overflow: hidden; border: 1px solid var(--border); animation: pop .3s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.palette-input input { flex: 1; border: 0; outline: 0; background: none; font-size: 1.05rem; }
.palette-list { max-height: 52vh; overflow: auto; padding: 8px; }
.palette-list a { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 11px; text-decoration: none; color: inherit; }
.palette-list a.sel, .palette-list a:hover { background: var(--oat); }
.palette-list .pi { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-2); font-size: .85rem; }
.palette-list b { display: block; font-size: .95rem; font-weight: 600; }
.palette-list small { color: var(--muted); font-size: .8rem; }
.palette-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: .76rem; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #CFCCC1; padding: 80px 0 32px; margin-top: 0; position: relative; overflow: hidden; }
.site-footer a { color: #CFCCC1; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; }
@media (max-width: 960px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
.foot-brand .brand { color: var(--ivory); }
.foot-brand p { margin-top: 16px; max-width: 36ch; font-size: .93rem; }
.site-footer h4 { color: var(--ivory); font: 600 .76rem/1 var(--ff-mono); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .93rem; }
.foot-news { margin-top: 22px; display: flex; gap: 8px; max-width: 380px; }
.foot-news input { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 12px; border: 1px solid #3B3A37; background: #262624; color: var(--ivory); }
.socials { display: flex; gap: 8px; margin-top: 20px; }
.socials a { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: #262624; border: 1px solid #3B3A37; }
.socials a:hover { background: var(--clay); border-color: var(--clay); }
.socials svg { width: 18px; height: 18px; fill: currentColor; }
.foot-bottom { margin-top: 56px; padding-top: 24px; border-top: 1px solid #3B3A37; display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; font-size: .82rem; color: #8F8E86; }
.foot-bottom p { margin: 0; max-width: 80ch; }
.site-footer > .wrap { container-type: inline-size; }
/* The phrase is ~8.75em wide, so 11cqw fills ~96% of the footer column at any screen width. */
.foot-word { font: 500 9vw/.95 var(--ff-display); font-size: 11cqw; letter-spacing: -.05em; color: #34332F; margin: 48px 0 8px; white-space: nowrap; user-select: none; text-align: center; }

/* ---------- Misc pages ---------- */
.page-hero { padding: clamp(48px, 7vw, 88px) 0 clamp(28px, 4vw, 48px); position: relative; overflow: hidden; }
.page-hero h1 { max-width: 18ch; }
.legal { font: 400 1.02rem/1.75 var(--ff-ui); }
.legal h2 { font-size: 1.6rem; margin-top: 2em; }
.legal h3 { font-size: 1.2rem; margin-top: 1.6em; }
.legal p, .legal li { color: var(--text-2); }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.stats-row > div { padding: 26px 24px; border-right: 1px solid var(--border); }
.stats-row > div:last-child { border-right: 0; }
.stats-row b { display: block; font: 500 2.6rem/1 var(--ff-display); letter-spacing: -.03em; margin-bottom: 6px; }
.stats-row small { color: var(--muted); font-size: .9rem; }
@media (max-width: 760px) { .stats-row { grid-template-columns: 1fr 1fr; } .stats-row > div:nth-child(2) { border-right: 0; } .stats-row > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); } }

.dash-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
.ring { width: 150px; height: 150px; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 500 2.2rem/1 var(--ff-display); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.badge-card { text-align: center; padding: 16px 10px; border-radius: 16px; border: 1px solid var(--border); background: var(--bg); transition: .3s; }
.badge-card:not(.on) .be { filter: grayscale(1); opacity: .45; }
.badge-card.on { background: var(--surface); box-shadow: var(--shadow-1); }
.badge-card .be { font-size: 2rem; display: block; margin-bottom: 6px; }
.badge-card b { font-size: .82rem; display: block; line-height: 1.3; }
.badge-card small { font-size: .72rem; color: var(--muted); }
.heat { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; }
.heat i { aspect-ratio: 1; border-radius: 4px; background: var(--oat); }
.heat i.l1 { background: color-mix(in srgb, var(--clay) 35%, var(--oat)); } .heat i.l2 { background: color-mix(in srgb, var(--clay) 65%, var(--oat)); } .heat i.l3 { background: var(--clay); }

.cert { aspect-ratio: 1.414; max-width: 900px; margin: 0 auto; border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-3); padding: clamp(24px, 5vw, 64px); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); }
.cert::before { content: ""; position: absolute; inset: 14px; border: 1.5px solid var(--kraft); border-radius: 10px; pointer-events: none; }
.cert .cname { font: 500 clamp(2rem, 5vw, 3.6rem)/1 var(--ff-display); font-style: italic; color: var(--clay-deep); }

.blog-card { display: grid; gap: 12px; }
.blog-card .thumb { aspect-ratio: 16/9; border-radius: var(--r-md); display: grid; place-items: center; font: 500 2.6rem/1 var(--ff-display); color: #fff; overflow: hidden; position: relative; }
.blog-card .thumb span { position: relative; z-index: 1; padding: 20px; font-size: 1.4rem; line-height: 1.2; text-align: center; }
.glossary dt { font: 600 1.05rem/1.3 var(--ff-mono); margin-top: 26px; color: var(--clay-deep); scroll-margin-top: 100px; }
:root[data-theme="dark"] .glossary dt { color: var(--kraft); }
.glossary dd { margin: 6px 0 0; color: var(--text-2); }
.az { display: flex; flex-wrap: wrap; gap: 6px; }
.az a { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; font: 600 .85rem/1 var(--ff-mono); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; align-items: center; }
.filter-bar input { flex: 1; min-width: 220px; padding: 13px 16px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); }
.chip-btn { border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--r-pill); padding: 9px 15px; font-weight: 500; font-size: .88rem; }
.chip-btn.on { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.cmd-table { width: 100%; border-collapse: collapse; }
.cmd-table td { padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.cmd-table td:first-child { white-space: nowrap; font-family: var(--ff-mono); font-weight: 600; color: var(--clay-deep); width: 1%; }
:root[data-theme="dark"] .cmd-table td:first-child { color: var(--kraft); }
.cmd-table td:last-child { width: 1%; }

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; }
@supports (animation-timeline: view()) {
  .scroll-pop { animation: scrollPop linear both; animation-timeline: view(); animation-range: entry 0% cover 30%; }
  @keyframes scrollPop { from { opacity: .2; transform: scale(.94) translateY(40px); } }
}
.tilt { transition: transform .4s var(--ease); transform-style: preserve-3d; will-change: transform; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 130; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
@media print {
  .site-header, .site-footer, .announce, .learn-side, .learn-toc, .paywall, .cookie, .toasts, .sticky-cta { display: none !important; }
  .learn { display: block; }
}

.yt-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 14px 10px 10px; border-radius: 12px; background: #262624; border: 1px solid #3B3A37; color: #F0EEE6 !important; font-size: .9rem; }
.yt-link svg { width: 26px; height: 26px; fill: #FF3B30; }
.yt-link b { display: block; font-weight: 600; } .yt-link small { color: #A6A399; }
.yt-card { display: flex; gap: 16px; align-items: center; text-decoration: none; }
.yt-card svg { width: 54px; height: 54px; fill: #FF3B30; flex-shrink: 0; }

/* ---------- mobile hardening ---------- */
.path-unit > span, .lesson-row > span, .order-item > span, .checklist label > span, .sort-card, .opt > span, .callout > div, .card, .tile, .plan { min-width: 0; }
.order-item > span, .checklist label > span, .opt > span, .sort-card, .callout, .objectives li, .takeaways li, .prose li, .prose p { overflow-wrap: anywhere; }
.path-tags { display: flex; }
:not(pre) > code { overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 640px) {
  .lesson-row { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .lesson-row > span:last-child { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
  .path-tags { display: none; }
  .order-item { grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; padding: 10px; }
  .order-item .mv button { width: 30px; height: 30px; }
  .module-body { padding: 16px; }
  .module-head small { display: none; }
  .prose { font-size: 1.06rem; }
  .codeblock pre { font-size: .8rem; }
  .complete-box, .takeaways, .paywall-card { padding: 22px; }
  .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; }
  .hero h1 { font-size: clamp(2.4rem, 11vw, 3.2rem); }
  .stats-row b { font-size: 2rem; }
  .flip { height: 190px; }
  .term-body { padding: 14px; min-height: 280px; }
  .tile { padding: 22px; }
  .cookie { left: 10px; right: 10px; bottom: 10px; width: auto; }
}
.unit-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.unit-aside { position: sticky; top: 90px; }
@media (max-width: 860px) { .unit-grid { grid-template-columns: minmax(0, 1fr); } .unit-aside { position: static; } }
.eyebrow { line-height: 1.45; flex-wrap: wrap; }
.foot-news { flex-wrap: wrap; } .foot-news input { flex: 1 1 200px; }
.prose td code, .prose th code { white-space: nowrap; overflow-wrap: normal; word-break: normal; }

