/* =========================================
   THE EVOLUTION OF AI - HANDWRITTEN NOTES
   Custom Digital Notebook CSS Stylesheet
   ========================================= */

@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&display=swap');

:root {
  /* Paper & Binder Palette */
  --paper-bg: #fdfbf7;
  --paper-lines: rgba(180, 160, 130, 0.28);
  --paper-margin-line: rgba(220, 38, 38, 0.25);
  --spiral-metal: #78716c;
  --spiral-ring: #d6d3d1;
  --hole-bg: #1e293b;
  
  /* Ink Colors from iPad Handwritten Note */
  --ink-red: #dc2626;
  --ink-red-dark: #b91c1c;
  --ink-blue: #1d4ed8;
  --ink-blue-dark: #1e40af;
  --ink-dark: #1e293b;
  --ink-yellow: #d97706;
  --ink-green: #059669;
  --ink-purple: #7c3aed;

  /* Accent Highlight BGs */
  --bg-red: #fee2e2;
  --bg-blue: #dbeafe;
  --bg-yellow: #fef3c7;
  --bg-green: #dcfce7;
  --bg-purple: #ede9fe;
  
  --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: 'Kalam', cursive;
  background: radial-gradient(circle at 50% 20%, #1e293b 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;
}

/* Subtle background glowing spots */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(29, 78, 216, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(220, 38, 38, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(5, 150, 105, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* App container */
.app {
  width: 100%;
  max-width: 1100px;
  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.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.35);
}

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

.brand-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.5));
  animation: pulseGlow 3s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(220, 38, 38, 0.4)); }
  100% { transform: scale(1.1); filter: drop-shadow(0 0 14px rgba(29, 78, 216, 0.8)); }
}

.topbar-title {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-pill {
  font-family: 'Patrick Hand', cursive;
  font-size: 13px;
  font-weight: normal;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.3), rgba(29, 78, 216, 0.3));
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fbbf24;
  padding: 2px 10px;
  border-radius: 20px;
}

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

.page-indicator {
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 14px;
  border-radius: 20px;
}

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

.nav-btn {
  font-family: 'Caveat', cursive;
  font-size: 16px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

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

.home-link-btn {
  font-family: 'Caveat', cursive;
  font-size: 16px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 5px 12px;
  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.22);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
}

.drawer-toggle-btn {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(29, 78, 216, 0.2));
  border-color: rgba(56, 189, 248, 0.4);
  color: #bae6fd;
}

.drawer-toggle-btn:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(29, 78, 216, 0.35));
  border-color: #38bdf8;
}

.pdf-btn {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.4), rgba(185, 28, 28, 0.4));
  border-color: rgba(239, 68, 68, 0.5);
  color: #fee2e2;
}

.pdf-btn:hover {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.6), rgba(185, 28, 28, 0.6)) !important;
}

/* =========================================
   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;
  background: rgba(255, 255, 255, 0.03);
}

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

.sidebar-home-link:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #38bdf8;
  transform: translateY(-1px);
}

.sidebar-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-size: 22px;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.sidebar-section {
  padding: 14px 18px 6px;
}

.section-label {
  font-family: 'Patrick Hand', cursive;
  font-size: 12px;
  letter-spacing: 1px;
  color: #94a3b8;
  margin-bottom: 8px;
  font-weight: 600;
}

/* Notebook Switcher Grid */
.notebook-switcher-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

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

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

.switcher-card.active {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.25), rgba(29, 78, 216, 0.25));
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

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

.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;
}

/* Search Box */
.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: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 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;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: #f1f5f9;
}

.sidebar-topic-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateX(4px);
}

.sidebar-topic-item.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.topic-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topic-num-badge {
  font-family: 'Caveat', cursive;
  font-size: 14px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  color: #cbd5e1;
  flex-shrink: 0;
}

.sidebar-topic-item.active .topic-num-badge {
  background: #38bdf8;
  color: #0f172a;
}

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

.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;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: 'Caveat', cursive;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-action-btn.pdf-btn {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.4), rgba(185, 28, 28, 0.4));
  color: #fee2e2;
  border-color: rgba(239, 68, 68, 0.5);
}

.sidebar-action-btn.home-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.sidebar-action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

/* Dot Navigation */
.dot-nav {
  display: flex;
  gap: 10px;
  margin: 16px 0 8px 0;
  z-index: 10;
}

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

.dot:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.2);
}

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

/* TOC Modal */
.toc-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.toc-card {
  background: #fdfbf7;
  background-image: linear-gradient(var(--paper-lines) 1px, transparent 1px);
  background-size: 100% 28px;
  width: 100%;
  max-width: 600px;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  border: 3px solid #d6d3d1;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed #94a3b8;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.toc-header h3 {
  font-family: 'Caveat', cursive;
  font-size: 26px;
  color: var(--ink-red);
}

.toc-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
}

.toc-item {
  font-family: 'Kalam', cursive;
  font-size: 17px;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toc-item:hover {
  background: var(--bg-blue);
  transform: translateX(6px);
  border-color: var(--ink-blue);
}

/* Notebook Container & Page */
.notebook-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.notebook-page {
  display: none;
  width: 92%;
  max-width: 900px;
  background: var(--paper-bg);
  border-radius: 12px;
  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: 980px;
  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;
  border-bottom: 2px dashed rgba(0, 0, 0, 0.15);
  padding-bottom: 8px;
  margin-bottom: 24px;
}

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

.page-num {
  font-family: 'Caveat', cursive;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  background: #e2e8f0;
  padding: 2px 10px;
  border-radius: 12px;
}

/* Title styling matching handwritten notes */
.ipad-note-header {
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Patrick Hand', cursive;
  font-size: 14px;
  color: #64748b;
}

.note-title-red {
  font-family: 'Caveat', cursive;
  font-size: 38px;
  font-weight: 700;
  color: var(--ink-red);
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  transform: rotate(-0.4deg);
}

.note-section-red {
  font-family: 'Caveat', cursive;
  font-size: 34px;
  font-weight: 700;
  color: var(--ink-red);
  margin: 28px 0 12px 0;
  transform: rotate(-0.3deg);
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-def-blue {
  font-family: 'Kalam', cursive;
  font-size: 22px;
  font-weight: 400;
  color: var(--ink-blue);
  line-height: 1.6;
  margin-bottom: 26px;
  padding-left: 8px;
  border-left: 3px solid var(--bg-blue);
}

.handwritten-blue-text {
  font-family: 'Kalam', cursive;
  font-size: 21px;
  color: var(--ink-blue);
  line-height: 1.5;
  margin: 8px 0;
}

.handwritten-dark-text {
  font-family: 'Kalam', cursive;
  font-size: 20px;
  color: var(--ink-dark);
  line-height: 1.5;
  margin: 8px 0;
}

.handwritten-yellow-text {
  font-family: 'Kalam', cursive;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink-yellow);
  line-height: 1.5;
  margin: 8px 0;
}

.handwritten-green-text {
  font-family: 'Kalam', cursive;
  font-size: 21px;
  color: var(--ink-green);
  line-height: 1.5;
  margin: 8px 0;
}

/* Timeline Blocks */
.timeline-block {
  margin-bottom: 24px;
  position: relative;
}

.timeline-year {
  font-family: 'Caveat', cursive;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.timeline-year .question {
  color: var(--ink-dark);
  font-style: italic;
}

.timeline-detail {
  font-family: 'Kalam', cursive;
  font-size: 21px;
  color: var(--ink-blue);
  padding-left: 24px;
  line-height: 1.5;
}

.timeline-arrow {
  color: var(--ink-blue);
  font-weight: bold;
}

/* Red Quote Box from handwritten notes */
.quote-box-red {
  background: var(--bg-red);
  border-left: 4px solid var(--ink-red);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin: 16px 0 24px 0;
  font-family: 'Caveat', cursive;
  font-size: 24px;
  font-weight: 600;
  color: var(--ink-red-dark);
  line-height: 1.5;
  box-shadow: 2px 4px 12px rgba(220, 38, 38, 0.08);
  transform: rotate(-0.3deg);
}

/* Golden Yellow Winter Banner */
.yellow-callout {
  color: var(--ink-yellow);
  font-family: 'Kalam', cursive;
  font-size: 21px;
  font-weight: 700;
  background: var(--bg-yellow);
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px dashed var(--ink-yellow);
  margin: 20px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: rotate(0.4deg);
}

/* Deep Blue Kasparov Block */
.chess-block {
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid rgba(30, 41, 59, 0.15);
  border-radius: 12px;
  padding: 16px 22px;
  margin: 22px 0;
}

.chess-title {
  font-family: 'Caveat', cursive;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink-dark);
}

.underline-blue {
  text-decoration: underline;
  text-decoration-color: var(--ink-blue);
  text-decoration-thickness: 2px;
}

.kasparov-annotations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
  font-family: 'Kalam', cursive;
  font-size: 19px;
  color: var(--ink-blue);
}

.anno-left {
  border-top: 2px solid var(--ink-blue);
  padding-top: 4px;
}

.anno-right {
  border-top: 2px double var(--ink-blue);
  padding-top: 4px;
  position: relative;
}

.anno-right::before {
  content: '⇓ ';
  color: var(--ink-blue);
  font-size: 22px;
  font-weight: bold;
}

/* Closing Green Question */
.closing-question-green {
  font-family: 'Caveat', cursive;
  font-size: 32px;
  font-weight: 700;
  color: var(--ink-green);
  text-align: center;
  margin: 24px 0;
  padding: 14px 12px;
  background: var(--bg-green);
  border-radius: 12px;
  border: 2px dashed var(--ink-green);
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.12);
  transform: rotate(-0.4deg);
}

/* Handwritten comparison badge (Rules vs Examples) */
.rule-vs-examples {
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: 'Caveat', cursive;
  font-size: 26px;
  font-weight: 700;
  margin: 10px 0 16px 0;
}

.strike-rules {
  color: var(--ink-red);
  background: var(--bg-red);
  padding: 4px 14px;
  border-radius: 8px;
  border: 1px dashed var(--ink-red);
}

.check-examples {
  color: var(--ink-green);
  background: var(--bg-green);
  padding: 4px 14px;
  border-radius: 8px;
  border: 1px solid var(--ink-green);
}

/* Pill tags grid for ML / DL concepts */
.pills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.green-pill-item {
  font-family: 'Kalam', cursive;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-green);
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid var(--ink-green);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.08);
}

.green-pill-item::before {
  content: '>';
  font-weight: 700;
  color: var(--ink-green);
}

/* AlexNet bracket group */
.bracket-group {
  border-left: 3px solid var(--ink-dark);
  padding-left: 16px;
  margin: 14px 0 18px 8px;
  font-family: 'Kalam', cursive;
  font-size: 20px;
  color: var(--ink-dark);
  line-height: 1.6;
}

.bracket-group div {
  margin-bottom: 4px;
}

/* NLP ambiguity quote box */
.nlp-quotes-box {
  background: rgba(255, 255, 255, 0.8);
  border: 2px dashed rgba(29, 78, 216, 0.3);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 14px 0;
}

.nlp-quote-line {
  font-family: 'Caveat', cursive;
  font-size: 25px;
  font-weight: 700;
  color: var(--ink-blue);
  margin-bottom: 6px;
}

.nlp-quote-explanation {
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
  color: #64748b;
  margin-bottom: 8px;
  padding-left: 12px;
}

/* NLP numbered steps list */
.nlp-steps-list {
  margin: 14px 0;
  padding-left: 12px;
}

.nlp-step-item {
  font-family: 'Kalam', cursive;
  font-size: 20px;
  color: var(--ink-dark);
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.nlp-step-item .step-num {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 24px;
  color: var(--ink-red);
}

/* Attention mechanism visualizer */
.attention-demo {
  background: #ffffff;
  border: 2px solid var(--ink-blue);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 18px 0;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.1);
}

.attention-sentence {
  font-family: 'Caveat', cursive;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink-blue);
  line-height: 1.6;
}

.attention-circle {
  border: 2px solid var(--ink-dark);
  border-radius: 50%;
  padding: 1px 8px;
  display: inline-block;
  color: var(--ink-dark);
  position: relative;
}

.attention-arrow-indicator {
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
  color: var(--ink-yellow);
  font-weight: bold;
  margin-top: 8px;
  padding-left: 6px;
}

/* Paradigm shift brackets (Old vs Modern AI) */
.paradigm-shift-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 20px 0;
}

.paradigm-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.paradigm-card.old {
  border-left: 4px solid #64748b;
}

.paradigm-card.modern {
  border-left: 4px solid var(--ink-green);
  background: var(--bg-green);
}

.paradigm-title {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.paradigm-title.old { color: #475569; }
.paradigm-title.modern { color: var(--ink-green); }

/* Modality pill tags */
.modality-tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 20px 0;
}

.modality-tag {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  background: #ffffff;
  border: 1.5px solid var(--ink-blue);
  color: var(--ink-blue);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Capabilities 2-Column Grid (The AI Today) */
.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.capability-card {
  background: #ffffff;
  border: 1.5px solid rgba(29, 78, 216, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.capability-card:hover {
  transform: translateY(-2px);
  border-color: var(--ink-blue);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.15);
}

.capability-star {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink-blue);
}

.capability-text {
  font-family: 'Kalam', cursive;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-dark);
}

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

/* Comparison Table */
.handwritten-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-family: 'Kalam', cursive;
  font-size: 18px;
}

.handwritten-table th,
.handwritten-table td {
  border: 2px dashed rgba(0, 0, 0, 0.18);
  padding: 10px 14px;
  text-align: left;
}

.handwritten-table th {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  background: var(--bg-blue);
  color: var(--ink-blue-dark);
}

/* Summary timeline footer */
.summary-timeline-bar {
  background: var(--bg-yellow);
  border: 2px dashed var(--ink-yellow);
  border-radius: 10px;
  padding: 12px 18px;
  margin-top: 24px;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 12px;
  font-family: 'Caveat', cursive;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-yellow);
}

/* PDF Print Styles for Clean Multi-Page Document */
@media print {
  @page {
    size: A4 portrait;
    margin: 5mm 5mm;
  }
  
  html, body {
    background: #ffffff !important;
    color: #1e293b !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }
  
  body::before, body::after {
    display: none !important;
  }
  
  .topbar, .dot-nav, .toc-modal, .sidebar-backdrop, .sidebar-drawer {
    display: none !important;
  }
  
  .app, .notebook-container {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .notebook-page {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    border: 1px solid #d6d3d1 !important;
    margin: 0 0 20px 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }
  
  .notebook-page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }
  
  .notebook-inner {
    min-height: auto !important;
    box-sizing: border-box !important;
    padding: 24px 30px 30px 64px !important;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .topbar {
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
  }

  .topbar-left {
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
  }

  .brand-icon {
    font-size: 22px;
  }

  .topbar-title {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .author-pill {
    display: none;
  }

  .topbar-right {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
  }

  .topbar-center {
    order: 3;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-btn {
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 6px;
  }

  .page-indicator {
    font-size: 14px;
    padding: 3px 12px;
  }

  .dot-nav {
    margin: 10px 0 6px 0;
    gap: 8px;
  }

  .dot {
    width: 8px;
    height: 8px;
  }

  .notebook-container {
    margin-top: 4px;
    padding: 0 6px;
  }

  .notebook-page {
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
  }

  .notebook-inner {
    padding: 20px 12px 28px 46px;
    min-height: auto;
    background-image: 
      linear-gradient(90deg, transparent 34px, var(--paper-margin-line) 34px, var(--paper-margin-line) 36px, transparent 36px),
      linear-gradient(var(--paper-lines) 1px, transparent 1px);
    background-size: 100% 100%, 100% 28px;
  }

  .spiral-holes {
    left: 8px;
    top: 20px;
    bottom: 20px;
  }

  .hole {
    width: 13px;
    height: 13px;
  }

  .hole::before {
    left: -8px;
    width: 18px;
    height: 5px;
  }

  .ipad-note-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-size: 12px;
    padding: 6px 10px;
    margin-bottom: 14px;
  }

  .page-header {
    margin-bottom: 16px;
    padding-bottom: 6px;
  }

  .note-title-red {
    font-size: 26px;
    line-height: 1.2;
    margin-bottom: 10px;
  }

  .note-section-red {
    font-size: 23px;
    margin: 20px 0 10px 0;
  }

  .note-def-blue {
    font-size: 17px;
    line-height: 1.5;
    margin-bottom: 18px;
  }

  .timeline-block {
    margin-bottom: 14px;
  }

  .timeline-year {
    font-size: 20px;
    flex-wrap: wrap;
  }

  .timeline-detail {
    font-size: 17px;
    padding-left: 12px;
  }

  .quote-box-red {
    padding: 12px 14px;
    font-size: 17px;
    margin: 14px 0;
    border-radius: 8px;
  }

  .yellow-callout {
    padding: 10px 12px;
    font-size: 16px;
    margin: 12px 0;
  }

  .chess-title {
    font-size: 20px;
  }

  .kasparov-annotations {
    grid-template-columns: 1fr;
    gap: 8px;
    font-size: 16px;
  }

  .closing-question-green {
    font-size: 20px;
    padding: 10px 12px;
    margin: 14px 0;
  }

  .handwritten-blue-text {
    font-size: 17px !important;
  }

  .paradigm-shift-container {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .capabilities-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .modality-tags-grid {
    gap: 6px;
  }

  .modality-tag {
    font-size: 17px;
    padding: 4px 10px;
  }

  .handwritten-table {
    font-size: 14px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  .handwritten-table th,
  .handwritten-table td {
    padding: 8px 10px;
    white-space: nowrap;
  }

  .summary-timeline-bar {
    font-size: 17px;
    padding: 8px 12px;
    gap: 8px;
    justify-content: center;
  }

  .toc-card {
    padding: 18px;
    margin: 10px;
  }

  .toc-item {
    font-size: 15px;
    padding: 8px 10px;
  }
}

