:root {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-focus: #0284c7;
  --line-soft: rgba(0, 0, 0, 0.08);
  
  --danube-water: #0284c7;
  --danube-water-bg: rgba(2, 132, 199, 0.12);
  --arc-accent: #0284c7;
  --ray-accent: #d97706;
  --fortress-accent: #dc2626;
  --highlight-glow: rgba(2, 132, 199, 0.25);
  
  --street-base: #94a3b8;
  --street-dim: #cbd5e1;
  --street-active: #0f172a;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg-primary: #090d16;
  --bg-surface: #111827;
  --bg-card: rgba(17, 24, 39, 0.92);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #1f293d;
  --border-focus: #38bdf8;
  --line-soft: rgba(255, 255, 255, 0.08);
  
  --danube-water: #38bdf8;
  --danube-water-bg: rgba(56, 189, 248, 0.12);
  --arc-accent: #38bdf8;
  --ray-accent: #fbbf24;
  --fortress-accent: #f87171;
  --highlight-glow: rgba(56, 189, 248, 0.25);
  
  --street-base: #334155;
  --street-dim: #1e293b;
  --street-active: #f8fafc;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
}

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

.topbar-brand .badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: var(--danube-water-bg);
  color: var(--danube-water);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switch {
  display: flex;
  align-items: center;
  background: var(--line-soft);
  padding: 2px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.lang-switch a {
  padding: 0.25rem 0.6rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.lang-switch a.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: var(--line-soft);
  border-color: var(--border-focus);
}

/* Layout: Hero & Stage */
.hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1.5rem;
  text-align: center;
}

.hero-tag {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--danube-water);
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 1rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.hero-standfirst {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 760px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
}

/* Interactive Split Stage */
.stage-container {
  max-width: 1280px;
  margin: 0 auto 3rem;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .stage-container {
    grid-template-columns: 1fr;
  }
}

.stage-viewport {
  position: sticky;
  top: 68px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .stage-viewport {
    position: sticky;
    top: 52px;
    height: 38svh;
    min-height: 240px;
    padding: 0.5rem;
    z-index: 50;
  }
}

.canvas-wrap {
  width: 100%;
  aspect-ratio: 16 / 11;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
}

@media (max-width: 768px) {
  .canvas-wrap {
    aspect-ratio: auto;
    height: 100%;
  }
}

.map-svg {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--bg-surface);
  user-select: none;
}

.danube-water {
  fill: var(--danube-water-bg);
  stroke: var(--danube-water);
  stroke-width: 4px;
}

.concentric-ring {
  fill: none;
  stroke: var(--arc-accent);
  stroke-width: 4px;
  stroke-opacity: 0.7;
}

.concentric-ring.fortress {
  stroke: var(--fortress-accent);
  stroke-width: 6px;
  stroke-opacity: 0.85;
}

.concentric-ring.dashed {
  stroke-dasharray: 16, 12;
  stroke-width: 3px;
}

.radial-ray {
  stroke: var(--ray-accent);
  stroke-width: 3.5px;
  stroke-dasharray: 12, 12;
  stroke-opacity: 0.75;
}

.street-line {
  fill: none;
  stroke: var(--street-base);
  stroke-width: 3.2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  cursor: pointer;
  transition: stroke 0.15s ease, stroke-width 0.15s ease;
}

.street-line:hover {
  stroke: var(--danube-water);
  stroke-width: 9px;
}

.street-line.selected {
  stroke: var(--danube-water);
  stroke-width: 11px;
}

.street-line.in-sweep {
  stroke: var(--danube-water);
  stroke-width: 8px;
}

.street-line.in-ray-sweep {
  stroke: var(--ray-accent);
  stroke-width: 8px;
}

.map-label {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  fill: var(--text-muted);
  pointer-events: none;
}

.danube-label {
  font-family: var(--font-sans);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 6px;
  fill: var(--danube-water);
  opacity: 0.7;
  pointer-events: none;
}

.sweep-circle {
  fill: none;
  stroke: var(--danube-water);
  stroke-width: 8px;
  stroke-opacity: 0.8;
  pointer-events: none;
  display: none;
}
.sweep-circle.active {
  display: block;
}

.sweep-ray {
  stroke: var(--ray-accent);
  stroke-width: 8px;
  stroke-opacity: 0.8;
  pointer-events: none;
  display: none;
}
.sweep-ray.active {
  display: block;
}

.canvas-overlay-stats {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  pointer-events: none;
  font-family: var(--font-mono);
}

.canvas-overlay-stats strong {
  color: var(--danube-water);
}

.canvas-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Sidebar / Controls Panel */
.stage-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Search Box */
.search-box {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  padding-left: 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.15s ease;
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--highlight-glow);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-results {
  margin-top: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  display: none;
}

.search-results.active {
  display: block;
}

.search-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover, .search-item.selected {
  background: var(--danube-water-bg);
  color: var(--danube-water);
}

.search-item.empty {
  color: var(--text-muted);
  cursor: default;
}

.search-item .item-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.detail-zone {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
}

.detail-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.radius-value {
  font-family: var(--font-mono);
  color: var(--danube-water);
  font-weight: 700;
}

.angle-value {
  font-family: var(--font-mono);
  color: var(--ray-accent);
  font-weight: 700;
}

.share-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

/* Selected Street Detail Card */
.street-detail {
  display: none;
  margin-top: 0.75rem;
  padding: 0.85rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--danube-water);
  font-size: 0.85rem;
}

.street-detail.active {
  display: block;
}

.street-detail h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.street-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.stat-cell {
  background: var(--bg-surface);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.stat-cell .label {
  color: var(--text-muted);
  font-size: 0.7rem;
  display: block;
}

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

/* Dial & Sliders */
.control-group {
  margin-bottom: 1rem;
}

.control-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.range-slider {
  width: 100%;
  accent-color: var(--danube-water);
}

.preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.preset-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-pill:hover, .preset-pill.active {
  background: var(--danube-water-bg);
  border-color: var(--danube-water);
  color: var(--danube-water);
}

.btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-reset:hover {
  background: var(--line-soft);
  color: var(--text-primary);
}

/* Scrollytelling Sections */
.story-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.story-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.story-section:last-child {
  border-bottom: none;
}

.story-section h2 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
  line-height: 1.25;
}

.story-section p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

.story-section p:last-child {
  margin-bottom: 0;
}

.metric-callout {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--bg-surface);
  border-left: 4px solid var(--danube-water);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border: 1px solid var(--border);
  border-left-width: 4px;
}

.metric-callout .metric-num {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--danube-water);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.metric-callout .metric-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Proof Table */
.data-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

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

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

.data-table th {
  background: var(--bg-surface);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

.data-table tr:hover td {
  background: var(--danube-water-bg);
}

/* Footer & Share */
.page-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 3rem 1.25rem 2rem;
  text-align: center;
}

.share-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.share-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.share-btn:hover {
  background: var(--line-soft);
  border-color: var(--border-focus);
}

.footer-nav {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

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

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

.footer-credits {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Back to top button */
.btn-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  transition: all 0.2s ease;
}

.btn-to-top.visible {
  display: inline-flex;
}

.btn-to-top:hover {
  background: var(--line-soft);
}

/* Reading Rail */
.reading-rail {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 80;
}

@media (max-width: 1200px) {
  .reading-rail {
    display: none;
  }
}

.rail-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  text-decoration: none;
  position: relative;
}

.rail-dot .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg-primary);
  transition: all 0.2s ease;
  display: block;
}

.rail-dot:hover .dot, .rail-dot[aria-current="true"] .dot {
  background: var(--danube-water);
  transform: scale(1.3);
}

.rail-dot .rail-label {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.rail-dot:hover .rail-label, .rail-dot:focus .rail-label {
  opacity: 1;
}

/* Contrast probe / print */
@media print {
  .topbar, .stage-panel, .reading-rail, .btn-to-top, .share-row {
    display: none !important;
  }
  .stage-container {
    display: block;
  }
}

/* Brăila field atlas: a measured present-day map beside its documentary trail. */
:root {
  --bg-primary: #f4f1e8;
  --bg-surface: #fffdf7;
  --bg-card: rgba(255, 253, 247, 0.96);
  --text-primary: #19292d;
  --text-secondary: #34484c;
  --text-muted: #3e5053;
  --border: #c9d0c8;
  --border-focus: #005f68;
  --line-soft: rgba(25, 41, 45, 0.1);
  --danube-water: #00535b;
  --danube-water-bg: rgba(0, 106, 115, 0.12);
  --arc-accent: #8a4a26;
  --ray-accent: #634900;
  --fortress-accent: #7b2b27;
  --highlight-glow: rgba(0, 106, 115, 0.2);
  --street-base: #667779;
  --street-dim: #aeb8b4;
  --street-active: #19292d;
  --font-sans: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

[data-theme="dark"] {
  --bg-primary: #10191b;
  --bg-surface: #182629;
  --bg-card: rgba(24, 38, 41, 0.96);
  --text-primary: #f3f0e6;
  --text-secondary: #d4ddd8;
  --text-muted: #bdcbc5;
  --border: #425355;
  --border-focus: #8ce0df;
  --line-soft: rgba(243, 240, 230, 0.12);
  --danube-water: #8ce0df;
  --danube-water-bg: rgba(140, 224, 223, 0.13);
  --arc-accent: #f0ac75;
  --ray-accent: #f1d16b;
  --fortress-accent: #ff9c88;
  --highlight-glow: rgba(140, 224, 223, 0.22);
  --street-base: #9eafaa;
  --street-dim: #526568;
  --street-active: #f3f0e6;
}

html { scroll-behavior: smooth; }
body { background: var(--bg-primary); color: var(--text-primary); }
:focus-visible { outline: 3px solid var(--border-focus); outline-offset: 3px; }

.topbar { padding-inline: clamp(1rem, 4vw, 3.5rem); }
.hero {
  max-width: 1480px;
  padding: clamp(3.5rem, 8vw, 7rem) clamp(1.25rem, 5vw, 5rem) 3rem;
  text-align: left;
}
.hero-tag, .story-index, .map-kicker {
  color: var(--danube-water);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.35;
  text-transform: uppercase;
}
.hero-tag { margin-bottom: 1.1rem; }
.hero h1 {
  max-width: 1120px;
  margin: 0 0 1.2rem;
  font: 500 clamp(2.7rem, 6.5vw, 6.4rem)/0.99 var(--font-display);
  letter-spacing: -0.052em;
}
.hero-standfirst {
  max-width: 810px;
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(1.08rem, 1.7vw, 1.34rem);
  line-height: 1.65;
}

.story-layout {
  width: min(100% - 2.5rem, 1480px);
  margin: 0 auto 5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 0.97fr);
  gap: clamp(2.5rem, 6vw, 7rem);
  align-items: stretch;
}
.stage-column { min-width: 0; }
.stage-container {
  position: sticky;
  top: 68px;
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
.stage-viewport {
  position: static;
  height: min(70svh, 700px);
  min-height: 480px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-surface);
  box-shadow: 0 20px 60px -42px var(--text-primary);
}
.canvas-wrap {
  height: calc(100% - 2.5rem);
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 13px;
  background: var(--bg-primary);
}
.map-svg { background: var(--bg-primary); }
.danube-water { fill: var(--danube-water-bg); stroke: var(--danube-water); stroke-width: 12px; }
.concentric-ring { stroke: var(--arc-accent); stroke-width: 12px; stroke-opacity: 0.9; }
.concentric-ring.independence-guide { stroke: var(--fortress-accent); }
.concentric-ring.dorobanti-guide { stroke: var(--text-muted); stroke-opacity: 0.75; }
.concentric-ring.dashed { stroke-dasharray: 30 22; }
.radial-ray { stroke: var(--ray-accent); stroke-width: 10px; stroke-dasharray: 25 24; stroke-opacity: 0.8; }
.street-line {
  stroke: var(--street-base);
  stroke-width: 15px;
  stroke-opacity: 0.58;
  transition: opacity 0.3s ease, stroke 0.3s ease, stroke-width 0.3s ease;
}
.street-line:hover { stroke: var(--danube-water); stroke-width: 36px; stroke-opacity: 1; }
.street-line.selected, .street-line.in-sweep, .street-line.in-ray-sweep { stroke-width: 36px; stroke-opacity: 1; }
.street-line.selected, .street-line.in-sweep { stroke: var(--danube-water); }
.street-line.in-ray-sweep { stroke: var(--ray-accent); }
.map-label { font: 700 76px/1 var(--font-sans); fill: var(--text-primary); paint-order: stroke; stroke: var(--bg-primary); stroke-width: 13px; stroke-linejoin: round; }
.danube-label { font: 800 98px/1 var(--font-sans); letter-spacing: 8px; fill: var(--danube-water); opacity: 0.9; }
.independence-label { fill: var(--fortress-accent); }
.dorobanti-label { fill: var(--text-muted); }
.canvas-overlay-stats {
  top: 0.9rem;
  left: 0.9rem;
  max-width: calc(100% - 1.8rem);
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  color: var(--text-primary);
  font: 700 0.74rem/1.45 var(--font-sans);
}
.map-kicker { margin-bottom: 0.2rem; font-size: 0.62rem; }
.map-scene-caption {
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.8rem;
  z-index: 2;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.4;
  backdrop-filter: blur(8px);
}
.canvas-controls-row { margin-top: 0.6rem; color: var(--text-muted); font-size: 0.78rem; }
.stage-panel { display: grid; gap: 0.8rem; margin-top: 1rem; }
.card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-surface);
  box-shadow: none;
}
.card-title { color: var(--text-primary); font-size: 0.86rem; }
.search-input, .preset-pill, .btn-reset { color: var(--text-primary); }
.search-item:hover, .search-item.selected { color: var(--text-primary); }

#mapSvg[data-scene="geometry"] .street-line { opacity: 0.2; }
#mapSvg[data-scene="geometry"] .street-line[data-name="Bulevardul Alexandru Ioan Cuza"] { opacity: 1; stroke: var(--arc-accent); stroke-width: 28px; }
#mapSvg[data-scene="ditch"] .street-line { opacity: 0.14; }
#mapSvg[data-scene="ditch"] .street-line[data-name="Bulevardul Independenței"] { opacity: 1; stroke: var(--fortress-accent); stroke-width: 30px; }
#mapSvg[data-scene="plan"] .street-line { opacity: 0.19; }
#mapSvg[data-scene="plan"] .reference-rings { opacity: 1; }
#mapSvg[data-scene="port"] .street-line { opacity: 0.16; }
#mapSvg[data-scene="port"] .street-line[data-name="Strada Mihai Eminescu"],
#mapSvg[data-scene="port"] .street-line[data-name="Calea Galați"],
#mapSvg[data-scene="port"] .street-line[data-name="Calea Călărașilor"] { opacity: 1; stroke: var(--ray-accent); stroke-width: 29px; }
#mapSvg[data-scene="underground"] .street-line { opacity: 0.08; }
#mapSvg[data-scene="underground"] .danube-water { opacity: 0.42; }

.story-container {
  grid-column: 2;
  grid-row: 1;
  max-width: none;
  margin: 0;
  padding: 0 0 4rem;
}
.story-section {
  min-height: 66svh;
  padding: clamp(3rem, 7vh, 6rem) 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  scroll-margin-top: 5rem;
}
.story-section h2 {
  max-width: 18ch;
  margin: 0.7rem 0 1.2rem;
  font: 500 clamp(1.9rem, 3.2vw, 3.25rem)/1.08 var(--font-display);
  letter-spacing: -0.035em;
}
.story-section p { max-width: 62ch; font-size: 1rem; line-height: 1.75; }
.story-section p:last-child { margin-bottom: 0; }
.story-index { display: inline-flex; align-items: center; gap: 0.55rem; }
.story-index::before { content: ""; width: 1.8rem; height: 1px; background: currentColor; }
.metric-callout {
  margin: 1.4rem 0;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--arc-accent);
  border-radius: 0 13px 13px 0;
  background: var(--bg-surface);
}
.metric-callout--clay { border-left-color: var(--fortress-accent); }
.metric-callout--sand { border-left-color: var(--ray-accent); }
.metric-callout .metric-num { color: var(--arc-accent); font: 700 clamp(1.8rem, 3vw, 2.6rem)/1.1 var(--font-sans); letter-spacing: -0.04em; }
.metric-callout--clay .metric-num { color: var(--fortress-accent); }
.metric-callout--sand .metric-num { color: var(--ray-accent); }
.metric-callout .metric-label { margin-top: 0.35rem; color: var(--text-primary); font-weight: 700; line-height: 1.45; }
.metric-callout .metric-desc, .method-note { margin-top: 0.5rem; color: var(--text-secondary); font-size: 0.87rem; line-height: 1.6; }
.timeline { list-style: none; margin: 1.1rem 0 1.4rem; padding: 0 0 0 1.1rem; border-left: 2px solid var(--border); }
.timeline li { position: relative; display: grid; grid-template-columns: minmax(7.5rem, auto) 1fr; gap: 0.6rem; padding: 0.55rem 0 0.55rem 0.9rem; color: var(--text-secondary); }
.timeline li::before { content: ""; position: absolute; left: -1.47rem; top: 1rem; width: 0.55rem; height: 0.55rem; border: 2px solid var(--danube-water); border-radius: 50%; background: var(--bg-primary); }
.timeline time { color: var(--text-primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.data-table-wrap { margin: 1.25rem 0; border-color: var(--border); background: var(--bg-surface); }
.data-table { min-width: 520px; color: var(--text-secondary); font-size: 0.82rem; }
.data-table caption { padding: 0.75rem; color: var(--text-secondary); text-align: left; font-weight: 600; }
.data-table th { background: var(--bg-primary); color: var(--text-primary); }
.source-notes { margin-top: 1rem; padding: 1.1rem; border-top: 1px solid var(--border); background: var(--bg-surface); }
.source-notes h3 { margin-bottom: 0.6rem; font: 600 1.3rem var(--font-display); }
.source-notes p { font-size: 0.83rem; line-height: 1.55; }
.source-notes a, .story-section a { color: var(--border-focus); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

.rail-dot[aria-current="true"] .dot { background: var(--danube-water); }
.page-footer { margin-top: 2rem; background: var(--bg-surface); color: var(--text-primary); }
.footer-nav a, .footer-credits { color: var(--text-muted); }

@media (max-width: 960px) {
  .story-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; }
  .stage-viewport { height: min(67svh, 640px); min-height: 420px; }
}
@media (max-width: 760px) {
  html { scroll-behavior: auto; }
  .hero { padding: 2.8rem 1.1rem 2rem; }
  .hero h1 { font-size: clamp(2.4rem, 12vw, 4rem); }
  .story-layout { width: calc(100% - 2rem); grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; gap: 2rem; margin-bottom: 2rem; align-items: start; }
  .stage-column { display: contents; }
  .stage-container { position: sticky; top: 52px; z-index: 55; grid-column: 1; grid-row: 1; align-self: start; }
  .stage-viewport { position: static; top: auto; z-index: 50; height: clamp(190px, 35svh, 310px); min-height: 0; padding: 0.45rem; border-radius: 13px; }
  .canvas-wrap { height: calc(100% - 2rem); border-radius: 9px; }
  .canvas-overlay-stats { top: 0.45rem; left: 0.45rem; padding: 0.4rem 0.5rem; font-size: 0.65rem; }
  .map-kicker { font-size: 0.52rem; }
  .map-scene-caption { left: 0.45rem; right: 0.45rem; bottom: 0.45rem; padding: 0.35rem 0.45rem; font-size: 0.65rem; }
  .canvas-controls-row { margin-top: 0.35rem; font-size: 0.72rem; }
  .stage-panel { grid-column: 1; grid-row: 2; margin-top: 1rem; }
  .story-container { grid-column: 1; grid-row: 1; margin-top: calc(clamp(190px, 35svh, 310px) + 1rem); padding-bottom: 2rem; position: relative; z-index: 1; }
  .story-section { min-height: 0; padding: 2.8rem 0; }
  .story-section h2 { font-size: clamp(1.85rem, 8vw, 2.5rem); }
  .story-section p { font-size: 0.97rem; }
  .timeline li { grid-template-columns: 1fr; gap: 0.05rem; }
  .reading-rail { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
@media print {
  .stage-container { position: static; }
  .story-layout { display: block; }
  .story-section { min-height: 0; }
}
