/* ============================================================
   GAME CODE SCHOOL — Shared Stylesheet
   ============================================================ */

/* 1. Variables & Reset
   ---------------------------------------------------------- */
:root {
  /* Brand colors pulled from gamecodeschool.png logo */
  --brand-blue:   #1a6ed8;
  --brand-orange: #ff8800;

  --blue-900: #1a3a6e;
  --blue-700: #1a6ed8;
  --blue-600: #1a6ed8;
  --blue-500: #4a8fe8;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;

  --orange-700: #d97700;
  --orange-600: #ff8800;
  --orange-500: #ffa030;
  --orange-100: #ffecd0;
  --orange-50:  #fff8ed;

  --text:        #1e293b;
  --text-muted:  #64748b;
  --text-faint:  #94a3b8;
  --border:      #e2e8f0;
  --border-dark: #cbd5e1;
  --bg:          #ffffff;
  --bg-subtle:   #f8fafc;
  --bg-code:     #f1f5f9;

  --font-ui:   'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;

  --max-content: 740px;
  --max-site:    1180px;

  --radius:    6px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow:    0 1px 4px rgba(0,0,0,.07), 0 2px 8px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.09);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 17px; scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   2. Site Header
   ============================================================ */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--max-site);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
}

.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo img {
  height: 36px;
  width: auto;
  display: block;
}
.site-logo:hover { text-decoration: none; opacity: .85; }

.header-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: color .15s;
}
.header-nav a:hover { color: var(--brand-blue); text-decoration: none; }

/* ============================================================
   2b. Reading Progress Bar
   ============================================================ */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--orange-500), var(--orange-600));
  z-index: 200;
  border-radius: 0 2px 2px 0;
  pointer-events: none;
  transition: width .08s linear;
}

/* ============================================================
   3. Home Page
   ============================================================ */
.home-intro {
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 2rem 3rem;
  background: var(--bg-subtle);
}

.home-intro-inner {
  max-width: var(--max-site);
  margin: 0 auto;
}

.home-intro h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-bottom: .5rem;
  color: var(--text);
}

.home-intro h1 span { color: var(--brand-orange); }

.home-intro p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.65;
}

.home-books {
  max-width: var(--max-site);
  margin: 0 auto;
  padding: 3rem 2rem 4.5rem;
}

.section-heading {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 3rem;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.book-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .22s cubic-bezier(.25,.8,.25,1), box-shadow .22s;
  display: flex;
  flex-direction: column;
}

.book-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.book-cover-wrap {
  background: linear-gradient(160deg, #f0f4ff 0%, #e8f0fe 100%);
  padding: 2.25rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--border);
  min-height: 240px;
}

.book-cover-wrap img {
  max-height: 200px;
  width: auto;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  transition: transform .22s;
}

.book-card:hover .book-cover-wrap img {
  transform: scale(1.03);
}

.book-info {
  padding: 1.6rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: .55rem;
  color: var(--text);
}

.book-subtitle {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 1.4rem;
}

.book-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--orange-600);
  color: white;
  padding: .6rem 1.3rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .875rem;
  text-decoration: none;
  align-self: flex-start;
  transition: background .15s, transform .12s;
  box-shadow: 0 2px 6px rgba(255,136,0,.25);
}
.book-btn:hover {
  background: var(--orange-700);
  text-decoration: none;
  color: white;
  transform: translateY(-1px);
}

.free-badge,
.new-badge,
.bestseller-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  padding: .28rem .7rem;
  border-radius: 4px;
  margin-bottom: .8rem;
}

.free-badge {
  background: #16a34a;
  color: white;
  align-self: flex-start;
}

.new-badge {
  background: var(--brand-blue);
  color: white;
  align-self: flex-start;
}

.bestseller-badge {
  background: var(--brand-orange);
  color: white;
  align-self: flex-start;
}

.book-btn-sample {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border-dark);
  box-shadow: none;
}
.book-btn-sample:hover {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: var(--brand-blue);
  transform: none;
}

.amazon-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: #FF9900;
  color: #111111;
  padding: .55rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: .85rem;
  text-decoration: none;
  align-self: flex-start;
  margin-top: .65rem;
  transition: background .15s, transform .12s;
  box-shadow: 0 2px 8px rgba(255,153,0,.3);
}
.amazon-btn:hover {
  background: #e68900;
  color: #111111;
  text-decoration: none;
  transform: translateY(-1px);
}

/* ============================================================
   3b. More Categories
   ============================================================ */
.more-categories {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.more-categories-label {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-faint);
  white-space: nowrap;
}

.more-categories-links {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
}

.category-link {
  display: inline-flex;
  align-items: center;
  padding: .35rem .85rem;
  border: 1.5px solid var(--border-dark);
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color .14s, color .14s, background .14s;
}

.category-link:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  background: var(--blue-50);
  text-decoration: none;
}

/* ============================================================
   4. Book Index Page
   ============================================================ */
.book-index {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 2.75rem;
  font-size: .875rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--blue-600); }
.breadcrumb .sep { color: var(--border-dark); }

.book-header {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 3.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.book-header-cover { flex-shrink: 0; }
.book-header-cover img {
  width: 130px;
  border-radius: 6px;
  box-shadow: var(--shadow-md);
}

.book-header-info h1 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.18;
  margin-bottom: .6rem;
  letter-spacing: -.025em;
}

.book-header-info .subtitle {
  font-size: .97rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1rem;
  font-style: italic;
}

.book-meta {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: .25rem .8rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
}

.badge-blue {
  background: var(--blue-50);
  color: var(--blue-700);
  border: 1px solid var(--blue-100);
}

.badge-orange {
  background: var(--orange-50);
  color: var(--orange-600);
  border: 1px solid var(--orange-100);
}

.toc-label {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-faint);
  margin-bottom: 1.5rem;
}

.act-section { margin-bottom: 2.75rem; }

.act-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .75rem;
}

.act-title {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--blue-700);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  padding: .3rem .8rem;
  border-radius: 20px;
  white-space: nowrap;
}

.act-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.chapter-list { list-style: none; }

.chapter-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .65rem .5rem;
  border-radius: var(--radius);
  transition: background .12s;
}
.chapter-item:hover { background: var(--bg-subtle); }

.chapter-item.available:hover { background: var(--orange-50); }

.ch-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  flex-shrink: 0;
  background: var(--bg-subtle);
  color: var(--text-faint);
  border: 1.5px solid var(--border);
}

.chapter-item.available .ch-num {
  background: var(--orange-50);
  color: var(--orange-600);
  border-color: var(--orange-100);
}

.ch-title {
  font-size: .93rem;
  line-height: 1.4;
  flex: 1;
  color: var(--text-muted);
}

.chapter-item.available .ch-title {
  color: var(--text);
  font-weight: 500;
}

.chapter-item a {
  color: inherit;
  text-decoration: none;
}
.chapter-item.available a:hover { color: var(--orange-600); }

.tag {
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
  flex-shrink: 0;
}
.tag-project {
  background: var(--orange-50);
  color: var(--orange-600);
  border: 1px solid var(--orange-100);
}

/* ============================================================
   4b. Book Hero Image
   ============================================================ */
.book-hero {
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: #111;
  line-height: 0;
}

.book-hero img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  object-position: center top;
  display: block;
}

@media (max-width: 640px) {
  .book-hero img { max-height: 220px; }
}

/* ============================================================
   5. Chapter Page — Layout
   ============================================================ */
.chapter-wrapper {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 2rem 7rem;
}

.chapter-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.chapter-nav-bar a,
.chapter-nav-bar .nav-placeholder {
  font-size: .83rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .35rem;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  padding: .35rem .6rem;
  border-radius: var(--radius);
  transition: all .14s;
}

.chapter-nav-bar a:hover {
  color: var(--blue-600);
  background: var(--blue-50);
  text-decoration: none;
}

.nav-center-info {
  font-size: .78rem;
  color: var(--text-faint);
  font-weight: 500;
  letter-spacing: .03em;
}

.chapter-header { margin-bottom: 3rem; }

.chapter-eyebrow {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--orange-600);
  margin-bottom: .65rem;
}

.chapter-title {
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.035em;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.chapter-intro-line {
  width: 48px;
  height: 4px;
  background: linear-gradient(90deg, var(--orange-500), var(--orange-600));
  border-radius: 2px;
}

/* ============================================================
   6. Chapter Content — Typography
   ============================================================ */
.chapter-content {
  font-size: 1.05rem;
  line-height: 1.82;
  color: var(--text);
}

.chapter-content p { margin-bottom: 1.5rem; }

.chapter-content h2 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.2;
  margin-top: 3.5rem;
  margin-bottom: 1.1rem;
  padding-top: 2.5rem;
  border-top: none;
  /* Two-tone divider: orange accent for first 48px, then grey rule */
  background: linear-gradient(90deg, var(--orange-500) 48px, var(--border) 48px) top / 100% 2px no-repeat;
  color: var(--text);
  scroll-margin-top: 80px;
}

.chapter-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  background: none;
}

.chapter-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.015em;
  margin-top: 2.5rem;
  margin-bottom: .7rem;
  color: var(--text);
  scroll-margin-top: 80px;
}

.chapter-content h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: .5rem;
  color: var(--blue-900);
  scroll-margin-top: 80px;
}

.chapter-content ul,
.chapter-content ol {
  margin-left: 1.6rem;
  margin-bottom: 1.5rem;
}

.chapter-content li { margin-bottom: .45rem; }

.chapter-content li > p { margin-bottom: .4rem; }

.chapter-content strong { font-weight: 700; color: inherit; }
.chapter-content em { font-style: italic; }

.chapter-content code {
  font-family: var(--font-mono);
  font-size: .855em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: .1em .38em;
  border-radius: 3px;
  color: #be185d;
  white-space: nowrap;
}

/* Heading anchor links — injected by article.js */
.heading-anchor {
  opacity: 0;
  margin-left: .4em;
  color: var(--text-faint);
  text-decoration: none;
  font-weight: 400;
  font-size: .7em;
  transition: opacity .15s, color .15s;
  user-select: none;
}
.chapter-content h2:hover .heading-anchor,
.chapter-content h3:hover .heading-anchor,
.heading-anchor:focus { opacity: 1; }
.heading-anchor:hover { color: var(--brand-blue); text-decoration: none; }

/* ============================================================
   7. Code Blocks
   ============================================================ */
.chapter-content pre {
  margin: 1.8rem 0;
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  font-size: .875rem;
  position: relative;  /* anchor for copy button */
}

.chapter-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border-radius: 0;
  white-space: pre;
}

/* Override highlight.js to add padding */
.chapter-content pre > code.hljs {
  padding: 1.4rem 1.5rem;
  font-size: .875rem;
  font-family: var(--font-mono);
  line-height: 1.65;
  border-radius: var(--radius);
}

/* Language label — shown when pre has data-language="…" */
.chapter-content pre[data-language]::before {
  content: attr(data-language);
  display: block;
  min-width: 100%;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: .45rem 1.5rem;
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}

/* Copy button — injected by article.js into every pre */
.copy-btn {
  position: absolute;
  top: .35rem;
  right: .6rem;
  padding: .2rem .6rem;
  background: var(--bg);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.6;
  opacity: 0;
  transition: opacity .15s, background .15s, border-color .15s, color .15s;
  z-index: 10;
}
.chapter-content pre:hover .copy-btn,
.copy-btn:focus { opacity: 1; }

.copy-btn:hover {
  background: var(--blue-50);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  text-decoration: none;
}

.copy-btn.copied {
  opacity: 1;
  background: #dcfce7;
  border-color: #16a34a;
  color: #16a34a;
}

/* ============================================================
   8. Figures & Screenshots
   ============================================================ */
.chapter-content figure {
  margin: 2.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.chapter-content figure img {
  width: 100%;
  display: block;
}

.chapter-content figcaption {
  font-size: .825rem;
  color: var(--text-muted);
  padding: .75rem 1.1rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  font-style: italic;
  text-align: center;
  line-height: 1.5;
}

/* ============================================================
   9. Callouts & Blockquotes
   ============================================================ */
.chapter-content blockquote {
  border-left: 4px solid var(--blue-500);
  background: var(--blue-50);
  padding: 1.1rem 1.4rem;
  margin: 1.75rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.chapter-content blockquote p {
  margin-bottom: 0;
  font-size: .96rem;
  color: #1e3a8a;
  line-height: 1.65;
}

.error-grid, .error-list { margin: 1.5rem 0 2rem; display: flex; flex-direction: column; gap: .75rem; }

.error-item {
  padding: 1rem 1.15rem;
  background: var(--bg-subtle);
  border-left: 3px solid var(--orange-500);
  border-radius: 0 var(--radius) var(--radius) 0;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.error-item p { margin-bottom: 0; font-size: .95rem; line-height: 1.65; }

/* ============================================================
   10. Chapter Bottom Navigation
   ============================================================ */
.chapter-nav-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding-top: 3rem;
  margin-top: 3.5rem;
  border-top: 1px solid var(--border);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all .15s;
  background: var(--bg);
}
.nav-btn:hover {
  border-color: var(--blue-500);
  background: var(--blue-50);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.nav-btn-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 700;
  color: var(--text-faint);
}

.nav-btn-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.nav-btn-next { text-align: right; }

/* ============================================================
   11. Coming Soon
   ============================================================ */
.coming-soon {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-dark);
  margin-top: 2.5rem;
}

.coming-soon-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: .4;
}

.coming-soon h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

.coming-soon p {
  color: var(--text-faint);
  font-size: .9rem;
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============================================================
   12. Footer
   ============================================================ */
.site-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 2rem;
  font-size: .85rem;
  color: var(--text-faint);
}

.site-footer a {
  color: var(--text-muted);
}
.site-footer a:hover { color: var(--blue-600); }

/* ============================================================
   13. Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .books-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .books-grid { grid-template-columns: 1fr; }
  .book-header { flex-direction: column; gap: 1.5rem; }
  .book-header-cover img { width: 110px; }
  .chapter-nav-bottom { grid-template-columns: 1fr; }
  .nav-btn-next { text-align: left; }
  .chapter-nav-bar { gap: .5rem; }
  .home-hero { padding: 4.5rem 1.25rem 4rem; }
  .home-books { padding: 3.5rem 1.25rem 4rem; }
  .book-index { padding: 2rem 1.25rem 4rem; }
  .chapter-wrapper { padding: 0 1.25rem 5rem; }
}

/* ============================================================
   14. Dark Mode  (respects OS preference; default is light)
   ============================================================ */
@media (prefers-color-scheme: dark) {

  :root {
    /* Text */
    --text:        #e2e8f0;
    --text-muted:  #94a3b8;
    --text-faint:  #64748b;

    /* Surfaces */
    --bg:          #0f172a;
    --bg-subtle:   #1e293b;
    --bg-code:     #1e293b;

    /* Borders */
    --border:      #334155;
    --border-dark: #475569;

    /* Brand */
    --brand-blue:   #60a5fa;
    --brand-orange: #ff8800;

    /* Blue scale */
    --blue-900: #bfdbfe;
    --blue-700: #60a5fa;
    --blue-600: #60a5fa;
    --blue-500: #93c5fd;
    --blue-100: #1e3a5f;
    --blue-50:  #0f1f3d;

    /* Orange backgrounds (mid-range stays vivid) */
    --orange-100: #431407;
    --orange-50:  #2c0a00;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow:    0 1px 4px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,.5);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.6);
  }

  /* Header (hardcoded white override) */
  .site-header { background: var(--bg); }

  /* Book cover gradient */
  .book-cover-wrap {
    background: linear-gradient(160deg, #1a2744 0%, #1e293b 100%);
  }

  /* Blockquote text (hardcoded dark blue) */
  .chapter-content blockquote p { color: var(--blue-900); }

  /* Inline code colour */
  .chapter-content code { color: #f472b6; }

  /* Code blocks — match github-dark palette */
  .chapter-content pre { background: #0d1117; border-color: #30363d; }

  /* Language label */
  .chapter-content pre[data-language]::before {
    background: #010409;
    color: #8b949e;
    border-bottom-color: #30363d;
  }

  /* Copy button */
  .copy-btn { background: #1e293b; border-color: #334155; color: #94a3b8; }
  .copy-btn:hover { background: #0f1f3d; border-color: #60a5fa; color: #60a5fa; }
  .copy-btn.copied { background: #14532d; border-color: #16a34a; color: #4ade80; }

  /* Nav buttons */
  .nav-btn { background: var(--bg); }
}
