/* Cele două griuri - Site Stylesheet */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("AtkinsonHyperlegibleNext.abde1ad5cf78.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("IBMPlexMono-Regular.81fc864103e7.woff2") format("woff2");
}

:root {
  --font-sans: "Atkinson Hyperlegible Next", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Theme variables - Dark Mode (Default) */
  --bg-base: #0c1017;
  --bg-surface: #141b26;
  --bg-surface-elevated: #1c2636;
  --border-subtle: #27364b;
  --border-focus: #38bdf8;
  --text-primary: #f0f4fc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-primary: #38bdf8;
  --accent-secondary: #f59e0b;
  --accent-success: #10b981;
  --accent-error: #f43f5e;
  --stage-bezel: #1e293b;
  --shadow-elevation: 0 12px 36px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --border-subtle: #cbd5e1;
  --border-focus: #0284c7;
  --text-primary: #090d16; /* WCAG AAA high-contrast ink */
  --text-secondary: #1e293b;
  --text-muted: #475569;
  --accent-primary: #0284c7;
  --accent-secondary: #d97706;
  --accent-success: #059669;
  --accent-error: #e11d48;
  --stage-bezel: #e2e8f0;
  --shadow-elevation: 0 12px 36px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
}

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

html {
  font-size: 16px;
  line-height: 1.6;
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-secondary);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  padding: 0 1rem 3rem;
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  background: var(--accent-primary);
  color: #ffffff;
  padding: 0.5rem 1rem;
  font-weight: 700;
  z-index: 100;
  border-radius: 4px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* Container */
.page-container {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

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

.brand-link {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

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

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switch, .theme-toggle {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.lang-switch:hover, .theme-toggle:hover {
  border-color: var(--accent-primary);
}

.lang-switch:focus-visible, .theme-toggle:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Hero Section */
.hero-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-title {
  font-size: clamp(1.85rem, 5vw, 2.65rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.hero-deck {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Optical Bench Component */
.bench-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: var(--shadow-elevation);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.bench-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.85rem;
}

.round-pills {
  display: flex;
  gap: 0.4rem;
  list-style: none;
}

.round-pill {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.round-pill.active {
  background: var(--accent-primary);
  color: #0c1017;
  border-color: var(--accent-primary);
  font-weight: 700;
}

.round-pill.done {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.round-meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Stage Canvas */
.stage-wrapper {
  position: relative;
  width: 100%;
  background: var(--stage-bezel);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.stage-svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
}

/* Controls Panel */
.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

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

.vernier-slider {
  width: 100%;
  height: 2.5rem;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.vernier-slider:focus-visible {
  outline: none;
}

.vernier-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 0.65rem;
  background: linear-gradient(to right, #000000, #808080, #ffffff);
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
}

.vernier-slider::-moz-range-track {
  width: 100%;
  height: 0.65rem;
  background: linear-gradient(to right, #000000, #808080, #ffffff);
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
}

.vernier-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 1.75rem;
  width: 1.75rem;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  margin-top: -0.55rem;
  transition: transform 0.1s ease;
}

.vernier-slider::-moz-range-thumb {
  height: 1.75rem;
  width: 1.75rem;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  border: none;
}

.vernier-slider:active::-webkit-slider-thumb {
  transform: scale(1.15);
}

.action-row {
  display: flex;
  gap: 0.75rem;
}

.btn-primary {
  flex: 1;
  background: var(--accent-primary);
  color: #0c1017;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: filter 0.15s ease, transform 0.1s ease;
}

[data-theme="light"] .btn-primary {
  color: #ffffff;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* Feedback banner */
.result-banner {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: fadeIn 0.3s ease;
}

.result-banner.hidden {
  display: none;
}

.banner-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

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

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

.stat-value {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
}

.banner-insight {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Summary Card */
.summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: var(--shadow-elevation);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.summary-card.hidden {
  display: none;
}

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

.strip-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.strip-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.swatch-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  border-radius: 8px;
  overflow: hidden;
}

.swatch-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.swatch-dual {
  width: 100%;
  height: 4.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  display: flex;
  overflow: hidden;
}

.swatch-target, .swatch-user {
  flex: 1;
  height: 100%;
}

.swatch-caption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.swatch-delta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
}

.delta-pos {
  color: var(--accent-secondary);
}

.delta-neg {
  color: var(--accent-primary);
}

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

.summary-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

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

/* Editorial Explainer Sections */
.article-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.prose {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.prose p {
  color: var(--text-secondary);
}

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

.mechanism-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

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

.mechanism-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-text {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* Sources & Trust */
.sources-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.source-item {
  color: var(--text-muted);
  line-height: 1.45;
}

.source-item a {
  color: var(--accent-primary);
  text-decoration: underline;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-nav {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

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

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
