/* PHNIX Validator — status page. Brand tokens from phnix.io; status colours are a
   fixed scale (never the brand orange/red), always paired with an icon and a label. */

@font-face { font-family: "Bebas Neue"; src: url("fonts/bebas-neue-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  /* brand (phnix.io) */
  --bg: #050505;
  --surface: #10100f;
  --surface-2: #151210;
  --orange: #ff5a1f;
  --red: #ff2d00;
  --gold: #ffb347;
  --ink: #fff8ed;
  --ink-2: #aaa6a2;
  --ink-warm: #edc49e;
  --line: rgba(255, 255, 255, .10);
  --fire-line: rgba(255, 111, 36, .24);
  /* status (fixed scale, ≥ 4.3:1 on --surface) */
  --good: #0aac23;
  --warning: #fbb315;
  --critical: #dc3c3d;
  --none: #46403a;
  --body: "Inter", Arial, sans-serif;
  --display: "Bebas Neue", Impact, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 55% at 50% -8%, rgba(213, 100, 21, .20), transparent 62%),
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(255, 90, 31, .07), transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--ink); text-decoration-color: var(--fire-line); text-underline-offset: 3px; }
a:hover { color: var(--gold); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--orange); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 12px; }
.muted { color: var(--ink-2); }
.na { color: var(--ink-2); }
[hidden] { display: none !important; }

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* ---------------------------------------------------------------- header */
.top { border-bottom: 1px solid var(--line); background: rgba(5, 5, 5, .72); backdrop-filter: blur(10px); position: relative; z-index: 2; }
.top__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: baseline; gap: 12px; text-decoration: none; }
.brand__mark { font: 400 34px/1 var(--display); letter-spacing: .02em; color: var(--orange); }
.brand__sub { font: 600 12px/1 var(--body); letter-spacing: .26em; text-transform: uppercase; color: var(--ink-warm); }
.toplink { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.toplink:hover { color: var(--ink); }
.ico-ext { width: 12px; height: 12px; margin-left: 4px; vertical-align: -1px; }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; z-index: 1; padding: clamp(56px, 10vw, 112px) 0 32px; text-align: center; }
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 0 0 22px;
  font: 600 12px/1 var(--body); letter-spacing: .28em; text-transform: uppercase; color: var(--ink-warm); }
.eyebrow::before, .eyebrow::after { content: ""; width: 42px; height: 1px; background: linear-gradient(90deg, transparent, var(--fire-line)); }
.eyebrow::after { transform: scaleX(-1); }
h1 {
  margin: 0 auto;
  font: 400 clamp(46px, 10vw, 112px)/.92 var(--display);
  letter-spacing: .01em;
  background: linear-gradient(180deg, #fff9d4 0%, #ffcf52 42%, #ff761b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-wrap: balance;
}
.h1__line { display: block; }
.lede { margin: 22px auto 0; max-width: 40ch; text-wrap: balance; font-size: clamp(17px, 2vw, 20px); color: var(--ink-warm); }

/* ---------------------------------------------------------------- cards & status */
.card {
  position: relative;
  background: linear-gradient(140deg, #15110f, #0b0b0a);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .9);
}
.status { margin: 44px auto 0; max-width: 680px; padding: 26px 28px; text-align: center; }
.status::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, var(--fire-line), transparent 55%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; padding: 1px;
}
.status__pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .03);
  font-weight: 600; font-size: 17px; }
.status__icon { width: 20px; height: 20px; flex: none; color: var(--ink-2); }
.status__pill[data-tone="good"] .status__icon { color: var(--good); }
.status__pill[data-tone="warning"] .status__icon { color: var(--warning); }
.status__pill[data-tone="critical"] .status__icon { color: var(--critical); }
.status__reason { margin: 14px auto 0; max-width: 52ch; color: var(--ink); }
.status__meta { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.status__meta:empty { display: none; }

/* ---------------------------------------------------------------- sections */
section.wrap { position: relative; z-index: 1; }
.section-title { margin: 64px 0 18px; font: 600 13px/1 var(--body); letter-spacing: .22em; text-transform: uppercase; color: var(--ink-warm); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tile { padding: 20px 22px 18px; background: linear-gradient(140deg, #141110, #0c0b0a); border: 1px solid var(--line); border-radius: var(--radius); }
.tile__label { margin: 0; font: 600 13px/1.3 var(--body); color: var(--ink-2); }
.tile__value { margin: 10px 0 4px; font: 600 clamp(26px, 3.2vw, 34px)/1.1 var(--body); letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere; }
.tile__unit { font-size: .6em; font-weight: 600; color: var(--ink-2); margin-left: 2px; }
.tile__note { margin: 0; font-size: 13px; color: var(--ink-2); }

/* ---------------------------------------------------------------- history strips */
.history__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.history__head .section-title { margin-bottom: 18px; }
.range { display: inline-flex; margin-bottom: 12px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.range__btn { font: 600 13px/1 var(--body); color: var(--ink-2); background: none; border: 0; padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.range__btn[aria-pressed="true"] { background: rgba(255, 255, 255, .08); color: var(--ink); }
.history { padding: 24px 26px 18px; transition: opacity .2s; }
.is-loading .history, .is-loading .tiles { opacity: .55; }
.strip { margin: 0 0 22px; }
.strip figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 10px; }
.strip__title { font-weight: 600; }
.strip__sub { font-size: 13px; color: var(--ink-2); }
.strip__cells { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; height: 34px; border-radius: 4px; }
.strip__cells:focus-visible { outline-offset: 5px; }
.cell { border-radius: 2px; background: var(--none); }
.cell[data-tone="good"] { background: var(--good); }
.cell[data-tone="warning"] { background: var(--warning); }
.cell[data-tone="critical"] { background: var(--critical); }
.cell.is-active { outline: 2px solid var(--ink); outline-offset: 1px; }
.strip__axis { display: flex; justify-content: space-between; margin-top: -12px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.history__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.key { width: 10px; height: 10px; border-radius: 2px; background: var(--none); }
.key[data-tone="good"] { background: var(--good); }
.key[data-tone="warning"] { background: var(--warning); }
.key[data-tone="critical"] { background: var(--critical); }
.linkbtn { font: 600 13px/1 var(--body); color: var(--ink); background: none; border: 0; padding: 6px 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--fire-line); text-underline-offset: 3px; }
.linkbtn:hover { color: var(--gold); }
.tablewrap { margin-top: 16px; max-height: 420px; overflow: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding: 12px 0 8px; color: var(--ink-2); font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; background: #12100e; font-weight: 600; color: var(--ink-2); font-size: 13px; }

.tooltip { position: fixed; z-index: 20; pointer-events: none; display: grid; gap: 2px; min-width: 150px; padding: 10px 12px;
  background: rgba(16, 13, 11, .96); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 30px -12px #000; font-size: 13px; }
.tooltip__value { font-size: 16px; color: var(--ink); }
.tooltip__label, .tooltip__detail { color: var(--ink-2); }
.tooltip__detail:empty { display: none; }

/* ---------------------------------------------------------------- identity */
.facts { margin: 0; padding: 6px 26px; }
.fact { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact dt { color: var(--ink-2); font-size: 14px; padding-top: 2px; }
.fact dd { margin: 0; overflow-wrap: anywhere; }
.fact__key { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fact__key code { font: 500 14px/1.5 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.fact__hint { display: block; margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.fact__hint:empty { display: none; }
.iconbtn { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--body); color: var(--ink-2); background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.iconbtn svg { width: 14px; height: 14px; }
.iconbtn:hover { color: var(--ink); border-color: var(--fire-line); }
.badge { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 3px 10px; font-size: 12px; font-weight: 600;
  border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--none); }
.badge[data-tone="good"] { color: var(--ink); }
.badge[data-tone="good"]::before { background: var(--good); }
.badge[data-tone="warning"]::before { background: var(--warning); }
.unl { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.unl li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.unl .unl__name { font-weight: 600; min-width: 128px; }
.unl .unl__detail { font-size: 13px; color: var(--ink-2); }
.unl .badge { margin-left: 0; }

/* ---------------------------------------------------------------- method & footer */
.method__list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.method__list li { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-2); font-size: 14px; background: rgba(255, 255, 255, .015); }
.method__list strong { display: block; margin-bottom: 6px; color: var(--ink); font-weight: 600; font-size: 15px; }
.foot { margin-top: 72px; border-top: 1px solid var(--line); position: relative; z-index: 1; }
.foot__inner { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; padding: 26px 0 34px; font-size: 14px; color: var(--ink-2); }
.foot nav { display: flex; gap: 22px; }
.foot a { color: var(--ink-2); }
.foot a:hover { color: var(--ink); }
.firebtn { font: 600 12px/1 var(--body); color: var(--ink-2); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.firebtn:hover { color: var(--ink); border-color: var(--fire-line); }

/* ---------------------------------------------------------------- embers (decorative, pausable) */
.embers { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.embers i { position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%; background: #ffb066;
  box-shadow: 0 0 8px 2px rgba(255, 122, 40, .55); opacity: 0; animation: rise 14s linear infinite; }
.embers i:nth-child(1) { left: 6%; animation-delay: 0s; }
.embers i:nth-child(2) { left: 14%; animation-delay: 6s; animation-duration: 17s; }
.embers i:nth-child(3) { left: 22%; animation-delay: 2s; animation-duration: 12s; }
.embers i:nth-child(4) { left: 31%; animation-delay: 9s; }
.embers i:nth-child(5) { left: 39%; animation-delay: 4s; animation-duration: 19s; }
.embers i:nth-child(6) { left: 47%; animation-delay: 11s; animation-duration: 15s; }
.embers i:nth-child(7) { left: 56%; animation-delay: 1s; animation-duration: 16s; }
.embers i:nth-child(8) { left: 63%; animation-delay: 7s; animation-duration: 13s; }
.embers i:nth-child(9) { left: 71%; animation-delay: 3s; animation-duration: 18s; }
.embers i:nth-child(10) { left: 78%; animation-delay: 10s; }
.embers i:nth-child(11) { left: 85%; animation-delay: 5s; animation-duration: 15s; }
.embers i:nth-child(12) { left: 92%; animation-delay: 8s; animation-duration: 12s; }
.embers i:nth-child(13) { left: 52%; animation-delay: 13s; animation-duration: 20s; }
.embers i:nth-child(14) { left: 18%; animation-delay: 12s; animation-duration: 16s; }
@keyframes rise {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0; }
  10% { opacity: .9; }
  70% { opacity: .5; }
  100% { transform: translate3d(28px, -92vh, 0) scale(.4); opacity: 0; }
}
.fire-paused .embers, .fire-paused .embers i { animation: none; display: none; }
@media (prefers-reduced-motion: reduce) {
  .embers { display: none; }
  .firebtn { display: none; }
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method__list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { width: min(1120px, 100% - 28px); }
  .brand__mark { font-size: 30px; }
  .status { padding: 22px 18px; }
  .tiles { gap: 10px; }
  .tile { padding: 16px; }
  .history { padding: 18px 16px 14px; }
  .strip__cells { gap: 1px; height: 30px; }
  .fact { grid-template-columns: 1fr; gap: 4px; }
  .facts { padding: 4px 18px; }
  .tile__value { font-size: 23px; white-space: nowrap; }
  .eyebrow { gap: 10px; letter-spacing: .18em; font-size: 11px; }
  .eyebrow::before, .eyebrow::after { width: 18px; }
}
@media (forced-colors: active) {
  .cell, .key { forced-color-adjust: none; border: 1px solid CanvasText; }
}

/* local preview only (scripts/preview.mjs): marks synthetic data, never served in production */
.preview-banner { position: sticky; top: 0; z-index: 30; padding: 8px 16px; text-align: center; font: 700 13px/1.4 var(--body);
  color: #050505; background: repeating-linear-gradient(135deg, #ffb347 0 14px, #ffc56e 14px 28px); }
