:root {
  --bg-start: #0b1220;
  --bg-end: #05080f;
  --glass-bg: rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.18);
  --glass-glow: rgba(120,180,255,0.25);
  --text-primary: #f4f6fb;
  --text-secondary: #c6ccda;
  --accent-warm: #f5c27a;
  --accent-cool: #7db7ff;
  --radius-lg: 20px;
  --radius-md: 14px;
  --blur: 18px;
  --transition: 240ms ease;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(125,183,255,0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-start), var(--bg-end));
}
main { max-width: 1100px; margin: auto; padding: 64px 24px; }
.glass {
  backdrop-filter: blur(var(--blur));
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
nav { display: flex; gap: 20px; margin-bottom: 40px; }
nav a { color: var(--accent-cool); text-decoration: none; font-size: 0.9rem; }
.card-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  padding: 26px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border);
  transition: transform var(--transition);
}
.card:hover { transform: translateY(-6px); }
.footer {
  text-align: center;
  margin-top: 60px;
  font-size: 0.8rem;
  color: rgba(200,210,230,0.55);
}
/* ===============================
   Home Page Enhancements
   =============================== */

.hero {
  position: relative;
  overflow: hidden;
  min-height: 340px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 30% 30%, rgba(125,183,255,0.25), transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(245,194,122,0.18), transparent 45%);
  animation: slow-drift 22s linear infinite;
  pointer-events: none;
}

@keyframes slow-drift {
  0% { transform: translate(0,0); }
  50% { transform: translate(-4%, -2%); }
  100% { transform: translate(0,0); }
}

.card {
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(125,183,255,0.35);
  transition: box-shadow 240ms ease;
  pointer-events: none;
}

.card:hover::after {
  box-shadow: 0 0 0 1px rgba(125,183,255,0.35),
              0 0 40px rgba(125,183,255,0.25);
}

.card.primary {
  transform: translateY(-10px);
}

.card.primary h2 {
  font-size: 1.45rem;
}

.card .subtitle {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--accent-warm);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.atlas-teaser {
  margin-top: 48px;
  height: 160px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 20% 50%, rgba(125,183,255,0.25), transparent 50%),
    radial-gradient(circle at 80% 60%, rgba(245,194,122,0.18), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur));
}

/* ===============================
   Home Page Enhancements
   =============================== */

.hero {
  position: relative;
  overflow: hidden;
  min-height: 340px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 30% 30%, rgba(125,183,255,0.25), transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(245,194,122,0.18), transparent 45%);
  animation: slow-drift 22s linear infinite;
  pointer-events: none;
}

@keyframes slow-drift {
  0% { transform: translate(0,0); }
  50% { transform: translate(-4%, -2%); }
  100% { transform: translate(0,0); }
}

.card {
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(125,183,255,0.35);
  transition: box-shadow 240ms ease;
  pointer-events: none;
}

.card:hover::after {
  box-shadow: 0 0 0 1px rgba(125,183,255,0.35),
              0 0 40px rgba(125,183,255,0.25);
}

.card.primary {
  transform: translateY(-10px);
}

.card.primary h2 {
  font-size: 1.45rem;
}

.card .subtitle {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--accent-warm);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.atlas-teaser {
  margin-top: 48px;
  height: 160px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 20% 50%, rgba(125,183,255,0.25), transparent 50%),
    radial-gradient(circle at 80% 60%, rgba(245,194,122,0.18), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur));
}

/* ===============================
   Map View Instrument
   =============================== */

.map-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
}

.map-canvas {
  position: relative;
  height: 520px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 30% 40%, rgba(125,183,255,0.18), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(245,194,122,0.12), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--glass-border);
  overflow: hidden;
}

.map-canvas svg {
  width: 100%;
  height: 100%;
}

.node {
  fill: rgba(125,183,255,0.85);
  cursor: pointer;
  transition: r 160ms ease, fill 160ms ease;
}

.node:hover {
  r: 10;
  fill: rgba(245,194,122,0.95);
}

.edge {
  stroke: rgba(200,210,230,0.35);
  stroke-width: 1.5;
}

.info-panel {
  backdrop-filter: blur(var(--blur));
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.info-panel h2 {
  margin-top: 0;
}

.info-panel .hint {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--accent-warm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ===============================
   Home Atlas Teaser
   =============================== */

.atlas-teaser {
  margin: 56px 0;
  height: 180px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 25% 50%, rgba(125,183,255,0.25), transparent 50%),
    radial-gradient(circle at 75% 60%, rgba(245,194,122,0.18), transparent 55%);
  border: 1px solid var(--glass-border);
}

/* ===============================
   Map Node Cards
   =============================== */

.map-canvas {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.node-card {
  min-width: 160px;
  padding: 14px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(var(--blur));
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
}

.node-card:hover {
  box-shadow: 0 0 30px rgba(125,183,255,0.25);
}

.node-card .breadcrumbs {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-bottom: 6px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.map-canvas {
  position: relative;
}

#atlas-cards {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.node-card.spatial {
  position: absolute;
  pointer-events: auto;
  min-width: 160px;
  padding: 12px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(var(--blur));
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transform: translate(-50%, -50%);
}

.node-card.spatial:hover {
  box-shadow: 0 0 30px rgba(125,183,255,0.25);
}

.legend {
  margin-top: 16px;
  font-size: 0.85rem;
  opacity: 0.85;
}

/* Map v2: scrollable canvas */
.map-layout { overflow: visible; }
.map-canvas {
  position: relative;
  height: 720px;
  overflow-y: auto;
}

/* Map UI: top controls */
.map-top-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 16px;
  font-size: 0.9rem;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-group strong {
  color: rgba(200,210,230,0.85);
  font-weight: 600;
}

.toggle {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 6px 12px;
  color: rgba(240,245,255,0.9);
  cursor: default;
}

.toggle.active {
  box-shadow: 0 0 0 1px rgba(125,183,255,0.35),
              0 0 18px rgba(125,183,255,0.25);
}

/* Map UI: legend */
.map-legend {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.85rem;
  opacity: 0.9;
}

.map-legend ul {
  list-style: none;
  padding-left: 0;
}

.map-legend li {
  margin-bottom: 6px;
}

/* Map v2: lens styling */
.edge[data-lens="epistemic"] {
  stroke-dasharray: 4 3;
  stroke: rgba(245,194,122,.55);
}
