/* Atlas page only. Four stages, each with its own product visual:
   the work environment being recorded, the knowledge in depth, the hub as a 3D database, agents on the hub.
   Colours come from the site tokens; sizes inside the visuals use container units so each scales as one picture. */
:root {
  --atlas-ground: var(--color-night);
  --atlas-ink: var(--color-on-night);
  --atlas-muted: var(--color-on-night-muted);
  --atlas-dim: color-mix(in srgb, var(--color-on-night) 52%, var(--color-night));
  --atlas-panel: color-mix(in srgb, var(--color-on-night) 6%, var(--color-night));
  --atlas-panel-2: color-mix(in srgb, var(--color-on-night) 10%, var(--color-night));
  --atlas-panel-3: color-mix(in srgb, var(--color-on-night) 16%, var(--color-night));
  --atlas-edge: color-mix(in srgb, var(--color-on-night) 18%, var(--color-night));
  --atlas-route: var(--color-accent);
  --atlas-route-soft: color-mix(in srgb, var(--color-accent) 38%, var(--color-night));
  --atlas-route-deep: color-mix(in srgb, var(--color-accent) 62%, var(--color-night));
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Opening */
.atlas-head h1 { font-size: calc(var(--primitive-fontSize-display) * 1.35); }

/* The spine: four stages down the page, the stage list held beside them */
.spine { background: var(--atlas-ground); color: var(--atlas-ink); padding-block: var(--primitive-spacing-8) var(--primitive-spacing-24); }
.spine-nav { grid-column: 1 / 4; align-self: start; position: sticky; top: calc(var(--bar) + var(--primitive-spacing-12)); display: flex; flex-direction: column; gap: var(--primitive-spacing-8); }
.spine-nav ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--primitive-spacing-2); }
.spine-nav a { display: flex; flex-direction: column; gap: 2px; padding: var(--primitive-spacing-4) var(--primitive-spacing-4) var(--primitive-spacing-4) var(--primitive-spacing-6); text-decoration: none; color: var(--atlas-dim); position: relative; transition: color var(--primitive-motion-fast) ease, background-color var(--primitive-motion-fast) ease; }
.spine-nav a::before { content: ""; position: absolute; left: 0; top: var(--primitive-spacing-4); bottom: var(--primitive-spacing-4); width: 3px; background: var(--atlas-edge); transition: background-color var(--primitive-motion-fast) ease; }
.spine-nav a b { font-family: var(--f-display); font-weight: 600; font-size: var(--primitive-fontSize-lead); letter-spacing: -0.02em; color: inherit; }
.spine-nav a span { font-size: var(--primitive-fontSize-small); }
.spine-nav a:hover { color: var(--atlas-muted); }
.spine-nav a[aria-current="step"] { color: var(--atlas-ink); background: var(--atlas-panel); }
.spine-nav a[aria-current="step"]::before { background: var(--atlas-route); }
.spine-nav a:focus-visible { outline: 2px solid var(--color-ring); outline-offset: 2px; }
.spine-note { color: var(--atlas-dim); font-size: var(--primitive-fontSize-small); padding-left: var(--primitive-spacing-6); }

.stages { grid-column: 4 / 13; display: flex; flex-direction: column; gap: var(--primitive-spacing-40); min-width: 0; }
.stage { --p: .5; display: flex; flex-direction: column; gap: var(--primitive-spacing-12); scroll-margin-top: calc(var(--bar) + var(--primitive-spacing-8)); min-width: 0; }
.stage-text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--spacing-gutter); align-items: end; }
.stage-text h2 { font-size: var(--primitive-fontSize-head); line-height: 1; max-width: 13ch; }
.stage-text p { font-size: var(--primitive-fontSize-body); line-height: 1.55; color: var(--atlas-muted); max-width: 46ch; }

/* Shared for every visual: the frame, the grain, the example label */
.desk, .depth-wrap, .db-wrap { position: relative; container-type: inline-size; overflow: hidden; background: var(--atlas-panel); }
.desk::after, .depth-wrap::after, .db-wrap::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: url("../img/grain.png?v=20261026") repeat; background-size: 180px; mix-blend-mode: overlay; opacity: .2; }
.tag { position: absolute; left: 2cqw; top: 1.6cqw; z-index: 5; font-size: 12px; font-weight: 600; color: var(--atlas-route); background: var(--atlas-ground); padding: 3px 8px; }

/* Stage 1: the work environment */
.desk { aspect-ratio: 16 / 10; max-width: 100%; background: var(--atlas-panel); }
.desk-bar { display: flex; justify-content: space-between; height: 3.4cqw; padding: 0 2cqw; align-items: center; font-size: max(10px, 1.15cqw); color: var(--atlas-muted); background: var(--atlas-ground); }
.desk-app { font-weight: 600; color: var(--atlas-ink); }
.win { position: absolute; left: 3cqw; right: 3cqw; top: 6cqw; bottom: 13cqw; background: var(--atlas-ground); display: flex; flex-direction: column; }
.win-tabs { display: flex; gap: .4cqw; padding: .8cqw .8cqw 0; background: var(--atlas-panel); }
.win-tabs span { font-size: max(10px, 1.1cqw); padding: .7cqw 1.4cqw; color: var(--atlas-dim); background: var(--atlas-panel-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-tabs span.on { background: var(--atlas-ground); color: var(--atlas-ink); }
.win-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.6cqw; padding: 1.8cqw; min-height: 0; }
.dash, .sheet-pane { background: var(--atlas-panel); padding: 1.4cqw; display: flex; flex-direction: column; gap: 1cqw; min-width: 0; min-height: 0; }
.dash-head { display: flex; justify-content: space-between; gap: 1cqw; font-size: max(10px, 1.15cqw); color: var(--atlas-dim); }
.dash-head b { color: var(--atlas-ink); font-weight: 600; }
.chart { width: 100%; flex: 1; min-height: 0; }
.chart-grid path { stroke: var(--atlas-edge); stroke-width: 1; vector-effect: non-scaling-stroke; fill: none; }
.chart .ln { fill: none; stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-dasharray: 600; stroke-dashoffset: 0; }
.chart .ln-a { stroke: var(--atlas-route); }
.chart .ln-b { stroke: var(--atlas-muted); }
.chart .ln-c { stroke: var(--atlas-dim); }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8cqw; }
.kpis div { background: var(--atlas-panel-2); padding: .9cqw 1cqw; display: flex; flex-direction: column; gap: .2cqw; font-size: max(9px, 1cqw); color: var(--atlas-dim); min-width: 0; }
.kpis b { font-size: max(11px, 1.6cqw); color: var(--atlas-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.kpis i { font-style: normal; font-weight: 600; }
.kpis .up { color: var(--atlas-route); }
.sheet { width: 100%; border-collapse: collapse; font-size: max(9px, 1.05cqw); font-variant-numeric: tabular-nums; }
.sheet th { text-align: left; font-weight: 600; color: var(--atlas-dim); padding: .6cqw .7cqw; background: var(--atlas-panel-2); }
.sheet td { padding: .7cqw; background: var(--atlas-panel); } /* taste-skill-ignore: a real table inside the product interface */
.sheet tr + tr td { border-top: 1px solid var(--atlas-ground); } /* taste-skill-ignore: a real table inside the product interface */
.sheet tr.paste td { animation: paste 6s ease-in-out infinite; }
.rec-pill { position: absolute; top: 7.6cqw; right: 4.4cqw; display: flex; align-items: center; gap: .8cqw; padding: .7cqw 1.3cqw; background: var(--atlas-ground); font-size: max(10px, 1.15cqw); font-variant-numeric: tabular-nums; z-index: 3; }
.rec-pill i { width: .9cqw; height: .9cqw; min-width: 7px; min-height: 7px; border-radius: 50%; background: var(--atlas-route); animation: pulse 1.6s ease-in-out infinite; }
.rec-pill .mic { color: var(--atlas-dim); }
.capture { position: absolute; right: 3cqw; bottom: 2.4cqw; width: 30cqw; background: var(--atlas-ground); padding: 1.3cqw 1.5cqw; display: flex; flex-direction: column; gap: .8cqw; font-size: max(10px, 1.1cqw); z-index: 3; }
.capture b { font-weight: 600; color: var(--atlas-route); }
.capture ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5cqw; }
.capture li { display: flex; gap: .7cqw; align-items: baseline; color: var(--atlas-muted); }
.capture li::before { content: ""; flex: none; width: .7cqw; height: .7cqw; min-width: 6px; min-height: 6px; background: var(--atlas-edge); }
.capture li.done::before { background: var(--atlas-route); }
.capture li.now { color: var(--atlas-ink); }
.capture li.now::before { background: var(--atlas-route); animation: pulse 1.2s ease-in-out infinite; }
.pointer { position: absolute; left: 0; top: 0; width: 2.2cqw; min-width: 14px; z-index: 4; fill: var(--atlas-ink); stroke: var(--atlas-ground); stroke-width: 1.4; animation: point 6s cubic-bezier(.65, 0, .35, 1) infinite; }
.narration { position: absolute; left: 3cqw; bottom: 2.4cqw; width: 61cqw; display: grid; grid-template-columns: 14cqw minmax(0, 1fr); gap: 1.6cqw; align-items: center; padding: 1.2cqw 1.6cqw; background: var(--atlas-ground); z-index: 3; }
.wave { width: 100%; height: 3.6cqw; min-height: 22px; display: block; color: var(--atlas-route); border-top: 0 solid var(--atlas-edge); }
.narration p { font-size: max(11px, 1.3cqw); line-height: 1.4; color: var(--atlas-ink); }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes paste { 0%, 45% { background: var(--atlas-panel); } 55%, 80% { background: var(--atlas-route-soft); } 100% { background: var(--atlas-panel); } }
@keyframes point {
  0% { transform: translate(14cqw, 26cqw); }
  25% { transform: translate(30cqw, 47cqw); }
  45% { transform: translate(30cqw, 47cqw); }
  70% { transform: translate(64cqw, 33cqw); }
  100% { transform: translate(14cqw, 26cqw); }
}

/* Stage 2: knowledge in depth */
.depth-wrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: center; gap: 2cqw; padding: 4cqw; min-height: 44cqw; }
.depth-scene { perspective: 1500px; perspective-origin: 50% 30%; display: grid; place-items: center; min-height: 38cqw; }
.depth { --sep: calc(5cqw + var(--p) * 9cqw); position: relative; width: 40cqw; aspect-ratio: 16 / 10; transform-style: preserve-3d; transform: rotateX(54deg) rotateZ(-32deg) translate3d(2cqw, 4cqw, -10cqw); }
.layer { position: absolute; inset: 0; padding: 2cqw 2.4cqw; background: color-mix(in srgb, var(--atlas-panel-2) 78%, transparent); outline: 1px solid var(--atlas-edge); transform: translate3d(calc((3 - var(--i)) * 1.6cqw), calc((3 - var(--i)) * 2.2cqw), calc(var(--i) * var(--sep))); transition: transform .2s linear; display: flex; flex-direction: column; gap: 1cqw; overflow: hidden; }
.layer h3 { font-family: var(--f-text); font-size: 1.7cqw; font-weight: 600; letter-spacing: 0; color: var(--atlas-route); }
.layer.l1 h3 { color: var(--atlas-ink); }
.layer p, .layer li { font-size: 1.45cqw; line-height: 1.35; color: var(--atlas-ink); }
.layer ol, .layer ul { margin: 0; padding-left: 2cqw; display: flex; flex-direction: column; gap: .4cqw; }
.layer .chips { display: flex; flex-wrap: wrap; gap: .8cqw; }
.layer .chips span { font-size: 1.35cqw; padding: .4cqw 1cqw; background: var(--atlas-panel-3); }
.layer.l1 { background: color-mix(in srgb, var(--atlas-route) 22%, var(--atlas-panel-2)); outline-color: var(--atlas-route); }
.layer.l1 p { font-size: 1.8cqw; font-weight: 500; }
.depth-key { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.8cqw; counter-reset: none; }
.depth-key li { display: flex; flex-direction: column; gap: .3cqw; padding-left: 1.6cqw; position: relative; }
.depth-key li::before { content: ""; position: absolute; left: 0; top: .5cqw; width: .8cqw; height: .8cqw; min-width: 7px; min-height: 7px; background: var(--atlas-edge); }
.depth-key li:first-child::before { background: var(--atlas-route); }
.depth-key b { font-size: max(14px, 1.9cqw); font-weight: 600; }
.depth-key span { font-size: max(12px, 1.4cqw); color: var(--atlas-muted); }

/* Stage 3 and 4: the hub as a horizontal 3D database */
.db-wrap { min-height: 46cqw; }
.db-scene { perspective: 1700px; perspective-origin: 50% 18%; height: 46cqw; display: grid; place-items: center; }
.db { position: relative; width: 78cqw; transform-style: preserve-3d; transform: rotateX(60deg) rotateZ(calc(-22deg + var(--p) * 10deg)) translateY(-2cqw); display: flex; flex-direction: column; gap: 1.8cqw; }
.lane { position: relative; display: flex; align-items: center; gap: 1cqw; transform-style: preserve-3d; padding: 1cqw 1.2cqw; background: var(--atlas-panel-2); }
.lane-name { flex: none; width: 13cqw; font-size: 1.45cqw; font-weight: 600; color: var(--atlas-muted); }
.rec { --h: 1.6cqw; position: relative; flex: none; width: 11.5cqw; height: 4.4cqw; transform-style: preserve-3d; transform: translateZ(var(--h)); transition: transform .7s cubic-bezier(.34, 1.3, .64, 1); }
.rec .top { position: absolute; inset: 0; background: var(--atlas-panel-3); display: flex; align-items: center; padding: 0 .9cqw; font-size: 1.05cqw; line-height: 1.15; color: var(--atlas-muted); overflow: hidden; transition: background-color .5s ease, color .5s ease; }
.rec .front { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); background: var(--atlas-panel-2); transform-origin: bottom; transform: rotateX(-90deg); transition: background-color .5s ease; }
.rec .side { position: absolute; top: 0; bottom: 0; right: 0; width: var(--h); background: var(--atlas-ground); transform-origin: right; transform: rotateY(90deg); }
.rec.lit .top { background: var(--atlas-route); color: var(--color-on-accent); }
.rec.lit .front { background: var(--atlas-route-deep); }
.rec.incoming { transform: translateZ(9cqw); }
.rec.incoming .top { background: var(--atlas-route); color: var(--color-on-accent); }
.rec.read .top { background: var(--atlas-ink); color: var(--atlas-ground); }
.rec.read .front { background: var(--atlas-muted); }
.db-feed { position: absolute; right: 2cqw; top: 2cqw; display: flex; flex-direction: column; gap: .4cqw; background: var(--atlas-ground); padding: 1.3cqw 1.6cqw; font-size: max(11px, 1.2cqw); max-width: 32cqw; z-index: 3; }
.db-feed b { font-size: max(12px, 1.4cqw); }
.db-feed span:last-child { color: var(--atlas-muted); }
.state { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 2px 8px; background: var(--atlas-route); color: var(--color-on-accent); }

/* Agents stand above the database and read from rows */
.agent { position: absolute; left: 0; top: 0; transform-style: preserve-3d; pointer-events: none; }
.agent .beam { position: absolute; left: -1px; top: 0; width: 2px; height: 15cqw; background: var(--atlas-route); transform-origin: top; transform: rotateX(-90deg); opacity: .3; transition: opacity .4s ease; }
.agent .node { position: absolute; left: -2.1cqw; top: -2.1cqw; width: 4.2cqw; height: 4.2cqw; transform: translateZ(15cqw) rotateZ(calc(22deg - var(--p) * 10deg)) rotateX(-60deg); display: grid; place-items: center; }
.agent .node i { width: 2.4cqw; height: 2.4cqw; background: var(--atlas-ground); outline: 2px solid var(--atlas-route); transform: rotate(45deg); transition: background-color .4s ease; }
.agent .node span { position: absolute; top: 100%; white-space: nowrap; font-size: 1.3cqw; font-weight: 600; color: var(--atlas-muted); transition: color .4s ease; }
.agent.on .beam { opacity: 1; }
.agent.on .node i { background: var(--atlas-route); }
.agent.on .node span { color: var(--atlas-ink); }
.agent-log { position: absolute; right: 2cqw; top: 2cqw; width: 30cqw; background: var(--atlas-ground); padding: 1.4cqw 1.6cqw; display: flex; flex-direction: column; gap: .9cqw; font-size: max(11px, 1.2cqw); z-index: 3; }
.agent-head { display: flex; flex-direction: column; gap: .5cqw; }
.agent-head b { font-size: max(12px, 1.45cqw); }
.reads { color: var(--atlas-muted); }
.reads b { color: var(--atlas-ink); font-weight: 600; }
.log { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .5cqw; }
.log li { display: flex; gap: .8cqw; color: var(--atlas-dim); transition: color .3s ease; }
.log li::before { content: ""; flex: none; width: .8cqw; height: .8cqw; min-width: 7px; min-height: 7px; margin-top: .45em; outline: 1.5px solid currentColor; outline-offset: -1.5px; }
.log li.done { color: var(--atlas-ink); }
.log li.done::before { background: var(--atlas-route); outline-color: var(--atlas-route); }

/* After the spine */
.gains .list li { border-top-color: var(--color-foreground); }
.crew-list { grid-column: 1 / 13; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--spacing-gutter); }
.crew-list li { display: flex; flex-direction: column; gap: var(--primitive-spacing-2); min-width: 0; }
.crew-list img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; margin-bottom: var(--primitive-spacing-4); }
.crew-list b { font-size: var(--primitive-fontSize-lead); font-weight: 600; letter-spacing: -0.01em; }
.crew-list span { color: var(--color-muted-foreground); }

@media (max-width: 1000px) {
  .spine-nav { display: none; }
  .stages { grid-column: 1 / 13; gap: var(--primitive-spacing-24); }
  .stage-text { grid-template-columns: 1fr; align-items: start; }
  .depth-wrap { grid-template-columns: 1fr; padding: 5cqw; }
  .depth-scene { min-height: 52cqw; }
  .depth { width: 62cqw; }
  .layer h3 { font-size: 2.4cqw; } .layer p, .layer li { font-size: 2cqw; } .layer .chips span { font-size: 1.9cqw; } .layer.l1 p { font-size: 2.4cqw; }
  .depth-key { flex-direction: row; flex-wrap: wrap; gap: 3cqw 5cqw; }
  .depth-key li { flex: 1 1 40%; }
}
@media (max-width: 720px) {
  .desk { aspect-ratio: 3 / 4; }
  .desk-bar { height: 8cqw; font-size: 11px; }
  .win { top: 11cqw; left: 3cqw; right: 3cqw; }
  .win-tabs span:not(.on) { display: none; }
  .win-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .sheet-pane, .capture, .pointer { display: none; }
  .rec-pill { top: 12cqw; right: 5cqw; }
  .narration { width: 94cqw; bottom: 3cqw; grid-template-columns: 1fr; gap: 2cqw; padding: 3cqw; }
  .win { bottom: 34cqw; }
  .wave { height: 8cqw; }
  .narration p { font-size: 13px; }
  .tag { top: 1.6cqw; bottom: auto; right: 2cqw; left: auto; }
  .depth { width: 74cqw; }
  .layer { padding: 2.6cqw 3cqw; }
  .layer h3 { font-size: 3.4cqw; } .layer p, .layer li { font-size: 2.9cqw; } .layer .chips span { font-size: 2.8cqw; } .layer.l1 p { font-size: 3.4cqw; }
  .layer.l2 li:nth-child(n+3), .layer.l4 li:nth-child(n+3) { display: none; }
  .depth-key b { font-size: 14px; } .depth-key span { font-size: 13px; }
  .db-wrap { min-height: auto; display: flex; flex-direction: column; }
  .db-scene { height: 82cqw; }
  .db { width: 120cqw; transform: rotateX(60deg) rotateZ(calc(-26deg + var(--p) * 8deg)) translateY(-4cqw) scale(.78); }
  .lane-name { font-size: 2.6cqw; width: 18cqw; }
  .rec .top { font-size: 0; }
  .db-feed, .agent-log { position: static; width: auto; max-width: none; margin: 0 3cqw 12cqw; padding: 4cqw; font-size: 13px; }
  .db-feed b, .agent-head b { font-size: 15px; }
  .agent .node span { display: none; }
  .crew-list { grid-template-columns: 1fr 1fr; }
  .crew-list li:last-child { grid-column: 1 / 3; max-width: 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet tr.paste td, .rec-pill i, .capture li.now::before, .pointer { animation: none; }
  .pointer { transform: translate(30cqw, 47cqw); }
  .layer, .rec, .rec .top, .rec .front, .agent .beam { transition: none; }
}
/* Without 3D support the visuals lie flat and still read */
@supports not (transform-style: preserve-3d) {
  .depth, .db { transform: none; }
  .layer { position: relative; transform: none; inset: auto; margin-bottom: 1cqw; }
  .agent { display: none; }
}
