/* PingReports public status page — modern, flat, self-hosted everything.
   Inter Variable (rsms.me) self-hosted in /static/fonts. Color system
   driven by per-page CSS vars set inline from the theme. No third-party
   CDN imports. */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter.woff2") format("woff2-variations"),
       url("/static/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #2563eb;
  --accent:  #10b981;
  --bg:      #0b1020;
  --ink:     #f8fafc;
  --ink-soft: rgba(248, 250, 252, 0.65);
  --line:    rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.12);
  --card:    rgba(255, 255, 255, 0.025);
  --ok:      #10b981;
  --warn:    #f59e0b;
  --bad:     #ef4444;
  --info:    #38bdf8;
  --radius:  14px;
  --radius-sm: 8px;
  --shadow-lift: 0 2px 8px rgba(0,0,0,0.18), 0 12px 32px rgba(0,0,0,0.18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  font-optical-sizing: auto;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}
body.theme-dark  { background: var(--bg); color: var(--ink); }
body.theme-light {
  --ink: #0b1020;
  --ink-soft: rgba(11, 16, 32, 0.65);
  --line: rgba(0, 0, 0, 0.06);
  --line-strong: rgba(0, 0, 0, 0.12);
  --card: #ffffff;
  --bg: #f4f5f8;
  background: var(--bg);
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ============================ HERO ============================ */
.hero {
  padding: 64px 24px 48px;
  background: var(--primary);
  color: #fff;
  position: relative;
  overflow: hidden;  /* so absolutely-positioned logo doesn't bleed out */
}
.hero::after {
  /* Subtle radial darken at bottom edge — keeps the seam between hero
     and body from looking like a glued-on rectangle. */
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 60px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.18) 100%);
  pointer-events: none;
}
.hero-empty { background: #1e293b; }
.hero-inner { max-width: 1080px; margin: 0 auto; position: relative; }
.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

/* Logo size + position. The hero-inner is position:relative so corner
   placements absolutely-position the logo against the hero container.
   Top-left / top-center keep the logo in document flow (above the
   title) so the visual hierarchy reads correctly; other positions pull
   the logo into a corner and pad the hero accordingly. */
.hero .logo {
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
}
.hero-logo-small .logo  { max-height: 44px; }
.hero-logo-medium .logo { max-height: 72px; }
.hero-logo-large .logo  { max-height: 112px; }

/* Default: bottom-right corner placement. */
.hero-pos-top-left .logo,
.hero-pos-top-center .logo,
.hero-pos-top-right .logo {
  margin-bottom: 20px;
}
.hero-pos-top-center .logo { margin-left: auto; margin-right: auto; }
.hero-pos-top-right .logo  { margin-left: auto; }

.hero-pos-bottom-left .logo,
.hero-pos-bottom-center .logo,
.hero-pos-bottom-right .logo {
  position: absolute;
  bottom: 0;
}
.hero-pos-bottom-left .logo   { left: 0; }
.hero-pos-bottom-center .logo { left: 50%; transform: translateX(-50%); }
.hero-pos-bottom-right .logo  { right: 0; }

/* Give the hero a bit more bottom padding when the logo sits in a
   bottom corner, so the title + status line don't collide with it. */
.hero-pos-bottom-left,
.hero-pos-bottom-center,
.hero-pos-bottom-right {
  padding-bottom: 80px;
}
.hero-pos-bottom-left.hero-logo-large,
.hero-pos-bottom-center.hero-logo-large,
.hero-pos-bottom-right.hero-logo-large {
  padding-bottom: 130px;
}
.status-line {
  font-size: 16px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
  font-weight: 500;
  backdrop-filter: blur(8px);
}
.status-line::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.status-ok   { color: #d1fae5; }
.status-ok::before   { background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.25); }
.status-warn { color: #fde68a; }
.status-warn::before { background: #fbbf24; box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.25); }
.status-down { color: #fecaca; }
.status-down::before { background: #f87171; box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.30); }

/* In-content "Subscribe to updates" CTA — placed under the hero rather
   than ON it, so the brand-coloured hero band isn't competing with a
   semi-transparent button. Right-aligned to mirror an action bar. */
.content-actions {
  display: flex;
  justify-content: flex-end;
  margin: -8px 0 12px;
}
.subscribe-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.subscribe-cta:hover {
  background: var(--card);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}
.subscribe-cta svg { flex: none; color: var(--primary); }

/* Subscribe section needs scroll-margin so the in-page anchor lands
   below the fixed-ish hero rather than tucked under it. */
.subscribe { scroll-margin-top: 24px; }

/* Loud toast on the subscribe section so the confirm-link landing is
   obvious without scrolling. */
.subscribe-toast {
  animation: pr-sp-toast-pop 0.25s ease-out;
}
@keyframes pr-sp-toast-pop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================ MAIN ============================ */
main { max-width: 1080px; margin: 32px auto; padding: 0 24px 80px; }

h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 32px 0 12px;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ============================ INCIDENTS ============================ */
.incidents .incident {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.incident::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 4px;
}
.incident.sev-critical::before { background: var(--bad); }
.incident.sev-major::before    { background: var(--warn); }
.incident.sev-minor::before    { background: var(--info); }
.incident.sev-maintenance::before { background: #a78bfa; }

.inc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.inc-head > div:first-child { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inc-head strong { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.inc-opened { font-size: 12px; padding-top: 2px; }
.inc-opened time { color: var(--ink-soft); }

.chip-status {
  background: rgba(148,163,184,0.16);
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
}
.status-key-investigating { background: rgba(239,68,68,0.14); color: #fca5a5; }
.status-key-identified    { background: rgba(245,158,11,0.14); color: #fcd34d; }
.status-key-monitoring    { background: rgba(56,189,248,0.14); color: #7dd3fc; }
.status-key-resolved      { background: rgba(16,185,129,0.16); color: #6ee7b7; }
.status-key-scheduled     { background: rgba(167,139,250,0.16); color: #c4b5fd; }
.status-key-in_progress   { background: rgba(167,139,250,0.18); color: #ddd6fe; }
.status-key-completed     { background: rgba(16,185,129,0.16); color: #6ee7b7; }
.status-key-opened        { background: rgba(148,163,184,0.16); color: var(--ink-soft); }

.chip-sev {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.chip-sev.sev-crit { background: rgba(239,68,68,0.18); color: #fca5a5; }
.chip-sev.sev-major { background: rgba(245,158,11,0.18); color: #fcd34d; }
.chip-sev.sev-minor { background: rgba(56,189,248,0.18); color: #7dd3fc; }
.chip-sev.sev-maint { background: rgba(167,139,250,0.22); color: #ddd6fe; }

.inc-meta-label {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  opacity: 0.7;
  margin-right: 4px;
  font-weight: 600;
}

.incidents-past .incident {
  background: transparent;
  opacity: 0.86;
}
.incidents-past .inc-timeline { border-left-color: rgba(148,163,184,0.18); }
.inc-update.is-resolution::before { background: var(--ok) !important; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px rgba(16,185,129,0.25) !important; }

.inc-timeline {
  list-style: none;
  padding: 0 0 0 8px;
  margin: 16px 0 0;
  border-left: 2px solid var(--line-strong);
}
.inc-update {
  position: relative;
  padding: 0 0 16px 18px;
}
.inc-update::before {
  content: "";
  position: absolute;
  left: -7px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--info);
  box-shadow: 0 0 0 3px var(--bg, var(--card));
}
.inc-update.is-initial::before { background: var(--ink-soft); }
.incident.sev-critical .inc-update:first-child::before { background: var(--bad); }
.incident.sev-major .inc-update:first-child::before    { background: var(--warn); }
.incident.sev-minor .inc-update:first-child::before    { background: var(--info); }
.inc-update-status {
  text-transform: capitalize;
  font-weight: 600;
  font-size: 13px;
}
.inc-update-time { font-size: 11px; margin-left: 8px; }
.inc-update-body { margin-top: 4px; font-size: 14px; color: var(--ink-soft); line-height: 1.55; }
.inc-update-body p { margin: 0 0 6px; }

/* Subscribe form */
.subscribe { max-width: 1080px; margin: 16px auto 32px; padding: 0 24px; }
.subscribe-card {
  display: flex; gap: 24px; align-items: center; justify-content: space-between;
  padding: 22px 24px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.subscribe-card h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.subscribe-card p { margin: 0; font-size: 13px; }
.subscribe-form { display: flex; gap: 8px; align-items: stretch; min-width: 320px; flex: 1; max-width: 460px; }
.subscribe-form input[type="email"] {
  flex: 1; min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
}
.subscribe-form input[type="email"]:focus { outline: 0; border-color: var(--primary); }
.subscribe-form button {
  background: var(--primary);
  color: #fff;
  border: 0;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: -0.01em;
}
.subscribe-form button:hover { filter: brightness(1.08); }
.subscribe-toast {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.10);
  color: var(--info);
  border: 1px solid rgba(56,189,248,0.25);
  font-size: 13px;
}
.subscribe-toast.ok  { background: rgba(16,185,129,0.10); color: var(--ok); border-color: rgba(16,185,129,0.25); }
.subscribe-toast.err { background: rgba(239,68,68,0.10); color: #fca5a5; border-color: rgba(239,68,68,0.25); }

/* ============================ COMPONENTS ============================ */
.components .component {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: 10px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.components .component:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.component-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 28px; }
.component-meta { min-width: 0; }
.component-meta strong { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.component .desc { font-size: 13px; color: var(--ink-soft); margin-top: 4px; line-height: 1.5; }

.chip {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.2;
}
/* Status-row chips (next to "Operational" / "Degraded" / etc. on the
   component row) get a small leading dot. Incident-status chips do NOT
   — the colored background already carries the status meaning, and a
   dot on a short label like "In progress" pushes the text off-centre. */
.component-row .chip::before,
.subscribe-toast .chip::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.chip.status-operational { background: rgba(16, 185, 129, 0.12); color: var(--ok); }
.chip.status-operational::before { background: var(--ok); }
.chip.status-degraded    { background: rgba(245, 158, 11, 0.12); color: var(--warn); }
.chip.status-degraded::before    { background: var(--warn); }
.chip.status-down        { background: rgba(239, 68, 68, 0.14); color: var(--bad); }
.chip.status-down::before        { background: var(--bad); }
.chip.status-unknown     { background: rgba(148, 163, 184, 0.14); color: #94a3b8; }
.chip.status-unknown::before     { background: #94a3b8; }

/* ============================ 90-DAY UPTIME GRID ============================ */
.uptime-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(90, minmax(0, 1fr));
  gap: 3px;
  align-items: stretch;
  position: relative;
}
.uptime-grid .day {
  display: block;
  height: 32px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.10);
  transition: transform 0.08s ease, filter 0.08s ease;
  cursor: help;
}
.uptime-grid .day:hover { transform: scaleY(1.15); filter: brightness(1.4); z-index: 1; }
.uptime-grid .day.d-100 { background: var(--ok); }
.uptime-grid .day.d-ok  { background: #34d399; }
.uptime-grid .day.d-warn { background: var(--warn); }
.uptime-grid .day.d-bad  { background: var(--bad); }
.uptime-grid .day.no-data { background: transparent; border: 1px dashed var(--line-strong); }
.grid-axis {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ============================ FOOTER ============================ */
footer {
  text-align: center;
  padding: 32px 24px 48px;
  color: var(--ink-soft);
  font-size: 13px;
}
footer .legal {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}
footer .legal a { color: var(--ink-soft); }
footer .legal a:hover { color: var(--ink); text-decoration: underline; }

.muted { color: var(--ink-soft); }
code {
  font-family: "Inter", monospace;
  background: rgba(148, 163, 184, 0.14);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.92em;
}

/* ============================ MOBILE ============================ */
@media (max-width: 640px) {
  .hero { padding: 40px 16px 32px; }
  main { padding: 0 16px 60px; }
  .uptime-grid .day { height: 24px; }
  .component-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .component-row .chip { align-self: flex-start; }
}
