/* Vibe Emergency Comic Deck - Modular Design System */

/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Bebas+Neue&family=Roboto+Mono:wght@400;700&display=swap');

/* ===== TOKENS INLINED (Design Variables) ===== */

/* Color Tokens */
:root {
  /* Brand Colors */
  --red: #E30613;
  --yellow: #FFD500;
  --blue: #0056A6;
  --green: #00A651;
  --black: #000000;
  --white: #FFFFFF;
  --gray: #E6E6E6;
  --beige: #F5F5DC;

  /* Semantic Color Tokens */
  --color-primary: var(--red);
  --color-secondary: var(--blue);
  --color-accent: var(--yellow);
  --color-success: var(--green);

  /* Background Tokens */
  --bg-primary: var(--yellow);
  --bg-secondary: var(--blue);

  /* Foreground Tokens */
  --fg-primary: var(--black);
  --fg-inverse: var(--white);

  /* Theme-specific */
  --noir-accent: #E30613;

  /* Spacing Scale */
  --space-1: clamp(4px, 1vw, 8px);
  --space-2: clamp(8px, 1.5vw, 12px);
  --space-3: clamp(12px, 2vw, 16px);
  --space-4: clamp(16px, 2.5vw, 24px);
  --space-5: clamp(20px, 3vw, 32px);
  --space-6: clamp(24px, 4vw, 40px);
  --space-7: clamp(32px, 5vw, 48px);
  --space-8: clamp(40px, 6vw, 60px);
  --padding-base: clamp(8px, 2vw, 24px);
  --padding-large: clamp(16px, 3vw, 36px);

  /* Border & Effects */
  --border-width: clamp(4px, 1vw, 12px);
  --border-width-thin: clamp(2px, 0.5vw, 6px);
  --border-width-thick: clamp(6px, 1.5vw, 12px);
  --comic-border: var(--border-width) solid var(--black);
  --comic-border-thin: var(--border-width-thin) solid var(--black);
  --comic-border-thick: var(--border-width-thick) solid var(--black);
  --shadow-offset: clamp(6px, 1.5vw, 14px);
  --comic-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--black);
  --shadow-sm: 4px 4px 0 var(--black);
  --shadow-md: 6px 6px 0 var(--black);
  --shadow-lg: 8px 8px 0 var(--black);
  --radius-sm: clamp(4px, 1vw, 8px);
  --radius-md: clamp(8px, 2vw, 12px);

  /* Typography */
  --font-display: 'Bangers', cursive;
  --font-heading: 'Bebas Neue', Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  --font-mono: 'Roboto Mono', ui-monospace, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  --font-body: 'Bebas Neue', Impact, sans-serif;
  --text-xs: clamp(12px, 2vw, 14px);
  --text-sm: clamp(14px, 2.5vw, 16px);
  --text-base: clamp(16px, 3vw, 20px);
  --text-lg: clamp(18px, 3.5vw, 24px);
  --text-xl: clamp(20px, 4vw, 28px);
  --text-2xl: clamp(24px, 5vw, 32px);
  --text-3xl: clamp(28px, 6vw, 40px);
  --text-4xl: clamp(32px, 7vw, 48px);
  --text-5xl: clamp(40px, 8vw, 64px);
  --text-6xl: clamp(48px, 10vw, 72px);
  --heading-1: clamp(32px, 8vw, 72px);
  --heading-1-fit: clamp(36px, 10vw, 84px);
  --heading-2: clamp(24px, 6vw, 48px);
  --heading-3: clamp(20px, 5vw, 40px);
  --leading-tight: 1.1;
  --leading-normal: 1.4;
  --leading-relaxed: 1.6;
}

@media (min-width: 1024px) {
  :root {
    --heading-1: clamp(48px, 6vw, 72px);
    --heading-1-fit: clamp(56px, 7vw, 84px);
  }
}

/* ===== LAYOUTS ===== */

/* Landing Page Layout */
.landing-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--beige) url('assets/halftone.png');
  overflow-y: auto;
  height: auto;
}

.landing-container {
  text-align: center;
  max-width: 800px;
  padding: var(--space-7);
}

.logo-container {
  margin-bottom: var(--space-8);
  border: var(--comic-border);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
}

.logo-container img {
  max-width: 500px;
  width: 100%;
  height: auto;
}

.links-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  align-items: center;
}

@media (max-width: 600px) {
  .logo-container img {
    max-width: 300px;
  }
}

/* Code Page Layout */
.code-page-body {
  margin: 0;
  padding: 0;
  background: var(--beige) url('assets/halftone.png');
  overflow-y: auto !important;
  height: auto !important;
}

.code-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-5);
}

.code-header {
  text-align: center;
  margin-bottom: var(--space-7);
}

.header-box {
  background: var(--white);
  border: var(--comic-border);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.code-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  color: var(--blue);
  margin: 0 0 var(--space-5) 0;
}

.code-header p {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: var(--black);
  margin: 0;
}

.pull-quote {
  background: var(--yellow);
  border: var(--comic-border);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  margin: var(--space-6) 0;
  position: relative;
}

.pull-quote::before {
  content: '"';
  font-family: var(--font-display);
  font-size: 72px;
  color: var(--blue);
  position: absolute;
  top: -10px;
  left: 20px;
  line-height: 1;
}

.pull-quote::after {
  content: '"';
  font-family: var(--font-display);
  font-size: 72px;
  color: var(--blue);
  position: absolute;
  bottom: -20px;
  right: 20px;
  line-height: 1;
}

.pull-quote-label {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--red);
  margin: 0 0 var(--space-2) 0;
  text-transform: uppercase;
}

.pull-quote-text {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  line-height: var(--leading-normal);
  color: var(--black);
  margin: 0;
  font-style: italic;
  text-align: left;
  padding-left: var(--space-7);
}

.back-link {
  display: inline-block;
  margin-bottom: var(--space-6);
  padding: var(--space-2) var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  text-decoration: none;
  color: var(--white);
  background: var(--blue);
  border: var(--comic-border);
  box-shadow: var(--shadow-sm);
  transition: all 0.1s ease;
}

.back-link:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--black);
}

.code-container {
  position: relative;
  background: var(--white);
  border: var(--comic-border);
  box-shadow: var(--shadow-lg);
  margin-bottom: var(--space-7);
}

.code-header-bar {
  background: var(--red);
  padding: var(--space-4) var(--space-5);
  border-bottom: var(--comic-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--white);
  margin: 0;
}

.copy-button {
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--black);
  background: var(--yellow);
  border: var(--comic-border);
  box-shadow: 3px 3px 0 var(--black);
  cursor: pointer;
  transition: all 0.1s ease;
}

.copy-button:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--black);
}

.copy-button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--black);
}

.copy-button.copied {
  background: var(--green);
  color: var(--white);
}

.code-container pre {
  margin: 0;
  padding: var(--space-5);
  overflow-x: auto;
}

.code-container pre code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

@media (max-width: 768px) {
  .code-header h1 {
    font-size: var(--text-3xl);
  }

  .code-header p {
    font-size: var(--text-lg);
  }

  .code-container pre code {
    font-size: var(--text-xs);
  }
}

/* ===== BUTTON COMPONENTS ===== */

/* Base button */
.btn {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  border: var(--comic-border);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  line-height: 1;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-sm);
}

/* Button color variants */
.btn--primary {
  background: var(--color-primary);
  color: var(--fg-inverse);
}

.btn--secondary {
  background: var(--color-secondary);
  color: var(--fg-inverse);
}

.btn--accent {
  background: var(--color-accent);
  color: var(--fg-primary);
}

/* Button size variants */
.btn--sm {
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-3);
}

.btn--lg {
  font-size: var(--text-xl);
  padding: var(--space-4) var(--space-6);
  min-width: 400px;
}

/* Comic link style (landing page links) */
.comic-link {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  padding: var(--space-5) var(--space-7);
  border: var(--comic-border);
  box-shadow: var(--shadow-md);
  transition: all 0.1s ease;
  min-width: 400px;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.comic-link:hover {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-sm);
}

.comic-link:active {
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0 var(--black);
}

.comic-link--blue {
  background: var(--blue);
  color: var(--white);
}

.comic-link--red {
  background: var(--red);
  color: var(--white);
}

.comic-link--yellow {
  background: var(--yellow);
  color: var(--black);
}

/* Responsive */
@media (max-width: 600px) {
  .comic-link {
    font-size: var(--text-2xl);
    padding: var(--space-4) var(--space-5);
    min-width: 280px;
  }
}

/* Toolbar buttons (legacy compatibility) */
.toolbar button {
  font-family: var(--font-heading);
  font-size: 14px;
  border: 3px solid var(--black);
  background: var(--color-primary);
  color: var(--white);
  padding: 4px 8px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--black);
  white-space: nowrap;
  line-height: 1;
  min-width: auto;
  transition: transform 0.1s ease;
}

.toolbar button:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--black);
}

.toolbar button.secondary {
  background: var(--bg-secondary);
}

.toolbar button#print {
  font-size: 12px;
}

@media (min-width: 768px) {
  .toolbar button {
    font-size: 16px;
    padding: 5px 10px;
    border-width: 4px;
    box-shadow: 5px 5px 0 var(--black);
  }

  .toolbar button:active {
    box-shadow: 3px 3px 0 var(--black);
  }

  .toolbar button#print {
    font-size: 14px;
  }
}

@media (min-width: 1024px) {
  .toolbar button {
    font-size: 16px;
    padding: 6px 12px;
    box-shadow: 6px 6px 0 var(--black);
  }

  .toolbar button:active {
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0 var(--black);
  }
}

@media (min-width: 1440px) {
  .toolbar button {
    font-size: 18px;
    padding: 6px 14px;
  }

  .toolbar button#print {
    font-size: 15px;
  }
}

/* ===== PANEL COMPONENTS ===== */

.panel {
  background: var(--yellow);
  border: var(--comic-border);
  min-height: clamp(80px, 15vh, 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: clamp(16px, 3.5vw, 28px);
  text-align: center;
  padding: var(--padding-base);
  flex-direction: column;
  overflow: hidden;
}

.panel.gray {
  background: #f4f4f4;
  filter: grayscale(100%);
}

/* Panel Color Variants */
.panel--blue,
.panel-blue {
  background: var(--blue) !important;
  color: var(--white) !important;
}

.panel--red,
.panel-red {
  background: var(--red) !important;
  color: var(--white) !important;
}

.panel--yellow,
.panel-yellow {
  background: var(--yellow) !important;
  color: var(--black) !important;
}

.panel--white,
.panel-white {
  background: var(--white) !important;
  color: var(--black) !important;
}

/* Panel Sizing Modifiers */
.panel--full,
.panel-full {
  min-height: unset;
  height: 100%;
}

.panel-70 {
  height: 70%;
}

.panel-50 {
  height: 50%;
}

.panel-120 {
  height: 120%;
}

/* Panel Border Modifiers */
.panel--border-thick,
.panel-border-thick {
  border-width: var(--border-width-thick);
}

.panel--border-medium,
.panel-border-medium {
  border-width: clamp(6px, 1.2vw, 8px);
}

/* Panel Margin Adjustments */
.panel--overlap-right,
.panel-overlap-right {
  margin-right: calc(-1 * var(--border-width-thick));
}

.panel--overlap-top,
.panel-overlap-top {
  margin-top: calc(-1 * var(--border-width-thick));
}

/* Border utilities for touching panels */
.border-all {
  border: var(--border-width) solid var(--black);
}

.border-no-bottom {
  border: var(--border-width) solid var(--black);
  border-bottom: none;
}

.border-right-only {
  border: none !important;
  border-right: var(--border-width) solid var(--black) !important;
}

.no-border {
  border: none !important;
}

/* Panel Container Fill - makes child panels fill remaining space */
.panel-container-fill {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0;
  margin-bottom: clamp(32px, 4vw, 48px);
}

.panel-no-gap {
  gap: 0;
}

.panel-fill-bottom {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.panel-fill-bottom.logo-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-direction: row;
  padding: 20px;
  gap: 10px;
}

.panel-fill-bottom.logo-row img {
  position: relative;
  width: auto;
  height: clamp(40px, 8vh, 80px);
  max-width: clamp(80px, 15vw, 150px);
  object-fit: contain;
  padding: 0;
  margin: 0;
}

.panel-fill-bottom img:not(.panel-img):not(.logo):not(.panel-content-img) {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  padding: 20px;
}

/* Panel images - full width with padding */
.panel-img {
  width: calc(100% - 20px) !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
  margin: 10px !important;
  position: relative !important;
}

/* Two-panel side-by-side template */
.two-panel-container {
  padding: 0;
  border: var(--border-width) solid var(--black);
  display: flex;
}

.panel-left {
  flex: 1;
  background: var(--white);
  border-right: var(--border-width) solid var(--black);
  padding: 15px;
  align-items: flex-start;
  display: flex;
  flex-direction: column;
}

.panel-right {
  flex: 1;
  background: var(--red);
  padding: 15px;
  align-items: flex-start;
  display: flex;
  flex-direction: column;
}

/* Steps (colored panels in sequence) */
.steps {
  display: grid;
  gap: clamp(8px, 1.5vw, 12px);
}

.step {
  border: var(--border-width-thin) solid var(--black);
  padding: clamp(8px, 2vw, 16px);
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 12px);
  font-size: clamp(14px, 5vw, 1.8rem);
  font-weight: 700;
}

.step:nth-child(1) { background: var(--blue); color: #fff; }
.step:nth-child(2) { background: var(--yellow); color: #000; }
.step:nth-child(3) { background: var(--red); color: #fff; }
.step:nth-child(4) { background: var(--blue); color: #fff; }
.step:nth-child(5) { background: var(--yellow); }
.step:nth-child(6) { background: var(--red); color: #fff; }
.step:nth-child(7) { background: var(--white); color: #000; }

/* Panel Grid */
.panel-grid {
  display: grid;
  gap: clamp(8px, 2vw, 16px);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .panel-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .panel {
    font-size: clamp(20px, 2.5vw, 28px);
  }

  /* Restore negative margins on tablet+ */
  .panel--overlap-right,
  .panel-overlap-right {
    margin-right: -12px;
  }

  .panel--overlap-top,
  .panel-overlap-top {
    margin-top: -12px;
  }
}

@media (min-width: 1024px) {
  .panel-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1440px) {
  .panel-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 767px) {
  /* Reset panel heights on mobile */
  .panel--full,
  .panel-full,
  .panel-70,
  .panel-50,
  .panel-120 {
    height: auto !important;
    min-height: clamp(100px, 20vh, 200px);
  }

  /* Remove overlap margins on mobile */
  .panel--overlap-right,
  .panel-overlap-right,
  .panel--overlap-top,
  .panel-overlap-top {
    margin-right: 0 !important;
    margin-top: 0 !important;
  }

  /* Adjust panel heights on mobile */
  .panel[style*="height"] {
    height: auto !important;
    min-height: clamp(100px, 20vh, 200px) !important;
  }

  /* Fix margin issues on mobile */
  .panel[style*="margin-right: -12px"] {
    margin-right: 0 !important;
  }

  .panel[style*="margin-top: -12px"] {
    margin-top: 0 !important;
  }
}

/* ===== BASE STYLES ===== */

/* Base mobile-first styles */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg-primary) url('assets/halftone.png');
  font-family: var(--font-body);
  color: var(--fg-primary);
  overflow: hidden;
}

/* Override for landing and code pages */
body.landing-body,
body.code-page-body {
  overflow-y: auto !important;
  height: auto !important;
  min-height: 100vh;
  background: var(--beige) url('assets/halftone.png') !important;
}

html:has(.landing-body),
html:has(.code-page-body) {
  overflow-y: auto !important;
  height: auto !important;
}

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== TOOLBAR ===== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--white);
  border-bottom: 6px solid var(--black);
  position: relative;
  z-index: 5;
  flex-wrap: wrap;
}

.toolbar .brand {
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 0.5px;
  flex: 1 1 auto;
  min-width: 150px;
  line-height: 1.2;
}

.toolbar .spacer {
  flex: 1;
  display: none;
}

.toolbar .counter {
  font-size: 14px;
  white-space: nowrap;
  padding: 0 4px;
}

/* ===== VIEWPORT & SLIDES ===== */
.viewport {
  flex: 1;
  position: relative;
  padding: clamp(12px, 2vw, 24px);
  background: var(--bg-primary) url('assets/halftone.png');
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: clamp(12px, 2vw, 24px);
  background: var(--white);
  border: var(--comic-border-thick);
  box-shadow: var(--comic-shadow);
  padding: var(--padding-large);
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
}

.slide.active {
  display: flex;
  flex-direction: column;
  animation: pageFlip 350ms ease-out;
}

@keyframes pageFlip {
  from { transform: rotateY(-8deg) translateX(-10px); opacity: 0; }
  to { transform: rotateY(0) translateX(0); opacity: 1; }
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 {
  margin: 0 0 clamp(8px, 2vw, 12px) 0;
  line-height: var(--leading-tight);
  letter-spacing: 0.5px;
  word-wrap: break-word;
}

h1 {
  font-family: var(--font-display);
  font-size: var(--heading-1);
  color: var(--color-primary);
}

h1.fit {
  font-size: var(--heading-1-fit);
}

h2 {
  font-family: var(--font-heading);
  font-size: var(--heading-2);
}

h3 {
  font-family: var(--font-display);
  font-size: var(--heading-3);
  color: var(--color-primary);
}

p, li {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

/* ===== IMAGES ===== */
img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Logo images - horizontal row */
.logo {
  width: auto !important;
  height: clamp(60px, 12vh, 120px) !important;
  max-width: clamp(80px, 15vw, 150px) !important;
  object-fit: contain !important;
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Links containing panel content images should be centered */
a img.panel-content-img {
  display: block !important;
}

a:has(img.panel-content-img) {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  height: 100% !important;
}

/* Image sizing utilities */
.img-full-width {
  width: 100%;
  height: auto;
}

.img-half-width {
  width: clamp(200px, 50vw, 600px);
  height: auto;
}

.img-medium-width {
  width: clamp(180px, 40vw, 500px);
  height: auto;
}

.img-small-width {
  width: clamp(100px, 22vw, 300px);
  height: auto;
}

.img-tiny {
  width: clamp(40px, 2%, 80px);
  height: auto;
  margin-right: clamp(8px, 2vw, 22px);
}

.img-fixed-height-small {
  height: clamp(120px, 18vh, 200px);
  width: auto;
}

.img-fixed-height-medium {
  height: clamp(150px, 20vh, 250px);
  width: auto;
}

.img-fixed-height-large {
  height: clamp(200px, 30vh, 300px);
  width: auto;
}

.img-40vw {
  width: 40vw;
}

.img-contain {
  object-fit: contain;
}

.img-max-height-300 {
  max-height: 300px;
  object-fit: contain;
}

/* ===== FOOTER ===== */
.slide-footer {
  position: absolute;
  bottom: clamp(8px, 2vw, 16px);
  left: clamp(12px, 2vw, 24px);
  right: clamp(12px, 2vw, 24px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-family: var(--font-heading);
  font-size: clamp(12px, 2vw, 18px);
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.footer-left {
  text-align: left;
}

.footer-right {
  text-align: right;
  max-width: 60%;
}

.footer-brand {
  position: absolute;
  bottom: clamp(8px, 2vw, 16px);
  right: clamp(12px, 2vw, 24px);
  font-family: var(--font-heading);
  font-size: clamp(12px, 2vw, 18px);
  letter-spacing: 0.5px;
  opacity: 0.9;
  max-width: 60%;
  text-align: right;
}

.footer-shifted {
  margin-bottom: clamp(8px, 1.5vw, 12px);
  margin-right: clamp(16px, 3vw, 32px);
}

/* ===== BULLET LISTS ===== */
.bullet-list {
  list-style-type: disc;
  padding-left: clamp(1rem, 2vw, 1.5rem);
  margin: 0;
  width: 100%;
}

.bullet-list li {
  font-size: clamp(14px, 3vw, 2rem);
  font-family: var(--font-heading);
  line-height: 1.3;
  text-align: left;
  padding: clamp(0.2em, 0.5vw, 0.4em) 0;
  cursor: pointer;
  word-wrap: break-word;
  transition: all 0.2s ease;
  position: relative;
}

.bullet-list.has-modals li::after {
  content: ' →';
  opacity: 0.6;
  font-size: 0.8em;
  transition: opacity 0.2s ease;
}

.bullet-list.has-modals li:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.bullet-list.has-modals li:hover::after {
  opacity: 1;
}

.bullet-list li:active {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.bullet-list p {
  font-size: clamp(18px, 3.5vw, 2.5rem);
  margin: clamp(4px, 1vw, 8px) 0;
}

.bullet-list li.text-huge,
.bullet-list.text-huge li {
  font-size: clamp(28px, 8vw, 4rem) !important;
}

/* Extra left padding for specific sections */
section[aria-label="Interactive Session"] .bullet-list,
section[aria-label="What's Next?"] .bullet-list,
section[aria-label="How I Approach AI"] .bullet-list {
  padding-left: clamp(2rem, 4vw, 3rem) !important;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: clamp(10px, 2vw, 20px);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  border: var(--comic-border);
  box-shadow: var(--comic-shadow);
  width: 100%;
  max-width: 95vw;
  max-height: 95vh;
  overflow-y: auto;
  padding: clamp(12px, 2vw, 24px);
  position: relative;
}

.modal-content:has(iframe) {
  padding: 0;
  width: 95vw;
  height: 90vh;
  overflow: hidden;
}

.modal-content .close-button {
  position: absolute;
  top: clamp(8px, 1vw, 12px);
  right: clamp(8px, 1vw, 12px);
  background: var(--red);
  color: var(--white);
  border: clamp(2px, 0.5vw, 4px) solid var(--black);
  width: clamp(28px, 5vw, 32px);
  height: clamp(28px, 5vw, 32px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  font-family: var(--font-mono);
  z-index: 10;
  font-size: clamp(16px, 3vw, 20px);
}

.modal-content.split-view {
  padding: 0;
  width: 95vw;
  height: 90vh;
  overflow: hidden;
}

.split-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.split-pane {
  flex: 1;
  height: 50%;
  border: none;
  overflow: auto;
}

.split-pane + .split-pane {
  border-top: var(--comic-border);
}

.image-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(8px, 2vw, 16px);
  padding: clamp(8px, 2vw, 16px);
  background: var(--white);
  max-height: 80vh;
  overflow-y: auto;
}

.image-grid img {
  border: clamp(2px, 0.5vw, 4px) solid var(--black);
  border-radius: var(--radius-sm);
  box-shadow: clamp(2px, 0.5vw, 4px) clamp(2px, 0.5vw, 4px) 0 var(--black);
  width: 100%;
  height: auto;
}

.modal-content .media-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(8px, 2vw, 16px);
  margin-bottom: clamp(8px, 2vw, 16px);
}

.modal-content .media-container img,
.modal-content .media-container video {
  width: 100%;
  height: auto;
  border: clamp(2px, 0.5vw, 4px) solid var(--black);
}

.modal-content .spec-text {
  font-size: clamp(12px, 2vw, 14px);
  line-height: var(--leading-normal);
  font-family: var(--font-mono);
  white-space: pre-wrap;
  max-height: 40vh;
  overflow-y: auto;
  padding: clamp(8px, 1.5vw, 12px);
  border: 2px solid var(--gray);
  background: #f8f8f8;
}

.modal-img-constrained {
  max-height: 300px;
  object-fit: contain;
}

.modal-img-full {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-iframe-tall {
  width: 100%;
  height: 80vh;
}

.source-code {
  margin: 0;
  max-height: 70vh;
  overflow-y: auto;
  background: #2d2d2d;
  border-radius: 4px;
}

.source-code code {
  font-family: var(--font-mono);
  font-size: clamp(12px, 2vw, 14px);
  line-height: var(--leading-relaxed);
  padding: clamp(8px, 2vw, 16px);
}

/* ===== GRID LAYOUTS ===== */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(8px, 2vw, 16px);
}

.grid-2row {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: clamp(8px, 2vw, 16px);
  height: calc(100% - 120px);
}

.grid-full-height {
  height: calc(100% - 120px);
}

/* ===== UTILITY CLASSES ===== */

/* Typography */
.text-huge {
  font-size: clamp(24px, 7vw, 3rem);
}

.text-xlarge {
  font-size: clamp(20px, 4vw, 2.5rem);
}

.text-large {
  font-size: clamp(18px, 3.5vw, 2rem);
}

.text-small {
  font-size: clamp(12px, 2vw, 1rem);
}

.text-blue {
  color: var(--blue) !important;
}

.text-black {
  color: var(--black) !important;
}

.text-white {
  color: var(--white) !important;
}

/* Layout */
.mt-small {
  margin-top: clamp(8px, 2vw, 20px);
}

.mt-negative {
  margin-top: clamp(-32px, -3vw, -12px);
}

.mb-small {
  margin-bottom: clamp(8px, 1.5vw, 12px);
}

.mr-large {
  margin-right: clamp(16px, 3vw, 32px);
}

.pr-large {
  padding-right: clamp(16px, 3vw, 30px);
}

.center-flex,
.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.z-high {
  z-index: 1000;
}

/* List modifiers */
.list-compact {
  margin-top: clamp(-5px, -1vw, -5px);
}

.list-spaced {
  /* margin-top: clamp(10px, 2vw, 25px); */
}

/* Iframe utilities */
.iframe-full {
  width: 100%;
  height: 80vh;
  border: 0;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Small mobile adjustments */
@media (max-width: 479px) {
  .toolbar {
    padding: 6px 8px;
  }

  .toolbar .brand {
    font-size: 12px;
    min-width: 100%;
    margin-bottom: 4px;
  }

  .toolbar .counter {
    font-size: 12px;
  }
}

/* Tablet breakpoint */
@media (min-width: 768px) {
  .toolbar {
    flex-wrap: nowrap;
    padding: 10px 16px;
    border-bottom-width: 8px;
    gap: 10px;
  }

  .toolbar .brand {
    font-size: 18px;
    min-width: auto;
    margin-bottom: 0;
  }

  .toolbar .counter {
    font-size: 16px;
  }

  .toolbar .spacer {
    display: block;
  }

  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-content .media-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .split-container {
    flex-direction: row;
  }

  .split-pane {
    height: 100%;
  }

  .split-pane + .split-pane {
    border-top: none;
    border-left: var(--comic-border);
  }

  .grid-2col {
    grid-template-columns: 1fr 1fr;
  }
}

/* Desktop breakpoint */
@media (min-width: 1024px) {
  .toolbar {
    padding: 10px 20px;
    gap: 12px;
  }

  .toolbar .brand {
    font-size: 20px;
  }

  .toolbar .counter {
    font-size: 16px;
  }

  .image-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .bullet-list li {
    font-size: clamp(20px, 2.5vw, 2rem);
  }
}

/* Large desktop breakpoint */
@media (min-width: 1440px) {
  .toolbar {
    padding: 12px 24px;
  }

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

  .toolbar .counter {
    font-size: 18px;
  }
}

/* Mobile overrides */
@media (max-width: 767px) {
  .slide > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .slide > div > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .grid-2row {
    grid-template-rows: auto auto;
    height: auto;
  }

  .grid-full-height {
    height: auto;
  }

  .text-huge {
    font-size: clamp(28px, 6vw, 48px);
  }

  .text-xlarge {
    font-size: clamp(18px, 3.5vw, 2rem);
  }

  .text-large {
    font-size: clamp(16px, 3vw, 1.8rem);
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .toolbar {
    display: none;
  }

  .slide {
    position: static;
    page-break-after: always;
    border: 2px solid var(--black);
    box-shadow: none;
  }
}

/* ===== DARK THEME ===== */
.noir {
  --bg-primary: #111111;
  --bg-secondary: #222222;
  --fg-primary: #FFFFFF;
  --accent: var(--noir-accent);
}

.noir .viewport {
  background: var(--bg-primary) url('assets/halftone.png');
}

.noir .slide {
  background: #ffffff;
}

.noir .toolbar {
  background: #000;
  color: #fff;
  border-bottom-color: #fff;
}

.noir .toolbar button {
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 #fff;
  border-color: #fff;
}

.noir .panel {
  background: #000;
  color: #fff;
  border-color: #fff;
}

.noir .label,
.noir .step {
  border-color: #000;
}

/* ===== OVERFLOW CONTROL ===== */
body {
  overflow: hidden;
}

.app {
  overflow: hidden;
}

.viewport {
  overflow: hidden;
}

.slide {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== SPECIAL HANDLING FOR COMPLEX LAYOUTS ===== */
.slide > div[style*="grid"] {
  display: grid !important;
  gap: clamp(8px, 2vw, 16px);
  height: auto !important;
  margin: clamp(8px, 2vw, 20px) 0;
}
