/* The status page: a page of its own, in the look of the front page (its colours, type and
   header), with only what this page needs. The colour tokens are the front page's; the chart
   and status colours are added here and checked against the card in both themes (every one
   at least 3:1 as a graphic, text always in the ink tokens). */
:root {
  color-scheme: light dark;
  --bg:          #ffffff;
  --wash:        #eff8f6;
  --card:        #ffffff;
  --sunken:      #f4f8f7;
  --ink:         #10282c;
  --ink-soft:    #3f565b;
  --ink-faint:   #566d72;
  --line:        #d3e3e0;
  --line-strong: #6f8d89;
  --brand:       #0a7166;
  --brand-text:  #0a6a5f;
  --voice:       #6542cc;
  --code-bg:     #f4f8f7;
  --shadow:      0 1px 2px rgba(16, 40, 44, .05), 0 18px 40px -22px rgba(16, 40, 44, .28);

  --series-text:    #6542cc;
  --series-connect: #0a7166;
  --good:           #17803d;
  --warning:        #b86e00;
  --critical:       #c42b2b;
  --none:           #d3e3e0;
  --grid:           #e3eeec;
  --axis:           #6f8d89;

  --font: "Familjen Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0c1d20;
    --wash:        #10272b;
    --card:        #132e33;
    --sunken:      #0f2529;
    --ink:         #e8f4f2;
    --ink-soft:    #b3c8c6;
    --ink-faint:   #9bb3b1;
    --line:        #24474c;
    --line-strong: #5e878d;
    --brand:       #5fd3c3;
    --brand-text:  #6fdccd;
    --voice:       #b8a3ff;
    --code-bg:     #0f2529;
    --shadow:      0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -22px rgba(0, 0, 0, .7);

    --series-text:    #b8a3ff;
    --series-connect: #5fd3c3;
    --good:           #4cc47a;
    --warning:        #f0b545;
    --critical:       #ff8a7e;
    --none:           #2f5257;
    --grid:           #1f3f44;
    --axis:           #5e878d;
  }
}
:root[data-theme="dark"] {
  --bg:          #0c1d20;
  --wash:        #10272b;
  --card:        #132e33;
  --sunken:      #0f2529;
  --ink:         #e8f4f2;
  --ink-soft:    #b3c8c6;
  --ink-faint:   #9bb3b1;
  --line:        #24474c;
  --line-strong: #5e878d;
  --brand:       #5fd3c3;
  --brand-text:  #6fdccd;
  --voice:       #b8a3ff;
  --code-bg:     #0f2529;
  --shadow:      0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -22px rgba(0, 0, 0, .7);

  --series-text:    #b8a3ff;
  --series-connect: #5fd3c3;
  --good:           #4cc47a;
  --warning:        #f0b545;
  --critical:       #ff8a7e;
  --none:           #2f5257;
  --grid:           #1f3f44;
  --axis:           #5e878d;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
/* Tooltips and notes set their own display; hidden must still hide them. */
[hidden] { display: none !important; }
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--font); }
a { color: var(--brand-text); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--voice); outline-offset: 3px; border-radius: 8px; }
p { margin: 0 0 .9em; }
code { font-family: var(--mono); font-size: .86em; background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; padding: .05em .35em; overflow-wrap: anywhere; }
strong { font-weight: 650; }
h1, h2 { margin: 0; letter-spacing: -.015em; }
.sprite { position: absolute; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

/* ---------- header and footer, as on the front page ---------- */
.bar { display: flex; align-items: center; gap: 20px; height: 76px; }
.logo {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font-weight: 700; font-size: 1.3rem; letter-spacing: -.02em; white-space: nowrap;
}
.logo svg { width: 36px; height: 36px; flex: none; }
.logo .ring { color: var(--brand); }
.logo .wave { color: var(--voice); }
.logo .lines { color: var(--ink); }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bar-link { color: var(--ink-soft); text-decoration: none; font-weight: 550; padding: 8px 12px; border-radius: 999px; }
.bar-link:hover { background: var(--wash); color: var(--ink); }
/* A phone has room for the logo and the theme switch; the footer links to the docs too. */
@media (max-width: 24em) {
  .bar { gap: 12px; }
  .bar-link { display: none; }
}
.theme {
  width: 42px; height: 42px; border-radius: 50%; padding: 0; display: grid; place-items: center;
  background: transparent; color: var(--ink-soft); border: 1.5px solid var(--line-strong); cursor: pointer;
}
.theme:hover { background: var(--wash); color: var(--ink); }
.ic { width: 20px; height: 20px; fill: currentColor; }
.theme .ic-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .ic-sun { display: block; }
  :root:not([data-theme="light"]) .theme .ic-moon { display: none; }
}
:root[data-theme="dark"] .theme .ic-sun { display: block; }
:root[data-theme="dark"] .theme .ic-moon { display: none; }

footer.foot {
  padding-block: 40px 56px; color: var(--ink-faint); font-size: .94rem;
  display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: space-between; align-items: center;
}
footer.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }

/* ---------- the page ---------- */
.status-page { padding-bottom: clamp(2rem, 6vw, 4rem); }
.page-head { padding-block: clamp(1rem, 4vw, 2.5rem) clamp(1.25rem, 3vw, 2rem); }
.eyebrow { margin: 0 0 .4rem; color: var(--brand-text); font-weight: 650; letter-spacing: .02em; }
.page-head h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); font-weight: 700; line-height: 1.05; }
.lede { margin: .9rem 0 0; color: var(--ink-soft); max-width: 62ch; font-size: 1.08rem; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
}

/* ---------- now ---------- */
.now { padding: clamp(1.25rem, 3vw, 2rem); }
.now__head { display: flex; gap: 1rem; align-items: flex-start; }
.now__icon { flex: none; width: 2.75rem; height: 2.75rem; fill: var(--ink-soft); }
.now[data-state="up"] .now__icon { fill: var(--good); }
.now[data-state="degraded"] .now__icon { fill: var(--warning); }
.now[data-state="down"] .now__icon { fill: var(--critical); }
.now__headline { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); line-height: 1.2; padding-top: .2rem; font-weight: 700; }
.now__detail { margin: .35rem 0 0; color: var(--ink-soft); min-height: 3.2em; max-width: 46em; }
@media (max-width: 37.5em) {
  /* Room for a longer state and detail on a phone, so the tiles below stay put. */
  .now__headline { min-height: 2.4em; }
  .now__detail { min-height: 6.4em; }
}

.notice {
  margin: 1rem 0 0; padding: .6rem .85rem; max-width: 46em;
  border-left: 4px solid var(--warning); border-radius: .4rem;
  background: color-mix(in srgb, var(--warning) 12%, transparent);
}

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .75rem; margin: 1.5rem 0 0; }
.tile { background: var(--sunken); border: 1px solid var(--line); border-radius: 14px; padding: .85rem 1rem; }
.tile dt { font-size: .875rem; color: var(--ink-soft); }
.tile dd { margin: .15rem 0 0; font-size: 1.75rem; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile dd small { font-size: .875rem; font-weight: 400; color: var(--ink-soft); }
.tile .tile__sub { margin: 0; font-size: .875rem; font-weight: 400; color: var(--ink-soft); }

.next {
  display: flex; align-items: center; gap: .55rem; margin: 1.1rem 0 0; padding-top: 1rem;
  border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .94rem;
  font-variant-numeric: tabular-nums; min-height: 1.6em;
}
.next__dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--ink-faint); flex: none; }
.now[data-state="up"] .next__dot, .now[data-state="degraded"] .next__dot { background: var(--good); }

/* ---------- sections ---------- */
.section { margin-top: clamp(2.5rem, 6vw, 4rem); }
.section__head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .5rem 1.5rem; margin-bottom: 1rem;
}
.section h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.8rem); font-weight: 700; }

.legend { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin: 0; padding: 0; list-style: none; font-size: .875rem; color: var(--ink-soft); }
.legend li { display: inline-flex; align-items: center; gap: .45rem; }
.swatch { width: .75rem; height: .75rem; border-radius: 3px; background: var(--none); }
.swatch--good { background: var(--good); }
.swatch--warning { background: var(--warning); }
.swatch--critical { background: var(--critical); }
.key { display: inline-block; width: 1.1rem; height: 3px; border-radius: 2px; background: var(--series-text); }
.key--connect { background: var(--series-connect); }
.mark-key { display: inline-block; width: .7rem; height: .6rem; background: var(--critical); clip-path: polygon(50% 0, 100% 100%, 0 100%); }

/* Which day count the bars show: 90 on wide screens, 30 on phones. */
.narrow { display: none; }
@media (max-width: 37.5em) {
  .wide { display: none; }
  .narrow { display: inline; }
  .day { flex-basis: calc((100% - 29 * 2px) / 30); }
}

/* ---------- day bars ---------- */
.days-frame { position: relative; }
.days { display: flex; justify-content: flex-end; gap: 2px; height: 2.75rem; border-radius: 6px; }
.day { flex: 0 0 calc((100% - 89 * 2px) / 90); min-width: 0; border-radius: 3px; background: var(--none); }
.day--good { background: var(--good); }
.day--warning { background: var(--warning); }
.day--critical { background: var(--critical); }
.day.is-active { outline: 2px solid var(--ink); outline-offset: 1px; }
.day:hover { filter: brightness(1.12); }
@media (prefers-reduced-motion: no-preference) { .day { transition: filter .12s ease; } }
.axis { display: flex; justify-content: space-between; margin-top: .4rem; font-size: .8125rem; color: var(--ink-soft); }

/* ---------- tooltips ---------- */
.tooltip {
  position: absolute; z-index: 2; top: calc(100% + .5rem); display: grid; gap: .15rem;
  min-width: 11rem; max-width: 17rem; padding: .6rem .75rem;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow);
  font-size: .875rem; line-height: 1.4; pointer-events: none;
}
.chart .tooltip { top: .5rem; }
.tooltip__title, .tooltip__muted { color: var(--ink-soft); }
.tooltip__row { display: flex; align-items: center; gap: .45rem; }
.tooltip strong { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- latency chart ---------- */
.chart { position: relative; height: 240px; border-radius: 16px; overflow: hidden; box-shadow: none; }
.chart__svg { display: block; width: 100%; height: 240px; touch-action: pan-y; }
.chart__empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--ink-soft); }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis-line { stroke: var(--axis); stroke-width: 1; }
.chart .tick, .chart .end-label { fill: var(--ink-soft); font: 400 12px var(--font); font-variant-numeric: tabular-nums; }
.chart .end-label { fill: var(--ink); font-weight: 650; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line--text { stroke: var(--series-text); }
.chart .line--connect { stroke: var(--series-connect); }
.chart .dot--text, .chart .marker--text { fill: var(--series-text); }
.chart .dot--connect, .chart .marker--connect { fill: var(--series-connect); }
.chart .marker { stroke: var(--card); stroke-width: 2; }
.chart .fail-mark { fill: var(--critical); }
.chart .crosshair { stroke: var(--ink-soft); stroke-width: 1; }

/* ---------- tables ---------- */
.table { margin-top: 1rem; }
.table summary { cursor: pointer; width: fit-content; color: var(--brand-text); font-weight: 600; border-radius: 4px; }
.table__scroll { max-height: 24rem; overflow: auto; margin-top: .75rem; border: 1px solid var(--line); border-radius: 14px; }
.table table { width: 100%; border-collapse: collapse; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: .45rem .85rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { position: sticky; top: 0; background: var(--sunken); font-weight: 650; }
.table td.is-failed { white-space: normal; min-width: 14rem; }

/* ---------- what we measure ---------- */
.about { max-width: 46em; }
.about ol { padding-left: 1.25rem; }
.about li { margin-bottom: .5em; }
.about__history { color: var(--ink-soft); }
