/* FARNETIX Solutions — Service Status
   Palette: deep navy surfaces, brand blue/cyan accents, green reserved for OK state. */

:root {
    color-scheme: dark;

    --bg: #060c17;
    --bg-elev: #0a1322;
    --panel: #0b1524;
    --panel-hover: #0e1a2c;
    --line: rgba(126, 158, 200, 0.16);
    --line-strong: rgba(126, 158, 200, 0.28);

    --text: #eef3f9;
    --text-2: #b8c6d8;
    --muted: #7e8ea6;

    --blue: #2f6dff;
    --cyan: #57c9ee;
    --ok: #3ddc97;
    --warn: #f2b552;
    --danger: #ff6b7a;
    --info: #7fa6ff;

    --wrap: 1140px;
    --radius: 10px;

    --font: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-2);
    background:
        radial-gradient(120% 60% at 50% -10%, rgba(47, 109, 255, 0.14), transparent 60%),
        linear-gradient(180deg, #071020 0%, var(--bg) 40%);
    background-attachment: fixed;
}

h1, h2, h3 { color: var(--text); font-weight: 600; letter-spacing: -0.015em; margin: 0; text-wrap: pretty; }
p { margin: 0; }
img { display: block; max-width: 100%; }
ul, ol, dl, dd, dt { margin: 0; padding: 0; }
li { list-style: none; }

a { color: var(--cyan); text-decoration: none; transition: color 0.16s ease; }
a:hover { color: #8fe0ff; }

:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
    border-radius: 4px;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: 28px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 12px;
    padding: 10px 16px;
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    z-index: 20;
}
.skip-link:focus { left: 20px; }

/* ---------- Topbar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--line);
    background: rgba(6, 12, 23, 0.88);
    backdrop-filter: blur(10px);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 68px;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { height: 26px; width: auto; opacity: 0.95; }
.brand-divider { width: 1px; height: 20px; background: var(--line-strong); }
.brand-label {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.topbar-right { display: flex; align-items: center; gap: 22px; }

.global-state {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 6px 13px 6px 11px;
    font-size: 13px;
    white-space: nowrap;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(61, 220, 151, 0.06);
}

.site-link { font-size: 13.5px; color: var(--text-2); white-space: nowrap; }
.site-link:hover { color: var(--cyan); }

/* ---------- Status dots ---------- */

.dot {
    position: relative;
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.14);
}
.dot::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px solid var(--ok);
    opacity: 0;
    animation: pulse 3.2s ease-out infinite;
}
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(242, 181, 82, 0.14); }
.dot-warn::after { border-color: var(--warn); }
.dot-danger { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 107, 122, 0.14); }
.dot-danger::after { border-color: var(--danger); }
.dot-info { background: var(--info); box-shadow: 0 0 0 3px rgba(127, 166, 255, 0.14); }
.dot-info::after { border-color: var(--info); }
.dot-idle { background: var(--muted); box-shadow: 0 0 0 3px rgba(126, 142, 166, 0.12); }
.dot-idle::after { display: none; }

@keyframes pulse {
    0% { opacity: 0.55; transform: scale(1); }
    70%, 100% { opacity: 0; transform: scale(2.3); }
}

/* ---------- Hero ---------- */

.hero { padding: 72px 0 56px; }

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 56px;
    align-items: start;
}

.eyebrow {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 18px;
}

.hero h1 {
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.15;
    max-width: 15ch;
}

.lead {
    margin-top: 20px;
    max-width: 56ch;
    font-size: 16px;
    color: var(--text-2);
}

.hero-status {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(47, 109, 255, 0.07), rgba(11, 21, 36, 0.6));
}

.panel-label {
    font-size: 11.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.hero-status-value {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}
.hero-status-value .dot { width: 10px; height: 10px; }

.hero-meta {
    display: grid;
    gap: 14px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}
.hero-meta div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hero-meta dt { font-size: 13px; color: var(--muted); }
.hero-meta dd { font-family: var(--mono); font-size: 13px; color: var(--text); }

/* ---------- Sections ---------- */

.section { padding: 28px 0; }
.section-tight { padding: 0; }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: 18px; }
.section-note { font-size: 13px; color: var(--muted); }

.columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    padding-block: 28px;
}
.columns.wrap { padding-block: 28px; }
.section .columns.wrap { padding-block: 0; }

/* ---------- Metrics ---------- */

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel);
}

.metric { padding: 20px 22px; border-left: 1px solid var(--line); }
.metric:first-child { border-left: 0; }

.metric-key {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.metric-value {
    margin-top: 10px;
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
}
.metric-value.is-empty { color: var(--muted); font-weight: 500; }
.metric-sub { margin-top: 6px; font-size: 12.5px; color: var(--muted); }

/* ---------- Services ---------- */

.services {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel);
}

.service {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 18px 22px;
    border-top: 1px solid var(--line);
    transition: background 0.16s ease;
}
.service:first-child { border-top: 0; }
.service:hover { background: var(--panel-hover); }

.service-name {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 15.5px;
    font-weight: 500;
    color: var(--text);
    font-family: var(--mono);
    overflow-wrap: anywhere;
}
.service-desc { margin-top: 4px; padding-left: 19px; font-size: 13.5px; color: var(--muted); }

.service-right { display: flex; align-items: center; gap: 18px; justify-self: end; }
.service-time { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.services-empty { padding: 20px 22px; font-size: 14px; color: var(--muted); }

/* ---------- Badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 11px;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--text-2);
    background: rgba(255, 255, 255, 0.02);
}
.badge-ok { color: #a7f0cc; border-color: rgba(61, 220, 151, 0.3); background: rgba(61, 220, 151, 0.08); }
.badge-degraded { color: #ffd9a1; border-color: rgba(242, 181, 82, 0.3); background: rgba(242, 181, 82, 0.08); }
.badge-partial { color: #ffc39d; border-color: rgba(255, 150, 90, 0.3); background: rgba(255, 150, 90, 0.08); }
.badge-major { color: #ffb3bc; border-color: rgba(255, 107, 122, 0.32); background: rgba(255, 107, 122, 0.09); }
.badge-maintenance { color: #c3d4ff; border-color: rgba(127, 166, 255, 0.3); background: rgba(127, 166, 255, 0.08); }

/* ---------- Panels, empty states ---------- */

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.empty { display: flex; align-items: flex-start; gap: 14px; padding: 22px; }
.empty .dot { margin-top: 7px; }
.empty-title { color: var(--text); font-weight: 500; }
.empty-note { margin-top: 3px; font-size: 13.5px; color: var(--muted); }

/* ---------- Events (incidents / maintenance) ---------- */

.event { padding: 22px; border-top: 1px solid var(--line); }
.event:first-child { border-top: 0; }
.event-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.event-head h3 { font-size: 15.5px; }
.event-meta { margin-top: 8px; font-size: 13px; color: var(--muted); }
.event-body { margin-top: 10px; font-size: 14px; }
.event-affected { margin-top: 14px; font-size: 13px; color: var(--muted); }
.event-affected span { letter-spacing: 0.06em; text-transform: uppercase; font-size: 11.5px; }
.event-affected em { font-family: var(--mono); font-style: normal; color: var(--text-2); }

.timeline { margin-top: 16px; padding-left: 18px; border-left: 1px solid var(--line); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: "";
    position: absolute;
    left: -22px;
    top: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bg-elev);
    border: 1px solid var(--line-strong);
}
.timeline-item:first-child::before { border-color: var(--cyan); background: var(--cyan); }
.timeline-stage { font-size: 13px; font-weight: 500; color: var(--text); }
.timeline-time { font-size: 12px; color: var(--muted); }
.timeline-body { margin-top: 4px; font-size: 13.5px; }

/* ---------- Topology ---------- */

.topology { padding: 22px; display: grid; gap: 0; }

.topo-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding: 14px 0;
    position: relative;
}
.topo-row + .topo-row { border-top: 1px dashed var(--line); }

.topo-tier {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}
.topo-nodes { display: flex; flex-wrap: wrap; gap: 8px; }

.node {
    padding: 7px 13px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
}
.node-accent {
    color: var(--text);
    border-color: rgba(47, 109, 255, 0.4);
    background: rgba(47, 109, 255, 0.1);
}

/* ---------- Checks ---------- */

.checks { padding: 8px 0; }
.check {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    font-size: 14px;
}
.check + .check { border-top: 1px solid var(--line); }
.check-glyph { font-family: var(--mono); font-size: 13px; color: var(--ok); }
.check-glyph[data-state="warn"] { color: var(--warn); }
.check-glyph[data-state="fail"] { color: var(--danger); }
.check-label { color: var(--text-2); }
.check-state { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- Footer ---------- */

.footer { margin-top: 64px; border-top: 1px solid var(--line); padding: 32px 0 44px; }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-strong { color: var(--text); font-size: 14px; }
.footer-note { margin-top: 4px; font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 22px; font-size: 13.5px; }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
    .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .hero h1 { max-width: 22ch; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric:nth-child(odd) { border-left: 0; }
    .metric:nth-child(n + 3) { border-top: 1px solid var(--line); }
    .columns { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 640px) {
    body { font-size: 14.5px; }
    .wrap { padding-inline: 18px; }

    .topbar-inner { min-height: 60px; padding-block: 12px; flex-wrap: wrap; gap: 10px 16px; }
    .brand-logo { height: 22px; }
    .topbar-right { width: 100%; justify-content: space-between; gap: 12px; }
    .global-state { font-size: 12.5px; padding: 5px 11px 5px 9px; }

    .hero { padding: 40px 0 36px; }
    .hero h1 { max-width: none; }
    .hero-status { padding: 20px; }

    .metrics { grid-template-columns: minmax(0, 1fr); }
    .metric { border-left: 0; }
    .metric + .metric { border-top: 1px solid var(--line); }

    .section-head { flex-direction: column; align-items: flex-start; gap: 4px; }

    .service {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 16px 18px;
    }
    .service-right { justify-self: start; padding-left: 19px; gap: 14px; }
    .service-desc { padding-left: 19px; }

    .topo-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .event, .empty, .check { padding-inline: 18px; }
    .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
