/* ==========================================================================
   Design Engineering & Animation System
   Strictly adheres to Emil Kowalski's Guidelines (emilkowalski/skills)
   - Zero `transition: all`
   - Never scale(0) entrances; start from scale(0.96) + opacity: 0
   - Snappy durations (< 250ms for UI)
   - Fine-crafted cubic-bezier easing curves
   - GPU-accelerated transforms & opacity only
   - Fine pointer & prefers-reduced-motion gating
   ========================================================================== */

:root {
  /* Color Palette - Dark Canvas Craft */
  --bg-canvas: #090a0f;
  --bg-subtle: #0e1017;
  --bg-card: rgba(20, 24, 33, 0.75);
  --bg-card-hover: rgba(27, 33, 46, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-bright: rgba(255, 255, 255, 0.16);
  --border-active: rgba(99, 102, 241, 0.4);

  --text-primary: #f4f4f5;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Custom Easings (Emil Kowalski Spec) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);

  /* Elevation Shadows */
  --shadow-sm: 0 0 0 1px var(--border-subtle), 0 2px 8px -2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 0 0 1px var(--border-subtle), 0 8px 24px -4px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 0 0 1px var(--border-bright), 0 16px 48px -8px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 30px -5px rgba(99, 102, 241, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography Helpers */
h1, h2, h3, h4 {
  color: var(--text-primary);
  letter-spacing: -0.025em;
  font-weight: 700;
  line-height: 1.25;
}

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

code, kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
}

kbd {
  padding: 3px 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Ambient Background Light */
.glow-bg {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(140px);
  z-index: 0;
  opacity: 0.4;
}

.top-glow {
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 450px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, rgba(139, 92, 246, 0.1) 60%, transparent 80%);
}

.side-glow {
  bottom: 20%;
  right: -100px;
  width: 500px;
  height: 400px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, transparent 70%);
}

/* Site Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(9, 10, 15, 0.75);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 150ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .nav-link:hover {
    color: var(--text-primary);
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons - Asymmetric Timing System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  user-select: none;
  outline: none;
  /* Specific properties: transform, opacity, background-color, border-color, box-shadow */
  transition: transform 180ms var(--ease-out),
              opacity 180ms var(--ease-out),
              background-color 160ms ease,
              border-color 160ms ease,
              box-shadow 160ms ease;
  will-change: transform;
}

/* Button Active Press (Fast 100ms deliberate feedback) */
.btn:active {
  transform: scale(0.97);
  transition-duration: 100ms;
}

.btn-primary {
  background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  padding: 10px 18px;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background: linear-gradient(180deg, #7174f7 0%, #5850ec 100%);
    box-shadow: 0 4px 16px -2px rgba(99, 102, 241, 0.45);
  }
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
  color: var(--text-primary);
  padding: 10px 18px;
}

@media (hover: hover) and (pointer: fine) {
  .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-bright);
  }
}

.btn-outline {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
  padding: 10px 18px;
}

@media (hover: hover) and (pointer: fine) {
  .btn-outline:hover {
    color: var(--text-primary);
    border-color: var(--border-bright);
    background: rgba(255, 255, 255, 0.03);
  }
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 13px 24px;
  font-size: 1rem;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.75rem;
}

.btn-block {
  width: 100%;
}

/* Hero Section */
.hero-section {
  position: relative;
  z-index: 1;
  padding: 64px 0 48px;
  text-align: center;
}

.hero-badge-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.gradient-text {
  display: block;
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #a5b4fc 0%, #38bdf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 6px;
}

.hero-desc {
  font-size: 1.12rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 36px;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

/* Mechanical Keyboard Stage (Hardware Mockup) */
.keyboard-stage {
  max-width: 860px;
  margin: 0 auto;
  perspective: 1200px;
}

.keyboard-case {
  background: #12151d;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg), 0 0 60px -15px rgba(99, 102, 241, 0.2);
  transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
  position: relative;
  overflow: hidden;
}

.keyboard-case::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.keyboard-case-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  font-size: 0.85rem;
}

.case-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  font-weight: 500;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.key-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #090a0f;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.7);
}

.key-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* Keycaps Tactile 3D Styling */
.keycap {
  flex: 1;
  height: 48px;
  background: #1a1e29;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 3px solid #0d0f15;
  border-radius: 6px;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 3px 0 #0d0f15, 0 4px 6px rgba(0, 0, 0, 0.4);
  /* Precision transition matching Emil Kowalski's guidelines */
  transition: transform 120ms var(--ease-out),
              box-shadow 120ms var(--ease-out),
              background-color 120ms ease,
              border-bottom-color 120ms ease;
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .keycap:hover {
    background: #242a38;
    border-color: rgba(255, 255, 255, 0.15);
  }
}

/* Depressed Key state (Tactile Bottom-Out) */
.keycap:active, .keycap.pressed {
  transform: translateY(3px);
  border-bottom-width: 1px;
  box-shadow: 0 0 0 #0d0f15, inset 0 1px 4px rgba(0, 0, 0, 0.6), 0 0 16px rgba(99, 102, 241, 0.5);
  background: #312e81;
  color: #ffffff;
  border-color: #6366f1;
}

.key-wide { flex: 1.5; }
.key-1-5 { flex: 1.4; }
.key-1-75 { flex: 1.7; }
.key-mod { flex: 1.3; }
.key-space {
  flex: 6;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.key-space.pressed {
  color: #ffffff;
}

/* Switch Quick Selector Bar */
.switch-selector-bar {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bar-title {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.switch-pill {
  padding: 6px 12px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  cursor: pointer;
  transition: transform 160ms var(--ease-out),
              background-color 160ms ease,
              border-color 160ms ease,
              color 160ms ease;
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .switch-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
  }
}

.switch-pill.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.45);
  color: #c7d2fe;
  font-weight: 600;
  box-shadow: 0 0 14px -2px rgba(99, 102, 241, 0.35);
}

/* Section Containers & Headers */
.section-container {
  padding: 84px 0;
  position: relative;
  z-index: 1;
}

.bg-subtle {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 10px;
  margin-bottom: 12px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* Card System - Micro-interactions */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: transform 220ms var(--ease-out),
              border-color 220ms var(--ease-out),
              box-shadow 220ms var(--ease-out);
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-3px);
    border-color: var(--border-bright);
    box-shadow: var(--shadow-md);
  }
}

/* Mode Cards */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.mode-card {
  display: flex;
  flex-direction: column;
}

.mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.mode-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.tag-evil { background: rgba(244, 63, 94, 0.15); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.3); }
.tag-heal { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.tag-chaos { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }

.mode-icon { font-size: 1.8rem; }

.mode-name {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.mode-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 20px;
  flex-grow: 1;
}

.mode-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: #cbd5e1;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* Roulette Interactive Box */
.roulette-box {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
}

.roulette-header {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 32px;
}

.roulette-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: start;
}

@media (max-width: 860px) {
  .roulette-body {
    grid-template-columns: 1fr;
  }
}

.roulette-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.control-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 8px;
}

.custom-select {
  width: 100%;
  background: #161922;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 12px 16px;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: border-color 150ms var(--ease-out);
}

.custom-select:focus {
  border-color: var(--accent-primary);
}

.segmented-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seg-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #141720;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.seg-item input {
  accent-color: var(--accent-primary);
}

.seg-item:has(input:checked) {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  color: #e0e7ff;
}

.btn-spin {
  margin-top: 10px;
}

/* Roulette Result Area */
.roulette-result {
  min-height: 280px;
  background: #11141c;
  border: 1px dashed var(--border-bright);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.result-placeholder {
  text-align: center;
  color: var(--text-muted);
}

.placeholder-icon {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 12px;
}

/* Emil Kowalski Entrance Animation: scale(0.96) + opacity 0 to scale(1) + opacity 1 */
.result-content {
  opacity: 1;
  transform: scale(1);
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
  will-change: transform, opacity;
}

.result-content.hidden {
  display: none;
  opacity: 0;
  transform: scale(0.96);
}

.result-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.result-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.result-metric {
  font-size: 0.8rem;
  color: var(--accent-amber);
  font-weight: 600;
}

.result-title {
  font-size: 1.45rem;
  margin-bottom: 10px;
  color: #ffffff;
}

.result-rationale {
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 20px;
}

.result-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
}

.spec-cell {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.spec-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.result-actions {
  display: flex;
  gap: 10px;
}

/* Switch Sound Lab Grid */
.sound-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.switch-card {
  display: flex;
  flex-direction: column;
}

.switch-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.switch-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
}

.switch-icon-box.clicky { background: rgba(244, 63, 94, 0.1); border-color: rgba(244, 63, 94, 0.3); }
.switch-icon-box.thocky { background: rgba(99, 102, 241, 0.1); border-color: rgba(99, 102, 241, 0.3); }
.switch-icon-box.smooth { background: rgba(236, 72, 153, 0.1); border-color: rgba(236, 72, 153, 0.3); }
.switch-icon-box.heavy { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); }
.switch-icon-box.silent { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.3); }
.switch-icon-box.panda { background: rgba(168, 85, 247, 0.1); border-color: rgba(168, 85, 247, 0.3); }

.switch-series {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.switch-name {
  font-size: 1.15rem;
}

.switch-flavor {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  flex-grow: 1;
}

.switch-meter {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.meter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.meter-bar {
  width: 60%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.meter-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #38bdf8);
  border-radius: var(--radius-pill);
}

.switch-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.switch-force-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 8px;
  border-radius: 4px;
}

/* Timeline 5-Act Section */
.timeline-container {
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 27px;
  width: 2px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.4), rgba(255, 255, 255, 0.05));
}

.timeline-item {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  position: relative;
}

.timeline-node {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 50%;
  background: #11141c;
  border: 2px solid var(--accent-primary);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
  z-index: 2;
}

.timeline-card {
  flex-grow: 1;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.time-badge {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
  color: #38bdf8;
}

.act-title {
  font-size: 1.25rem;
}

.act-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.checklist-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.check-item:has(input:checked) {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-check {
  accent-color: var(--accent-emerald);
}

/* Interactive Scorer in Act 4 */
.interactive-scorer {
  background: #141720;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 14px;
}

.scorer-head {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.score-sliders {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.slider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.82rem;
}

.slider-row span {
  width: 130px;
}

.custom-range {
  flex-grow: 1;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.score-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.88rem;
}

.score-num {
  font-weight: 700;
  color: var(--accent-cyan);
}

.score-status {
  color: var(--accent-emerald);
  font-weight: 600;
}

.act-footer-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* Scripts Grid */
.script-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.script-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.script-role-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
  align-self: flex-start;
}

.role-evil { background: rgba(244, 63, 94, 0.15); color: #fda4af; }
.role-victim { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.role-heal { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }

.script-text {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 18px;
}

/* Pitfalls Grid */
.pitfalls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

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

.pitfall-icon {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.pitfall-card h4 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.pitfall-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Site Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: #07080c;
  padding: 48px 0;
  position: relative;
  z-index: 1;
}

.footer-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 8px;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 480px;
}

.tech-stack {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stack-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: #94a3b8;
}

/* Modal System (Strict Emil Kowalski: scale(0.96) entrance, fast 150ms exit) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--ease-out);
  will-change: opacity;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-window {
  background: #12151e;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96) translateY(8px);
  opacity: 0;
  transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out);
  will-change: transform, opacity;
  overflow: hidden;
}

.modal-backdrop.open .modal-window {
  transform: scale(1) translateY(0);
  opacity: 1;
}

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

.modal-title {
  font-size: 1.15rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 150ms ease;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.contract-box {
  background: #090b10;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 0.86rem;
  color: #cbd5e1;
  margin-bottom: 20px;
}

.contract-divider {
  border: none;
  border-top: 1px dashed var(--border-subtle);
  margin: 12px 0;
}

.contract-terms {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sig-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.sig-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sig-input {
  flex: 1;
  background: #161a24;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 150ms ease;
}

.sig-input:focus {
  border-color: var(--accent-primary);
}

.sig-vs {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

/* Sonner-style Toaster System (Emil Kowalski Spec) */
.sonner-toaster {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.sonner-toast {
  pointer-events: auto;
  background: #161924;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 380px;
  font-size: 0.88rem;
  color: var(--text-primary);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition: transform 200ms var(--ease-spring), opacity 200ms var(--ease-out);
  will-change: transform, opacity;
}

.sonner-toast.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.toast-icon {
  font-size: 1.1rem;
}

.toast-message {
  flex-grow: 1;
}

/* Accessibility & Mobile Responsive */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .key-row { gap: 4px; }
  .keycap { height: 40px; font-size: 0.7rem; }
  .key-space { font-size: 0.6rem; }
  .section-container { padding: 56px 0; }
  .roulette-box { padding: 20px; }
  .timeline-container::before { left: 23px; }
  .timeline-node { width: 46px; height: 46px; min-width: 46px; font-size: 0.85rem; }
  .sonner-toaster { right: 16px; left: 16px; bottom: 16px; }
  .sonner-toast { min-width: auto; max-width: 100%; }
}

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