:root {
  --bg: #eef1f4;
  --bg-spot: #dfe7ee;
  --card: #fbfcfd;
  --ink: #12161c;
  --mute: #5c6570;
  --faint: #8b949e;
  --line: #e2e8ee;
  --soft: #f3f5f7;
  --ok: #0c9a6e;
  --ok-soft: #d9f6ea;
  --warn: #c67a12;
  --bad: #dc3b4a;
  --info: #2b6cb0;
  --backup: #0f766e;
  --display: "Sora", system-ui, sans-serif;
  --sans: "Figtree", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --max: 800px;
  --r: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background:
    radial-gradient(1200px 420px at 12% -10%, color-mix(in srgb, var(--ok) 14%, transparent), transparent 60%),
    radial-gradient(900px 380px at 110% 0%, var(--bg-spot), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.is-down {
  background:
    radial-gradient(1200px 420px at 12% -10%, color-mix(in srgb, var(--bad) 16%, transparent), transparent 60%),
    radial-gradient(900px 380px at 110% 0%, var(--bg-spot), transparent 55%),
    var(--bg);
}
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, select, textarea, input { font: inherit; color: inherit; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 9; background: #111; color: #fff; padding: 6px 12px; border-radius: 6px; }

.top, #app, .foot { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 26px 0 20px; }
.brand {
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.02rem;
  letter-spacing: -0.04em;
}
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: var(--mute); font-size: 0.92rem; font-weight: 600; }
.nav a:hover { color: var(--ink); }
#app { padding-bottom: 56px; display: block; }

.hero { padding: 8px 0 26px; animation: rise 0.55s ease both; }
.hero h1 {
  font-family: var(--display);
  font-size: clamp(1.85rem, 4.4vw, 2.4rem);
  font-weight: 650;
  letter-spacing: -0.045em;
  display: flex;
  align-items: center;
  gap: 14px;
  line-height: 1.12;
}
.hero h1 .dot {
  width: 13px; height: 13px; border-radius: 50%; flex: none;
  background: var(--c, var(--ok));
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--c, var(--ok)) 16%, transparent);
  animation: beacon 2.6s ease-in-out infinite;
}
.hero .lede {
  margin-top: 12px;
  color: var(--mute);
  max-width: 46ch;
  font-size: 1.02rem;
}

.banner, .card {
  animation: rise 0.6s ease both;
}
.banner { animation-delay: 0.05s; }
.now { animation-delay: 0.1s; }
.history-card { animation-delay: 0.18s; }
.contact { animation-delay: 0.26s; }

body.ready .hero,
body.ready .banner,
body.ready .card,
body.ready .page,
body.ready .uptime-bar {
  animation: none;
}

.banner {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--c, var(--bad));
  border-radius: var(--r);
  padding: 18px 20px 16px;
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(18, 22, 28, 0.04);
}
.banner .kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c, var(--bad));
  font-weight: 500;
  margin-bottom: 6px;
}
.banner h2 { font-family: var(--display); font-size: 1.18rem; font-weight: 650; letter-spacing: -0.03em; margin-bottom: 6px; }
.banner .impact { color: #4b5563; margin-bottom: 12px; }
.banner .times {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-family: var(--mono); font-size: 0.78rem; color: var(--mute); margin-bottom: 14px;
}
.banner .times b { color: var(--ink); font-weight: 500; }

.down-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.down-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--soft); border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.down-row:first-child { border-top: 0; }
.down-row .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--bad)); flex: none; }
.down-row .name { font-weight: 600; }
.down-row .err { margin-left: auto; color: var(--mute); font-size: 0.8rem; }
.note { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: 0.88rem; color: #374151; }
.note .lbl { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); margin-bottom: 3px; }
.more-link { display: inline-block; margin-top: 12px; margin-right: 18px; font-weight: 650; font-size: 0.9rem; border-bottom: 1px solid var(--ink); }

.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(18, 22, 28, 0.04);
}
.card-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px 18px 8px;
}
.card-head h2 { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); }
.card-head .range { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); }

.now {
  border-left: 3px solid var(--c, var(--ok));
}
.now-copy { padding: 0 18px 10px; color: var(--mute); font-size: 0.9rem; max-width: 64ch; }
.strip-note { padding: 8px 18px 14px; color: var(--faint); font-size: 0.75rem; }

.history-card {
  background: #f4f6f8;
  box-shadow: none;
  border-left: 3px solid #c5ccd4;
}
.history-card .recent-item { padding: 12px 18px; }
.history-card .see-all { margin: 4px 0 0; padding: 8px 18px 16px; }

.contact-copy, .contact-warn { padding: 0 18px 10px; color: var(--mute); font-size: 0.92rem; max-width: 58ch; }
.contact-warn { color: #9a3412; }
.mails { display: grid; }
.mail-row {
  display: grid;
  grid-template-columns: 158px 1fr auto;
  grid-template-areas: "kind addr copy" "kind hint copy";
  gap: 0 12px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.mail-row:hover { background: var(--soft); }
.mail-row .kind { grid-area: kind; font-weight: 650; font-size: 0.88rem; display: flex; flex-direction: column; gap: 4px; }
.mail-row .kind em {
  font-style: normal;
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--backup);
  font-weight: 700;
}
.mail-row .addr { grid-area: addr; font-family: var(--mono); font-size: 0.82rem; }
.mail-row .hint { grid-area: hint; color: var(--faint); font-size: 0.78rem; }
.mail-row .copy { grid-area: copy; color: var(--faint); align-self: center; display: inline-flex; align-items: center; gap: 6px; }
.mail-row .copy .hi { width: 16px; height: 16px; }
.mail-row .copied-lbl { opacity: 0; font-size: 0.72rem; font-weight: 700; color: var(--ok); }
.mail-row.copied .copied-lbl { opacity: 1; }
.mail-row.copied .hi { color: var(--ok); }
.mail-row.backup { background: color-mix(in srgb, var(--backup) 6%, var(--card)); }
.contact.mail-down .mail-row.backup { background: color-mix(in srgb, var(--backup) 12%, var(--card)); }

.group { display: block; border-top: 1px solid var(--line); }
.group:first-of-type { border-top: 0; }
.group summary { list-style: none; cursor: pointer; padding: 12px 18px 14px; }
.group summary::-webkit-details-marker { display: none; }
.group-row { display: flex; align-items: center; gap: 8px; }
.group-row .dot, .part .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ok)); flex: none; }
.group-row .name { font-weight: 650; }
.group-row .hi { width: 20px; height: 20px; flex: none; color: var(--ink); }
.group-row .who { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.group-row .does { color: var(--faint); font-size: 0.8rem; font-weight: 450; }
.group-row .st { margin-left: auto; font-weight: 650; font-size: 0.88rem; color: var(--c, var(--ok)); }
.problem { color: var(--bad); font-size: 0.9rem; margin: 8px 0 0; max-width: 58ch; }
.group-row .count { color: var(--faint); font-size: 0.82rem; }
.group-row .uptime { margin-left: auto; font-family: var(--mono); font-size: 0.8rem; color: var(--mute); }
.group-row .chev { color: var(--faint); font-size: 0.7rem; transition: transform 0.2s ease; }
.group[open] .chev { transform: rotate(180deg); }
.group summary:hover { background: color-mix(in srgb, var(--soft) 70%, transparent); }

.uptime-bar { display: flex; gap: 1px; height: 12px; margin-top: 10px; border-radius: 3px; overflow: hidden; transform-origin: left center; animation: bar-in 0.7s ease both; }
.uptime-bar i { flex: 1 1 0; min-width: 0; background: var(--line); }
.uptime-bar i.operational { background: var(--ok); }
.uptime-bar i.degraded { background: #ee8a93; }
.uptime-bar i.down, .uptime-bar i.major, .uptime-bar i.partial { background: var(--bad); }

.parts { padding: 0 18px 12px; }
.part { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--soft); font-size: 0.92rem; }
.part:first-child { border-top: 0; }
.part .name { font-weight: 550; }
.part .st { margin-left: auto; color: var(--mute); font-size: 0.82rem; }

.section-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); margin: 8px 0 10px; }
.recent-item, .history-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  align-items: flex-start;
  transition: color 0.15s ease;
}
.recent-item:hover .title, .history-item:hover .title { color: var(--ok); }
.recent-item:first-of-type, .history-item:first-of-type { border-top: 0; }
.recent-item .date, .history-item .date { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); width: 78px; flex: none; }
.recent-item .title, .history-item .title { font-weight: 650; }
.recent-item .impact, .history-item .impact { color: var(--mute); font-size: 0.86rem; margin-top: 2px; }
.tag { display: inline-block; margin-left: 8px; font-family: var(--mono); font-size: 0.68rem; padding: 1px 6px; border-radius: 4px; background: var(--ok-soft); color: #047857; vertical-align: middle; }
.see-all { text-align: center; margin-top: 14px; }
.see-all a { font-weight: 650; font-size: 0.88rem; border-bottom: 1px solid var(--ink); }

.page { padding: 4px 0 24px; display: block; animation: rise 0.45s ease both; }
.back { display: inline-block; color: var(--mute); font-size: 0.86rem; margin-bottom: 16px; }
.page h1 { font-family: var(--display); font-size: 1.7rem; letter-spacing: -0.04em; margin-bottom: 6px; }
.lede { color: var(--mute); margin-bottom: 18px; max-width: 56ch; }
.badges { display: flex; gap: 8px; margin-bottom: 10px; }
.badge {
  font-size: 0.78rem;
  padding: 3px 8px; border-radius: 4px; font-weight: 650;
}
.badge.severity-critical, .badge.severity-major { background: #fef2f2; color: var(--bad); }
.badge.severity-minor { background: #fffbeb; color: var(--warn); }
.badge.status-resolved { background: var(--ok-soft); color: #047857; }
.badge.status-investigating, .badge.status-identified, .badge.status-recovery, .badge.status-monitoring { background: #eff6ff; color: var(--info); }
.incident-stats { display: flex; flex-wrap: wrap; gap: 18px; font-size: 0.82rem; color: var(--mute); margin: 12px 0 16px; }
.incident-stats b { display: block; color: var(--ink); font-size: 0.92rem; font-weight: 500; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 18px; }
.pill { display: inline-block; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 0.8rem; }

.log { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.log h2 {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--mute); margin-bottom: 14px;
}
.timeline { display: block; }
.timeline-entry { display: block; position: relative; padding: 0 0 18px 20px; border-left: 1px solid var(--line); }
.timeline-entry:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline-entry::before {
  content: ""; position: absolute; left: -4px; top: 6px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--line);
}
.timeline-entry.resolved::before { background: var(--ok); }
.timeline-entry .when { font-size: 0.82rem; color: var(--faint); margin-bottom: 4px; }
.timeline-entry .body { color: var(--ink); font-size: 0.95rem; line-height: 1.45; max-width: 58ch; }

.history-month { margin-bottom: 22px; }
.history-month h3 { font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mute); margin-bottom: 8px; }
.history-item .duration { margin-left: auto; font-family: var(--mono); font-size: 0.75rem; color: var(--faint); white-space: nowrap; }

.foot { padding: 8px 0 56px; color: var(--mute); font-size: 0.88rem; max-width: 62ch; }
.foot p { margin-bottom: 8px; }

.admin { display: grid; gap: 4px; }
.admin label { display: grid; gap: 6px; font-size: 0.84rem; color: var(--mute); margin-bottom: 10px; }
.admin input, .admin select, .admin textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%;
}
.actions { display: flex; gap: 8px; }
.form-msg { margin-top: 10px; }
.btn { background: var(--ink); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 650; cursor: pointer; }
.btn-ghost { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; font-weight: 650; cursor: pointer; }
.empty { color: var(--mute); padding: 24px 0; text-align: center; }

.state-operational { --c: var(--ok); }
.state-degraded, .state-maintenance { --c: var(--warn); }
.state-partial { --c: #ea580c; }
.state-major, .state-down { --c: var(--bad); }
.state-major .hero h1 .dot, .state-down .hero h1 .dot, .state-partial .hero h1 .dot { animation-duration: 1.2s; }

@media (max-width: 640px) {
  .top, #app, .foot { width: calc(100% - 28px); }
  .group-row .uptime, .down-row .err, .history-item .duration { display: none; }
  .mail-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "kind copy" "addr copy" "hint hint";
  }
}
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.hi { display: inline-flex; width: 22px; height: 22px; color: inherit; }
.hi svg { width: 100%; height: 100%; overflow: visible; display: block; }
.part .why { color: var(--mute); font-size: 0.78rem; margin-left: auto; max-width: 42%; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes beacon {
  0%, 100% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c, var(--ok)) 16%, transparent); }
  50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--c, var(--ok)) 8%, transparent); }
}
@keyframes bar-in {
  from { transform: scaleX(0.35); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, .hero h1 .dot, .uptime-bar {
    animation: none !important;
    transition: none !important;
  }
}
