/* ============================
   Philosophy Project — Styles
   ============================ */

:root {
  --bg: #06060a;
  --surface: #0e0e14;
  --surface-2: #16161f;
  --border: #1e1e2a;
  --border-hover: #2a2a3a;
  --text: #e2e2ea;
  --text-muted: #6e6e82;
  --text-dim: #44445a;
  --accent-neuro: #38bdf8;
  --accent-psych: #a78bfa;
  --accent-phil: #f472b6;
  --accent-sim: #34d399;
  --accent-primary: #818cf8;
  --radius: 16px;
  --radius-sm: 10px;
}

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

html { scroll-behavior: smooth; }

/* ============================
   Login Screen
   ============================ */

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.login-screen.fade-out {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

.login-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.login-card {
  background: rgba(14, 14, 20, 0.7);
  backdrop-filter: blur(40px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 3.5rem 3rem;
  text-align: center;
  min-width: 380px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
}

.login-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.login-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent-neuro), var(--accent-psych), var(--accent-phil));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 2.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group {
  position: relative;
}

.login-input {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
  letter-spacing: 0.05em;
}

.login-input::placeholder {
  color: var(--text-dim);
  letter-spacing: 0;
}

.login-input:focus {
  border-color: var(--accent-psych);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

.login-input.shake {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(6px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-1px); }
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.15), rgba(167, 139, 250, 0.15));
  border: 1px solid rgba(129, 140, 248, 0.3);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.login-btn:hover {
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.25), rgba(167, 139, 250, 0.25));
  border-color: rgba(129, 140, 248, 0.5);
  transform: translateY(-1px);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn-arrow {
  transition: transform 0.2s;
}

.login-btn:hover .login-btn-arrow {
  transform: translateX(3px);
}

.login-error {
  height: 1.5rem;
  font-size: 0.8rem;
  color: #f87171;
  margin-top: 0.5rem;
  transition: opacity 0.3s;
}

.login-footer {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 600px; height: 600px;
  background: var(--accent-neuro);
  top: -200px; left: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px; height: 500px;
  background: var(--accent-psych);
  bottom: -150px; right: -100px;
  animation-delay: -7s;
}

.orb-3 {
  width: 400px; height: 400px;
  background: var(--accent-phil);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(40px, 30px) scale(1.02); }
}

.app {
  position: relative;
  z-index: 1;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(6, 6, 10, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-icon {
  font-size: 1.5rem;
}

.nav-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-neuro), var(--accent-psych), var(--accent-phil));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-link.active {
  color: var(--text);
  background: var(--surface);
}

/* Sections */
.section {
  min-height: 100vh;
  padding: 8rem 2.5rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  color: var(--text);
}

.neuro-accent { color: var(--accent-neuro); }
.psych-accent { color: var(--accent-psych); }
.phil-accent { color: var(--accent-phil); }
.sim-accent { color: var(--accent-sim); }

/* Hero */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  text-align: center;
  max-width: 700px;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  margin-bottom: 1.5rem;
}

.hero-line {
  display: block;
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}

.hero-line.accent {
  background: linear-gradient(135deg, var(--accent-neuro), var(--accent-psych), var(--accent-phil));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
}

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

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
}

/* Pillar Cards */
.pillars {
  min-height: auto;
  padding-top: 2rem;
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.pillar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: block;
}

.pillar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity 0.3s;
}

.pillar-card:nth-child(1)::before { background: linear-gradient(90deg, var(--accent-neuro), transparent); }
.pillar-card:nth-child(2)::before { background: linear-gradient(90deg, var(--accent-psych), transparent); }
.pillar-card:nth-child(3)::before { background: linear-gradient(90deg, var(--accent-phil), transparent); }

.pillar-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.pillar-card:hover::before {
  opacity: 1;
}

.pillar-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1.5rem;
}

.pillar-card:nth-child(1) .pillar-icon { color: var(--accent-neuro); }
.pillar-card:nth-child(2) .pillar-icon { color: var(--accent-psych); }
.pillar-card:nth-child(3) .pillar-icon { color: var(--accent-phil); }

.pillar-card h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.pillar-card p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.pillar-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.topic {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.pillar-arrow {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  font-size: 1.5rem;
  color: var(--text-dim);
  transition: all 0.3s;
}

.pillar-card:hover .pillar-arrow {
  color: var(--text);
  transform: translateX(4px);
}

/* Detail Sections */
.detail-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.detail-section.visible {
  display: block;
}

.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 2rem;
  font-family: inherit;
}

.back-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

/* Research Grid */
.research-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.research-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.research-card.expandable {
  cursor: pointer;
}

.research-card.expanded {
  border-color: var(--accent-primary);
  box-shadow: 0 8px 32px rgba(129, 140, 248, 0.08);
}

/* Card Header */
.card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.card-header h3 {
  flex: 1;
}

.expand-icon {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.3s;
  flex-shrink: 0;
}

.research-card.expanded .expand-icon {
  transform: rotate(45deg);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.research-number {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
}

.research-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0;
}

.research-card > p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0.75rem 0 0;
}

/* Card Detail (expanded content) */
.card-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
}

.research-card.expanded .card-detail {
  max-height: 2000px;
  opacity: 1;
  margin-top: 1.5rem;
}

.detail-content {
  padding: 1.5rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.detail-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin: 1.25rem 0 0.5rem;
}

.detail-content h4:first-child {
  margin-top: 0;
}

.detail-content p {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.detail-content strong {
  color: var(--text);
}

.detail-content em {
  color: var(--text-muted);
  font-style: italic;
}

/* Detail Table */
.detail-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.8rem;
}

.detail-table tr {
  border-bottom: 1px solid var(--border);
}

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

.detail-table td {
  padding: 0.6rem 0.75rem;
  color: var(--text-muted);
  vertical-align: top;
}

.detail-table td:first-child {
  white-space: nowrap;
  color: var(--text);
  width: 120px;
}

/* Card Diagram (Mermaid) */
.card-diagram {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  overflow-x: auto;
}

.card-diagram .mermaid {
  display: flex;
  justify-content: center;
}

.card-diagram .mermaid svg {
  width: 100%;
  height: auto;
  min-height: 300px;
}

/* Force readable text in all Mermaid diagrams */
.card-diagram .mermaid svg text,
.card-diagram .mermaid svg .nodeLabel,
.card-diagram .mermaid svg .edgeLabel,
.card-diagram .mermaid svg .cluster-label,
.card-diagram .mermaid svg tspan {
  font-size: 14px !important;
  font-family: 'Inter', sans-serif !important;
}

.card-diagram .mermaid svg .nodeLabel {
  font-size: 14px !important;
  line-height: 1.4;
}

/* Subgraph / cluster titles */
.card-diagram .mermaid svg .cluster-label text,
.card-diagram .mermaid svg .cluster-label tspan {
  font-size: 15px !important;
  font-weight: 600 !important;
}

.card-diagram.diagram-wide {
  padding: 2rem;
}

.card-diagram.diagram-wide .mermaid svg {
  min-height: 450px;
}

/* Copyable Reference Chips */
.ref {
  display: inline;
  font-style: normal;
  color: var(--accent-primary);
  cursor: pointer;
  position: relative;
  border-bottom: 1px dashed rgba(129, 140, 248, 0.3);
  transition: all 0.2s;
}

.ref:hover {
  color: #a5b4fc;
  border-bottom-color: rgba(129, 140, 248, 0.6);
}

.ref::after {
  content: '\2398';
  font-size: 0.65em;
  margin-left: 3px;
  opacity: 0;
  transition: opacity 0.2s;
  vertical-align: super;
}

.ref:hover::after {
  opacity: 0.6;
}

.ref.copied {
  color: var(--accent-sim);
  border-bottom-color: var(--accent-sim);
}

.ref.copied::after {
  content: '\2713';
  opacity: 1;
}

/* Copy Toast */
.copy-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--accent-sim);
  color: var(--accent-sim);
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 9999;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Research points (kept for backward compat) */
.research-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.research-points li {
  font-size: 0.8rem;
  color: var(--text-dim);
  padding-left: 1rem;
  position: relative;
}

.research-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-primary);
  opacity: 0.5;
}

/* Simulation Placeholder */
.sim-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.sim-icon {
  width: 120px;
  height: 120px;
  margin-bottom: 2rem;
  color: var(--accent-sim);
}

.sim-placeholder h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.sim-placeholder > p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.sim-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
}

.sim-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sim-feature-icon {
  color: var(--accent-sim);
  font-size: 0.6rem;
}

/* ============================
   Simulation Interactive UI
   ============================ */

.sim-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  margin-top: -1.5rem;
}

/* Controls */
.sim-controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sim-controls-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.5rem;
  align-items: stretch;
}

.sim-ctrl-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  min-height: 38px;
}

.sim-ctrl-group label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  min-width: 85px;
  flex-shrink: 0;
}

.sim-ctrl-group input[type="range"] {
  flex: 1;
  min-width: 60px;
}

.sim-ctrl-group select {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.35rem 0.5rem;
  font-family: inherit;
  font-size: 0.8rem;
  min-width: 0;
}

.ctrl-val {
  font-size: 0.8rem;
  color: var(--accent-primary);
  font-weight: 700;
  min-width: 42px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

input[type="range"] {
  -webkit-appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
}

/* Regime / Governance Panel */
.regime-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}

.regime-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.regime-header h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.regime-presets {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.regime-preset {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.regime-preset:hover {
  border-color: var(--accent-primary);
  color: var(--text);
}

.regime-preset.active {
  background: rgba(129, 140, 248, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.regime-preset:disabled {
  opacity: 0.3;
  cursor: default;
}

.regime-axes {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.regime-axis {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.axis-left,
.axis-right {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  width: 100px;
  flex-shrink: 0;
}

.axis-left {
  color: #f87171;
  text-align: right;
}

.axis-right {
  color: #34d399;
  text-align: left;
}

.axis-slider {
  -webkit-appearance: none;
  flex: 1;
  min-width: 100px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, rgba(248,113,113,0.3), var(--border) 40%, var(--border) 60%, rgba(52,211,153,0.3));
  outline: none;
}

.axis-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(129, 140, 248, 0.3);
  transition: transform 0.15s;
}

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

.axis-slider::-webkit-slider-thumb:active {
  transform: scale(0.95);
  background: var(--accent-primary);
}

/* Callout Box */
.sim-callout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: rgba(56, 189, 248, 0.04);
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-left: 3px solid var(--accent-neuro);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.callout-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.callout-body strong {
  font-size: 0.85rem;
  color: var(--text);
}

.callout-body p {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.callout-body em {
  color: #f87171;
  font-style: italic;
}

/* Buttons */
.sim-buttons.sim-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.sim-btn {
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.sim-btn:hover { border-color: var(--accent-primary); }

.sim-btn-play { border-color: var(--accent-sim); color: var(--accent-sim); }
.sim-btn-play:hover { background: rgba(52,211,153,0.1); }

.sim-btn-pause { border-color: var(--accent-psych); color: var(--accent-psych); }

.sim-btn-reset { border-color: var(--text-dim); color: var(--text-dim); }

.sim-year {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-left: auto;
}

.sim-status {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
}

.sim-status.ready { background: rgba(68,68,90,0.3); color: var(--text-dim); }
.sim-status.running { background: rgba(52,211,153,0.15); color: var(--accent-sim); }
.sim-status.paused { background: rgba(167,139,250,0.15); color: var(--accent-psych); }
.sim-status.complete { background: rgba(56,189,248,0.15); color: var(--accent-neuro); }

/* Charts Grid */
.sim-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.sim-chart-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  height: 310px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  flex-shrink: 0;
}

.chart-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.zoom-reset-btn {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.6rem;
  cursor: pointer;
  transition: all 0.2s;
}

.zoom-reset-btn:hover,
.chart-expand-btn:hover {
  border-color: var(--accent-primary);
  color: var(--text);
}

.chart-expand-btn {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.6rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 0.3rem;
}

/* Expanded chart — fullscreen overlay */
.sim-chart-box.expanded {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  height: auto;
  border-radius: 0;
  padding: 1.5rem;
  background: var(--bg);
  border: none;
  animation: fadeIn 0.25s ease;
}

.sim-chart-box.expanded .chart-expand-btn {
  font-size: 0.75rem;
  padding: 0.35rem 0.8rem;
}

.sim-chart-box.expanded .chart-header {
  margin-bottom: 0.75rem;
}

.sim-chart-box.expanded .chart-title {
  font-size: 1.1rem;
}

.sim-chart-box.expanded .zoom-reset-btn {
  font-size: 0.75rem;
  padding: 0.35rem 0.8rem;
}

.sim-chart-box canvas {
  flex: 1;
  min-height: 0;
  width: 100% !important;
  height: auto !important;
}

.sim-chart-box.expanded canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Scoreboard */
.sim-scoreboard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.sim-scoreboard h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.score-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.score-row.composite {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.score-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  width: 80px;
  text-align: right;
}

.score-row.composite .score-label {
  color: var(--text);
  font-size: 0.85rem;
}

.bar-pair {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 16px;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.bar-wrap.cp .bar-fill { background: #f87171; }
.bar-wrap.ab .bar-fill { background: #34d399; }

.bar-num {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  min-width: 30px;
}

.score-legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
}

.legend-cp { color: #f87171; }
.legend-ab { color: #34d399; }

/* Winner Box */
.sim-winner-box {
  text-align: center;
  padding: 2rem;
  background: var(--surface);
  border: 2px solid var(--accent-sim);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  animation: fadeIn 0.5s ease;
}

.winner-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.winner-name {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
}

.winner-margin {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.sim-btn-download {
  margin-top: 1.25rem;
  border-color: var(--accent-neuro);
  color: var(--accent-neuro);
  font-size: 0.85rem;
  padding: 0.6rem 1.5rem;
}

.sim-btn-download:hover {
  background: rgba(56, 189, 248, 0.1);
}

/* Stats Grid */
.sim-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.sim-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.sim-stat.warn { border-color: rgba(248,113,113,0.3); }
.sim-stat.good { border-color: rgba(52,211,153,0.3); }

.sim-stat-val {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.sim-stat.warn .sim-stat-val { color: #f87171; }
.sim-stat.good .sim-stat-val { color: #34d399; }

.sim-stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

@media (max-width: 768px) {
  .sim-charts-grid { grid-template-columns: 1fr; }
  .sim-controls-row { grid-template-columns: 1fr !important; }
  .sim-buttons.sim-controls-row { display: flex; flex-wrap: wrap; }
  .regime-axis { flex-wrap: wrap; }
  .axis-left, .axis-right { width: 80px; font-size: 0.65rem; }
  .sim-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================
   Data-Tip Hover Tooltips
   ============================ */
[data-tip] {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--text-dim);
}

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a28;
  border: 1px solid var(--border-hover);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  width: max-content;
  max-width: 320px;
  white-space: normal;
  text-transform: none;
  letter-spacing: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateX(-50%) translateY(4px);
  z-index: 999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

[data-tip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Flip tooltip below if near the top */
.regime-axis [data-tip]::after,
.sim-ctrl-group [data-tip]::after {
  bottom: auto;
  top: calc(100% + 8px);
}

/* ============================
   Governance Effects Explainer
   ============================ */
.gov-effects {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.gov-effects h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.gov-effects-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.gov-effects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1rem;
}

.gov-effect-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}

.gov-effect-axis {
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.ge-left { color: #f87171; }
.ge-right { color: #34d399; }

.gov-effect-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.gov-effect-table tr {
  border-bottom: 1px solid var(--border);
}

.gov-effect-table tr:last-child {
  border-bottom: none;
}

.gov-effect-table td {
  padding: 0.5rem 0.4rem;
  vertical-align: top;
  color: var(--text-muted);
}

.gov-effect-table td:first-child {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  width: 90px;
}

.ge-left-val {
  color: #f8717199;
  font-size: 0.7rem;
}

.ge-right-val {
  color: #34d39999;
  font-size: 0.7rem;
}

@media (max-width: 768px) {
  .gov-effects-grid { grid-template-columns: 1fr; }
}

/* Footer */
.footer {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-line {
    font-size: 2.2rem;
  }

  .hero-stats {
    gap: 2rem;
  }

  .pillar-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 7rem 1.25rem 3rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .research-grid {
    grid-template-columns: 1fr;
  }
}
