@tailwind base;
@tailwind components;
@tailwind utilities;

.font-display {
    font-family: "Oxanium", system-ui, sans-serif;
}

.page-bg {
    background-color: #0a1628;
    background-image:
        linear-gradient(115deg, rgba(251, 191, 36, 0.05), transparent 22%),
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(37, 99, 235, 0.22), transparent 55%),
        radial-gradient(ellipse 80% 50% at 100% 50%, rgba(185, 28, 28, 0.08), transparent 50%),
        radial-gradient(ellipse 60% 40% at 0% 80%, rgba(59, 130, 246, 0.12), transparent 45%),
        linear-gradient(180deg, #0c1929 0%, #060d18 50%, #040810 100%);
    background-attachment: fixed;
}

.stars-overlay {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.55;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(1px 1px at 30% 65%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1.5px 1.5px at 70% 30%, rgba(147, 197, 253, 0.8), transparent),
        radial-gradient(1px 1px at 85% 75%, rgba(255, 255, 255, 0.45), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.35), transparent),
        radial-gradient(1px 1px at 22% 88%, rgba(252, 165, 165, 0.4), transparent),
        radial-gradient(1px 1px at 92% 12%, rgba(255, 255, 255, 0.55), transparent);
    background-size: 100% 100%;
}

@media (prefers-reduced-motion: no-preference) {
    .stars-overlay {
        animation: stars-drift 120s linear infinite alternate;
    }

    .page-bg {
        animation: bg-breathe 45s ease-in-out infinite alternate;
    }

    .met-glow {
        animation: met-pulse 4s ease-in-out infinite;
    }
}

@keyframes stars-drift {
    from {
        transform: translate(0, 0);
    }
    to {
        transform: translate(-2%, 1%);
    }
}

@keyframes bg-breathe {
    0% {
        filter: hue-rotate(0deg) brightness(1);
    }
    100% {
        filter: hue-rotate(6deg) brightness(1.03);
    }
}

@keyframes met-pulse {
    0%,
    100% {
        text-shadow: 0 0 20px rgba(59, 130, 246, 0.35), 0 0 40px rgba(255, 255, 255, 0.08);
    }
    50% {
        text-shadow: 0 0 28px rgba(59, 130, 246, 0.55), 0 0 50px rgba(220, 38, 38, 0.12);
    }
}

.patriot-bar {
    background: linear-gradient(
        90deg,
        #b91c1c 0%,
        #b91c1c 33%,
        #f8fafc 33%,
        #f8fafc 66%,
        #1e40af 66%,
        #1e40af 100%
    );
    background-size: 100% 100%;
}

@media (prefers-reduced-motion: no-preference) {
    .patriot-bar {
        animation: patriot-shine 8s ease-in-out infinite;
    }
}

@keyframes patriot-shine {
    0%,
    100% {
        opacity: 0.92;
        filter: brightness(1);
    }
    50% {
        opacity: 1;
        filter: brightness(1.15);
    }
}

.card-lift {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.american-manifesto {
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: rgba(248, 250, 252, 0.72);
    max-width: 58rem;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .card-lift:hover {
        transform: translateY(-3px);
    }
}

.glow-border-blue:hover {
    box-shadow: 0 12px 40px -12px rgba(37, 99, 235, 0.35);
}

.glow-border-silver:hover {
    box-shadow: 0 12px 40px -12px rgba(148, 163, 184, 0.25);
}

.glow-border-red:hover {
    box-shadow: 0 12px 40px -12px rgba(220, 38, 38, 0.22);
}

#mission-progress canvas {
    display: block;
}

.mission-control {
    background:
        linear-gradient(135deg, rgba(251, 191, 36, 0.06), transparent 22%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(9, 14, 27, 0.78)),
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 38%),
        radial-gradient(circle at top right, rgba(220, 38, 38, 0.09), transparent 34%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 28px;
    padding: 18px;
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.20);
    position: relative;
    overflow: hidden;
}

.mission-control::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(251, 191, 36, 0.12);
    border-radius: 22px;
    pointer-events: none;
}

.mission-control::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    top: 56px;
    height: 1px;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.0), rgba(255, 255, 255, 0.18), rgba(220, 38, 38, 0.0));
    pointer-events: none;
}

.mission-control-top {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.mission-control-kicker {
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #fbbf24;
    margin-bottom: 8px;
}

.mission-control-phase-row,
.mission-control-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mission-control-phase-row {
    margin-bottom: 10px;
}

.mission-control-manifesto {
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.46);
    margin-bottom: 10px;
}

.mission-phase-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    border: 1px solid rgba(96, 165, 250, 0.35);
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(15, 23, 42, 0.3));
    color: #dbeafe;
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 0 20px rgba(37, 99, 235, 0.10);
}

.mission-next-countdown {
    color: rgba(255, 255, 255, 0.68);
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 12px;
}

.mission-control-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ── Unified telemetry panel ── */
.telem-panel {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background:
        linear-gradient(180deg, rgba(8, 15, 30, 0.80), rgba(2, 8, 23, 0.55)),
        linear-gradient(135deg, rgba(255, 255, 255, 0.02), transparent 50%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
    margin-bottom: 16px;
}

.telem-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.telem-col {
    padding: 18px 20px 16px;
    min-width: 0;
    position: relative;
}

/* Vertical dividers between columns on wide screens */
@media (min-width: 700px) {
    .telem-hero {
        grid-template-columns: 1fr 1px 1fr 1px 1fr;
    }
    .telem-col-earth  { border-bottom: none; }
    .telem-col-speed  { border-bottom: none; }
    .telem-col-moon   { border-bottom: none; }
    .telem-hero::after { display: none; }
}

/* Horizontal dividers between columns on mobile */
@media (max-width: 699px) {
    .telem-col {
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    .telem-col:last-child { border-bottom: none; }
}

/* The 1px grid divider cells */
.telem-hero > div:nth-child(2),
.telem-hero > div:nth-child(4) {
    width: 1px;
    background: rgba(255, 255, 255, 0.06);
    display: none;
}
@media (min-width: 700px) {
    .telem-hero > div:nth-child(2),
    .telem-hero > div:nth-child(4) {
        display: block;
    }
}

.telem-col-head {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
}

.telem-col-label {
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.40);
}

.telem-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.telem-dot-earth { background: radial-gradient(circle, #60a5fa, #1d4ed8); box-shadow: 0 0 6px #3b82f655; }
.telem-dot-moon  { background: radial-gradient(circle, #cbd5e1, #64748b); box-shadow: 0 0 5px #94a3b833; }
.telem-dot-speed { background: radial-gradient(circle, #f87171, #f59e0b); box-shadow: 0 0 6px #ef444455; }

/* Big distance / speed readout */
.telem-big {
    font-size: clamp(1.6rem, 3.8vw, 2.6rem);
    font-weight: 300;
    font-family: "Oxanium", system-ui, sans-serif;
    letter-spacing: -0.01em;
    color: #f1f5f9;
    line-height: 1;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.telem-big-speed { color: #bae6fd; }

.telem-alt {
    font-size: 11px;
    color: rgba(148, 163, 184, 0.45);
    margin-bottom: 10px;
    min-height: 1em;
}

/* Radial velocity row — compact, inline */
.telem-radial {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-family: "Oxanium", system-ui, sans-serif;
    letter-spacing: 0.04em;
    margin-top: 2px;
    padding: 5px 8px;
    border-radius: 8px;
    border-left: 2px solid transparent;
}
.telem-radial-earth {
    border-left-color: rgba(59, 130, 246, 0.55);
    background: rgba(59, 130, 246, 0.06);
}
.telem-radial-moon {
    border-left-color: rgba(148, 163, 184, 0.45);
    background: rgba(148, 163, 184, 0.05);
}
.telem-radial .radial-label { color: rgba(255, 255, 255, 0.50); flex: 1; }
.telem-radial .radial-val   { color: rgba(255, 255, 255, 0.85); font-weight: 600; white-space: nowrap; }
.telem-radial .radial-arrow { font-size: 13px; line-height: 1; }
.telem-radial-earth .radial-arrow { color: #60a5fa; }
.telem-radial-moon  .radial-arrow { color: #94a3b8; }

/* Speed column specifics */
.telem-col-speed { text-align: center; }
.telem-col-speed .telem-col-head { justify-content: center; }
.telem-col-speed .telem-big { font-size: clamp(1.8rem, 4.2vw, 3rem); }
.telem-col-speed .speed-context-badge { margin: 6px auto 10px; }

.telem-speed-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    margin-top: 2px;
}
.telem-secondary-label {
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: rgba(255, 255, 255, 0.38);
}
.telem-secondary-val {
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.80);
    white-space: nowrap;
}

/* Moon column — right-align on wide to mirror Earth */
@media (min-width: 700px) {
    .telem-col-moon {
        text-align: right;
    }
    .telem-col-moon .telem-col-head {
        flex-direction: row-reverse;
    }
    .telem-col-moon .telem-radial {
        flex-direction: row-reverse;
        border-left: none;
        border-right: 2px solid rgba(148, 163, 184, 0.45);
    }
}

/* Expert strip — raw vectors */
.telem-expert-strip {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px 20px 12px;
}

.mission-progress-shell {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 14px;
    position: relative;
}

.mission-progress-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.mission-progress-strip {
    padding: 0;
}

.playback-controls {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.playback-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 7px 10px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0.52));
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.playback-btn:hover {
    color: #f8fafc;
    border-color: rgba(147, 197, 253, 0.40);
    background: rgba(30, 41, 59, 0.82);
}

.playback-btn-active {
    color: #f8fafc;
    border-color: rgba(251, 191, 36, 0.42);
    background: linear-gradient(90deg, rgba(30, 64, 175, 0.32), rgba(185, 28, 28, 0.22));
}

.playback-scrubber {
    width: 100%;
    accent-color: #fbbf24;
}

.playback-readout {
    min-width: 140px;
    text-align: right;
}

.playback-mode {
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: rgba(255, 255, 255, 0.42);
}

.playback-stamp {
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 12px;
    color: #cbd5e1;
}

/* (old .mission-metrics-grid breakpoint removed — replaced by .telem-panel) */

@media (max-width: 640px) {
    .mission-control {
        padding: 14px;
        border-radius: 24px;
    }

    .mission-control-actions {
        width: 100%;
        justify-content: space-between;
    }

    .playback-controls {
        grid-template-columns: 1fr;
    }

    .playback-readout {
        text-align: left;
        min-width: 0;
    }
}

#viz-mount canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* ============================================================
   VIZ TOOLTIP (fixed, shown on milestone hover in 3D scene)
   ============================================================ */
.viz-tooltip {
    position: fixed;
    z-index: 200;
    pointer-events: none;
    background: rgba(4, 10, 28, 0.92);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 10px;
    padding: 10px 14px;
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 12px;
    color: #e2e8f0;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
    max-width: 200px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.viz-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}
.viz-tooltip .tip-label {
    font-weight: 700;
    font-size: 13px;
    color: #93c5fd;
    margin-bottom: 2px;
}
.viz-tooltip .tip-desc {
    color: #cbd5e1;
    font-size: 11px;
}
.viz-tooltip .tip-time {
    color: #64748b;
    font-size: 10px;
    margin-top: 4px;
    display: block;
}

/* ============================================================
   INFO TIPS — [?] hover popups on VX/VY/VZ labels
   ============================================================ */
.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.20);
    border: 1px solid rgba(59, 130, 246, 0.40);
    color: #93c5fd;
    font-size: 8px;
    font-weight: 700;
    cursor: help;
    position: relative;
    vertical-align: middle;
    margin-left: 3px;
    font-family: "Oxanium", system-ui, sans-serif;
    transition: background 0.15s;
}
.info-tip:hover {
    background: rgba(59, 130, 246, 0.38);
}
.info-tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(4, 10, 28, 0.96);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.5;
    color: #cbd5e1;
    white-space: normal;
    width: 200px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 100;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
}
.info-tip:hover::after {
    opacity: 1;
}

/* ============================================================
   MISSION PROGRESS STRIP
   ============================================================ */
.progress-strip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 4px;
}
.progress-strip-label {
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.55);
}
.progress-strip-meta {
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 11px;
    color: #7dd3fc;
}
.progress-bar-track {
    position: relative;
    height: 10px;
    background: rgba(30, 41, 59, 0.70);
    border-radius: 9999px;
    margin-bottom: 18px;
    overflow: visible;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #2563eb 0%, #f8fafc 50%, #dc2626 100%);
    transition: width 1s ease;
    position: relative;
}
.progress-bar-fill::after {
    content: '';
    position: absolute;
    right: -1px;
    top: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #dc2626;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.6);
}
.milestone-tick {
    position: absolute;
    top: -4px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}
.tick-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid currentColor;
    background: #04091a;
}
.milestone-tick.past  { color: #60a5fa; }
.milestone-tick.future { color: #475569; }
.tick-label {
    position: absolute;
    top: 14px;
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 8.5px;
    white-space: nowrap;
    color: currentColor;
    opacity: 0.80;
}
@media (max-width: 480px) {
    .tick-label { display: none; }
    .progress-bar-track { margin-bottom: 8px; }
}
.track-badge {
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.56));
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.40);
}
.track-badge.track-ok   { color: #4ade80; border-color: rgba(74, 222, 128, 0.35); }
.track-badge.track-warn { color: #fb923c; border-color: rgba(251, 146, 60, 0.35); }
.track-badge.track-playback { color: #93c5fd; border-color: rgba(147, 197, 253, 0.35); }

/* ============================================================
   SPEED CONTEXT BADGE
   ============================================================ */
.speed-context-badge {
    display: inline-block;
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 99px;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.18), rgba(245, 158, 11, 0.08));
    border: 1px solid rgba(251, 191, 36, 0.34);
    color: #fde68a;
    letter-spacing: 0.02em;
}

/* ============================================================
   RADIAL VELOCITY ROWS
   ============================================================ */
.radial-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.50);
    border-left: 3px solid transparent;
}
.radial-row-earth { border-left-color: #3b82f6; }
.radial-row-moon  { border-left-color: #64748b; }

.radial-arrow {
    font-size: 18px;
    line-height: 1;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.radial-row-earth .radial-arrow { color: #60a5fa; }
.radial-row-moon  .radial-arrow { color: #94a3b8; }

.radial-body {
    flex: 1;
    min-width: 0;
}
.radial-label {
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.radial-val {
    font-size: 17px;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    color: #e2e8f0;
    line-height: 1.3;
}

/* ============================================================
   RAW VECTORS — <details> disclosure for nerds
   ============================================================ */
details.raw-vectors {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 10px;
    margin-top: 8px;
}
details.raw-vectors summary {
    cursor: pointer;
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: rgba(255, 255, 255, 0.30);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    transition: color 0.15s;
}
details.raw-vectors summary::-webkit-details-marker { display: none; }
details.raw-vectors summary::before {
    content: '\25B6';
    font-size: 8px;
    transition: transform 0.15s;
    color: rgba(255, 255, 255, 0.25);
}
details.raw-vectors[open] summary::before { transform: rotate(90deg); }
details.raw-vectors summary:hover { color: rgba(255, 255, 255, 0.55); }

/* ============================================================
   DATA FRESHNESS BADGE
   ============================================================ */
.data-freshness {
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    background: rgba(30, 41, 59, 0.60);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.30);
}
.data-freshness.fresh { color: #4ade80; border-color: rgba(74, 222, 128, 0.30); }
.data-freshness.stale { color: #facc15; border-color: rgba(250, 204, 21, 0.30); }
.data-freshness.old   { color: #f87171; border-color: rgba(248, 113, 113, 0.30); }
.data-freshness.playback { color: #93c5fd; border-color: rgba(147, 197, 253, 0.30); }

.timeline-item {
    opacity: 0;
    animation: timeline-in 0.55s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
    .timeline-item {
        opacity: 1;
        animation: none;
    }

    .stars-overlay,
    .page-bg,
    .patriot-bar,
    .met-glow {
        animation: none !important;
    }

    .animate-pulse {
        animation: none !important;
    }
}

@keyframes timeline-in {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-item:nth-child(1) {
    animation-delay: 0.05s;
}
.timeline-item:nth-child(2) {
    animation-delay: 0.1s;
}
.timeline-item:nth-child(3) {
    animation-delay: 0.15s;
}
.timeline-item:nth-child(4) {
    animation-delay: 0.2s;
}
.timeline-item:nth-child(5) {
    animation-delay: 0.25s;
}
.timeline-item:nth-child(6) {
    animation-delay: 0.3s;
}
.timeline-item:nth-child(7) {
    animation-delay: 0.35s;
}
.timeline-item:nth-child(8) {
    animation-delay: 0.4s;
}

.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* Patriot max — stripes, ribbon, title */
.stripes-top {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    z-index: 50;
    background: repeating-linear-gradient(
        90deg,
        #b91c1c 0px,
        #b91c1c 14px,
        #f8fafc 14px,
        #f8fafc 28px,
        #1e3a8a 28px,
        #1e3a8a 42px
    );
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.patriot-ribbon-left {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 5px;
    z-index: 40;
    background: linear-gradient(180deg, #b91c1c 0%, #b91c1c 33%, #f8fafc 33%, #f8fafc 66%, #1e40af 66%, #1e40af 100%);
    opacity: 0.85;
}

@media (max-width: 480px) {
    .patriot-ribbon-left {
        width: 3px;
    }
}

.usa-title-gradient {
    display: inline-block;
    background: linear-gradient(90deg, #f8fafc 0%, #93c5fd 35%, #dc2626 70%, #f8fafc 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
    .usa-title-gradient {
        animation: title-wave 10s ease-in-out infinite;
    }

    .patriot-shimmer-text {
        animation: patriot-shimmer 6s ease-in-out infinite;
    }

    .patriot-spin-slow {
        animation: spin-slow 28s linear infinite;
    }

    .crew-card-patriot:hover {
        box-shadow: 0 0 0 1px rgba(248, 250, 252, 0.15), 0 12px 40px -8px rgba(220, 38, 38, 0.2);
    }
}

/* ── Resource cards ─────────────────────────────────────────── */
.resource-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 1rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    ring-2 ring-red-500/10;
}

.resource-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(15, 23, 42, 0.75);
    transform: translateY(-1px);
}

.resource-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: background 0.2s;
}

.resource-body {
    flex: 1;
    min-width: 0;
}

.resource-title {
    font-family: var(--font-display, 'Oxanium', monospace);
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(248, 250, 252, 0.85);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.resource-sub {
    font-size: 0.65rem;
    color: rgba(148, 163, 184, 0.55);
    margin-top: 0.15rem;
    line-height: 1.4;
}

.resource-ext {
    font-size: 0.6rem;
    color: rgba(148, 163, 184, 0.25);
    flex-shrink: 0;
    transition: color 0.2s;
}

.resource-card:hover .resource-ext {
    color: rgba(148, 163, 184, 0.55);
}

.live-dot-sm {
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #dc2626;
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    margin-left: 0.1rem;
    vertical-align: middle;
}

@keyframes title-wave {
    0%,
    100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

@keyframes patriot-shimmer {
    0%,
    100% {
        opacity: 0.85;
    }
    50% {
        opacity: 1;
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .usa-title-gradient {
        animation: none;
        background: none;
        -webkit-background-clip: unset;
        background-clip: unset;
        color: #f8fafc;
    }

    .patriot-shimmer-text {
        animation: none;
    }

    .patriot-spin-slow {
        animation: none;
    }
}

/* ============================================================
   REFERENCE FRAME BUTTONS
   ============================================================ */
.frame-btn {
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 11px;
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(15, 23, 42, 0.65);
    color: rgba(255, 255, 255, 0.36);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.frame-btn.frame-btn-secondary {
    color: rgba(251, 191, 36, 0.70);
    border-color: rgba(251, 191, 36, 0.18);
}

.frame-btn:hover {
    color: rgba(255, 255, 255, 0.72);
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(30, 41, 59, 0.75);
}

.frame-btn.frame-btn-active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.26), rgba(185, 28, 28, 0.18));
    border-color: rgba(251, 191, 36, 0.34);
    color: #f8fafc;
}

.frame-btn.frame-btn-active:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.38), rgba(185, 28, 28, 0.24));
    border-color: rgba(251, 191, 36, 0.50);
}

.trajectory-kicker {
    margin-top: 5px;
    font-family: "Oxanium", system-ui, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(251, 191, 36, 0.72);
}
