:root {
  --bg-primary: #0b0e14;
  --bg-surface: #121720;
  --bg-surface-elevated: #1a202c;
  --border-subtle: #242c3d;
  --border-active: #3b465c;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;
  
  --color-amber: #f59e0b;
  --color-amber-glow: rgba(245, 158, 11, 0.15);
  --color-emerald: #10b981;
  --color-emerald-glow: rgba(16, 185, 129, 0.15);
  --color-indigo: #818cf8;
  --color-indigo-glow: rgba(129, 140, 248, 0.15);
  --color-violet: #a855f7;
  --color-rose: #f43f5e;
  --color-rose-glow: rgba(244, 63, 94, 0.15);
  --color-cyan: #06b6d4;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Fira Code", Menlo, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
}

.site-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.15s ease;
}

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

.lang-switch {
  display: inline-flex;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.lang-switch a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.lang-switch a.active {
  color: var(--color-amber);
  border-color: var(--border-active);
  background: var(--bg-surface);
}

.lang-switch a:hover:not(.active) {
  color: var(--text-primary);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
}

.hero {
  margin-bottom: 4rem;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-amber);
  margin-bottom: 1rem;
  display: inline-block;
}

h1 {
  font-size: 2.75rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.lead {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 820px;
  margin-bottom: 2.5rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 2.5rem 0;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--color-amber);
}

.metric-card.emerald::before {
  background: var(--color-emerald);
}

.metric-card.indigo::before {
  background: var(--color-indigo);
}

.metric-card.rose::before {
  background: var(--color-rose);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.metric-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Spectrometer & Interactive Simulator */
.interactive-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 2rem;
  margin: 3rem 0 4rem;
}

.section-header {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

/* Timeline Decay Engine */
.timeline-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.timeline-control-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

.current-year-badge {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-amber);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.retention-summary {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.slider-wrapper {
  position: relative;
  margin: 1.5rem 0 1rem;
}

.timeline-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--border-subtle);
  outline: none;
  cursor: pointer;
  transition: background 0.15s;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-amber);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
  border: 2px solid #fff;
  transition: transform 0.1s ease;
}

.timeline-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.timeline-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-amber);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
  border: 2px solid #fff;
}

.timeline-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.timeline-preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn-preset {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preset:hover {
  border-color: var(--color-amber);
  color: var(--text-primary);
}

.btn-preset.active {
  background: var(--color-amber-glow);
  border-color: var(--color-amber);
  color: var(--color-amber);
}

/* Filters & Search */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 240px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.65rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: var(--color-amber);
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.btn-pill {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.8125rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-active);
}

.btn-pill.active {
  background: var(--bg-surface-elevated);
  border-color: var(--color-amber);
  color: var(--color-amber);
  font-weight: 500;
}

/* Word Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1rem;
}

.word-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.25rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.word-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.word-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.word-translation {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-muted);
}

.halflife-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.badge-ultra {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-high {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-mid {
  background: rgba(129, 140, 248, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(129, 140, 248, 0.4);
}

.badge-low {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.pie-root-tag {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-cyan);
  margin-bottom: 0.75rem;
}

.card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

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

.stat-item-val {
  color: var(--text-secondary);
  font-weight: 600;
  text-align: right;
}

.decay-status-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border-subtle);
  overflow: hidden;
  margin-bottom: 0.75rem;
  position: relative;
}

.decay-fill {
  height: 100%;
  background: var(--color-amber);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.card-notes {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.75rem;
  flex: 1;
}

.cognates-toggle {
  background: none;
  border: none;
  color: var(--color-amber);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.cognates-toggle:hover {
  text-decoration: underline;
}

.cognates-list {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.cognates-list.open {
  display: block;
}

.cognate-row {
  display: flex;
  justify-content: space-between;
  padding: 0.15rem 0;
}

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

/* Verb Section & Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

th {
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

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

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.mono {
  font-family: var(--font-mono);
}

.tag-regularized {
  color: var(--color-rose);
  background: var(--color-rose-glow);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.tag-immortal {
  color: var(--color-emerald);
  background: var(--color-emerald-glow);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* Article Prose */
.prose {
  margin: 3.5rem 0;
}

.prose h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 1rem;
  color: var(--text-primary);
}

.prose p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

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

.prose ul, .prose ol {
  margin: 1rem 0 1.5rem 1.5rem;
  color: var(--text-secondary);
}

.prose li {
  margin-bottom: 0.5rem;
}

.callout {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--color-amber);
  border-radius: 0 8px 8px 0;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}

.callout-title {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
  color: var(--color-amber);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.callout p {
  margin-bottom: 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.math-display {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  text-align: center;
  margin: 0.75rem 0 1rem;
  color: var(--color-amber);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Method & Footer */
.method-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.75rem;
  margin: 4rem 0 2rem;
}

.method-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.method-box p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.method-box p:last-child {
  margin-bottom: 0;
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .timeline-slider::-webkit-slider-thumb:hover {
    transform: none;
  }
  
  .word-card:hover {
    transform: none;
  }
}

/* Mobile Responsiveness (390px viewport check) */
@media (max-width: 640px) {
  .container {
    padding: 1.5rem 1rem 4rem;
  }
  
  h1 {
    font-size: 1.875rem;
  }
  
  .lead {
    font-size: 1.0625rem;
  }
  
  .interactive-section {
    padding: 1.25rem;
    margin: 2rem 0;
  }
  
  .timeline-control-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  
  .current-year-badge {
    font-size: 1.25rem;
  }

  .timeline-ticks {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 0.5rem;
    font-size: 0.6875rem;
  }
  
  .timeline-preset-buttons {
    gap: 0.35rem;
  }

  .btn-preset {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .metric-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-input {
    width: 100%;
  }
  
  .header-inner {
    padding: 0.75rem 1rem;
  }
}


