* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  /* Paper-and-ink academic ground, warm-neutral */
  --paper:   #F3F4EF;
  --paper-2: #ECEEE6;
  --card:    #FBFCF9;
  --line:    #DBDFD3;
  --line-2:  #C8CEBE;
  --ink:     #1F231C;
  --ink-2:   #4B524760; /* unused placeholder, overwritten below */
  --ink-2:   #4C534A;
  --ink-3:   #7E877B;
  /* Sage accent + tints */
  --sage:    #3C6B57;
  --sage-2:  #588A72;
  --sage-tint: #E4EDE6;
  --sage-tint-2: #D6E4DA;
  /* Deep ground for the graph act */
  --night:   #171A15;
  --night-2: #20241D;
  --night-line: #333A2E;
  --night-ink: #E9EDE2;
  --night-ink-2: #A7B09C;
  /* Claim-graph taxonomy hues (structural, reused in the pipeline + legend) */
  --t-paper: #5B8A5A;
  --t-claim: #4A6FA5;
  --t-evidence: #3C7A55;
  --t-bundle: #6E5AA6;
  --t-idea:  #B06A34;
  --radius:  12px;
  --radius-lg: 18px;
  --font-serif: 'Libre Baskerville', 'Iowan Old Style', Georgia, serif;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', Consolas, monospace;
  /* Dashboard-compat aliases so the ported cockpit (magicBento) + galaxy render on-brand */
  --accent: #3C6B57; --accent-light: var(--sage-tint);
  --text: var(--ink); --text2: var(--ink-2); --text3: var(--ink-3);
  --border: var(--line); --bg: var(--paper); --bg-warm: var(--paper-2);
  --card-raised: #FFFFFF; --card-hover: #FFFFFF;
  --maxw: 1200px;
  --shadow-sm: 0 1px 2px rgba(31,35,28,.06), 0 4px 14px rgba(31,35,28,.05);
  --shadow-md: 0 8px 30px rgba(31,35,28,.10), 0 2px 6px rgba(31,35,28,.06);
  --shadow-lg: 0 24px 60px rgba(20,26,18,.30);
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
#nh-glass-svg { position: absolute; width: 0; height: 0; pointer-events: none; }
.tone-paper { background: var(--t-paper); }
.tone-claim { background: var(--t-claim); }
.tone-evidence { background: var(--t-evidence); }
.tone-bundle { background: var(--t-bundle); }
.tone-idea { background: var(--t-idea); }
::selection { background: var(--sage); color: #fff; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); }

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: var(--paper);
}
.topbar-inner { height: 66px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Archivo', var(--font-sans); font-size: 20px; font-weight: 600; letter-spacing: -.012em; color: var(--ink); }
.brand .mark { width: 30px; height: auto; }
.topnav { display: flex; align-items: center; gap: 4px; }
.nav-link { padding: 8px 13px; border-radius: 9px; color: var(--ink-2); font-size: 14px; font-weight: 500; transition: background .15s, color .15s; }
.nav-link:hover { background: var(--paper-2); color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-weight: 600; font-size: 14.5px; line-height: 1;
  border-radius: 999px; cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); padding: 12px 20px; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #2C3128; box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); padding: 12px 20px; }
.btn-ghost:hover { background: var(--card); border-color: var(--ink-3); }
.btn-sage { background: var(--sage); color: #fff; padding: 12px 22px; box-shadow: 0 1px 2px rgba(31,35,28,.1); }
.btn-sage:hover { background: #345E4C; box-shadow: var(--shadow-md); }
.nav-cta { padding: 9px 17px; font-size: 14px; }
.nav-mobile-links { display: none; }

/* ── Eyebrow / section heads ─────────────────────────────── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase; color: var(--sage);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--sage-2); opacity: .7; }
.section-title { font-family: var(--font-serif); font-weight: 700; color: var(--ink); letter-spacing: -.01em; line-height: 1.12; text-wrap: balance; }

/* ── Hero ────────────────────────────────────────────────── */
.hero { position: relative; padding: clamp(84px, 9vh, 108px) 0 clamp(48px, 7vh, 92px); }
/* hero background is flat --paper now, uniform with the top bar (gradient glow removed on request) */
.hero-head { margin-bottom: clamp(34px, 5vh, 58px); animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.hero-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(30px, 5vw, 62px); align-items: center; }
.hero-copy { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.hero h1 {
  margin: 16px 0 0;
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(27px, 3.5vw, 45px); line-height: 1.14; letter-spacing: -.012em;
  color: var(--ink);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .28em;
}
.expl-hero-static { flex: 0 0 auto; }
/* Pill word-rotator — ported from the workspace home (hero.js): a sage
   pill whose width animates to fit each keyword while the letters stagger
   in from below. overflow:hidden clips the letters mid-slide so nothing
   spills; the ghost span measures the target width off-screen. */
.text-rotate {
  display: inline-block; position: relative; vertical-align: baseline;
  overflow: hidden; box-sizing: border-box; flex: 0 0 auto;
  height: 1.62em; line-height: 1; padding: .31em .58em;
  background: var(--sage); color: #fff; border-radius: 13px;
  box-shadow: 0 4px 18px rgba(60,107,87,.30);
  transform: translateY(.42em); width: 0;
  transition: width .42s cubic-bezier(.34,1.11,.55,1);
}
.text-rotate-ghost { position: absolute; visibility: hidden; pointer-events: none; white-space: nowrap; top: 0; left: 0; font-family: var(--font-serif); font-weight: 700; font-style: normal; line-height: 1; }
.text-rotate-line { position: absolute; inset: 0; display: inline-flex; align-items: center; justify-content: flex-start; white-space: nowrap; padding: 0 .58em; }
.text-rotate-word { display: inline-flex; align-items: center; }
.text-rotate-char { display: inline-block; transform: translateY(110%); opacity: 0; will-change: transform, opacity; color: #fff; font-family: var(--font-serif); font-style: normal; font-weight: 700; transition: transform .55s cubic-bezier(.16,1.11,.3,1), opacity .45s ease-out; }
.text-rotate-char.is-in  { transform: translateY(0);     opacity: 1; }
.text-rotate-char.is-out { transform: translateY(-110%); opacity: 0; }
.text-rotate-space { display: inline-block; width: .28em; }
.text-rotate-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hero-lede { max-width: 34em; font-size: clamp(16px, 1.15vw, 18.5px); line-height: 1.62; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-strip {
  margin-top: 38px; padding-top: 26px; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 22px;
}
.hstat { min-width: 0; }
.hstat-num { font-family: var(--font-serif); font-weight: 700; font-size: clamp(24px, 2.4vw, 32px); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.hstat-num .u { font-size: .62em; color: var(--sage); margin-left: 1px; }
.hstat-label { margin-top: 7px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.hstat-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: middle; transform: translateY(-1px); }

/* Hero visual: framed terminal device carousel */
.hero-visual { position: relative; animation: rise .8s .08s cubic-bezier(.2,.7,.2,1) both; }
.device {
  position: relative; border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow-md);
  padding: 14px 14px 16px;
}
.device::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6); pointer-events: none;
}
.device-kicker {
  display: inline-flex; align-items: center; gap: 7px; margin: 2px 4px 12px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .05em; color: var(--sage);
  background: var(--sage-tint); border: 1px solid var(--sage-tint-2); padding: 4px 10px; border-radius: 999px;
}
.device-kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sage-2); }
.device-stage { position: relative; min-height: 262px; }
/* Stacked terminal cards. `visibility` (not just opacity) so the outgoing
   card is removed from render INSTANTLY when it loses .active — otherwise
   both cards sit at the same inset:0 spot at partial opacity during the
   .45s fade and their (independently-typing) terminal text blends into a
   flickering ghost. Only the incoming card fades in; the outgoing is gone. */
.carousel-card { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .45s ease; pointer-events: none; }
.carousel-card.active { opacity: 1; visibility: visible; pointer-events: auto; position: relative; }
.panel-caption { margin: 12px 4px 2px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.carousel-dots { display: flex; gap: 6px; margin: 14px 4px 0; }
.cdot { width: 20px; height: 3px; border-radius: 3px; background: var(--line-2); transition: background .3s; }

/* Terminal widget (DOM from mountTerminal) */
.terminal { border-radius: 11px; overflow: hidden; background: var(--night); border: 1px solid #000; box-shadow: 0 10px 30px rgba(20,26,18,.22); }
.terminal-header { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #23281F; border-bottom: 1px solid #000; }
.traffic-lights { display: flex; gap: 7px; }
.traffic-light { width: 11px; height: 11px; border-radius: 50%; }
.traffic-close { background: #ED6A5E; } .traffic-min { background: #F4BF4F; } .traffic-max { background: #61C554; }
.terminal-title { flex: 1; text-align: center; font-family: var(--font-mono); font-size: 11.5px; color: #8A9382; letter-spacing: .04em; }
.terminal-header > span:last-child { width: 40px; }
.terminal-body { padding: 15px 16px 18px; height: 322px; overflow: hidden; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.7; color: #CFD8C6; }
.line-cmd { color: #E9EFE1; white-space: pre-wrap; word-break: break-word; }
.line-cmd::before { content: "$ "; color: #61C554; font-weight: 500; }
.line-out { color: #97A48C; white-space: pre-wrap; word-break: break-word; }
.cursor { display: inline-block; width: 8px; height: 15px; background: #61C554; margin-left: 2px; vertical-align: text-bottom; animation: blink 1.05s steps(2) infinite; border-radius: 1px; }
@keyframes blink { 50% { opacity: 0; } }

/* ── Corpus band (live numbers + pipeline) ───────────────── */
.corpus { padding: clamp(52px, 8vh, 96px) 0; border-top: 1px solid var(--line); background: var(--paper); }
.corpus-head { max-width: 760px; }
.corpus-head .section-title { font-size: clamp(26px, 3.4vw, 40px); margin: 16px 0 12px; }
.corpus-head p { color: var(--ink-2); font-size: 16px; max-width: 60ch; }
.stat-grid { margin-top: 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 20px; box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.stat-card .edge { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.stat-num { font-family: var(--font-serif); font-weight: 700; font-size: clamp(30px, 3.6vw, 44px); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-label { margin-top: 12px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--sage); }
.stat-desc { margin-top: 7px; font-size: 13.5px; line-height: 1.5; color: var(--ink-3); }

/* Pipeline stepper */
.pipeline { margin-top: 34px; position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.pipeline::before { content: ""; position: absolute; left: 8%; right: 8%; top: 13px; height: 2px; background: linear-gradient(90deg, var(--t-paper), var(--t-claim), var(--t-evidence), var(--t-bundle), var(--t-idea)); opacity: .35; border-radius: 2px; }
.pstep { position: relative; text-align: left; }
.pstep .node { width: 28px; height: 28px; border-radius: 50%; background: var(--card); border: 2px solid var(--line-2); display: grid; place-items: center; margin-bottom: 12px; position: relative; z-index: 1; }
.pstep .node span { width: 9px; height: 9px; border-radius: 50%; }
.pstep b { display: block; font-size: 15px; color: var(--ink); font-weight: 600; }
.pstep small { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }

/* ── Network act (dark) ──────────────────────────────────── */
.terrain { background: var(--paper); color: var(--ink); padding: clamp(56px, 9vh, 104px) 0 clamp(40px, 6vh, 72px); }
.terrain-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 30px; }
.terrain-head .eyebrow { color: var(--sage); }
.terrain-head .eyebrow::before { background: var(--sage-2); }
.terrain-head .section-title { color: var(--ink); font-size: clamp(24px, 3.2vw, 38px); max-width: 15ch; }
.terrain-head p { color: var(--ink-2); max-width: 42ch; font-size: 15px; }
.terrain-head-right { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }
.network-container {
  position: relative; height: clamp(420px, 62vh, 620px); border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-md);
}
.network-container canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.network-container canvas:active { cursor: grabbing; }
.network-legend { position: absolute; left: 16px; bottom: 16px; display: flex; flex-wrap: wrap; gap: 8px; max-width: 70%; }
.chip { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; backdrop-filter: blur(6px); }
.network-zoom-controls { position: absolute; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.network-zoom-btn { width: 38px; height: 38px; display: grid; place-items: center; color: var(--ink-3); background: rgba(255,255,255,.66); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; backdrop-filter: blur(6px); transition: color .15s, background .15s, border-color .15s; }
.network-zoom-btn:hover { color: var(--ink); background: #fff; border-color: var(--sage); }
[id$="-info-panel"] {
  position: absolute; z-index: 3; top: 16px; max-width: 260px; pointer-events: none;
  background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 12.5px; color: var(--ink); backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md); opacity: 0; transition: opacity .18s;
}
[id$="-info-panel"]:not(:empty) { opacity: 1; }
[id$="-info-panel"].position-right { right: 16px; } [id$="-info-panel"].position-left { left: 16px; }

/* ── Closing CTA + footer ────────────────────────────────── */
.closer { padding: clamp(60px, 10vh, 120px) 0; text-align: center; border-top: 1px solid var(--line); }
.closer .eyebrow { justify-content: center; }
.closer h2 { margin: 18px auto 14px; font-family: var(--font-serif); font-weight: 700; font-size: clamp(30px, 4.4vw, 52px); line-height: 1.1; letter-spacing: -.015em; max-width: 16ch; text-wrap: balance; }
.closer p { color: var(--ink-2); max-width: 48ch; margin: 0 auto 30px; font-size: 17px; }
.closer .hero-actions { justify-content: center; }
.footer { border-top: 1px solid var(--line); background: var(--paper-2); padding: 34px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer .brand { font-size: 16px; }
.footer-links { display: flex; gap: 4px; flex-wrap: wrap; }
.footer-copy { font-size: 12.5px; color: var(--ink-3); font-family: var(--font-mono); }

/* ── Motion ──────────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .expl-hero-static { flex: 0 0 100%; }   /* pill drops to its own line — no overflow on tablet/phone */
  .hero-body { grid-template-columns: 1fr; gap: 38px; }
  .hero-visual { max-width: 520px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: repeat(2, 1fr); gap: 18px 20px; }
  .pipeline::before { display: none; }
}
@media (max-width: 430px) {
  /* keep the widest keyword pill inside the viewport on small phones */
  .hero h1 { font-size: clamp(22px, 6.6vw, 29px); }
}
@media (max-width: 620px) {
  body { font-size: 15px; }
  .nav-mobile-hide { display: none; }
  .hero-strip { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .terrain-head { flex-direction: column; align-items: flex-start; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .cursor { animation: none; }
}
/* ── 3-screen pager (ported from the workspace home) ─────── */
#pager { position: relative; }
#pager:not(.natural) { height: 100vh; overflow: hidden; }
#pager:not(.natural) #pager-track { height: 300vh; transition: transform .8s cubic-bezier(.645,.045,.355,1); will-change: transform; }
#pager:not(.natural) .pager-screen { height: 100vh; box-sizing: border-box; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 76px 0 46px !important; border-top: 0 !important; }
#pager:not(.natural) .pager-screen > .wrap { width: 100%; }
#pager:not(.natural) .terrain.pager-screen { padding: 64px 0 22px !important; }
#pager:not(.natural) .terrain .terrain-head { margin-bottom: 0; }
#pager:not(.natural) .terrain .terrain-head .section-title { font-size: clamp(21px, 2.5vw, 30px); }
#pager:not(.natural) .terrain .terrain-head p { font-size: 14px; }
#pager:not(.natural) .terrain .terrain-wrap { display: flex; flex-direction: column; height: 100%; gap: clamp(11px, 1.5vh, 18px); }
#pager:not(.natural) .terrain .network-container { flex: 1 1 auto; height: auto; min-height: 0; }
/* screen 5 · galaxy full-bleed — no card, canvas fills the whole page (like the workspace) */
#pager:not(.natural) #galaxy.pager-screen { padding: 0 !important; }
#galaxy .wrap { max-width: none; padding: 0; height: 100%; }
#galaxy .terrain-wrap { height: 100%; gap: 0; }
#galaxy .network-container { border: 0; border-radius: 0; box-shadow: none; background: transparent; height: 100%; }
#galaxy #galaxy-info-panel { top: 82px; }                 /* clear the fixed topbar */
#galaxy .expl-net-legend { left: 24px; bottom: 24px; }
#galaxy .network-zoom-controls { right: 24px; bottom: 24px; }
.terrain-cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.terrain-cta-note { color: var(--night-ink-2); font-size: 14px; max-width: 48ch; }
/* screen 4 · research cockpit (ported Magic Bento) */
.bento-screen { background: var(--paper); }
.bento-wrap { display: flex; flex-direction: column; gap: 20px; }
.bento-mount { min-height: 300px; }
/* screen 4 cockpit — shrink the whole bento: make the mount the cqw query
   container and cap its width, so card widths AND the em-based type/spacing
   scale down together (landing-only override; workspace magicBento untouched). */
.bento-screen #expl-bento-mount-wide { width: 100%; max-width: 1000px; margin: 0 auto; container-type: inline-size; display: flex; flex-direction: column; justify-content: center; }
#pager:not(.natural) .bento-screen { padding: 74px 0 30px !important; }
#pager:not(.natural) .bento-screen .bento-wrap { height: 100%; gap: clamp(12px,2vh,20px); }
#pager:not(.natural) .bento-screen .bento-mount { flex: 1 1 auto; min-height: 0; overflow: visible; }
.pager-dots { position: fixed; right: clamp(14px, 2vw, 30px); top: 50%; transform: translateY(-50%); z-index: 45; display: flex; flex-direction: column; gap: 13px; }
.pager-dot { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 1.5px solid var(--ink-3); background: transparent; cursor: pointer; transition: transform .2s, background .2s, border-color .2s; }
.pager-dot:hover { border-color: var(--ink); }
.pager-dot.active { background: var(--sage); border-color: var(--sage); transform: scale(1.25); }
.pager-dots.on-dark .pager-dot { border-color: rgba(233,237,226,.5); }
.pager-dots.on-dark .pager-dot:hover { border-color: #fff; }
.pager-dots.on-dark .pager-dot.active { background: var(--sage-2); border-color: var(--sage-2); }
#pager.natural ~ .pager-dots { display: none; }
/* ── back-to-top button: ported verbatim from workspace .qs-scroll-down (workspace.css) ── */
.qs-scroll-down {
  position: absolute;
  top: -52px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  z-index: 5;
  isolation: isolate;
  user-select: none;
  color: var(--text);
  background:
    radial-gradient(
      ellipse 70% 130% at 50% -20%,
      rgba(255, 255, 255, 0.92) 0%,
      rgba(255, 255, 255, 0.50) 30%,
      rgba(255, 255, 255, 0.22) 65%,
      rgba(255, 255, 255, 0.14) 100%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 50%,
      rgba(74, 124, 111, 0.13) 100%
    ),
    rgba(74, 124, 111, 0.06),
    rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: url(#nh-liquid) blur(20px) saturate(185%) brightness(1.06);
          backdrop-filter: url(#nh-liquid) blur(20px) saturate(185%) brightness(1.06);
  box-shadow:
    0 8px 22px rgba(18, 26, 46, 0.09),
    0 1px 3px rgba(18, 26, 46, 0.05),
    inset 0 2.5px 0 rgba(255, 255, 255, 1),
    inset 0 1px 1px -0.5px rgba(255, 255, 255, 0.8),
    inset 0 4px 6px -4px rgba(255, 255, 255, 0.55),
    inset 0 -3px 5px -2px rgba(74, 124, 111, 0.13),
    inset 0 -1px 0 rgba(255, 255, 255, 0.42),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.28);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.14s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}
.qs-scroll-down.is-visible {
  opacity: 0.95;
  pointer-events: auto;
}
.qs-scroll-down:hover {
  opacity: 1;
  transform: translateX(-50%) translateY(-1px);
  box-shadow:
    0 10px 28px rgba(18, 26, 46, 0.13),
    0 2px 5px rgba(18, 26, 46, 0.07),
    inset 0 2px 0 rgba(255, 255, 255, 1),
    inset 0 0.5px 0.5px rgba(255, 255, 255, 0.72),
    inset 0 -3px 5px -2px rgba(74, 124, 111, 0.17),
    inset 0 -1px 0 rgba(255, 255, 255, 0.55),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.34);
}
.qs-scroll-down:active {
  transform: translateX(-50%) translateY(0);
}
/* No blue UA focus ring on mouse click; keyboard-only shows a low-key brand-green ring. */
.qs-scroll-down:focus { outline: none; }
.qs-scroll-down:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.qs-scroll-down::before {
  content: '';
  position: absolute;
  inset: 1.5px 18% auto 18%;
  height: 50%;
  border-radius: 999px;
  background: radial-gradient(
    ellipse 100% 90% at 50% -10%,
    rgba(255, 255, 255, 0.82) 0%,
    rgba(255, 255, 255, 0.32) 45%,
    rgba(255, 255, 255, 0) 85%
  );
  filter: blur(0.4px);
  pointer-events: none;
  z-index: 0;
}
.qs-scroll-down::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    ellipse 75% 40% at 50% 100%,
    rgba(74, 124, 111, 0.18) 0%,
    rgba(74, 124, 111, 0) 70%
  );
  pointer-events: none;
  z-index: 0;
}
.qs-scroll-down svg {
  position: relative;
  z-index: 1;
  color: rgba(32, 58, 51, 0.94);
  filter:
    drop-shadow(0 1px 0.5px rgba(255, 255, 255, 0.7))
    drop-shadow(0 0.5px 0 rgba(20, 40, 32, 0.08));
}
@supports not ((-webkit-backdrop-filter: blur(1px))
                or (backdrop-filter: blur(1px))) {
  .qs-scroll-down { background: rgba(255, 255, 255, 0.94); }
}
/* landing-specific positioning: fixed to viewport bottom-center (pager screens don't scroll) */
#pager-to-top.qs-scroll-down { position: fixed; top: auto; bottom: 30px; z-index: 46; }
#pager.natural ~ #pager-to-top { display: none; }
/* ── ported network info-panel + topic legend CSS (from workspace home.js) ── */
.network-panel-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 10px;
}
.network-panel-kicker-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}
.network-panel-kicker-dot-target {
  margin-left: auto;
  opacity: 0.85;
}

/* Node hover — title-first hierarchy */
.network-panel-title {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.32;
  color: var(--text);
  letter-spacing: -0.005em;
  margin-bottom: 12px;
}
.network-panel-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 6px;
  font-size: 11.5px;
  color: var(--text2);
  line-height: 1.4;
  margin-bottom: 14px;
}
.network-panel-topic {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  /* background + color set inline based on cluster colour */
}
.network-panel-meta-sep {
  color: var(--text3);
  opacity: 0.6;
}
.network-panel-divider {
  height: 1px;
  background: rgba(208,216,213,0.75);
  margin: 0 -4px 12px;
}
.network-panel-cta {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.005em;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.network-panel-cta::before {
  content: '→';
  font-size: 14px;
  font-weight: 400;
}
.network-panel-arxiv {
  font-size: 10.5px;
  color: var(--text3);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  font-weight: 400;
  word-break: break-all;
  line-height: 1.35;
}

/* Role in graph — one-line honest sentence derived on the client
   from rank + adjacency, positioned right below the meta row. */
.network-panel-role {
  margin-top: 4px;
  margin-bottom: 12px;
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(74, 124, 111, 0.06);
  border: 1px solid rgba(74, 124, 111, 0.14);
}
.network-panel-role-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
  margin-bottom: 3px;
}
.network-panel-role-text {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text2);
}
/* Direction key inside the Role in graph block — mirrors the canvas
   grammar (solid = cites, dashed = cited by) so readers stop having
   to guess which line style corresponds to which direction. The
   swatches are ACTUAL arrow shapes (stroke + CSS-triangle tip) so
   the legend reads in the same vocabulary as the graph itself. */
.network-panel-role-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dashed rgba(74, 124, 111, 0.22);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
}
.network-panel-role-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* Legend taper — SVG polygon whose shape mirrors the on-canvas edge
   grammar (Scheme B, 2026-07-12). Wide end on the left = citing paper
   (outgoing swatch); wide end on the right = citing paper coming AT
   the focused node (incoming swatch). Same visual sentence as the
   graph, so legend and canvas read as one vocabulary. */
.network-panel-role-legend-taper {
  width: 26px;
  height: 8px;
  vertical-align: middle;
  flex-shrink: 0;
  fill: var(--text2);
  overflow: visible;
}
/* Incoming: same polygon but colour softens a hair so it visually
   matches the softer on-canvas incoming ink (α 0.44 vs outgoing 0.74). */
.network-panel-role-legend-taper--incoming {
  fill: var(--text3);
  opacity: 0.85;
}

/* Legacy arrow swatch (2026-07-12 retired · kept as fossil in case an
   older cached page still hits this rule). Previous version used a
   stroke + CSS-triangle head. */
.network-panel-role-legend-arrow {
  display: inline-block;
  position: relative;
  width: 24px;
  height: 10px;
  vertical-align: middle;
  flex-shrink: 0;
}
.network-panel-role-legend-arrow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 18px;
  border-top: 2px solid var(--text2);
  transform: translateY(-1px);
}
.network-panel-role-legend-arrow--dashed::before {
  border-top-width: 0;
  border-top: 1.5px dashed var(--text2);
  transform: translateY(-0.75px);
}
.network-panel-role-legend-arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 7px solid var(--text2);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transform: translateY(-4px);
}

/* Edge hover — sequential Source → Relation → Target. Each end is
   labelled explicitly (e.g. "Source · citing paper") rather than
   inferred from stacking, so direction of the citation is never
   ambiguous. Relation pattern: short tag on top (bold sage-teal),
   explanatory sentence underneath in muted grey. */
.network-panel-edge-slot {
  margin: 0;
}
.network-panel-edge-slot-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 4px;
}
.network-panel-edge-label {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.32;
  color: var(--text);
  letter-spacing: -0.005em;
}
.network-panel-relation {
  padding: 10px 12px;
  margin: 8px 0;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: rgba(74, 124, 111, 0.07);
}
.network-panel-relation-tag {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.005em;
  margin-bottom: 3px;
}
.network-panel-relation-explain {
  font-size: 11.5px;
  font-style: italic;
  color: var(--text2);
  line-height: 1.4;
}
.network-panel-arrow {
  margin: 6px 0;
  color: var(--text3);
  font-size: 14px;
  text-align: center;
  opacity: 0.55;
}
/* Evidence footer on edge cards — only rendered when the endpoint
   attached real topic_attribution metadata (conf / key_ref / intent). */
.network-panel-evidence {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(208,216,213,0.65);
}
.network-panel-evidence-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 5px;
}
.network-panel-evidence-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text2);
}
.network-panel-evidence-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(74, 124, 111, 0.12);
  color: var(--accent);
  text-transform: uppercase;
}

/* Topic legend — sits bottom-left of the canvas (zoom controls
   are bottom-right so the two never collide). Colour-dot per topic
   so the palette isn't just decoration. */
#expl-net-legend {
  position: absolute;
  left: 24px; bottom: 24px;
  z-index: 8;
  max-width: 240px;
  padding: 11px 14px 12px;
  border: 1px solid rgba(208,216,213,0.9);
  border-radius: 12px;
  background: rgba(252,253,252,0.92);
  box-shadow: 0 1px 9px rgba(45,43,40,0.08);
  backdrop-filter: blur(14px);
  font-family: var(--font-sans);
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}
#expl-net-legend.visible { opacity: 1; }
.expl-net-legend-title {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 6px;
}
.expl-net-legend-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.expl-net-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text2);
  line-height: 1.35;
}
.expl-net-legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 4px currentColor;
}
.expl-net-legend-item--other {
  color: var(--text3);
  margin-top: 3px;
  padding-top: 5px;
  border-top: 1px solid rgba(208,216,213,0.55);
}
.network-panel-content.cluster-color-0 { color: #4A90E2; }
.network-panel-content.cluster-color-1 { color: #E57373; }
.network-panel-content.cluster-color-2 { color: #81C784; }
.network-panel-content.cluster-color-3 { color: #BA68C8; }
