:root{
  --bg:#08090b;
  --panel:#101215;
  --panel2:#15181c;
  --line:#292d33;
  --text:#f1f2f3;
  --muted:#969ca5;
  --accent:#d8ff45;
}

*{box-sizing:border-box}

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,sans-serif;
}

header{
  position:sticky;
  top:0;
  z-index:10;
  backdrop-filter:blur(18px);
  background:rgba(8,9,11,.88);
  border-bottom:1px solid var(--line);
  padding:16px 28px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:30px;
}

.brand{
  font-weight:800;
  font-size:1.35rem;
  letter-spacing:-.04em;
}

.eyebrow{
  color:var(--muted);
  font-size:.68rem;
  letter-spacing:.19em;
}

nav{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
}

nav button{
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--muted);
  padding:8px 11px;
  cursor:pointer;
}

nav button:hover,
nav button.active{
  color:var(--text);
  background:#1b1e23;
}

main{
  max-width:1250px;
  min-height:80vh;
  margin:auto;
  padding:65px 28px 100px;
}

.view{display:none}
.view.active{display:block}

.hero{
  min-height:330px;
  display:flex;
  justify-content:space-between;
  gap:30px;
}

h1{
  margin:.4rem 0;
  font-size:clamp(3rem,8vw,7rem);
  line-height:.9;
  letter-spacing:-.065em;
}

h2{letter-spacing:-.035em}

.lead{
  font-size:1.25rem;
  line-height:1.6;
  color:var(--muted);
  max-width:780px;
}

.status{
  height:max-content;
  border:1px solid var(--line);
  padding:12px 16px;
  border-radius:100px;
  color:var(--muted);
  font-size:.75rem;
}

.dot{
  display:inline-block;
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--accent);
  margin-right:8px;
}

.stats{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
}

.stat{
  padding:20px;
  border-right:1px solid var(--line);
}

.stat:last-child{border-right:0}

.stat strong{
  display:block;
  font-size:2rem;
}

.stat span{
  color:var(--muted);
  font-size:.78rem;
}

.columns,
.domain-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  margin-top:40px;
}

article,.card{
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--panel);
  padding:22px;
}

article p,.card{
  color:var(--muted);
}

.section-title{
  margin-top:70px;
}

.map-shell{
  height:520px;
  margin-top:40px;
  border:1px solid var(--line);
  border-radius:18px;
  background:
    radial-gradient(circle at 65% 40%,rgba(216,255,69,.1),transparent 25%),
    linear-gradient(135deg,#101217,#090a0d);
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
}

.map-label strong{
  display:block;
  font-size:3rem;
}

.map-label span,.map-note{
  color:var(--muted);
}

.map-note{margin-top:30px}

.chain{
  margin-top:40px;
  padding:35px;
  border:1px solid var(--line);
  background:var(--panel);
  border-radius:14px;
  line-height:1.7;
  font-size:1rem;
}

.timeline,.evidence,.books{
  margin-top:40px;
  border-top:1px solid var(--line);
}

.timeline div,.evidence div,.books div{
  display:grid;
  grid-template-columns:220px 1fr;
  border-bottom:1px solid var(--line);
  padding:18px 8px;
}

.timeline span,.evidence span{
  color:var(--muted);
}

footer{
  border-top:1px solid var(--line);
  padding:22px 28px;
  color:var(--muted);
  display:flex;
  justify-content:space-between;
}

@media(max-width:900px){
  header{align-items:flex-start;flex-direction:column}
  .hero{flex-direction:column}
  .stats{grid-template-columns:repeat(2,1fr)}
  .stat{border-bottom:1px solid var(--line)}
  .columns,.domain-grid{grid-template-columns:1fr}
}

.searchbar{margin:35px 0}
.searchbar input,.network-input,.map-controls select{
  width:100%;
  background:#111419;
  border:1px solid var(--line);
  color:var(--text);
  border-radius:10px;
  padding:15px 16px;
  font-size:1rem;
}

.results{
  display:grid;
  gap:10px;
  margin-top:25px;
}

.record-card{
  width:100%;
  text-align:left;
  display:grid;
  grid-template-columns:110px 1fr 220px;
  gap:16px;
  align-items:center;
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--text);
  border-radius:10px;
  padding:15px 16px;
  cursor:pointer;
}

.record-card:hover{
  background:var(--panel2);
  border-color:#3b4149;
}

.record-card span:last-child{
  color:var(--muted);
}

.record-kind{
  text-transform:uppercase;
  font-size:.67rem;
  letter-spacing:.13em;
  color:var(--muted);
}

.drawer{
  position:fixed;
  right:-760px;
  top:0;
  bottom:0;
  width:min(760px,92vw);
  z-index:100;
  background:#0d0f12;
  border-left:1px solid var(--line);
  padding:32px;
  overflow:auto;
  transition:right .2s ease;
  box-shadow:-20px 0 60px rgba(0,0,0,.35);
}

.drawer.open{right:0}

.drawer-close{
  float:right;
  border:0;
  background:#1a1e23;
  color:#fff;
  border-radius:8px;
  font-size:1.5rem;
  padding:3px 11px;
  cursor:pointer;
}

.detail-table{
  margin-top:25px;
  border-top:1px solid var(--line);
}

.detail-row{
  display:grid;
  grid-template-columns:180px 1fr;
  gap:20px;
  padding:11px 0;
  border-bottom:1px solid var(--line);
}

.detail-row span{
  color:var(--muted);
  font-size:.8rem;
}

.detail-row b{
  font-weight:500;
  overflow-wrap:anywhere;
}

.relationship-list{
  display:grid;
  gap:8px;
}

.relationship{
  border:1px solid var(--line);
  border-radius:8px;
  padding:12px;
}

.relationship span{
  display:block;
  color:var(--muted);
  margin-top:4px;
}

.boundary-note{
  color:var(--muted);
  font-size:.83rem;
  border-left:2px solid var(--accent);
  padding-left:12px;
}

.timeline-row{
  grid-template-columns:180px 1fr;
}

.map-controls{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin:30px 0;
}

.fact-row{
  display:grid;
  grid-template-columns:1fr 220px;
  gap:20px;
  border:1px solid var(--line);
  border-radius:9px;
  padding:14px;
}

.fact-row span{
  display:block;
  color:var(--muted);
  margin-top:3px;
}

.empty{
  color:var(--muted);
  padding:30px 0;
}

a{color:var(--accent)}

@media(max-width:800px){
  .record-card{grid-template-columns:1fr}
  .detail-row{grid-template-columns:1fr}
  .map-controls{grid-template-columns:1fr}
}

.real-map{
  margin-top:35px;
}

.map-toolbar{
  display:flex;
  justify-content:space-between;
  gap:24px;
  align-items:flex-end;
  margin-bottom:14px;
}

.map-toolbar span,
.map-legend{
  display:block;
  color:var(--muted);
  font-size:.78rem;
  margin-top:4px;
}

#atlasSvg{
  display:block;
  width:100%;
  border:1px solid var(--line);
  border-radius:18px;
}

.map-bg{
  fill:#0d1014;
}

.map-glow{
  fill:var(--accent);
  opacity:.08;
}

.map-circle{
  fill:#151a1f;
  stroke:var(--accent);
  stroke-width:2;
  cursor:pointer;
  transition:.15s ease;
}

.map-node:hover .map-circle,
.map-node:focus .map-circle{
  fill:#252c19;
  stroke-width:4;
}

.map-node{
  outline:none;
  cursor:pointer;
}

.map-name{
  fill:var(--text);
  font-size:15px;
  font-weight:700;
}

.map-sub{
  fill:var(--muted);
  font-size:11px;
}

.map-inspector{
  margin-top:14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--panel);
  padding:22px;
}

.map-inspector-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:30px;
}

.map-total{
  text-align:right;
}

.map-total strong{
  display:block;
  font-size:1.8rem;
}

.map-total span{
  color:var(--muted);
  font-size:.75rem;
}

.map-fact-list{
  display:grid;
  gap:8px;
}

.map-fact{
  display:grid;
  grid-template-columns:1fr 160px;
  gap:10px 20px;
  border:1px solid var(--line);
  border-radius:9px;
  padding:13px;
}

.map-fact span,
.map-fact small{
  display:block;
  color:var(--muted);
}

.map-fact small{
  grid-column:1 / -1;
}

.map-fact-value{
  text-align:right;
  font-weight:700;
}

.layer-registry{
  display:grid;
  gap:10px;
}

.layer-row{
  display:grid;
  grid-template-columns:1fr 230px;
  gap:8px 24px;
  border:1px solid var(--line);
  border-radius:10px;
  padding:15px;
}

.layer-row span,
.layer-row small{
  display:block;
  color:var(--muted);
}

.layer-row p{
  grid-column:1 / -1;
  margin:4px 0 0;
  color:var(--muted);
  font-size:.82rem;
}

@media(max-width:800px){
  .map-toolbar,
  .map-inspector-head{
    align-items:flex-start;
    flex-direction:column;
  }

  .map-total{
    text-align:left;
  }

  .map-fact,
  .layer-row{
    grid-template-columns:1fr;
  }

  .map-fact small,
  .layer-row p{
    grid-column:auto;
  }

  .map-fact-value{
    text-align:left;
  }
}

.county-polygon{
  fill:#11161a;
  stroke:#6c737d;
  stroke-width:2;
  cursor:pointer;
}

.place-polygon{
  stroke:#d8ff45;
  stroke-width:1.5;
  cursor:pointer;
  transition:
    opacity .15s ease,
    stroke-width .15s ease,
    filter .15s ease;
}

.place-region:hover .place-polygon,
.place-region:focus .place-polygon{
  stroke-width:4;
  filter:brightness(1.35);
}

.place-region{
  outline:none;
}

.place-name{
  fill:#ffffff;
  font-size:12px;
  font-weight:700;
  paint-order:stroke;
  stroke:#08090b;
  stroke-width:4px;
  stroke-linejoin:round;
  pointer-events:none;
}

.heat-0{fill:#1a2025}
.heat-1{fill:#26301f}
.heat-2{fill:#435428}
.heat-3{fill:#718c31}
.heat-4{fill:#b2d83a}

.legend-box{
  display:inline-block;
  width:14px;
  height:14px;
  border:1px solid #59606a;
  vertical-align:-2px;
  margin:0 3px 0 10px;
}

.map-legend .heat-1{background:#26301f}
.map-legend .heat-2{background:#435428}
.map-legend .heat-3{background:#718c31}
.map-legend .heat-4{background:#b2d83a}

#atlasSvg{
  min-height:500px;
}

.network-toolbar{
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  margin:28px 0 12px;
}

.network-reset{
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--text);
  border-radius:10px;
  padding:0 18px;
  cursor:pointer;
}

.network-reset:hover{
  background:var(--panel2);
}

.network-meta{
  color:var(--muted);
  font-size:.8rem;
  margin:0 0 10px;
}

.network-graph{
  border:1px solid var(--line);
  background:#0b0d10;
  border-radius:16px;
  overflow:hidden;
}

#networkSvg{
  display:block;
  width:100%;
  min-height:520px;
}

.graph-edge line{
  stroke:#59606a;
  stroke-width:1.4;
  opacity:.62;
}

.graph-predicate{
  fill:#8e969f;
  font-size:9px;
  paint-order:stroke;
  stroke:#0b0d10;
  stroke-width:3px;
}

.graph-node{
  cursor:pointer;
  outline:none;
}

.graph-node circle{
  fill:#171c20;
  stroke:var(--accent);
  stroke-width:2;
}

.graph-node:hover circle,
.graph-node:focus circle{
  fill:#29321c;
  stroke-width:4;
}

.graph-node-label{
  fill:var(--text);
  font-size:11px;
  font-weight:600;
  paint-order:stroke;
  stroke:#08090b;
  stroke-width:3px;
}

.graph-node-type{
  fill:var(--muted);
  font-size:8px;
  text-transform:uppercase;
}

.graph-empty{
  fill:var(--muted);
  font-size:16px;
}

.network-summary{
  color:var(--muted);
  padding:14px 0;
}

@media(max-width:800px){
  .network-toolbar{
    grid-template-columns:1fr;
  }

  .network-reset{
    padding:12px;
  }
}

.source-link-block{
  margin:20px 0;
  padding:14px;
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--panel);
}

.source-link-block small{
  display:block;
  color:var(--muted);
  margin-top:8px;
  line-height:1.5;
}

.source-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:20px 0;
}

.source-action{
  display:inline-block;
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--text);
  text-decoration:none;
  border-radius:9px;
  padding:10px 14px;
}

.source-action:hover{
  background:var(--panel2);
}

.source-action.primary{
  border-color:var(--accent);
}

.hash-value{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:.75rem;
  overflow-wrap:anywhere;
}

.source-warning{
  border-left-color:#d98c4a;
}

.successor-card{
  margin:24px 0;
  padding:18px;
  border:1px solid var(--accent);
  border-radius:12px;
  background:var(--panel);
}

.successor-card h3{
  margin:10px 0 16px;
}

.successor-badge{
  display:inline-block;
  font-size:.72rem;
  font-weight:700;
  letter-spacing:.08em;
  border:1px solid var(--accent);
  border-radius:999px;
  padding:5px 9px;
  color:var(--accent);
}

.successor-card .boundary-note{
  margin-top:16px;
}


/* Operation Whale Fall public consolidation v0.19 */
nav a.project-link{
  display:inline-flex;
  align-items:center;
  padding:8px 10px;
  border-radius:8px;
  color:inherit;
  text-decoration:none;
  font-size:.92rem;
  opacity:.82;
}
nav a.project-link:hover,nav a.project-link:focus{
  opacity:1;
  background:rgba(255,255,255,.06);
}
