/*
  unchanged.fyi — status visual canon

  Notes:
  - Document-first layout
  - Minimal motion
  - Flat components (no elevation)
  - One accent color
  - Administrative semantics (no "happy" green)
*/

:root {
  /* Primary palette */
  --bg: #f6f7f8;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #d1d5db;

  /* Semantics (administrative) */
  --operational: #4b5563; /* intentionally not green */
  --investigating: #9ca3af;
  --degraded: #b45309; /* brown-orange, not red */
  --unchanged: #374151;

  /* Accent (choose exactly one) */
  --accent: #64748b;

  /* Layout */
  --container: 980px;
  --radius: 6px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;

  /* Typography */
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Focus */
  --focus: 2px solid var(--accent);
}

:root[data-theme="dark"] {
  --bg: #0b0f14;
  --surface: #0f1720;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #273142;

  --operational: #94a3b8;
  --investigating: #64748b;
  --degraded: #d97706;
  --unchanged: #cbd5e1;

  --accent: #94a3b8;

  --focus: 2px solid var(--accent);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: var(--radius);
}

.skip-link:focus {
  left: 10px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-row {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-6) 0 var(--space-4);
}

.header-title .kicker {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.header-title .title {
  margin: 6px 0 0 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 600;
}

.header-meta {
  min-width: 260px;
}

.meta-line {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  justify-content: space-between;
  padding: 3px 0;
}

.meta-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.meta-value {
  font-size: 14px;
  color: var(--text);
}

.toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  cursor: pointer;
}

.toggle:hover {
  border-color: var(--accent);
}

.toggle:active {
  transform: translateY(1px);
}

.lede {
  margin: 0 0 var(--space-6) 0;
  color: var(--muted);
  max-width: 72ch;
}

.site-main {
  padding: var(--space-6) 0 var(--space-6);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 var(--space-5) 0;
  overflow: hidden;
}

.card-header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.card-subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}

.card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.note {
  font-size: 14px;
  color: var(--text);
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  padding: var(--space-5);
}

.summary-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  background: var(--surface);
}

.summary-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.summary-value {
  margin-top: 8px;
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

.table-wrap {
  padding: var(--space-5);
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.cell-strong {
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  line-height: 1.6;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface);
  color: var(--text);
}

.badge-operational {
  border-color: rgba(75, 85, 99, 0.35);
  color: var(--operational);
}

.badge-investigating {
  border-color: rgba(156, 163, 175, 0.5);
  color: var(--investigating);
}

.badge-degraded {
  border-color: rgba(180, 83, 9, 0.35);
  color: var(--degraded);
}

.badge-unchanged {
  border-color: rgba(55, 65, 81, 0.4);
  color: var(--unchanged);
}

.actions {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: not-allowed;
}

.button[disabled] {
  opacity: 0.6;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 var(--space-5);
}

.timeline-item {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-meta {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.timeline-body {
  margin-top: var(--space-3);
}

.timeline-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.timeline-text {
  font-size: 14px;
  max-width: 85ch;
}

.details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--space-3) var(--space-4);
}

.details summary {
  cursor: pointer;
  font-weight: 600;
}

.details-body {
  margin-top: var(--space-3);
}

.details-body p {
  margin: 0 0 var(--space-3) 0;
}

.stack {
  padding: var(--space-5);
  display: grid;
  gap: var(--space-4);
}

.stack-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--space-4);
  align-items: start;
}

.label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 2px;
}

.value {
  font-size: 14px;
}

.badges {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.type-sample .type-h {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.type-sample .type-p {
  margin-bottom: 6px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-6) 0;
}

.footer-row {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.footer-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.fineprint {
  margin-top: var(--space-5);
  font-size: 12px;
  max-width: 90ch;
}

/* Responsive */
@media (max-width: 900px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-row {
    flex-direction: column;
    gap: var(--space-4);
  }

  .header-meta {
    min-width: unset;
  }
}

@media (max-width: 520px) {
  .container {
    padding: 0 var(--space-4);
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .stack-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toggle:active {
    transform: none;
  }
}