/* Status page styles - brand colours are overridden in brand.css (see brands.json). */
@font-face { font-family: "Manrope"; src: url("/fonts/manrope.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }

:root {
  --bg: #08090B;
  --card: #0F1115;
  --line: #1C1F26;
  --line-strong: #2A2E37;
  --text: #F2F4F7;
  --text-soft: #D5DAE2;
  --text-lede: #A3ACBB;
  --muted: #8A93A3;
  --accent: #2FA4E7;
  --ok: #3DD68C;
  --warn: #F5B54A;
  --down: #F0616D;
  --down-text: #F48A93;
  --empty: #1C1F26;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible, .history-range:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.eyebrow { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* Header */
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: 36px 0 32px; border-bottom: 1px solid var(--line); }
.logo-link { display: block; line-height: 0; }
.logo-link img { width: var(--logo-w, 168px); height: auto; display: block; }
.header-nav { display: flex; align-items: center; gap: 24px; font-size: 14px; font-weight: 500; }
.pill-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 11px 18px; border: 1px solid var(--line-strong); border-radius: 999px; }

/* Native history selector reuses the existing pill control and palette. */
.history-range { background: var(--card); color: var(--text); font: inherit; max-width: 100%; }

/* Hero */
.hero { padding: 72px 0 24px; }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.state-ok { background: rgba(61,214,140,.10); color: var(--ok); }
.state-ok .dot { box-shadow: 0 0 0 4px rgba(61,214,140,.18); }
.state-down { background: rgba(240,97,109,.12); color: var(--down-text); }
.state-down .dot { background: var(--down); box-shadow: 0 0 0 4px rgba(240,97,109,.20); }
.state-warn { background: rgba(245,181,74,.12); color: var(--warn); }
.state-warn .dot { box-shadow: 0 0 0 4px rgba(245,181,74,.18); }
.state-loading { background: rgba(138,147,163,.12); color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .state-ok .dot, .state-down .dot, .state-warn .dot { animation: pulse 2.4s ease-in-out infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
}
h1 { margin: 28px 0 0; font-size: clamp(2.25rem, 5vw, 3.75rem); line-height: 1.05; font-weight: 600; letter-spacing: -0.035em; max-width: 16ch; }
.lede { margin: 24px 0 0; max-width: 56ch; font-size: 18px; line-height: 1.6; color: var(--text-lede); }
.meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 32px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.meta span:empty { display: none; }

/* Blocks & cards */
.block { margin-bottom: 24px; }
.block-label { margin: 0 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.card .block-label { margin-bottom: 18px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.badge { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--muted); padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 999px; }
.badge:empty { display: none; }

/* Notice */
.notice.is-down { background: #120D0F; border-color: #3A1E23; }
.notice.is-warn { background: #13100A; border-color: #3A2F1C; }
.notice.is-resolved { background: #0B1310; border-color: #1C3A2B; }
.notice.is-unknown { background: var(--card); border-color: var(--line-strong); }
.service-status.s-unknown { color: var(--muted); }
.bars .b-unknown { background: #4B5260; }
.notice-body { margin: 14px 0 0; max-width: 62ch; font-size: 16px; line-height: 1.6; color: var(--text-soft); white-space: pre-line; }
.timeline { list-style: none; margin: 28px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.timeline:empty { display: none; }
.timeline li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; font-size: 15px; line-height: 1.5; color: var(--text-soft); }
.timeline time { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 1px; }

/* Services */
.service + .service { margin-top: 16px; }
.service { padding: 28px 28px 24px; }
.service-name { display: flex; flex-direction: column; gap: 4px; }
.service-url { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.service-status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.service-status .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.service-status.s-up { color: var(--ok); }
.service-status.s-down { color: var(--down-text); }
.service-status.s-down .dot { background: var(--down); }
.service-status.s-warn { color: var(--warn); }
.bars { display: flex; gap: 3px; height: 36px; margin-top: 24px; }
.bars span { flex: 1 1 0; min-width: 2px; border-radius: 3px; background: var(--empty); }
.bars .b-up { background: var(--ok); }
.bars .b-down { background: var(--down); }
.bars .b-warn { background: var(--warn); }
.bars .b-maint { background: var(--accent); }
.bars span[data-kind] { cursor: default; transition: filter .12s ease, transform .12s ease; transform-origin: bottom; }
.bars span[data-kind]:hover, .bars span.is-active { filter: brightness(1.3); transform: scaleY(1.12); }

/* Bar hover card */
.bar-tip { position: fixed; z-index: 50; min-width: 168px; max-width: calc(100% - 16px); padding: 10px 12px; border-radius: 12px; background: #16191F; border: 1px solid var(--line-strong); box-shadow: 0 12px 32px rgba(0,0,0,.5); pointer-events: none; font-size: 13px; line-height: 1.4; }
.bar-tip::after { content: ""; position: absolute; left: var(--arrow-x, 50%); bottom: -6px; width: 10px; height: 10px; margin-left: -5px; background: inherit; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); transform: rotate(45deg); }
.bar-tip.below::after { bottom: auto; top: -6px; transform: rotate(-135deg); }
.bar-tip-time { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.bar-tip-status { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.bar-tip-status .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bar-tip-ping { margin-top: 4px; font-family: var(--mono); font-size: 12px; color: var(--text-lede); }
.t-up { background: var(--ok); } .t-down { background: var(--down); } .t-warn { background: var(--warn); }
.t-maint { background: var(--accent); } .t-unknown { background: #4B5260; }
@media (prefers-reduced-motion: reduce) { .bars span[data-kind] { transition: none; } }

.bars-legend { display: flex; justify-content: space-between; margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Info grid */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.info-row { display: flex; gap: 14px; align-items: flex-start; }
.info-row svg { flex: none; margin-top: 1px; }
.info-row p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--text-soft); }
.info-row p + p { margin-top: 10px; }
.icon-ok { color: var(--ok); }
.icon-muted { color: var(--muted); }
.maint-item strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }

/* Footer */
.site-footer { margin-top: 96px; padding: 32px 0 48px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; font-size: 14px; }
.contact { display: flex; flex-wrap: wrap; gap: 8px 28px; font-weight: 500; }
.contact a { color: var(--accent); }
.contact a:hover { color: var(--text); }

/* Phone */
@media (max-width: 600px) {
  .wrap { padding: 0 20px; }
  .site-header { padding: 24px 0 20px; }
  .logo-link img { width: var(--logo-w-sm, 132px); }
  .header-nav .eyebrow { display: none; }
  .hero { padding: 48px 0 24px; }
  h1 { font-size: 36px; line-height: 1.08; letter-spacing: -0.03em; }
  .lede { font-size: 16px; }
  .meta { flex-direction: column; gap: 6px; font-size: 12px; }
  .card, .service { padding: 20px; border-radius: 18px; }
  .bars { gap: 2px; height: 30px; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .site-footer { flex-direction: column-reverse; align-items: flex-start; margin-top: 64px; }
  .contact { flex-direction: column; gap: 4px; }
  .contact a { padding: 10px 0; }
}

/* Response chart: existing palette/spacing, with intrinsic desktop and phone aspect ratios. */
.response-panel { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.response-plot { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 12px; }
.response-scale { display: flex; flex-direction: column; justify-content: space-between; }
.response-graph { display: block; width: 100%; aspect-ratio: 4 / 1; }
.response-grid { stroke: var(--line-strong); stroke-width: 1; pointer-events: none; }
.response-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; pointer-events: none; }
.response-dot { fill: var(--accent); stroke: var(--accent); stroke-width: 2; pointer-events: none; }
.response-point { fill: transparent; cursor: crosshair; }
.response-point:focus-visible, .response-point.is-active { fill: var(--accent); fill-opacity: .1; outline: 2px solid var(--accent); outline-offset: -2px; }
.response-plot .bars-legend { grid-column: 2; }
@media (max-width: 600px) { .response-graph { aspect-ratio: 2 / 1; } }

/* Clearer check details and one compact heading/filter row. */
.hero .meta { margin-top: 24px; gap: 12px; font-family: var(--sans); font-size: 14px; color: var(--text-soft); }
.hero .meta .pill-link { background: var(--card); max-width: 100%; }
.history-controls h2 { margin: 0; }
.history-filter { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-soft); }
@media (max-width: 600px) {
  .history-filter { flex-direction: column; align-items: stretch; gap: 8px; width: 100%; }
  .history-filter .history-range { width: 100%; }
  .hero .meta { align-items: flex-start; }
}

/* Prominent period metrics reuse the existing type sizes, spacing and text palette. */
.period-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; font-family: var(--sans); color: var(--text); }
.metric-label { font-size: 16px; font-weight: 500; color: var(--text-soft); }
.metric-value { font-size: 36px; font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; color: var(--text); }
@media (max-width: 600px) { .period-metrics { grid-template-columns: 1fr; } }
