/* Frontier design system: a crisp product look. Light content, deep-ink heroes, one gradient
   brand (indigo → violet → cyan). Tokens first; dark mode redefines them. */

:root {
  --bg: #faf9f6;
  --band: #f2f0eb;
  --band-2: #f6f4ef;
  --card: #ffffff;
  --card-2: #fcfbf8;
  --ink: #17171a;
  --ink-2: #55534e;
  --ink-3: #8e8a82;
  --line: #e9e6df;
  --line-2: #d9d5cc;
  --accent: #a94f2a;          /* clay: links, highlights */
  --accent-2: #d29a68;        /* sand */
  --accent-3: #5f8a6e;        /* sage */
  --accent-ink: #ffffff;
  --accent-soft: #f5ebe3;
  --grad: linear-gradient(120deg, #a94f2a 0%, #d29a68 100%);
  --up: #2f7d55;
  --up-soft: #e4f1e9;
  --down: #c2453f;
  --down-soft: #fbeceb;
  --warn: #a86411;
  --warn-soft: #fbf1df;
  --night: #17171a;           /* console background (same in both themes) */
  --night-2: #222226;
  --night-line: rgba(255, 255, 255, .1);
  --night-ink: #f1efea;
  --night-ink-2: #a9a59c;
  --shadow-1: 0 1px 2px rgba(30, 25, 15, .05), 0 2px 10px rgba(30, 25, 15, .04);
  --shadow-2: 0 4px 10px rgba(30, 25, 15, .05), 0 18px 44px rgba(30, 25, 15, .09);
  --shadow-glow: 0 10px 30px rgba(23, 23, 26, .18);
  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1180px;
  --font: "Inter", "Segoe UI Variable Display", "Segoe UI Variable Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "Cascadia Code", "Cascadia Mono", "SF Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211; --band: #181816; --band-2: #1b1a18; --card: #1f1e1b; --card-2: #23221f;
    --ink: #f1efea; --ink-2: #bab6ad; --ink-3: #86827a; --line: #2f2d29; --line-2: #3c3a34;
    --accent: #e08a5c; --accent-2: #e6b183; --accent-3: #8fbf9f; --accent-ink: #17171a;
    --accent-soft: #3a261b;
    --up: #6fcf97; --up-soft: #16281e; --down: #f08a84; --down-soft: #331a19;
    --warn: #f0b85a; --warn-soft: #2e2414;
    --shadow-1: none; --shadow-2: 0 18px 44px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121211; --band: #181816; --band-2: #1b1a18; --card: #1f1e1b; --card-2: #23221f;
  --ink: #f1efea; --ink-2: #bab6ad; --ink-3: #86827a; --line: #2f2d29; --line-2: #3c3a34;
  --accent: #e08a5c; --accent-2: #e6b183; --accent-3: #8fbf9f; --accent-ink: #17171a;
  --accent-soft: #3a261b;
  --up: #6fcf97; --up-soft: #16281e; --down: #f08a84; --down-soft: #331a19;
  --warn: #f0b85a; --warn-soft: #2e2414;
  --shadow-1: none; --shadow-2: 0 18px 44px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* agent colours (timeline, charts): muted, earthy */
:root {
  --ag-planner: #7c6a9e; --ag-scout: #3f5f8a; --ag-recommender: #4b8a9a; --ag-openalex: #5f8a6e;
  --ag-critic: #c08a2e; --ag-curator: #a94f2a; --ag-cartographer: #7a9a4a; --ag-writer: #8e8a82;
  --ag-guardian: #2f7d55;
}

/* -- base ---------------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--font); min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main { flex: 1; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.025em; margin: 0 0 .5em; font-weight: 750; }
h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.55rem, 2.8vw, 2.25rem); }
h3 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.015em; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .88em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sr-only:focus { position: fixed; left: 12px; top: 12px; width: auto; height: auto; clip: auto;
                 z-index: 99; background: var(--card); padding: 8px 14px; border-radius: 8px; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* -- header --------------------------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}
.site-header .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800;
         font-size: 1.12rem; letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; color: var(--ink); }
.brand small { font-weight: 700; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase;
               color: var(--ink-2); background: color-mix(in srgb, var(--line) 80%, transparent); border-radius: 99px;
               padding: 2px 7px; }
.nav { display: flex; gap: 2px; margin-left: 6px; }
.nav a { color: var(--ink-2); padding: 7px 12px; border-radius: 99px; font-size: .9rem;
         font-weight: 600; white-space: nowrap; transition: background .2s, color .2s; }
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--line) 70%, transparent);
               text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); background: var(--card);
                              box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }
.head-search { position: relative; }
.head-search svg { position: absolute; left: 12px; top: 50%; width: 15px; height: 15px;
                   transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.head-search input { font: inherit; font-size: .86rem; width: 180px; padding: 8px 14px 8px 34px;
                     border-radius: 99px; border: 1px solid var(--line-2); background: var(--card);
                     color: var(--ink); transition: width .25s var(--ease), border-color .2s, box-shadow .2s; }
.head-search input:focus { width: 240px; outline: none; border-color: var(--accent);
                           box-shadow: 0 0 0 4px var(--accent-soft); }
.search-btn { display: none; }
@media (max-width: 1140px) { .head-search { display: none; } .search-btn { display: inline-flex; } }
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .nav { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 2px;
         margin: 0; padding: 10px 16px 16px; background: var(--bg);
         border-bottom: 1px solid var(--line); box-shadow: var(--shadow-2); display: none; }
  .nav.open { display: flex; animation: drop .2s var(--ease); }
  .nav a { padding: 11px 14px; border-radius: var(--radius-sm); }
  .header-actions .btn-label { display: none; }
}

/* -- buttons, badges, cards ----------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: .93rem; font-weight: 650; line-height: 1; white-space: nowrap;
  padding: 12px 20px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  background: var(--ink); color: var(--bg);
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 6px 16px rgba(23,23,26,.14);
  transition: transform .15s var(--ease), box-shadow .2s, background .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px);
             background: color-mix(in srgb, var(--ink) 86%, var(--accent));
             box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 12px 26px rgba(23,23,26,.2); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line-2);
             box-shadow: var(--shadow-1); }
.btn.ghost:hover { border-color: var(--ink-3); box-shadow: var(--shadow-2); }
.btn.glass { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.18);
             box-shadow: none; backdrop-filter: blur(6px); }
.btn.glass:hover { background: rgba(255,255,255,.14); }
.btn.small { padding: 8px 14px; font-size: .84rem; }
.btn .arr { transition: transform .2s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px;
            height: 38px; border-radius: 99px; border: 1px solid var(--line-2); flex: none;
            background: var(--card); color: var(--ink-2); cursor: pointer; font-size: 1.05rem; }
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); text-decoration: none; }
.icon-btn svg { width: 18px; height: 18px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700;
         padding: 3px 10px; border-radius: 99px; background: var(--accent-soft);
         color: var(--accent); white-space: nowrap; letter-spacing: .01em; }
.badge.up { background: var(--up-soft); color: var(--up); }
.badge.down { background: var(--down-soft); color: var(--down); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.muted { background: color-mix(in srgb, var(--line) 75%, transparent); color: var(--ink-2); }
.badge.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.dot.live { animation: pulse 1.8s infinite; box-shadow: 0 0 0 0 currentColor; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
        box-shadow: var(--shadow-1); padding: 24px; position: relative; }
.card.hover { transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.card.hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-2);
                    border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.card.glow::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
                     background: var(--grad); opacity: .55; pointer-events: none;
                     -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
                     -webkit-mask-composite: xor; mask-composite: exclude; }

.grid { display: grid; gap: 18px; }
@media (min-width: 720px) {
  .grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* -- sections ------------------------------------------------------------------------------- */

.section { padding: 76px 0; position: relative; }
.section.tight { padding: 36px 0; }
.section.band { background: var(--band); }
.section.band-2 { background: var(--band-2); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
                flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.center-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.center-head .lead { margin: 0 auto; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 800;
           letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--grad); }
.lead { font-size: 1.14rem; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: .9rem; }
.page-head { padding: 56px 0 12px; position: relative; }
.page-head p { color: var(--ink-2); max-width: 64ch; font-size: 1.06rem; }

/* page hero: deep-ink band used at the top of inner pages */
.page-hero { position: relative; overflow: hidden; background: var(--night); color: var(--night-ink);
             padding: 64px 0 56px; isolation: isolate; }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 300px at 12% 0%, rgba(99, 102, 241, .35), transparent 70%),
    radial-gradient(500px 280px at 90% 20%, rgba(6, 182, 212, .22), transparent 70%),
    radial-gradient(400px 260px at 60% 120%, rgba(139, 92, 246, .3), transparent 70%); }
.page-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(var(--night-line) 1px, transparent 1px),
                    linear-gradient(90deg, var(--night-line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
          mask: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%); }
.page-hero h1 { color: #fff; }
.page-hero p, .page-hero .lead { color: var(--night-ink-2); }
.page-hero .eyebrow { color: #a5b4fc; }
.page-hero .faint { color: var(--night-ink-2); }
.page-hero a:not(.btn) { color: #a5b4fc; }
.page-hero .btn.ghost { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.2); box-shadow: none; }
.page-hero .btn.ghost:hover { background: rgba(255,255,255,.12); }
.page-hero .icon-btn { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.2); }

/* -- stats ---------------------------------------------------------------------------------- */

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .num { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em;
             font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .lbl { font-size: .86rem; color: var(--ink-2); }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
             padding: 20px 22px; box-shadow: var(--shadow-1); }
.stat-card .num { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* -- tables --------------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius);
              background: var(--card); box-shadow: var(--shadow-1); }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th { text-align: left; font-weight: 700; color: var(--ink-3); font-size: .74rem;
                text-transform: uppercase; letter-spacing: .08em; background: var(--card-2); }
table.data th, table.data td { padding: 13px 18px; border-bottom: 1px solid var(--line); }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .15s; }
table.data tbody tr:hover { background: var(--accent-soft); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* -- empty / error states ------------------------------------------------------------------- */

.state { text-align: center; padding: 88px 0 100px; }
.state .code { font-size: clamp(4.5rem, 13vw, 8rem); font-weight: 800; letter-spacing: -.05em;
               line-height: 1; background: var(--grad); -webkit-background-clip: text;
               background-clip: text; color: transparent; }
.state p { color: var(--ink-2); max-width: 46ch; margin: 12px auto 24px; }
.state .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* -- footer --------------------------------------------------------------------------------- */

.site-footer { background: var(--band); color: var(--ink-2); font-size: .86rem;
               border-top: 1px solid var(--line); }
.site-footer .base { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between;
                     align-items: center; padding: 22px 16px; }
@media (min-width: 720px) { .site-footer .base { padding: 22px 28px; } }

/* -- motion --------------------------------------------------------------------------------- */

.js .reveal { opacity: 0; transform: translateY(18px);
              transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }
.rise { animation: rise .8s var(--ease) both; }
.rise.d1 { animation-delay: .08s; } .rise.d2 { animation-delay: .16s; }
.rise.d3 { animation-delay: .24s; } .rise.d4 { animation-delay: .32s; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.skeleton { border-radius: 8px; min-height: 14px;
            background: linear-gradient(90deg, var(--line) 0, var(--band) 50%, var(--line) 100%);
            background-size: 800px 100%; animation: shimmer 1.4s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important;
                           scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* -- agent pipeline strip (how it works) ---------------------------------------------------- */

.pipe { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 8px 2px 14px;
        scrollbar-width: thin; }
.pipe-stage { flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px;
              min-width: 108px; padding: 14px 10px; background: var(--card); text-align: center;
              border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-1);
              font-size: .88rem; animation: rise .6s var(--ease) both; position: relative; }
.pipe-stage::after { content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 3px;
                     border-radius: 0 0 3px 3px; background: var(--c, var(--accent)); }
.pipe-stage:nth-child(3) { animation-delay: .08s; } .pipe-stage:nth-child(5) { animation-delay: .16s; }
.pipe-stage:nth-child(7) { animation-delay: .24s; } .pipe-stage:nth-child(9) { animation-delay: .32s; }
.pipe-stage:nth-child(11) { animation-delay: .4s; } .pipe-stage:nth-child(13) { animation-delay: .48s; }
.pipe-stage:nth-child(15) { animation-delay: .56s; }
.pipe-icon { font-size: 1.3rem; line-height: 1; }
.pipe-sub { font-size: .72rem; color: var(--ink-3); }
.pipe-stack { gap: 5px; }
.pipe-stack::after { background: var(--ag-scout); }
.pipe-mini { display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700;
             padding: 3px 9px; border-radius: 8px; background: var(--bg); width: 100%;
             border-left: 3px solid var(--c); }
.pipe-mini .pipe-icon { font-size: .9rem; }
.pipe-you { background: var(--accent-soft); }
.pipe-link { flex: 1 0 22px; min-width: 22px; height: 2px; background: var(--line-2);
             position: relative; overflow: hidden; }
.pipe-link i { position: absolute; top: -2px; left: -8px; width: 6px; height: 6px; border-radius: 50%;
               background: var(--accent); box-shadow: 0 0 8px var(--accent);
               animation: packet 1.6s linear infinite; }
.pipe-link:nth-of-type(4n) i { animation-delay: .4s; }
.pipe-link:nth-of-type(4n+2) i { animation-delay: .8s; }
@keyframes packet { from { left: -8px; } to { left: 100%; } }
.pipe.compact .pipe-stage { min-width: 90px; padding: 10px 8px; }

.mini { display: inline-block; width: 70px; height: 8px; border-radius: 99px; background: var(--down-soft);
        overflow: hidden; vertical-align: 1px; }
.mini span { display: block; height: 100%; background: var(--up); }

/* -- agent control room (home hero, run page, setup progress) ------------------------------- */

.ctrl { background: linear-gradient(180deg, rgba(20, 26, 64, .92), rgba(9, 12, 30, .96));
        border: 1px solid rgba(148, 163, 255, .22); border-radius: 20px; color: var(--night-ink);
        box-shadow: 0 30px 80px rgba(3, 6, 25, .55), inset 0 1px 0 rgba(255,255,255,.06);
        overflow: hidden; position: relative; }
.ctrl-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
            border-bottom: 1px solid var(--night-line); font-size: .8rem; color: var(--night-ink-2); }
.ctrl-bar .lights { display: flex; gap: 6px; }
.ctrl-bar .lights i { width: 10px; height: 10px; border-radius: 50%; background: #2b3157; }
.ctrl-bar .lights i:nth-child(1) { background: #f87171; } .ctrl-bar .lights i:nth-child(2) { background: #fbbf24; }
.ctrl-bar .lights i:nth-child(3) { background: #34d399; }
.ctrl-bar b { color: #fff; font-weight: 700; }
.ctrl-bar .live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: #6ee7b7;
                  font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .68rem; }
.ctrl-bar .live .dot { animation: pulse 1.4s infinite; }
.ctrl-bar button { font: inherit; font-size: .74rem; color: var(--night-ink-2); background: transparent;
                   border: 1px solid var(--night-line); border-radius: 99px; padding: 3px 10px; cursor: pointer; }
.ctrl-bar button:hover { color: #fff; border-color: rgba(255,255,255,.35); }
.ctrl-net { display: block; width: 100%; height: auto; }
.ctrl-net .edge { stroke: rgba(148, 163, 255, .18); stroke-width: 1.5; fill: none; }
.ctrl-net .edge.hot { stroke: url(#edge-grad); stroke-width: 2; }
.ctrl-net .node circle.halo { fill: var(--c); opacity: 0; transform-box: fill-box; transform-origin: center; }
.ctrl-net .node circle.core { fill: #121838; stroke: var(--c); stroke-width: 2; transition: fill .3s; }
.ctrl-net .node text { fill: var(--night-ink-2); font: 600 11px var(--font); text-anchor: middle; transition: fill .3s; }
.ctrl-net .node .emo { font-size: 15px; fill: #fff; }
.ctrl-net .node.on circle.core { fill: color-mix(in srgb, var(--c) 35%, #121838); }
.ctrl-net .node.on circle.halo { animation: halo 1.2s var(--ease) infinite; }
.ctrl-net .node.on text.lbl { fill: #fff; }
.ctrl-net .node.done circle.core { fill: color-mix(in srgb, var(--c) 22%, #121838); }
.ctrl-net .node.fail circle.core { stroke: #f87171; fill: #3a1420; }
.ctrl-net .pkt { fill: #fff; filter: drop-shadow(0 0 6px #a5b4fc); }
@keyframes halo { 0% { opacity: .55; transform: scale(1); } 100% { opacity: 0; transform: scale(2.1); } }
.ctrl-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--night-line);
              border-bottom: 1px solid var(--night-line); }
.ctrl-stats div { padding: 10px 14px; border-right: 1px solid var(--night-line); }
.ctrl-stats div:last-child { border-right: 0; }
.ctrl-stats b { display: block; font-size: 1.25rem; color: #fff; font-variant-numeric: tabular-nums;
                letter-spacing: -.02em; line-height: 1.2; }
.ctrl-stats span { font-size: .7rem; color: var(--night-ink-2); text-transform: uppercase; letter-spacing: .08em; }
.ctrl-log { font: 12.5px/1.55 var(--mono); padding: 12px 16px 14px; height: 168px; overflow: hidden;
            display: flex; flex-direction: column; justify-content: flex-end; gap: 3px;
            -webkit-mask: linear-gradient(transparent, #000 30%); mask: linear-gradient(transparent, #000 30%); }
.ctrl-log .ln { display: grid; grid-template-columns: 52px 1fr; gap: 10px; animation: rise .35s var(--ease) both; color: var(--night-ink-2); }
.ctrl-log .ln .t { color: #5d6594; flex: none; width: 52px; }
.ctrl-log .ln .who { color: var(--c, #a5b4fc); font-weight: 700; }
.ctrl-log .ln .msg { color: #d6daf5; }
.ctrl-log .ln.fail .msg { color: #fca5a5; }
.ctrl-log .ln.info .msg { color: var(--night-ink-2); }
.ctrl-log .caret { display: inline-block; width: 7px; height: 14px; background: #a5b4fc; vertical-align: -2px;
                   animation: pulse 1s steps(2) infinite; }
@media (max-width: 560px) {
  .ctrl-stats { grid-template-columns: repeat(2, 1fr); }
  .ctrl-stats div:nth-child(2) { border-right: 0; }
  .ctrl-stats div:nth-child(-n+2) { border-bottom: 1px solid var(--night-line); }
  .ctrl-log { font-size: 11.5px; height: 150px; }
  .ctrl-log .ln { grid-template-columns: 1fr; }
  .ctrl-log .ln .t { display: none; }
}

/* -- small charts (SVG built by charts.js) -------------------------------------------------- */

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--ink-3); font: 500 11px var(--font); }
.chart .axis { stroke: var(--line-2); }
.chart .grid-line { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .bar { transition: opacity .2s; }
.chart .bar:hover { opacity: .8; }
.chart .val { fill: var(--ink-2); font-weight: 700; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--ink-2); margin-top: 10px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--night); color: #fff;
       font-size: .8rem; padding: 6px 10px; border-radius: 8px; box-shadow: var(--shadow-2);
       opacity: 0; transition: opacity .12s; max-width: 280px; }
.tip.on { opacity: 1; }
figure[data-chart] { margin: 0; }
.chart .grow { transform: scaleX(0); transition: transform 1s var(--ease); }
figure.drawn .chart .grow { transform: scaleX(1); }
.chart .draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s var(--ease); }
figure.drawn .chart .draw { stroke-dashoffset: 0; }
.chart .pop-dot { opacity: 0; transform-box: fill-box; transform-origin: center; }
figure.drawn .chart .pop-dot { animation: dot-in .5s var(--ease) both; }
@keyframes dot-in { from { opacity: 0; transform: scale(0); } to { opacity: .9; transform: scale(1); } }
.chart [data-tip] { cursor: default; }
@media (prefers-reduced-motion: reduce) { .chart .grow { transform: none; } .chart .draw { stroke-dashoffset: 0; } .chart .pop-dot { opacity: .9; } }

/* inner-page heroes: search form and filters on the dark band */
.page-head.page-hero { padding: 56px 0 48px; }
.page-hero .search-form input[type=search] { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(165,180,252,.3);
                                             padding: 14px 20px; font-size: 1.02rem; }
.page-hero .search-form input[type=search]::placeholder { color: var(--night-ink-2); }
.page-hero .search-form input[type=search]:focus { outline: none; border-color: #a5b4fc; box-shadow: 0 0 0 4px rgba(129,140,248,.25); }
.page-hero .scopes a { color: #dfe3ff !important; border-color: rgba(165,180,252,.25); background: rgba(255,255,255,.04); }
.page-hero .scopes a[aria-current] { background: rgba(129,140,248,.25); border-color: #a5b4fc; }
.page-hero code { color: #c7d2fe; }

/* -- phone layout: grid children may shrink, long labels wrap ------------------------------ */
.hero-grid > *, .brief-layout > *, .setup-grid > *, .map-layout > *, .rq-grid > *,
.run-hero-grid > *, .brief-hero-grid > *, .live-grid > *, .run-grid > *, .grid > * { min-width: 0; }
html, body { overflow-x: clip; }
@media (max-width: 480px) {
  .site-header .wrap { gap: 8px; }
  .header-actions { gap: 6px; }
  .brand small { display: none; }
  .icon-btn { width: 36px; height: 36px; }
  .topics-btn { padding: 8px 10px; }
  .btn { white-space: normal; text-align: center; }
  .hero-cta .btn, .cta-actions .btn { flex: 1 1 auto; }
  .section { padding: 52px 0; }
  .card { padding: 18px; }
  .ctrl-bar .sub { display: none; }
}
.ins-grid > *, .papers > li, .brief-main, .brief-side { min-width: 0; }
.paper-title, .paper-summary, .paper-meta, .pick h3, button.choice { overflow-wrap: anywhere; }
.site-footer .contact-link { color: var(--ink-2); font-weight: 600; }
.site-footer .contact-link:hover { color: var(--ink); }

/* -- account menu and guest bar --------------------------------------------------------------- */
.acct { position: relative; }
.acct summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 3px 10px 3px 3px;
                border-radius: 99px; border: 1px solid var(--line-2); background: var(--card); }
.acct summary::-webkit-details-marker { display: none; }
.acct summary:hover { border-color: var(--ink-3); }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 700;
          font-size: .85rem; background: var(--ink); color: var(--bg); }
.avatar.guest { background: var(--band); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.acct-name { font-size: .86rem; font-weight: 650; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1140px) { .acct-name { display: none; } .acct summary { padding: 3px; } }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 250px; padding: 8px; z-index: 40;
             background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2);
             display: grid; gap: 2px; }
.acct-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; gap: 2px; }
.acct-who b { font-size: .9rem; }
.acct-who span { font-size: .78rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.acct-menu a, .acct-menu button { display: block; width: 100%; text-align: left; font: inherit; font-size: .88rem;
             padding: 8px 10px; border-radius: 8px; color: var(--ink); background: none; border: 0; cursor: pointer; }
.acct-menu a:hover, .acct-menu button:hover { background: var(--band); text-decoration: none; }
.acct-menu .acct-cta { color: var(--accent); font-weight: 650; }
.acct-menu form { margin: 0; border-top: 1px solid var(--line); padding-top: 4px; margin-top: 4px; }
.guest-bar { background: var(--accent-soft); color: var(--ink-2); font-size: .86rem; border-bottom: 1px solid var(--line); }
.guest-bar .wrap { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; align-items: center; padding-top: 9px; padding-bottom: 9px; }
.guest-bar a { font-weight: 650; color: var(--accent); }
