/* ==========================================================================
   Pădurea din pixel / How Much Forest Is in a Pixel?
   Theme: Precision Cartographic Reticle & Spatial Support Optics
   ========================================================================== */

:root {
  --bg-deep: #06110c;
  --bg-panel: #0b1d15;
  --bg-card: #10271d;
  --bg-card-hover: #153225;
  --border-subtle: #1c4230;
  --border-focus: #2d6b4f;
  
  --text-main: #e6f4ed;
  --text-muted: #95b3a3;
  --text-faint: #5a7d6d;
  
  --accent-laser: #34d399;
  --accent-phosphor: #a3e635;
  --accent-gold: #fbbf24;
  --accent-cyan: #38bdf8;
  --accent-danger: #f87171;
  
  --font-serif: "Newsreader", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

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

html {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  color: var(--accent-phosphor);
}

a:focus-visible, button:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent-phosphor);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Meta Bar */
.site-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(6, 17, 12, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.85rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.brand-badge:hover {
  color: var(--accent-laser);
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-laser);
  box-shadow: 0 0 8px var(--accent-laser);
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-panel);
  padding: 2px;
}

.lang-link {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 4px;
}

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

/* Hero Section */
.hero {
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: radial-gradient(circle at 50% -20%, rgba(52, 211, 153, 0.12), transparent 70%);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-phosphor);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
  background: rgba(163, 230, 53, 0.08);
  border: 1px solid rgba(163, 230, 53, 0.25);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 500;
  line-height: 1.15;
  color: #ffffff;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.hero-deck {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 44rem;
}

/* Interactive Reticle Explorer */
.explorer-section {
  padding: 3rem 0;
}

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

@media (max-width: 820px) {
  .explorer-grid {
    grid-template-columns: 1fr;
  }
}

.reticle-wrapper {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.reticle-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.reticle-canvas-container {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  background: #040c08;
  border: 1px solid var(--border-focus);
  border-radius: 8px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#reticle-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.reticle-legend {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.gold { background: var(--accent-gold); }
.legend-dot.emerald { background: var(--accent-laser); }
.legend-dot.cyan { background: var(--accent-cyan); }

/* Control & Readout Panel */
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.control-group {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
}

.control-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 0.65rem;
}

.select-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  cursor: pointer;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.65rem 0.5rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.toggle-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.toggle-btn.active {
  background: rgba(52, 211, 153, 0.15);
  border-color: var(--accent-laser);
  color: var(--accent-laser);
  font-weight: 700;
}

/* Metric Display Cards */
.metric-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.metric-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.metric-card.highlight {
  grid-column: span 2;
  border-color: rgba(52, 211, 153, 0.4);
  background: linear-gradient(180deg, rgba(16, 39, 29, 0.8), var(--bg-panel));
}

.metric-card-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 0.35rem;
}

.metric-card-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.metric-card.highlight .metric-card-value {
  font-size: 2rem;
  color: var(--accent-laser);
}

.metric-card-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.delta-neutral { color: var(--text-muted); }
.delta-negative { color: var(--accent-danger); }
.delta-positive { color: var(--accent-phosphor); }

/* Editorial Body */
.prose-section {
  padding: 3rem 0;
  max-width: 48rem;
  margin: 0 auto;
}

.prose-section h2 {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 500;
  color: #ffffff;
  margin: 2.5rem 0 1rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.prose-section p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-main);
  margin-bottom: 1.35rem;
}

.callout-box {
  background: var(--bg-panel);
  border-left: 4px solid var(--accent-laser);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}

.callout-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-laser);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.callout-box p {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

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

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

.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-variant-numeric: tabular-nums;
}

.data-table th {
  background: var(--bg-card);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

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

.data-table tr:hover td {
  background: rgba(52, 211, 153, 0.05);
}

/* Methodological Note & Sources */
.methodology {
  background: var(--bg-panel);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0;
  margin-top: 3rem;
}

.methodology h3 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-phosphor);
  margin-bottom: 1.25rem;
}

.methodology p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-focus);
  color: var(--text-main);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 40;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--accent-laser);
  color: var(--bg-deep);
  transform: translateY(-2px);
}

/* Site Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  padding: 2.5rem 0;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

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

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