/* Fox3 status page. Brand tokens mirror app/src/styles/globals.css on fox3servers.com. */

@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url('/fonts/barlow-500.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url('/fonts/barlow-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 700; font-display: swap; src: url('/fonts/barlow-700.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 800; font-display: swap; src: url('/fonts/barlow-800.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-400-700.woff2') format('woff2'); }

:root {
  --navy-950: #0a0e1a;
  --navy-900: #0f1629;
  --navy-800: #151d38;
  --navy-700: #1c2747;
  --navy-600: #243156;
  --fox-600: #b91c1c;
  --fox-500: #dc2626;
  --fox-400: #ef4444;

  --text: #eef1f7;
  --text-2: #b4bdd0;
  --muted: #8591ab;
  --line: rgba(52, 68, 115, 0.55);
  --panel: rgba(21, 29, 56, 0.62);
  --panel-solid: #121a33;

  --ok: #2fcb74;
  --degraded: #f2b705;
  --partial: #fb8b24;
  --major: #f0443a;
  --maint: #5aa7ff;
  --unknown: #7a86a3;
  --nodata: #212b4a;

  --radius: 14px;
  --heading: 'Barlow', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 520px at 50% -180px, rgba(36, 49, 86, 0.75), transparent 70%),
    radial-gradient(700px 300px at 85% -120px, rgba(220, 38, 38, 0.10), transparent 70%),
    var(--navy-950);
  color: var(--text);
  font: 400 15px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--fox-400);
  outline-offset: 2px;
  border-radius: 6px;
}
h1, h2, h3 { font-family: var(--heading); letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.top { padding: 22px 0 8px; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 44px; width: auto; filter: drop-shadow(0 6px 18px rgba(220, 38, 38, 0.25)); }
.brand-name { font: 800 22px/1 var(--heading); letter-spacing: -0.02em; }
.brand-name b { color: var(--fox-400); font-weight: 800; }
.brand-tag {
  font: 600 12px/1 var(--heading); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-2); padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; margin-left: 2px;
}
.nav { display: flex; align-items: center; gap: 10px; }
.nav-link { color: var(--text-2); text-decoration: none; font-size: 14px; padding: 8px 10px; border-radius: 8px; }
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 14px/1 var(--heading); letter-spacing: 0.02em;
  padding: 11px 16px; border-radius: 10px; border: 1px solid transparent;
  background: var(--fox-500); color: #fff; text-decoration: none; cursor: pointer;
  box-shadow: 0 10px 24px -10px rgba(220, 38, 38, 0.55);
  transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: var(--fox-400); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); box-shadow: none; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(120, 140, 200, 0.45); }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }

/* Subscribe menu (details/summary, no JS needed) */
.sub { position: relative; }
.sub > summary { list-style: none; }
.sub > summary::-webkit-details-marker { display: none; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 290px;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px; padding: 8px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.6);
}
.menu a { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 8px; text-decoration: none; }
.menu a:hover { background: rgba(255, 255, 255, 0.05); }
.menu svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--text-2); }
.menu b { display: block; font-weight: 600; font-size: 14px; }
.menu span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* ---------- Hero banner ---------- */
.hero {
  --c: var(--ok);
  position: relative; overflow: hidden;
  margin: 26px 0 30px; padding: 26px 28px;
  display: flex; align-items: center; gap: 20px;
  border-radius: 18px; border: 1px solid color-mix(in srgb, var(--c) 38%, transparent);
  background:
    radial-gradient(420px 160px at 0% 0%, color-mix(in srgb, var(--c) 26%, transparent), transparent 75%),
    linear-gradient(180deg, color-mix(in srgb, var(--c) 9%, var(--navy-900)), var(--navy-900));
  box-shadow: 0 24px 60px -30px color-mix(in srgb, var(--c) 60%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.hero-icon {
  flex: none; width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent), 0 0 34px -4px color-mix(in srgb, var(--c) 55%, transparent);
}
.hero-icon svg { width: 30px; height: 30px; }
.hero h1 { font-size: clamp(24px, 4.2vw, 32px); font-weight: 800; line-height: 1.1; }
.hero p { margin-top: 6px; color: var(--text-2); font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.live { display: inline-flex; align-items: center; gap: 7px; }
.live::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .live::before { animation: none; } }


/* ---------- Sections ---------- */
.section { margin: 34px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); }
.section-link { font-size: 13.5px; color: var(--text-2); text-decoration: none; }
.section-link:hover { color: var(--text); }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(6px); box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.8);
}

/* ---------- Incidents (active + maintenance) ---------- */
.inc {
  --c: var(--unknown);
  position: relative; padding: 20px 22px 18px 26px; margin-bottom: 14px; overflow: hidden;
}
.inc::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.inc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.inc h3 { font-size: 19px; font-weight: 700; line-height: 1.3; }
.inc h3 a { text-decoration: none; }
.inc h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.badge {
  flex: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font: 700 11.5px/1 var(--heading); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 9px; border-radius: 999px; color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12px; color: var(--text-2); padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line); }
.window { margin-top: 8px; font-size: 13.5px; color: var(--text-2); }

.timeline { list-style: none; margin: 16px 0 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--navy-600); box-shadow: 0 0 0 3px var(--navy-900); }
.timeline li::after { content: ''; position: absolute; left: 8px; top: 18px; bottom: -2px; width: 1px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li:first-child::before { background: var(--c); }
.tl-state { font: 700 13px/1.4 var(--heading); letter-spacing: 0.04em; text-transform: uppercase; }
.tl-time { font-size: 12.5px; color: var(--muted); margin-left: 8px; }
.tl-body { margin-top: 4px; color: var(--text-2); }
.tl-body p + p { margin-top: 8px; }
.tl-body a { color: var(--text); text-underline-offset: 3px; }
.more { margin-top: 12px; }
.more summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary:hover { color: var(--text); }
.more[open] summary { display: none; }

/* ---------- Components ---------- */
.group { margin-bottom: 14px; overflow: hidden; }
.group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 22px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.015);
}
.group-head h2 { font-size: 16px; font-weight: 700; letter-spacing: 0.01em; }
.comp { padding: 18px 22px 16px; }
.comp + .comp { border-top: 1px solid var(--line); }
.comp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comp-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.comp-desc { font-size: 13px; color: var(--muted); margin-top: 1px; }
.state { --c: var(--ok); display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--c); white-space: nowrap; }
.state::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent); }
.state-plain { color: var(--text-2); }

.bars { display: flex; gap: 2px; height: 34px; margin-top: 14px; }
.bar {
  flex: 1 1 0; min-width: 0; border-radius: 2.5px; background: var(--ok);
  transition: transform 0.12s, filter 0.12s; transform-origin: bottom; cursor: default;
}
.bar:hover, .bar:focus-visible { transform: scaleY(1.12); filter: brightness(1.2); outline: none; }
.b-operational { background: var(--ok); opacity: 0.9; }
.b-degraded { background: var(--degraded); }
.b-partial_outage { background: var(--partial); }
.b-major_outage { background: var(--major); }
.b-maintenance { background: var(--maint); }
.b-unknown { background: var(--unknown); opacity: 0.6; }
.b-nodata { background: var(--nodata); }
.bars-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.bars-foot .rule { flex: 1; height: 1px; background: var(--line); }
.bars-foot .up { color: var(--text-2); font-weight: 600; }
.d30 { display: none; }

.support { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; }
.support-l { display: flex; gap: 16px; align-items: center; }
.support-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(88, 101, 242, 0.14); color: #8c97ff; }
.support-icon svg { width: 24px; height: 24px; }
.support h3 { font-size: 16px; font-weight: 700; }
.support p { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }
.support-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Past incidents ---------- */
.day { padding: 16px 0 18px; border-top: 1px solid var(--line); }
.day:first-child { border-top: 0; padding-top: 4px; }
.day h3 { font: 700 14px/1.3 var(--heading); letter-spacing: 0.04em; color: var(--text-2); text-transform: uppercase; margin-bottom: 8px; }
.day .none { color: var(--muted); font-size: 14px; }
.pi { --c: var(--unknown); display: block; padding: 10px 14px 12px; margin: 6px -14px 0; border-radius: 10px; text-decoration: none; }
.pi:hover { background: rgba(255, 255, 255, 0.03); }
.pi-title { font-weight: 600; font-size: 15.5px; color: var(--c); }
.pi-body { font-size: 14px; color: var(--text-2); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pi-meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- Incident page ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; margin-top: 24px; color: var(--text-2); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--text); }
.back svg { width: 16px; height: 16px; flex: none; }
.page-title { margin: 18px 0 8px; font-size: clamp(26px, 4.4vw, 36px); font-weight: 800; line-height: 1.15; }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; }
.panel { padding: 22px 24px; }
.panel .timeline { margin-top: 0; }
.pm h2 { font-size: 18px; margin-bottom: 8px; }
.pm .tl-body { color: var(--text); }

/* ---------- Footer ---------- */
.foot { margin: 52px 0 40px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; font-size: 13px; color: var(--muted); }
.foot a { color: var(--text-2); text-decoration: none; }
.foot a:hover { color: var(--text); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------- Tooltip (app.js) ---------- */
.tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 280px;
  background: #0d1428; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.7); font-size: 13px; line-height: 1.45;
  opacity: 0; transform: translateY(4px); transition: opacity 0.1s, transform 0.1s;
}
.tip.on { opacity: 1; transform: none; }
.tip-date { font-weight: 700; font-family: var(--heading); font-size: 14px; letter-spacing: 0.02em; }
.tip-line { color: var(--text-2); margin-top: 3px; }
.tip-inc { color: var(--text); margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.info { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font: 700 10px/1 var(--heading); cursor: help; flex: none; }

/* ---------- Admin ---------- */
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 6px; }
.admin-bar h1 { font-size: 28px; font-weight: 800; }
.admin-who { font-size: 13px; color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 11px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl th { font: 700 12px/1.2 var(--heading); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-top: 0; }
.tbl a { text-decoration: none; font-weight: 600; }
.tbl a:hover { text-decoration: underline; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.form { display: grid; gap: 16px; padding: 22px 24px; }
.field label, .field .lbl { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=datetime-local], select, textarea {
  width: 100%; background: #0c1326; color: var(--text); border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; font: inherit; font-size: 14px;
}
select.sm { width: auto; padding: 6px 8px; font-size: 13px; }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checks { display: grid; gap: 8px; }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, 0.02); }
.check-row label { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 0; }
.cbx { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.flag { font: 700 11px/1 var(--heading); letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; background: rgba(242, 183, 5, 0.14); color: var(--degraded); border: 1px solid rgba(242, 183, 5, 0.3); }
.flag-live { background: rgba(47, 203, 116, 0.12); color: var(--ok); border-color: rgba(47, 203, 116, 0.3); }
.notice { padding: 12px 16px; border-radius: 10px; background: rgba(90, 167, 255, 0.1); border: 1px solid rgba(90, 167, 255, 0.3); color: var(--text); font-size: 14px; margin: 14px 0; }
.danger { background: transparent; border-color: rgba(240, 68, 58, 0.45); color: #ff8a82; box-shadow: none; }
.danger:hover { background: rgba(240, 68, 58, 0.12); }

/* Status colour hooks — must stay after every component rule that sets a default --c. */
.c-operational { --c: var(--ok); }
.c-degraded { --c: var(--degraded); }
.c-partial_outage { --c: var(--partial); }
.c-major_outage { --c: var(--major); }
.c-maintenance { --c: var(--maint); }
.c-unknown, .c-notice { --c: var(--unknown); }

/* ---------- Responsive ---------- */
@media (max-width: 680px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 16px; }
  .brand img { height: 36px; }
  .brand-name { font-size: 19px; }
  .brand-tag { display: none; }
  .nav-link { display: none; }
  .hero { padding: 20px; gap: 16px; margin-top: 18px; align-items: flex-start; }
  .hero-icon { width: 48px; height: 48px; border-radius: 13px; }
  .hero-icon svg { width: 25px; height: 25px; }
  .group-head, .comp, .support, .panel { padding-left: 16px; padding-right: 16px; }
  .inc { padding: 18px 16px 16px 20px; }
  .inc-head { flex-direction: column-reverse; gap: 8px; }
  .comp-row { align-items: flex-start; }
  .comp-desc { display: none; }
  .bars .bar:nth-child(-n+60) { display: none; }
  .bars { gap: 3px; }
  .d90 { display: none; }
  .d30 { display: inline; }
  .section-head .section-link.d90 { display: none; }
  .support { flex-direction: column; align-items: flex-start; }
  .support-actions { justify-content: flex-start; }
  .menu { width: min(290px, calc(100vw - 32px)); }
  .row2 { grid-template-columns: 1fr; }
  .tbl th:nth-child(3), .tbl td:nth-child(3) { display: none; }
}
