/* ============================================================ */
/* fps — public status page                                      */
/* ============================================================ */
/*
 * Self-contained design system for the /status page.
 * Reuses the design tokens defined in front_layout/css.blade.php
 * (--ink-*, --paper, --canvas, --accent, --rule, --radius-*).
 *
 * State tokens are local to this stylesheet:
 *   up        — green     (#16a34a family)
 *   degraded  — amber     (#d97706 family)
 *   down      — red       (#dc2626 family)
 *   unknown   — neutral   (--ink-300)
 */

:root {
    --fps-up: #16a34a;
    --fps-up-soft: rgba(22, 163, 74, 0.12);
    --fps-up-tint: rgba(22, 163, 74, 0.06);

    --fps-degraded: #d97706;
    --fps-degraded-soft: rgba(217, 119, 6, 0.14);
    --fps-degraded-tint: rgba(217, 119, 6, 0.06);

    --fps-down: #dc2626;
    --fps-down-soft: rgba(220, 38, 38, 0.14);
    --fps-down-tint: rgba(220, 38, 38, 0.06);

    --fps-unknown: #d4d4d8;
    --fps-unknown-soft: rgba(160, 160, 170, 0.16);
}

.fps-page {
    font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ink-900);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.005em;
}

.fps-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 48px);
}

/* ------------------------------------------------------------ */
/* Hero — overall status banner                                 */
/* ------------------------------------------------------------ */

.fps-hero {
    position: relative;
    padding: clamp(56px, 8vw, 96px) 0 clamp(40px, 6vw, 64px);
    border-bottom: 1px solid var(--rule);
    background:
        radial-gradient(80% 60% at 0% 0%, var(--fps-up-tint), transparent 60%),
        var(--paper);
    transition: background 360ms ease;
}
.fps-hero--degraded {
    background:
        radial-gradient(80% 60% at 0% 0%, var(--fps-degraded-tint), transparent 60%),
        var(--paper);
}
.fps-hero--down {
    background:
        radial-gradient(80% 60% at 0% 0%, var(--fps-down-tint), transparent 60%),
        var(--paper);
}

.fps-eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 12px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--ink-500);
    margin: 0 0 22px;
}
.fps-eyebrow__dot {
    width: 8px; height: 8px; border-radius: 999px;
    background: var(--fps-up);
    box-shadow: 0 0 0 4px var(--fps-up-soft);
    animation: fps-pulse 2.6s ease-in-out infinite;
}
.fps-hero--degraded .fps-eyebrow__dot {
    background: var(--fps-degraded);
    box-shadow: 0 0 0 4px var(--fps-degraded-soft);
}
.fps-hero--down .fps-eyebrow__dot {
    background: var(--fps-down);
    box-shadow: 0 0 0 4px var(--fps-down-soft);
    animation: fps-pulse-fast 1.6s ease-in-out infinite;
}

@keyframes fps-pulse {
    0%, 100% { box-shadow: 0 0 0 4px currentColor; }
    50%      { box-shadow: 0 0 0 6px transparent; }
}
@keyframes fps-pulse-fast {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.18); }
}

.fps-hero__headline {
    font-family: "Geist", sans-serif;
    font-weight: 600;
    font-size: clamp(34px, 4.6vw, 56px);
    letter-spacing: -0.025em;
    line-height: 1.05;
    margin: 0 0 16px;
    color: var(--ink-950);
    max-width: 22ch;
}

.fps-hero__lede {
    font-size: clamp(16px, 1.15vw, 18px);
    line-height: 1.55;
    color: var(--ink-700);
    margin: 0 0 18px;
    max-width: 58ch;
}

.fps-hero__meta {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: "Geist Mono", monospace;
    font-size: 12px; letter-spacing: 0.04em;
    color: var(--ink-500);
    margin: 0;
}

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

.fps-section {
    padding: clamp(48px, 6vw, 80px) 0;
}
.fps-section--alt { background: var(--canvas); }
.fps-section--alert {
    padding-top: clamp(32px, 4vw, 56px);
    padding-bottom: clamp(32px, 4vw, 56px);
}
.fps-section--subscribe {
    background: var(--canvas);
    border-top: 1px solid var(--rule);
}

.fps-section__head {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 28px;
    align-items: end;
    margin-bottom: 32px;
}
.fps-section__title {
    font-family: "Geist", sans-serif;
    font-weight: 600;
    font-size: clamp(22px, 2.4vw, 30px);
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--ink-950);
    margin: 0;
}
.fps-section__sub {
    font-size: 14px; line-height: 1.55;
    color: var(--ink-500);
    margin: 0;
}

.fps-empty {
    padding: 28px;
    border: 1px dashed var(--rule-strong);
    border-radius: var(--radius-md);
    color: var(--ink-700);
    background: var(--paper);
}

/* ------------------------------------------------------------ */
/* Status pills                                                 */
/* ------------------------------------------------------------ */

.fps-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 12px 5px 10px;
    border-radius: 999px;
    font-size: 13px; font-weight: 500;
    border: 1px solid var(--rule);
    background: var(--ink-100);
    color: var(--ink-900);
    line-height: 1.2;
}
.fps-pill::before {
    content: "";
    width: 7px; height: 7px; border-radius: 999px;
    background: var(--fps-unknown);
}
.fps-pill--up {
    background: var(--fps-up-soft);
    color: #166534;
    border-color: rgba(22, 163, 74, 0.22);
}
.fps-pill--up::before { background: var(--fps-up); }
.fps-pill--degraded {
    background: var(--fps-degraded-soft);
    color: #92400e;
    border-color: rgba(217, 119, 6, 0.28);
}
.fps-pill--degraded::before { background: var(--fps-degraded); }
.fps-pill--down {
    background: var(--fps-down-soft);
    color: #991b1b;
    border-color: rgba(220, 38, 38, 0.30);
}
.fps-pill--down::before { background: var(--fps-down); }

/* ------------------------------------------------------------ */
/* Services list with charts                                    */
/* ------------------------------------------------------------ */

.fps-services {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.fps-service__error {
    margin: 4px 0 18px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--fps-down-tint);
    border: 1px solid rgba(220, 38, 38, 0.20);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fps-service[data-status="degraded"] .fps-service__error {
    background: var(--fps-degraded-tint);
    border-color: rgba(217, 119, 6, 0.22);
}
.fps-service__error-label {
    font-family: "Geist Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fps-down);
}
.fps-service[data-status="degraded"] .fps-service__error-label { color: var(--fps-degraded); }
.fps-service__error-text {
    font-family: "Geist Mono", monospace;
    font-size: 13px;
    line-height: 1.45;
    color: var(--ink-900);
    word-break: break-word;
}

.fps-chart {
    margin-top: 14px;
}
.fps-chart + .fps-chart { margin-top: 18px; }

.fps-chart__label {
    font-family: "Geist Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-500);
    margin: 0 0 6px;
}

.fps-chart__axis {
    display: flex; justify-content: space-between;
    font-family: "Geist Mono", monospace;
    font-size: 11px; letter-spacing: 0.04em;
    color: var(--ink-500);
    margin-top: 4px;
}

/* Recent-window squares — one tile per 5-min bucket */
.fps-squares {
    display: grid;
    grid-template-columns: repeat(48, minmax(0, 1fr));
    gap: 3px;
}
.fps-square {
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    background: var(--fps-unknown);
    transition: transform 160ms ease;
}
.fps-square:hover { transform: scale(1.12); }
.fps-square--up        { background: var(--fps-up); }
.fps-square--degraded  { background: var(--fps-degraded); }
.fps-square--down      { background: var(--fps-down); }
.fps-square--unknown   { background: var(--fps-unknown); }

.fps-service {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    padding: 22px clamp(18px, 2.4vw, 28px);
    transition: border-color 200ms ease, box-shadow 200ms ease;
}
.fps-service:hover {
    border-color: var(--rule-strong);
    box-shadow: 0 12px 32px -20px rgba(10, 10, 10, 0.18);
}
.fps-service[data-status="down"]    { border-color: rgba(220, 38, 38, 0.30); }
.fps-service[data-status="degraded"]{ border-color: rgba(217, 119, 6, 0.28); }

.fps-service__head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.fps-service__id {
    display: flex; align-items: center; gap: 12px;
    flex-wrap: wrap;
}
.fps-service__sub {
    font-family: "Geist Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--ink-400);
    text-transform: uppercase;
}
.fps-service__metrics {
    display: flex; gap: 18px;
    flex-wrap: wrap;
}
.fps-metric {
    display: inline-flex; flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}
.fps-metric__label {
    font-family: "Geist Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-500);
}
.fps-metric__value {
    font-family: "Geist", sans-serif;
    font-size: 15px; font-weight: 600;
    color: var(--ink-950);
    font-variant-numeric: tabular-nums;
}

.fps-bars {
    display: grid;
    grid-template-columns: repeat(90, minmax(0, 1fr));
    gap: 2px;
}
.fps-bar {
    height: 34px;
    border-radius: 2px;
    background: var(--fps-unknown);
    transition: transform 160ms ease;
    cursor: default;
}
.fps-bar:hover { transform: scaleY(1.06); }
.fps-bar--up        { background: var(--fps-up); }
.fps-bar--degraded  { background: var(--fps-degraded); }
.fps-bar--down      { background: var(--fps-down); }
.fps-bar--unknown   { background: var(--fps-unknown); }


/* ------------------------------------------------------------ */
/* Incidents                                                    */
/* ------------------------------------------------------------ */

.fps-incidents {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.fps-incidents--active { gap: 14px; }

.fps-incident {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    padding: 18px 20px;
}
.fps-incident--ongoing {
    border-color: rgba(220, 38, 38, 0.30);
    background: linear-gradient(180deg, var(--fps-down-tint), var(--paper) 60%);
}
.fps-incident--resolved {
    background: var(--paper);
}

.fps-incident__head {
    display: flex; align-items: center; gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.fps-incident__title {
    font-family: "Geist", sans-serif;
    font-size: 16px; font-weight: 600;
    color: var(--ink-950);
    margin: 0;
    line-height: 1.3;
}
.fps-incident__meta {
    font-family: "Geist Mono", monospace;
    font-size: 12px;
    color: var(--ink-500);
    margin: 0 0 6px;
}
.fps-incident__body {
    font-size: 14px; line-height: 1.55;
    color: var(--ink-700);
    margin: 6px 0 0;
}

/* ------------------------------------------------------------ */
/* Incident history grouped by day                              */
/* ------------------------------------------------------------ */

.fps-day {
    margin-bottom: 28px;
}
.fps-day:last-child { margin-bottom: 0; }
.fps-day__head {
    display: flex; align-items: baseline; justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--rule);
}
.fps-day__title {
    font-family: "Geist", sans-serif;
    font-size: 15px; font-weight: 600;
    color: var(--ink-950);
    margin: 0;
    letter-spacing: -0.01em;
}
.fps-day__count {
    font-family: "Geist Mono", monospace;
    font-size: 11px;
    color: var(--ink-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ------------------------------------------------------------ */
/* Subscribe / feeds                                            */
/* ------------------------------------------------------------ */

.fps-feeds {
    list-style: none;
    padding: 0;
    margin: 32px 0 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.fps-feed {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 22px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    background: var(--paper);
    text-decoration: none !important;
    color: var(--ink-900) !important;
    transition: border-color 200ms ease, transform 200ms cubic-bezier(0.16,1,0.3,1), box-shadow 200ms ease;
}
.fps-feed:hover {
    border-color: var(--ink-900);
    transform: translateY(-1px);
    box-shadow: 0 18px 36px -22px rgba(10, 10, 10, 0.20);
}
.fps-feed__kind {
    font-family: "Geist Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-500);
}
.fps-feed__name {
    font-family: "Geist Mono", monospace;
    font-size: 14px;
    color: var(--ink-950);
}
.fps-feed__sub {
    font-size: 13px;
    line-height: 1.45;
    color: var(--ink-500);
}

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

@media (max-width: 900px) {
    .fps-section__head {
        grid-template-columns: 1fr;
        gap: 12px;
        align-items: start;
    }
    .fps-service__head {
        align-items: flex-start;
    }
    .fps-service__metrics { gap: 14px; }
    .fps-feeds {
        grid-template-columns: 1fr;
    }
    .fps-bar { height: 28px; }
}

@media (max-width: 560px) {
    .fps-bars { gap: 1px; }
    .fps-bar { height: 24px; border-radius: 1px; }
    .fps-squares { gap: 3px; }
    .fps-metric { align-items: flex-start; }
    .fps-service__metrics {
        gap: 12px;
        width: 100%;
        justify-content: space-between;
    }
}

/* ------------------------------------------------------------ */
/* Reduced motion                                               */
/* ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    .fps-eyebrow__dot { animation: none; }
    .fps-bar { transition: none; }
}
