/* ========================================
   75 Medium Challenge - Design System
   Modern, Performance-Optimized CSS
   ======================================== */

/* ----------------------------------------
   CSS Custom Properties (Design Tokens)
   ---------------------------------------- */
:root {
  /* Color Palette */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.1);
  --secondary: #8b5cf6;
  --secondary-hover: #7c3aed;
  --accent: #06b6d4;
  --accent-hover: #0891b2;

  /* Neutrals */
  --background: #0f172a;
  --background-alt: #020617;
  --surface: #1e293b;
  --surface-elevated: #334155;
  --border: #334155;
  --border-light: rgba(148, 163, 184, 0.1);

  /* Text */
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  /* Semantic Colors */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  --gradient-dark: linear-gradient(180deg, var(--background) 0%, var(--background-alt) 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);

  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Typography Scale (1.25 ratio) */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.563rem;
  --text-3xl: 1.953rem;
  --text-4xl: 2.441rem;
  --text-5xl: 3.052rem;
  --text-6xl: 3.815rem;

  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* Font Families */
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Fira Code', Consolas, Monaco, 'Andale Mono', monospace;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --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 -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
  --shadow-glow-accent: 0 0 20px rgba(6, 182, 212, 0.3);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-tooltip: 600;

  /* Container */
  --container-max: 1200px;
  --container-narrow: 800px;
  --container-wide: 1400px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text);
  background: var(--gradient-dark);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ----------------------------------------
   Typography
   ---------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text);
  margin-bottom: var(--space-md);
}

h1 {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(var(--text-xl), 3vw, var(--text-3xl));
}

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

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

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

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

strong,
b {
  font-weight: 600;
  color: var(--text);
}

em,
i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
}

/* ----------------------------------------
   Layout Components
   ---------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: var(--container-wide);
}

.section {
  padding: var(--space-4xl) 0;
}

.section--alt {
  background: var(--surface);
}

/* ----------------------------------------
   Header & Navigation
   ---------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: transform var(--transition-base), background var(--transition-base);
}

.header--hidden {
  transform: translateY(-100%);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.header__logo:hover {
  color: var(--text);
  text-decoration: none;
}

.header__logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--text-lg);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav__list {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
}

.nav__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  padding: var(--space-sm) 0;
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width var(--transition-base);
}

.nav__link:hover,
.nav__link--active {
  color: var(--text);
  text-decoration: none;
}

.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
}

/* Mobile Menu Toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav__toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

/* ----------------------------------------
   Hero Section
   ---------------------------------------- */
.hero {
  padding: calc(72px + var(--space-4xl)) 0 var(--space-4xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150%;
  height: 100%;
  background: radial-gradient(ellipse at center top, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--primary);
  margin-bottom: var(--space-lg);
}

.hero__title {
  max-width: 900px;
  margin: 0 auto var(--space-lg);
}

.hero__title span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__description {
  font-size: var(--text-lg);
  max-width: 700px;
  margin: 0 auto var(--space-2xl);
  color: var(--text-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
}

/* ----------------------------------------
   Buttons
   ---------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md), 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn--primary:hover {
  box-shadow: var(--shadow-lg), 0 6px 20px rgba(99, 102, 241, 0.5);
  color: white;
}

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  background: var(--surface-elevated);
  border-color: var(--text-muted);
  color: var(--text);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn--ghost:hover {
  color: var(--text);
  background: var(--surface);
}

.btn--sm {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-sm);
}

.btn--lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--text-lg);
}

/* ----------------------------------------
   Cards
   ---------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.card--glass {
  background: var(--gradient-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card__icon {
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  margin-bottom: var(--space-md);
}

.card__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
}

.card__description {
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Card Grid */
.card-grid {
  display: grid;
  gap: var(--space-xl);
}

.card-grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card-grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card-grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ----------------------------------------
   Article Content
   ---------------------------------------- */
.article {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: calc(72px + var(--space-3xl)) var(--space-lg) var(--space-4xl);
}

.article__header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.article__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-lg);
}

.article__content h2 {
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.article__content h3 {
  margin-top: var(--space-2xl);
}

.article__content p {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

.article__content ul,
.article__content ol {
  margin: var(--space-lg) 0;
  padding-left: var(--space-xl);
  color: var(--text-secondary);
}

.article__content li {
  margin-bottom: var(--space-sm);
  line-height: var(--leading-relaxed);
}

.article__content blockquote {
  margin: var(--space-2xl) 0;
  padding: var(--space-xl);
  background: var(--surface);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--text-secondary);
}

.article__content img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
  margin: var(--space-2xl) 0;
}

.article__content code {
  font-family: var(--font-mono);
  background: var(--surface);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.article__content pre {
  background: var(--surface);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: var(--space-xl) 0;
}

.article__content pre code {
  background: none;
  padding: 0;
}

/* ----------------------------------------
   Table of Contents
   ---------------------------------------- */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.toc__details {
  margin: 0;
}

.toc__details summary {
  list-style: none;
}

.toc__details summary::-webkit-details-marker {
  display: none;
}

.toc__title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  cursor: pointer;
  padding: var(--space-sm) 0;
  user-select: none;
  color: var(--text);
}

.toc__title::after {
  content: '▶';
  font-size: var(--text-xs);
  transition: transform var(--transition-fast);
  color: var(--text-muted);
}

.toc__details[open] .toc__title {
  margin-bottom: var(--space-md);
}

.toc__details[open] .toc__title::after {
  transform: rotate(90deg);
}

.toc__title:hover {
  color: var(--accent);
}

.toc__title:hover::after {
  color: var(--accent);
}

.toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

.toc__link {
  color: var(--text-muted);
  font-size: var(--text-sm);
  display: block;
  padding: var(--space-xs) 0;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
}

.toc__link:hover {
  color: var(--accent);
  padding-left: var(--space-sm);
  text-decoration: none;
}

.toc__link--h3 {
  padding-left: var(--space-lg);
}

/* ----------------------------------------
   Tables
   ---------------------------------------- */
.table-wrapper {
  overflow-x: auto;
  margin: var(--space-xl) 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

th,
td {
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface);
  font-weight: 600;
  color: var(--text);
}

tr:hover td {
  background: rgba(99, 102, 241, 0.05);
}

/* ----------------------------------------
   Highlight Box
   ---------------------------------------- */
.highlight {
  background: var(--gradient-glass);
  border: 1px solid var(--primary);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin: var(--space-2xl) 0;
}

.highlight--success {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.highlight--warning {
  border-color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
}

.highlight--info {
  border-color: var(--info);
  background: rgba(59, 130, 246, 0.1);
}

.highlight__title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ----------------------------------------
   Footer
   ---------------------------------------- */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-4xl) 0 var(--space-xl);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}

.footer__brand {
  max-width: 300px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  margin-bottom: var(--space-md);
}

.footer__description {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.footer__heading {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.footer__links {
  list-style: none;
}

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

.footer__links a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

.footer__links a:hover {
  color: var(--accent);
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ----------------------------------------
   Back to Top Button
   ---------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-base);
  z-index: var(--z-fixed);
}

.back-to-top--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl), 0 0 30px rgba(99, 102, 241, 0.5);
}

/* ----------------------------------------
   Scroll Progress Indicator
   ---------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient-primary);
  z-index: calc(var(--z-fixed) + 1);
  transition: width 50ms linear;
}

/* ----------------------------------------
   Animations
   ---------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-in {
  animation: fadeIn 0.4s ease forwards;
}

/* ----------------------------------------
   Utility Classes
   ---------------------------------------- */
.text-center {
  text-align: center;
}

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

.text-right {
  text-align: right;
}

.text-primary {
  color: var(--primary);
}

.text-accent {
  color: var(--accent);
}

.text-muted {
  color: var(--text-muted);
}

.mt-0 {
  margin-top: 0;
}

.mt-md {
  margin-top: var(--space-md);
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mt-xl {
  margin-top: var(--space-xl);
}

.mt-2xl {
  margin-top: var(--space-2xl);
}

.mb-0 {
  margin-bottom: 0;
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.mb-xl {
  margin-bottom: var(--space-xl);
}

.mb-2xl {
  margin-bottom: var(--space-2xl);
}

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

/* ----------------------------------------
   Responsive Design
   ---------------------------------------- */
@media (max-width: 1024px) {
  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --space-4xl: 4rem;
  }

  .nav__list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
  }

  .nav__list--open {
    display: flex;
  }

  .nav__toggle {
    display: flex;
  }

  .hero {
    padding: calc(72px + var(--space-2xl)) 0 var(--space-2xl);
  }

  .hero__actions {
    flex-direction: column;
    align-items: center;
  }

  .hero__actions .btn {
    width: 100%;
    max-width: 300px;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer__brand {
    max-width: none;
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  .back-to-top {
    bottom: var(--space-md);
    right: var(--space-md);
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }

  .article {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .card {
    padding: var(--space-lg);
  }

  .toc {
    padding: var(--space-lg);
  }
}

/* ----------------------------------------
   YouTube Lite Embed (Facade Pattern for CWV)
   ---------------------------------------- */
.youtube-facade {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  margin: var(--space-2xl) 0;
}

.youtube-facade__thumbnail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.youtube-facade:hover .youtube-facade__thumbnail {
  transform: scale(1.05);
}

.youtube-facade__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-xl);
}

.youtube-facade__play::after {
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent white;
  margin-left: 4px;
}

.youtube-facade:hover .youtube-facade__play {
  background: var(--error);
  transform: translate(-50%, -50%) scale(1.1);
}

.youtube-facade__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Video caption */
.video-caption {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: calc(-1 * var(--space-lg));
  margin-bottom: var(--space-2xl);
}

/* ----------------------------------------
   Hero Background Video
   ---------------------------------------- */
.hero--video {
  position: relative;
  overflow: hidden;
}

.hero__video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  opacity: 0.3;
}

.hero__video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.7) 0%,
    rgba(15, 23, 42, 0.9) 50%,
    var(--background) 100%
  );
  z-index: -1;
}

/* ----------------------------------------
   Section Images (CWV Optimized)
   ---------------------------------------- */
.section-image {
  margin: var(--space-xl) 0 var(--space-2xl);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface);
}

.section-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  transition: opacity var(--transition-base);
}

/* Lazy load animation */
.section-image img[loading="lazy"] {
  opacity: 0;
}

.section-image img.loaded {
  opacity: 1;
}

.section-image__credit {
  text-align: right;
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md);
  background: var(--surface);
}

.section-image__credit a {
  color: var(--text-muted);
}

.section-image__credit a:hover {
  color: var(--accent);
}

/* Responsive video container */
.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: var(--space-2xl) 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ----------------------------------------
   Print Styles
   ---------------------------------------- */
@media print {

  .header,
  .footer,
  .back-to-top,
  .scroll-progress,
  .toc {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .article {
    padding: 0;
    max-width: none;
  }

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

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}

/* ----------------------------------------
   Article Thumbnail & Image Credit
   ---------------------------------------- */
.article__thumbnail {
  margin: 0 0 var(--space-2xl);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.article__thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.image-credit {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding: var(--space-sm) 0;
  margin: 0;
}

.image-credit a {
  color: var(--text-muted);
  text-decoration: underline;
}

.image-credit a:hover {
  color: var(--accent);
}