/* PowerNotes Status — standalone static page.
   Brand tokens mirror @pn/webapp's style.css; nothing is imported so this page
   stays a zero-build, zero-dependency deploy. */

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

:root {
  /* Brand */
  --violet: #7164ac;
  --violet-deep: #2b2444;
  --violet-mid: #453a6b;

  /* Surfaces & ink */
  --paper: #fafafb;
  --surface: #ffffff;
  --rule: #e6e5ea;
  --rule-soft: #f0eff3;
  --ink: #17161c;
  --ink-2: #55525f;
  --ink-3: #8a8794;

  /* Status tones: -text for type, -mark for bars and dots, -wash for pills */
  --ok-text: #16794c;
  --ok-mark: #2fa96f;
  --ok-wash: #e8f5ee;
  --warn-text: #8a5a00;
  --warn-mark: #e0a02a;
  --warn-wash: #fbf2df;
  --down-text: #b23325;
  --down-mark: #dd5a48;
  --down-wash: #fbeceb;
  --info-text: #574c85;
  --info-mark: #7164ac;
  --info-wash: #eeecf7;

  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --shell: 900px;
  --gutter: 24px;
  --radius: 10px;

  /* The service row is a fixed two-column rail so the 30-day axis label in the
     band header can line up exactly with the bars below it. */
  --tick-w: 5px;
  --tick-gap: 2px;
  --strip-w: 208px; /* 30 ticks + 29 gaps */
  --pill-col: 140px;
  --rail-gap: 18px;
  --card-pad: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111017;
    --surface: #1a1922;
    --rule: #2c2b37;
    --rule-soft: #23222d;
    --ink: #eeedf3;
    --ink-2: #a9a6b6;
    --ink-3: #7c7989;

    --ok-text: #55cd93;
    --ok-mark: #35b87a;
    --ok-wash: #16301f;
    --warn-text: #e6ab4a;
    --warn-mark: #d9992a;
    --warn-wash: #33280f;
    --down-text: #f08472;
    --down-mark: #d9553f;
    --down-wash: #381c19;
    --info-text: #b0a4e0;
    --info-mark: #8a7cc4;
    --info-wash: #241f38;
  }
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 150ms ease;
}

.skip-link:focus-visible {
  top: 12px;
}

/* ── Masthead ─────────────────────────────────────────────────
   The one loud surface on the page: deep brand violet, with the
   verdict set large. Everything below it stays quiet. */

.masthead {
  position: relative;
  background: var(--violet-deep);
  color: #fff;
  isolation: isolate;
  overflow: hidden;
}

.masthead::before {
  content: '';
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 150%;
  background: radial-gradient(60% 70% at 22% 0%, rgba(113, 100, 172, 0.55), transparent 70%);
  z-index: -1;
}

.masthead__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 26px var(--gutter) 46px;
}

.masthead__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.brand__mark {
  display: block;
  border-radius: 50%;
}

.brand__name {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand__rule {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.28);
}

.brand__page {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.masthead__nav {
  display: flex;
  gap: 22px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
}

.masthead__nav a {
  text-decoration: none;
}

.masthead__nav a:hover {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.5);
}

.masthead__nav :focus-visible {
  outline-color: #fff;
}

.verdict {
  margin-top: 40px;
}

.verdict__eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

.verdict__dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--tone-mark, #fff);
}

.verdict__line {
  margin-top: 14px;
  font-size: clamp(2rem, 1.3rem + 2.8vw, 3.1rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

.verdict__meta {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.62);
}

/* The signature: a full-bleed rule in the current status colour, sitting
   between the masthead and the detail. It is the page's loudest single mark. */
.statusrule {
  height: 4px;
  background: var(--tone-mark, rgba(255, 255, 255, 0.2));
  transition: background 300ms ease;
}

/* Tone assignment flows from the masthead down through both the dot and rule. */
.masthead[data-overall='loading'] {
  --tone-mark: rgba(255, 255, 255, 0.35);
}
.masthead[data-overall='ok'] {
  --tone-mark: #35b87a;
}
.masthead[data-overall='warn'] {
  --tone-mark: #e0a02a;
}
.masthead[data-overall='down'] {
  --tone-mark: #e8604c;
}
.masthead[data-overall='info'] {
  --tone-mark: #a091dc;
}

/* ── Bands ────────────────────────────────────────────────── */

main {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.band {
  padding: 44px 0 0;
}

.band__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  margin-bottom: 16px;
}

.band__title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-family: var(--mono);
}

.band__aside {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-3);
}

/* Sits directly above the strip column: same width, offset by the pill column
   and the card's own padding. */
.axis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: var(--strip-w);
  margin-right: calc(var(--pill-col) + var(--rail-gap) + var(--card-pad));
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-3);
}

.axis__rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.legend {
  margin-top: 14px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-3);
  max-width: 62ch;
}

/* ── Service groups ───────────────────────────────────────── */

.group {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.group__name {
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 92%, var(--paper));
}

.svc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 20px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--rule-soft);
}

.svc:last-child {
  border-bottom: 0;
}

.svc__name {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.008em;
}

.svc__detail {
  margin-top: 1px;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.svc__right {
  display: grid;
  grid-template-columns: var(--strip-w) var(--pill-col);
  align-items: center;
  gap: var(--rail-gap);
  justify-self: end;
}

/* Uptime strip: 30 ticks, one per day, oldest at the left. */
.strip {
  position: relative;
  display: flex;
  gap: var(--tick-gap);
  align-items: flex-end;
  width: var(--strip-w);
  height: 26px;
}

.tick {
  width: var(--tick-w);
  height: 100%;
  border-radius: 2px;
  background: var(--tick-color, var(--ok-mark));
  transition: opacity 120ms ease;
}

.tick:hover {
  opacity: 0.6;
}

.tick--ok {
  --tick-color: var(--ok-mark);
}
.tick--warn {
  --tick-color: var(--warn-mark);
}
.tick--down {
  --tick-color: var(--down-mark);
}
.tick--info {
  --tick-color: var(--info-mark);
}

.strip__tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 3;
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 3px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.strip__tip[data-show='1'] {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 7px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  background: var(--pill-wash, var(--ok-wash));
  color: var(--pill-text, var(--ok-text));
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.pill--ok {
  --pill-wash: var(--ok-wash);
  --pill-text: var(--ok-text);
}
.pill--warn {
  --pill-wash: var(--warn-wash);
  --pill-text: var(--warn-text);
}
.pill--down {
  --pill-wash: var(--down-wash);
  --pill-text: var(--down-text);
}
.pill--info {
  --pill-wash: var(--info-wash);
  --pill-text: var(--info-text);
}

/* A closed incident is history, not a live signal — it gets no status colour. */
.pill--muted {
  --pill-wash: var(--rule-soft);
  --pill-text: var(--ink-2);
}

/* ── Ledger: maintenance + incident history ───────────────── */

.ledger {
  border-top: 1px solid var(--rule);
}

.entry {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 4px 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.entry__date {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-3);
  padding-top: 2px;
}

.entry__title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.entry__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.tag {
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-2);
}

.entry__body {
  margin-top: 8px;
  font-size: 0.9375rem;
  color: var(--ink-2);
  max-width: 68ch;
}

.entry__window {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-3);
}

.updates {
  margin-top: 14px;
  list-style: none;
  border-left: 2px solid var(--rule);
  padding-left: 16px;
  display: grid;
  gap: 14px;
}

.update__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.update__state {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.update__at {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-3);
}

.update__body {
  margin-top: 3px;
  font-size: 0.9375rem;
  color: var(--ink-2);
  max-width: 68ch;
}

/* Empty states read as a settled record, not a missing one. */
.empty {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

/* Neutral by default; only "no incidents" earns the green. */
.empty__mark {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  flex: none;
}

.empty__mark--ok {
  color: var(--ok-text);
}

.empty__text {
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.empty__text span {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.notice {
  padding: 18px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.notice--error {
  border-color: color-mix(in srgb, var(--down-mark) 45%, var(--rule));
  background: var(--down-wash);
  color: var(--down-text);
}

.notice__title {
  margin-bottom: 5px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}

.notice--error .notice__title {
  color: var(--down-text);
}

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

.foot {
  margin-top: 56px;
  border-top: 1px solid var(--rule);
}

.foot__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 26px var(--gutter) 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
}

.foot__note {
  font-size: 0.8125rem;
  color: var(--ink-3);
  max-width: 56ch;
}

.foot__links {
  display: flex;
  gap: 20px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-3);
}

.foot__links a {
  text-decoration: none;
}

.foot__links a:hover {
  color: var(--ink-2);
  text-decoration: underline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Narrow screens ───────────────────────────────────────── */

@media (max-width: 640px) {
  .masthead__inner {
    padding-bottom: 36px;
  }

  .verdict {
    margin-top: 32px;
  }

  .svc {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Stacked: status first, then the strip, both left-aligned under the name. */
  .svc__right {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    justify-self: start;
    width: 100%;
    gap: 14px;
  }

  .strip {
    height: 22px;
  }

  /* The axis only makes sense while it sits above a right-aligned strip. */
  .axis {
    display: none;
  }

  .entry {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 460px) {
  /* The pill carries the status; the 30-day detail is not worth the crush. */
  .strip {
    display: none;
  }
}

/* Only hover feedback remains, but honour the preference anyway. */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 1ms !important;
  }
}
