/* ============================================
   MPK Mini MK3 Playbook - Layout
   Header, footer, rails, and page structure
   ============================================ */

/* ─────────────────────────────────────────
   APP SHELL
   ───────────────────────────────────────── */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  padding-top: var(--header-height);
}

/* ─────────────────────────────────────────
   HEADER - Premium Solid
   ───────────────────────────────────────── */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  
  /* Glass Mainframe Effect */
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  
  /* Texture Overlay */
  background-image: var(--bg-noise), linear-gradient(to bottom, var(--bg-glass-heavy), var(--bg-glass-heavy));
  background-blend-mode: overlay, normal;
  
  /* Border with warm tint */
  border-bottom: 1px solid var(--border-subtle);
  
  /* Subtle shadow */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Scrolled state - enhanced shadow */
.header.scrolled {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  border-bottom-color: var(--border-default);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-2xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
  gap: var(--space-6);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.logo-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  /* Glow for the logo */
  filter: drop-shadow(0 0 8px rgba(255, 77, 28, 0.4));
  transition: filter 0.3s ease;
}

.logo:hover .logo-icon {
  filter: drop-shadow(0 0 12px rgba(255, 77, 28, 0.8));
}

body {
  min-height: 100vh;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  overflow-x: hidden;
}

/* Texture Overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0; /* Low z-index so it doesn't block interactive elements */
  background-image: var(--bg-noise);
  opacity: 0.4;
  mix-blend-mode: overlay;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

.logo-subtitle {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  letter-spacing: var(--tracking-wide);
}

/* Primary Navigation */
.nav-primary {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.nav-link {
  position: relative;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: var(--color-white);
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-dim) 100%);
  box-shadow: 0 2px 8px rgba(255, 61, 0, 0.3);
}

.nav-link.active::after {
  display: none;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  min-width: 200px;
}

.search-trigger:hover {
  background: var(--bg-hover);
  border-color: var(--border-default);
  color: var(--text-secondary);
}

.search-trigger-icon {
  opacity: 0.6;
}

.search-trigger-text {
  flex: 1;
  text-align: left;
}

.search-trigger-kbd {
  display: flex;
  gap: 2px;
}

.kbd {
  padding: 2px 6px;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-overlay);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Mobile Menu */
.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

@media (max-width: 1024px) {
  .nav-primary {
    display: none;
  }
  
  .search-trigger {
    min-width: unset;
    padding: var(--space-2);
  }
  
  .search-trigger-text,
  .search-trigger-kbd {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .header-inner {
    padding: 0 var(--space-4);
  }
}

@media (max-width: 640px) {
  .header-inner {
    gap: var(--space-3);
  }
  
  .logo-text {
    display: none;
  }
  
  .header-actions {
    gap: var(--space-2);
  }
}

/* ─────────────────────────────────────────
   PAGE LAYOUT
   ───────────────────────────────────────── */

.page {
  opacity: 0;
  animation: fadeIn var(--duration-normal) var(--ease-out) forwards;
}

.page-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

/* With Rails */
.page-content.with-left-rail {
  grid-template-columns: var(--rail-width) 1fr;
}

.page-content.with-right-rail {
  grid-template-columns: 1fr var(--rail-width);
}

.page-content.with-both-rails {
  grid-template-columns: var(--rail-width) 1fr var(--rail-width);
  max-width: var(--container-2xl);
}

@media (max-width: 1280px) {
  .page-content.with-both-rails {
    grid-template-columns: 1fr var(--rail-width);
  }
  
  .left-rail {
    display: none;
  }
}

@media (max-width: 1024px) {
  .page-content.with-left-rail,
  .page-content.with-right-rail,
  .page-content.with-both-rails {
    grid-template-columns: 1fr;
  }
  
  .left-rail,
  .right-rail {
    display: none;
  }
}

/* ─────────────────────────────────────────
   RAILS
   ───────────────────────────────────────── */

.left-rail {
  position: sticky;
  top: calc(var(--header-height) + var(--space-8));
  height: fit-content;
  max-height: calc(100vh - var(--header-height) - var(--space-16));
  overflow-y: auto;
}

.right-rail {
  position: sticky;
  top: calc(var(--header-height) + var(--space-8));
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Table of Contents */
.toc {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.toc-title {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-tertiary);
  margin-bottom: var(--space-4);
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.toc-link {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: var(--transition-fast);
}

.toc-link:hover {
  color: var(--text-primary);
  background: var(--bg-overlay);
}

.toc-link.active {
  color: var(--accent-primary);
  background: var(--accent-primary-bg);
  border-left-color: var(--accent-primary);
}

.toc-link.indent {
  padding-left: var(--space-6);
  font-size: var(--text-xs);
}

/* Info Cards */
.info-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.info-card-title {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-tertiary);
  margin-bottom: var(--space-3);
}

.info-card-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.info-card-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.info-card-icon {
  color: var(--accent-primary);
}

/* ─────────────────────────────────────────
   HERO SECTION - Premium
   ───────────────────────────────────────── */

.hero {
  position: relative;
  padding: var(--space-24) var(--space-6) var(--space-20);
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255, 61, 0, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(255, 61, 0, 0.06) 0%, transparent 50%),
    var(--bg-base);
  overflow: hidden;
}

/* Animated grid pattern */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 20%, transparent 70%);
  animation: heroGridPulse 8s ease-in-out infinite;
}

@keyframes heroGridPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.6; }
}

/* Glowing orb effect */
.hero::after {
  content: '';
  position: absolute;
  top: -200px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 61, 0, 0.12) 0%, transparent 60%);
  filter: blur(60px);
  animation: heroOrbFloat 12s ease-in-out infinite;
  pointer-events: none;
}

@keyframes heroOrbFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, 20px); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--container-xl);
  margin: 0 auto;
}

.hero-content {
  max-width: 780px;
}

/* Glassmorphism badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 61, 0, 0.3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-primary);
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: var(--font-extrabold);
  line-height: 1.05;
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-6);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero h1 .text-accent {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero .lead {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-10);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* Primary hero button with glow */
.hero-actions .btn-primary {
  box-shadow: 0 4px 20px rgba(255, 61, 0, 0.3);
  transition: all 0.3s ease;
}

.hero-actions .btn-primary:hover {
  box-shadow: 0 6px 30px rgba(255, 61, 0, 0.4);
  transform: translateY(-2px);
}

/* Hero Stats - Animated Counters */
.hero-stats {
  display: flex;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.hero-stats .stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.hero-stats .stat-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stats .stat-label {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

/* Hero Inner - Flex Layout for Visualizer */
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--container-xl);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
}

@media (max-width: 1024px) {
  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .hero-stats {
    flex-wrap: wrap;
    gap: var(--space-6);
  }
  
  .hero-visualizer-preview {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: var(--space-16) var(--space-4) var(--space-12);
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero .lead {
    font-size: var(--text-base);
  }
  
  .hero-actions {
    width: 100%;
  }
  
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: var(--space-4);
    width: 100%;
  }
  
  .hero-stats .stat {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-3);
    background: var(--bg-glass);
    border-radius: var(--radius-md);
  }
}

/* Mini Visualizer Preview */
.hero-visualizer-preview {
  flex-shrink: 0;
  width: 320px;
  padding: var(--space-6);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hero-visualizer-preview:hover {
  border-color: var(--accent-primary);
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 60px rgba(255, 61, 0, 0.15);
}

.mini-mpk {
  background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border: 2px solid #333;
}

.mini-mpk-label {
  text-align: center;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-3);
}

/* Mini Pads - 2x4 Grid */
.mini-pads {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: var(--space-3);
}

.mini-pad {
  aspect-ratio: 1;
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  border-radius: 4px;
  border: 1px solid #444;
  position: relative;
  transition: all 0.2s ease;
}

.mini-pad::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 2px;
  background: transparent;
  transition: all 0.3s ease;
}

/* Animated pad sequence */
.mini-pad:nth-child(1) { animation: padGlow 2s ease-in-out 0s infinite; }
.mini-pad:nth-child(2) { animation: padGlow 2s ease-in-out 0.25s infinite; }
.mini-pad:nth-child(3) { animation: padGlow 2s ease-in-out 0.5s infinite; }
.mini-pad:nth-child(4) { animation: padGlow 2s ease-in-out 0.75s infinite; }
.mini-pad:nth-child(5) { animation: padGlow 2s ease-in-out 1s infinite; }
.mini-pad:nth-child(6) { animation: padGlow 2s ease-in-out 1.25s infinite; }
.mini-pad:nth-child(7) { animation: padGlow 2s ease-in-out 1.5s infinite; }
.mini-pad:nth-child(8) { animation: padGlow 2s ease-in-out 1.75s infinite; }

@keyframes padGlow {
  0%, 80%, 100% { 
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    box-shadow: none;
  }
  40% { 
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-dim) 100%);
    box-shadow: 0 0 15px rgba(255, 61, 0, 0.5);
  }
}

/* Mini Knobs */
.mini-knobs {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: var(--space-3);
}

.mini-knob {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
  border-radius: 50%;
  border: 1px solid #555;
  position: relative;
}

.mini-knob::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 1px;
  animation: knobRotate 4s linear infinite;
  transform-origin: center 7px;
}

@keyframes knobRotate {
  0% { transform: translateX(-50%) rotate(0deg); }
  100% { transform: translateX(-50%) rotate(360deg); }
}

/* Mini Keys */
.mini-keys {
  height: 24px;
  background: linear-gradient(180deg, #fafafa 0%, #e0e0e0 100%);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.mini-keys::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  width: 8%;
  height: 60%;
  background: #1a1a1a;
  border-radius: 0 0 2px 2px;
  box-shadow: 
    14px 0 0 #1a1a1a,
    28px 0 0 #1a1a1a,
    56px 0 0 #1a1a1a,
    70px 0 0 #1a1a1a,
    84px 0 0 #1a1a1a,
    112px 0 0 #1a1a1a,
    126px 0 0 #1a1a1a;
}

.mini-mpk-hint {
  margin-top: var(--space-4);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.hero-visualizer-preview:hover .mini-mpk-hint {
  color: var(--accent-primary);
}

/* ─────────────────────────────────────────
   SECTIONS
   ───────────────────────────────────────── */

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

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

.section-inner {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ─────────────────────────────────────────
   GRIDS
   ───────────────────────────────────────── */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────── */

.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-8) var(--space-6);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-xl);
  margin: 0 auto;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.footer-version {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.footer-version .badge {
  font-size: var(--text-xs);
}

.footer-links {
  display: flex;
  gap: var(--space-6);
}

.footer-link {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  transition: var(--transition-fast);
}

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

.footer-right {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .footer-inner {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }
  
  .footer-left {
    flex-direction: column;
  }
  
  .page-content {
    padding: var(--space-6) var(--space-4);
  }
  
  .section {
    padding: var(--space-12) 0;
  }
  
  .section-inner {
    padding: 0 var(--space-4);
  }
}

/* ─────────────────────────────────────────
   BREADCRUMBS
   ───────────────────────────────────────── */

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-6);
}

.breadcrumb-separator {
  opacity: 0.5;
}

.breadcrumb-link {
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.breadcrumb-link:hover {
  color: var(--accent-primary);
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: var(--font-medium);
}

/* ─────────────────────────────────────────
   MOBILE NAVIGATION DRAWER
   ───────────────────────────────────────── */

.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-glass-dark);
  backdrop-filter: blur(var(--blur-xl));
  -webkit-backdrop-filter: blur(var(--blur-xl));
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.mobile-nav.open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-inner {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-default);
  padding: var(--space-6);
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-out);
}

.mobile-nav.open .mobile-nav-inner {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.mobile-nav-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.mobile-nav-close:hover {
  color: var(--text-primary);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mobile-nav-link {
  display: block;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.mobile-nav-link:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.mobile-nav-link.active {
  background: var(--accent-primary-bg);
  color: var(--accent-primary);
}

/* ─────────────────────────────────────────
   SEARCH MODAL
   ───────────────────────────────────────── */

.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(var(--blur-sm));
  -webkit-backdrop-filter: blur(var(--blur-sm));
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(var(--header-height) + var(--space-8)) var(--space-6);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.search-modal.open {
  opacity: 1;
  visibility: visible;
}

.search-modal-inner {
  width: 100%;
  max-width: 600px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(-20px) scale(0.98);
  transition: transform var(--duration-normal) var(--ease-out);
}

.search-modal.open .search-modal-inner {
  transform: translateY(0) scale(1);
}

.search-modal-input {
  width: 100%;
  padding: var(--space-5) var(--space-6);
  font-size: var(--text-lg);
  background: transparent;
  border: none;
  color: var(--text-primary);
}

.search-modal-input:focus {
  outline: none;
}

.search-modal-input::placeholder {
  color: var(--text-muted);
}

.search-results {
  border-top: 1px solid var(--border-subtle);
  max-height: 400px;
  overflow-y: auto;
}

.search-result {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  color: var(--text-secondary);
  transition: var(--transition-fast);
  cursor: pointer;
}

.search-result:hover,
.search-result.selected {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.search-result-icon {
  opacity: 0.5;
}

.search-result-title {
  font-weight: var(--font-medium);
}

.search-result-meta {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.search-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--bg-surface);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ─────────────────────────────────────────
   SCROLL PROGRESS BAR
   ───────────────────────────────────────── */

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--bg-surface);
  z-index: 10001;
}

.scroll-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px var(--accent-primary);
}

/* ─────────────────────────────────────────
   BACK TO TOP BUTTON
   ───────────────────────────────────────── */

.back-to-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
}

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

.back-to-top:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  box-shadow: 0 4px 20px rgba(255, 61, 0, 0.4);
  transform: translateY(-4px);
}

/* ─────────────────────────────────────────
   SCROLL HINT ARROW
   ───────────────────────────────────────── */

.scroll-hint {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  opacity: 1;
  transition: opacity 0.5s ease;
}

.scroll-hint.hidden {
  opacity: 0;
  pointer-events: none;
}

.scroll-hint-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.scroll-hint-arrow {
  color: var(--accent-primary);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ─────────────────────────────────────────
   ACCORDION ENHANCED
   ───────────────────────────────────────── */

.accordion-learn {
  margin: var(--space-12) 0;
}

.accordion-learn .accordion-item {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  overflow: hidden;
  transition: all 0.3s ease;
}

.accordion-learn .accordion-item:hover {
  border-color: var(--accent-primary);
}

.accordion-learn .accordion-item.open {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 20px rgba(255, 61, 0, 0.1);
}

.accordion-learn .accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}

.accordion-learn .accordion-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.accordion-learn .accordion-icon {
  color: var(--accent-primary);
  transition: transform 0.3s ease;
}

.accordion-learn .accordion-item.open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-learn .accordion-content {
  height: 0;
  overflow: hidden;
  padding: 0 var(--space-6);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.accordion-learn .accordion-item.open .accordion-content {
  padding-bottom: var(--space-5);
}

/* ─────────────────────────────────────────
   TESTIMONIALS CAROUSEL
   ───────────────────────────────────────── */

.testimonials {
  padding: var(--space-16) 0;
  background: var(--bg-surface);
  overflow: hidden;
}

.testimonial-track {
  display: flex;
  gap: var(--space-6);
  animation: testimonialScroll 30s linear infinite;
}

@keyframes testimonialScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.testimonial-card {
  flex-shrink: 0;
  width: 400px;
  padding: var(--space-6);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
}

.testimonial-quote {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.testimonial-avatar {
  width: 40px;
  height: 40px;
  background: var(--accent-primary-bg);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-bold);
  color: var(--accent-primary);
}

.testimonial-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.testimonial-role {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ─────────────────────────────────────────
   COMPARISON TABLE
   ───────────────────────────────────────── */

.comparison-table-wrapper {
  margin: var(--space-12) 0;
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th {
  padding: var(--space-4) var(--space-5);
  background: var(--bg-surface);
  font-weight: var(--font-semibold);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.comparison-table th.highlight {
  background: var(--accent-primary-bg);
  color: var(--accent-primary);
}

.comparison-table td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-check {
  color: var(--status-success);
}

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

/* ─────────────────────────────────────────
   NEWSLETTER SIGNUP
   ───────────────────────────────────────── */

.newsletter {
  padding: var(--space-12);
  background: linear-gradient(135deg, var(--accent-primary-bg) 0%, var(--accent-secondary-bg) 100%);
  border-radius: var(--radius-2xl);
  text-align: center;
  margin: var(--space-12) 0;
}

.newsletter-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-2);
}

.newsletter-text {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.newsletter-form {
  display: flex;
  gap: var(--space-3);
  max-width: 400px;
  margin: 0 auto;
}

.newsletter-input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

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

/* ─────────────────────────────────────────
   PROGRESS TRACKER
   ───────────────────────────────────────── */

.progress-tracker {
  position: fixed;
  bottom: var(--space-8);
  left: var(--space-8);
  padding: var(--space-4);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  z-index: 1000;
}

.progress-ring {
  width: 60px;
  height: 60px;
}

.progress-ring-circle {
  stroke: var(--border-subtle);
  fill: none;
  stroke-width: 4;
}

.progress-ring-progress {
  stroke: var(--accent-primary);
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 0.5s ease;
}

.progress-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--accent-primary);
}

/* ─────────────────────────────────────────
   SPOTLIGHT SEARCH
   ───────────────────────────────────────── */

.spotlight {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.spotlight.open {
  opacity: 1;
  visibility: visible;
}

.spotlight-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.spotlight-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(-20px);
  transition: transform 0.2s ease;
}

.spotlight.open .spotlight-modal {
  transform: translateY(0);
}

.spotlight-input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}

.spotlight-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.spotlight-input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: var(--text-lg);
  color: var(--text-primary);
  outline: none;
}

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

.spotlight-kbd {
  padding: var(--space-1) var(--space-2);
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.spotlight-results {
  max-height: 300px;
  overflow-y: auto;
  padding: var(--space-2);
}

.spotlight-result {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s ease;
}

.spotlight-result:hover,
.spotlight-result.selected {
  background: var(--bg-overlay);
}

.spotlight-result-icon {
  font-size: 1.25rem;
}

.spotlight-result-title {
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.spotlight-result-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.spotlight-empty {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-muted);
}

.spotlight-footer {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.spotlight-footer kbd {
  padding: 2px 6px;
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  margin-right: var(--space-1);
}

/* ─────────────────────────────────────────
   KEYBOARD NAV HINTS
   ───────────────────────────────────────── */

.keyboard-focused {
  outline: 2px solid var(--accent-primary) !important;
  outline-offset: 4px;
}

.nav-hint {
  position: fixed;
  bottom: var(--space-20);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.nav-hint.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ─────────────────────────────────────────
   PROGRESS WIDGET
   ───────────────────────────────────────── */

.progress-widget {
  position: fixed;
  bottom: var(--space-8);
  left: var(--space-8);
  z-index: 1000;
  cursor: pointer;
}

.progress-widget-inner {
  position: relative;
  width: 56px;
  height: 56px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.progress-widget:hover .progress-widget-inner {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 20px rgba(255, 61, 0, 0.2);
}

.progress-ring {
  position: absolute;
  width: 56px;
  height: 56px;
}

.progress-ring-bg {
  fill: none;
  stroke: var(--border-subtle);
  stroke-width: 3;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 3;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 0.5s ease;
}

.progress-tooltip {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: var(--space-3);
  min-width: 200px;
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
}

.progress-widget.expanded .progress-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.progress-tooltip-title {
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

.progress-tooltip-item {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.progress-tooltip-item.visited {
  color: var(--text-primary);
}

/* ─────────────────────────────────────────
   SKELETON LOADING
   ───────────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 0%, var(--bg-overlay) 50%, var(--bg-surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-2);
}

.skeleton-title {
  height: 2em;
  width: 60%;
  margin-bottom: var(--space-4);
}

.skeleton-card {
  height: 200px;
}

/* ─────────────────────────────────────────
   PAD TRIGGER EFFECT
   ───────────────────────────────────────── */

.mini-pad.pad-triggered,
.interactive-pad.pad-triggered {
  background: var(--accent-primary) !important;
  box-shadow: 0 0 30px var(--accent-primary) !important;
  transform: scale(0.95);
}

/* ─────────────────────────────────────────
   BOTTOM SHEET (MOBILE)
   ───────────────────────────────────────── */

.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.bottom-sheet.open {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.bottom-sheet-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-4) var(--space-6) var(--space-8);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.bottom-sheet.open .bottom-sheet-content {
  transform: translateY(0);
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-4);
}

.bottom-sheet-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.bottom-sheet-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.2s ease;
}

.bottom-sheet-link:hover {
  background: var(--bg-overlay);
}

.bottom-sheet-icon {
  font-size: 1.25rem;
}

/* ─────────────────────────────────────────
   REFRESH INDICATOR
   ───────────────────────────────────────── */

.refresh-indicator {
  position: fixed;
  top: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10000;
}

.refresh-indicator.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.refresh-spinner {
  animation: spin 1s linear infinite;
  color: var(--accent-primary);
}

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

/* ─────────────────────────────────────────
   CONFETTI
   ───────────────────────────────────────── */

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10000;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--accent-primary);
  animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ─────────────────────────────────────────
   SCROLL PROGRESS BAR
   ───────────────────────────────────────── */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-primary-bright) 100%);
  z-index: 1001;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px var(--accent-primary);
}

/* ─────────────────────────────────────────
   BACK TO TOP BUTTON
   ───────────────────────────────────────── */

.back-to-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 48px;
  height: 48px;
  background: var(--accent-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) rotate(270deg);
  transition: all 0.3s ease;
  z-index: 900;
  box-shadow: 0 4px 20px rgba(255, 61, 0, 0.4);
}

.back-to-top svg {
  color: white;
  transform: rotate(-90deg);
}

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

.back-to-top.visible svg {
  transform: rotate(-90deg);
}

.back-to-top:hover {
  background: var(--accent-primary-bright);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(255, 61, 0, 0.5);
}

/* ─────────────────────────────────────────
   TOAST NOTIFICATIONS
   ───────────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: auto;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-color: var(--color-success);
}

.toast-success .toast-icon {
  color: var(--color-success);
}

.toast-error {
  border-color: var(--color-error);
}

.toast-error .toast-icon {
  color: var(--color-error);
}

.toast-info {
  border-color: var(--accent-secondary);
}

.toast-info .toast-icon {
  color: var(--accent-secondary);
}

.toast-icon {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
}

.toast-message {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

/* ─────────────────────────────────────────
   KEYBOARD SHORTCUTS MODAL
   ───────────────────────────────────────── */

.shortcuts-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.shortcuts-modal.open {
  opacity: 1;
  visibility: visible;
}

.shortcuts-modal-inner {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  min-width: 360px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.shortcuts-modal.open .shortcuts-modal-inner {
  transform: scale(1);
}

.shortcuts-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.shortcuts-modal-header h3 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0;
}

.shortcuts-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: var(--text-lg);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.shortcuts-close:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-2) 0;
}

.shortcut-item span {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* ─────────────────────────────────────────
   PRINT STYLES
   ───────────────────────────────────────── */

@media print {
  .header,
  .back-to-top,
  .toast-container,
  .scroll-progress,
  .mobile-nav,
  .search-modal,
  .shortcuts-modal {
    display: none !important;
  }
  
  .app-main {
    padding-top: 0 !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .section-alt {
    background: #f5f5f5 !important;
  }
}

/* ─────────────────────────────────────────
   TABLE OF CONTENTS (Sticky Sidebar)
   ───────────────────────────────────────── */

.toc-sidebar {
  position: fixed;
  top: calc(var(--header-height) + 32px);
  right: 32px;
  width: 240px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  
  background: rgba(21, 19, 18, 0.6); /* Translucent surface */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 90;
}

.toc-sidebar.visible {
  opacity: 1;
  transform: translateX(0);
}

.toc-header {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-link {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
}

.toc-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.toc-link.active {
  color: var(--accent-primary);
  background: rgba(255, 77, 28, 0.1);
  border-left-color: var(--accent-primary);
}

.toc-h3 {
  padding-left: 20px;
  font-size: 0.8rem;
}

/* Hide TOC on smaller screens */
@media (max-width: 1280px) {
  .toc-sidebar {
    display: none;
  }
}

/* Scrollbar Polish */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ─────────────────────────────────────────
   SPOTLIGHT SEARCH (Glass Mainframe)
   ───────────────────────────────────────── */

.search-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.search-modal.open {
  opacity: 1;
  visibility: visible;
}

.search-modal-inner {
  width: 100%;
  max-width: 600px;
  background: rgba(20, 20, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05); /* Inner rim */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.98);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-modal.open .search-modal-inner {
  transform: scale(1);
}

.search-modal-input {
  width: 100%;
  padding: var(--space-6);
  background: transparent;
  border: none;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-primary);
  outline: none;
  border-bottom: 1px solid var(--border-subtle);
}

.search-modal-input::placeholder {
  color: var(--text-tertiary);
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: var(--space-2);
}

.search-result {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-1);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-result:hover, .search-result.selected {
  background: var(--bg-overlay);
}

.search-result-icon {
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.search-result:hover .search-result-icon {
  color: var(--accent-primary);
}

.search-result-title {
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.search-result-meta {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.search-hint {
  padding: var(--space-3) var(--space-6);
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.search-hint kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}
.toc-sidebar::-webkit-scrollbar {
  width: 4px;
}
.toc-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 2px;
}
