/* Shared by / and /live. Page-specific rules live in each page's <style>. */
:root {
  --ground: #262521;   /* wet slate, from the pitch chart */
  --ground-2: #2f2d28;
  --ground-3: #38352f;
  --bone: #e8e6df;     /* logo colour */
  --stone: #a3a097;    /* secondary text, 5.9:1 on ground */
  --rule: #3d3a33;
  --rule-strong: #5a564d;
  --amber: #f0b429;    /* measured data, primary action */
  --amber-hi: #f6c756;
  --ink: #1d1c19;
  --rust: #d0562c;     /* failure, for marks */
  --rust-text: #e0714a;/* failure, for text: 4.8:1 on ground */
  --safe: #6cbf76;
  --watch: #e8c547;
  --warning: #f08a3c;
  --danger: #e0714a;
  --radius: 8px;
  --measure: 66ch;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0; background: var(--ground); color: var(--bone);
  font-family: "Archivo", system-ui, sans-serif; font-variation-settings: "wdth" 100;
  font-size: 1.125rem; line-height: 1.6; font-feature-settings: "tnum" 1;
  overflow-x: hidden;
}
a { color: var(--amber); text-underline-offset: 3px; }
a, button, summary, input[type=range] { cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 3px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 480px) { .wrap { padding: 0 16px; } body { font-size: 1.0625rem; } }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--amber); color: var(--ink); padding: 10px 16px; border-radius: 6px; z-index: 50; font-weight: 700; }
.skip:focus { left: 16px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--ground) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--rule); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: var(--bone); text-decoration: none; font-weight: 800; font-variation-settings: "wdth" 112; font-size: 1.25rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { width: 34px; height: 34px; }
.top nav { display: flex; align-items: center; gap: 6px; }
.top nav .nl { color: var(--stone); text-decoration: none; font-size: 0.95rem; padding: 0 10px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 6px; transition: color .15s; }
.top nav .nl:hover, .top nav .nl[aria-current=page] { color: var(--bone); }
@media (max-width: 900px) { .top nav .nl { display: none; } }
@media (max-width: 520px) { .top nav .hide-sm { display: none; } .brand { font-size: 1.1rem; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: var(--radius); font: inherit; font-weight: 700; font-size: 1rem; text-decoration: none; border: 1.5px solid transparent; transition: background-color .15s, color .15s, border-color .15s, transform .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--amber); color: var(--ink); }
.btn-primary:hover { background: var(--amber-hi); }
.btn-ghost { background: transparent; border-color: var(--rule-strong); color: var(--bone); }
.btn-ghost:hover { border-color: var(--bone); }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 0.95rem; }
.btn[aria-pressed="true"] { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary .pulse { background: var(--ink); animation: none; }

.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--safe); flex: none; animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(108,191,118,.55); } 70% { box-shadow: 0 0 0 9px rgba(108,191,118,0); } 100% { box-shadow: 0 0 0 0 rgba(108,191,118,0); } }

/* type */
h1, h2, h3 { text-wrap: balance; }
h2 { margin: 0 0 18px; font-weight: 800; font-variation-settings: "wdth" 78; font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.02; letter-spacing: -0.016em; max-width: 20ch; }
h3 { margin: 0 0 6px; font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
p { margin: 0 0 16px; max-width: var(--measure); }
.muted { color: var(--stone); }
.intro { color: var(--stone); font-size: 1.2rem; max-width: 56ch; }

section.block { padding: 104px 0; border-top: 1px solid var(--rule); }
@media (max-width: 640px) { section.block { padding: 64px 0; } }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 28px; } }

/* alert tier banner, used by the demo and by live data */
.tier { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 10px; background: var(--ground-3); border-left: 6px solid var(--safe); transition: border-color .3s, background-color .3s; }
.tier svg { width: 34px; height: 34px; flex: none; }
.tier .t-name { font-weight: 850; font-variation-settings: "wdth" 72; font-size: 2rem; line-height: 1; letter-spacing: 0.01em; }
.tier .t-say { color: var(--stone); font-size: 0.95rem; margin: 4px 0 0; }
.tier[data-t=SAFE] { border-color: var(--safe); } .tier[data-t=SAFE] .t-name { color: var(--safe); }
.tier[data-t=WATCH] { border-color: var(--watch); } .tier[data-t=WATCH] .t-name { color: var(--watch); }
.tier[data-t=WARNING] { border-color: var(--warning); } .tier[data-t=WARNING] .t-name { color: var(--warning); }
.tier[data-t=DANGER] { border-color: var(--danger); background: #3a2a22; } .tier[data-t=DANGER] .t-name { color: var(--danger); }
.tier[data-t=OFFLINE] { border-color: var(--rule-strong); } .tier[data-t=OFFLINE] .t-name { color: var(--stone); }

/* footer */
footer { border-top: 1px solid var(--rule); padding: 48px 0 64px; color: var(--stone); font-size: 0.95rem; }
.foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
footer img { width: 110px; height: auto; display: block; margin-bottom: 18px; }
.closing { color: var(--bone); font-weight: 800; font-variation-settings: "wdth" 80; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.1; max-width: 22ch; margin-bottom: 24px; }
.foot-links { display: flex; gap: 0 22px; flex-wrap: wrap; align-content: flex-start; }
.foot-links a { color: var(--stone); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.foot-links a:hover { color: var(--bone); }

/* ---------- glass (ui-ux-pro-max: glassmorphism, dark) ----------
   Frosted panels over soft colour fields. Text sits on >= 60% opaque
   ground so contrast stays above 4.5:1 whatever is behind the blur. */
body { background:
    radial-gradient(40vw 40vw at 88% 8%, rgba(240,180,41,.07), transparent 70%),
    radial-gradient(45vw 45vw at 4% 46%, rgba(90,163,192,.07), transparent 70%),
    radial-gradient(40vw 40vw at 90% 82%, rgba(240,180,41,.06), transparent 70%),
    var(--ground); background-attachment: fixed; }
.glass, .card, .sim, .top {
  background: rgba(47,45,40,.62) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(232,230,223,.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 20px 40px -24px rgba(0,0,0,.6);
}
.top { border-width: 0 0 1px 0; background: rgba(38,37,33,.72) !important; box-shadow: none; }
.sec.alt { background: rgba(47,45,40,.35); }
.card:hover { border-color: rgba(240,180,41,.35); }

/* ---------- live-data bar across the top ---------- */
.topbar { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 6px 16px;
  background: linear-gradient(90deg, rgba(240,180,41,.16), rgba(108,191,118,.14)); border-bottom: 1px solid rgba(232,230,223,.10);
  color: var(--bone); text-decoration: none; font-size: .95rem; text-align: center; }
.topbar b { color: var(--safe); font-weight: 800; letter-spacing: .02em; }
.topbar .tb-cta { font-weight: 700; color: var(--ink); background: var(--amber); padding: 5px 12px; border-radius: 999px; white-space: nowrap; transition: background-color .15s; }
.topbar:hover .tb-cta { background: var(--amber-hi); }
.topbar:focus-visible { outline-offset: -3px; }
@media (max-width: 640px) { .topbar .tb-long { display: none; } }

/* ---------- redesign pass: grain overlay, spotlight borders, nav state ---------- */
body::after { content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); } /* grain overlay */
.spot { position: relative; }
.spot::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(240,180,41,.75), rgba(240,180,41,0) 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.spot:hover::before { opacity: 1; }
.top nav .nl { position: relative; }
.top nav .nl.active { color: var(--bone); }
.top nav .nl.active::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: 8px; height: 2px; border-radius: 2px; background: var(--amber); }

/* ---------- performance on phones and touch devices ----------
   Backdrop blur, a fixed full-screen grain layer with blending, fixed
   backgrounds and endless box-shadow animations each force the phone to
   repaint large areas on every scroll frame. On small or touch screens they
   are swapped for solid equivalents that look almost the same. */
@media (max-width: 900px), (pointer: coarse) {
  .glass, .card, .sim, .top, .explainer, .contact-form, .qa, .hero-chip, .story-copy, .l3, .stat, .n, .empty, .ops, .banner, .m, .u, .auth-card {
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .glass, .card, .sim, .explainer, .contact-form, .qa, .stat, .n, .ops, .m, .u, .auth-card { background: #2c2a25 !important; }
  .top { background: #262521 !important; }
  .hero-chip { background: #2c2a25; }
  body { background-attachment: scroll; }
  body::after { display: none; }
  .pulse { animation: none; box-shadow: 0 0 0 3px rgba(108,191,118,.25); }
  .spot::before { display: none; }
}
