:root {
    color-scheme: dark;
    --ink: #f3f7f1;
    --muted: #9baaa0;
    --surface: #151e19;
    --surface-raised: #1b2720;
    --line: #2a382f;
    --accent: #a8e063;
    --accent-strong: #70d48b;
    --warning: #f4c46b;
    --danger: #f08080;
}

* { box-sizing: border-box; }
html { background: #0d1310; }

body {
    min-width: 320px;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 82% 5%, rgba(112, 212, 139, 0.11), transparent 27rem),
        #0d1310;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

button { font: inherit; }
.shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }

.hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 32px;
    min-height: 340px;
    padding: 76px 0 54px;
}

.eyebrow,
.label {
    margin: 0;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--accent-strong);
    box-shadow: 0 0 0 5px rgba(112, 212, 139, 0.12);
}

h1, h2 {
    margin: 0;
    max-width: 760px;
    letter-spacing: -0.045em;
    line-height: 0.98;
}

h1 {
    margin-top: 20px;
    font-size: clamp(3.2rem, 8vw, 6.8rem);
    font-weight: 650;
}

h2 {
    margin-top: 14px;
    font-size: clamp(2rem, 4vw, 3.7rem);
    font-weight: 620;
}

.intro {
    max-width: 640px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.refresh-panel {
    flex: 0 0 auto;
    padding-bottom: 8px;
    text-align: right;
}

#refresh-button {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 11px 18px;
    color: var(--ink);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

#refresh-button:hover { border-color: var(--accent-strong); background: var(--surface-raised); }
#refresh-button:active { transform: translateY(1px); }
#refresh-button:focus-visible { outline: 3px solid rgba(168, 224, 99, 0.38); outline-offset: 3px; }
#refresh-button:disabled { cursor: wait; opacity: 0.65; }

#updated-at {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

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

.metric-card {
    min-height: 236px;
    padding: 28px;
    background: var(--surface);
}

.service-card {
    background:
        linear-gradient(130deg, rgba(112, 212, 139, 0.08), transparent 65%),
        var(--surface);
}

.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.badge {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 9px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.badge.online {
    border-color: rgba(112, 212, 139, 0.35);
    color: var(--accent-strong);
    background: rgba(112, 212, 139, 0.08);
}

.badge.offline {
    border-color: rgba(240, 128, 128, 0.35);
    color: var(--danger);
    background: rgba(240, 128, 128, 0.08);
}

.metric-value {
    margin: 40px 0 8px;
    font-size: clamp(2.15rem, 5vw, 4rem);
    font-weight: 600;
    letter-spacing: -0.05em;
    line-height: 1;
}

.compact-value { margin: 0; font-size: 0.9rem; font-weight: 700; }
.metric-note { margin: 12px 0 0; color: var(--muted); font-size: 0.86rem; }

.meter {
    height: 5px;
    margin-top: 25px;
    overflow: hidden;
    border-radius: 99px;
    background: #28332c;
}

.meter span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-strong), var(--accent));
    transition: width 500ms ease;
}

.meter.warning span { background: var(--warning); }
.meter.danger span { background: var(--danger); }
.journey { padding: 128px 0 104px; }

.section-copy {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
    gap: 24px 64px;
    align-items: end;
}

.section-copy .eyebrow,
.section-copy h2 { grid-column: 1; }

.section-copy > p:last-child {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin: 0;
    color: var(--muted);
}

.flow {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin: 60px 0 0;
    padding: 0;
    list-style: none;
}

.flow li {
    position: relative;
    min-height: 155px;
    padding: 20px 20px 20px 0;
    border-top: 1px solid var(--line);
}

.flow li:not(:last-child)::after {
    position: absolute;
    top: -9px;
    right: 14px;
    content: "→";
    padding-left: 8px;
    color: var(--accent-strong);
    background: #0d1310;
}

.flow strong, .flow small { display: block; }
.flow strong { margin-top: 28px; font-size: 1.1rem; }
.flow small { max-width: 145px; margin-top: 5px; color: var(--muted); font-size: 0.78rem; }

.step-number {
    color: var(--accent-strong);
    font-family: ui-monospace, "Cascadia Code", monospace;
    font-size: 0.75rem;
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    border-top: 1px solid var(--line);
    padding: 28px 0 42px;
    color: var(--muted);
    font-size: 0.78rem;
}

footer p { margin: 0; }

@media (max-width: 760px) {
    .shell { width: min(100% - 28px, 1160px); }
    .hero { display: block; min-height: auto; padding: 64px 0 44px; }
    .refresh-panel { margin-top: 34px; text-align: left; }
    .metrics { grid-template-columns: 1fr; }
    .metric-card { min-height: 210px; padding: 24px; }
    .section-copy { display: block; }
    .section-copy > p:last-child { margin-top: 24px; }
    .flow { grid-template-columns: 1fr; margin-top: 46px; }

    .flow li {
        min-height: 112px;
        padding-left: 18px;
        border-top: 0;
        border-left: 1px solid var(--line);
    }

    .flow li:not(:last-child)::after {
        top: auto;
        right: auto;
        bottom: 2px;
        left: -9px;
        content: "↓";
        padding: 4px 0;
    }

    .flow strong { margin-top: 12px; }
    .journey { padding: 92px 0 72px; }
    footer { display: block; }
    footer p + p { margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
