/* ==============================================================
   Study Hub — Programming & Coding Notes
   --------------------------------------------------------------
   One stylesheet for two places:

     1. index.coding-notes.html  — the full beginner course page
     2. index.html  #coding      — the teaser section that links to it

   Additive only. Nothing here touches another page: every selector
   is namespaced `cn-` or scoped to `#coding`, and the page never
   relies on Tailwind being loaded on it.

   Palette follows Study Hub's dark space theme (blue / violet /
   cyan) plus one extra "terminal" green used for code accents.
   ============================================================== */

/* ==============================================================
   1. Tokens
   ============================================================== */

:root {
  --cn-bg: #04060f;
  --cn-bg-soft: #080d1a;
  --cn-panel: rgba(148, 163, 184, 0.05);
  --cn-panel-2: rgba(148, 163, 184, 0.09);
  --cn-line: rgba(148, 163, 184, 0.15);
  --cn-line-strong: rgba(148, 163, 184, 0.32);

  --cn-ink: #e9eefb;
  --cn-ink-soft: #d3ddef;
  --cn-dim: #93a5c0;
  --cn-faint: #6a7c96;

  --cn-blue: #60a5fa;
  --cn-violet: #a78bfa;
  --cn-cyan: #22d3ee;
  --cn-green: #34d399;
  --cn-amber: #fbbf24;
  --cn-rose: #fb7185;

  --cn-radius: 22px;
  --cn-radius-sm: 14px;
  --cn-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
  --cn-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ==============================================================
   2. Page shell
   ============================================================== */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.cn-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--cn-ink);
  background-color: var(--cn-bg);
  background-image:
    radial-gradient(1100px 620px at 12% -8%, rgba(59, 130, 246, 0.20), transparent 62%),
    radial-gradient(900px 520px at 88% 4%, rgba(139, 92, 246, 0.16), transparent 60%),
    radial-gradient(800px 620px at 50% 108%, rgba(34, 211, 238, 0.10), transparent 62%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Faint blueprint grid behind everything, fading out at the edges. */
body.cn-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(1000px 700px at 50% 0%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(1000px 700px at 50% 0%, #000 10%, transparent 78%);
}

.cn-page a { color: inherit; text-decoration: none; }
.cn-page img { max-width: 100%; display: block; }
.cn-page button { font: inherit; }
.cn-page :focus-visible {
  outline: 2px solid var(--cn-cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

.cn-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==============================================================
   3. Reading progress + top bar
   ============================================================== */

.cn-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  z-index: 200;
  background: linear-gradient(90deg, var(--cn-blue), var(--cn-violet) 50%, var(--cn-cyan));
  box-shadow: 0 0 14px rgba(96, 165, 250, 0.7);
  transition: width 0.12s linear;
}

.cn-topbar {
  position: sticky;
  top: 0;
  z-index: 120;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(4, 6, 15, 0.82);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.cn-topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.cn-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.4px;
  white-space: nowrap;
}

.cn-brand img {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  object-fit: contain;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 3px;
}

.cn-brand em { font-style: normal; color: var(--cn-blue); }

.cn-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cn-topbar-chip {
  display: none;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--cn-cyan);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.26);
  padding: 6px 12px;
  border-radius: 9999px;
  white-space: nowrap;
}

.cn-topbar-back {
  font-size: 13px;
  font-weight: 700;
  color: var(--cn-ink-soft);
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--cn-line);
  border-radius: 11px;
  padding: 9px 14px;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}

.cn-topbar-back:hover {
  color: #fff;
  background: rgba(96, 165, 250, 0.18);
  border-color: rgba(96, 165, 250, 0.45);
  transform: translateY(-1px);
}

@media (min-width: 720px) {
  .cn-topbar-chip { display: inline-flex; }
}

/* ==============================================================
   4. Hero
   ============================================================== */

.cn-hero {
  position: relative;
  z-index: 1;
  padding: 58px 0 44px;
  overflow: hidden;
}

/* Two slow-moving glow blobs — the page's only ambient motion. */
.cn-aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.cn-aurora-a {
  width: 420px; height: 420px;
  top: -140px; left: -100px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.55), transparent 68%);
  animation: cnDrift 17s ease-in-out infinite;
}

.cn-aurora-b {
  width: 460px; height: 460px;
  top: -80px; right: -140px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.5), transparent 68%);
  animation: cnDrift 21s ease-in-out infinite reverse;
}

@keyframes cnDrift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(34px, 30px, 0) scale(1.1); }
}

.cn-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}

@media (min-width: 1000px) {
  .cn-hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 52px; }
}

.cn-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--cn-green);
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.28);
  padding: 7px 14px;
  border-radius: 9999px;
}

.cn-eyebrow span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cn-green);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
  animation: cnBlink 1.9s ease-in-out infinite;
}

@keyframes cnBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

.cn-title {
  margin: 20px 0 0;
  font-size: clamp(2rem, 6.4vw, 3.5rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -1.6px;
}

.cn-title em {
  font-style: normal;
  background: linear-gradient(100deg, #7dd3fc, #a78bfa 52%, #34d399);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: cnShine 6s linear infinite;
}

@keyframes cnShine { to { background-position: 220% center; } }

.cn-lede {
  margin: 18px 0 0;
  max-width: 60ch;
  font-size: 16px;
  line-height: 1.75;
  color: var(--cn-dim);
}

.cn-lede strong { color: var(--cn-ink-soft); font-weight: 700; }

.cn-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.cn-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: 14px;
  padding: 15px 24px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}

.cn-btn svg { width: 17px; height: 17px; flex: 0 0 auto; }

.cn-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  box-shadow: 0 14px 34px rgba(99, 102, 241, 0.38);
}

.cn-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(99, 102, 241, 0.5);
}

.cn-btn-ghost {
  color: var(--cn-ink-soft);
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--cn-line);
}

.cn-btn-ghost:hover {
  color: #fff;
  background: rgba(148, 163, 184, 0.16);
  border-color: var(--cn-line-strong);
  transform: translateY(-2px);
}

.cn-btn:active { transform: scale(0.97); }

.cn-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--cn-line);
}

.cn-stat b {
  display: block;
  font-size: clamp(1.25rem, 3.4vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.8px;
  background: linear-gradient(120deg, #dbeafe, #bfdbfe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cn-stat span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--cn-faint);
}

/* ---------- animated code window (hero) ---------- */

.cn-window {
  position: relative;
  border-radius: var(--cn-radius);
  border: 1px solid var(--cn-line);
  background: linear-gradient(180deg, rgba(11, 17, 33, 0.96), rgba(5, 8, 16, 0.98));
  box-shadow: var(--cn-shadow);
  overflow: hidden;
}

.cn-window::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(96, 165, 250, 0.55), rgba(167, 139, 250, 0.35) 45%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.cn-window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--cn-line);
  background: rgba(148, 163, 184, 0.05);
}

.cn-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.cn-dot-r { background: #ff5f57; }
.cn-dot-y { background: #febc2e; }
.cn-dot-g { background: #28c840; }

.cn-window-name {
  margin-left: 6px;
  font-family: var(--cn-mono);
  font-size: 11.5px;
  color: var(--cn-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cn-window-live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cn-green);
  white-space: nowrap;
}

.cn-window-live i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cn-green);
  animation: cnBlink 1.4s ease-in-out infinite;
}

.cn-window-body {
  padding: 18px 18px 20px;
  font-family: var(--cn-mono);
  font-size: 13px;
  line-height: 1.85;
  color: #cbd5e1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cn-type {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  font-family: inherit;
}

.cn-window-body .cn-caret {
  display: inline-block;
  width: 8px;
  height: 15px;
  vertical-align: -2px;
  margin-left: 1px;
  background: var(--cn-cyan);
  animation: cnCaret 1s steps(1) infinite;
}

@keyframes cnCaret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.cn-window-out {
  border-top: 1px dashed var(--cn-line);
  padding: 14px 18px;
  font-family: var(--cn-mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--cn-green);
  background: rgba(52, 211, 153, 0.05);
  overflow-x: auto;
}

.cn-window-out b { color: var(--cn-faint); font-weight: 600; }

/* ---------- floating language pills ---------- */

.cn-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.cn-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cn-ink-soft);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--cn-line);
  border-radius: 9999px;
  padding: 7px 14px;
  transition: transform 0.2s, color 0.2s, border-color 0.2s, background 0.2s;
}

.cn-pill:hover {
  transform: translateY(-2px);
  color: #fff;
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(96, 165, 250, 0.45);
}

.cn-pill i {
  width: 8px; height: 8px;
  border-radius: 3px;
  flex: 0 0 auto;
}

/* ==============================================================
   5. Photo strip (free, credited imagery)
   ============================================================== */

.cn-strip {
  position: relative;
  z-index: 1;
  padding: 8px 0 12px;
}

.cn-strip-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

@media (min-width: 700px) {
  .cn-strip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.cn-figure {
  position: relative;
  margin: 0;
  border-radius: var(--cn-radius-sm);
  border: 1px solid var(--cn-line);
  overflow: hidden;
  background: linear-gradient(140deg, rgba(59, 130, 246, 0.22), rgba(139, 92, 246, 0.2) 55%, rgba(34, 211, 238, 0.16));
  min-height: 168px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s, box-shadow 0.3s;
}

.cn-figure:hover {
  transform: translateY(-5px);
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 20px 44px -22px rgba(0, 0, 0, 0.8);
}

.cn-figure img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  opacity: 0.85;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s;
}

.cn-figure:hover img { transform: scale(1.06); opacity: 1; }

/* If a photo fails to load the gradient panel remains — no broken icon. */
.cn-figure.is-broken img { display: none; }

.cn-figure figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 30px 14px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #eaf1ff;
  background: linear-gradient(to top, rgba(3, 6, 14, 0.94), rgba(3, 6, 14, 0));
}

.cn-figure figcaption b { display: block; font-size: 13.5px; font-weight: 800; }

/* ==============================================================
   6. Shell: sticky chapter rail + reading column
   ============================================================== */

.cn-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  padding: 34px 0 60px;
}

@media (min-width: 1040px) {
  .cn-shell {
    grid-template-columns: 262px minmax(0, 1fr);
    gap: 46px;
    align-items: start;
  }
}

/* ---------- rail ---------- */

.cn-rail {
  position: relative;
}

@media (min-width: 1040px) {
  .cn-rail-inner {
    position: sticky;
    top: 82px;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
  }
  .cn-rail-inner::-webkit-scrollbar { width: 6px; }
  .cn-rail-inner::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 9999px;
  }
}

.cn-rail-card {
  border: 1px solid var(--cn-line);
  border-radius: var(--cn-radius-sm);
  background: rgba(6, 10, 22, 0.72);
  padding: 16px;
}

.cn-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.cn-rail-head h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--cn-faint);
}

.cn-rail-pct {
  font-family: var(--cn-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--cn-green);
}

.cn-bar {
  height: 5px;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
  margin-bottom: 14px;
}

.cn-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--cn-blue), var(--cn-cyan));
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* On mobile the rail collapses to a swipeable pill row. */
.cn-toc {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.cn-toc::-webkit-scrollbar { display: none; }

.cn-toc a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cn-dim);
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--cn-line);
  border-radius: 11px;
  padding: 9px 13px;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.cn-toc a:hover { color: #fff; border-color: var(--cn-line-strong); }

.cn-toc a.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(139, 92, 246, 0.85));
  border-color: transparent;
}

.cn-toc a.is-done { color: var(--cn-green); }
.cn-toc a.is-done.is-active { color: #fff; }

.cn-toc-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 6px;
  font-family: var(--cn-mono);
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.16);
  flex: 0 0 auto;
}

.cn-toc a.is-active .cn-toc-num { background: rgba(255, 255, 255, 0.22); }

@media (min-width: 1040px) {
  .cn-toc {
    flex-direction: column;
    overflow: visible;
    gap: 4px;
  }
  .cn-toc a {
    width: 100%;
    white-space: normal;
    background: transparent;
    border-color: transparent;
    padding: 8px 10px;
  }
  .cn-toc a:hover { background: rgba(148, 163, 184, 0.1); }
  .cn-toc a.is-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.85), rgba(139, 92, 246, 0.8));
  }
}

.cn-rail-actions { margin-top: 14px; display: grid; gap: 8px; }

.cn-rail-btn {
  width: 100%;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cn-dim);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--cn-line);
  border-radius: 11px;
  padding: 10px 12px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.cn-rail-btn:hover {
  color: #fff;
  background: rgba(148, 163, 184, 0.16);
  border-color: var(--cn-line-strong);
}

.cn-rail-note {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--cn-faint);
}

/* ==============================================================
   7. Chapters
   ============================================================== */

.cn-main { min-width: 0; display: grid; gap: 26px; }

.cn-chapter {
  position: relative;
  scroll-margin-top: 88px;
  border: 1px solid var(--cn-line);
  border-radius: var(--cn-radius);
  background:
    radial-gradient(720px 340px at 8% -12%, rgba(59, 130, 246, 0.10), transparent 62%),
    linear-gradient(180deg, rgba(9, 13, 26, 0.9), rgba(4, 7, 15, 0.94));
  padding: clamp(20px, 3.4vw, 34px);
  box-shadow: 0 26px 70px -40px rgba(0, 0, 0, 0.9);
}

.cn-chapter::before {
  content: "";
  position: absolute;
  left: 0; top: 26px;
  width: 3px;
  height: 46px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--cn-blue), var(--cn-violet));
  opacity: 0.85;
}

.cn-chapter.is-done::before {
  background: linear-gradient(180deg, var(--cn-green), var(--cn-cyan));
}

.cn-ch-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.cn-ch-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 13px;
  font-family: var(--cn-mono);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(139, 92, 246, 0.9));
  box-shadow: 0 10px 26px -12px rgba(99, 102, 241, 0.9);
}

.cn-chapter.is-done .cn-ch-num {
  background: linear-gradient(135deg, #10b981, #22d3ee);
}

.cn-ch-title {
  margin: 0;
  font-size: clamp(1.28rem, 3.2vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.7px;
  line-height: 1.2;
}

.cn-ch-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--cn-faint);
}

.cn-chapter p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--cn-dim);
}

.cn-chapter p strong { color: var(--cn-ink-soft); font-weight: 700; }
.cn-chapter p em { color: var(--cn-cyan); font-style: normal; font-weight: 600; }

.cn-h3 {
  margin: 30px 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  color: #cfe0ff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cn-h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--cn-line), transparent);
}

/* ---------- point lists ---------- */

.cn-points { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }

.cn-point {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--cn-ink-soft);
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--cn-line);
  border-left: 3px solid rgba(96, 165, 250, 0.7);
  border-radius: 12px;
  padding: 13px 16px;
}

.cn-point > b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  font-family: var(--cn-mono);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--cn-blue), var(--cn-violet));
}

.cn-point code {
  font-family: var(--cn-mono);
  font-size: 12.8px;
  color: #bae6fd;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 6px;
  padding: 1px 6px;
  overflow-wrap: break-word;
}

.cn-point.is-tip { border-left-color: rgba(52, 211, 153, 0.8); }
.cn-point.is-tip > b { background: linear-gradient(135deg, #10b981, #22d3ee); }

.cn-point.is-warn { border-left-color: rgba(251, 191, 36, 0.85); }
.cn-point.is-warn > b { background: linear-gradient(135deg, #f59e0b, #fb7185); }

/* ---------- callouts ---------- */

.cn-callout {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 13px;
  border-radius: 14px;
  border: 1px solid rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.07);
  padding: 15px 17px;
}

.cn-callout svg { width: 22px; height: 22px; color: var(--cn-green); margin-top: 2px; }

.cn-callout h4 {
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #a7f3d0;
}

.cn-callout p { margin: 0; font-size: 14px; line-height: 1.72; color: var(--cn-ink-soft); }

.cn-callout.is-warn {
  border-color: rgba(251, 191, 36, 0.32);
  background: rgba(251, 191, 36, 0.07);
}
.cn-callout.is-warn svg { color: var(--cn-amber); }
.cn-callout.is-warn h4 { color: #fde68a; }

.cn-callout.is-info {
  border-color: rgba(96, 165, 250, 0.32);
  background: rgba(96, 165, 250, 0.07);
}
.cn-callout.is-info svg { color: var(--cn-blue); }
.cn-callout.is-info h4 { color: #bfdbfe; }

/* ==============================================================
   8. Code blocks
   ============================================================== */

.cn-code {
  margin-top: 18px;
  border-radius: var(--cn-radius-sm);
  border: 1px solid rgba(96, 165, 250, 0.22);
  background: linear-gradient(180deg, rgba(11, 17, 33, 0.96), rgba(5, 8, 16, 0.98));
  overflow: hidden;
}

.cn-code-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(148, 163, 184, 0.05);
}

.cn-code-lang {
  font-family: var(--cn-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cn-cyan);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 7px;
  padding: 3px 8px;
  flex: 0 0 auto;
}

.cn-code-file {
  font-family: var(--cn-mono);
  font-size: 11.5px;
  color: var(--cn-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.cn-copy {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--cn-dim);
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--cn-line);
  border-radius: 9px;
  padding: 6px 11px;
  cursor: pointer;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}

.cn-copy:hover { color: #fff; background: rgba(148, 163, 184, 0.2); }
.cn-copy.is-done {
  color: var(--cn-green);
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(52, 211, 153, 0.12);
}

.cn-code pre {
  margin: 0;
  padding: 16px 18px 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--cn-mono);
  font-size: 13px;
  line-height: 1.75;
  color: #d7e3f4;
  tab-size: 4;
}

.cn-code code {
  font-family: inherit;
  font-size: inherit;
  white-space: pre;
  background: none;
  border: 0;
  padding: 0;
}

/* syntax colours (added at runtime by js/coding-notes.js) */
.tok-c { color: #64748b; font-style: italic; }
.tok-s { color: #86efac; }
.tok-k { color: #c4b5fd; font-weight: 600; }
.tok-n { color: #fbbf24; }
.tok-f { color: #7dd3fc; }
.tok-b { color: #f0abfc; }

/* ==============================================================
   9. Inline figures / diagrams
   ============================================================== */

.cn-fig {
  margin: 22px 0 0;
  border-radius: var(--cn-radius-sm);
  border: 1px solid var(--cn-line);
  background:
    radial-gradient(600px 260px at 50% -20%, rgba(96, 165, 250, 0.12), transparent 70%),
    rgba(6, 10, 22, 0.7);
  padding: 20px 18px 14px;
  overflow: hidden;
}

.cn-fig svg { display: block; width: 100%; height: auto; max-width: 640px; margin: 0 auto; }

.cn-fig figcaption {
  margin-top: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--cn-faint);
}

/* ---------- comparison / data tables ---------- */

.cn-table-wrap {
  margin-top: 20px;
  border: 1px solid var(--cn-line);
  border-radius: var(--cn-radius-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cn-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.cn-table th,
.cn-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--cn-line);
  vertical-align: top;
  line-height: 1.6;
}

.cn-table th {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #cfe0ff;
  background: rgba(148, 163, 184, 0.08);
  white-space: nowrap;
}

.cn-table tbody tr:last-child td { border-bottom: 0; }
.cn-table tbody tr:hover { background: rgba(148, 163, 184, 0.05); }
.cn-table td:first-child { color: var(--cn-ink); font-weight: 600; }
.cn-table code {
  font-family: var(--cn-mono);
  font-size: 12.5px;
  color: #bae6fd;
  background: rgba(34, 211, 238, 0.1);
  border-radius: 6px;
  padding: 1px 6px;
}

/* ==============================================================
   10. History timeline
   ============================================================== */

.cn-timeline {
  position: relative;
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-left: 30px;
}

.cn-timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cn-cyan), var(--cn-violet) 55%, var(--cn-green));
  opacity: 0.55;
}

.cn-era {
  position: relative;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--cn-ink-soft);
  background: rgba(148, 163, 184, 0.04);
  border: 1px solid var(--cn-line);
  border-radius: 12px;
  padding: 12px 15px;
}

.cn-era::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 17px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--cn-bg);
  border: 2px solid var(--cn-cyan);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.cn-era b {
  display: inline-block;
  font-family: var(--cn-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cn-cyan);
  margin-right: 8px;
}

.cn-era i {
  display: block;
  margin-top: 5px;
  font-style: normal;
  font-size: 12.5px;
  color: var(--cn-faint);
}

/* ==============================================================
   11. Language cards
   ============================================================== */

.cn-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 18px;
}

@media (min-width: 620px) { .cn-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .cn-cards.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.cn-card {
  border: 1px solid var(--cn-line);
  border-radius: var(--cn-radius-sm);
  background: rgba(148, 163, 184, 0.045);
  padding: 18px;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s, background 0.3s;
}

.cn-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.08);
}

.cn-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 10px;
}

.cn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  font-family: var(--cn-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  flex: 0 0 auto;
}

.cn-card h4 { margin: 0; font-size: 15.5px; font-weight: 800; letter-spacing: -0.2px; }
.cn-card p { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--cn-dim); }
.cn-card ul { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }

.cn-card li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 9px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--cn-dim);
}

.cn-card li::before {
  content: "▸";
  color: var(--cn-cyan);
  font-size: 12px;
  line-height: 1.7;
}

.cn-tag {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--cn-ink-soft);
  background: rgba(148, 163, 184, 0.12);
  border-radius: 9999px;
  padding: 5px 11px;
}

/* ==============================================================
   12. Memory boxes (variables illustration)
   ============================================================== */

.cn-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.cn-box {
  border: 1px dashed rgba(96, 165, 250, 0.45);
  border-radius: 12px;
  background: rgba(96, 165, 250, 0.07);
  padding: 12px 14px;
}

.cn-box span {
  display: block;
  font-family: var(--cn-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--cn-blue);
}

.cn-box b {
  display: block;
  margin-top: 6px;
  font-family: var(--cn-mono);
  font-size: 14px;
  color: #eaf1ff;
  word-break: break-word;
}

.cn-box i {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 11.5px;
  color: var(--cn-faint);
}

/* ==============================================================
   13. Quiz
   ============================================================== */

.cn-quiz {
  position: relative;
  scroll-margin-top: 88px;
  border: 1px solid var(--cn-line);
  border-radius: var(--cn-radius);
  background:
    radial-gradient(700px 320px at 88% -14%, rgba(139, 92, 246, 0.14), transparent 62%),
    linear-gradient(180deg, rgba(9, 13, 26, 0.92), rgba(4, 7, 15, 0.95));
  padding: clamp(20px, 3.4vw, 32px);
}

.cn-quiz-q {
  border: 1px solid var(--cn-line);
  border-radius: var(--cn-radius-sm);
  background: rgba(148, 163, 184, 0.04);
  padding: 16px 18px;
}

.cn-quiz-q + .cn-quiz-q { margin-top: 14px; }

.cn-quiz-q h4 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--cn-ink);
  display: flex;
  gap: 10px;
}

.cn-quiz-q h4 span {
  font-family: var(--cn-mono);
  font-size: 12px;
  color: var(--cn-violet);
  flex: 0 0 auto;
}

.cn-answers { display: grid; gap: 8px; }

.cn-answer {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  font-size: 14px;
  color: var(--cn-ink-soft);
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--cn-line);
  border-radius: 11px;
  padding: 11px 14px;
  cursor: pointer;
  transition: color 0.18s, background 0.18s, border-color 0.18s, transform 0.18s;
}

.cn-answer:hover:not(:disabled) {
  color: #fff;
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.42);
  transform: translateX(3px);
}

.cn-answer kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  flex: 0 0 auto;
  font-family: var(--cn-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--cn-dim);
  background: rgba(148, 163, 184, 0.14);
  border-radius: 7px;
}

.cn-answer:disabled { cursor: default; }

.cn-answer.is-right {
  color: #d1fae5;
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.55);
}

.cn-answer.is-right kbd { background: rgba(52, 211, 153, 0.3); color: #ecfdf5; }

.cn-answer.is-wrong {
  color: #ffe4e6;
  background: rgba(251, 113, 133, 0.14);
  border-color: rgba(251, 113, 133, 0.55);
}

.cn-answer.is-wrong kbd { background: rgba(251, 113, 133, 0.3); color: #fff1f2; }

.cn-explain {
  margin-top: 11px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--cn-dim);
  border-left: 3px solid var(--cn-violet);
  background: rgba(139, 92, 246, 0.08);
  border-radius: 0 10px 10px 0;
  padding: 10px 14px;
}

.cn-explain b { color: #ddd6fe; }

.cn-quiz-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--cn-line);
}

.cn-score {
  font-size: 14px;
  color: var(--cn-dim);
}

.cn-score b {
  font-family: var(--cn-mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--cn-green);
}

/* ==============================================================
   14. Glossary
   ============================================================== */

.cn-glossary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 18px;
}

@media (min-width: 700px) { .cn-glossary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.cn-term {
  border: 1px solid var(--cn-line);
  border-left: 3px solid rgba(34, 211, 238, 0.7);
  border-radius: 11px;
  background: rgba(148, 163, 184, 0.04);
  padding: 12px 15px;
}

.cn-term dt {
  font-family: var(--cn-mono);
  font-size: 13px;
  font-weight: 700;
  color: #bae6fd;
}

.cn-term dd {
  margin: 5px 0 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--cn-dim);
}

/* ==============================================================
   15. Roadmap
   ============================================================== */

.cn-roadmap { display: grid; gap: 12px; margin-top: 18px; }

.cn-phase {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--cn-line);
  border-radius: var(--cn-radius-sm);
  background: rgba(148, 163, 184, 0.04);
  padding: 16px 18px;
}

@media (min-width: 720px) {
  .cn-phase { grid-template-columns: 150px minmax(0, 1fr); gap: 20px; }
}

.cn-phase-when {
  font-family: var(--cn-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cn-amber);
}

.cn-phase-when small {
  display: block;
  margin-top: 4px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--cn-faint);
}

.cn-phase h4 { margin: 0; font-size: 15.5px; font-weight: 800; }
.cn-phase p { margin: 7px 0 0; font-size: 13.8px; line-height: 1.72; color: var(--cn-dim); }

/* ==============================================================
   16. Chapter footer (mark as read)
   ============================================================== */

.cn-ch-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px dashed var(--cn-line);
}

.cn-done {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--cn-dim);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--cn-line);
  border-radius: 11px;
  padding: 10px 15px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.cn-done:hover { color: #fff; background: rgba(148, 163, 184, 0.16); }

.cn-done.is-done {
  color: var(--cn-green);
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.45);
}

.cn-done svg { width: 15px; height: 15px; }

.cn-next {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--cn-blue);
}

.cn-next:hover { color: #bfdbfe; }

/* ==============================================================
   17. Closing call to action
   ============================================================== */

.cn-outro {
  position: relative;
  z-index: 1;
  padding: 10px 0 70px;
}

.cn-outro-inner {
  border: 1px solid var(--cn-line);
  border-radius: var(--cn-radius);
  background:
    radial-gradient(700px 340px at 16% 0%, rgba(59, 130, 246, 0.2), transparent 62%),
    radial-gradient(600px 320px at 88% 100%, rgba(34, 211, 238, 0.14), transparent 62%),
    linear-gradient(180deg, rgba(9, 13, 26, 0.94), rgba(4, 7, 15, 0.96));
  padding: clamp(24px, 4vw, 46px);
  text-align: center;
}

.cn-outro-inner h2 {
  margin: 14px 0 10px;
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.8px;
}

.cn-outro-inner p {
  margin: 0 auto;
  max-width: 56ch;
  font-size: 15px;
  line-height: 1.75;
  color: var(--cn-dim);
}

.cn-outro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

/* ==============================================================
   18. Footer + back to top
   ============================================================== */

.cn-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--cn-line);
  background: rgba(3, 5, 12, 0.7);
  padding: 28px 0;
}

.cn-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--cn-faint);
}

.cn-footer a { color: var(--cn-dim); font-weight: 600; }
.cn-footer a:hover { color: var(--cn-blue); }

.cn-totop {
  position: fixed;
  right: 18px;
  bottom: 88px;
  z-index: 130;
  width: 46px; height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--cn-line);
  background: rgba(9, 14, 28, 0.9);
  color: var(--cn-ink);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.28s, transform 0.28s, visibility 0.28s, background 0.2s, border-color 0.2s;
}

.cn-totop.is-on { opacity: 1; visibility: visible; transform: translateY(0); }
.cn-totop:hover { background: rgba(96, 165, 250, 0.24); border-color: rgba(96, 165, 250, 0.5); }

/* ==============================================================
   19. Reveal animations
   ============================================================== */

.cn-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.cn-reveal.is-in { opacity: 1; transform: none; }

/* ==============================================================
   20. Teaser section on index.html (#coding)
   ============================================================== */

#coding {
  position: relative;
  overflow: hidden;
}

#coding .cn-tease-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 34px;
  align-items: center;
}

@media (min-width: 900px) {
  #coding .cn-tease-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr); gap: 48px; }
}

#coding .cn-tease-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

#coding .cn-tease-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: #d3ddef;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 9999px;
  padding: 7px 14px;
  transition: transform 0.2s, color 0.2s, border-color 0.2s, background 0.2s;
}

#coding .cn-tease-pill:hover {
  transform: translateY(-2px);
  color: #fff;
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(96, 165, 250, 0.45);
}

#coding .cn-tease-pill i { width: 8px; height: 8px; border-radius: 3px; }

#coding .cn-tease-topics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

@media (min-width: 640px) {
  #coding .cn-tease-topics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

#coding .cn-tease-topic {
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 13px;
  background: rgba(148, 163, 184, 0.035);
  padding: 13px 14px;
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
}

#coding .cn-tease-topic:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.08);
}

#coding .cn-tease-topic span {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 15px;
  font-weight: 700;
  color: #7dd3fc;
}

#coding .cn-tease-topic b {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #e9eefb;
}

#coding .cn-tease-topic em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 11.5px;
  line-height: 1.5;
  color: #8fa2bb;
}

/* the code window reuse inside the teaser */
#coding .cn-window-body { font-size: 12.5px; }

@media (prefers-reduced-motion: no-preference) {
  #coding .cn-tease-float { animation: cnTeaseFloat 6s ease-in-out infinite; }
}

@keyframes cnTeaseFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* ==============================================================
   21. Responsive + motion + print
   ============================================================== */

/* Narrow phones: keep the top bar on one line with the Clerk account
   button (injected by js/clerk-auth.js) still comfortably reachable. */
@media (max-width: 560px) {
  .cn-topbar-inner { padding: 10px 14px; gap: 8px; }
  .cn-brand { font-size: 16px; gap: 8px; }
  .cn-brand img { width: 26px; height: 26px; padding: 2px; }
  .cn-topbar-right { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .cn-topbar-back { font-size: 12px; padding: 8px 10px; }
  .cn-hero { padding: 40px 0 32px; }
  .cn-window-body { font-size: 12px; }
  .cn-points { gap: 9px; }
  .cn-point { grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 12px 13px; }
  .cn-point > b { width: 22px; height: 22px; font-size: 10px; }
  .cn-callout { grid-template-columns: minmax(0, 1fr); }
  .cn-ch-head { gap: 11px; }
  .cn-ch-num { width: 36px; height: 36px; font-size: 13.5px; }
  .cn-totop { right: 14px; bottom: 84px; width: 42px; height: 42px; }
  #coding .cn-tease-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .cn-page { scroll-behavior: auto; }
  .cn-aurora,
  .cn-eyebrow span,
  .cn-window-live i,
  .cn-caret,
  .cn-title em { animation: none !important; }

  .cn-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .cn-page * {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

@media print {
  body.cn-page { background: #fff; color: #111; }
  .cn-topbar, .cn-rail, .cn-totop, .cn-progress, .cn-aurora, .cn-strip { display: none !important; }
  .cn-chapter { break-inside: avoid; border-color: #ccc; box-shadow: none; background: #fff; }
}
