/* ===================================
   iw.fyi Slides MVP - Styles
   =================================== */

/* ===================================
   1. Font Declarations
   =================================== */

/* Atkinson Hyperlegible Next - Variable font (200-800) */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../fonts/AtkinsonHyperlegibleNext.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../fonts/AtkinsonHyperlegibleNextItalic.woff2') format('woff2');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

/* Literata - Bold for headings */
@font-face {
  font-family: 'Literata';
  src: url('../fonts/Literata700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Literata';
  src: url('../fonts/LiterataItalic700.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* Playfair Display SC - Numbers */
@font-face {
  font-family: 'Playfair Display SC';
  src: url('../fonts/PlayfairDisplaySC700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ===================================
   2. CSS Custom Properties (Design Tokens)
   =================================== */

:root {
  /* ===================================
     Base Palette (Inbox Welcome colors)
     =================================== */
  /* Brand */
  --iw-red: #CC0025;
  --iw-red-heading: #B30020;

  /* Neutrals */
  --iw-cream: #FFF9E9;
  --iw-honeydew: #BFD7C2;

  --gray-900: #1A1A1A;
  --gray-800: #3D3D3D;
  --gray-800-alpha: #3D3D3DCB;

  /* Links */
  --link-green: #2F4B32;
  --link-green-hover: #3C5E3D;

  /* ===================================
     Light Mode (Default) - Semantic Tokens
     =================================== */

  /* Frame (chrome outside slides) */
  --frame-bg: var(--iw-cream);
  --frame-text: var(--gray-900);
  --frame-text-muted: rgba(61, 61, 61, 0.4);
  --frame-border: rgba(0, 0, 0, 0.04);

  /* Neutral slides (explainer, CTA) */
  --slide-bg: #FFFFFF;
  --slide-text: var(--gray-900);
  --slide-text-muted: rgba(61, 61, 61, 0.7);
  --slide-border: rgba(0, 0, 0, 0.08);

  /* Mistake slides (red backgrounds) */
  --slide-mistake-bg: var(--iw-red-heading);
  --slide-mistake-text: #FFF9E9;

  /* Consequence slides (same as mistake slides - red backgrounds) */
  --slide-consequence-bg: var(--iw-red-heading);
  --slide-consequence-text: #FFF9E9;

  /* Links */
  --link-color: var(--link-green);
  --link-hover: var(--link-green-hover);

  /* Buttons */
  --button-bg: var(--link-green);
  --button-text: #FFF9E9;
  --button-bg-hover: var(--link-green-hover);

  /* UI elements */
  --heading-color: var(--iw-red-heading);
  --accent-primary: var(--iw-red);
  --divider-color: rgba(0, 0, 0, 0.08);
  --overlay-bg: rgba(26, 26, 26, 0.6);

  /* Legacy compatibility - map old names to semantic tokens */
  --page-bg: var(--frame-bg); /* Alias for frame background */
  --text-primary: var(--slide-text); /* Alias for slide text */
  --text-secondary: var(--slide-text-muted); /* Alias for muted text */
  --color-page-bg: var(--frame-bg);
  --color-card-bg: var(--slide-bg);
  --color-accent-primary: var(--accent-primary);
  --color-text-primary: var(--slide-text);
  --color-text-secondary: var(--slide-text-muted);
  --color-overlay-backdrop: var(--overlay-bg);
  --color-error: #EF4444;

  /* Typography */
  --font-body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-heading: 'Literata', Georgia, 'Times New Roman', serif;
  --font-number: 'Playfair Display SC', Georgia, serif;

  /* Font Sizes (mobile-first) */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */
  --text-huge: 7rem;       /* 112px - mistake numbers on mobile */
  --mistake-number-desktop-size: clamp(14rem, 38vh, 24rem);
  --mistake-number-desktop-line-height: 0.78;
  --mistake-desktop-gap: clamp(2.5rem, 5vw, 4.5rem);
  --mistake-content-max-width: 42rem;

  /* Layout */
  --header-height: 60px;
  --slide-max-width: 1200px;
  --slide-padding: 3rem;

  /* Spacing scale */
  --space-xs: 0.25rem;     /* 4px */
  --space-sm: 0.5rem;      /* 8px */
  --space-md: 1rem;        /* 16px */
  --space-lg: 1.5rem;      /* 24px */
  --space-xl: 2rem;        /* 32px */
  --space-2xl: 3rem;       /* 48px */
  --space-3xl: 4rem;       /* 64px */

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Z-index scale */
  --z-base: 1;
  --z-header: 100;
  --z-gate-backdrop: 999;
  --z-gate: 1000;

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ===================================
   Dark Mode
   Frame switches to dark, neutral slides switch to dark neutral,
   mistake/consequence slides remain unchanged
   =================================== */
@media (prefers-color-scheme: dark) {
  :root {
    /* Frame - switch to dark */
    --frame-bg: var(--gray-900);
    --frame-text: rgba(255, 255, 255, 0.95);
    --frame-text-muted: rgba(255, 255, 255, 0.25);
    --frame-border: rgba(255, 255, 255, 0.06);

    /* Neutral slides - switch to dark neutral */
    --slide-bg: #2A2A2A;
    --slide-text: rgba(255, 255, 255, 0.95);
    --slide-text-muted: rgba(255, 255, 255, 0.6);
    --slide-border: rgba(255, 255, 255, 0.08);

    /* Mistake slides - UNCHANGED (stay red with cream text) */
    /* --slide-mistake-bg: unchanged */
    /* --slide-mistake-text: unchanged */

    /* Consequence slides - UNCHANGED (stay red with cream text, same as mistake) */
    /* --slide-consequence-bg: unchanged */
    /* --slide-consequence-text: unchanged */

    /* Links - adjust for dark backgrounds */
    --link-color: #7FB884;
    --link-hover: #9FCAA4;

    /* Buttons - adjust for dark backgrounds */
    --button-bg: #3C5E3D;
    --button-text: rgba(255, 255, 255, 0.95);
    --button-bg-hover: #4A7047;

    /* UI elements */
    --heading-color: #E8475C;
    --accent-primary: #E8475C;
    --divider-color: rgba(255, 255, 255, 0.08);
    --overlay-bg: rgba(26, 26, 26, 0.85);
  }
}

/* Tablet breakpoint */
@media (min-width: 768px) {
  :root {
    --text-huge: 14rem;
    --slide-padding: 4.5rem;
  }
}

/* Laptop breakpoint */
@media (min-width: 1024px) {
  :root {
    --slide-padding: 5.5rem;
  }
}

/* Large desktop breakpoint */
@media (min-width: 1440px) {
  :root {
    --slide-padding: 6.5rem;
  }
}

/* ===================================
   3. CSS Reset
   =================================== */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  height: 100%;
  overflow: hidden; /* Swiper handles scrolling */
  background: var(--frame-bg);
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

/* ===================================
   4. Base Typography
   =================================== */

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.65;
  color: var(--slide-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Heading scale */
h1, h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--space-lg);
  color: var(--heading-color);
}

h1 {
  font-size: var(--text-5xl);
}

h2 {
  font-size: var(--text-4xl);
}

h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 var(--space-md);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

h5, h6 {
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 var(--space-sm);
}

h5 {
  font-size: var(--text-lg);
}

h6 {
  font-size: var(--text-base);
}

/* Large number class for mistake slides */
.mistake-number {
  font-family: var(--font-number);
  font-size: var(--text-huge);
  font-weight: 700;
  line-height: 0.85;
  color: var(--accent-primary);
  margin: 0;
  display: block;
}

/* Paragraph spacing */
p:not(:last-child) {
  margin-bottom: var(--space-md);
}

/* Lists */
ul, ol {
  padding-left: var(--space-xl);
  margin-bottom: var(--space-lg);
}

li {
  margin-bottom: var(--space-sm);
}

/* Links */
a {
  color: var(--link-color);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--link-hover);
}

/* Bold and italic */
strong, b {
  font-weight: 700;
}

em, i {
  font-style: italic;
}

/* Tablet typography scaling */
@media (min-width: 768px) {
  body {
    font-size: 1.125rem; /* 18px */
  }

  h1 {
    font-size: 1.75rem; /* 28px */
  }

  h2 {
    font-size: 1.5rem; /* 24px */
  }
}

/* Laptop typography scaling */
@media (min-width: 1024px) {
  body {
    font-size: 1.25rem; /* 20px - matches Google Slides */
  }

  h1 {
    font-size: 2rem; /* 32px */
  }

  h2 {
    font-size: 1.75rem; /* 28px */
  }
}

/* Large desktop typography scaling */
@media (min-width: 1440px) {
  body {
    font-size: 1.375rem; /* 22px */
  }

  h1 {
    font-size: 2.25rem; /* 36px */
  }

  h2 {
    font-size: 2rem; /* 32px */
  }
}

/* ===================================
   5. Layout Components
   =================================== */

#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--frame-bg);
  border-bottom: 1px solid var(--frame-border);
  z-index: var(--z-header);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  height: 100%;
  padding: 0 var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
  justify-content: space-between;
}

.header__logo {
  flex-shrink: 0;
}

.logo-mark {
  height: 32px;
  width: auto;
  display: none; /* Hide on mobile */
}

/* Show only favicon on mobile */
.header__logo {
  width: 32px;
  height: 32px;
  background-image: url('../favicon.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  text-decoration: none;
  flex-shrink: 0;
}

/* Show full logo on tablet and up */
@media (min-width: 768px) {
  .logo-mark {
    display: block;
  }

  .header__logo {
    width: auto;
    background-image: none;
  }

  .header__inner {
    gap: var(--space-2xl);
  }
}

/* Desktop: increase spacing even more */
@media (min-width: 1024px) {
  .header__inner {
    gap: var(--space-3xl);
  }
}

.header__title {
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--frame-text);
  white-space: normal; /* Allow wrapping on mobile */
  line-height: 1.3;
  margin: 0;
  flex: 0 1 auto; /* Don't grow, but can shrink */
}

@media (min-width: 768px) {
  .header__title {
    font-size: var(--text-xl);
    white-space: nowrap; /* No wrapping on tablet and up */
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Main container */
.main {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

/* Swiper container */
.swiper {
  width: 100%;
  height: 100%;
}

.swiper-wrapper {
  height: 100%;
}

.swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg) var(--space-lg) var(--space-md) var(--space-lg);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Tablet padding */
@media (min-width: 768px) {
  .swiper-slide {
    padding: var(--space-2xl) var(--space-2xl) var(--space-lg) var(--space-2xl);
  }

  .slide__card {
    padding: 3rem 2.5rem;
  }
}

/* Laptop padding */
@media (min-width: 1024px) {
  .slide__card {
    padding: 4rem 3.5rem;
  }

  /* Reduce top/bottom padding for explainer slides */
  .slide--explainer .slide__card {
    padding: 1.5rem 3.5rem;
  }
}

/* Large desktop padding */
@media (min-width: 1440px) {
  .slide__card {
    padding: 5rem 4.5rem;
  }

  /* Reduce top/bottom padding for explainer slides */
  .slide--explainer .slide__card {
    padding: 2rem 4.5rem;
  }
}

/* Swiper pagination */
.swiper-pagination {
  bottom: var(--space-sm) !important; /* Closer to bottom */
}

.swiper-pagination-bullet {
  background: var(--frame-text-muted);
  opacity: 1;
}

.swiper-pagination-bullet-active {
  background: var(--frame-text);
  opacity: 0.6;
}

/* Navigation arrows - hidden on mobile, visible on tablet+ */
.swiper-button-prev,
.swiper-button-next {
  display: none; /* Hidden on mobile */
  color: var(--frame-text);
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
  opacity: 1;
}

@media (min-width: 768px) {
  .swiper-button-prev,
  .swiper-button-next {
    display: flex; /* Show on tablet and up */
  }

  .swiper-button-prev {
    left: 2vw;
  }

  .swiper-button-next {
    right: 2vw;
  }
}

/* ===================================
   6. Slide Card System
   =================================== */

.slide__card {
  width: 100%;
  max-width: var(--slide-max-width);
  min-height: 520px;
  background: var(--slide-bg);
  color: var(--slide-text);
  border-radius: var(--radius-md);
  border: 1px solid var(--slide-border);
  overflow: hidden;
}

.slide__content {
  padding: var(--slide-padding);
}

.slide__content--scrollable {
  max-height: calc(100vh - var(--header-height) - 4rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.slide__content--centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  min-height: 400px;
}

@media (min-width: 768px) {
  .slide__card {
    border-radius: var(--radius-lg);
  }
}

@media (min-width: 1024px) {
  .slide__card {
    min-height: 600px;
  }
}

/* ===================================
   7. Slide Type Variants
   =================================== */

/* Mistake slide - Grid layout with giant number */
.slide--mistake .slide__card {
  background: var(--slide-mistake-bg);
  color: var(--slide-mistake-text);
}

.slide--mistake .slide__content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  align-items: start; /* Mobile: top-aligned for compact layout */
}

.slide--mistake .mistake__number-wrapper {
  /* Mobile: small number in top left */
}

.slide--mistake .mistake-number {
  color: var(--slide-mistake-text);
  font-size: 5rem; /* Small on mobile to fit without scrolling */
  line-height: 0.85;
  transform: translateY(-0.05em);
}

.slide--mistake .mistake__content {
  /* Content column */
}

.slide--mistake .mistake__title {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: var(--space-lg);
  color: var(--slide-mistake-text);
  font-weight: 700;
  margin-top: 0;
}

.slide--mistake .mistake__description {
  font-size: var(--text-2xl);
  line-height: 1.6;
  color: var(--slide-mistake-text);
  font-weight: 400;
}

.slide--mistake .mistake__description p:not(:last-child) {
  margin-bottom: var(--space-lg);
}

/* Tablet: Two-column grid */
@media (min-width: 768px) {
  .slide--mistake .slide__content {
    grid-template-columns: auto 1fr;
    gap: var(--space-3xl);
    align-items: center; /* Center on larger screens */
  }

  .slide--mistake .mistake-number {
    font-size: 12rem; /* Moderate size for tablet */
  }

  .slide--mistake .mistake__title {
    font-size: 2.5rem;
  }

  .slide--mistake .mistake__description {
    font-size: var(--text-xl);
  }
}

/* Desktop: Larger number, wider gap, larger text */
@media (min-width: 1024px) {
  .slide--mistake .slide__content {
    gap: var(--mistake-desktop-gap);
  }

  .slide--mistake .mistake-number {
    font-size: clamp(14rem, 20vh, 18rem); /* Controlled size range */
    line-height: 0.85;
  }

  .slide--mistake .mistake__content {
    max-width: var(--mistake-content-max-width);
  }

  .slide--mistake .mistake__title {
    font-size: 2.75rem; /* Slightly larger on desktop */
    line-height: 1.15;
    margin-bottom: var(--space-lg);
  }

  .slide--mistake .mistake__description {
    max-width: 50ch;
    font-size: var(--text-xl);
  }
}

/* Consequence slide - Same grid layout, no number */
.slide--consequence .slide__card {
  background: var(--slide-consequence-bg);
  color: var(--slide-consequence-text);
}

.slide--consequence .slide__content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: start; /* Critical: no centering */
}

.slide--consequence .consequence__content {
  /* Single column content */
}

.slide--consequence .consequence__title {
  font-size: var(--text-4xl);
  line-height: 1.2;
  margin-bottom: var(--space-xl);
  color: var(--slide-consequence-text);
  font-weight: 700;
  margin-top: 0;
}

.slide--consequence .consequence__description {
  font-size: var(--text-2xl);
  line-height: 1.6;
  color: var(--slide-consequence-text);
  font-weight: 400;
}

.slide--consequence .consequence__description p:not(:last-child) {
  margin-bottom: var(--space-lg);
}

/* Tablet: Maintain rhythm with mistake slide */
@media (min-width: 768px) {
  .slide--consequence .slide__content {
    /* Keep same gap as mistake for visual continuity */
    grid-template-columns: auto 1fr;
    gap: var(--space-3xl);
  }

  /* First column is empty (where number would be) to maintain alignment */
  .slide--consequence .slide__content::before {
    content: '';
    display: block;
    width: 0;
  }

  .slide--consequence .consequence__title {
    font-size: var(--text-4xl);
  }

  .slide--consequence .consequence__description {
    font-size: var(--text-2xl);
  }
}

/* Desktop: Match mistake slide spacing */
@media (min-width: 1024px) {
  .slide--consequence .slide__content {
    gap: var(--mistake-desktop-gap);
  }

  .slide--consequence .consequence__content {
    max-width: var(--mistake-content-max-width);
  }

  .slide--consequence .consequence__title {
    font-size: var(--text-5xl);
    line-height: 1.1;
    margin-bottom: var(--space-lg);
  }

  .slide--consequence .consequence__description {
    max-width: 50ch;
    font-size: var(--text-3xl);
  }
}

/* Explainer slide */
.slide--explainer .explainer__title {
  margin-bottom: var(--space-2xl);
}

.slide--explainer .explainer__body {
  font-size: var(--text-2xl);
  line-height: 1.75;
  max-width: 60ch;
}

.slide--explainer .explainer__body p,
.slide--explainer .explainer__body ul,
.slide--explainer .explainer__body ol {
  margin-bottom: var(--space-xl);
}

.slide--explainer .explainer__body ul,
.slide--explainer .explainer__body ol {
  padding-left: 0; /* Flush with left text edge */
  list-style-position: outside;
  margin-left: 1.5em; /* Space for bullets */
}

.slide--explainer .explainer__body li {
  margin-bottom: var(--space-md);
}

.slide--explainer .explainer__body strong {
  font-weight: 700;
  color: var(--slide-text);
}

.slide--explainer .explainer__body em {
  font-style: italic;
}

.slide--explainer .explainer__body a {
  color: var(--link-color);
  text-decoration: underline;
}

.slide--explainer .explainer__body a:hover {
  color: var(--link-hover);
  text-decoration: none;
}

/* Task list items (GitHub Flavored Markdown) - Illustrative only, works across all slide types */

/* Remove list styling from parent <ul> containing checkboxes */
ul:has(> li > input[type="checkbox"]) {
  list-style: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

/* Target list items that contain checkboxes */
li:has(> input[type="checkbox"]) {
  list-style: none !important;
  display: grid !important;
  grid-template-columns: 1.25rem 1fr !important;
  column-gap: 1rem !important;
  align-items: start !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* Hide the actual checkbox input (purely illustrative presentation) */
li > input[type="checkbox"] {
  display: none !important;
}

/* Illustrative square marker via ::before */
li:has(> input[type="checkbox"])::before {
  content: "" !important;
  width: 1.15rem !important;
  height: 1.15rem !important;
  margin-top: 0.2em !important; /* Optical baseline nudge for first-line alignment */
  border: 2px solid currentColor !important;
  opacity: 0.35 !important;
  border-radius: 0.2rem !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

/* Regular list items (non-task-list) - restore bullets */
.slide--explainer .explainer__body ul li:not(.task-list-item) {
  list-style: disc;
  margin-left: 0;
}

/* CTA slide */
.slide--cta .slide__content--centered {
  /* Override centered layout for editorial feel */
  align-items: flex-start;
  text-align: left;
  justify-content: flex-start;
}

.slide--cta .cta__title {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-xl);
}

.slide--cta .cta__description {
  font-size: var(--text-2xl); /* Match explainer body size */
  line-height: 1.75; /* Match explainer line-height */
  color: var(--slide-text-muted);
  font-weight: 400; /* Normal weight for all text */
  margin-bottom: var(--space-3xl);
  max-width: 60ch; /* Match explainer max-width */
}

.slide--cta .cta__description p:not(:last-child) {
  margin-bottom: var(--space-lg);
}

/* Ensure strong/bold tags in CTA also use weight 400 */
.slide--cta .cta__description strong,
.slide--cta .cta__description b {
  font-weight: 400;
}

.slide--cta .cta__button {
  display: inline-block;
  padding: var(--space-md) var(--space-2xl);
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 600;
  font-size: var(--text-base);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.slide--cta .cta__button:hover {
  background: var(--button-bg-hover);
  transform: translateY(-1px);
}

.slide--cta .cta__button:active {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .slide--cta .cta__title {
    font-size: var(--text-5xl);
  }

  .slide--cta .cta__description {
    font-size: var(--text-2xl); /* Maintain larger size on tablet+ */
  }

  .slide--cta .cta__button {
    font-size: 1.125rem; /* Match tablet body text */
  }
}

@media (min-width: 1024px) {
  .slide--cta .slide__card {
    padding: 3rem 3.5rem; /* Reduced top/bottom padding */
  }

  .slide--cta .cta__description {
    font-size: var(--text-3xl); /* Even larger on desktop */
  }

  .slide--cta .cta__button {
    font-size: 1.25rem; /* Match laptop body text */
  }
}

@media (min-width: 1440px) {
  .slide--cta .slide__card {
    padding: 3.5rem 4.5rem; /* Reduced top/bottom padding */
  }

  .slide--cta .cta__button {
    font-size: 1.375rem; /* Match large desktop body text */
  }
}

/* ===================================
   8. Content Components
   =================================== */

/* Illustrative Checklist - Non-interactive typographic element */
.checklist {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: grid;
  row-gap: 1rem;
}

.checklist li {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  column-gap: 1rem;
  align-items: start; /* First-line alignment, not vertical center */
  font-size: var(--text-lg);
  line-height: 1.45;
}

.checklist li::before {
  content: "";
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15em; /* Optical baseline nudge for first-line alignment */
  border: 2px solid var(--slide-border);
  border-radius: 0.25rem;
  box-sizing: border-box;
}

/* ===================================
   9. Gate Overlay
   =================================== */

.gate-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-gate);
  display: none;
}

.gate-overlay[aria-hidden="false"] {
  display: block;
}

.gate-overlay__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-bg);
  z-index: var(--z-gate-backdrop);
}

.gate-overlay__card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 500px;
  background: var(--slide-bg);
  color: var(--slide-text);
  border-radius: var(--radius-md);
  padding: var(--space-2xl);
  z-index: var(--z-gate);
  box-shadow: var(--shadow-xl);
}

.gate-overlay__content {
  position: relative;
}

.gate-overlay h2 {
  margin-bottom: var(--space-md);
}

.gate-overlay__description {
  font-size: var(--text-lg);
  color: var(--slide-text-muted);
  margin-bottom: var(--space-xl);
}

.gate-overlay__close {
  position: absolute;
  top: calc(-1 * var(--space-md));
  right: calc(-1 * var(--space-md));
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slide-text-muted);
  font-size: var(--text-2xl);
  line-height: 1;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

.gate-overlay__close:hover {
  background: var(--slide-border);
}

@media (min-width: 768px) {
  .gate-overlay__card {
    border-radius: var(--radius-lg);
    padding: var(--space-3xl);
  }
}

/* Encharge form styling */
#encharge-form-container {
  margin-top: var(--space-lg);
}

.encharge-form__input {
  width: 100%;
  padding: var(--space-md);
  font-size: var(--text-base);
  background: var(--slide-bg);
  color: var(--slide-text);
  border: 2px solid var(--slide-border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  transition: border-color var(--transition-fast);
}

.encharge-form__input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.encharge-form__submit {
  width: 100%;
  padding: var(--space-md) var(--space-xl);
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 600;
  font-size: var(--text-base);
  border-radius: var(--radius-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.encharge-form__submit:hover {
  transform: translateY(-1px);
  background: var(--button-bg-hover);
}

.encharge-form__submit:active {
  transform: translateY(0);
}

.encharge-form__checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  cursor: pointer;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--slide-text);
}

.encharge-form__checkbox {
  margin-top: 0.25rem;
  cursor: pointer;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.encharge-form__checkbox-label:hover {
  opacity: 0.8;
}

.encharge-form__error {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.encharge-form__success {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.encharge-form__success strong {
  display: block;
  font-size: var(--text-base);
  margin-bottom: var(--space-xs);
}

.encharge-form__success p {
  margin: 0;
}

/* ===================================
   10. Loading & Error States
   =================================== */

.loading-state,
.error-state {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--frame-text);
  text-align: center;
  padding: var(--space-xl);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--frame-text-muted);
  border-top-color: var(--accent-primary);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
  margin-bottom: var(--space-lg);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state p {
  color: var(--frame-text-muted);
  font-size: var(--text-lg);
}

.error-state h2 {
  color: var(--heading-color);
  margin-bottom: var(--space-md);
}

.error-state p {
  color: var(--frame-text-muted);
  font-size: var(--text-lg);
}

/* Note: Mistake and consequence slides both use red backgrounds with cream text
   in both light and dark modes, maintaining high contrast and visual continuity */

/* ===================================
   11. Utility Classes
   =================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===================================
   12. Accessibility
   =================================== */

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .slide__card {
    border: 2px solid var(--slide-text);
  }

  .cta__button,
  .encharge-form__submit {
    border: 2px solid var(--button-text);
  }
}
