:root {
  --bg: #0c0f17;
  --surface: #151a26;
  --surface-alt: #1c2333;
  --border: #242c3d;
  --border-light: #37435c;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --rose: #f43f5e;
  --rose-light: #fb7185;
  --rose-glow: rgba(244, 63, 94, 0.15);
  --cyan: #38bdf8;
  --cyan-light: #7dd3fc;
  --cyan-glow: rgba(56, 189, 248, 0.15);
  --amber: #f59e0b;
  --emerald: #10b981;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --max-w: 860px;
}

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

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

html {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 0%, #1e2638 0%, var(--bg) 60%);
}

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  background: rgba(12, 15, 23, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.brand-link {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 14px;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

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

.lang-switch {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  font-family: var(--font-mono);
}

.lang-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.lang-link.active {
  color: var(--rose-light);
  background: var(--rose-glow);
  border: 1px solid rgba(244, 63, 94, 0.3);
  font-weight: 600;
}

.main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 80px;
  width: 100%;
}

/* Badge */
.topic-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--rose-light);
  background: var(--rose-glow);
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 6px 14px;
  border-radius: 9999px;
  margin-bottom: 24px;
  font-weight: 600;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--rose);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--rose);
}

/* Hero Section */
.hero-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: #ffffff;
}

.hero-subtitle {
  font-size: clamp(18px, 2.5vw, 22px);
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 36px;
}

/* Answer First Card (FM-003) */
.conclusion-card {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.08) 0%, rgba(56, 189, 248, 0.05) 100%), var(--surface);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-card);
}

.conclusion-title {
  font-size: 14px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  color: var(--rose-light);
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  font-weight: 700;
}

.conclusion-text {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
}

/* Key Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-light);
}

.metric-card.highlight::before {
  background: linear-gradient(90deg, var(--rose), var(--cyan));
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.metric-value.accent-rose {
  color: var(--rose-light);
}

.metric-value.accent-cyan {
  color: var(--cyan-light);
}

.metric-label {
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.metric-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Content Sections */
.section {
  margin-bottom: 56px;
}

.section-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #ffffff;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-number {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--rose-light);
  background: var(--rose-glow);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.prose {
  color: #cbd5e1;
  font-size: 17px;
  line-height: 1.7;
}

.prose p {
  margin-bottom: 18px;
}

.prose em {
  font-style: italic;
  color: var(--text);
}

.prose strong {
  font-weight: 600;
  color: #ffffff;
}

/* Interactive Simulator Container */
.interactive-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 32px 0;
  box-shadow: var(--shadow-card);
}

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

.interactive-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Canvas Display */
.canvas-wrapper {
  position: relative;
  width: 100%;
  height: 380px;
  background: #080b12;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* HUD Overlay on Canvas */
.hud-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(21, 26, 38, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
  pointer-events: none;
}

.hud-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 12px;
}

.hud-label {
  color: var(--text-dim);
}

.hud-val {
  font-weight: 700;
  color: var(--text);
}

.hud-val.force {
  color: var(--rose-light);
  font-size: 14px;
}

.hud-val.pressure {
  color: var(--cyan-light);
  font-size: 14px;
}

/* Controls Grid */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
  background: var(--surface-alt);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

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

.control-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.control-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--rose-light);
}

.control-slider {
  width: 100%;
  height: 6px;
  background: #242c3d;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.control-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--rose);
  border: 2px solid #ffffff;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

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

/* Preset Buttons */
.presets-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.preset-btn {
  background: var(--surface);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn:hover {
  background: #242c3d;
  color: var(--text);
}

.preset-btn.active {
  background: var(--rose-glow);
  border-color: var(--rose);
  color: var(--rose-light);
  font-weight: 600;
}

/* Food Crunch Grid */
.food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.food-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.food-card:hover {
  border-color: var(--border-light);
}

.food-card.active {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.4);
}

.food-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.food-force {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--rose-light);
  font-weight: 600;
  margin-bottom: 4px;
}

.food-stress {
  font-size: 12px;
  color: var(--text-dim);
}

/* Personal Calculator Card */
.calculator-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 36px 0;
  box-shadow: var(--shadow-card);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.calc-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-input-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.calc-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
}

.calc-input-wrapper input,
.calc-input-wrapper select {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  outline: none;
}

.calc-input-wrapper select option {
  background: var(--surface);
  color: var(--text);
}

.calc-unit {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-dim);
  margin-left: 8px;
}

.calc-results {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.08) 0%, rgba(56, 189, 248, 0.05) 100%), var(--surface-alt);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.calc-result-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calc-result-val {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: #38bdf8;
}

.calc-result-lbl {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Comparison Table */
.table-wrapper {
  overflow-x: auto;
  margin: 28px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.bio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.bio-table th {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.bio-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: #cbd5e1;
}

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

.bio-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.bio-table .mono {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #ffffff;
}

/* Method Note & References */
.method-box {
  background: var(--surface);
  border-left: 3px solid var(--cyan);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px 24px;
  margin: 36px 0;
}

.method-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--cyan-light);
  margin-bottom: 8px;
}

.method-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.references-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.references-list li {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  padding-left: 18px;
  position: relative;
}

.references-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--rose);
}

.references-list a {
  color: var(--cyan-light);
  text-decoration: none;
}

.references-list a:hover {
  text-decoration: underline;
}

/* Site Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  margin-top: auto;
  background: var(--surface);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Prefers Reduced Motion */
@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;
  }
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .main-content {
    padding: 24px 16px 60px;
  }

  .interactive-container,
  .calculator-card,
  .conclusion-card {
    padding: 18px 14px;
  }

  .canvas-wrapper {
    height: 300px;
  }

  .hud-panel {
    top: 8px;
    right: 8px;
    padding: 8px 12px;
    min-width: 150px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
