/* Public status page — "Catbird Status" design.
   Values are copied from the design's inline styles and its SilentWitnessUI
   components (Badge, Button, SegmentedControl). */

/* Inter (SIL Open Font License 1.1, https://rsms.me/inter), variable 300–800. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/static/vendor/fonts/inter-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/static/vendor/fonts/inter-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Theme tokens. Dark is the default, as in the design. */
:root, :root[data-theme="dark"] {
  --sw-bg: #0b0f17; --sw-card: #111723; --sw-border: #1f2937;
  --sw-text: #f1f5f9; --sw-muted: #8b97a8; --sw-hover: #141b28;
}
:root[data-theme="light"] {
  --sw-bg: #f1f5f9; --sw-card: #ffffff; --sw-border: #e8ecf1;
  --sw-text: #1e293b; --sw-muted: #64748b; --sw-hover: #f8fafc;
}
:root { --sw-ok: #22c55e; --sw-mono: ui-monospace, SFMono-Regular, Menlo, monospace; }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--sw-ok); }
@keyframes sw-pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3); opacity: 0; } }
@keyframes sw-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.sw-page { min-height: 100vh; background: var(--sw-bg); color: var(--sw-text); transition: background .3s, color .3s; font-size: 14px; line-height: 1.5; }
.sw-mono { font-family: ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; }
.sw-muted { color: var(--sw-muted); }
.sw-strong { color: var(--sw-text); }

/* ── Header ── */
.sw-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--sw-border); background: var(--sw-bg); }
.sw-brand { display: flex; align-items: center; gap: 12px; }
.sw-brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.sw-brand-name span { font-weight: 400; color: var(--sw-muted); }
.sw-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
/* Buttons (Vercel-style pills that follow the theme). */
.sw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; border-radius: 9999px; font-size: 14px; line-height: 20px; font-weight: 500; height: 32px; padding: 0 14px; border: 1px solid transparent; transition: background-color .15s, color .15s, border-color .15s; }
.sw-btn:focus-visible { outline: 2px solid var(--sw-muted); outline-offset: 2px; }
.sw-btn-primary { background: var(--sw-text); color: var(--sw-bg); }
.sw-btn-primary:hover { background: var(--sw-text); color: var(--sw-bg); opacity: .88; }
.sw-btn-outline { border-color: var(--sw-border); background: transparent; color: var(--sw-text); }
.sw-btn-outline:hover { background: var(--sw-hover); border-color: var(--sw-muted); color: var(--sw-text); }
.sw-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Badge (SilentWitnessUI). */
.sw-badge { display: inline-flex; align-items: center; border-radius: 9999px; border: 1px solid transparent; padding: 2px 10px; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.sw-badge-success { background: rgb(220 252 231); color: rgb(22 101 52); }
.sw-badge-warning { background: rgb(254 249 195); color: rgb(133 77 14); }
.sw-badge-error { background: rgb(254 226 226); color: rgb(153 27 27); }
.sw-badge-neutral { background: hsl(240 4.8% 95.9%); color: hsl(240 5.9% 10%); }

/* ── Main list ── */
.sw-main { max-width: 960px; margin: 0 auto; padding: 56px 24px 80px; display: flex; flex-direction: column; gap: 56px; }
.sw-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: end; }
.sw-hero-copy { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sw-kicker { display: flex; align-items: center; gap: 12px; color: var(--sw-status); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.sw-pulse { position: relative; width: 10px; height: 10px; display: inline-block; flex: none; }
.sw-pulse span { position: absolute; inset: 0; border-radius: 50%; background: var(--sw-status); }
.sw-pulse span + span { animation: sw-pulse 1.8s ease-out infinite; }
.sw-hero h1 { margin: 0; font-size: clamp(34px, 5vw, 56px); line-height: 1.02; letter-spacing: -.035em; font-weight: 800; text-wrap: balance; }
.sw-hero p { margin: 0; color: var(--sw-muted); font-size: 16px; max-width: 52ch; text-wrap: pretty; }
.sw-lastcheck { display: flex; flex-direction: column; gap: 4px; text-align: right; font-family: var(--sw-mono); font-variant-numeric: tabular-nums; }
.sw-lastcheck-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--sw-muted); }
.sw-lastcheck-value { font-size: 28px; font-weight: 500; letter-spacing: -.02em; color: var(--sw-text); }
.sw-lastcheck-value .sw-ago { color: var(--sw-muted); font-size: 14px; }
.sw-lastcheck-sub { font-size: 12px; color: var(--sw-muted); }

.sw-section { display: flex; flex-direction: column; gap: 12px; }
.sw-section-head { display: flex; align-items: center; gap: 12px; }
.sw-section-title { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sw-muted); white-space: nowrap; }
.sw-rule { flex: 1; height: 1px; background: var(--sw-border); }
.sw-section-meta { font-size: 12px; color: var(--sw-muted); font-family: ui-monospace, Menlo, monospace; }

.sw-card { background: var(--sw-card); border: 1px solid var(--sw-border); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.03), 0 6px 16px rgba(0,0,0,.02); }
.sw-service { padding: 20px 24px; border-top: 1px solid var(--sw-border); display: flex; flex-direction: column; gap: 14px; position: relative; }
.sw-service:hover { background: var(--sw-hover); z-index: 10; }
.sw-service-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sw-service-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sw-service-name > span:first-child { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.sw-metrics { display: flex; align-items: center; gap: 20px; }
.sw-metric { font-family: ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; font-size: 13px; line-height: 1.2; text-align: right; }
.sw-metric span { color: var(--sw-muted); }
.sw-metric div + div { font-size: 11px; color: var(--sw-muted); }
.sw-metric + .sw-metric { padding-left: 20px; border-left: 1px solid var(--sw-border); }

.sw-bars-wrap { position: relative; }
.sw-bars { display: flex; gap: 2px; height: 30px; }
.sw-bar { flex: 1; border-radius: 2px; cursor: default; transition: transform .12s; }
.sw-bar:hover { transform: scaleY(1.18); opacity: 1 !important; }
.sw-bars-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--sw-muted); font-family: ui-monospace, Menlo, monospace; }
.sw-tip { position: absolute; top: 36px; transform: translateX(-50%); z-index: 50; pointer-events: none; animation: sw-fade .12s ease-out; background: var(--sw-text); color: var(--sw-bg); padding: 8px 12px; border-radius: 8px; font-size: 12px; line-height: 1.4; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.sw-tip-date { font-weight: 600; }
.sw-tip-label { display: flex; gap: 6px; align-items: center; }
.sw-tip-label i { width: 7px; height: 7px; border-radius: 50%; }
.sw-tip-detail { font-family: ui-monospace, Menlo, monospace; opacity: .75; }

/* ── Incident history ── */
.sw-history { display: grid; grid-template-columns: 120px 1fr; column-gap: 24px; }
.sw-history-row { display: contents; }
.sw-when { padding: 18px 0; font-family: ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--sw-muted); text-align: right; line-height: 1.5; }
.sw-when div:first-child { color: var(--sw-text); font-weight: 500; }
.sw-entry { display: block; position: relative; padding: 18px 0 18px 28px; border-left: 1px solid var(--sw-border); cursor: pointer; color: inherit; }
.sw-entry:hover { border-left-color: var(--sw-muted); color: inherit; }
.sw-dot { position: absolute; left: -5px; top: 24px; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 3px var(--sw-bg); }
.sw-entry-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.sw-entry-title { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.sw-entry-updates { font-size: 12px; color: var(--sw-muted); }
.sw-entry p { margin: 0 0 8px; color: var(--sw-muted); max-width: 64ch; text-wrap: pretty; }
.sw-entry-meta { font-size: 12px; color: var(--sw-muted); font-family: ui-monospace, Menlo, monospace; }
.sw-empty { color: var(--sw-muted); padding: 18px 0; }

/* ── Incident page ── */
.sw-detail { max-width: 760px; margin: 0 auto; padding: 40px 24px 80px; display: flex; flex-direction: column; gap: 40px; animation: sw-fade .2s ease-out; }
.sw-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sw-muted); width: fit-content; }
.sw-detail-head { display: flex; flex-direction: column; gap: 14px; }
.sw-detail-badges { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sw-detail h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.05; letter-spacing: -.03em; font-weight: 800; text-wrap: balance; }
.sw-detail-meta { display: flex; gap: 24px; flex-wrap: wrap; font-family: ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--sw-muted); }
.sw-updates { padding: 4px 24px; }
.sw-update { display: grid; grid-template-columns: 88px 1fr; column-gap: 20px; padding: 20px 0; border-top: 1px solid var(--sw-border); }
.sw-update-when { font-family: ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--sw-muted); text-align: right; line-height: 1.5; }
.sw-update-when div:first-child { color: var(--sw-text); font-weight: 500; }
.sw-update-body { position: relative; padding-left: 24px; border-left: 1px solid var(--sw-border); }
.sw-update-body .sw-dot { top: 5px; box-shadow: 0 0 0 3px var(--sw-card); }
.sw-stage { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }
.sw-update-body p { margin: 0; color: var(--sw-text); max-width: 60ch; text-wrap: pretty; }
.sw-rootcause { display: flex; flex-direction: column; gap: 8px; }
.sw-rootcause p { margin: 0; color: var(--sw-muted); max-width: 64ch; text-wrap: pretty; }

/* ── Footer ── */
.sw-footer { border-top: 1px solid var(--sw-border); padding: 24px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--sw-muted); max-width: 1008px; margin: 0 auto; }
.sw-footer-links { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.sw-footer-end { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* Theme switch (Vercel-style pill of icon buttons). */
.sw-theme-switch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--sw-border); border-radius: 9999px; background: var(--sw-bg); }
.sw-theme-switch button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 9999px; background: transparent; color: var(--sw-muted); cursor: pointer; transition: color .15s, background-color .15s; }
.sw-theme-switch button:hover { color: var(--sw-text); }
.sw-theme-switch button[aria-checked="true"] { background: var(--sw-card); color: var(--sw-text); box-shadow: 0 0 0 1px var(--sw-border); }
.sw-theme-switch button:focus-visible { outline: 2px solid var(--sw-muted); outline-offset: 1px; }
.sw-theme-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 640px) {
  .sw-hero { grid-template-columns: 1fr; }
  .sw-lastcheck { text-align: left; }
  .sw-history { grid-template-columns: 72px 1fr; column-gap: 16px; }
  .sw-update { grid-template-columns: 64px 1fr; column-gap: 14px; }
}
.sw-bar-unknown { background: var(--sw-border); }
