/* Pragul termic · The Heat Threshold
   Stiluri vizuale specifice subiectului: atmosferă termo-epidemiologică, benzi izotermice, precizie clinică */

:root {
  --bg-deep: #0c1015;
  --bg-canvas: #121820;
  --bg-surface: #18222d;
  --bg-surface-raised: #1f2c3a;
  --bg-surface-hover: #263748;
  
  --border-dim: #22303f;
  --border-medium: #304458;
  --border-bright: #486482;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0c1015;

  --temp-safe: #38bdf8;
  --temp-warm: #fb923c;
  --temp-hot: #f97316;
  --temp-extreme: #ef4444;

  --font-display: "Newsreader", "Charter", "Georgia", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;

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

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

  --max-w-content: 1040px;
  --max-w-narrow: 760px;
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

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

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

a {
  color: var(--temp-safe);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  color: #7dd3fc;
}

/* Header & Nav */
.site-header {
  border-bottom: 1px solid var(--border-dim);
  background: rgba(12, 16, 21, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.brand-link {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

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

.brand-badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-medium);
  font-size: 0.7rem;
  color: var(--temp-warm);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-pill);
  padding: 0.2rem;
}

.lang-link {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.lang-link.active {
  background: var(--border-bright);
  color: var(--text-primary);
}

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

/* Layout Containers */
.main-content {
  flex: 1;
  max-width: var(--max-w-content);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  width: 100%;
}

.prose-narrow {
  max-width: var(--max-w-narrow);
  margin: 0 auto;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--temp-warm);
  margin-bottom: 1rem;
}

.kicker::before, .kicker::after {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--border-medium);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  letter-spacing: -0.015em;
}

.hero-standfirst {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: var(--max-w-narrow);
  margin: 0 auto 2rem;
}

/* Key Stats Bar */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0 3rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border-medium);
}

.stat-card.risk-5::before { background: var(--temp-warm); }
.stat-card.risk-10::before { background: var(--temp-hot); }
.stat-card.risk-20::before { background: var(--temp-extreme); }
.stat-card.baseline::before { background: var(--temp-safe); }

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.35rem;
}

.stat-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Interactive Engine Container */
.interactive-section {
  background: var(--bg-canvas);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  margin: 2.5rem 0;
  box-shadow: var(--shadow-md);
}

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

.section-title {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.section-lead {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Control Tabs */
.engine-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-dim);
  padding-bottom: 0.75rem;
}

.tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--temp-warm);
  color: var(--text-inverse);
  border-color: var(--temp-warm);
}

/* Engine Mode Views */
.engine-view {
  display: none;
}

.engine-view.active {
  display: block;
}

/* Slider & Readout Component */
.slider-group {
  margin: 1.5rem 0;
}

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

.slider-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.slider-readout {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--temp-warm);
}

.temp-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #38bdf8 0%, #fb923c 45%, #f97316 70%, #ef4444 100%);
  outline: none;
  cursor: pointer;
}

.temp-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--bg-deep);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.1s ease;
}

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

.temp-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--bg-deep);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

/* Interactive Result Panel */
.result-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.metric-item {
  border-left: 2px solid var(--border-medium);
  padding-left: 0.75rem;
}

.metric-item.highlight {
  border-left-color: var(--temp-warm);
}

.metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.15rem;
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.result-explanation {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
  border-top: 1px solid var(--border-dim);
  padding-top: 1rem;
}

/* Comparison Subgroup Matrix */
.subgroup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.subgroup-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
}

.subgroup-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subgroup-tag {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-raised);
  color: var(--text-secondary);
}

.threshold-ladder {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.ladder-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
}

.ladder-pill {
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.ladder-pill.step-5 { background: rgba(251, 146, 60, 0.15); color: var(--temp-warm); }
.ladder-pill.step-10 { background: rgba(249, 115, 22, 0.15); color: var(--temp-hot); }
.ladder-pill.step-20 { background: rgba(239, 68, 68, 0.15); color: var(--temp-extreme); }

/* Thermal Visualizer Chart Canvas */
.chart-container {
  width: 100%;
  margin: 1.5rem 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.chart-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Studies & Mechanisms Matrix */
.matrix-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.matrix-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.25rem;
  align-items: baseline;
}

@media (max-width: 640px) {
  .matrix-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

.matrix-window-name {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--temp-warm);
  text-transform: uppercase;
}

.matrix-window-outcome {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.matrix-window-mechanism {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Clinical Refusal Interactive Module */
.refusal-box {
  background: linear-gradient(145deg, #1b242e 0%, #151d26 100%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 3rem 0;
  position: relative;
}

.refusal-badge {
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--border-bright);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

.refusal-query-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
  align-items: center;
}

.refusal-input {
  background: var(--bg-deep);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  width: 140px;
}

.refusal-btn {
  background: var(--border-bright);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.refusal-btn:hover {
  background: var(--border-medium);
}

.refusal-output {
  background: var(--bg-surface);
  border-left: 3px solid var(--temp-safe);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.refusal-output strong {
  color: var(--text-primary);
}

/* Studies Table */
.table-responsive {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
}

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

.studies-table th {
  background: var(--bg-surface-raised);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-medium);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.studies-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-dim);
  color: var(--text-secondary);
}

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

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

.studies-table .study-author {
  font-weight: 600;
  color: var(--text-primary);
}

.studies-table .study-thresh {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--temp-warm);
}

/* Narrative Editorial Sections */
.editorial-block {
  margin: 3.5rem 0;
}

.editorial-block h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.editorial-block p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

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

/* Methodology & Sources */
.sources-section {
  border-top: 1px solid var(--border-dim);
  padding-top: 2.5rem;
  margin-top: 3.5rem;
}

.sources-title {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.source-item {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border-dim);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-dim);
  background: var(--bg-deep);
  padding: 2rem 1.25rem;
  margin-top: auto;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: var(--max-w-content);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

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

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

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.text-mono { font-family: var(--font-mono); }
