/* Nouăzeci de milimetri de mercur · Design System */
:root {
  --bg-abyss: #070D18;
  --bg-card: #0F172A;
  --bg-card-hover: #1E293B;
  --border-subtle: #1E293B;
  --border-active: #334155;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --hydro-cyan: #38BDF8;
  --hydro-cyan-glow: rgba(56, 189, 248, 0.25);
  --arterial-rose: #F43F5E;
  --arterial-glow: rgba(244, 63, 94, 0.25);
  --valve-amber: #F59E0B;
  --font-sans: -apple-system, BlinkMacSystemFont, "Plus Jakarta Sans", "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Space Mono", "Fira Code", monospace;
  --max-w: 860px;
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-abyss);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem 4rem;
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(56, 189, 248, 0.08) 0%, transparent 60%),
    linear-gradient(to bottom, #070D18, #0B1120);
}

/* Accessibility */
.sr-only {
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  min-width: 1px !important;
  max-width: 1px !important;
  position: absolute !important;
}

:focus-visible {
  outline: 2px solid var(--hydro-cyan);
  outline-offset: 3px;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-w);
}

/* Header & Nav */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--hydro-cyan);
}

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hydro-cyan);
  box-shadow: 0 0 8px var(--hydro-cyan);
}

.language-nav {
  display: flex;
  gap: 0.5rem;
}

.language-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.25rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.language-nav a:hover {
  color: var(--text-primary);
  border-color: var(--border-active);
}

.language-nav a.active {
  color: var(--hydro-cyan);
  border-color: var(--hydro-cyan);
  background: rgba(56, 189, 248, 0.1);
}

/* Hero Section */
.hero {
  margin-bottom: 3.5rem;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.hero__title-highlight {
  color: var(--hydro-cyan);
  background: linear-gradient(135deg, #38BDF8 0%, #BAE6FD 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.deck {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Scoreboard / Stat Cards */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 640px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card--danger::after {
  background: var(--arterial-rose);
}

.stat-card--success::after {
  background: var(--hydro-cyan);
}

.stat-card__label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-card__number {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.stat-card--danger .stat-card__number {
  color: var(--arterial-rose);
}

.stat-card--success .stat-card__number {
  color: var(--hydro-cyan);
}

.stat-card__desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Sections */
.section {
  margin-bottom: 4rem;
}

.section__title {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section__number {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--hydro-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

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

.prose p {
  margin-bottom: 1rem;
}

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

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

/* Interactive Station Box */
.interactive-station {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
  .interactive-station {
    padding: 2rem;
  }
}

.station-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.station-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.station-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Manometer Simulator Grid */
.simulator-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 680px) {
  .simulator-layout {
    grid-template-columns: 220px 1fr;
  }
}

/* Manometer Gauge Column */
.manometer-tube-box {
  background: #090E17;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.tube-svg {
  width: 100%;
  max-width: 160px;
  height: 280px;
}

.pressure-readout {
  margin-top: 1rem;
  text-align: center;
}

.pressure-readout__val {
  font-family: var(--font-mono);
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--hydro-cyan);
  transition: color 0.3s ease;
}

.pressure-readout__unit {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Valve and Step Controls */
.sim-controls {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.step-tracker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

.step-dots {
  display: flex;
  gap: 0.5rem;
  flex: 1 1 auto;
  justify-content: space-between;
}

.step-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 50%;
  background: var(--border-active);
  transition: all 0.3s ease;
}

.step-dot.active {
  background: var(--hydro-cyan);
  box-shadow: 0 0 10px var(--hydro-cyan);
}

.step-dot.passed {
  background: #0284C7;
}

@media (max-width: 679px) {
  .step-tracker {
    align-items: stretch;
    flex-direction: column;
  }

  .step-dots {
    width: 100%;
  }

  .step-tracker > span:last-child {
    align-self: flex-end;
  }
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
  font-family: var(--font-sans);
}

.button--primary {
  background: var(--hydro-cyan);
  color: #070D18;
}

.button--primary:hover {
  background: #7DD3FC;
  transform: translateY(-1px);
}

.button--secondary {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-active);
}

.button--secondary:hover {
  background: #334155;
}

.button--danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--arterial-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

.button--danger:hover {
  background: rgba(244, 63, 94, 0.25);
}

.valve-state-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.valve-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-right: 0.25rem;
}

.valve-badge--open {
  background: rgba(56, 189, 248, 0.2);
  color: var(--hydro-cyan);
}

.valve-badge--closed {
  background: rgba(244, 63, 94, 0.2);
  color: var(--arterial-rose);
}

/* Calculator Section */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .calc-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-label__val {
  font-family: var(--font-mono);
  color: var(--hydro-cyan);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--border-subtle);
  border-radius: 4px;
  outline: none;
  margin: 0.5rem 0;
}

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

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

.select-posture {
  display: flex;
  gap: 0.5rem;
}

.posture-btn {
  flex: 1;
  min-height: 44px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

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

.posture-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--hydro-cyan);
  color: var(--hydro-cyan);
}

.calc-results {
  background: rgba(7, 13, 24, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9375rem;
}

.result-row__label {
  color: var(--text-muted);
}

.result-row__val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

.result-row__val--highlight {
  color: var(--hydro-cyan);
}

.result-row__val--danger {
  color: var(--arterial-rose);
}

/* Guided Observation Protocol */
.protocol-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.protocol-step {
  display: flex;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem;
}

.protocol-step__num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--hydro-cyan);
  background: rgba(56, 189, 248, 0.1);
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.protocol-step__body strong {
  color: var(--text-primary);
}

/* Method and References Table */
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-card);
}

.data-table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.9375rem;
}

.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  background: rgba(15, 23, 42, 0.5);
}

.data-table td {
  color: var(--text-secondary);
}

.data-table tr:hover td {
  background: rgba(30, 41, 59, 0.3);
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

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

/* 404 Page */
.page-404 {
  justify-content: center;
}

.error-container {
  text-align: center;
  max-width: 480px;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
}

.manometer-mark {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--arterial-rose);
  margin-bottom: 1rem;
}

.error-container h1 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

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

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