/* Ephemeris status page, in the product's own design language, "The Record"
   (docs/design/VISUAL-LANGUAGE.md): a light sterile ground, structure from
   1px hairlines, zero radius, no shadows, a margin spine beside a record
   column, figures in tabular numerals, and status as a stamp (a word in a
   uniform border on a tint; never a dot, a pill or a thickened edge).
   Colours are the Sterile light tokens (docs/design/tokens.css), each hue one
   meaning: verified, waiting, blocked, action, inert.
   No scripts: day tooltips open on hover and keyboard focus, and the bars
   switch from 90 to 60 to 30 days at 1024px and 600px, all in CSS. */
:root {
  --field: #f3f6f5; --raised: #ffffff; --sunken: #e7ecea;
  --hair: #cfd8d5; --control: #63706d;
  --ink: #11222a; --ink-soft: #3c4d53; --ink-quiet: #4e5f65;
  --verified-ink: #266f57; --verified-tint: #eaf4ef; --verified-edge: #4c8a74;
  --waiting-ink: #794a00; --waiting-tint: #fbf0db; --waiting-edge: #8a6520;
  --blocked-ink: #7e0000; --blocked-tint: #fbe6e3; --blocked-edge: #a9463c;
  --action-ink: #17509f; --action-solid: #17509f; --action-tint: #e6eef9; --action-edge: #3d71bc;
  --inert-ink: #5c6663; --inert-tint: #e7ecea; --inert-edge: #6f7c80;
  --focus: #0b3c80;
  --sans: "IBM Plex Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --serif: "Newsreader", "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", ui-monospace, monospace;
  --tap: 44px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--field); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: var(--action-ink); text-underline-offset: 2px; }
a:focus-visible, .btn:focus-visible, input:focus-visible, button:focus-visible, .day:focus-visible, .tab:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
.fig, time, .when, .bar-legend, .dayrow-date { font-variant-numeric: tabular-nums; }

/* ---- top bar: the mark and one action */
.topbar { background: var(--raised); border-bottom: 1px solid var(--hair); }
.topbar-in, .page, .foot-in { max-width: 1040px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-height: var(--tap); }
.mark { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
.wordmark { font: 600 14px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.sub { font-size: 14px; color: var(--ink-quiet); padding-left: 10px; border-left: 1px solid var(--hair); }

/* ---- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px;
  border: 1px solid var(--control); border-radius: 0; background: var(--raised); color: var(--ink);
  font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; transition: background-color 120ms linear, border-color 120ms linear; }
.btn:hover { background: var(--sunken); border-color: var(--ink); }
.btn.primary { background: var(--action-solid); border-color: var(--action-solid); color: #fff; }
.btn.primary:hover { background: #0f3f80; border-color: #0f3f80; }

/* ---- page head */
.page { padding-bottom: 56px; }
.pagehead { padding: 40px 0 32px; }
.pagehead h1 { font: 500 34px/1.15 var(--serif); letter-spacing: -.01em; }
.crumb { font-size: 14px; color: var(--ink-quiet); margin-bottom: 8px; }
.crumb a { color: var(--ink-quiet); }
.state { margin-top: 14px; }
.lede { margin-top: 12px; font-size: 17px; color: var(--ink-soft); max-width: 60ch; }
.pagehead .form { margin-top: 20px; }

/* ---- the stamp */
.stamp { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--inert-edge);
  background: var(--inert-tint); color: var(--ink); font: 600 12px/1.4 var(--sans); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.stamp .ic { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
.stamp.big { padding: 8px 14px; font-size: 14px; gap: 8px; }
.stamp.big .ic { width: 16px; height: 16px; }
.stamp.verified { border-color: var(--verified-edge); background: var(--verified-tint); color: var(--verified-ink); }
.stamp.waiting { border-color: var(--waiting-edge); background: var(--waiting-tint); color: var(--waiting-ink); }
.stamp.blocked { border-color: var(--blocked-edge); background: var(--blocked-tint); color: var(--blocked-ink); }

/* ---- open incidents: a uniform-bordered notice on its tint */
.notice { border: 1px solid var(--inert-edge); background: var(--inert-tint); padding: 16px 20px; margin: 0 0 24px; }
.notice.waiting { border-color: var(--waiting-edge); background: var(--waiting-tint); }
.notice.blocked { border-color: var(--blocked-edge); background: var(--blocked-tint); }
.notice-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 6px; }
.notice-head h2 { font: 500 21px/1.25 var(--serif); }
.notice-head h2 a { color: var(--ink); }
.notice-line { border: 1px solid var(--inert-edge); background: var(--inert-tint); padding: 10px 14px; margin-bottom: 16px; font-size: 15px; }
.notice-line.blocked { border-color: var(--blocked-edge); background: var(--blocked-tint); color: var(--blocked-ink); }
.notice-line.verified { border-color: var(--verified-edge); background: var(--verified-tint); color: var(--verified-ink); }

/* ---- margin spine and record column */
.spine { display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 32px; border-top: 1px solid var(--hair); padding-top: 24px; margin-top: 8px; }
.margin { border-right: 1px solid var(--hair); padding-right: 24px; padding-bottom: 24px; }
.margin .no { display: block; font: 400 15px var(--serif); color: var(--ink-quiet); }
.margin .lab { font: 600 15px/1.3 var(--sans); margin-top: 4px; }
.margin .meta { display: block; margin-top: 8px; font-size: 13px; color: var(--ink-quiet); }
.record { min-width: 0; padding-bottom: 24px; }

/* ---- components: ruled rows */
.crow { padding: 4px 0 18px; }
.crow + .crow { border-top: 1px solid var(--hair); padding-top: 18px; }
.crow-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crow-head h3 { font: 600 16px/1.3 var(--sans); }
.bars { display: flex; gap: 2px; height: 34px; margin: 14px 0 8px; }
.bars .day { flex: 1 1 0; min-width: 0; }
.day { position: relative; display: block; }
.day:hover { outline: 1px solid var(--ink); outline-offset: 0; }
.nodata { background: var(--hair); }
.future { background: transparent; border: 1px solid var(--hair); }
.future:hover { outline: 0; }
.g0 { background: #4C8A74; }
.g1 { background: #636A3A; }
.g2 { background: #6B5E24; }
.g3 { background: #715616; }
.g4 { background: #764E07; }
.g5 { background: #7F4A08; }
.g6 { background: #8B4917; }
.g7 { background: #974826; }
.g8 { background: #A34735; }
.g9 { background: #A43D35; }
.g10 { background: #992C26; }
.g11 { background: #8E1A17; }
.g12 { background: #830908; }
.g13 { background: #7E0000; }
.bar-legend { display: flex; align-items: center; gap: 10px; font: 400 12px/1.4 var(--mono); color: var(--ink-quiet); }
.bar-legend .rule { flex: 1; height: 1px; background: var(--hair); }
.bar-legend .fig { color: var(--ink); font-weight: 600; }
.w60, .w30 { display: none; }
.key { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--hair); }

/* ---- the day tooltip: paper on a 1px control rule; opens on hover and
   keyboard focus; a transparent bridge keeps it open while the pointer
   moves up into it to follow a related incident */
.tip { display: none; position: absolute; z-index: 10; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  width: 250px; padding: 12px 14px; background: var(--raised); color: var(--ink); border: 1px solid var(--control);
  font: 400 13px/1.45 var(--sans); text-align: left; cursor: default; }
.tip::after { content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px; }
.day:hover .tip, .day:focus .tip, .day:focus-within .tip { display: block; }
.r .tip { left: auto; right: -2px; transform: none; }
.tip .date { display: block; font: 600 12px var(--mono); margin-bottom: 8px; }
.tip .field { display: flex; justify-content: space-between; gap: 12px; padding: 5px 8px; margin-bottom: 4px; background: var(--sunken); }
.tip .k { font-weight: 600; }
.tip .k.blocked { color: var(--blocked-ink); }
.tip .k.waiting { color: var(--waiting-ink); }
.tip .v { font-variant-numeric: tabular-nums; }
.tip .msg { display: block; color: var(--ink-quiet); }
.tip .related { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--hair); }
.tip .related-h { display: block; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-quiet); margin-bottom: 2px; }
.tip .related a { display: block; font-weight: 600; }

/* ---- past incidents: a date column and the record */
.dayrow { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 14px 0; }
.dayrow + .dayrow { border-top: 1px solid var(--hair); }
.dayrow-date { font: 500 13px/1.6 var(--mono); color: var(--ink-quiet); }
.quiet { color: var(--ink-quiet); font-size: 15px; }
.incident + .incident { margin-top: 16px; }
.incident-title { font: 600 16px/1.35 var(--sans); }
.incident-title a { text-decoration: none; color: inherit; }
.incident-title a:hover { text-decoration: underline; }
.incident-title.blocked { color: var(--blocked-ink); }
.incident-title.waiting { color: var(--waiting-ink); }
.incident-title.neutral { color: var(--ink); }
.updates { margin-top: 6px; }
.update { padding: 8px 0; }
.update + .update { border-top: 1px solid var(--hair); }
.update p { font-size: 15px; }
.when { font: 400 12px/1.5 var(--mono); color: var(--ink-quiet); margin-top: 2px; }
.more { margin-top: 12px; font-size: 15px; font-weight: 600; }
.affected { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 16px; }

/* ---- historical uptime */
.tabs { display: flex; flex-wrap: wrap; margin-top: 20px; }
.tab { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 16px; border: 1px solid var(--control); margin: 0 -1px -1px 0;
  background: var(--raised); color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; }
.tab[aria-current="page"] { background: var(--action-tint); border-color: var(--action-edge); color: var(--action-ink); position: relative; z-index: 1; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 336px; }
.calendar .wd { font: 500 11px var(--mono); color: var(--ink-quiet); text-align: center; padding-bottom: 2px; }
.calendar .day { aspect-ratio: 1; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

/* ---- forms */
.form { display: grid; gap: 10px; max-width: 420px; }
.form label { font-size: 14px; font-weight: 600; }
.form input { min-height: var(--tap); padding: 0 12px; border: 1px solid var(--control); border-radius: 0; background: var(--raised); color: var(--ink); font: 400 16px var(--sans); }
.form .btn { justify-self: start; }
.fine { font-size: 13px; color: var(--ink-quiet); }
.links li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 10px 0; }
.links li + li { border-top: 1px solid var(--hair); }
.links a { font-weight: 600; }
.links .quiet { font-size: 14px; }

/* ---- footer */
.foot { border-top: 1px solid var(--hair); background: var(--raised); }
.foot-in { padding-top: 20px; padding-bottom: 28px; font-size: 13px; color: var(--ink-quiet); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 8px; }
.foot a { color: var(--ink-soft); }

/* ---- 90 days on wide screens, 60 on tablets, 30 on phones */
@media (min-width: 1025px) {
  .l90 .tip { left: -2px; transform: none; }
}
@media (max-width: 1024px) {
  .bars .old60 { display: none; }
  .w90 { display: none; } .w60 { display: inline; }
  .l60 .tip { left: -2px; transform: none; }
}
@media (max-width: 720px) {
  .spine { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .margin { border-right: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
  .margin .lab { margin-top: 0; }
  .margin .meta { margin-top: 0; width: 100%; }
  .dayrow { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
@media (max-width: 600px) {
  .bars .old30 { display: none; }
  .w60 { display: none; } .w30 { display: inline; }
  .l60 .tip { left: 50%; transform: translateX(-50%); }
  .l30 .tip { left: -2px; transform: none; }
  .bars { gap: 3px; }
  .topbar-in, .page, .foot-in { padding-left: 16px; padding-right: 16px; }
  .sub { display: none; }
  .topbar .btn { padding: 0 12px; font-size: 14px; }
  .pagehead { padding: 28px 0 24px; }
  .pagehead h1 { font-size: 28px; }
  .stamp.big { white-space: normal; }
  .tip { width: 220px; }
  .calendar { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; }
}
