/* OhAuthCat status page, in the landing site's language (ohauthcat-landing
   coming-soon page): the same tokens (DESIGN.md §2.1), the hero glow, the
   Geist headline and Geist Mono labels. Light and dark follow the system. */

@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --canvas: #f7f7fd;
  --surface: #ffffff;
  --sunken: #f0f0fa;
  --text: #15152b;
  --muted: #4d4d6b;
  --line: #e7e6f3;
  --accent: #c94820;
  --accent-text: #a63413;
  --accent-subtle: #fff3ed;
  --on-accent: #ffffff;
  --ok: #0d7a45;
  --ok-bg: #e3f6ec;
  --ok-bar: #22c55e;
  --warn: #8f5300;
  --warn-bg: #fff2d9;
  --warn-bar: #f59e0b;
  --bad: #c0163f;
  --bad-bg: #ffe9ef;
  --bad-bar: #f43f5e;
  --idle: #45455f;
  --idle-bg: #efeff6;
  --idle-bar: #e3e2ef;
  --shadow-md: 0 1px 2px rgb(21 21 43 / 0.05), 0 6px 20px rgb(21 21 43 / 0.06);
  --tip-bg: #15152b;
  --tip-text: #ededfb;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0f0f1d;
    --surface: #15152a;
    --sunken: #0b0b17;
    --text: #ededfb;
    --muted: #b1b1d2;
    --line: #272748;
    --accent: #f08a5d;
    --accent-text: #f08a5d;
    --accent-subtle: #2d1e1a;
    --on-accent: #15152b;
    --ok: #6ee7a6;
    --ok-bg: rgb(52 211 153 / 0.14);
    --ok-bar: #34d399;
    --warn: #fbc261;
    --warn-bg: rgb(251 191 36 / 0.14);
    --warn-bar: #fbbf24;
    --bad: #ff8fa6;
    --bad-bg: rgb(251 113 133 / 0.16);
    --bad-bar: #fb7185;
    --idle: #c6c6e0;
    --idle-bg: #24243f;
    --idle-bar: #242443;
    --shadow-md: 0 0 0 1px rgb(255 255 255 / 0.03), 0 8px 24px rgb(0 0 0 / 0.35);
    --tip-bg: #ededfb;
    --tip-text: #15152b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
.mono { font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding-inline: 1.25rem; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(620px 420px at 82% 18%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    radial-gradient(900px 500px at 0% 0%, var(--accent-subtle), transparent 70%),
    var(--canvas);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.4rem;
}
.brand img { display: block; width: 160px; height: auto; }
.nav-links { display: flex; gap: 1.5rem; font-size: 0.9rem; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover { color: var(--text); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3.5rem;
  align-items: center;
  padding-block: 3rem 5rem;
}
.kicker { color: var(--accent-text); font-size: 0.85rem; letter-spacing: 0.02em; }
.kicker b { color: var(--text); font-weight: 500; }
h1 {
  margin: 1rem 0 1.25rem;
  font-size: clamp(2.4rem, 5.2vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 700;
}
.lede { max-width: 32rem; color: var(--muted); font-size: 1.125rem; }
.actions { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.button {
  display: inline-block;
  padding: 0.8rem 1.3rem;
  border-radius: 0.6rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent);
}
.button:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.addr { color: var(--muted); font-size: 0.9rem; user-select: all; }

/* The live panel, in the shape of the landing page's sign-in trace. */
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 0.82rem;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.panel-head small { display: block; color: var(--muted); font-size: 0.75rem; }
.pill {
  flex: none;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--idle-bg);
  color: var(--idle);
  font-size: 0.75rem;
  white-space: nowrap;
}
.pill[data-state="ok"] { background: var(--ok-bg); color: var(--ok); }
.pill[data-state="partial"] { background: var(--warn-bg); color: var(--warn); }
.pill[data-state="major"] { background: var(--bad-bg); color: var(--bad); }

.rows { list-style: none; margin: 0; padding: 0.6rem 0; }
.row {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem;
}
.row .name { line-height: 1.3; min-width: 0; }
.row .name small { display: block; color: var(--muted); font-size: 0.7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .state { color: var(--muted); text-align: right; }
.row[data-state="ok"] .state { color: var(--ok); }
.row[data-state="partial"] .state { color: var(--warn); }
.row[data-state="major"] .state { color: var(--bad); }

/* Status mark: tick, dash or cross on a tinted disc. */
.mark { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--idle-bg); display: grid; place-items: center; }
.mark::after { content: ""; width: 0.4rem; height: 1.5px; background: var(--idle); border-radius: 1px; }
.row[data-state="ok"] .mark { background: var(--ok-bg); }
.row[data-state="ok"] .mark::after {
  width: 0.38rem; height: 0.2rem; background: none; border-radius: 0;
  border-left: 1.5px solid var(--ok); border-bottom: 1.5px solid var(--ok);
  transform: translateY(-1px) rotate(-45deg);
}
.row[data-state="partial"] .mark { background: var(--warn-bg); }
.row[data-state="partial"] .mark::after { background: var(--warn); }
.row[data-state="major"] .mark { background: var(--bad-bg); }
.row[data-state="major"] .mark::after { background: var(--bad); width: 0.45rem; height: 0.45rem; border-radius: 50%; }

.panel-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.panel-foot[data-state="ok"] #foot-left { color: var(--ok); }
.panel-foot[data-state="partial"] #foot-left { color: var(--warn); }
.panel-foot[data-state="major"] #foot-left { color: var(--bad); }

/* ---------- Sections ---------- */
main { padding-block: 1rem 4rem; }
.block { padding-block: 3.5rem 0; }
.block-head { margin-bottom: 1.5rem; }
h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.sub { margin-top: 0.6rem; color: var(--muted); max-width: 40rem; }
#active h2 { margin-bottom: 1.25rem; }

.groups { display: grid; gap: 1rem; }
.group {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.group-name {
  padding: 0.95rem 1.25rem 0;
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.component { padding: 0.9rem 1.25rem 1.1rem; }
.component + .component { border-top: 1px solid var(--line); }
.component-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.7rem; }
.component-name { font-weight: 600; letter-spacing: -0.01em; min-width: 0; }
.component-name small { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 400; letter-spacing: 0; overflow-wrap: anywhere; }

.bars { display: grid; grid-template-columns: repeat(90, minmax(0, 1fr)); gap: 3px; height: 2.1rem; }
.bar { border-radius: 2px; background: var(--idle-bar); }
.bar[data-state="ok"] { background: var(--ok-bar); }
.bar[data-state="partial"] { background: var(--warn-bar); }
.bar[data-state="major"] { background: var(--bad-bar); }
.bar:hover { filter: brightness(1.15); }

.bars-foot {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
}
.bars-foot .rule { height: 1px; background: var(--line); }
.bars-foot .pct { color: var(--text); }

.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin-top: 1.1rem; color: var(--muted); font-size: 0.75rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.sw { width: 0.65rem; height: 0.65rem; border-radius: 2px; background: var(--idle-bar); }
.sw[data-state="ok"] { background: var(--ok-bar); }
.sw[data-state="partial"] { background: var(--warn-bar); }
.sw[data-state="major"] { background: var(--bad-bar); }

/* Incidents */
.incidents, .days { list-style: none; margin: 0; padding: 0; }
.incident {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--idle-bar);
  border-radius: 12px;
  background: var(--surface);
}
.incident + .incident { margin-top: 0.75rem; }
.incident[data-state="major"] { border-left-color: var(--bad-bar); }
.incident[data-state="partial"] { border-left-color: var(--warn-bar); }
.incident[data-state="resolved"] { border-left-color: var(--ok-bar); }
.incident-title { font-weight: 600; }
.incident-title a { color: inherit; text-decoration: none; }
.incident-title a:hover { color: var(--accent-text); }
.incident-meta { color: var(--muted); font-size: 0.85rem; }

.days { border-top: 1px solid var(--line); }
.day {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1rem 2rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--line);
}
.day-date { color: var(--muted); font-size: 0.85rem; padding-top: 0.1rem; }
.day-empty { color: var(--muted); }

/* Footer */
.foot { border-top: 1px solid var(--line); }
.foot-row { padding-block: 1.75rem 2.5rem; color: var(--muted); font-size: 0.85rem; display: grid; gap: 0.3rem; }

/* Tooltip */
.tip {
  position: fixed;
  z-index: 10;
  max-width: 17rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: var(--tip-bg);
  color: var(--tip-text);
  font-size: 0.75rem;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: 0 10px 30px rgb(4 4 12 / 0.3);
}
.tip strong { display: block; font-weight: 600; }

.from-30 { display: none; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; padding-block: 2rem 3.5rem; }
  .brand img { width: 136px; }
  .nav-links { gap: 1rem; font-size: 0.85rem; }
  .day { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
}

@media (max-width: 560px) {
  .nav-links a[href="#history"] { display: none; }
  .bars { grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 2px; height: 1.9rem; }
  .bar:nth-child(-n + 60) { display: none; }
  .from-90 { display: none; }
  .from-30 { display: inline; }
  .block { padding-block: 2.75rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
