/* ==========================================================================
   HowlTicket — status.howlticket.com
   Night-forest design system, matching the marketing site: deep night navy,
   ember orange, moon gold, vintage cream. The chrome (nav, page header on the
   pine band, eyebrows, cards, footer) mirrors the marketing site's site.css;
   unlike that site, this page also supports a light theme, so every chrome
   colour below is a token with a light-mode value.

   CHART COLOUR NOTE — these values were produced by the dataviz validator
   (OKLCH lightness band, chroma floor, CVD separation, contrast vs surface),
   not chosen by eye. Two deliberate trade-offs are recorded here so nobody
   "corrects" them later:

   1. Dark-mode --st-degraded (#dba02b) sits slightly above the dark lightness
      band (L 0.744 vs a 0.67 ceiling). Darkening it into the band collapses
      its deuteranopia separation from --st-outage to ΔE ~5, which is the
      classic amber/red confusion. Separation was chosen over band conformance:
      the band is a harmony guideline, CVD separation is an accessibility one.
      As published, the worst all-pairs separation is ΔE 12.0 (deutan), above
      the ΔE 8 target.

   2. Light-mode --st-degraded (#cc9a0e) carries a sub-3:1 contrast warning
      against paper. That warning is dischargeable only with visible labels or
      a table view, and this page ships BOTH, plus hatched textures and
      per-bar tooltips. Status is never encoded by colour alone here.
   ========================================================================== */

:root {
    /* brand palette (shared with the marketing site) */
    --night-950: #0a0f1e;
    --night-900: #0d1424;
    --night-800: #121c33;
    --surface: #152039;
    --surface-2: #1b2a4b;
    --line: rgba(243, 234, 214, 0.12);
    --ember: #e8762e;
    --ember-bright: #f68d45;
    --ember-deep: #c75f1d;
    --moon: #f3c969;
    --cream: #f3ead6;
    --text: #e9edf6;
    --muted: #a7b2c9;

    /* chrome roles — each has a light-mode value below (contrast ratios are
       listed in README.md, "Design") */
    --link: var(--ember-bright);
    --link-hover: var(--moon);
    --eyebrow: var(--moon);
    --brand-ink: #ffffff;
    --brand-accent: var(--ember);
    --focus: var(--moon);
    --nav-bg: rgba(10, 15, 30, 0.82);
    --control-line: rgba(243, 234, 214, 0.45);
    --tint: rgba(243, 234, 214, 0.07);
    --hero-veil:
        linear-gradient(180deg, rgba(10, 15, 30, 0.92), rgba(13, 20, 36, 0.97));
    --fog-a: rgba(243, 234, 214, 0.17);
    --fog-b: rgba(243, 234, 214, 0.12);
    --fog-c: rgba(167, 178, 201, 0.12);

    /* chart surface — the colour the validator was run against */
    --chart-surface: #0d1424;

    /* status palette (validated, dark mode) */
    --st-good: #1fa5a0;
    --st-degraded: #dba02b;
    --st-outage: #e2504a;
    --st-unknown: #3b465e;

    /* categorical series (validated, dark mode) */
    --series-p50: #3a9fd6;
    --series-p95: #dd6f24;

    --radius: 14px;
    --radius-lg: 22px;
    --shadow: 0 10px 40px rgba(5, 8, 18, 0.45);
    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --night-950: #ece3d1;
        --night-900: #f6efe0;
        --night-800: #efe6d4;
        --surface: #fffaf0;
        --surface-2: #f3ead6;
        --line: rgba(34, 28, 18, 0.14);
        --cream: #221c12;
        --text: #221c12;
        --muted: #5c5444;

        /* chrome roles (light): the marketing site's ember and moon are too
           pale for text on paper, so links, eyebrows and the wordmark accent
           take darker siblings of the same hues */
        --link: #9c4710;
        --link-hover: #221c12;
        --eyebrow: #7d5600;
        --brand-ink: #221c12;
        --brand-accent: #b4531a;
        --focus: #9c4710;
        --nav-bg: rgba(236, 227, 209, 0.88);
        --control-line: rgba(34, 28, 18, 0.55);
        --tint: rgba(34, 28, 18, 0.07);
        --hero-veil:
            linear-gradient(180deg, rgba(246, 239, 224, 0.9), rgba(246, 239, 224, 0.96));
        --fog-a: rgba(255, 255, 255, 0.35);
        --fog-b: rgba(255, 255, 255, 0.28);
        --fog-c: rgba(255, 255, 255, 0.22);

        --chart-surface: #f6efe0;

        /* status palette (validated, light mode) */
        --st-good: #0b7f5e;
        --st-degraded: #cc9a0e;
        --st-outage: #a32b22;
        --st-unknown: #bcb2a0;

        /* categorical series (validated, light mode) */
        --series-p50: #1f6f9e;
        --series-p95: #a84d12;

        --shadow: 0 10px 30px rgba(90, 76, 50, 0.16);
    }
}

/* The explicit data-theme="light" override mirrors the media query, so the
   light theme can be forced (README: "To force either theme"). */
:root[data-theme="light"] {
    --night-950: #ece3d1;
    --night-900: #f6efe0;
    --night-800: #efe6d4;
    --surface: #fffaf0;
    --surface-2: #f3ead6;
    --line: rgba(34, 28, 18, 0.14);
    --cream: #221c12;
    --text: #221c12;
    --muted: #5c5444;

    --link: #9c4710;
    --link-hover: #221c12;
    --eyebrow: #7d5600;
    --brand-ink: #221c12;
    --brand-accent: #b4531a;
    --focus: #9c4710;
    --nav-bg: rgba(236, 227, 209, 0.88);
    --control-line: rgba(34, 28, 18, 0.55);
    --tint: rgba(34, 28, 18, 0.07);
    --hero-veil:
        linear-gradient(180deg, rgba(246, 239, 224, 0.9), rgba(246, 239, 224, 0.96));
    --fog-a: rgba(255, 255, 255, 0.35);
    --fog-b: rgba(255, 255, 255, 0.28);
    --fog-c: rgba(255, 255, 255, 0.22);

    --chart-surface: #f6efe0;

    --st-good: #0b7f5e;
    --st-degraded: #cc9a0e;
    --st-outage: #a32b22;
    --st-unknown: #bcb2a0;

    --series-p50: #1f6f9e;
    --series-p95: #a84d12;

    --shadow: 0 10px 30px rgba(90, 76, 50, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    margin: 0;
    background: var(--night-900);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

img { max-width: 100%; }

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.12;
    margin: 0 0 0.6em;
    color: var(--cream);
    letter-spacing: -0.01em;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.container { width: min(1160px, 100% - 3rem); margin-inline: auto; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Literal colours on purpose: the skip link is moon-on-night in both themes,
   so it cannot pick up a light-mode token and lose its contrast. */
.skip-link {
    position: absolute;
    left: 1rem;
    top: 0.75rem;
    z-index: 100;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    background: #f3c969;
    color: #0a0f1e;
    font-weight: 700;
    transform: translateY(-200%);
    transition: transform 0.15s ease;
}

.skip-link:focus { transform: none; color: #0a0f1e; outline: 2px solid var(--focus); outline-offset: 2px; }

.eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--eyebrow);
    margin-bottom: 0.9rem;
}

/* ---------- header (mirrors the marketing site's .nav) ---------- */

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

/* full-bleed bar: brand pinned to the far left of the viewport, links to the far right */
.nav-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.75rem 1.4rem;
}

.nav-left { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 1.18rem;
    color: var(--brand-ink);
    letter-spacing: 0.02em;
}

.nav-brand img { width: 30px; height: 36px; }
.nav-brand .brand-text { white-space: nowrap; }
.nav-brand .accent { color: var(--brand-accent); }
.nav-brand:hover { color: var(--brand-ink); }

/* demo badge: a small tag hanging off the wordmark. The ::before extends the
   tap target to ~42px tall without making the pill itself look heavier. Its
   ink and gradient are literal: the pill is self-contained in both themes. */
.nav-demo-badge {
    position: relative;
    display: inline-block;
    background: linear-gradient(160deg, var(--ember-bright), var(--ember-deep));
    color: #1c0f04;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    box-shadow: 0 3px 12px rgba(232, 118, 46, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-demo-badge::before {
    content: "";
    position: absolute;
    inset: -10px -4px;
}

.nav-demo-badge:hover {
    color: #1c0f04;
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(232, 118, 46, 0.5);
}

/* desktop: links + CTAs share one row, pushed right */
.nav-menu {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 1rem;
    min-width: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0 0 0 auto;
    list-style: none;
    padding: 0;
}

.nav-links a {
    display: block;
    color: var(--muted);
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.97rem;
}

.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--cream); }
.nav-links a[aria-current="page"] { background: var(--tint); }

.nav-cta { display: flex; align-items: center; margin-left: 0.75rem; }

/* single outlined login button, sized to sit flush with the text links */
.nav-login {
    display: inline-block;
    border: 1px solid var(--control-line);
    border-radius: 8px;
    padding: 0.45rem 1.15rem;
    color: var(--cream);
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.nav-login:hover { background: var(--tint); border-color: var(--cream); color: var(--cream); }

.nav-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: 1px solid var(--control-line);
    border-radius: 8px;
    color: var(--cream);
    font-size: 1.3rem;
    line-height: 1.4;
    padding: 0.2rem 0.7rem;
    cursor: pointer;
}

@media (max-width: 900px) {
    .nav-toggle { display: block; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: var(--night-950);
        border-bottom: 1px solid var(--line);
        padding: 1rem 1.5rem 1.5rem;
    }
    .nav-menu.open { display: block; }
    .nav-links { flex-direction: column; align-items: stretch; margin: 0 0 1rem; }
    .nav-cta { flex-direction: column; align-items: stretch; margin-left: 0; }
}

/* ---------- hero: page header on the pine band ---------- */

.page-head {
    position: relative;
    overflow: hidden;
    padding: 4rem 0 3rem;
    background: var(--hero-veil), url("../images/pine_band.webp") center 30% / cover no-repeat;
    border-bottom: 1px solid var(--line);
}

.page-head > .container { position: relative; z-index: 1; }

/* Fog: the marketing site's layer, held still. A status page stays calm, so
   there is no drift animation and no wolf eyes — just the texture. */
.page-head::after {
    content: "";
    position: absolute;
    inset: -25% -30%;
    background:
        radial-gradient(48% 34% at 16% 70%, var(--fog-a), transparent 68%),
        radial-gradient(42% 30% at 80% 28%, var(--fog-b), transparent 68%),
        radial-gradient(30% 22% at 48% 90%, var(--fog-c), transparent 70%);
    filter: blur(18px);
    pointer-events: none;
}

.page-head .eyebrow { display: block; text-align: center; }

.banner { text-align: center; }

.banner h1 {
    font-size: clamp(2rem, 4vw, 3.1rem);
    margin: 0 0 0.5rem;
    overflow-wrap: anywhere;
}

.banner-meta { color: var(--muted); font-size: 1.05rem; margin: 0 auto; max-width: 40rem; }

/* Overall-status pill: dot + glyph + label + colour. Glyph and label are
   generated from #banner[data-state] so the script that sets the state also
   sets the pill, with no second DOM hook to keep in sync. The label text stays
   in --cream for contrast; the state colour rides on the dot, glyph and rim. */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.1rem;
    padding: 0.35rem 0.95rem 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    color: var(--cream);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.banner-dot {
    width: 12px; height: 12px; border-radius: 50%; flex: none;
    background: var(--st-unknown);
    color: var(--st-unknown);
    position: relative;
}

.banner-dot::after {
    content: "";
    position: absolute; inset: -5px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.35;
}

.pill-glyph { line-height: 1; }
.pill-glyph::before { content: "○"; }
.pill-label::before { content: "No data"; }

.banner[data-state="operational"] .status-pill { border-color: color-mix(in srgb, var(--st-good) 55%, transparent); }
.banner[data-state="degraded"]    .status-pill { border-color: color-mix(in srgb, var(--st-degraded) 55%, transparent); }
.banner[data-state="outage"]      .status-pill { border-color: color-mix(in srgb, var(--st-outage) 55%, transparent); }

.banner[data-state="operational"] .banner-dot { background: var(--st-good); color: var(--st-good); }
.banner[data-state="degraded"]    .banner-dot { background: var(--st-degraded); color: var(--st-degraded); }
.banner[data-state="outage"]      .banner-dot { background: var(--st-outage); color: var(--st-outage); }
.banner[data-state="unknown"]     .banner-dot { background: var(--st-unknown); color: var(--st-unknown); }

.banner[data-state="operational"] .pill-glyph { color: var(--st-good); }
.banner[data-state="degraded"]    .pill-glyph { color: var(--st-degraded); }
.banner[data-state="outage"]      .pill-glyph { color: var(--st-outage); }
.banner[data-state="unknown"]     .pill-glyph { color: var(--muted); }

.banner[data-state="operational"] .pill-glyph::before { content: "●"; }
.banner[data-state="degraded"]    .pill-glyph::before { content: "▲"; }
.banner[data-state="outage"]      .pill-glyph::before { content: "✕"; }

.banner[data-state="operational"] .pill-label::before { content: "Operational"; }
.banner[data-state="degraded"]    .pill-label::before { content: "Degraded"; }
.banner[data-state="outage"]      .pill-label::before { content: "Outage"; }

@media (prefers-reduced-motion: no-preference) {
    .banner[data-state="outage"] .banner-dot::after,
    .banner[data-state="degraded"] .banner-dot::after {
        animation: pulse 2.4s ease-out infinite;
    }
}

@keyframes pulse {
    0%   { transform: scale(0.8); opacity: 0.5; }
    70%  { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ---------- staleness / offline notice ---------- */

.notice {
    display: none;
    max-width: 46rem;
    margin: 1.6rem auto 0;
    padding: 1rem 1.2rem;
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--st-degraded) 50%, transparent);
    background: color-mix(in srgb, var(--st-degraded) 12%, var(--surface));
    font-size: 0.95rem;
    text-align: left;
}

.notice.is-visible { display: block; }
.notice.is-severe {
    border-color: color-mix(in srgb, var(--st-outage) 55%, transparent);
    background: color-mix(in srgb, var(--st-outage) 14%, var(--surface));
}

.notice strong { color: var(--cream); }

/* ---------- cards (the marketing site's .card surface) ---------- */

.card,
.tile,
.component,
.incident {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* ---------- stat tiles ---------- */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin: 2.2rem 0 0;
}

.tile { padding: 1.1rem 1.3rem; }

.tile-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--muted);
    margin: 0 0 0.35rem;
}

.tile-value {
    font-family: var(--font-display);
    font-size: 1.9rem;
    line-height: 1;
    color: var(--cream);
    margin: 0;
}

.tile-value .unit { font-size: 0.95rem; color: var(--muted); margin-left: 0.15em; }

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

.section { padding: 4rem 0; }

.section-head { max-width: 46rem; margin-bottom: 1.6rem; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 0 0 0.35rem; }
.section-head p { color: var(--muted); font-size: 1.02rem; margin: 0; }
.section-head .eyebrow { margin-bottom: 0.6rem; }

.legend-states { margin: 0 0 1.2rem; }

/* ---------- component rows ---------- */

.components { display: grid; gap: 1rem; }

.component { padding: 1.35rem 1.5rem; min-width: 0; }

.component-head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

.component-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--cream);
    margin: 0;
    flex: 1;
    min-width: 8rem;
}

.component-latency {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--muted);
    white-space: nowrap;
}

/* Status badge: glyph + text + colour, never colour alone. The label stays in
   --cream so it meets 4.5:1 in both themes (light-mode amber and dark-mode red
   do not, as text); the state colour rides on the glyph and the rim. */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.22rem 0.7rem 0.22rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cream);
    border: 1px solid var(--muted);
    white-space: nowrap;
}

.badge .glyph { font-size: 0.9em; line-height: 1; color: var(--muted); }
.badge[data-state="operational"] { border-color: var(--st-good); }
.badge[data-state="degraded"]    { border-color: var(--st-degraded); }
.badge[data-state="outage"]      { border-color: var(--st-outage); }
.badge[data-state="operational"] .glyph { color: var(--st-good); }
.badge[data-state="degraded"]    .glyph { color: var(--st-degraded); }
.badge[data-state="outage"]      .glyph { color: var(--st-outage); }

/* ---------- uptime strip ---------- */

.strip {
    display: flex;
    gap: 2px;              /* the 2px surface gap between adjacent marks */
    align-items: flex-end;
    height: 38px;
    margin-bottom: 0.5rem;
}

.strip-bar {
    flex: 1 1 0;
    min-width: 2px;
    height: 100%;
    border-radius: 2px;    /* rounded data-ends */
    background: var(--st-unknown);
    position: relative;
    cursor: default;
}

.strip-bar[data-state="operational"] { background: var(--st-good); }

/* Secondary encoding is HEIGHT, not just texture.
   Amber and red cannot be fully separated under deuteranopia, so state must
   survive without colour. At ~8px per bar a 3px hatch is visual mud, but a
   silhouette difference reads instantly even in grayscale — so each state gets
   a distinct height, and the hatch is reserved for outage, where a full-height
   bar gives it room to register. The four states read as: tall solid, short
   solid, tall striped, short faded. */
.strip-bar[data-state="degraded"] {
    height: 68%;
    background: var(--st-degraded);
}

.strip-bar[data-state="outage"] {
    background:
        repeating-linear-gradient(135deg,
            var(--st-outage) 0 3px,
            color-mix(in srgb, var(--st-outage) 55%, #ffffff) 3px 6px);
}

.strip-bar[data-state="unknown"] {
    height: 40%;
    background: var(--st-unknown);
    opacity: 0.55;
}

.strip-bar:hover { outline: 2px solid var(--cream); outline-offset: 1px; }

.strip-scale {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.74rem;
    color: var(--muted);
}

/* ---------- legend ---------- */

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }

.legend-swatch {
    width: 14px; height: 14px; border-radius: 3px; flex: none;
    background: var(--st-unknown);
}

.legend-swatch[data-state="operational"] { background: var(--st-good); }

/* Swatches mirror the strip's silhouettes so the legend teaches the encoding
   it is explaining: degraded is short, outage is striped. */
.legend-swatch[data-state="degraded"] {
    background: var(--st-degraded);
    height: 10px;
    align-self: flex-end;
    margin-bottom: 2px;
}
.legend-swatch[data-state="outage"] {
    background: repeating-linear-gradient(135deg,
        var(--st-outage) 0 3px,
        color-mix(in srgb, var(--st-outage) 55%, #ffffff) 3px 6px);
}
.legend-swatch[data-state="unknown"] {
    height: 7px;
    align-self: flex-end;
    margin-bottom: 3px;
    opacity: 0.55;
}
.legend-swatch[data-series="p50"] { background: var(--series-p50); }
.legend-swatch[data-series="p95"] { background: var(--series-p95); }

/* ---------- latency chart ---------- */

.chart-card { padding: 1.5rem; }

.chart-wrap { position: relative; }

.chart { display: block; width: 100%; height: auto; overflow: visible; }

.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.chart .series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-line[data-series="p50"] { stroke: var(--series-p50); }
.chart .series-line[data-series="p95"] { stroke: var(--series-p95); }
.chart .series-area[data-series="p95"] { fill: var(--series-p95); opacity: 0.1; }
/* No opacity rule here on purpose: a CSS declaration beats an SVG presentation
   attribute, so styling opacity here would override the attribute the script
   uses to hide the crosshair, leaving it stuck visible at x=0 on load. */
.chart .crosshair { stroke: var(--cream); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .marker { stroke: var(--chart-surface); stroke-width: 2; }  /* 2px surface ring */
.chart .marker[data-series="p50"] { fill: var(--series-p50); }
.chart .marker[data-series="p95"] { fill: var(--series-p95); }

.chart-tooltip {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease;
    background: var(--night-950);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: nowrap;
    box-shadow: var(--shadow);
    z-index: 5;
}

.chart-tooltip.is-visible { opacity: 1; }
.chart-tooltip .tt-time { color: var(--muted); font-size: 0.76rem; display: block; margin-bottom: 0.2rem; }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: 0.4rem; }
.chart-tooltip .tt-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chart-tooltip .tt-dot[data-series="p50"] { background: var(--series-p50); }
.chart-tooltip .tt-dot[data-series="p95"] { background: var(--series-p95); }
.chart-tooltip .tt-value { font-family: var(--font-mono); color: var(--cream); margin-left: auto; }

.chart-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* ---------- table view (the accessibility fallback) ---------- */

.table-toggle {
    background: none;
    border: 1px solid var(--control-line);
    color: var(--cream);
    border-radius: 999px;
    padding: 0.35rem 0.95rem;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.table-toggle:hover { background: var(--tint); border-color: var(--cream); }

.data-table { display: none; margin-top: 1.1rem; max-height: 320px; overflow: auto; }
.data-table.is-visible { display: block; }

.data-table table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th, .data-table td {
    text-align: left;
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid var(--line);
}
.data-table th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--surface); }
.data-table td { font-family: var(--font-mono); color: var(--text); }

/* ---------- incidents ---------- */

.incidents { display: grid; gap: 1rem; }

.incident {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 0.4rem 1rem;
    padding: 1.2rem 1.4rem;
}

.incident-badge { margin-top: 0.15rem; }
.incident-body p { margin: 0; }
.incident-summary { color: var(--text); }
.incident-meta { color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem !important; }
.incident-ongoing {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--cream);
    border: 1px solid var(--st-outage);
}

.empty {
    padding: 2rem;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    margin: 0;
}

/* ---------- footer (mirrors the marketing site's footer) ---------- */

.site-footer {
    background: var(--night-950);
    border-top: 1px solid var(--line);
    padding: 3.5rem 0 2.5rem;
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.footer-brand .nav-brand { margin-bottom: 0.8rem; }
.footer-brand p { color: var(--muted); max-width: 22rem; font-size: 0.92rem; margin: 0; }

/* column labels are <p> (no heading level to skip), as on the marketing site */
.footer-heading {
    line-height: 1.12;
    margin: 0 0 0.8em;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-family: var(--font-body);
    font-weight: 700;
}

.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: 0.55rem; }
.site-footer ul a { color: var(--text); font-size: 0.95rem; }
.site-footer ul a:hover { color: var(--link-hover); }

.footer-bottom {
    border-top: 1px solid var(--line);
    padding-top: 1.6rem;
    display: flex;
    justify-content: space-between;
    gap: 0.6rem 1.5rem;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.86rem;
}

.footer-bottom span:empty { display: none; }

/* ---------- loading / error ---------- */

.state-msg { padding: 3rem 0; text-align: center; color: var(--muted); margin: 0; }

/* ---------- small screens ---------- */

@media (max-width: 800px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    .container { width: min(1160px, 100% - 2rem); }
    .nav-inner { padding: 0.7rem 1rem; gap: 0.75rem; }
    .page-head { padding: 2.75rem 0 2.25rem; }
    .section { padding: 3rem 0; }
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
    .tile { padding: 0.95rem 1rem; }
    .tile-value { font-size: 1.6rem; }
    .component, .incident { padding: 1.1rem 1.1rem; }
    .chart-card { padding: 1rem; }
    .component-head { gap: 0.5rem; }
    .component-latency { width: 100%; }
    .strip { height: 30px; }
    /* 90 bars at a 2px floor plus 2px gaps need 358px — wider than a phone
       card. Keep the 2px gap (it is the mark spec) and let the bars thin. */
    .strip-bar { min-width: 1px; }
    .incident { grid-template-columns: 1fr; }
    .incident-badge { justify-self: start; }
    .site-footer { padding: 2.5rem 0 2rem; }
}

/* The wordmark keeps its 1.18rem/800 size even here: the light-mode accent
   (#b4531a) passes only as WCAG large text (3.11:1), which needs >= 18.67px bold. */
@media (max-width: 380px) {
    .nav-inner { gap: 0.5rem; }
    .nav-demo-badge { padding: 0.25rem 0.5rem; letter-spacing: 0.03em; }
}
