/* ============================================================
   From Coder to Shipper — design system
   ============================================================ */
:root {
  --bg: #0a0d13;
  --bg-2: #0d121b;
  --surface: #121926;
  --surface-2: #16202f;
  --card: #111826;
  --card-2: #0f1622;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.26);
  --text: #e7ecf5;
  --muted: #9aa8bf;
  --faint: #6b7790;
  --accent: #34d399;
  --accent-dim: #10b981;
  --accent-2: #38bdf8;
  --accent-3: #a78bfa;
  --warn: #fbbf24;
  --code-bg: #0a0f18;
  --radius: 16px;
  --radius-sm: 11px;
  --maxw: 1140px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --shadow: 0 24px 60px -28px rgba(0,0,0,0.7);
  --glow: 0 0 0 1px rgba(52,211,153,0.25), 0 20px 60px -30px rgba(52,211,153,0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(1100px 520px at 82% -8%, rgba(56,189,248,0.10), transparent 60%),
    radial-gradient(900px 480px at 10% 2%, rgba(52,211,153,0.10), transparent 55%);
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.28rem; }
p { margin: 0 0 1em; }
code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--code-bg);
  color: #c7d2e4;
  padding: 0.12em 0.42em;
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow-wrap: anywhere;
}
strong { color: #fff; font-weight: 650; }
em { color: inherit; }
::selection { background: rgba(52,211,153,0.28); color: #fff; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .55em;
  margin-bottom: .9rem;
}
.eyebrow::before { content:""; width: 22px; height: 1px; background: var(--accent); display: inline-block; }
.section { padding: 76px 0; }
.section.tight { padding: 46px 0; }
.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.lead { color: var(--muted); font-size: 1.16rem; max-width: 62ch; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.center { text-align: center; }
.center .section-head { margin-left: auto; margin-right: auto; }
.section-head.center { margin-left: auto; margin-right: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--font); font-weight: 600; font-size: 0.98rem;
  padding: 0.82em 1.35em; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s;
  text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-dim));
  color: #04120c; box-shadow: 0 12px 30px -12px rgba(52,211,153,0.6);
}
.btn-primary:hover { box-shadow: 0 16px 40px -12px rgba(52,211,153,0.8); transform: translateY(-1px); }
.btn-ghost { background: rgba(255,255,255,0.03); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: rgba(255,255,255,0.06); border-color: var(--border-strong); }
.btn-sm { padding: 0.55em 0.95em; font-size: 0.88rem; border-radius: 10px; }
.btn .arw { transition: transform .18s; }
.btn:hover .arw { transform: translateX(3px); }

/* ---------- badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: .04em;
  padding: 0.4em 0.85em; border-radius: 999px;
  background: rgba(52,211,153,0.10); border: 1px solid rgba(52,211,153,0.30); color: var(--accent);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.pill {
  display: inline-block; font-family: var(--mono); font-size: 0.74rem;
  padding: 0.28em 0.7em; border-radius: 8px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--muted);
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10,13,19,0.72);
  border-bottom: 1px solid var(--border);
}
/* nav row is ~15% wider than page content (--maxw 1140px -> 1310px) */
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; max-width: 1310px; }
.brand { display: flex; align-items: center; gap: .6em; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  color: #04120c; font-family: var(--mono); font-weight: 800; font-size: 15px;
  box-shadow: 0 6px 18px -6px rgba(52,211,153,0.7);
}
.brand small { display: block; white-space: nowrap; font-family: var(--mono); font-weight: 500; font-size: 0.62rem; letter-spacing: .12em; color: var(--faint); text-transform: uppercase; margin-top: 1px; }
.nav-links { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 0 1 auto; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.nav-links::-webkit-scrollbar { height: 6px; }
.nav-links::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.nav-links::-webkit-scrollbar-track { background: transparent; }
.nav-links a {
  color: var(--muted); font-size: 0.92rem; font-weight: 500;
  padding: 0.5em 0.85em; border-radius: 9px; transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.05); text-decoration: none; }
.nav-links a.active { color: var(--text); background: rgba(52,211,153,0.12); }
.nav-cta { margin-left: 10px; }
/* keep the primary CTA dark-on-green even inside .nav-links (where links are muted) */
.nav-links a.btn-primary { color: #04120c; }
.nav-links a.btn-primary:hover { background: linear-gradient(180deg, var(--accent), var(--accent-dim)); color: #04120c; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border-strong); color: var(--text);
  width: 42px; height: 40px; border-radius: 10px; font-size: 1.1rem; cursor: pointer; }

/* language switcher */
.nav-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lang-switch {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 2px; background: rgba(255,255,255,0.02);
}
.lang-switch a {
  padding: 3px 10px; border-radius: 999px; line-height: 1.5;
  font-family: var(--mono); font-size: 0.7rem; font-weight: 700; letter-spacing: .08em;
  color: var(--muted); text-decoration: none; transition: color .15s, background .15s;
}
.lang-switch a:not(.on):hover { color: var(--text); background: rgba(255,255,255,0.05); }
.lang-switch a.on {
  color: #04120c;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 14px -6px rgba(52,211,153,0.8);
}

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 40px; background: var(--bg-2); }
.footer-inner { padding: 48px 0 40px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer h4 { font-family: var(--mono); font-size: 0.74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.footer a { color: var(--muted); display: block; padding: 4px 0; font-size: 0.94rem; }
.footer a:hover { color: var(--text); }
.footer .about { color: var(--muted); font-size: 0.95rem; max-width: 34ch; }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--faint); font-size: 0.85rem; font-family: var(--mono); }

/* ---------- terminal card ---------- */
.term {
  background: linear-gradient(180deg, #0d131d, #0a0f17);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: var(--mono);
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--border); }
.term-bar .dots { display: flex; gap: 7px; }
.term-bar .dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.term-bar .dots i:nth-child(1){background:#ff5f57;} .term-bar .dots i:nth-child(2){background:#febc2e;} .term-bar .dots i:nth-child(3){background:#28c840;}
.term-bar .title { margin-left: 8px; color: var(--faint); font-size: 0.8rem; }
.term-body { padding: 20px 20px 22px; font-size: 0.86rem; line-height: 1.9; color: #c7d2e4; overflow-x: auto; }
.term-body .ln { white-space: pre; }
.term-body .p { color: var(--accent); }
.term-body .c { color: #7c8aa5; }
.term-body .ok { color: var(--accent); }
.term-body .hl { color: var(--accent-2); }
.term-body .cursor { display: inline-block; width: 9px; height: 1.05em; background: var(--accent); vertical-align: -2px; animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   LANDING
   ============================================================ */
.hero { position: relative; padding: 84px 0 60px; overflow: hidden; }
.hero::before {
  content:""; position:absolute; inset:0; z-index:0; pointer-events:none;
  background-image:
    linear-gradient(rgba(148,163,184,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(800px 420px at 50% 0%, #000 40%, transparent 75%);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
  .hero-grid > * { min-width: 0; }
.hero h1 { margin: 18px 0 14px; }
.hero h1 .grad { background: linear-gradient(100deg, var(--accent), var(--accent-2) 60%, var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { font-size: 1.18rem; color: var(--muted); max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 30px 0 8px; }
.hero-trust { display: flex; flex-wrap: nowrap; gap: 20px; margin-top: 26px; color: var(--faint); font-family: var(--mono); font-size: 0.8rem; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.hero-trust span { display: inline-flex; align-items: center; gap: .5em; white-space: nowrap; }
.hero-trust b { color: var(--muted); font-weight: 600; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 40px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px 18px; }
.stat .n { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; background: linear-gradient(120deg,#fff,var(--muted)); -webkit-background-clip:text; background-clip:text; color: transparent; }
.stat .l { color: var(--muted); font-size: 0.86rem; margin-top: 2px; }

/* feature / format cards */
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform .16s ease, border-color .2s, background .2s; position: relative;
}
.card:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--surface); }
.card .ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px;
  background: rgba(56,189,248,0.12); border: 1px solid rgba(56,189,248,0.28); color: var(--accent-2);
}
.card .ico svg { width: 24px; height: 24px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.97rem; margin-bottom: 0; }
.card .link { margin-top: 16px; display: inline-flex; align-items: center; gap: .4em; font-weight: 600; color: var(--accent); font-size: 0.92rem; }

/* day timeline */
.timeline { position: relative; margin-top: 8px; }
.timeline::before { content:""; position:absolute; left: 27px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2), var(--accent-3)); opacity: .5; }
.tl-item { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 22px; padding: 16px 0; }
.tl-node {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  font-family: var(--mono); font-weight: 700; font-size: 1.15rem; color: var(--text); z-index: 1;
}
.tl-body { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; transition: border-color .2s, transform .16s; }
.tl-body:hover { border-color: var(--border-strong); transform: translateX(3px); }
.tl-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tl-top .d { font-family: var(--mono); font-size: 0.76rem; color: var(--accent); letter-spacing: .08em; }
.tl-top h3 { margin: 0; font-size: 1.18rem; }
.tl-body .desc { color: var(--muted); font-size: 0.96rem; margin: 6px 0 0; }
.tl-body .go { margin-top: 12px; font-size: 0.88rem; font-weight: 600; color: var(--accent); display: inline-flex; gap: .4em; align-items:center; }

/* CTA band */
.cta-band {
  position: relative; overflow: hidden; border-radius: 22px; padding: 54px 40px; text-align: center;
  background: linear-gradient(135deg, rgba(52,211,153,0.14), rgba(56,189,248,0.12)), var(--card);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow);
}
.cta-band h2 { font-size: clamp(1.8rem,3.6vw,2.6rem); }
.cta-band p { color: var(--muted); font-size: 1.1rem; max-width: 52ch; margin: 0 auto 24px; }
.cta-band .hero-cta { justify-content: center; margin-top: 0; }

/* checklist */
.check { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.check li { position: relative; padding-left: 30px; color: var(--text); }
.check li::before {
  content:"✓"; position:absolute; left:0; top:0; width:20px; height:20px; border-radius:6px;
  background: rgba(52,211,153,0.14); border:1px solid rgba(52,211,153,0.35); color: var(--accent);
  font-size: 0.72rem; display: grid; place-items: center; font-weight: 700;
}
.check li .muted { color: var(--muted); }

/* two-col intro */
.intro-split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }

/* big picture block */
.bigpic { background: var(--code-bg); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 22px 24px; overflow-x: auto; }
.bigpic pre { margin: 0; font-family: var(--mono); font-size: 0.82rem; line-height: 1.55; color: #aeb9cf; }
.bigpic .cap { color: var(--muted); font-size: 0.95rem; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); }

/* ============================================================
   DAY PAGES / SHARED CONTENT BLOCKS
   ============================================================ */
.page-head { padding: 60px 0 26px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.82rem; color: var(--faint); margin-bottom: 22px; }
.crumbs a { color: var(--faint); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { opacity: .5; }
.day-kicker { display: inline-flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 0.82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.day-kicker .num { font-size: 1rem; padding: .25em .7em; border-radius: 999px; background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.32); }
.day-head h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.day-head .tag { color: var(--muted); font-size: 1.18rem; max-width: 60ch; margin-top: 8px; }

.block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 30px; margin-bottom: 22px; }
.block > .b-title { display: flex; align-items: center; gap: 12px; font-size: 1.05rem; font-weight: 700; margin-bottom: 18px; }
.block > .b-title .tag2 { font-family: var(--mono); font-size: 0.72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 500; }
.block > .b-title .b-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--accent); }
.block > .b-title .b-ico svg { width: 19px; height: 19px; }

.olist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.olist li { position: relative; padding-left: 30px; color: var(--text); }
.olist li::before { content:""; position:absolute; left:2px; top:.5em; width:8px; height:8px; border-radius:50%; background: var(--accent-2); box-shadow: 0 0 0 3px rgba(56,189,248,0.16); }
.clist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.clist li { position: relative; padding-left: 26px; color: var(--muted); }
.clist li::before { content:"›"; position:absolute; left:4px; top:-1px; color: var(--accent); font-weight: 700; }
.clist li strong { color: var(--text); }

.lab { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 14px; }
.lab li { position: relative; padding: 14px 16px 14px 54px; background: var(--card-2); border: 1px solid var(--border); border-radius: 12px; color: var(--muted); }
.lab li::before { counter-increment: step; content: counter(step, decimal-leading-zero); position: absolute; left: 14px; top: 14px; font-family: var(--mono); font-size: 0.8rem; color: var(--accent); font-weight: 700; }
.lab li strong { color: var(--text); }

.deliv { background: linear-gradient(135deg, rgba(52,211,153,0.10), rgba(56,189,248,0.06)), var(--card); border: 1px solid rgba(52,211,153,0.30); border-radius: var(--radius); padding: 24px 28px; margin: 6px 0 22px; }
.deliv .k { font-family: var(--mono); font-size: 0.74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; display:flex; align-items:center; gap:8px; }
.deliv p { margin: 0; font-size: 1.05rem; color: var(--text); }

.hook { border-left: 3px solid var(--accent-3); background: var(--card); border-radius: 0 12px 12px 0; padding: 18px 22px; margin: 4px 0 8px; }
.hook .k { font-family: var(--mono); font-size: 0.72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-3); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.hook p { margin: 0; color: var(--muted); }

/* prev / next */
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 34px; }
.pn a { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; transition: border-color .2s, transform .16s; display: block; }
.pn a:hover { border-color: var(--border-strong); transform: translateY(-2px); text-decoration: none; }
.pn a.next { text-align: right; }
.pn .dir { font-family: var(--mono); font-size: 0.74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.pn .t { font-weight: 700; color: var(--text); margin-top: 4px; }
.pn a.next .dir { text-align: right; }
.pn .spacer { visibility: hidden; }

/* TOC / format chips */
.toc { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; }
.toc h4 { font-family: var(--mono); font-size: 0.74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.toc ol { margin: 0; padding-left: 22px; columns: 1; }
.toc li { margin: 4px 0; break-inside: avoid; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--text); }

/* table */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl th { font-family: var(--mono); font-size: 0.74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.tbl td { color: var(--muted); }
.tbl td .k { color: var(--text); font-weight: 600; }
.tbl tr:hover td { background: rgba(255,255,255,0.02); }
.tbl code { white-space: normal; }

/* numbered "next" list */
.next-list { display: grid; gap: 14px; }
.next-item { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.next-item .n { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; background: rgba(167,139,250,0.12); border: 1px solid rgba(167,139,250,0.3); color: var(--accent-3); }
.next-item h4 { margin: 0 0 4px; font-size: 1.05rem; }
.next-item p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* philosophy cards */
.phil-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.phil { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; }
.phil h4 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 1.08rem; }
.phil h4 .b { font-family: var(--mono); color: var(--accent); font-size: .9rem; }
.phil p { margin: 0; color: var(--muted); font-size: 0.96rem; }

/* flat course sticky toc */
.flat-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; }
.flat-wrap > * { min-width: 0; }
.flat-toc { position: sticky; top: 84px; }
.day-section { scroll-margin-top: 84px; }

/* 404 */
.err { text-align: center; padding: 120px 20px; }
.err .code { font-family: var(--mono); font-size: 5rem; font-weight: 800; background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip:text; background-clip:text; color: transparent; }
.err p { color: var(--muted); max-width: 40ch; margin: 0 auto 24px; }

/* ============================================================
   SLIDE DECK
   ============================================================ */
.deck { position: fixed; inset: 0; background: var(--bg); overflow: hidden; }
.deck::before { content:""; position:absolute; inset:0; background-image: radial-gradient(900px 500px at 80% 0%, rgba(56,189,248,0.10), transparent 60%), radial-gradient(800px 480px at 12% 100%, rgba(52,211,153,0.10), transparent 55%); pointer-events:none; }
.slide {
  position: absolute; inset: 0; display: none; padding: 60px clamp(24px, 7vw, 110px);
  flex-direction: column; justify-content: center;
}
.slide.active { display: flex; animation: fade .45s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.slide .s-eyebrow { font-family: var(--mono); font-size: 0.82rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 22px; display: flex; align-items: center; gap: 10px; }
.slide .s-eyebrow .num { padding: .2em .7em; border-radius: 999px; background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.32); }
.slide h1 { font-size: clamp(2.2rem, 6vw, 4.4rem); margin: 0 0 20px; }
.slide h2 { font-size: clamp(1.9rem, 4.6vw, 3.3rem); margin: 0 0 22px; }
.slide .s-sub { font-size: clamp(1.05rem, 2.4vw, 1.5rem); color: var(--muted); max-width: 62ch; }
.slide ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.slide ul li { position: relative; padding-left: 34px; font-size: clamp(1rem, 2.2vw, 1.4rem); color: var(--text); max-width: 72ch; }
.slide ul li::before { content:""; position:absolute; left:0; top:.55em; width:11px; height:11px; border-radius:50%; background: var(--accent-2); box-shadow: 0 0 0 4px rgba(56,189,248,0.18); }
.slide ul li .sub { display:block; font-size: 0.8em; color: var(--muted); margin-top: 4px; }
.slide .two { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.slide .pre { background: var(--code-bg); border: 1px solid var(--border-strong); border-radius: 14px; padding: 22px; overflow: auto; max-height: 70vh; }
.slide .pre pre { margin:0; font-family: var(--mono); font-size: clamp(0.62rem,1.5vw,0.92rem); line-height:1.5; color:#aeb9cf; }
.deck-hud { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 16px clamp(20px, 5vw, 60px); }
.deck-hud .prog { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); z-index: 20; transition: width .3s ease; box-shadow: 0 0 12px rgba(52,211,153,0.6); }
.deck-hud .cnt { font-family: var(--mono); font-size: 0.82rem; color: var(--faint); }
.deck-hud .ctrl { display: flex; gap: 10px; }
.deck-hud button { background: rgba(255,255,255,0.04); border: 1px solid var(--border-strong); color: var(--text); width: 46px; height: 46px; border-radius: 12px; font-size: 1.1rem; cursor: pointer; transition: background .15s, border-color .15s; display: grid; place-items: center; }
.deck-hud button:hover { background: rgba(255,255,255,0.09); border-color: var(--border-strong); }
.deck-hud button.wide { width: auto; padding: 0 16px; font-size: 0.85rem; font-family: var(--mono); }
.deck-hint { position: fixed; top: 18px; right: 22px; z-index: 10; font-family: var(--mono); font-size: 0.74rem; color: var(--faint); }

/* ============================================================
   PRINT / PDF — DARK THEME (the PDF is the dark product now)
   ============================================================ */
.print-only { display: none; }
@media print {
  body {
    background: #0b1020 !important; color: #e6edf3; font-size: 11pt; background-image: none !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .no-print { display: none !important; }
  .print-page { page-break-before: always; }
  .print-page:first-child { page-break-before: avoid; }
  .print-cover { page-break-after: always; min-height: 92vh; display:flex; flex-direction:column; justify-content:center; }
  h1,h2,h3,h4 { color:#f2f6fc; }
  /* inline color overrides (print.html sets a light-mode subtitle color inline) */
  .print-cover > div { color:#9fb0c8 !important; }
  .print-cover .pc-eyebrow { font-family: var(--mono); letter-spacing:.14em; text-transform:uppercase; font-size:10pt; color:#34d399; }
  .print-cover h1 { font-size: 40pt; margin: 14px 0 8px; color:#f2f6fc; }
  .print-cover .pc-sub { font-size: 15pt; color:#9fb0c8; max-width: 46ch; }
  .print-cover .pc-badge { display:inline-block; font-family:var(--mono); font-size:10pt; padding:.35em .8em; border:1px solid #34d399; color:#34d399; border-radius:999px; margin-top: 24px; background:rgba(52,211,153,.08); }
  .psec { margin-bottom: 18px; }
  .psec h2 { font-size: 19pt; border-bottom: 2px solid #223052; padding-bottom: 6px; margin: 0 0 12px; color:#f2f6fc; }
  .psec h3 { font-size: 13pt; margin: 14px 0 6px; color:#dce6f2; }
  .psec p { font-size: 10.5pt; color:#c3cede; margin: 0 0 8px; }
  .psec ul { margin: 4px 0 10px; padding-left: 20px; }
  .psec li { font-size: 10.5pt; color:#c3cede; margin: 3px 0; }
  .psec .lab li { background:#121a2e; border:1px solid #223052; border-radius:8px; padding:8px 10px 8px 40px; color:#c3cede; }
  .psec .lab li::before { color:#34d399; }
  .daynum { font-family: var(--mono); font-size: 11pt; letter-spacing:.1em; color:#34d399; text-transform:uppercase; }
  .print-cover .bigpic, .psec .bigpic { background:#0f1729; border:1px solid #223052; border-radius:8px; }
  .print-cover .bigpic pre, .psec .bigpic pre { color:#a8c0e0; font-size: 8pt; }
  code { background:#182238 !important; color:#d7e3f4 !important; border-color:#2a3a5c !important; white-space:normal; }
  .deliv { background:#0d2b20; border:1px solid #1d5c41; }
  .deliv .k { color:#34d399; }
  .deliv p { color:#bfe9d6; }
  .hook { border-left:3px solid #a78bfa; background:#161028; }
  .hook .k { color:#a78bfa; }
  .hook p { color:#cfc7e8; }
  .tbl th { color:#8b9bb4; border-color:#223052; background:#0f1729; }
  .tbl td { color:#c3cede; border-color:#223052; }
  .pn { display:none; }
  .print-footer { font-family:var(--mono); font-size:8pt; color:#64748b; margin-top: 8px; }
  .muted, .psec .muted { color:#8b9bb4 !important; }
  .faint { color:#64748b !important; }
  .daynum { color:#34d399; }
  .k { color:#34d399; }
  a { color:#7dd3fc; text-decoration:none; }
  @page { margin: 16mm 15mm; }
}

/* ============================================================
   COURSE CONTENT INDEX (/course-content)
   ============================================================ */
.cc-stats { margin: 26px 0 0; }
.cc-overview {
  display: flex; align-items: center; gap: 20px; text-decoration: none; color: var(--text);
  background: linear-gradient(135deg, rgba(52,211,153,0.13), rgba(56,189,248,0.10)), var(--card);
  border: 1px solid rgba(52,211,153,0.30); border-radius: var(--radius); padding: 22px 26px; margin-bottom: 38px;
  box-shadow: var(--shadow); transition: border-color .2s, transform .16s;
}
.cc-overview:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.cc-ov-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 auto;
  background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.32); color: var(--accent); }
.cc-ov-ico svg { width: 26px; height: 26px; }
.cc-ov-body { flex: 1; min-width: 0; }
.cc-ov-body h3 { margin: 0 0 4px; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cc-ov-badge { font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; color: var(--accent-2);
  border: 1px solid rgba(56,189,248,.35); background: rgba(56,189,248,.10); padding: .2em .6em; border-radius: 999px; }
.cc-ov-body p { margin: 0; color: var(--muted); font-size: .95rem; }
.cc-day { padding: 30px 0 6px; border-top: 1px solid var(--border); margin-top: 26px; }
.cc-day-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.cc-node { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  font-family: var(--mono); font-weight: 700; font-size: 1.05rem; color: var(--accent); }
.cc-node-final { color: var(--accent-3); border-color: rgba(167,139,250,0.35); background: rgba(167,139,250,0.10); }
.cc-day-head h3 { margin: 0; font-size: 1.32rem; }
.cc-sub { display: block; font-family: var(--mono); font-size: .78rem; color: var(--faint); margin-top: 3px; letter-spacing: .04em; }
.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.topic {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; color: var(--text); text-decoration: none;
  transition: border-color .2s, transform .16s, background .2s;
}
.topic:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--surface); }
.topic:hover h4 { color: #fff; }
.t-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.t-num { font-family: var(--mono); font-size: .78rem; font-weight: 700; color: var(--accent); letter-spacing: .06em; }
.t-count { font-family: var(--mono); font-size: .7rem; color: var(--faint); white-space: nowrap; }
.topic h4 { margin: 0 0 6px; font-size: 1.07rem; line-height: 1.35; transition: color .15s; }
.topic p { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; }
.t-open { margin-top: 14px; font-size: .85rem; font-weight: 600; color: var(--accent); display: inline-flex; gap: .45em; align-items: center; }
.t-open .arw { transition: transform .18s; }
.topic:hover .t-open .arw, .cc-overview:hover .t-open .arw { transform: translateX(3px); }
.cc-final-note {
  background: linear-gradient(135deg, rgba(167,139,250,0.10), rgba(56,189,248,0.06)), var(--card);
  border: 1px solid rgba(167,139,250,0.30); border-radius: var(--radius); padding: 22px 26px;
  color: var(--muted); font-size: 1rem;
}
.cc-final-note strong { color: var(--text); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav-links { position: fixed; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 4px; padding: 12px 16px 18px; background: var(--bg-2); border-bottom: 1px solid var(--border); transform: translateY(-140%); transition: transform .25s ease; box-shadow: var(--shadow); }
  .nav-links.open { transform: translateY(0); }
  .nav-cta { margin-left: 0; }
  .nav-toggle { display: block; }
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-overview { flex-wrap: wrap; }
  .hero .term { order: 2; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-2, .phil-grid, .intro-split { grid-template-columns: 1fr; }
  .flat-wrap { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .flat-toc { position: static; }
  .toc ol { columns: 1; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .slide .two { grid-template-columns: 1fr; gap: 24px; }
  .section { padding: 56px 0; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .container { padding: 0 16px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .pn { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: 1fr; }
  .cc-node { width: 44px; height: 44px; font-size: .95rem; }
  .tl-item { grid-template-columns: 44px 1fr; gap: 14px; }
  .tl-node { width: 44px; height: 44px; font-size: 1rem; }
  .timeline::before { left: 21px; }
  .block, .deliv { padding: 20px; }
}

/* ---------- portal nav links (shown when logged in) ---------- */
.portal-link {
  display: inline-flex; align-items: center;
  font-weight: 600; font-size: .88rem; color: var(--accent);
  border: 1px solid rgba(52,211,153,0.35); border-radius: 10px;
  padding: .5em 1em; text-decoration: none;
  background: rgba(52,211,153,0.08);
}
.portal-link:hover { background: rgba(52,211,153,0.16); text-decoration: none; }
.portal-logout { font-size: .84rem; color: var(--faint); }

.nav-apply { border-color: rgba(52,211,153,.4); color: var(--accent); }
.nav-apply:hover { background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.6); color: var(--accent); }
