/* Statussiden (statusside.py). Samme fargetokens, skrifter og uttrykk som markedssiden (site/src/site.css),
   men uten byggesteg: siden serveres fra overvåkingsserveren, ikke fra produksjonen. Lys og mørk etter
   systemets valg. Statusfargene har alltid ikon og tekst ved siden av. */
@font-face {
  font-family: "Instrument Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url(/fonts/instrument-sans-latin-wght-normal.woff2) format("woff2-variations");
}
@font-face {
  font-family: "Geist Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/geist-mono-latin-wght-normal.woff2) format("woff2-variations");
}

:root {
  color-scheme: light dark;
  --page: light-dark(#ffffff, #09090b);
  --bg: light-dark(#f5f5f8, #0d0d10);
  --surface: light-dark(#ffffff, #111114);
  --ink: light-dark(#121218, #ededf0);
  --ink-2: light-dark(#3d3d48, #c3c3cb);
  --muted: light-dark(#666673, #94949e);
  --line: light-dark(#e3e3ea, #26262c);
  --accent: light-dark(#136f8f, #5bb8d8);
  --accent-soft: light-dark(#ecf5f8, #12222a);
  --danger: light-dark(#b42318, #f97066);
  --danger-soft: light-dark(#fdecea, #2a1515);
  --success: light-dark(#1f7a4d, #5cc995);
  --success-soft: light-dark(#e3f3ea, #12261c);
  --warning: light-dark(#a15c07, #f5b544);
  --warning-soft: light-dark(#fdf3e2, #2a2010);
  /* Stolpene: mettere enn teksten, og tydelig ulike også for fargeblinde (grønn/gul/rød med lyshet). */
  --bar-ok: light-dark(#2f9e68, #3fb57c);
  --bar-warn: light-dark(#e0a526, #d99a1e);
  --bar-down: light-dark(#c8352a, #e5574b);
  --bar-none: light-dark(#e3e3ea, #26262c);
  --shadow-hairline: 0 1px 2px light-dark(rgb(18 18 30 / 0.06), rgb(0 0 0 / 0.4));
  --shadow-card: 0 1px 2px light-dark(rgb(18 18 30 / 0.04), rgb(0 0 0 / 0.3)), 0 18px 44px -26px light-dark(rgb(30 58 110 / 0.3), rgb(0 0 0 / 0.8));
  --sans: "Instrument Sans Variable", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--page); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: light-dark(rgb(19 111 143 / 0.18), rgb(91 184 216 / 0.3)); }
[hidden] { display: none !important; }

.wrap { max-width: 56rem; margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 640px) { .wrap { padding: 0 2rem; } }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 450;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.badge-outline {
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
  border-radius: 3px;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 15px;
  font-weight: 450;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Toppen, som markedssiden. */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 80%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.top-in { display: flex; align-items: center; gap: 0.75rem; height: 4rem; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 0.625rem; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.logo { width: 1.75rem; height: 1.75rem; flex: none; }
.login {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  height: 2.25rem;
  padding: 0 0.875rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  box-shadow: var(--shadow-hairline);
  font-size: 14.5px;
  font-weight: 600;
  transition: background-color 120ms;
}
.login:hover { background: light-dark(#f3f3f7, #1a1a1f); }

/* Hovedbudskapet: svakt rutenett som tones ut, som forsiden (uten lyset). */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: 3.5rem 0 2.5rem; }
@media (min-width: 640px) { .hero { padding: 5rem 0 3rem; } }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(light-dark(rgb(19 111 143 / 0.07), rgb(91 184 216 / 0.06)) 1px, transparent 1px),
    linear-gradient(90deg, light-dark(rgb(19 111 143 / 0.07), rgb(91 184 216 / 0.06)) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center -1px;
  mask-image: radial-gradient(ellipse 70% 75% at 60% 0%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 75% at 60% 0%, #000 10%, transparent 75%);
}
.headline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
@media (min-width: 640px) { .headline { font-size: 48px; gap: 1rem; } }
.headline-icon { width: 1.875rem; height: 1.875rem; flex: none; align-self: flex-start; margin-top: 0.125rem; }
@media (min-width: 640px) { .headline-icon { width: 2.75rem; height: 2.75rem; align-self: center; margin-top: 0; } }
.headline-ok .headline-icon { color: var(--success); }
.headline-redusert .headline-icon, .headline-ukjent .headline-icon { color: var(--warning); }
.headline-nede .headline-icon { color: var(--danger); }
.headline-vedlikehold .headline-icon { color: var(--accent); }
.lead { margin-top: 1.25rem; max-width: 40rem; font-size: 18px; line-height: 1.4; color: var(--muted); text-wrap: pretty; }
@media (min-width: 640px) { .lead { font-size: 21px; } }
.meta { margin-top: 1.25rem; max-width: 40rem; font-size: 14.5px; color: var(--muted); text-wrap: pretty; }
.stale {
  margin-top: 1.25rem;
  max-width: 40rem;
  border-radius: 0.75rem;
  background: var(--warning-soft);
  padding: 0.75rem 1rem;
  font-size: 15px;
  color: var(--ink);
}

.block { padding-bottom: 3.5rem; }
.block > .eyebrow, .block-head { margin-bottom: 1rem; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; }
.legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 0.375rem; }
.legend i { width: 0.625rem; height: 0.625rem; border-radius: 2px; }
.feed { font-size: 14px; font-weight: 500; color: var(--accent); }
.feed:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Tjenestene: ett kort med hårfine skiller. */
.services {
  border: 1px solid var(--line);
  border-radius: 0.875rem;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.service { padding: 1.25rem 1.25rem 1rem; }
@media (min-width: 640px) { .service { padding: 1.5rem 1.5rem 1.125rem; } }
.service + .service { border-top: 1px solid var(--line); }
.service-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.service h3 { font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; }
.service-head p { margin-top: 0.125rem; font-size: 14px; color: var(--muted); }
.state {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.375rem;
  height: 1.75rem;
  padding: 0 0.625rem 0 0.5rem;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}
.state-icon { width: 1.125rem; height: 1.125rem; }
.state-ok { background: var(--success-soft); color: var(--success); }
.state-redusert { background: var(--warning-soft); color: var(--warning); }
.state-nede { background: var(--danger-soft); color: var(--danger); }
.state-vedlikehold { background: var(--accent-soft); color: var(--accent); }
.state-ukjent { background: var(--bg); color: var(--muted); }

/* Oppetid per dag: tynne stolper med 2 px mellomrom. På små skjermer bare de siste 30 dagene. */
.bars { display: flex; gap: 2px; height: 2.125rem; margin-top: 1rem; }
.bars i, .legend i { display: block; background: var(--bar-none); }
.bars i { font-style: normal; position: relative; flex: 1 1 0; min-width: 0; border-radius: 2px; transition: opacity 120ms; }
.bars i.ok, .legend i.ok { background: var(--bar-ok); }
.bars i.warn, .legend i.warn { background: var(--bar-warn); }
.bars i.down, .legend i.down { background: var(--bar-down); }
.bars:hover i { opacity: 0.55; }
.bars i:hover { opacity: 1; }
.bars i:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  width: max-content;
  max-width: 16rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 450;
  line-height: 1.45;
  white-space: pre-line;
  pointer-events: none;
}
.bars i.l:hover::after { left: 0; transform: none; }
.bars i.r:hover::after { left: auto; right: 0; transform: none; }
.axis { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.5rem; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.axis span:nth-child(3) { color: var(--ink-2); font-weight: 500; }
.axis .narrow { display: none; }
@media (max-width: 639.98px) {
  .bars i:nth-child(-n+60) { display: none; }
  .axis .wide { display: none; }
  .axis .narrow { display: inline; }
}

/* Hendelser. */
.incident {
  border: 1px solid var(--line);
  border-radius: 0.875rem;
  background: var(--surface);
  padding: 1.25rem;
}
@media (min-width: 640px) { .incident { padding: 1.5rem; } }
.incident + .incident { margin-top: 0.75rem; }
.incident-active { border-color: color-mix(in srgb, var(--warning) 45%, var(--line)); box-shadow: var(--shadow-card); }
.incident-maintenance, .incident-planned { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.incident-past { background: transparent; }
.incident-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.incident h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
/* Tid og berørte tjenester: under hverandre på mobil, på én linje med hårfin skillestrek ellers. */
.incident-meta { display: flex; flex-direction: column; gap: 0.125rem; margin-top: 0.25rem; font-size: 14px; color: var(--muted); }
@media (min-width: 640px) {
  .incident-meta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0; }
  .incident-meta span + span { margin-left: 0.75rem; padding-left: 0.75rem; border-left: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); line-height: 1.1; }
}
.pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 1.5rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.pill-warn { background: var(--warning-soft); color: var(--warning); }
.pill-info { background: var(--accent-soft); color: var(--accent); }
.pill-muted { background: var(--bg); color: var(--muted); }
.updates { margin-top: 1rem; border-left: 1px solid var(--line); padding-left: 1rem; }
.updates li + li { margin-top: 0.875rem; }
.updates time { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; color: var(--muted); }
.updates p { margin-top: 0.125rem; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.empty {
  border: 1px dashed var(--line);
  border-radius: 0.875rem;
  padding: 1.25rem;
  font-size: 15px;
  color: var(--muted);
}

.foot { border-top: 1px solid var(--line); }
.foot-in { padding-top: 2rem; padding-bottom: 2.25rem; font-size: 14px; color: var(--muted); }
.foot-top { display: flex; flex-direction: column; gap: 1.25rem; }
.foot-brand { display: inline-flex; align-items: center; gap: 0.5rem; width: fit-content; font-size: 15px; font-weight: 600; color: var(--ink); }
.foot-brand .logo { width: 1.375rem; height: 1.375rem; }
/* Mobil: lenkene under hverandre med god klikkflate. Bredere: på én linje til høyre, med hårfine
   skillestreker (venstrekanten på hvert ledd; første ledd har ingen). */
.foot-links { display: flex; flex-direction: column; gap: 0.75rem; color: var(--ink-2); }
.foot-note { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; text-wrap: pretty; }
@media (min-width: 640px) {
  .foot-top { flex-direction: row; align-items: center; justify-content: space-between; gap: 1.5rem; }
  .foot-links { flex-direction: row; gap: 0; }
  .foot-links li { padding: 0 0.875rem; border-left: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); line-height: 1.1; }
  .foot-links li:first-child { padding-left: 0; border-left: 0; }
  .foot-links li:last-child { padding-right: 0; }
  .foot-note { margin-top: 1.25rem; }
}
.foot a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (forced-colors: active) {
  .bars i { border: 1px solid CanvasText; }
  .bars i.down, .legend i.down { background: CanvasText; }
}
