/* ==========================================================================
   INIMA ÎN APĂ RECE — THE MAMMALIAN DIVE REFLEX
   Visual Theme: "Bazinul de adâncime termică și ecoul cardiografic"
   ========================================================================== */

:root {
  --bg-deep: #060e17;
  --bg-surface: #0c1a27;
  --bg-card: #112538;
  --bg-card-hover: #163047;
  --border-subtle: #1c3d5a;
  --border-focus: #38bdf8;
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --cyan-cold: #38bdf8;
  --cyan-ice: #5eead4;
  --cyan-glow: rgba(56, 189, 248, 0.25);
  
  --heart-red: #f43f5e;
  --heart-soft: #fb7185;
  --heart-glow: rgba(244, 63, 94, 0.35);
  
  --emerald-green: #34d399;
  --amber-warm: #fbbf24;
  
  --font-serif: "Newsreader", Georgia, Cambria, "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-subtle);
  --shadow-glow: 0 0 30px -5px var(--cyan-glow);
  --shadow-heart: 0 0 35px -5px var(--heart-glow);
}

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

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

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

/* Accessibility: Hidden text */
.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;
}

/* Typography */
h1, h2, h3, .serif-heading {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 600;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: 1.0625rem;
}

p strong {
  color: var(--text-primary);
  font-weight: 600;
}

a {
  color: var(--cyan-cold);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover, a:focus-visible {
  color: var(--cyan-ice);
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

/* Header & Nav */
.site-header {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-brand .brand-icon {
  width: 28px;
  height: 28px;
  color: var(--heart-red);
}

.language-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.language-nav a {
  padding: 0.375rem 0.75rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

.language-nav a.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

/* Hero Section (Answer First) */
.hero {
  padding: 2.5rem 0 3rem;
  text-align: left;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-full);
  color: var(--cyan-cold);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-mono);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-lead {
  font-size: clamp(1.1875rem, 2.5vw, 1.375rem);
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

/* Key Metrics Hero Grid */
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

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

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

.metric-card.heart::before {
  background: linear-gradient(90deg, var(--heart-red), var(--heart-soft));
}

.metric-card.flow::before {
  background: linear-gradient(90deg, var(--emerald-green), var(--cyan-cold));
}

.metric-value {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.metric-value.cold { color: var(--cyan-cold); }
.metric-value.heart { color: var(--heart-soft); }
.metric-value.flow { color: var(--emerald-green); }

.metric-unit {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}

.metric-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.metric-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Interactive Simulator Section */
.interactive-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  margin: 3rem 0;
  box-shadow: var(--shadow-glow);
}

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

.simulator-header h2 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.simulator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .simulator-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.control-group {
  margin-bottom: 1.75rem;
}

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.625rem;
  color: var(--text-primary);
}

.control-value {
  font-family: var(--font-mono);
  color: var(--cyan-cold);
  font-size: 1.0625rem;
}

.slider-container {
  position: relative;
  width: 100%;
}

input[type="range"] {
  width: 100%;
  height: 8px;
  background: var(--bg-card);
  border-radius: var(--radius-full);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--border-subtle);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cyan-cold);
  cursor: pointer;
  box-shadow: 0 0 10px var(--cyan-cold);
  border: 2px solid var(--bg-deep);
  transition: transform 0.1s ease, background-color 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--cyan-ice);
}

input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cyan-cold);
  cursor: pointer;
  box-shadow: 0 0 10px var(--cyan-cold);
  border: 2px solid var(--bg-deep);
}

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

/* Radio / Button Choice Group */
.choice-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.625rem;
}

.choice-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  min-height: 48px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.choice-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.choice-btn.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--cyan-cold);
  color: var(--text-primary);
  font-weight: 600;
}

.choice-btn .choice-sub {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.choice-btn.active .choice-sub {
  color: var(--cyan-cold);
}

/* Simulator Output Display Panel */
.simulator-display {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cardiac-monitor {
  background: #04090f;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.monitor-screen {
  position: relative;
  z-index: 1;
}

.pulse-rate {
  font-family: var(--font-mono);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--heart-soft);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.pulse-rate .rate-unit {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pulse-delta {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.pulse-delta.negative {
  color: var(--cyan-cold);
}

.pulse-delta.positive {
  color: var(--amber-warm);
}

/* Heartbeat Icon Animation */
.heart-pulsar {
  width: 54px;
  height: 54px;
  color: var(--heart-red);
  filter: drop-shadow(0 0 12px var(--heart-glow));
  transform-origin: center;
  animation: pulse-beat var(--beat-duration, 0.8s) ease-in-out infinite;
}

@keyframes pulse-beat {
  0% { transform: scale(1); }
  15% { transform: scale(1.22); }
  30% { transform: scale(1); }
  45% { transform: scale(1.12); }
  60% { transform: scale(1); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .heart-pulsar {
    animation: none;
  }
}

/* ECG Canvas / SVG trace */
.ecg-canvas {
  width: 100%;
  height: 70px;
  background: #04090f;
  border-radius: var(--radius-sm);
  border: 1px solid #142838;
}

/* Flow Distribution Bars */
.flow-distribution {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.flow-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.flow-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 600;
}

.flow-bar-bg {
  width: 100%;
  height: 8px;
  background: #081420;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.flow-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.flow-bar-fill.brain { background: var(--cyan-cold); }
.flow-bar-fill.heart { background: var(--heart-soft); }
.flow-bar-fill.limbs { background: var(--text-muted); }

.autonomic-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #081420;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  border-left: 4px solid var(--cyan-cold);
}

.autonomic-state.sympathetic {
  border-left-color: var(--amber-warm);
}

/* On-Body Real-Time Test Section */
.on-body-lab {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  margin: 3.5rem 0;
}

.lab-stepper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.lab-step {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: border-color 0.2s ease;
}

.lab-step.active {
  border-color: var(--cyan-cold);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--cyan-cold);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.tap-button {
  background: var(--bg-card);
  border: 2px solid var(--cyan-cold);
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  min-height: 56px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
  transition: transform 0.05s ease, background 0.1s ease;
}

.tap-button:active {
  transform: scale(0.97);
  background: rgba(56, 189, 248, 0.2);
}

.btn-primary {
  background: var(--cyan-cold);
  color: #04090f;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  padding: 0.875rem 1.5rem;
  min-height: 48px;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: var(--cyan-ice);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-weight: 600;
  padding: 0.875rem 1.25rem;
  min-height: 48px;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

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

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

.data-table th, .data-table td {
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.data-table td.mono {
  font-family: var(--font-mono);
  color: var(--cyan-cold);
}

/* Method Note & Scientific Sources */
.method-note {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.method-note h3 {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.sources-list {
  list-style: none;
  margin-top: 1rem;
}

.sources-list li {
  margin-bottom: 0.75rem;
  padding-left: 1.25rem;
  position: relative;
  font-size: 0.875rem;
  line-height: 1.5;
}

.sources-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--cyan-cold);
  font-weight: bold;
}

/* Footer */
.site-footer {
  width: 100%;
  max-width: 1080px;
  margin: auto auto 0;
  padding: 2rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

@media (max-width: 600px) {
  .site-footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}
