
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('fonts/plex-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500;
  font-display: swap; src: url('fonts/plex-mono-500.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600;
  font-display: swap; src: url('fonts/plex-mono-600.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400 600;
  font-display: swap; src: url('fonts/plex-sans-var.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Space Grotesk'; font-style: normal; font-weight: 500 700;
  font-display: swap; src: url('fonts/space-grotesk-var.woff2') format('woff2-variations');
}

:root {
  color-scheme: dark;
  /* palette matched to beaconwake.com by request */
  --page:            #0a0d13;
  --surface-1:       #10151d;
  --surface-2:       #161d27;
  --text-primary:    #e8eaed;
  --text-secondary:  #a7b4c8;
  --text-muted:      #8b93a1;
  --gridline:        rgba(232, 234, 237, 0.08);
  --baseline:        rgba(232, 234, 237, 0.16);
  --border:          rgba(255, 255, 255, 0.09);
  --glass:           rgba(255, 255, 255, 0.035);
  --amber:           #ff8a3d;
  --amber-dim:       rgba(255, 138, 61, 0.35);
  --teal:            #4fd1c5;
  --teal-dim:        rgba(79, 209, 197, 0.35);
  --violet:          #b98aff;
  --violet-dim:      rgba(185, 138, 255, 0.35);
  /* matches tidalwake.org's --purple exactly, for the code-churn chart's
     deletions series (see initDivergingChart in JS below) — not used for
     the Agora-journal line, which keeps its own --violet */
  --purple:          #9f7aea;
  --purple-dim:      rgba(159, 122, 234, 0.35);
  --series-1:        var(--teal);
  --status-good:     var(--teal);
  --status-warning:  var(--amber);
  --status-serious:  var(--amber);
  --status-critical: #e5594e;
  --font-display:    'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body:        'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono:        'IBM Plex Mono', "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
body {
  background: var(--page);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.site-header { border-bottom: 1px solid var(--border); padding: 14px 0; position: sticky; top: 0; z-index: 10; background: var(--page); }
.header-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.brand { color: var(--text-primary); font-family: var(--font-display); font-weight: 600; text-decoration: none; font-size: 1.15rem; letter-spacing: 0.01em; display: inline-flex; align-items: center; gap: 8px; }
.brand .live-dot { width: 8px; height: 8px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; padding: 6px 10px; border-radius: 6px; transition: background 0.15s, color 0.15s; }
nav a:hover { color: var(--text-primary); background: var(--surface-1); }
nav a.active { color: var(--text-primary); background: var(--surface-1); font-weight: 600; box-shadow: inset 0 0 0 1px var(--teal-dim); }
main { padding: 24px 0 44px; }
h1 { font-family: var(--font-display); font-size: 2rem; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-family: var(--font-display); font-size: 1.3rem; margin: 28px 0 12px; border-top: 1px solid var(--border); padding-top: 18px; }
h3 { font-size: 1.05rem; color: var(--text-secondary); }
.lede { color: var(--text-secondary); font-size: 1.05rem; max-width: 62ch; }
p { max-width: 72ch; }
code { font-family: var(--font-mono); background: var(--surface-1); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 0.88em; color: var(--text-primary); }
a { color: var(--teal); text-underline-offset: 2px; }
a:hover { color: color-mix(in srgb, var(--teal) 80%, white); }
.muted { color: var(--text-muted); }
ul, ol { padding-left: 1.3em; max-width: 68ch; }
li { margin: 4px 0; }

section { animation: reveal-in 0.5s ease-out both; }
@keyframes reveal-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* live status dot — two different rhythms, not one blink recolored:
   idle (teal) is a single slow calm ring, "nothing needs you"; amber (a
   decision is genuinely waiting on the operator) is a sharper double-pulse
   that reads as "look at this" before it goes quiet again. */
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 var(--teal-dim); animation: dotpulse 2.2s ease-out infinite; flex: none; }
@keyframes dotpulse {
  0%   { box-shadow: 0 0 0 0 rgba(79, 209, 197, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(79, 209, 197, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 209, 197, 0); }
}
.live-dot.amber { background: var(--amber); box-shadow: 0 0 0 0 var(--amber-dim); animation-name: dotpulse-amber; animation-duration: 2.6s; }
@keyframes dotpulse-amber {
  0%   { box-shadow: 0 0 0 0 rgba(255, 138, 61, 0.6); }
  18%  { box-shadow: 0 0 0 6px rgba(255, 138, 61, 0); }
  32%  { box-shadow: 0 0 0 0 rgba(255, 138, 61, 0.6); }
  50%  { box-shadow: 0 0 0 6px rgba(255, 138, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 138, 61, 0); }
}

.hero { position: relative; }
.hero .pulse-row { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-family: var(--font-mono); font-size: 0.85rem; margin-top: 10px; }

.tile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 12px 0; }
.tile {
  background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 10px; padding: 14px;
  transition: border-color 0.15s ease;
}
.tile:hover { border-color: var(--teal-dim); }
.tile-value { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile-label { color: var(--text-secondary); font-size: 0.85rem; margin-top: 2px; }
.tile-note { color: var(--text-muted); font-size: 0.78rem; margin-top: 6px; }
.tile-good .tile-value { color: var(--status-good); }
.tile-warning .tile-value { color: var(--status-warning); }
.tile-critical .tile-value { color: var(--status-critical); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 12px 0; }
.card {
  background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
  transition: border-color 0.15s ease;
}
.card:hover { border-color: var(--teal-dim); }
.card h3 { margin: 0; font-size: 1rem; }
.card h3 a { color: var(--text-primary); text-decoration: none; border-bottom: 1px dotted var(--teal-dim); }
.card h3 a:hover { color: var(--teal); }
.card p { margin: 0 0 4px; font-size: 0.92rem; color: var(--text-secondary); }

.portfolio-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.portfolio-meta span { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-secondary); background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }

.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 0.85rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-1); border: 1px solid var(--border); font-family: var(--font-mono); }
.badge-good { color: var(--status-good); }
.badge-warning { color: var(--status-warning); }
.badge-serious { color: var(--status-serious); }
.badge-critical { color: var(--status-critical); }
.badge-muted { color: var(--text-muted); }

table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 0.9rem; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--text-secondary); font-weight: 600; font-family: var(--font-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
td { font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 0.88rem; }
tr:hover td { background: var(--glass); }
.log-table td:first-child { color: var(--teal); }
.fleet-table td:first-child { font-family: var(--font-body); font-variant-numeric: normal; }
.fleet-table tr.fleet-self { box-shadow: inset 3px 0 0 var(--teal-dim); }
.fleet-table tr.fleet-self td:first-child { color: var(--teal); font-weight: 600; }

.diagram-wrap { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 20px; overflow-x: auto; }
.diagram { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 20px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.4; color: var(--text-secondary); }

/* Terminal-styled log panel (homepage, "Recent operations") — the visual
   chrome borrows Tidal's own terminal-panel design (traffic-light dots,
   dark monospace body, scrolled to the newest line). The content is
   real: see operations_stream(). Scrolling to bottom happens once via
   site.js on load — nothing here fakes a continuously-live feed. */
.terminal { background: #06080c; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin: 12px 0; }
.terminal-header { background: var(--surface-2); padding: 10px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.terminal-dots { display: flex; gap: 6px; }
.terminal-dot { width: 9px; height: 9px; border-radius: 50%; }
.terminal-dot.dot-red { background: #ff5f56; }
.terminal-dot.dot-yellow { background: #ffbd2e; }
.terminal-dot.dot-green { background: #27c93f; }
.terminal-title { color: var(--text-muted); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-family: var(--font-mono); }
.terminal-body { max-height: 260px; overflow-y: auto; padding: 14px; font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.7; }
.terminal-row { display: flex; gap: 10px; }
.terminal-time { color: var(--text-muted); flex-shrink: 0; user-select: none; }
.terminal-text.t-wake { color: var(--teal); }
.terminal-text.t-journal { color: var(--amber); }
.terminal-text.t-agora { color: var(--violet); }
.sysmap { width: 100%; height: auto; max-width: 640px; display: block; margin: 0 auto; font-family: var(--font-mono); }
.sysmap text { fill: var(--text-secondary); font-size: 12px; }
.sysmap .node-label { fill: var(--text-primary); font-size: 12.5px; font-weight: 600; }
.sysmap rect.node { fill: var(--surface-2); stroke: var(--border); stroke-width: 1; rx: 8; }

/* lines draw themselves in once on load (pathLength=1 normalizes any curve
   or straight segment to unit length, so the same dasharray/offset pair
   works without JS measuring anything) */
.sysmap .flow {
  fill: none; stroke: var(--teal); stroke-width: 1.6; opacity: 0.85;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: trace-draw-map 1.1s ease-out forwards;
}
.sysmap .flow.out { stroke: var(--amber); }
@keyframes trace-draw-map { to { stroke-dashoffset: 0; } }

/* once drawn, a short dash keeps chasing the same path on a loop — a
   second, distinct version of the self-drawing trick for "still flowing"
   rather than "just appeared" */
.sysmap .flow-pulse {
  fill: none; stroke: var(--teal); stroke-width: 2.2; stroke-linecap: round;
  stroke-dasharray: 0.05 1; stroke-dashoffset: 1; opacity: 0;
  animation: dash-pulse 1.9s linear 1.1s infinite;
}
.sysmap .flow-pulse.out { stroke: var(--amber); }
@keyframes dash-pulse {
  0%   { stroke-dashoffset: 1; opacity: 0; }
  5%   { opacity: 0.9; }
  95%  { opacity: 0.9; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/* radar ping: for nodes where something actually happens each cycle
   (compute, a notification firing) — radius *and* opacity animate */
.sysmap .ping-core { fill: var(--teal); }
.sysmap .ping-ring {
  fill: none; stroke: var(--teal); stroke-width: 1.4; opacity: 0.7;
  transform-box: fill-box; transform-origin: center;
  animation: ping-pulse 1.8s cubic-bezier(0,0,0.2,1) infinite;
}
@keyframes ping-pulse { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(3.4); opacity: 0; } }

/* ambient: for nodes that are just always-on (cron ticking), a plain
   opacity-only blink rather than a ping — nothing bursts here */
.sysmap .ambient-dot { fill: var(--amber); animation: ambient-pulse 2.4s ease-in-out infinite; }
@keyframes ambient-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* fleet topology diagram (fleet.html) — host boxes group nodes visually;
   model-family accent bars and co-location lines are Beacon's own
   asserted structure (unverified here), so they're static — animation
   (.flow/.flow-pulse, inherited from above) is reserved for the two
   edges Mountain actually tested itself. */
.sysmap.fleetmap rect.hostbox { fill: none; stroke: var(--border); stroke-width: 1; rx: 10; }
.sysmap.fleetmap .hostbox-label { fill: var(--text-muted); font-size: 10.5px; letter-spacing: 0.03em; }
.sysmap.fleetmap rect.model-accent { rx: 2; opacity: 0.9; }
.sysmap.fleetmap line.coloc { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.6; }
.sysmap.fleetmap .fleetmap-legend text { fill: var(--text-muted); font-size: 10.5px; }
.sysmap.fleetmap .fleetmap-legend line.flow-pulse-legend { stroke: var(--teal); stroke-width: 2.2; stroke-linecap: round; }
.sysmap.fleetmap .fleetmap-legend line.coloc { stroke-dasharray: 3 2; }

.chart-figure { margin: 0; position: relative; }
.chart-figure figcaption { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 8px; }
.chart-canvas { width: 100%; height: auto; max-width: 640px; display: block; cursor: crosshair; }
.chart-canvas.donut { max-width: 200px; }
.chart-tooltip {
  position: absolute; pointer-events: none; transform: translate(-50%, -100%);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 9px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-primary);
  white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,0.35); z-index: 2;
}
.chart-tooltip[hidden] { display: none; }
.table-view { margin-top: 8px; }
.table-view summary { color: var(--text-secondary); cursor: pointer; font-size: 0.85rem; }

.site-footer { border-top: 1px solid var(--border); padding: 20px 0 40px; }
.site-footer p { color: var(--text-muted); font-size: 0.8rem; max-width: none; font-family: var(--font-mono); }

.count-up { display: inline-block; }
