/* BrightBots status page. Tokens, type, header and buttons follow brightdev-web/DESIGN.md and site.css; the
   only additions are the four state colours, which pass WCAG AA as text on --bg and --raised in both themes
   (light: working 4.7:1, partly 4.5:1, not working 5.1:1; dark: 7.7:1, 8.6:1, 6.6:1). */

@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 400 900; font-display: swap; src: url(fonts/schibsted-grotesk-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 400 900; font-display: swap; src: url(fonts/schibsted-grotesk-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/geist-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/geist-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #f7f7f4; --bg-sunk: #eeeeea; --raised: #fdfdfb;
  --ink: #16171a; --ink-2: #474a52; --ink-3: #62666f;
  --line: #e1e1db; --line-strong: #c4c4bc;
  --accent: #f2b33d; --accent-hover: #e8a52a; --on-accent: #16171a; --accent-text: #8a5400; --accent-soft: #f8e7c4;
  --focus: #16171a;
  --shadow: 0 1px 2px rgb(22 23 26 / 0.06), 0 16px 36px -16px rgb(22 23 26 / 0.24);

  --ok: #2f7d4f; --warn: #a4620a; --bad: #c0392f; --none: #d3d3cc;

  --font-display: 'Schibsted Grotesk', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-text: 'Geist', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --step--1: 0.875rem; --step-0: 1rem; --step-1: 1.125rem; --step-2: 1.375rem;
  --radius-s: 8px; --radius-m: 12px;
  --ease: cubic-bezier(0.2, 0, 0, 1); --fast: 150ms; --base: 220ms;
  --gutter: 16px; --max: 880px; --header-h: 64px;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0f1012; --bg-sunk: #15161a; --raised: #1b1c21;
  --ink: #ededef; --ink-2: #b5b8bf; --ink-3: #8e929b;
  --line: #26282d; --line-strong: #3a3d44;
  --accent: #f2b33d; --accent-hover: #f6c35f; --accent-text: #f5c566; --accent-soft: #3a2f1a;
  --focus: #f5c566;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 36px -16px rgb(0 0 0 / 0.7);
  --ok: #46b97a; --warn: #e0a33a; --bad: #f0726a; --none: #34363c;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1012; --bg-sunk: #15161a; --raised: #1b1c21;
    --ink: #ededef; --ink-2: #b5b8bf; --ink-3: #8e929b;
    --line: #26282d; --line-strong: #3a3d44;
    --accent: #f2b33d; --accent-hover: #f6c35f; --accent-text: #f5c566; --accent-soft: #3a2f1a;
    --focus: #f5c566;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 36px -16px rgb(0 0 0 / 0.7);
    --ok: #46b97a; --warn: #e0a33a; --bad: #f0726a; --none: #34363c;
    color-scheme: dark;
  }
}
@media (min-width: 768px) { :root { --gutter: 32px; --header-h: 72px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--font-text);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul[role='list'], ol[role='list'] { list-style: none; padding: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
.icon { width: 1.125em; height: 1.125em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 60;
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: var(--radius-s); text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

h1, h2, .comp-name {
  font-family: var(--font-display); font-weight: 650; color: var(--ink); text-wrap: balance;
}
.text-link {
  color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px; text-underline-offset: 0.22em; transition: text-decoration-color var(--fast) var(--ease);
}
.text-link:hover { text-decoration-color: currentColor; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; min-height: 44px; padding: 10px 1.125rem;
  border-radius: var(--radius-s); border: 1px solid transparent; font-weight: 600; font-size: 0.9375rem; line-height: 1.2;
  text-decoration: none; text-align: center; cursor: pointer;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.btn-quiet { border-color: var(--line-strong); color: var(--ink); background: var(--raised); }
.btn-quiet:hover { border-color: var(--ink-3); }
.btn-small { min-height: 36px; padding: 6px 0.875rem; font-size: 0.875rem; white-space: nowrap; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 12px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; font-size: 1.125rem; white-space: nowrap; color: var(--ink); }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.brand-label { color: var(--ink-3); font-weight: 500; font-size: 0.9375rem; padding-left: 12px; border-left: 1px solid var(--line-strong); line-height: 1.2; white-space: nowrap; }
.header-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-s);
  border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2);
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.icon-btn:hover { background: var(--bg-sunk); color: var(--ink); }
.header-site-link { margin-left: 8px; }
@media (max-width: 639px) { .header-site-link { display: none; } }
@media (max-width: 380px) { .brand-label { padding-left: 10px; } .site-header .wrap { gap: 10px; } }

.lang-menu { position: relative; }
.flag { display: inline-block; flex: none; width: 18px; height: 13px; border-radius: 2px; background: center / cover no-repeat; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.14); }
.flag-tr { background-image: url(img/flags/tr.svg); }
.flag-gb { background-image: url(img/flags/gb.svg); }
.flag-es { background-image: url(img/flags/es.svg); }
.flag-br { background-image: url(img/flags/br.svg); }
.flag-de { background-image: url(img/flags/de.svg); }
.flag-fr { background-image: url(img/flags/fr.svg); }
.lang-summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 8px 0 10px;
  border-radius: var(--radius-s); cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 0.8125rem; letter-spacing: 0.02em;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.lang-summary::-webkit-details-marker { display: none; }
.lang-summary:hover, .lang-menu[open] .lang-summary { background: var(--bg-sunk); color: var(--ink); }
.lang-summary .icon-chevron { width: 14px; height: 14px; transition: transform var(--fast) var(--ease); }
.lang-menu[open] .icon-chevron { transform: rotate(180deg); }
.lang-panel {
  margin: 0; position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 216px;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow);
  padding: 6px; display: grid; gap: 2px; transform-origin: top right; animation: menu-in var(--base) var(--ease);
}
.lang-panel a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 6px; text-decoration: none; font-weight: 500; font-size: 0.9375rem; color: var(--ink-2); }
.lang-panel a:hover { background: var(--bg-sunk); color: var(--ink); }
.lang-panel a[aria-current] { color: var(--ink); font-weight: 600; background: var(--bg-sunk); }
@keyframes menu-in { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
.theme-toggle .icon-sun { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-sun { display: block; }
:root[data-theme='dark'] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme='light']) .theme-toggle .icon-moon { display: none; }
}

/* State colours. Every state also has its own icon shape and its own words. */
[data-state='up'] { --state: var(--ok); }
[data-state='degraded'] { --state: var(--warn); }
[data-state='down'] { --state: var(--bad); }
[data-state='unknown'], [data-state='loading'] { --state: var(--ink-3); }

/* Summary: the one sentence that answers "is it working?" */
.summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding-block: 48px 40px; align-items: start; }
.summary-mark { color: var(--state); padding-top: 0.2em; }
.summary-mark .icon { width: 32px; height: 32px; stroke-width: 2; }
.summary h1 {
  font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.375rem); line-height: 1.12; letter-spacing: -0.024em;
  min-height: 2.24em; max-width: 30ch;
}
.meta { margin-top: 12px; color: var(--ink-3); font-size: var(--step--1); line-height: 1.55; max-width: 62ch; }
@media (min-width: 768px) {
  .summary { padding-block: 72px 56px; gap: 20px; }
  .summary-mark .icon { width: 36px; height: 36px; }
  .summary h1 { min-height: 1.12em; }
}

/* Services: ruled rows, the name beside the state, the bar under them. */
.services { padding-bottom: 56px; }
.services > h2, .incidents > h2 { font-size: var(--step-2); letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 16px; }
.components { border-top: 1px solid var(--line); }
.comp { padding-block: 20px 18px; border-bottom: 1px solid var(--line); }
.comp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.comp-name { font-size: var(--step-1); letter-spacing: -0.015em; line-height: 1.3; }
.badge { display: inline-flex; align-items: center; gap: 6px; color: var(--state); font-weight: 600; font-size: var(--step--1); line-height: 1.3; white-space: nowrap; }
.badge .icon { width: 16px; height: 16px; stroke-width: 2; align-self: center; }
.comp-text { margin-top: 4px; color: var(--ink-2); font-size: var(--step--1); line-height: 1.55; min-height: 1.55em; max-width: 70ch; }
.comp-text .reason { color: var(--ink); }
.comp-uptime { color: var(--ink-3); font-size: var(--step--1); line-height: 1.55; min-height: 1.55em; }

.bar { display: flex; gap: 2px; height: 30px; margin-top: 12px; touch-action: manipulation; }
.cell { flex: 1 1 0; min-width: 0; border-radius: 2px; background: var(--none); cursor: default; transition: opacity var(--fast) var(--ease); }
.cell[data-level='up'] { background: var(--ok); }
.cell[data-level='minor'] { background: var(--warn); }
.cell[data-level='major'] { background: var(--bad); }
.bar:hover .cell:not(:hover):not(.is-active) { opacity: 0.55; }
.cell.is-active { opacity: 1; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--ink); }
.cell:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus); }
.axis { display: flex; justify-content: space-between; gap: 16px; margin-top: 6px; color: var(--ink-3); font-size: 0.8125rem; line-height: 1.4; }
.axis-30 { display: none; }
@media (max-width: 639px) {
  .cell:nth-child(-n+60) { display: none; }
  .axis-90 { display: none; }
  .axis-30 { display: inline; }
}

/* A part (ticket translation) sits under its product, indented behind a hairline. */
.parts { margin-top: 20px; margin-left: 4px; padding-left: 20px; border-left: 2px solid var(--line); }
.parts .comp { padding-block: 2px 2px; border-bottom: 0; }
.parts .comp-name { font-family: var(--font-text); font-size: var(--step-0); font-weight: 600; letter-spacing: 0; }
.parts .bar { height: 22px; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; color: var(--ink-3); font-size: 0.8125rem; line-height: 1.4; }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 10px; height: 14px; border-radius: 2px; background: var(--none); flex: none; }
.swatch[data-level='up'] { background: var(--ok); }
.swatch[data-level='minor'] { background: var(--warn); }
.swatch[data-level='major'] { background: var(--bad); }
.legend-note { flex-basis: 100%; }

/* Tooltip: one for the whole page, above the cell, kept inside the viewport. */
.tooltip {
  position: absolute; z-index: 70; max-width: min(280px, calc(100vw - 16px)); padding: 10px 12px;
  background: var(--raised); color: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: var(--shadow);
  font-size: var(--step--1); line-height: 1.5; pointer-events: none;
}
.tooltip strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.tooltip span { display: block; }

/* Incidents: a sunk band with ruled rows, the date beside the account. */
.band { background: var(--bg-sunk); border-top: 1px solid var(--line); }
.incidents { padding-block: 48px 64px; }
.incident-list { border-top: 1px solid var(--line-strong); }
.incident { display: grid; gap: 4px 24px; padding-block: 18px; border-bottom: 1px solid var(--line-strong); }
.inc-date { color: var(--ink-3); font-size: var(--step--1); line-height: 1.55; }
.inc-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.inc-title h3 { font-family: var(--font-display); font-weight: 650; font-size: var(--step-0); letter-spacing: -0.01em; line-height: 1.4; }
.inc-kind { color: var(--ink-2); font-size: var(--step--1); font-weight: 500; }
.inc-status { font-size: var(--step--1); font-weight: 600; color: var(--ink-3); }
.incident[data-ongoing='true'] .inc-status { color: var(--state); }
.inc-text { color: var(--ink-2); font-size: 0.9375rem; line-height: 1.55; max-width: 66ch; }
.incidents-empty { color: var(--ink-2); padding-block: 18px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
@media (min-width: 640px) { .incident { grid-template-columns: 176px minmax(0, 1fr); } .inc-date { padding-top: 1px; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.footer-grid { display: grid; gap: 24px 48px; padding-block: 40px 32px; }
.footer-about p, .footer-help > p:first-child { color: var(--ink-2); font-size: 0.9375rem; margin-top: 12px; max-width: 46ch; }
.footer-help > p:first-child { margin-top: 0; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 16px; }
.footer-base { display: grid; gap: 4px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.8125rem; }
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .footer-base { grid-column: 1 / -1; grid-template-columns: auto auto; justify-content: space-between; }
}
.noscript { padding-block: 24px; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
