@font-face {
  font-family: "Tokay";
  src: url("/assets/Tokay.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/assets/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Brand values from tokay.io's global.css: Tokay display headings, 3px
   corners, the logo's gradient under the header. Colour is reserved for
   state; surfaces stay neutral. */
:root {
  color-scheme: light dark;
  --bg: #f8fbfc;
  --surface: #fff;
  --fg: #0e1111;
  --soft: #596463;
  --faint: #8a9493;
  --border: #dfe8ea;
  --link: #0c7d8c;
  --operational: #11a36a;
  --maintenance: #5078c0;
  --partial: #e08a00;
  --major: #d02f45;
  --none: #e1e8ea;
  --brand: linear-gradient(90deg, #ab0071, #da617f, #f89c50);
  --radius: 3px;
  --display: "Tokay", Inter, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e0e;
    --surface: #111616;
    --fg: #e8eeee;
    --soft: #9aa6a5;
    --faint: #6d7877;
    --border: #222b2b;
    --link: #3fc4d3;
    --none: #222b2b;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum";
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

main, .wrap, .site-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */

.site-header {
  border-bottom: 2px solid transparent;
  border-image: var(--brand) 1;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--fg);
  font-family: var(--display);
  font-weight: 500;
  font-size: 16px;
}

.brand:hover { text-decoration: none; }
.brand svg { height: 24px; width: auto; color: var(--fg); }
.brand-divider { width: 1px; height: 18px; background: var(--border); }

.button {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 10px;
}

.button:hover { text-decoration: none; border-color: var(--fg); }

/* Type */

h1, h3 { font-family: var(--display); font-weight: 600; }
h1 { font-size: 28px; letter-spacing: -0.02em; line-height: 1.2; margin: 40px 0 24px; }
h3 { font-size: 15px; margin: 0; }

/* Mono label with a hairline running to the right edge. */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 48px 0 14px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.section-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.quiet { color: var(--soft); margin: 0; font-size: 13px; }

/* State marker: a small square, echoing the bars, with a ring that pulses
   while something is wrong. */

.dot {
  position: relative;
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: var(--faint);
}

[data-state="operational"] .dot { background: var(--operational); }
[data-state="maintenance"] .dot { background: var(--maintenance); color: var(--maintenance); }
[data-state="partial"] .dot { background: var(--partial); color: var(--partial); }
[data-state="major"] .dot { background: var(--major); color: var(--major); }
[data-state="unknown"] .dot { background: none; border: 1px solid var(--faint); }

[data-state="maintenance"] .dot::after,
[data-state="partial"] .dot::after,
[data-state="major"] .dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid currentColor;
  border-radius: 2px;
  animation: ping 2s ease-out infinite;
}

@keyframes ping {
  0% { transform: scale(0.8); opacity: 0.8; }
  80%, 100% { transform: scale(1.8); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dot::after { animation: none !important; }
}

/* Summary: an open statement, not a banner. */

.summary-text {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 0;
}

.summary-text .dot { width: 12px; height: 12px; border-radius: 2px; }

.summary-note {
  margin: 10px 0 0 26px;
  max-width: 560px;
  font-size: 14px;
  color: var(--soft);
}

.summary-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 0;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--soft);
}

.summary-meta:empty { display: none; }

/* Components */

.components {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.component { padding: 16px 20px 14px; }
.component + .component { border-top: 1px solid var(--border); }

.component-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.component-head .quiet { font-size: 12.5px; margin-top: 1px; }

.component-state {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--soft);
  white-space: nowrap;
}

/* Uptime bars slant like the strokes in the Tokay mark. */
.bars {
  display: flex;
  gap: 2px;
  height: 24px;
  margin-top: 14px;
  padding: 0 4px;
}

.bars span {
  flex: 1;
  border-radius: 1px;
  background: var(--none);
  transform: skewX(-12deg);
}

.bars span:hover { filter: brightness(0.85); }
.bars span[data-day="operational"] { background: var(--operational); }
.bars span[data-day="maintenance"] { background: var(--maintenance); }
.bars span[data-day="partial"] { background: var(--partial); }
.bars span[data-day="major"] { background: var(--major); }

.bars span[tabindex] { cursor: pointer; }
.bars span:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* The hover card for incident days. */
.day-card {
  position: absolute;
  z-index: 10;
  width: max-content;
  max-width: min(320px, calc(100vw - 16px));
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.08);
  font-size: 13px;
}

.day-card-date { margin: 0; font-family: var(--mono); font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.day-card-stats { margin: 6px 0 0; font-family: var(--mono); font-size: 12px; color: var(--soft); }
.day-card ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.day-card li { display: flex; align-items: baseline; gap: 8px; }
.day-card li a { color: var(--fg); }
.day-card .pill { flex: none; }

.bars-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.bars-foot .uptime { color: var(--soft); }
.bars-foot .short { display: none; }

/* Phones show the last 30 days. */
@media (max-width: 600px) {
  h1 { font-size: 23px; }
  .bars span:nth-child(-n+60) { display: none; }
  .bars-foot .long { display: none; }
  .bars-foot .short { display: inline; }
  .summary-meta { flex-direction: column; gap: 4px; }
  .incident-head { flex-direction: column; }
}

/* Incidents */

.incident {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
}

.incident-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.incident h1 { font-size: 24px; margin: 0; }
.incident h3 a, .incident h1 a { color: var(--fg); }
.incident .window { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--soft); }
.incident .meta { margin: 2px 0 14px; color: var(--soft); font-size: 13px; }

.pills { display: flex; gap: 6px; flex: none; }

.pill {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 18px;
  padding: 0 6px;
  border: 1px solid currentColor;
  border-radius: 2px;
  color: var(--soft);
}

.pill[data-impact="partial"] { color: var(--partial); }
.pill[data-impact="major"] { color: var(--major); }
.pill[data-impact="maintenance"] { color: var(--maintenance); }
.pill[data-resolved="true"] { color: var(--faint); }

/* Updates sit on a timeline rail with a square marker each. */
.update {
  position: relative;
  margin-top: 12px;
  padding-left: 18px;
  border-left: 1px solid var(--border);
}

.update::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--surface);
  border: 1px solid var(--faint);
}

.meta + .update::before { background: var(--faint); }

.update-head { margin: 0; font-size: 13px; }
.update-head time { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-left: 8px; }
.update p { margin: 4px 0; }

/* Footer */

.site-footer {
  margin-top: 64px;
  padding-top: 20px;
  padding-bottom: 40px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.site-footer a { color: var(--soft); }
