/* kalman.nz's one stylesheet, for the home page and the status page, so
   they can't drift apart. Plain CSS, no build. The Kalman fonts and palette,
   a reset, then the parts: a dark hero card (the same on every page), tables
   drawn the way R2 draws its lists, and the status page's box. A page sets
   its own column widths on its <col>s, as R2's tables do. Each product's own
   page is on its own site (R2's at r2.kalman.nz). */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-medium-latin.woff2") format("woff2");
}
:root {
  --carbon: #0e1114;
  --graphite: #22272e;
  --paper: #f2f2ee;
  --steel: #8a939e;
  --signal: #ff5b14;
  --signal-ink: #c43f05;
  --gray-100: #ededea;
  --gray-200: #e0e1dd;
  --gray-300: #c9cccb;
  --gray-500: #5f6773;
  --gray-600: #4b525c;
  --sans: "Archivo", Arial, Helvetica, sans-serif;
  --mono: "IBM Plex Mono", Menlo, Consolas, monospace;
  --wrap: 1440px;
  --gutter: clamp(20px, 4vw, 48px);
}
/* Ultrawides: a little more of the screen, as R2 takes. */
@media (min-width: 2400px) {
  :root { --wrap: 1640px; }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.5; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; padding: 0; }
h1, h2, h3 { font-weight: inherit; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
::selection { background: var(--signal); color: var(--carbon); }

/* Tables are drawn as R2 draws its lists (r2
   web/src/components/DataTable.tsx): a white card, 13px rows on one line,
   a rule round every cell. Once a table's areas have several rows each, a
   column can become group rows instead, as R2 groups a list. */
body {
  background: var(--paper);
  color: var(--carbon);
  font-size: 14px;
}
main .wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: var(--gutter);
}
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
}

/* ---------- Hero card ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  gap: 40px 64px;
  align-items: end;
  padding: clamp(28px, 3.4vw, 48px);
  background: var(--carbon);
  border-color: var(--carbon);
  color: var(--paper);
}
.hero .logo img {
  display: block;
  height: 28px;
  width: auto;
  /* The artwork's margin, a seventh of its height, taken back. */
  margin: -4px;
}
.hero h1 {
  margin-top: clamp(40px, 5vw, 72px);
  font-size: clamp(36px, 4.6vw, 64px);
  font-weight: 700;
  font-stretch: 112.5%;
  letter-spacing: -0.03em;
  line-height: 1;
}
.hero p {
  max-width: 34em;
  margin-top: 18px;
  font-size: 15px;
  color: rgba(242, 242, 238, 0.66);
}
.hero dl {
  border-top: 1px solid rgba(242, 242, 238, 0.16);
}
.hero dl > div {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  padding: 9px 0;
  border-bottom: 1px solid rgba(242, 242, 238, 0.16);
}
.hero dt {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 21px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
}
.hero a {
  color: var(--paper);
  text-underline-offset: 3px;
}
.hero a:hover {
  color: var(--signal);
}

/* ---------- Tabs ---------- */
/* The site's pages as R2's underlined tabs (r2 web/src/components/Tabs.tsx):
   Products (the home page and each product's page) and Status. */
.tabs {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  margin-top: 16px;
  border-bottom: 1px solid var(--gray-200);
}
.tabs a {
  margin-bottom: -1px;
  padding: 0 4px 10px;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.tabs a:hover {
  border-bottom-color: var(--gray-300);
  color: var(--carbon);
}
.tabs a[aria-current="page"] {
  border-bottom-color: var(--signal);
  color: var(--carbon);
}

/* ---------- Tables ---------- */
.table {
  overflow: hidden;
}
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  text-align: left;
}
th,
td {
  padding: 6px 12px;
  border-right: 1px solid var(--gray-200);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
th:last-child,
td:last-child {
  border-right: 0;
}
thead th {
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-300);
  background: #f7f7f4;
  font-weight: 500;
  color: var(--gray-500);
}
tbody tr {
  border-bottom: 1px solid var(--gray-200);
}
tbody tr:last-child {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fafaf8;
}
tr[data-href] {
  cursor: pointer;
}
tbody th[scope="row"] {
  font-weight: 600;
}
td {
  color: var(--gray-600);
}
td.main {
  color: var(--carbon);
}
td a {
  color: var(--signal-ink);
  text-decoration: none;
}
td a:hover {
  text-decoration: underline;
}
/* A product's status (Available, Coming soon in gray) and, on the status
   page, a monitor's, gray until it's read (site.js); the colours are R2's
   Lock, Fault, Warn and Data. A tick is one day in the status page's Recent
   column, today on the right; older days are cut off on the left when the
   column's too narrow for them all. */
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  vertical-align: 1px;
  background: var(--gray-300);
}
.dot.available, .dot.up, .tick.up { background: #2fd27a; }
.dot.down, .tick.down { background: #e5322d; }
.dot.degraded, .tick.degraded { background: #ffb020; }
.dot.maintenance, .tick.maintenance { background: #19c3e6; }
.tick.empty { background: var(--gray-100); }
.none {
  color: var(--gray-300);
}
.ticks {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  overflow: hidden;
}
/* Each tick shares the column's width, between 3px and 8px, so a wide
   screen shows every day without a gap. */
.tick {
  flex: 1 1 0;
  min-width: 3px;
  max-width: 8px;
  height: 14px;
  border-radius: 1px;
  background: var(--gray-300);
}

/* ---------- The status page ---------- */
/* One status box, as at the top of Kener's status page: the overall line
   with when it was read, then any incidents and maintenance. It
   takes the colour of the overall state when not everything is up (R2's
   soft shades), so it reads at a glance; each notice's label takes its
   own. */
.overall .headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding: 14px 20px;
}
.overall .value {
  font-size: 18px;
  font-weight: 600;
}
.overall .dot {
  width: 9px;
  height: 9px;
  margin-right: 9px;
}
.overall .aside {
  font-size: 13px;
  color: var(--gray-500);
}
.overall.degraded { background: #fff6e0; border-color: #ffb020; }
.overall.down { background: #fdecec; border-color: #e5322d; }
.overall.maintenance { background: #e8f8fc; border-color: #19c3e6; }
.notices:empty {
  display: none;
}
.notice {
  padding: 14px 20px 16px;
  border-top: 1px solid rgba(14, 17, 20, 0.1);
}
/* A notice's label (its kind and when) above its title, as R2's eyebrow. */
.notice .eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0b7a93;
}
.notice.down .eyebrow { color: #c42520; }
.notice.degraded .eyebrow { color: #8a5300; }
.notice h3 {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}
.notice .text {
  max-width: 60em;
  margin-top: 4px;
  font-size: 15px;
  color: var(--carbon);
  white-space: pre-line;
}
.notice .affects {
  margin-top: 6px;
  font-size: 13px;
  color: var(--gray-500);
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  padding-top: 28px;
  padding-bottom: 28px;
  font-size: 13px;
  color: var(--gray-500);
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Phones: each row a block of labelled lines, no sideways scroll. A cell
   without a label (a two-column table's value) takes the whole line. */
@media (max-width: 760px) {
  table,
  tbody,
  tr,
  th,
  td {
    display: block;
  }
  thead,
  colgroup {
    display: none;
  }
  th,
  td {
    border-right: 0;
    white-space: normal;
  }
  tbody tr {
    padding: 6px 0 10px;
  }
  tbody th[scope="row"] {
    font-size: 15px;
    padding-top: 8px;
  }
  tbody td {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1fr);
    gap: 12px;
    padding-top: 3px;
    padding-bottom: 3px;
  }
  tbody td::before {
    content: attr(data-label);
    color: var(--gray-500);
  }
  tbody td:not([data-label]) {
    display: block;
  }
  tbody td:not([data-label])::before {
    content: none;
  }
}
