/* Talkspike status page. Tokens follow the app (app/globals.css): paper
   #FCFCF8, charcoal #17221C, orange fills #D63F0C with white text (4.6:1),
   orange text #B83A12, the logo's #FF5C2B for the mark only. */

:root {
  --ink: #fcfcf8;
  --surface: #ffffff;
  --raised: #f4f7f4;
  --body: #17221c;
  --muted: #55615a;
  --faint: #6f7a73;
  --line: #dde6df;
  --line-strong: #c6d2c9;
  --brand: #ff5c2b;
  --accent: #d63f0c;
  --accent-soft: #c2380a;
  --accent-text: #b83a12;
  --on-accent: #ffffff;
  --st-operational: #2f7d32;
  /* Each state colour is AA (4.5:1) as text on its own tint and under
     white text in the round overall icon. */
  --st-degraded: #a35f00;
  --st-partial: #b8461a;
  --st-major: #c0283a;
  --st-maintenance: #2b6cb0;
  --st-unknown: #8a948d;
  --st-none: #e3e9e4;
  --bg-operational: #eef7ef;
  --bg-degraded: #fdf5e6;
  --bg-partial: #fdeee6;
  --bg-major: #fbe9ec;
  --bg-maintenance: #eaf2fb;
  --bg-unknown: #f1f3f1;
  --shadow: 0 1px 2px rgba(23, 34, 28, 0.05), 0 4px 16px rgba(23, 34, 28, 0.05);
  --radius: 16px;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #101511;
    --surface: #161d18;
    --raised: #1b241e;
    --body: #eef2ef;
    --muted: #a8b4ac;
    --faint: #8d9a92;
    --line: #26322a;
    --line-strong: #344238;
    --accent-text: #ff8a5c;
    --st-operational: #6cc070;
    --st-degraded: #e8a33d;
    --st-partial: #ff8a5c;
    --st-major: #ff6b78;
    --st-maintenance: #79a8e8;
    --st-unknown: #7e8a82;
    --st-none: #26322a;
    --bg-operational: #15261a;
    --bg-degraded: #2a2214;
    --bg-partial: #2c1c14;
    --bg-major: #2c1519;
    --bg-maintenance: #142030;
    --bg-unknown: #1b211d;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #101511;
  --surface: #161d18;
  --raised: #1b241e;
  --body: #eef2ef;
  --muted: #a8b4ac;
  --faint: #8d9a92;
  --line: #26322a;
  --line-strong: #344238;
  --accent-text: #ff8a5c;
  --st-none: #26322a;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  margin: 0;
  background: var(--ink);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent-text);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
  border-radius: 6px;
}
.wrap {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 16px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus {
  left: 8px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}

/* Header */
.top {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--body);
  text-decoration: none;
}
.mark {
  width: 30px;
  height: 30px;
  color: var(--brand);
}
.word {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 18px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 1px 8px;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  font-size: 13.5px;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 0;
}
.nav a:hover {
  color: var(--body);
}
.nav .nav-cta {
  color: var(--accent-text);
  font-weight: 600;
}

/* Overall */
.hero {
  padding: 36px 0 8px;
}
.overall {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.overall h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 30px);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.overall p {
  margin: 4px 0 0;
  font-size: 14px;
}
.overall-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  background: var(--st-unknown);
  font-size: 20px;
}
.overall.st-operational {
  background: var(--bg-operational);
  border-color: color-mix(in srgb, var(--st-operational) 30%, transparent);
}
.overall.st-operational .overall-icon {
  background: var(--st-operational);
}
.overall.st-degraded {
  background: var(--bg-degraded);
  border-color: color-mix(in srgb, var(--st-degraded) 35%, transparent);
}
.overall.st-degraded .overall-icon {
  background: var(--st-degraded);
}
.overall.st-partial {
  background: var(--bg-partial);
  border-color: color-mix(in srgb, var(--st-partial) 35%, transparent);
}
.overall.st-partial .overall-icon {
  background: var(--st-partial);
}
.overall.st-major {
  background: var(--bg-major);
  border-color: color-mix(in srgb, var(--st-major) 40%, transparent);
}
.overall.st-major .overall-icon {
  background: var(--st-major);
}
.overall.st-maintenance {
  background: var(--bg-maintenance);
}
.overall.st-maintenance .overall-icon {
  background: var(--st-maintenance);
}
.overall.st-unknown {
  background: var(--bg-unknown);
}
.overall-loading .overall-icon {
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}
@media (prefers-reduced-motion: reduce) {
  .overall-loading .overall-icon {
    animation: none;
  }
}

.notice {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
}
.notice-warn {
  border-color: color-mix(in srgb, var(--st-degraded) 45%, transparent);
  background: var(--bg-degraded);
}
.notice-bad {
  border-color: color-mix(in srgb, var(--st-major) 45%, transparent);
  background: var(--bg-major);
}

/* Sections */
section {
  scroll-margin-top: 80px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: -0.015em;
  margin: 36px 0 12px;
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--st-unknown);
}
.st-operational.dot,
.bar.st-operational {
  background: var(--st-operational);
}
.st-degraded.dot,
.bar.st-degraded {
  background: var(--st-degraded);
}
.st-partial.dot,
.bar.st-partial {
  background: var(--st-partial);
}
.st-major.dot,
.bar.st-major {
  background: var(--st-major);
}
.st-maintenance.dot,
.bar.st-maintenance {
  background: var(--st-maintenance);
}
.st-unknown.dot,
.bar.st-unknown {
  background: var(--st-unknown);
}
.st-none.dot,
.bar.st-none {
  background: var(--st-none);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 6px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  white-space: nowrap;
}
.pill.st-operational {
  color: var(--st-operational);
  border-color: color-mix(in srgb, var(--st-operational) 40%, transparent);
  background: var(--bg-operational);
}
.pill.st-degraded {
  color: var(--st-degraded);
  border-color: color-mix(in srgb, var(--st-degraded) 45%, transparent);
  background: var(--bg-degraded);
}
.pill.st-partial {
  color: var(--st-partial);
  border-color: color-mix(in srgb, var(--st-partial) 45%, transparent);
  background: var(--bg-partial);
}
.pill.st-major {
  color: var(--st-major);
  border-color: color-mix(in srgb, var(--st-major) 45%, transparent);
  background: var(--bg-major);
}
.pill.st-maintenance {
  color: var(--st-maintenance);
  border-color: color-mix(in srgb, var(--st-maintenance) 40%, transparent);
  background: var(--bg-maintenance);
}
.affected {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}
.timeline {
  list-style: none;
  margin: 12px 0 0;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.timeline time,
.timeline .when {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
}
.timeline p {
  margin: 2px 0 0;
  white-space: pre-line;
  font-size: 14px;
}
.timeline strong {
  font-size: 13px;
}

/* Components */
.groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.group {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.group-title {
  margin: 0;
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
  background: var(--raised);
}
.component-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.component {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.component:last-child {
  border-bottom: 0;
}
.component-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.component-name {
  font-weight: 600;
  font-size: 15px;
  margin: 0;
}
.component-desc {
  margin: 1px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.bars {
  display: flex;
  gap: 2px;
  height: 30px;
  margin-top: 12px;
}
.bar {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px;
  background: var(--st-none);
}
.bar:hover {
  opacity: 0.75;
}
.bars-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.uptimes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.uptimes b {
  font-weight: 500;
  color: var(--body);
}
.d-mobile {
  display: none;
}
@media (max-width: 640px) {
  .bar.older {
    display: none;
  }
  .d-desktop {
    display: none;
  }
  .d-mobile {
    display: inline;
  }
  .component-head {
    flex-direction: column;
    gap: 6px;
  }
}
.skeleton {
  height: 168px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--raised), var(--line), var(--raised));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
}
.footnote {
  margin: 12px 2px 0;
  font-size: 12.5px;
}

/* History */
.history {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.day {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.day h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--faint);
}
.day p.none {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.incident-row summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 6px 0;
}
.incident-row summary::-webkit-details-marker {
  display: none;
}
.incident-row summary .t {
  font-weight: 600;
  color: var(--body);
}
.incident-row summary .d {
  font-size: 12.5px;
  color: var(--muted);
}
.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* Subscribe */
.subscribe {
  margin-top: 36px;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 4px 20px 20px;
  box-shadow: var(--shadow);
}
@media (min-width: 760px) {
  .subscribe {
    grid-template-columns: 1fr 1fr;
    align-items: end;
    padding: 4px 24px 24px;
  }
}
.label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}
.row {
  display: flex;
  gap: 8px;
}
.row input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--body);
  padding: 0 14px;
  font: inherit;
}
.btn {
  height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  font: inherit;
  font-weight: 600;
  color: var(--on-accent);
  background: linear-gradient(180deg, var(--accent), var(--accent-soft));
  cursor: pointer;
}
.btn:hover {
  background: var(--accent-soft);
}
.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.checks {
  border: 0;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  gap: 16px;
  font-size: 14px;
}
.checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}
.checks input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}
.ok {
  color: var(--st-operational);
}
.bad {
  color: var(--st-major);
}

.how ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}
.how strong {
  color: var(--body);
}

/* Footer */
.foot {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  padding: 20px 0 36px;
  font-size: 13px;
  color: var(--muted);
}
.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.foot a {
  color: var(--muted);
}

/* Subscription page */
.panel-center {
  max-width: 480px;
  margin: 64px auto;
}
