/* ─────────────────────────────────────────────────────────────────────────
 * CCTools Status — editorial, refined, light.
 *
 * Aesthetic direction:
 *  - Pure single-column editorial layout. Generous whitespace.
 *  - Fraunces variable serif (display) — distinctive, expressive opsz.
 *  - DM Sans (body) — modern, characterful, never feels generic.
 *  - JetBrains Mono (data) — anchor cctools brand familiarity.
 *  - Off-white warm background (#fcfcf9) — softer than pure #fff.
 *  - Single accent color (status-driven). Everything else neutral.
 *  - Subtle horizontal rules instead of card boxes — feels like a
 *    morning paper status section, not a SaaS dashboard.
 * ───────────────────────────────────────────────────────────────────────── */

:root {
  /* Warm off-white paper */
  --bg: #fcfcf9;
  --bg-soft: #f6f5f0;
  --paper-grain: rgba(0, 0, 0, 0.02);

  /* Text — slight warm tint, never pure black */
  --ink: #1a1a17;
  --ink-soft: #4a4a45;
  --ink-mute: #88857d;
  --ink-faint: #b8b5ac;

  /* Hairline rules */
  --rule: rgba(0, 0, 0, 0.08);
  --rule-strong: rgba(0, 0, 0, 0.16);

  /* Status accents — light-bg tuned */
  --green: #1d7c3f;
  --green-soft: #2f9c54;
  --green-dim: #ebf6ee;
  --green-edge: #c0e3c9;

  --amber: #946800;
  --amber-soft: #b8842f;
  --amber-dim: #fbf3df;
  --amber-edge: #ead49b;

  --red: #b32625;
  --red-soft: #d44946;
  --red-dim: #fbeaea;
  --red-edge: #ecbbb9;

  /* Fonts */
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

/* ── Reset + base ─────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(var(--paper-grain) 1px, transparent 1px);
  background-size: 4px 4px;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  font-feature-settings: "ss01" 1, "ss02" 1;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.12s ease;
}
a:hover { opacity: 0.65; }

ul { list-style: none; padding: 0; margin: 0; }

code, .mono { font-family: var(--font-mono); }

/* ── Page wrapper ─────────────────────────────────────────────────────────── */

.page {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 32px 96px;
}

@media (max-width: 640px) {
  .page { padding: 28px 22px 64px; }
}

/* ── Masthead ─────────────────────────────────────────────────────────────── */

.masthead {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  padding-bottom: 20px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-weight: 600;
}

.brand-dot {
  width: 7px;
  height: 7px;
  background: var(--ink);
  border-radius: 50%;
}

.masthead-sep { color: var(--ink-faint); }
.masthead-section { color: var(--ink-soft); }
.masthead-date { margin-left: auto; color: var(--ink-faint); }

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  margin-bottom: 88px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--bg);
  margin-bottom: 28px;
  transition: all 0.2s ease;
}

.hero-eyebrow.s-operational {
  border-color: var(--green-edge);
  background: var(--green-dim);
  color: var(--green);
}
.hero-eyebrow.s-degraded {
  border-color: var(--amber-edge);
  background: var(--amber-dim);
  color: var(--amber);
}
.hero-eyebrow.s-major_outage {
  border-color: var(--red-edge);
  background: var(--red-dim);
  color: var(--red);
}
.hero-eyebrow.s-initializing {
  border-color: var(--rule-strong);
  background: var(--bg-soft);
  color: var(--ink-soft);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
}

.dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.25;
  animation: ring 2.2s ease-out infinite;
}

@keyframes ring {
  0%   { transform: scale(0.4); opacity: 0.45; }
  100% { transform: scale(1.8); opacity: 0; }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 96, "SOFT" 50, "WONK" 0;
  font-size: clamp(40px, 8vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 18px 0;
}

.hero-title em {
  font-style: italic;
  font-variation-settings: "opsz" 96, "SOFT" 100, "WONK" 1;
}

.hero-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-mute);
  margin: 0;
}

.hero-meta strong { color: var(--ink-soft); font-weight: 500; }

/* ── Section heads ────────────────────────────────────────────────────────── */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--rule);
}

h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 24, "SOFT" 30;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}

.section-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ── Services list ────────────────────────────────────────────────────────── */

.services { margin-bottom: 64px; }

.service-list {
  display: flex;
  flex-direction: column;
}

.service-row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
  transition: padding-left 0.2s ease;
}

.service-row:last-child { border-bottom: 0; }
.service-row:hover { padding-left: 4px; }
.service-row.svc-row-loading {
  grid-template-columns: 1fr;
  color: var(--ink-mute);
  font-style: italic;
}

.svc-bullet {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  position: relative;
  margin-left: 2px;
}
.svc-bullet.s-operational { background: var(--green); }
.svc-bullet.s-degraded { background: var(--amber); }
.svc-bullet.s-major_outage { background: var(--red); }
.svc-bullet.s-unknown { background: var(--ink-faint); }

.svc-info { min-width: 0; }

.svc-name {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.svc-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  cursor: help;
}

.svc-desc {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.svc-stats {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-mute);
  text-align: right;
  white-space: nowrap;
}

.svc-stats .status-word {
  display: block;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 10px;
  margin-bottom: 2px;
}
.svc-stats .status-word.s-operational { color: var(--green); }
.svc-stats .status-word.s-degraded { color: var(--amber); }
.svc-stats .status-word.s-major_outage { color: var(--red); }
.svc-stats .status-word.s-unknown { color: var(--ink-faint); }

@media (max-width: 480px) {
  .service-row { grid-template-columns: 12px 1fr; }
  .svc-stats { grid-column: 2; text-align: left; margin-top: 6px; }
}

/* ── Incidents ────────────────────────────────────────────────────────────── */

.incidents { margin-bottom: 64px; }

.incidents-list {
  display: flex;
  flex-direction: column;
}

.incident-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.incident-item:last-child { border-bottom: 0; }

.incident-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.incident-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 14, "SOFT" 40;
  font-size: 17px;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
}
.tag.t-red { color: var(--red); background: var(--red-dim); border-color: var(--red-edge); }
.tag.t-amber { color: var(--amber); background: var(--amber-dim); border-color: var(--amber-edge); }
.tag.t-green { color: var(--green); background: var(--green-dim); border-color: var(--green-edge); }

.incident-body {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 8px 0;
  white-space: pre-wrap;
}

.incident-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  margin-top: 32px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 28px;
  row-gap: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.footer-links a { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px; }
.footer-links a:hover { text-decoration-color: var(--ink); }

.footer-note {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-mute);
}
.footer-note a { color: var(--ink-soft); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }

/* ── Offline notice — inline, not a banner ────────────────────────────────── */

.offline-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--amber);
  margin-left: 8px;
}

/* ── Motion ───────────────────────────────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero, .services, .incidents, .footer {
  animation: fadeUp 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.services { animation-delay: 0.06s; }
.incidents { animation-delay: 0.12s; }
.footer { animation-delay: 0.18s; }

@media (prefers-reduced-motion: reduce) {
  .hero, .services, .incidents, .footer,
  .dot::after { animation: none; }
}

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
  body { background: #fff; }
  .footer, .masthead-date { display: none; }
}
