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

html {
  scroll-behavior: smooth;
  /* the atmosphere gradient tracks with the page, not the viewport scroll */
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-canvas);
  color: var(--ink-1);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* reveal-on-scroll primitives — used by nodes, cards, and any element
   that gets observed by the IntersectionObserver in reveal.js. */
.reveal-ready { opacity: 0; transform: translateY(18px); will-change: opacity, transform; }
.reveal-ready.is-revealed {
  opacity: 1;
  transform: none;
  transition: opacity 520ms var(--ease), transform 640ms var(--ease);
}

/* honor user's motion preference — kill all transitions + reveal animations */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-ready { opacity: 1; transform: none; }
}

body.bg-atmosphere {
  background-color: var(--bg-canvas);
  background-image:
    /* orange atmosphere — hero-right side, blends through the globe area */
    radial-gradient(1400px 900px at 75% 18%, rgba(255, 107, 53, 0.18), transparent 65%),
    /* softer secondary highlight across the top */
    radial-gradient(1600px 800px at 50% -8%, rgba(255, 107, 53, 0.08), transparent 70%),
    /* steel counterweight bottom-left */
    radial-gradient(1100px 800px at -5% 110%, rgba(143, 185, 230, 0.06), transparent 60%);
  background-attachment: fixed;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

#app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
}

/* single pulsing element allowed by the design system */
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.view { padding: 48px 56px 96px; max-width: 1680px; margin: 0 auto; position: relative; }

.view__topmeta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.view__wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.view__wordmark .wordmark__text { font-family: var(--font-sans); font-weight: 700; font-size: 22px; letter-spacing: -0.03em; color: var(--ink-1); }
.view__volume { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); margin: 0; }

.view__head { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: start; margin-bottom: 48px; }
.view__sectionnum { font-family: var(--font-serif); font-style: italic; font-size: 180px; line-height: 0.88; color: var(--brand); letter-spacing: -0.04em; text-indent: -6px; }
.view__headbody { min-width: 0; }
.view__eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 20px; display: inline-flex; align-items: center; gap: 12px; }
.view__eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--brand); }
.view__title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(48px, 5.5vw, 88px); line-height: 1.02; letter-spacing: -0.022em; margin: 0 0 24px; max-width: 960px; }
.view__title .emph { font-style: italic; background: var(--brand-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.view__sub { font-family: var(--font-serif); font-size: 22px; color: var(--ink-2); max-width: 780px; margin: 0 0 24px; line-height: 1.4; }
.view__canvas { position: relative; margin: 36px auto 0; }
.view__edges { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.view__nodes { position: absolute; inset: 0; z-index: 2; }

.node {
  position: absolute;
  padding: 20px 22px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015) 60%, rgba(0,0,0,0.15));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 4px 16px rgba(0,0,0,0.35);
  backdrop-filter: blur(14px);
  color: var(--ink-1);
  transition: border-color var(--dur-micro) var(--ease), opacity var(--dur-micro) var(--ease);
}
.node:hover { border-color: var(--brand-30); }
.node__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.node__icon { width: 20px; height: 20px; color: var(--brand); }
.node__title { font-family: var(--font-serif); font-weight: 400; font-size: 22px; line-height: 1.15; margin: 0; }
.node__body { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 0 0 14px; }
.node__foot { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.node__tag { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); padding: 3px 8px; border: 1px solid var(--ink-4); border-radius: 999px; }
.node__xref { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand); padding: 3px 8px; border: 1px solid var(--brand-30, rgba(255,107,53,0.30)); border-radius: 999px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }

/* ============================================================
   NODE TYPE VARIANTS — v7-inspired shape vocabulary
   stage · process · tool · doc · orb · tile
   ============================================================ */

.node--stage {
  background:
    linear-gradient(180deg, rgba(255,107,53,0.05), transparent 40%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015) 60%, rgba(0,0,0,0.15));
}
.node--process {
  /* default rectangular card — no override */
}
.node--doc   { border-style: dashed; }

/* tool → compact rectangular with bolder icon */
.node--tool  { border-radius: 12px; padding: 16px 18px; }
.node--tool .node__icon { width: 24px; height: 24px; }
.node--tool .node__title { font-size: 18px; }

/* TILE — big centered icon with tiny label underneath (like v7 AI tool tiles) */
.node--tile {
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 18px;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(255,107,53,0.08), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015) 60%, rgba(0,0,0,0.2));
}
.node--tile .node__head { flex-direction: column; margin: 0; gap: 0; }
.node--tile .node__icon { width: 44px; height: 44px; color: var(--brand); stroke-width: 1.25; }
.node--tile .node__title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 6px 0 0;
}
.node--tile .node__body {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
  text-align: center;
}
.node--tile .node__foot { display: none; }

/* ORB — circular agent with animated halo (poster-v7 "agent" style).
   The body text renders below the circle, like the v7 name/title/blurb. */
.node--orb {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: visible;
}
.node--orb::before {
  /* primary halo — soft brand glow */
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,107,53,0.28), rgba(255,107,53,0) 70%);
  pointer-events: none;
  animation: orb-pulse 3.6s var(--ease) infinite;
}
.node--orb::after {
  /* secondary halo — wider, slower */
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,107,53,0.12), rgba(255,107,53,0) 72%);
  pointer-events: none;
  animation: orb-pulse 5.4s var(--ease) infinite 0.8s;
}
@keyframes orb-pulse {
  0%, 100% { transform: translateX(-50%) scale(0.96); opacity: 0.9; }
  50%      { transform: translateX(-50%) scale(1.06); opacity: 1; }
}

.node--orb .node__head {
  position: relative;
  z-index: 1;
  width: 78px;
  height: 78px;
  margin: 30px auto 14px;
  border-radius: 50%;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,0.14), transparent 60%),
    linear-gradient(180deg, #FF7A3D, #E8552A 120%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 10px 30px rgba(255,107,53,0.35),
    0 0 0 1px rgba(255,122,61,0.5);
}
.node--orb .node__icon { color: var(--ink-1); width: 28px; height: 28px; stroke-width: 1.5; }
.node--orb .node__title {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.1;
  margin: 0 0 6px;
  position: relative;
  z-index: 1;
}
.node--orb .node__body {
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 10px;
  max-width: 90%;
  position: relative;
  z-index: 1;
}
.node--orb .node__foot {
  justify-content: center;
  position: relative;
  z-index: 1;
}
.node--orb .node__tag {
  background: rgba(255,107,53,0.08);
  border-color: var(--brand-30);
  color: var(--brand);
}

/* orb hover — intensify the glow */
.node--orb:hover::before { background: radial-gradient(closest-side, rgba(255,107,53,0.42), rgba(255,107,53,0) 72%); }

@media (prefers-reduced-motion: reduce) {
  .node--orb::before, .node--orb::after { animation: none; }
}

/* ============================================================
   TEMPLATED NODES — Trello-style board + editor leaderboard
   (poster-v7 mini-mockups embedded in the diagram)
   ============================================================ */

.node--boardcard {
  padding: 18px 18px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01) 60%, rgba(0,0,0,0.15));
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 4px 16px rgba(0,0,0,0.35);
  color: var(--ink-1);
  overflow: hidden;
}
.board__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.board__icon { width: 18px; height: 18px; color: var(--brand); flex-shrink: 0; }
.board__title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.board__brand { font-family: var(--font-sans); font-weight: 600; font-size: 13px; color: var(--ink-1); letter-spacing: -0.01em; }
.board__sub { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; }
.board__live { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brand); padding: 3px 8px; border: 1px solid var(--brand-30); border-radius: 999px; }
.board__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.board__col { background: rgba(0,0,0,0.18); border: 1px solid var(--ink-4); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.board__colhead { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); padding: 2px 2px 6px; border-bottom: 1px solid var(--ink-4); }
.board__count { color: var(--ink-2); font-weight: 500; }
.board__card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: 6px; padding: 6px 8px; font-size: 11px; line-height: 1.3; color: var(--ink-1); }
.board__card--steel   { border-left: 2px solid var(--steel); }
.board__card--warn    { border-left: 2px solid var(--warn); }
.board__card--success { border-left: 2px solid var(--success); }
.board__cardtitle { font-size: 10.5px; line-height: 1.3; }
.board__tag { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }

/* leaderboard */
.node--leaderboard {
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01) 60%, rgba(0,0,0,0.15));
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 4px 16px rgba(0,0,0,0.35);
  color: var(--ink-1);
  overflow: hidden;
}
.lb__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.lb__eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2); }
.lb__cap { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brand); padding: 3px 8px; border: 1px solid var(--brand-30); border-radius: 999px; }
.lb__sub { font-family: var(--font-serif); font-size: 13px; color: var(--ink-2); margin: 4px 0 10px; line-height: 1.3; }
.lb__sub .emph { font-style: italic; background: var(--brand-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.lb__rows { display: flex; flex-direction: column; gap: 4px; }
.lb__row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 5px 6px; border-radius: 8px; }
.lb__row.is-top { background: rgba(255,107,53,0.06); border: 1px solid var(--brand-30); }
.lb__av { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-sans); font-weight: 700; font-size: 12px; color: var(--bg-canvas); }
.lb__av--gold   { background: linear-gradient(135deg, #E8C068, #B08A3C); }
.lb__av--silver { background: linear-gradient(135deg, #D4D4D0, #8F8F8A); }
.lb__av--bronze { background: linear-gradient(135deg, #C88E5A, #8A5F3A); }
.lb__av--eor    { background: linear-gradient(135deg, #8FB9E6, #5F8AB8); }
.lb__nm { display: flex; flex-direction: column; min-width: 0; }
.lb__name { font-size: 12px; font-weight: 500; color: var(--ink-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb__rank { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.lb__trust { font-family: var(--font-serif); font-style: italic; font-size: 18px; color: var(--brand); letter-spacing: -0.02em; }

/* edges */
.edge { fill: none; stroke: var(--edge-stroke); stroke-width: 1.25; opacity: 0.8; }
.edge--solid  { stroke: var(--ink-3); }
.edge--dashed { stroke: var(--ink-3); }
.edge__label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; fill: var(--ink-3); }

/* ============================================================
   HUB — split hero (title left, globe right), cards below
   ============================================================ */
.hub { padding: 72px 56px 96px; max-width: 1680px; margin: 0 auto; position: relative; }
.hub__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.wordmark { display: flex; align-items: center; gap: 10px; }
.wordmark__text { font-family: var(--font-sans); font-weight: 700; font-size: 22px; letter-spacing: -0.03em; color: var(--ink-1); }
.hub__volume { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); margin: 0; }

.hub__hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 40px;
  align-items: center;
  min-height: 720px;
  margin-bottom: 80px;
}
.hub__hero-copy { position: relative; z-index: 2; padding-right: 24px; }
.hub__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(72px, 10vw, 148px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  margin: 0 0 28px;
}
.hub__title .emph {
  font-style: italic;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}
.hub__sub {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--ink-2);
  max-width: 540px;
  margin: 0;
  line-height: 1.45;
}

.hub__globe {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: 880px;
  pointer-events: none;
}
.hub__globe canvas,
.hub__globe svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* cards grid — filled tier row, stubs row */
.hub__cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.hub-card {
  padding: 24px 24px;
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 4px 16px rgba(0,0,0,0.35);
  color: var(--ink-1);
  cursor: pointer;
  transition: border-color var(--dur-micro) var(--ease), background-color var(--dur-micro) var(--ease);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
}
.hub-card:hover { border-color: var(--brand-30); background: rgba(255,107,53,0.04); }
.hub-card--soon { cursor: default; opacity: 0.42; }
.hub-card--soon:hover { border-color: rgba(255,255,255,0.08); background: rgba(255,255,255,0.035); }
.hub-card__head { display: flex; justify-content: space-between; align-items: center; }
.hub-card__num { font-family: var(--font-serif); font-style: italic; font-size: 28px; color: var(--brand); letter-spacing: -0.02em; line-height: 1; }
.hub-card__icon { width: 20px; height: 20px; color: var(--ink-2); stroke-width: 1.5; }
.hub-card__title { font-family: var(--font-serif); font-weight: 400; font-size: 28px; line-height: 1.05; margin: 6px 0 0; letter-spacing: -0.015em; }
.hub-card__body { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 0; flex: 1; }
.hub-card__cta { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--brand); margin-top: 4px; }

/* ============================================================
   cross-refs at the end of a sub-view
   ============================================================ */
.view__xrefs { margin: 72px 0 0; padding: 32px 0; border-top: 1px solid var(--ink-4); }
.view__xrefs-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 16px; }
.view__xrefs ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.xref-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: rgba(255,107,53,0.06); border: 1px solid rgba(255,107,53,0.30); color: var(--brand); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; transition: background-color var(--dur-micro) var(--ease); }
.xref-pill:hover { background: rgba(255,107,53,0.12); }
.xref-pill i { width: 14px; height: 14px; }

.node.is-anchored { box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 0 0 2px var(--brand), 0 0 32px rgba(255,107,53,0.35); }

/* Hub hero collapses on narrow viewports */
@media (max-width: 1100px) {
  .hub__hero { grid-template-columns: 1fr; gap: 24px; min-height: auto; }
  .hub__hero-copy { padding-right: 0; }
  .hub__globe { max-height: 560px; }
  .hub__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hub { padding: 48px 24px 64px; }
  .hub__cards { grid-template-columns: 1fr; }
}
