/* Frontier 10k — motion & atmosphere layer (founder order 2026-07-10: "no limits, impress me,
   make it dynamic"). Additive on top of style.css — the data layer beneath is gate-passed and
   untouched. Glow is permitted here by explicit founder revocation of the no-glow rule, but
   remains reserved for SIGNAL: the trajectory, the gauge, live indicators. Obsidian stays matte.
   Every animation respects prefers-reduced-motion. */

/* ---------- boot sequence (once per browser session, <1.2s) ---------- */
.boot {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: var(--s2);
}
.boot-mark {
  font-family: var(--mono); font-size: 11px; letter-spacing: .42em;
  color: var(--text-faint); text-transform: uppercase;
  animation: bootIn .5s cubic-bezier(.2,.7,.3,1) both;
}
.boot-title {
  font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: .18em;
  color: var(--text);
  animation: bootIn .5s .12s cubic-bezier(.2,.7,.3,1) both;
}
.boot-title .boot-accent { color: var(--accent-2); text-shadow: 0 0 24px rgba(110,121,242,.55); }
.boot-line {
  width: 192px; height: 2px; border-radius: 2px; overflow: hidden;
  background: var(--surface-2); position: relative;
  animation: bootIn .4s .2s both;
}
.boot-line::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2));
  animation: bootSweep .7s .25s cubic-bezier(.65,0,.35,1) forwards;
}
.boot-status {
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  color: var(--text-faint); text-transform: uppercase;
  animation: bootIn .4s .3s both;
}
.boot.boot-done { animation: bootOut .45s cubic-bezier(.7,0,.84,0) forwards; }
@keyframes bootIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes bootSweep { to { transform: translateX(0); } }
@keyframes bootOut { to { opacity: 0; visibility: hidden; } }

/* ---------- atmosphere: starfield + horizon grid (canvas, fixed, behind everything) ---------- */
#atmosphere {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .55;
}
.app { position: relative; z-index: 1; }
/* faint aurora wash anchored to the top — gives the obsidian depth without gradients-as-decoration */
.app::before {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  top: -320px; left: 50%; transform: translateX(-50%);
  width: 1100px; height: 560px;
  background: radial-gradient(ellipse at center, rgba(110,121,242,.10), rgba(110,121,242,.035) 45%, transparent 70%);
}

/* ---------- topbar: live clock cluster + LIVE lamp ---------- */
.topbar { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(10px); background: rgba(9,9,11,.82); }
.clock-cluster { display: flex; align-items: center; gap: var(--s2); }
.clock-item { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.clock-k { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; }
.clock-v { font-family: var(--mono); font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.live-lamp {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em; color: var(--green);
}
.live-lamp-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 8px rgba(79,195,138,.9);
  animation: lampBreathe 2.4s ease-in-out infinite;
}
.live-lamp.is-stale { color: var(--amber); }
.live-lamp.is-stale .live-lamp-dot { background: var(--amber); box-shadow: 0 0 8px rgba(227,169,74,.9); animation-duration: 1.1s; }
@keyframes lampBreathe { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }

/* ---------- ticker tape (real activity, Bloomberg register) ---------- */
.ticker {
  position: relative; overflow: hidden; z-index: 40;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(14,14,17,.75);
  height: 32px; display: flex; align-items: center;
  mask-image: linear-gradient(90deg, transparent, black 48px, black calc(100% - 48px), transparent);
}
.ticker-track {
  display: inline-flex; gap: var(--s5); white-space: nowrap; will-change: transform;
  animation: tickerScroll var(--ticker-dur, 90s) linear infinite;
  padding-left: 100%;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: var(--s1); font-size: 11px; color: var(--text-muted); }
.ticker-actor { font-family: var(--mono); color: var(--accent-2); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.ticker-sep { color: var(--text-faint); }
.ticker-time { font-family: var(--mono); color: var(--text-faint); font-size: 10px; }
@keyframes tickerScroll { to { transform: translateX(-100%); } }

/* ---------- entrance choreography ---------- */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.reveal-go { animation: revealUp .6s cubic-bezier(.2,.7,.25,1) forwards; }
@keyframes revealUp { to { opacity: 1; transform: none; } }

/* ---------- signal glow (reserved: trajectory, gauge, alerts) ---------- */
.vector-fill {
  box-shadow: 0 0 14px rgba(110,121,242,.45);
  transition: width 1.1s cubic-bezier(.2,.7,.25,1);
}
.vector-marker { box-shadow: 0 0 10px rgba(110,121,242,.85); }
.gauge-fill {
  transition: stroke-dashoffset 1.4s cubic-bezier(.3,.6,.2,1);
  filter: drop-shadow(0 0 6px rgba(110,121,242,.55));
}
.gauge-wrap { position: relative; }
.gauge-wrap::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%; pointer-events: none;
  border: 1px dashed rgba(110,121,242,.18);
  animation: haloSpin 32s linear infinite;
}
@keyframes haloSpin { to { transform: rotate(360deg); } }
.apex-big-num { text-shadow: 0 0 28px rgba(110,121,242,.30); }

/* scanline shimmer that sweeps the hero once per minute — a heartbeat you can see */
.apex-hero { position: relative; overflow: hidden; }
.apex-hero::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 72px; pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(110,121,242,.06), transparent);
  left: -80px;
  animation: heroSweep 8s cubic-bezier(.6,.1,.3,.9) infinite;
  animation-delay: 2s;
}
@keyframes heroSweep {
  0% { left: -80px; } 22% { left: calc(100% + 8px); } 100% { left: calc(100% + 8px); }
}

/* ---------- live value change: delta flash ---------- */
.flash-up { animation: flashUp 1.2s cubic-bezier(.2,.7,.3,1); }
.flash-any { animation: flashAny 1.2s cubic-bezier(.2,.7,.3,1); }
@keyframes flashUp { 0% { color: var(--green); text-shadow: 0 0 18px rgba(79,195,138,.8); } 100% { } }
@keyframes flashAny { 0% { color: var(--accent-2); text-shadow: 0 0 18px rgba(110,121,242,.8); } 100% { } }

/* ---------- micro-interactions ---------- */
.card { transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease; }
.card:hover { border-color: var(--accent-soft-border); box-shadow: 0 8px 32px rgba(0,0,0,.45), 0 0 0 1px rgba(110,121,242,.06) inset; }
.tab { transition: color .2s ease, border-color .2s ease, background .2s ease; }
.swarm-row, .friction-item, .cf-item, .decision-card, .meta-item-card { transition: border-color .2s ease, background .2s ease; }

/* live dispatch rows: breathing status LED */
.led-live {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 8px rgba(110,121,242,.9);
  animation: lampBreathe 1.8s ease-in-out infinite;
  margin-right: 6px; vertical-align: 1px;
}

/* pulse dot inherits stronger life */
.pulse-dot { animation: lampBreathe 2s ease-in-out infinite; box-shadow: 0 0 8px rgba(79,195,138,.8); }

/* ---------- chart draw-in ---------- */
.vector-chart path.chart-line { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: chartDraw 1.6s .5s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes chartDraw { to { stroke-dashoffset: 0; } }

/* ---------- mobile ---------- */
@media (max-width: 600px) {
  .clock-item.clock-utc { display: none; }
  .ticker { height: 28px; }
}

/* ---------- accessibility: motion off ---------- */
@media (prefers-reduced-motion: reduce) {
  .boot, .boot-line::after, .ticker-track, .gauge-wrap::after, .apex-hero::after,
  .live-lamp-dot, .led-live, .pulse-dot, .reveal { animation: none !important; }
  .reveal { opacity: 1; transform: none; }
  #atmosphere { display: none; }
  .gauge-fill, .vector-fill { transition: none; }
}

/* ============================================================
   SPACE PASS (founder round-2 order: "make space, not everything
   so dense, everything perfectly organized"). Generous rhythm:
   the grid steps up from 8 to a calmer 8-based scale — sections
   breathe, hierarchy reads instantly, nothing shouts.
   ============================================================ */

body { font-size: 13.5px; }

/* wider stage, more air around every band */
.topbar-inner, .apex, .shell, .footer { max-width: 1480px; }
.apex { padding: var(--s6) var(--s5) 0; gap: var(--s4); }
.shell { padding: var(--s5) var(--s5) var(--s8); gap: var(--s5); }
.topbar-inner { padding: var(--s2) var(--s5); }

/* cards breathe */
.apex-hero { padding: var(--s5); gap: var(--s4); }
.apex-autonomy, .apex-friction { padding: var(--s4) !important; }
.apex-row-lower { gap: var(--s4) !important; }

/* the hero number becomes the room's monolith */
.apex-big-num { font-size: 64px; letter-spacing: -0.03em; line-height: 1.05; }
.apex-big-pct { font-size: 22px; }
.apex-hero-numbers { gap: var(--s2); align-items: baseline; }

/* clearer band separation inside panels */
.content { padding-top: var(--s4); }
.panel-head { margin-bottom: var(--s4); }
.panel-head h2 { font-size: 18px; }
.subhead { margin: var(--s5) 0 var(--s2); }
.tabs { gap: var(--s2); }
.tab { padding-top: 12px; padding-bottom: 12px; }

/* organized: hairline section rules under every subhead, quiet but structural */
.subhead::after { content: ""; flex: 1; height: 1px; background: var(--border-hair); align-self: center; }

/* lists get vertical air */
.swarm-matrix, .friction-list, .cf-items, .decisions-list, .meta-feed, .reports-list { gap: var(--s2) !important; display: grid; }
.roster-wrap, .activity-groups { margin-top: var(--s1); }

/* rail becomes a calm column */
.shell-rail { position: sticky; top: 72px; }

@media (max-width: 600px) {
  .apex { padding: var(--s3) var(--s2) 0; }
  .shell { padding: var(--s3) var(--s2) var(--s6); }
  .apex-hero { padding: var(--s3); }
  .apex-big-num { font-size: 44px; }
}

/* sparse-data honesty without dead space: the trend chart stays compact until history exists */
.vector-chart { height: 72px; }
.vector-note { margin-top: 4px; }

/* ============================================================
   ROUND 3 - THE COMPANY, NOT THE REPORT (founder order: agents as
   literal employees in an organigram; details only on click;
   kill the stacked text blocks).
   ============================================================ */

/* ---------- organigram ---------- */
.org-chart { display: flex; flex-direction: column; align-items: center; padding: var(--s2) 0 var(--s4); }
.org-tier { display: flex; justify-content: center; }
.org-stem { width: 1px; height: 24px; background: linear-gradient(var(--border), var(--accent-soft-border)); }
.org-bus { width: min(88%, 960px); height: 1px; background: var(--border); position: relative; }
.org-bus::before, .org-bus::after { content: ""; position: absolute; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.org-bus::before { left: -3px; } .org-bus::after { right: -3px; }

.org-node {
  background: var(--surface); border: 1px solid var(--border-hair); border-radius: var(--radius);
  color: var(--text); cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: var(--s2); position: relative;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.org-node:hover { transform: translateY(-3px); border-color: var(--accent-soft-border); box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.org-node-name { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.org-node-role { font-size: 10.5px; color: var(--text-muted); }
.org-node-status { font-size: 10px; color: var(--text-faint); display: inline-flex; align-items: center; gap: 5px; }
.org-status-live { color: var(--green); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.org-node-task { font-size: 10px; color: var(--text-muted); max-width: 176px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.org-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted);
}
.org-node-emp.is-working .org-avatar { border-color: var(--accent-soft-border); color: var(--accent-2); box-shadow: 0 0 16px rgba(110,121,242,.25); }
.org-avatar-ceo { width: 56px; height: 56px; font-size: 13px; background: var(--accent-soft); border-color: var(--accent-soft-border); color: var(--accent-2); box-shadow: 0 0 20px rgba(110,121,242,.3); }
.org-avatar-founder { width: 40px; height: 40px; background: var(--amber-soft); border-color: rgba(227,169,74,.4); color: var(--amber); }
.org-node-founder, .org-node-ceo { min-width: 208px; }
.org-badge-alert {
  position: absolute; top: -8px; right: -8px;
  background: var(--red-soft); border: 1px solid rgba(236,106,106,.4); color: var(--red);
  font-size: 9px; padding: 2px 8px; border-radius: 999px; font-weight: 700;
}
.org-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(79,195,138,.9); animation: lampBreathe 1.8s ease-in-out infinite; display: inline-block; }
.org-live-dot.is-idle { background: var(--text-faint); box-shadow: none; animation: none; }

.org-grid { display: flex; gap: var(--s3); justify-content: center; flex-wrap: wrap; margin-top: var(--s3); width: 100%; }
.org-dept { display: flex; flex-direction: column; gap: var(--s2); align-items: stretch; min-width: 176px; flex: 0 1 208px; position: relative; padding-top: var(--s3); }
.org-dept::before { content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 16px; background: var(--border); }
.org-dept-label {
  text-align: center; font-size: 9px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 700;
}
.org-node-emp { width: 100%; }

/* ---------- drawer: all detail lives here ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 300; background: rgba(5,5,8,.6);
  backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s ease;
}
.drawer-backdrop.drawer-open { opacity: 1; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 94vw);
  background: var(--bg-elevated); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.7,.25,1);
  display: flex; flex-direction: column;
  box-shadow: -24px 0 64px rgba(0,0,0,.55);
}
.drawer-open .drawer { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s3); border-bottom: 1px solid var(--border-hair);
}
.drawer-title-wrap { display: flex; align-items: center; gap: var(--s2); }
.drawer-mono {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent-soft-border); color: var(--accent-2);
}
.drawer-head h3 { font-family: var(--mono); font-size: 14px; font-weight: 700; }
.drawer-sub { font-size: 11px; color: var(--text-muted); }
.drawer-x {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 18px; line-height: 1; padding: 4px 10px; cursor: pointer;
}
.drawer-x:hover { color: var(--text); border-color: var(--accent-soft-border); }
.drawer-body { overflow-y: auto; padding: var(--s3); display: flex; flex-direction: column; gap: var(--s4); }
.drawer-section { display: flex; flex-direction: column; gap: var(--s1); }
.drawer-kv { display: flex; justify-content: space-between; gap: var(--s2); font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.drawer-k { color: var(--text-faint); }
.drawer-v { color: var(--text); text-align: right; word-break: break-word; }
.drawer-card { background: var(--surface); border: 1px solid var(--border-hair); border-radius: var(--radius); padding: var(--s2); display: flex; flex-direction: column; gap: 6px; }
.drawer-card-live { border-left: 2px solid var(--accent); }
.drawer-card-alert { border-left: 2px solid var(--red); }
.drawer-card-title { font-family: var(--mono); font-size: 11px; color: var(--accent-2); }
.drawer-card-text { font-size: 12px; color: var(--text-muted); line-height: 1.55; }
.drawer-card-meta { font-size: 10px; color: var(--text-faint); }
.drawer-line { display: flex; gap: var(--s1); align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--border-soft); font-size: 11.5px; }
.drawer-line-tag { flex: none; font-size: 9px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); }
.tag-ok { color: var(--green); border-color: rgba(79,195,138,.35); }
.tag-bad { color: var(--red); border-color: rgba(236,106,106,.35); }
.drawer-line-text { color: var(--text-muted); line-height: 1.5; }
.drawer-empty { font-size: 12px; color: var(--text-faint); font-style: italic; }

/* ---------- declutter: kill the walls of text on the surface ---------- */
.panel-sub, .rail-sub, .vector-note { display: none; }
.hero-vacation-text { display: none; }
#org-roster, #org-activity { display: none; }

/* swarm + meta: one-line rows, click expands */
#swarm-matrix [class*="note"], #swarm-matrix [class*="result"] {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#swarm-matrix > *, #meta-feed > * { cursor: pointer; }
#swarm-matrix > *.is-open [class*="note"], #swarm-matrix > *.is-open [class*="result"] { white-space: normal; }
#meta-feed p { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
#meta-feed > *.is-open p { -webkit-line-clamp: unset; }

@media (max-width: 600px) {
  .org-grid { gap: var(--s2); }
  .org-dept { flex: 1 1 100%; padding-top: var(--s2); }
  .org-dept::before { display: none; }
  .org-bus { display: none; }
  .org-node-founder, .org-node-ceo { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer-backdrop { transition: none; }
  .org-live-dot { animation: none; }
}

/* mobile topbar: clocks stay, chrome goes */
@media (max-width: 600px) {
  .meta-generated, #refresh-btn { display: none; }
  .clock-cluster { gap: 10px; }
  .clock-item.clock-heartbeat-hide { display: none; }
  .topbar-inner { flex-wrap: wrap; gap: 8px; }
  .topbar-meta { min-width: 0; }
}
