/* ─── Variables ─── */
:root {
  --bg:             #070b14;
  --surface:        rgba(13, 18, 32, 0.75);
  --surface-opaque: rgba(7, 11, 20, 0.88);
  --border:         rgba(0, 212, 255, 0.12);
  --accent-dim:     rgba(0, 212, 255, 0.10);
  --text:           #e2e8f0;
  --muted:          #7a8fa6;
  --accent:         #00d4ff;
  --accent2:        #a78bfa;
}

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

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  overflow: hidden;
}

/* ─── Automata canvas ─── */
/* z-index: 0 keeps it above the body background but below Reveal content */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.75;
}

/* ─── Reveal overrides ─── */
.reveal-viewport {
  background-color: var(--bg);
}

.reveal {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: transparent;
  position: relative;
  z-index: 1;
}

.reveal .slides > section,
.reveal .slides > section > section {
  background: transparent;
  padding: 0;
}

/* ─── LANDING ─── */
.landing-section {
  position: relative !important;
  width: 100%;
  height: 100%;
}

/* Center content absolutely within the section */
.landing-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  text-align: center;
  width: fit-content;
  padding: 2.5rem 3.5rem;
  background: var(--surface-opaque);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.3em 1em;
  background: var(--accent-dim);
}

.course-title {
  white-space: nowrap;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #1a3a6e 0%, var(--accent) 55%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.author-name {
  font-size: clamp(0.85rem, 1.5vw, 1.05rem);
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-style: italic;
}

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 1.4rem;
  opacity: 0.5;
  animation: bounce 2.2s ease-in-out infinite;
  user-select: none;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(9px); }
}

/* ─── SLIDE PANEL ─── */
.reveal .slide-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.2rem 2.8rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  max-width: 820px;
  margin: 0 auto;
  text-align: left;
}

.reveal h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* sub-block inside a slide-panel */
.reveal .slide-block {
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}

.reveal .slide-panel > p {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
  font-style: italic;
}

.reveal ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.reveal ul li {
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  line-height: 1.6;
  color: var(--text);
  padding-left: 1.2rem;
  position: relative;
}

.reveal ul li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.reveal strong {
  color: rgba(0, 212, 255, 0.85);
  font-weight: 600;
}

.slide-nav {
  margin-top: 1.2rem;
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  opacity: 0.5;
}

/* ─── NOTEBOOKS ─── */
.notebooks-section {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  padding: 2rem;
}

.notebooks-inner {
  width: 100%;
  max-width: 900px;
  text-align: left;
  padding: 2rem 2.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.nb-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.nb-sub {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 1.6rem;
}

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

.notebook-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.notebook-card:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-3px);
}

.nb-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.9rem;
}

.nb-btn {
  flex: 1;
  text-align: center;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.4em 0.6em;
  border-radius: 6px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.nb-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.nb-download {
  background: var(--accent-dim);
  border: 1px solid var(--border);
  color: var(--accent);
}

.nb-colab {
  background: rgba(255, 160, 0, 0.12);
  border: 1px solid rgba(255, 160, 0, 0.25);
  color: #ffa000;
}

.nb-num {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent2);
  margin-bottom: 0.45rem;
  font-family: 'JetBrains Mono', monospace;
}

.notebook-card h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.notebook-card p {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ─── TABLE OF CONTENTS ─── */
.toc-section {
  width: 100%;
}

.toc-panel {
  width: 100%;
  padding: 2.2rem 2.8rem;
  background: var(--surface-opaque);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.toc-header {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.4rem;
  font-family: 'JetBrains Mono', monospace;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc-item {
  display: grid;
  grid-template-columns: 2rem 1fr;
  grid-template-rows: auto auto;
  column-gap: 1rem;
  row-gap: 0.1rem;
  padding: 0.7rem 0.9rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  text-align: left;
  width: 100%;
  font-family: 'Inter', system-ui, sans-serif;
}

.toc-item:hover {
  background: var(--accent-dim);
  border-color: var(--border);
}

.toc-num {
  grid-row: 1 / 3;
  align-self: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent2);
  font-family: 'JetBrains Mono', monospace;
}

.toc-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.toc-sub {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ─── Chapter title slides ─── */
.reveal .chapter-panel {
  text-align: center;
  border-color: rgba(167, 139, 250, 0.25);
}

.chapter-num {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
}

.chapter-sub {
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.4rem !important;
  margin-bottom: 0 !important;
}

/* chapter summary — accent2 border */
.reveal .chapter-summary .slide-panel {
  border-color: rgba(167, 139, 250, 0.3);
  background: rgba(167, 139, 250, 0.05);
}

/* bridge/transition — warm tint */
.reveal .chapter-transition .slide-panel {
  border-color: rgba(255, 200, 80, 0.25);
  background: rgba(255, 200, 80, 0.04);
}

.reveal .chapter-transition .chapter-num {
  color: #ffc850;
}

/* placeholder text */
.slide-placeholder {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  opacity: 0.6;
  margin-top: 0.6rem;
}

/* optional notebook tag */
.nb-tag {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent2);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 99px;
  padding: 0.15em 0.6em;
  vertical-align: middle;
  margin-left: 0.4em;
}

/* ─── Horizontal timeline ─── */
.timeline-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 2rem;
  position: relative;
}

/* connecting line */
.timeline-h::before {
  content: '';
  position: absolute;
  top: 10px; /* vertically centered on dot */
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
}

.tl-h-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
  flex: 1;
}

.tl-h-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.tl-h-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent2);
}

.tl-h-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* ─── Person / event slides ─── */
.reveal .slide-panel.person-slide {
  display: flex;
  align-items: center;
  gap: 2.4rem;
  max-width: 860px;
}

.person-slide > div:first-child {
  flex: 1;
  min-width: 0;
}

.person-bio {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.65;
  margin-top: 0.8rem;
  font-style: normal !important;
  opacity: 1 !important;
}

.person-images {
  display: flex;
  gap: 0.9rem;
  flex-shrink: 0;
}

.person-img {
  max-height: 220px;
  width: auto;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* ─── Code ─── */
.reveal code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0, 0, 0, 0.45);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent);
  font-size: 0.9em;
}
