/* Patruzeci și trei de dioptrii · Stiluri vizuale banc optic */

:root {
  --bg-deep: #070b19;
  --bg-surface: #0f172a;
  --bg-card: #131d38;
  --bg-card-hover: #1a274a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --ray-gold: #fbbf24;
  --ray-gold-glow: rgba(251, 191, 36, 0.25);
  --water-cyan: #38bdf8;
  --water-cyan-dark: #0284c7;
  --water-bg: rgba(56, 189, 248, 0.08);
  --fovea-coral: #f43f5e;
  --cornea-teal: #2dd4bf;
  
  --border-subtle: #1e293b;
  --border-medium: #334155;
  --border-accent: rgba(56, 189, 248, 0.3);
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", Menlo, Monaco, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-deep);
  color: var(--text-main);
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  line-height: 1.65;
  background: radial-gradient(circle at 50% 0%, #111c38 0%, #070b19 70%);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* Header & Navigation */
header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(7, 11, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.brand-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.lang-switch {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 9999px;
  padding: 0.2rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.lang-link {
  padding: 0.3rem 0.65rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 9999px;
  transition: all 0.2s ease;
}

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

.lang-link.active {
  background: var(--water-cyan);
  color: var(--bg-deep);
}

/* Hero Section */
.hero {
  max-width: 860px;
  margin: 3.5rem auto 2.5rem;
  padding: 0 1.25rem;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid var(--border-accent);
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  color: var(--water-cyan);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.hero-pill-dot {
  width: 6px;
  height: 6px;
  background: var(--water-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--water-cyan);
}

h1 {
  font-size: 2.75rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-deck {
  font-size: 1.22rem;
  line-height: 1.6;
  color: #cbd5e1;
  max-width: 760px;
  margin: 0 auto 2rem;
}

/* Stat Grid */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 960px;
  margin: 0 auto 3rem;
  padding: 0 1.25rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient, linear-gradient(90deg, #38bdf8, #818cf8));
}

.stat-card.cornea {
  --accent-gradient: linear-gradient(90deg, #2dd4bf, #38bdf8);
}

.stat-card.lens {
  --accent-gradient: linear-gradient(90deg, #818cf8, #c084fc);
}

.stat-card.water {
  --accent-gradient: linear-gradient(90deg, #f43f5e, #fb7185);
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

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

.stat-desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin: 0;
}

/* Main Content Layout */
.main-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.prose-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 1.25rem;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
}

.prose-block h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.prose-block h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 1.75rem 0 0.75rem;
  color: var(--text-main);
}

.prose-block p {
  color: #cbd5e1;
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 0 1.25rem;
}

.prose-block p:last-child {
  margin-bottom: 0;
}

/* Callout Box */
.callout {
  background: rgba(56, 189, 248, 0.06);
  border-left: 4px solid var(--water-cyan);
  border-radius: 0 0.75rem 0.75rem 0;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}

.callout-title {
  font-weight: 700;
  color: var(--water-cyan);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}

.callout p {
  font-size: 0.95rem;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.6;
}

/* Interactive Simulator Container */
.interactive-section {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 1.25rem;
  padding: 2rem;
  margin: 2.5rem 0;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.interactive-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.interactive-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.interactive-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

.controls-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-mode {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-mode:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--water-cyan);
}

.btn-mode.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--water-cyan);
  color: var(--water-cyan);
}

/* Canvas Display */
.canvas-wrapper {
  position: relative;
  background: #040711;
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

canvas.optical-bench {
  display: block;
  width: 100%;
  height: 340px;
  background: #040711;
}

.bench-readouts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1rem;
}

.readout-item {
  display: flex;
  flex-direction: column;
}

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

.readout-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.readout-val.accent-gold {
  color: var(--ray-gold);
}

.readout-val.accent-cyan {
  color: var(--water-cyan);
}

.readout-val.accent-coral {
  color: var(--fovea-coral);
}

/* Sliders Grid */
.sliders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.slider-name {
  color: var(--text-muted);
  font-weight: 500;
}

.slider-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  outline: none;
  margin: 0.4rem 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--water-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  transition: transform 0.1s ease;
}

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

/* Blur & Moken Simulator */
.vision-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.vision-card {
  background: #040711;
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vision-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
}

.vision-card.air .vision-card-title {
  color: var(--ray-gold);
}

.vision-card.underwater .vision-card-title {
  color: var(--water-cyan);
}

.chart-preview-box {
  width: 100%;
  height: 180px;
  background: #080c18;
  border: 1px solid var(--border-medium);
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.snellen-e {
  font-family: var(--font-mono);
  font-weight: 900;
  line-height: 1;
  color: #fff;
  transition: filter 0.3s ease;
}

.snellen-e.large { font-size: 4rem; }
.snellen-e.medium { font-size: 2.2rem; }
.snellen-e.small { font-size: 1.2rem; }

.moken-toggle-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-top: 1rem;
}

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

.calc-input-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.calc-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.calc-input, .calc-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 0.5rem;
  padding: 0.65rem 0.85rem;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  outline: none;
}

.calc-input:focus, .calc-select:focus {
  border-color: var(--water-cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.calc-results-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid #1e293b;
  font-size: 0.9rem;
}

.calc-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.calc-row-label {
  color: var(--text-muted);
}

.calc-row-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
}

/* Optics Anatomy Table */
.data-table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 0.75rem;
  border: 1px solid var(--border-subtle);
}

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

table.optics-table th {
  background: #111c38;
  color: #f8fafc;
  padding: 0.85rem 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-medium);
}

table.optics-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: #cbd5e1;
}

table.optics-table tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.5);
}

table.optics-table tr:hover {
  background: rgba(56, 189, 248, 0.04);
}

/* Scientific Method & References */
.scientific-note {
  background: #090e1f;
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 2rem;
  margin-top: 3rem;
}

.scientific-note h3 {
  font-size: 1.15rem;
  color: var(--water-cyan);
  margin-top: 0;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ref-list {
  padding-left: 1.25rem;
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.ref-list li {
  margin-bottom: 0.6rem;
}

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

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

/* Footer */
footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  padding: 3rem 1.25rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.footer-inner {
  max-width: 860px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

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

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

/* Responsive Breakpoints */
@media (max-width: 768px) {
  h1 {
    font-size: 2.1rem;
  }
  
  .hero-deck {
    font-size: 1.05rem;
  }
  
  .stat-strip {
    grid-template-columns: 1fr;
  }
  
  .prose-block {
    padding: 1.5rem;
  }
  
  .interactive-section {
    padding: 1.25rem;
  }
  
  canvas.optical-bench {
    height: 260px;
  }
  
  .vision-comparison-grid, .calc-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.75rem;
  }
  
  .nav-inner {
    padding: 0.75rem 1rem;
  }
}

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