/* =========================================
   DSA MASTER NOTES - HANDWRITTEN EDITION
   8+ YoE Senior / Staff Engineer Guide (Tier 1, 2, 3)
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&family=Kalam:wght@300;400;700&family=Patrick+Hand&family=Fira+Code:wght@400;500;600&family=Shantell+Sans:ital,wght@0,300..700;1,300..700&display=swap');

:root {
  /* Paper & Binder Palette */
  --paper-bg: #fdfbf7;
  --paper-lines: rgba(180, 160, 130, 0.28);
  --paper-margin-line: rgba(99, 102, 241, 0.35);
  --spiral-metal: #78716c;
  --spiral-ring: #d6d3d1;
  --hole-bg: #0f172a;
  
  /* Ink Colors from iPad Handwritten Note */
  --ink-red: #dc2626;
  --ink-red-dark: #b91c1c;
  --ink-blue: #2563eb;
  --ink-blue-dark: #1d4ed8;
  --ink-dark: #1e293b;
  --ink-yellow: #d97706;
  --ink-green: #059669;
  --ink-purple: #7c3aed;
  --ink-indigo: #4f46e5;
  --ink-cyan: #0284c7;

  /* Accent Highlight BGs */
  --bg-red: #fee2e2;
  --bg-blue: #dbeafe;
  --bg-yellow: #fef3c7;
  --bg-green: #dcfce7;
  --bg-purple: #ede9fe;
  --bg-indigo: #e0e7ff;
  --bg-cyan: #e0f2fe;
  
  --shadow-notebook: 0 20px 50px rgba(0, 0, 0, 0.45), 0 8px 20px rgba(0, 0, 0, 0.25);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Shantell Sans', 'Patrick Hand', cursive, sans-serif;
  background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0f172a 65%, #020617 100%);
  min-height: 100vh;
  color: var(--ink-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Subtle background glowing spots */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(circle at 15% 25%, rgba(99, 102, 241, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(6, 182, 212, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* App container */
.app {
  width: 100%;
  max-width: 1120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 60px;
  z-index: 1;
}

/* Top Navigation Bar */
.topbar {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 26px;
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6));
}

.topbar-title {
  font-family: 'Caveat', cursive;
  font-size: 23px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.4px;
}

.author-pill {
  font-family: 'Patrick Hand', cursive;
  font-size: 13px;
  font-weight: normal;
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(165, 180, 252, 0.35);
  color: #c7d2fe;
  padding: 2px 9px;
  border-radius: 9999px;
}

.topbar-center {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  padding: 3px 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-btn {
  font-family: 'Caveat', cursive;
  font-size: 18px;
  font-weight: 700;
  background: transparent;
  color: #f8fafc;
  border: none;
  border-radius: 9999px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  color: #38bdf8;
  transform: scale(1.05);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-indicator {
  font-family: 'Patrick Hand', cursive;
  font-size: 14px;
  color: #e2e8f0;
  padding: 0 12px;
  font-weight: bold;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

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

.home-link-btn {
  font-family: 'Caveat', cursive;
  font-size: 16px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  border-radius: 9999px;
  padding: 5px 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.home-link-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  transform: translateY(-1px);
}

.drawer-toggle-btn {
  font-family: 'Caveat', cursive;
  font-size: 16px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #e0e7ff;
  border-radius: 9999px;
  padding: 5px 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.15);
}

.drawer-toggle-btn:hover {
  background: rgba(99, 102, 241, 0.3);
  border-color: #818cf8;
  color: #fff;
  transform: translateY(-1px) scale(1.03);
}

/* =========================================
   TOPIC SIDENAV DRAWER (SLIDE-OVER)
   ========================================= */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 360px;
  max-width: 88vw;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(2, 6, 23, 0.98) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.6);
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  color: #f8fafc;
  overflow: hidden;
}

.sidebar-drawer.open {
  transform: translateX(0);
}

.sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-home-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f8fafc;
  text-decoration: none;
  font-family: 'Caveat', cursive;
  font-size: 20px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.2s ease;
}

.sidebar-home-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #818cf8;
  color: #c7d2fe;
}

.sidebar-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-section {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-label {
  font-family: 'Patrick Hand', cursive;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.notebook-switcher-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.switcher-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: #cbd5e1;
  transition: all 0.2s ease;
}

.switcher-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: translateY(-1px);
}

.switcher-card.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.6);
  color: #fff;
}

.switcher-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.switcher-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.switcher-title {
  font-family: 'Caveat', cursive;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.switcher-pages {
  font-family: 'Patrick Hand', cursive;
  font-size: 11px;
  color: #94a3b8;
}

/* Sidebar Search */
.sidebar-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.sidebar-search-box .search-icon {
  position: absolute;
  left: 10px;
  font-size: 14px;
  pointer-events: none;
  opacity: 0.6;
}

.sidebar-search-box input {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 32px 8px 32px;
  font-family: 'Kalam', cursive;
  font-size: 14px;
  color: #f8fafc;
  outline: none;
  transition: all 0.2s ease;
}

.sidebar-search-box input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: #818cf8;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.clear-search-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}

/* Topics List */
.sidebar-topics-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-topic-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.2s ease;
  color: #cbd5e1;
}

.sidebar-topic-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
  transform: translateX(3px);
}

.sidebar-topic-item.active {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.5);
  color: #fff;
}

.topic-badge-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Patrick Hand', cursive;
  font-size: 13px;
  font-weight: bold;
  flex-shrink: 0;
  margin-right: 10px;
}

.sidebar-topic-item.active .topic-badge-circle {
  background: #818cf8;
  color: #0f172a;
}

.topic-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.topic-title {
  font-family: 'Caveat', cursive;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-subtitle {
  font-family: 'Patrick Hand', cursive;
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-tag-pill {
  font-family: 'Patrick Hand', cursive;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
  margin-left: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

/* =========================================
   NOTEBOOK WRAPPER & SPIRAL PAGES
   ========================================= */
.notebook-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 24px;
}

.notebook-page {
  display: none;
  width: 94%;
  max-width: 980px;
  background: var(--paper-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-notebook);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.notebook-page.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Ruled notebook line background */
.notebook-inner {
  position: relative;
  padding: 40px 48px 50px 76px;
  min-height: 1020px;
  background-image: 
    linear-gradient(90deg, transparent 56px, var(--paper-margin-line) 56px, var(--paper-margin-line) 58px, transparent 58px),
    linear-gradient(var(--paper-lines) 1px, transparent 1px);
  background-size: 100% 100%, 100% 32px;
}

/* Spiral holes and metal rings along left margin */
.spiral-holes {
  position: absolute;
  top: 30px;
  left: 18px;
  bottom: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  z-index: 5;
}

.hole {
  width: 16px;
  height: 16px;
  background: var(--hole-bg);
  border-radius: 50%;
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.7);
  position: relative;
}

.hole::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -12px;
  width: 22px;
  height: 6px;
  background: linear-gradient(90deg, var(--spiral-ring), var(--spiral-metal), var(--spiral-ring));
  border-radius: 4px;
  transform: translateY(-50%) rotate(-12deg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* Page Header & Title */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: 2px dashed rgba(99, 102, 241, 0.3);
}

.author-tag {
  font-family: 'Patrick Hand', cursive;
  font-size: 14px;
  color: #64748b;
}

.page-num {
  font-family: 'Caveat', cursive;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-indigo);
  background: var(--bg-indigo);
  padding: 2px 10px;
  border-radius: 12px;
}

.page-title {
  font-family: 'Caveat', cursive;
  font-size: 40px;
  font-weight: 700;
  color: var(--ink-dark);
  line-height: 1.15;
  margin-bottom: 24px;
  position: relative;
  display: inline-block;
}

.title-underline {
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #06b6d4, #f43f5e);
  border-radius: 2px;
  margin-top: 4px;
  width: 100%;
}

/* =========================================
   HANDWRITTEN SECTIONS, CARDS & DIAGRAMS
   ========================================= */
.section-block {
  margin-bottom: 30px;
  position: relative;
}

.section-num-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink-indigo);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
  font-weight: bold;
  margin-right: 8px;
  vertical-align: middle;
}

.section-title {
  font-family: 'Caveat', cursive;
  font-size: 30px;
  font-weight: 700;
  color: var(--ink-dark);
  display: inline;
  vertical-align: middle;
}

.handwritten-list {
  list-style: none;
  margin: 14px 0;
  padding-left: 2px;
}

.handwritten-list li {
  font-family: 'Shantell Sans', cursive, sans-serif;
  font-size: 15.5px;
  line-height: 1.65;
  margin-bottom: 10px;
  position: relative;
  padding-left: 28px;
  color: #1e293b;
}

.handwritten-list li::before {
  content: '👉';
  position: absolute;
  left: 0;
  top: 1px;
  font-size: 16px;
}

/* =========================================
   VISUAL SKETCH-NOTE UI TOOLKIT
   ========================================= */

/* Highlighters with real marker stroke look */
mark, .marker {
  padding: 1px 6px;
  border-radius: 4px;
  display: inline;
  font-weight: 600;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

mark.hl-yellow, .marker-yellow {
  background: #fef08a;
  color: #713f12;
}

mark.hl-pink, .marker-pink {
  background: #fbcfe8;
  color: #9d174d;
}

mark.hl-cyan, mark.hl-blue, .marker-cyan {
  background: #bae6fd;
  color: #0369a1;
}

mark.hl-green, .marker-green {
  background: #bbf7d0;
  color: #14532d;
}

mark.hl-orange, .marker-orange {
  background: #fed7aa;
  color: #9a3412;
}

mark.hl-purple, .marker-purple {
  background: #f3e8ff;
  color: #6b21a8;
}

/* Text color helpers */
.hl-blue { color: var(--ink-blue); font-weight: bold; }
.hl-red { color: var(--ink-red); font-weight: bold; }
.hl-green { color: var(--ink-green); font-weight: bold; }
.hl-yellow { color: var(--ink-yellow); font-weight: bold; }
.hl-purple { color: var(--ink-purple); font-weight: bold; }
.hl-indigo { color: var(--ink-indigo); font-weight: bold; }
.hl-cyan { color: var(--ink-cyan); font-weight: bold; }

/* Cloud Slide Badge */
.cloud-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: #fce7f3;
  color: #9d174d;
  border: 2px dashed #f472b6;
  border-radius: 20px;
  font-family: 'Caveat', cursive;
  font-size: 19px;
  font-weight: 700;
  transform: rotate(-1.5deg);
  box-shadow: 2px 2px 0 rgba(219, 39, 119, 0.2);
}

/* Stamp Tag (Top-right pill) */
.stamp-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: #ede9fe;
  color: #4338ca;
  border: 2px solid #a5b4fc;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  font-family: 'Patrick Hand', cursive;
  font-size: 15px;
  font-weight: 700;
  transform: rotate(1.5deg);
}

/* Washi Tape Strip */
.washi-tape {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  width: 90px;
  height: 20px;
  background: rgba(254, 240, 138, 0.8);
  border: 1px dashed rgba(202, 138, 4, 0.45);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  pointer-events: none;
  z-index: 2;
}

/* Sketch Cards with Hand-Drawn Wobbly Borders */
.sketch-card {
  background: #ffffff;
  border: 2.2px solid #1e293b;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  box-shadow: 3px 4px 0 #1e293b;
  padding: 18px 20px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sketch-card:hover {
  transform: translateY(-2px);
  box-shadow: 4px 6px 0 #1e293b;
}

.sketch-card.card-blue {
  background: #f0f9ff;
  border-color: #0284c7;
  box-shadow: 3px 4px 0 #0284c7;
}

.sketch-card.card-green {
  background: #f0fdf4;
  border-color: #16a34a;
  box-shadow: 3px 4px 0 #16a34a;
}

.sketch-card.card-yellow {
  background: #fefce8;
  border-color: #ca8a04;
  box-shadow: 3px 4px 0 #ca8a04;
}

.sketch-card.card-pink {
  background: #fdf2f8;
  border-color: #db2777;
  box-shadow: 3px 4px 0 #db2777;
}

.sketch-card.card-purple {
  background: #faf5ff;
  border-color: #9333ea;
  box-shadow: 3px 4px 0 #9333ea;
}

/* Stakeholder / Tier Persona Columns (Matching Reference Image 2) */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 18px 0;
}

.persona-col {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.persona-col:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.persona-col.tier-1 { border-top: 4px solid #ef4444; border-bottom: 2px solid #ef4444; }
.persona-col.tier-2 { border-top: 4px solid #3b82f6; border-bottom: 2px solid #3b82f6; }
.persona-col.tier-3 { border-top: 4px solid #10b981; border-bottom: 2px solid #10b981; }

.persona-avatar-wrap {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 8px;
  border: 2px solid #1e293b;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.persona-col.tier-1 .persona-avatar-wrap { background: #fee2e2; border-color: #ef4444; }
.persona-col.tier-2 .persona-avatar-wrap { background: #dbeafe; border-color: #3b82f6; }
.persona-col.tier-3 .persona-avatar-wrap { background: #dcfce7; border-color: #10b981; }

.persona-pill {
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 12px;
  border: 1.5px solid;
  margin-bottom: 12px;
  text-align: center;
}

.persona-col.tier-1 .persona-pill { background: #fee2e2; border-color: #ef4444; color: #b91c1c; }
.persona-col.tier-2 .persona-pill { background: #dbeafe; border-color: #3b82f6; color: #1d4ed8; }
.persona-col.tier-3 .persona-pill { background: #dcfce7; border-color: #10b981; color: #15803d; }

.persona-list {
  width: 100%;
  list-style: none;
  padding: 0;
  margin: 0;
}

.persona-list li {
  font-family: 'Shantell Sans', cursive, sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  color: #334155;
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
}

.persona-list li::before {
  content: '•';
  color: #6366f1;
  font-size: 18px;
  position: absolute;
  left: 4px;
  top: -2px;
}

/* Retro macOS App Window (Matching Reference Image 1 HTTP 429 Box) */
.mac-window {
  background: #ffffff;
  border: 2.2px solid #334155;
  border-radius: 14px;
  box-shadow: 3px 4px 0 #334155;
  overflow: hidden;
  margin: 16px 0;
}

.mac-win-header {
  background: #f1f5f9;
  border-bottom: 1.5px solid #cbd5e1;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.win-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
}
.win-dot.red { background: #ef4444; }
.win-dot.yellow { background: #f59e0b; }
.win-dot.green { background: #10b981; }

.mac-win-title {
  margin-left: 8px;
  font-family: 'Patrick Hand', cursive;
  font-size: 13px;
  color: #64748b;
}

.mac-win-body {
  padding: 14px 18px;
  font-family: 'Fira Code', monospace;
  font-size: 13.5px;
  line-height: 1.6;
  color: #1e293b;
  background: #fafafa;
  overflow-x: auto;
}

/* Checklist with circle check badges */
.sketch-checklist {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}

.sketch-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: 'Shantell Sans', cursive, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1e293b;
  margin-bottom: 9px;
}

.chk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #10b981;
  color: #ffffff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: bold;
  flex-shrink: 0;
  margin-top: 1px;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Key Takeaway Card (Matching Reference Image 1) */
.takeaway-card {
  background: #f0fdf4;
  border: 2.2px solid #0284c7;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  box-shadow: 3px 4px 0 #0284c7;
  padding: 18px 22px;
  margin: 22px 0;
  position: relative;
}

.takeaway-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1.5px solid #38bdf8;
  border-radius: 20px;
  font-family: 'Caveat', cursive;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.takeaway-inner-pink {
  background: #ffffff;
  border: 2px dashed #f472b6;
  border-radius: 12px;
  padding: 12px 18px;
  text-align: center;
  margin-bottom: 12px;
}

.takeaway-inner-pink p {
  font-family: 'Shantell Sans', cursive, sans-serif;
  font-size: 17.5px;
  font-weight: 700;
  color: #9d174d;
  margin: 0;
}

.takeaway-quote {
  font-family: 'Patrick Hand', cursive;
  font-size: 17px;
  color: #15803d;
  text-align: center;
  margin: 0;
  line-height: 1.4;
}

/* Social & Engagement Footer Banner (Matching Reference Image) */
.social-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 10px 18px;
  margin-top: 24px;
  flex-wrap: wrap;
  gap: 10px;
}

.social-banner-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px;
  background: #fdf4ff;
  border: 1.5px solid #d946ef;
  border-radius: 20px;
  color: #a21caf;
  font-family: 'Patrick Hand', cursive;
  font-size: 15px;
  font-weight: bold;
}

/* Visual Diagram Containers */
.sketch-diagram-wrap {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  padding: 16px;
  margin: 16px 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

/* 2-Column and 3-Column Responsive Layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 16px 0;
}

.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

/* Feature & Diagram Cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.feature-card {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  box-shadow: 3px 3px 0 #cbd5e1;
  padding: 14px;
  transition: all 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--ink-indigo);
  box-shadow: 4px 5px 0 var(--ink-indigo);
}

.feature-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.feature-label {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-indigo);
  margin-bottom: 4px;
}

.feature-desc {
  font-family: 'Shantell Sans', cursive, sans-serif;
  font-size: 14px;
  color: #475569;
  line-height: 1.5;
}

/* Code Snippet Box */
.code-box {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 12px;
  padding: 14px 18px;
  font-family: 'Fira Code', monospace;
  font-size: 13.5px;
  line-height: 1.5;
  margin: 14px 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
  overflow-x: auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.code-title {
  font-family: 'Patrick Hand', cursive;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
}

.code-kw { color: #f43f5e; font-weight: bold; }
.code-fn { color: #38bdf8; }
.code-str { color: #4ade80; }
.code-num { color: #fbbf24; }
.code-cm { color: #64748b; font-style: italic; }

/* Sticky Note Callout Boxes */
.remember-box {
  background: var(--bg-yellow);
  border: 2px dashed #f59e0b;
  border-radius: 14px;
  padding: 16px 20px;
  margin: 20px 0;
  transform: rotate(-0.5deg);
  box-shadow: 3px 5px 0 #d97706;
}

.remember-title {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 6px;
}

.remember-item {
  font-family: 'Shantell Sans', cursive, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  color: #78350f;
  margin-bottom: 4px;
}

.tip-box {
  background: var(--bg-green);
  border: 2px solid #10b981;
  border-radius: 14px;
  padding: 16px 20px;
  margin: 20px 0;
  transform: rotate(0.4deg);
  box-shadow: 3px 5px 0 #059669;
}

.tip-title {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  font-weight: 700;
  color: #047857;
  margin-bottom: 6px;
}

.tip-content {
  font-family: 'Shantell Sans', cursive, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  color: #064e3b;
}

/* Comparison Tables */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.compare-table th,
.compare-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-family: 'Shantell Sans', cursive, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.compare-table tbody tr:nth-child(even) {
  background: #fafaf9;
}

.compare-table tbody tr:hover {
  background: #f0f9ff;
}

.compare-table th {
  background: #e0e7ff;
  font-family: 'Caveat', cursive;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink-indigo);
  border-bottom: 2px solid #818cf8;
}

/* Page Footer */
.page-footer {
  text-align: center;
  margin-top: 36px;
  font-family: 'Patrick Hand', cursive;
  font-size: 13px;
  color: #94a3b8;
}

/* Dot Navigation */
.dot-nav {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dot.active {
  background: #818cf8;
  transform: scale(1.3);
  box-shadow: 0 0 10px #818cf8;
}

/* Table of Contents Modal */
.toc-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.toc-modal.open {
  display: flex;
}

.toc-box {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 24px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.toc-title {
  font-family: 'Caveat', cursive;
  font-size: 28px;
  font-weight: 700;
  color: #818cf8;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
}

.toc-item:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #fff;
  transform: translateX(4px);
}

.toc-num {
  font-weight: bold;
  color: #818cf8;
  font-size: 14px;
}

/* Responsive Mobile Layout */
@media (max-width: 768px) {
  .notebook-inner {
    padding: 30px 20px 40px 45px;
    min-height: auto;
  }
  .spiral-holes {
    left: 8px;
  }
  .hole {
    width: 12px;
    height: 12px;
  }
  .page-title {
    font-size: 30px;
  }
  .section-title {
    font-size: 24px;
  }
  .two-col, .three-col, .persona-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .compare-table {
    display: block;
    overflow-x: auto;
  }
}
