/* Public status page — standalone stylesheet, intentionally decoupled from
   the app's Tailwind bundle. Served as a static asset so it works under the
   strict CSP (style-src 'self'; inline <style> blocks are blocked).
   Themes are CSS variables on the <body> class; adding a theme never
   requires an asset rebuild beyond this file. */

/* ── Themes ─────────────────────────────────────────────────── */
:root { color-scheme: dark; }
.theme-dark {
  --bg: #0a0c10;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-border: rgba(255, 255, 255, 0.09);
  --panel-highlight: rgba(255, 255, 255, 0.07);
  --text: #f2f5f4; --muted: #99a5a0; --faint: #5f6a64;
  --ok: #36f59f; --down: #ff5d5d; --degraded: #ffc24b;
  --empty: rgba(255, 255, 255, 0.08);
  --grid: rgba(255, 255, 255, 0.045);
  --shadow: rgba(0, 0, 0, 0.55);
  --aurora: 18%;
}
.theme-light {
  color-scheme: light;
  --bg: #faf8f3;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-border: #e5dfd2;
  --panel-highlight: rgba(255, 255, 255, 0.9);
  --text: #1d201e; --muted: #6d7570; --faint: #a3aaa5;
  --ok: #0b9e6b; --down: #d84046; --degraded: #c98708;
  --empty: #e9e3d6;
  --grid: rgba(29, 32, 30, 0.055);
  --shadow: rgba(58, 48, 28, 0.16);
  --aurora: 13%;
}
.theme-ocean {
  --bg: #050d1c;
  --panel: rgba(125, 195, 255, 0.05);
  --panel-border: rgba(125, 195, 255, 0.14);
  --panel-highlight: rgba(190, 230, 255, 0.1);
  --text: #e8f4ff; --muted: #7e9cb8; --faint: #4c6580;
  --ok: #35d6ff; --down: #ff6b8a; --degraded: #ffc24b;
  --empty: rgba(126, 156, 184, 0.18);
  --grid: rgba(126, 176, 255, 0.05);
  --shadow: rgba(0, 4, 18, 0.6);
  --aurora: 20%;
}
.theme-sunset {
  --bg: #170a13;
  --panel: rgba(255, 173, 122, 0.05);
  --panel-border: rgba(255, 173, 122, 0.16);
  --panel-highlight: rgba(255, 210, 170, 0.09);
  --text: #ffeede; --muted: #c39b8e; --faint: #7d6058;
  --ok: #ffa14f; --down: #ff4d6d; --degraded: #ffd166;
  --empty: rgba(255, 173, 122, 0.14);
  --grid: rgba(255, 173, 122, 0.05);
  --shadow: rgba(20, 2, 12, 0.6);
  --aurora: 16%;
}

/* The live state tints the whole page: beacon, aurora, headline accents. */
.state-ok      { --signal: var(--ok); }
.state-down    { --signal: var(--down); }
.state-unknown { --signal: var(--muted); }

/* ── Base ───────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
  position: relative; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* Status-tinted aurora */
body::before {
  content: ""; position: fixed; left: -15%; right: -15%; top: -30vh; height: 90vh;
  background: radial-gradient(ellipse 55% 55% at 50% 30%,
    color-mix(in oklab, var(--signal) var(--aurora), transparent), transparent 72%);
  pointer-events: none; z-index: 0;
}
/* Blueprint grid, fading out down the page */
body::after {
  content: ""; position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 70%);
  mask-image: linear-gradient(to bottom, black, transparent 70%);
  pointer-events: none; z-index: 0;
}
a { color: inherit; }
.mono { font-family: "JetBrains Mono", monospace; }

.container {
  width: 100%; max-width: 780px; margin: 0 auto;
  padding: 44px 22px 56px; flex: 1; position: relative; z-index: 1;
}

/* ── Load choreography ──────────────────────────────────────── */
.reveal { opacity: 0; animation: reveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.reveal.d1 { animation-delay: 70ms; }
.reveal.d2 { animation-delay: 140ms; }
.reveal.d3 { animation-delay: 210ms; }
.reveal.d4 { animation-delay: 280ms; }
@keyframes reveal { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── Masthead ───────────────────────────────────────────────── */
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 52px; }
.identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.identity img { max-height: 36px; max-width: 160px; display: block; }
.identity .domain-name { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-chip {
  font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 600;
  letter-spacing: 0.22em; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border: 1px solid var(--panel-border); border-radius: 999px;
  background: var(--panel); white-space: nowrap;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 8px var(--signal); animation: blink 2.2s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ── Hero ───────────────────────────────────────────────────── */
.hero { display: flex; align-items: center; gap: 26px; margin-bottom: 48px; }
.hero h1 {
  font-size: clamp(28px, 5.4vw, 42px); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.05;
  text-wrap: balance;
}
.hero-sub { font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.6; }

.beacon { position: relative; width: 66px; height: 66px; flex-shrink: 0; }
.beacon .core {
  position: absolute; inset: 50%; width: 18px; height: 18px; margin: -9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in oklab, var(--signal) 35%, white), var(--signal) 65%);
  box-shadow: 0 0 18px var(--signal), 0 0 44px color-mix(in oklab, var(--signal) 55%, transparent);
  animation: breathe 2.6s ease-in-out infinite;
}
.beacon .ring {
  position: absolute; inset: 50%; width: 22px; height: 22px; margin: -11px;
  border-radius: 50%; border: 1.5px solid var(--signal);
  animation: ring 2.6s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
}
.beacon .ring:nth-child(2) { animation-delay: -1.3s; }
.state-down .beacon .core, .state-down .beacon .ring { animation-duration: 1.5s; }
.state-down .beacon .ring:nth-child(2) { animation-delay: -0.75s; }
@keyframes ring { from { transform: scale(0.7); opacity: 0.9; } to { transform: scale(3.1); opacity: 0; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* ── Panels ─────────────────────────────────────────────────── */
.panel {
  background: linear-gradient(180deg, color-mix(in oklab, var(--panel-highlight) 35%, var(--panel)), var(--panel) 28%);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  box-shadow: 0 30px 60px -30px var(--shadow), inset 0 1px 0 var(--panel-highlight);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-bottom: 22px;
}

/* ── Metrics ────────────────────────────────────────────────── */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); }
.metric { padding: 26px 14px 22px; text-align: center; position: relative; }
.metric + .metric::before {
  content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px;
  background: var(--panel-border);
}
.metric .value {
  font-family: "JetBrains Mono", monospace; font-size: clamp(20px, 3.4vw, 27px);
  font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
  transition: text-shadow 0.25s ease;
}
.metric:hover .value { text-shadow: 0 0 18px color-mix(in oklab, var(--signal) 65%, transparent); }
.metric .label {
  font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-top: 9px;
}
.metric .tick { display: block; width: 26px; height: 2px; margin: 12px auto 0; border-radius: 2px; background: color-mix(in oklab, var(--signal) 70%, transparent); }

/* ── History ────────────────────────────────────────────────── */
.history { padding: 24px 26px 22px; }
.history-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.history-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.history-head .sub-label { font-family: "JetBrains Mono", monospace; color: var(--faint); font-size: 11px; font-weight: 400; }
.legend { display: flex; gap: 16px; }
.legend span { font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; }
.legend .l-ok i { background: var(--ok); }
.legend .l-degraded i { background: var(--degraded); }
.legend .l-down i { background: var(--down); }

.bars { display: flex; gap: 3px; height: 46px; }
.bars span {
  flex: 1; min-width: 2px; border-radius: 3px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--c, var(--empty)) 80%, white) -40%, var(--c, var(--empty)) 55%);
  transform-origin: bottom;
  animation: rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 300ms;
  transition: transform 0.15s ease, filter 0.15s ease;
}
/* Staggered ripple across the strip, CSP-safe (no inline indexes):
   ten phase buckets repeating left to right. */
.bars span:nth-child(10n+2) { animation-delay: 330ms; }
.bars span:nth-child(10n+3) { animation-delay: 360ms; }
.bars span:nth-child(10n+4) { animation-delay: 390ms; }
.bars span:nth-child(10n+5) { animation-delay: 420ms; }
.bars span:nth-child(10n+6) { animation-delay: 450ms; }
.bars span:nth-child(10n+7) { animation-delay: 480ms; }
.bars span:nth-child(10n+8) { animation-delay: 510ms; }
.bars span:nth-child(10n+9) { animation-delay: 540ms; }
.bars span:nth-child(10n)   { animation-delay: 570ms; }
.bars span:hover { transform: scaleY(1.12); filter: brightness(1.25); }
.bar-ok       { --c: var(--ok); }
.bar-degraded { --c: var(--degraded); }
.bar-down     { --c: var(--down); }
.bar-empty    { --c: var(--empty); }
@keyframes rise { from { transform: scaleY(0); } }

.axis { display: flex; justify-content: space-between; margin-top: 10px; }
.axis span { font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: 0.08em; color: var(--faint); }

/* ── Incident updates timeline ──────────────────────────────── */
.updates { padding: 24px 26px 14px; }
.updates .history-head { margin-bottom: 16px; }
.updates-list { list-style: none; }
.updates-list li { position: relative; padding: 0 0 20px 28px; }
/* Connecting rail between timeline dots */
.updates-list li::before {
  content: ""; position: absolute; left: 5px; top: 16px; bottom: 2px; width: 1px;
  background: var(--panel-border);
}
.updates-list li:last-child::before { display: none; }
.updates-list .u-dot {
  position: absolute; left: 0; top: 4px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--k);
  box-shadow: 0 0 10px color-mix(in oklab, var(--k) 55%, transparent);
}
.u-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 5px; }
.u-kind {
  font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--k);
}
.u-time { font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--faint); }
.updates-list p { font-size: 13.5px; line-height: 1.65; white-space: pre-line; }
.k-investigating { --k: var(--down); }
.k-identified, .k-monitoring { --k: var(--degraded); }
.k-resolved { --k: var(--ok); }
.k-update { --k: var(--muted); }

/* ── Meta & footer ──────────────────────────────────────────── */
.meta-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 0 6px; }
.meta-row span { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted); line-height: 1.7; }
.meta-row .mono-strong { color: var(--text); }

footer { text-align: center; padding: 26px 20px 34px; position: relative; z-index: 1; }
footer p {
  font-family: "JetBrains Mono", monospace; font-size: 10.5px; letter-spacing: 0.06em;
  color: var(--faint);
}
footer a { color: var(--muted); text-decoration-color: var(--faint); text-underline-offset: 3px; }
footer a:hover { color: var(--text); }

/* ── Responsive & motion ────────────────────────────────────── */
@media (max-width: 560px) {
  .hero { gap: 18px; margin-bottom: 38px; }
  .beacon { width: 52px; height: 52px; }
  .masthead { margin-bottom: 40px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(3)::before { display: none; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--panel-border); }
  .bars { gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .bars span { animation: none; opacity: 1; }
  .beacon .ring, .beacon .core, .live-dot { animation: none; }
}
