/* ============================================================
   ATLAS — The Drone Revolution
   Shared stylesheet · Vol. I · Ed. I
   ============================================================ */

:root {
  --paper:      #ECEEF1;
  --paper-2:    #E4E7EC;
  --surface:    #F7F8FA;
  --ink:        #0C1118;
  --ink-soft:   #1B2230;
  --body:       #3E4754;
  --mid:        #6B7480;
  --mute:       #98A1AD;
  --line:       #C9CFD7;
  --line-soft:  #D9DDE3;
  --hair:       #B6BDC6;
  --blue:       #2E50E0;
  --blue-2:     #3A65FF;
  --blue-deep:  #0E1F4B;
  --blue-soft:  #DDE5FB;
  --tint:       #E9EEF9;
  --warm:       #C26A3B;     /* contested · projection */

  --pad-x:      56px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-weight: 400;
  font-feature-settings: "ss01", "cv11", "tnum";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* dotted grid wash + subtle blue glows */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(12,17,24,0.07) 1px, transparent 0);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(46,80,224,0.06), transparent 60%),
    radial-gradient(ellipse 60% 50% at 10% 100%, rgba(46,80,224,0.04), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

main, header, footer, section { position: relative; z-index: 1; }

/* ---------- Typography primitives ---------- */
.display, h1, h2, h3 {
  font-family: 'Instrument Serif', 'Times New Roman', serif;
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 0.98;
  color: var(--ink);
}
.display em, h1 em, h2 em, h3 em {
  font-style: italic;
  color: var(--blue);
}
.mono, .label, .coord, .tag, .kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--blue); }

/* ---------- TOP STRIP (sticky) ---------- */
.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px var(--pad-x);
  border-bottom: 1px solid var(--line);
  gap: 24px;
  background: rgba(236,238,241,0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 50;
}
.top .left, .top .right {
  display: flex; gap: 22px; align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
}
.top .right { justify-content: flex-end; }
.top .wordmark {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-align: center;
  line-height: 1;
}
.top .wordmark em { font-style: italic; color: var(--blue); }
.top .wordmark .sub {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--mute);
  margin-top: 4px;
}
.top .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue);
  margin-right: 8px;
  vertical-align: 1px;
  box-shadow: 0 0 0 3px rgba(46,80,224,0.12);
}
.top a:hover { color: var(--blue); }
.top .nav-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  transition: color 0.2s, transform 0.2s;
}
.top .nav-arrow.next:hover { transform: translateX(2px); }
.top .nav-arrow.prev:hover { transform: translateX(-2px); }

/* ---------- COORDINATE MARKS ---------- */
.coord-marks { position: absolute; inset: 18px var(--pad-x); pointer-events: none; }
.coord-marks span {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--mute);
}
.coord-marks .tl { top: 0; left: 0; }
.coord-marks .tr { top: 0; right: 0; }
.coord-marks .bl { bottom: 0; left: 0; }
.coord-marks .br { bottom: 0; right: 0; }

/* ---------- HERO BLOCK (per-sheet) ---------- */
.hero {
  padding: 96px var(--pad-x) 72px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 80px;
  align-items: end;
}
.hero-title {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(56px, 7.2vw, 116px);
  line-height: 0.93;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.hero-title em {
  font-style: italic;
  color: var(--blue);
  display: block;
}
.hero-title .pill {
  display: inline-block;
  vertical-align: 0.18em;
  margin-left: 8px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(46,80,224,0.14);
}
.hero-sub {
  margin-top: 28px;
  max-width: 460px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--body);
}

/* ---------- PER-SHEET HERO (number + title) ---------- */
.sheet-hero {
  padding: 112px var(--pad-x) 80px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.sheet-hero::before {
  content: "";
  position: absolute;
  top: 64px; left: var(--pad-x);
  width: 64px; height: 1px;
  background: var(--blue);
}
.sheet-hero .meta {
  position: absolute;
  top: 76px; left: var(--pad-x);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue);
}
.sheet-hero .number {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(120px, 16vw, 240px);
  line-height: 0.78;
  letter-spacing: -0.04em;
  color: var(--blue);
  margin-bottom: 12px;
  display: block;
}
.sheet-hero h1 {
  font-size: clamp(48px, 6.2vw, 92px);
  line-height: 0.96;
  letter-spacing: -0.022em;
  color: var(--ink);
  max-width: 16ch;
}
.sheet-hero h1 em {
  font-style: italic;
  color: var(--blue);
  display: block;
}
.sheet-hero .kicker {
  margin-top: 28px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mid);
}
.sheet-hero .lede {
  margin-top: 36px;
  font-family: 'Instrument Serif', serif;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.25;
  color: var(--ink-soft);
  max-width: 26ch;
  letter-spacing: -0.012em;
}
.sheet-hero .lede em {
  font-style: italic;
  color: var(--blue);
}
.sheet-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: end;
}

/* ---------- BODY (article + marginalia) ---------- */
.body {
  padding: 88px var(--pad-x);
  border-bottom: 1px solid var(--line);
}
.body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 72px;
  align-items: start;
}
.prose {
  font-size: 17px;
  line-height: 1.65;
  color: var(--body);
  max-width: 64ch;
}
.prose p + p { margin-top: 20px; }
.prose .drop {
  float: left;
  font-family: 'Instrument Serif', serif;
  font-size: 84px;
  line-height: 0.85;
  color: var(--blue);
  padding: 4px 14px 0 0;
  font-style: italic;
}
.prose strong, .prose b {
  font-weight: 500;
  color: var(--ink);
}
.prose em { font-style: italic; color: var(--ink-soft); }
.prose h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  line-height: 1.05;
  margin: 56px 0 18px;
  color: var(--ink);
  max-width: 22ch;
}
.prose h2 em { font-style: italic; color: var(--blue); }
.prose h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 40px 0 14px;
}

.aside {
  font-size: 13px;
  line-height: 1.55;
  color: var(--mid);
  border-left: 1px solid var(--line);
  padding-left: 22px;
  position: sticky;
  top: 92px;
}
.aside .note + .note { margin-top: 28px; padding-top: 28px; border-top: 1px dashed var(--line); }
.aside .ntag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 10px;
}
.aside .nbig {
  font-family: 'Instrument Serif', serif;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 6px;
}
.aside .nbig em { font-style: italic; color: var(--blue); }
.aside .nsmall {
  font-size: 12.5px;
  color: var(--mid);
  line-height: 1.5;
}
.aside .nlabel {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 4px;
}

/* ---------- PULL QUOTE ---------- */
.pull {
  margin: 56px 0;
  padding: 36px 0 36px 36px;
  border-left: 2px solid var(--blue);
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.012em;
  color: var(--ink);
  max-width: 36ch;
}
.pull cite {
  display: block;
  margin-top: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mid);
}

/* ---------- FIGURE / STAGE ---------- */
.stage {
  margin: 56px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 48px 48px 40px;
  position: relative;
  overflow: hidden;
}
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(12,17,24,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12,17,24,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.stage .corner {
  position: absolute;
  width: 12px; height: 12px;
  border: 1px solid var(--ink);
}
.stage .corner.tl { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.stage .corner.tr { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.stage .corner.bl { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.stage .corner.br { bottom: 12px; right: 12px; border-left: none; border-top: none; }
.stage .stage-tag {
  position: relative;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 24px;
}
.stage svg {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
}
.stage .stage-cap {
  position: relative;
  margin-top: 20px;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 15px;
  color: var(--mid);
  line-height: 1.5;
  max-width: 68ch;
}
.stage--wide {
  margin-left: calc(-1 * var(--pad-x));
  margin-right: calc(-1 * var(--pad-x));
  border-left: none;
  border-right: none;
}

/* ---------- INLINE DATA STRIP ---------- */
.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 56px 0;
}
.strip .cell {
  padding: 22px 24px 24px 0;
  border-right: 1px solid var(--line);
}
.strip .cell:last-child { border-right: 0; padding-right: 0; }
.strip .cell .k {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 12px;
}
.strip .cell .v {
  font-family: 'Instrument Serif', serif;
  font-size: 28px;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.strip .cell .v em { font-style: italic; color: var(--blue); }

/* ---------- TABLE ---------- */
.tbl {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-size: 14px;
}
.tbl th, .tbl td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--body);
  vertical-align: top;
}
.tbl th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 10px;
}
.tbl tr:hover td { background: rgba(46,80,224,0.04); }
.tbl td.n {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tbl td.role { color: var(--mid); font-style: italic; font-family: 'Instrument Serif', serif; font-size: 16px; }
.tbl tr.hot td { background: rgba(46,80,224,0.05); }
.tbl tr.hot td.n { color: var(--blue); }

/* ---------- PAGINATION (per-sheet) ---------- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}
.pager a {
  display: block;
  padding: 48px var(--pad-x);
  position: relative;
  transition: background 0.2s;
}
.pager a:hover { background: var(--surface); }
.pager a:hover .pgt { color: var(--blue); }
.pager .prev { border-right: 1px solid var(--line); }
.pager .next { text-align: right; }
.pager .pgl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 10px;
}
.pager .pgl::before { content: "← "; color: var(--blue); }
.pager .next .pgl::before { content: ""; }
.pager .next .pgl::after { content: " →"; color: var(--blue); }
.pager .pgt {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.018em;
  color: var(--ink);
  transition: color 0.2s;
  max-width: 14ch;
}
.pager .next .pgt { margin-left: auto; }
.pager .pgt em { font-style: italic; color: var(--blue); }
.pager .pgn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--mid);
  margin-top: 8px;
}

/* ---------- FOOTER ---------- */
footer.atlas-footer {
  padding: 32px var(--pad-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
  gap: 24px;
}
footer.atlas-footer .nav { display: flex; gap: 32px; flex-wrap: wrap; }

/* ---------- NETWORK GRAPH PRIMITIVES (used in SVG) ---------- */
.edge       { stroke: var(--hair); stroke-width: 0.8; fill: none; }
.edge-hot   { stroke: var(--blue); stroke-width: 1.1; fill: none; }
.edge-warm  { stroke: var(--warm); stroke-width: 1.0; fill: none; stroke-dasharray: 3 4; }
.node       { fill: var(--surface); stroke: var(--ink); stroke-width: 1; }
.node-hot   { fill: var(--blue); stroke: var(--blue); }
.node-warm  { fill: var(--surface); stroke: var(--warm); stroke-width: 1.4; }
.ring       { stroke: var(--line); fill: none; }
.ring-axis  { stroke: var(--hair); stroke-dasharray: 2 4; }
.svglabel {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  fill: var(--ink-soft);
}
.svglabel-mute { fill: var(--mute); }
.svglabel-blue { fill: var(--blue); }
.svgname {
  font-family: 'Instrument Serif', serif;
  font-size: 17px;
  fill: var(--ink);
}
.svgname.italic { font-style: italic; fill: var(--blue); }

/* ---------- COVER (index) HERO ---------- */
.cover {
  padding: 96px var(--pad-x) 72px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.cover-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 80px;
  align-items: center;
}
.cover-hero {
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 560px;
  margin-left: auto;
  position: relative;
}
.cover-hero svg { width: 100%; height: 100%; overflow: visible; }
.cover .pulse {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1;
  transform-origin: center;
  animation: pulse 4s ease-out infinite;
  opacity: 0;
}
.cover .pulse.p2 { animation-delay: 1.3s; }
.cover .pulse.p3 { animation-delay: 2.6s; }
@keyframes pulse {
  0%   { transform: scale(0.6); opacity: 0.55; }
  100% { transform: scale(1.7); opacity: 0; }
}
.cover .edge, .cover .edge-hot {
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  animation: dash 2.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes dash { to { stroke-dashoffset: 0; } }
.cover .node, .cover .node-hot, .cover .node-warm, .cover .svglabel {
  opacity: 0;
  animation: fadein 0.8s ease-out forwards;
  animation-delay: 1.4s;
}
.cover .svglabel { animation-delay: 1.7s; }
@keyframes fadein { to { opacity: 1; } }

/* ---------- TABLE OF CONTENTS (index) ---------- */
.toc {
  padding: 96px var(--pad-x);
  border-bottom: 1px solid var(--line);
}
.toc-head {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 80px;
  margin-bottom: 56px;
}
.toc-head .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--blue);
  text-transform: uppercase;
  position: relative;
  padding-left: 18px;
}
.toc-head .num::before {
  content: "";
  position: absolute;
  left: 0; top: 6px;
  width: 10px; height: 1px;
  background: var(--blue);
}
.toc-head h2 {
  font-size: clamp(36px, 4.5vw, 64px);
  max-width: 920px;
  line-height: 1;
}
.toc-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.toc-item {
  padding: 32px 28px 32px 0;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  display: block;
  position: relative;
  transition: background 0.2s;
}
.toc-item:nth-child(3n) { border-right: 0; padding-right: 0; }
.toc-item:hover { background: var(--surface); }
.toc-item:hover .ti-name { color: var(--blue); }
.toc-item:hover .ti-num { color: var(--blue); }
.toc-item .ti-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 14px;
  transition: color 0.2s;
}
.toc-item .ti-name {
  font-family: 'Instrument Serif', serif;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin-bottom: 8px;
  transition: color 0.2s;
}
.toc-item .ti-name em { font-style: italic; color: var(--blue); }
.toc-item .ti-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  :root { --pad-x: 32px; }
  .top { padding: 16px var(--pad-x); grid-template-columns: 1fr auto; }
  .top .right { display: none; }
  .hero-grid, .cover-grid { grid-template-columns: 1fr; gap: 48px; }
  .cover-hero { max-width: 100%; }
  .sheet-hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .body-grid { grid-template-columns: 1fr; gap: 40px; }
  .aside { position: static; border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-top: 24px; }
  .toc-head { grid-template-columns: 1fr; gap: 16px; }
  .toc-list { grid-template-columns: repeat(2, 1fr); }
  .toc-item:nth-child(3n) { border-right: 1px solid var(--line); padding-right: 28px; }
  .toc-item:nth-child(2n) { border-right: 0; padding-right: 0; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .strip .cell { border-right: 1px solid var(--line); padding-right: 16px; }
  .strip .cell:nth-child(2n) { border-right: 0; padding-right: 0; }
  .pager a { padding: 36px var(--pad-x); }
  .stage { padding: 32px 24px; }
  .stage--wide { margin-left: calc(-1 * var(--pad-x)); margin-right: calc(-1 * var(--pad-x)); }
  footer.atlas-footer { flex-direction: column; gap: 18px; align-items: flex-start; padding: 24px var(--pad-x); }
}

@media (max-width: 600px) {
  .hero, .cover, .toc, .body, .sheet-hero { padding-top: 64px; padding-bottom: 56px; }
  .sheet-hero { padding-top: 80px; }
  .toc-list { grid-template-columns: 1fr; }
  .toc-item { border-right: 0 !important; padding-right: 0 !important; }
  .strip { grid-template-columns: 1fr; }
  .strip .cell { border-right: 0; padding-right: 0; }
  .pull { padding-left: 20px; margin: 36px 0; }
  .stage { padding: 24px 18px; }
  .pager { grid-template-columns: 1fr; }
  .pager .prev { border-right: 0; border-bottom: 1px solid var(--line); }
  .pager .next { text-align: left; }
  .pager .pgt { max-width: none; }
  .pager .next .pgt { margin-left: 0; }
}
