:root {
  color-scheme: light dark;
  --bg: #f5f3ec;
  --surface: #fbfaf5;
  --surface-2: #efede5;
  --text: #17150f;
  --muted: #67655b;
  --faint: #646258;
  --line: #ddd9cd;
  --line-strong: #c4bfb2;
  --brand: #c1352b;
  --brand-strong: #a72c22;
  --wash: rgb(255 106 75 / 7%);
  --heat: linear-gradient(96deg, #ff3d7f, #ff6a4b 55%, #ffb03a);
  --panel-shadow: 0 1px 2px rgb(23 21 15 / 4%);
  --green: #17824f;
  --green-soft: #e1f3e9;
  --amber: #a86400;
  --amber-soft: #fff0cf;
  --orange: #bf4b18;
  --orange-soft: #ffe4d5;
  --red: #bf2b2b;
  --red-soft: #ffe1df;
  --radius: 16px;
  --radius-small: 10px;
  --display: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  --body: "Hanken Grotesk", sans-serif;
}

.dark {
  --bg: #0c1a24;
  --surface: #12242e;
  --surface-2: #172e3a;
  --text: #f7f7f7;
  --muted: #c3c3c3;
  --faint: #949494;
  --line: #1e3a45;
  --line-strong: #2a4c58;
  --brand: #ff8a75;
  --brand-strong: #ffb3a6;
  --wash: rgb(255 106 75 / 8%);
  --panel-shadow: none;
  --green: #66d79b;
  --green-soft: rgb(40 171 99 / 14%);
  --amber: #ffc368;
  --amber-soft: rgb(255 179 58 / 13%);
  --orange: #ff9569;
  --orange-soft: rgb(255 112 54 / 15%);
  --red: #ff7d79;
  --red-soft: rgb(255 82 82 / 15%);
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --bg: #0c1a24;
    --surface: #12242e;
    --surface-2: #172e3a;
    --text: #f7f7f7;
    --muted: #c3c3c3;
    --faint: #949494;
    --line: #1e3a45;
    --line-strong: #2a4c58;
    --brand: #ff8a75;
    --brand-strong: #ffb3a6;
    --wash: rgb(255 106 75 / 8%);
    --panel-shadow: none;
    --green: #66d79b;
    --green-soft: rgb(40 171 99 / 14%);
    --amber: #ffc368;
    --amber-soft: rgb(255 179 58 / 13%);
    --orange: #ff9569;
    --orange-soft: rgb(255 112 54 / 15%);
    --red: #ff7d79;
    --red-soft: rgb(255 82 82 / 15%);
  }
}

* { box-sizing: border-box; }
html { font-size: 106.25%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-underline-offset: 0.18em; }
a:hover { color: var(--brand); }
a:focus-visible, button:focus-visible, .day:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 70%, transparent); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 20; top: 0.75rem; left: 0.75rem; transform: translateY(-5rem); padding: 0.6rem 0.9rem; border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: var(--surface); font-weight: 700; }
.skip-link:focus { transform: translateY(0); }
.page-shell { min-height: 100vh; background: radial-gradient(62rem 32rem at 100% 0%, var(--wash), transparent 68%); }
.site-header, main, footer { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; min-height: 5.25rem; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--text); font-family: var(--display); font-size: 1.15rem; font-weight: 700; letter-spacing: -0.035em; text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-logo { display: block; width: 2.15rem; height: 2.15rem; flex: none; background: currentColor; -webkit-mask: url("/assets/celeris-mark-2aa44a36fc0d.svg") center / contain no-repeat; mask: url("/assets/celeris-mark-2aa44a36fc0d.svg") center / contain no-repeat; }
.brand-name { font-size: 1.25rem; line-height: 1; }
.brand-status { padding-left: 0.65rem; border-left: 1px solid var(--line-strong); color: var(--muted); font-family: var(--body); font-size: 0.88rem; font-weight: 500; letter-spacing: 0; }
.brand-logo.large { width: 3.2rem; height: 3.2rem; }
.header-actions { display: flex; align-items: center; gap: 1rem; }
nav { display: flex; align-items: center; gap: 1.5rem; font-size: 0.9rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a[aria-current="page"] { color: var(--text); font-weight: 700; }
.theme-btn { display: grid; width: 2rem; height: 2rem; flex: none; cursor: pointer; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); transition: border-color 150ms ease-out, background-color 150ms ease-out, color 150ms ease-out; }
.theme-btn:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }
.theme-btn svg { display: none; width: 1rem; height: 1rem; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn.theme-system .theme-monitor, .theme-btn.theme-light .theme-sun, .theme-btn.theme-dark .theme-moon { display: block; }
main { display: grid; gap: 1rem; padding-block: clamp(2.25rem, 5vw, 4rem); }
h1, h2, h3 { font-family: var(--display); color: var(--text); text-wrap: balance; }
h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 600; line-height: 1; letter-spacing: -0.035em; }
h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 1.85rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.032em; }
h3 { margin: 0; font-size: 1.15rem; line-height: 1.25; letter-spacing: -0.015em; }
.confidence { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, auto); gap: 3rem; align-items: end; overflow: hidden; padding: clamp(1.5rem, 4vw, 2.5rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--panel-shadow); }
.confidence::after { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 2px; background: var(--heat); }
.confidence-state { display: flex; align-items: center; gap: 1.2rem; }
.confidence-state .state-icon { width: clamp(2.3rem, 5vw, 3.8rem); height: clamp(2.3rem, 5vw, 3.8rem); stroke-width: 1.5; }
.confidence-time { display: flex; flex-direction: column; gap: 0.35rem; padding-bottom: 0.35rem; color: var(--muted); font-size: 0.9rem; }
.confidence-time > span:first-child { color: var(--text); font-weight: 700; }
.time-pair { display: inline-flex; flex-wrap: wrap; gap: 0.2rem 0.65rem; }
.local-time { color: var(--muted); }
.local-time:not(:empty)::before { content: "Local "; color: var(--faint); }
.state-icon { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.state-major_outage, .state-major_outage .state-icon { color: var(--red); }
.state-partial_outage, .state-partial_outage .state-icon { color: var(--orange); }
.state-degraded_performance, .state-degraded_performance .state-icon { color: var(--amber); }
.state-operational, .state-operational .state-icon { color: var(--green); }
.components, .incidents, .history-strip { padding: clamp(1.35rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--panel-shadow); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.35rem; }
.section-heading p { max-width: 34rem; margin: 0; color: var(--muted); }
.component-group { display: grid; grid-template-columns: minmax(10rem, 0.34fr) minmax(0, 1fr); gap: 2rem; border-top: 1px solid var(--line-strong); }
.component-group > h3 { padding: 1.4rem 0; color: var(--muted); font-size: 0.95rem; font-weight: 600; }
.component-row { display: flex; align-items: center; justify-content: space-between; gap: 2rem; min-height: 4.6rem; border-bottom: 1px solid var(--line); color: var(--text); }
.component-row > div:first-child { display: flex; flex-direction: column; gap: 0.06rem; }
.component-row strong { font-size: 1.04rem; }
.component-row > div:first-child span { color: var(--muted); font-size: 0.86rem; }
.component-reading { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--green); font-size: 0.9rem; font-weight: 700; }
.component-row.state-degraded_performance .component-reading { color: var(--amber); }
.component-row.state-partial_outage .component-reading { color: var(--orange); }
.component-row.state-major_outage .component-reading { color: var(--red); }
.incident { padding: 1.8rem 0 0; border-top: 1px solid var(--line-strong); }
.incident + .incident { margin-top: 3rem; }
.incident-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; }
.incident-head > div { display: flex; flex-direction: column; gap: 0.45rem; }
.incident-head > span { color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.incident-state { display: inline-flex; align-self: flex-start; width: fit-content; border-radius: 999px; padding: 0.12rem 0.58rem; background: var(--surface-2); font-size: 0.76rem; font-weight: 750; }
.incident-state.state-major_outage { background: var(--red-soft); }
.incident-state.state-partial_outage { background: var(--orange-soft); }
.incident-state.state-degraded_performance { background: var(--amber-soft); }
.affected { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.9rem; }
.incident-started { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.82rem; }
.incident-timeline { position: relative; margin: 1.8rem 0 0; padding: 0; list-style: none; }
.incident-timeline::before { content: ""; position: absolute; top: 0.62rem; bottom: 0.8rem; left: 0.32rem; width: 1px; background: var(--line-strong); }
.incident-timeline li { position: relative; display: grid; grid-template-columns: 0.7rem minmax(0, 1fr); gap: 1.1rem; }
.incident-timeline li + li { margin-top: 1.55rem; }
.timeline-pin { position: relative; z-index: 1; width: 0.7rem; height: 0.7rem; margin-top: 0.38rem; border: 2px solid var(--surface); border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.timeline-content { max-width: 46rem; }
.timeline-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1.5rem; color: var(--muted); font-size: 0.82rem; }
.timeline-meta strong { color: var(--text); }
.timeline-content p { margin: 0.4rem 0 0; white-space: pre-line; }
.empty-state { border-block: 1px solid var(--line); padding: 1.4rem 0; color: var(--muted); }
.day-rail { display: grid; grid-template-columns: repeat(30, minmax(0.25rem, 1fr)); gap: clamp(0.18rem, 0.5vw, 0.42rem); }
.day { position: relative; min-height: 2.9rem; border-radius: 0.24rem; background: var(--green); }
.day.state-degraded_performance { border-block: 0.72rem solid var(--surface); background: var(--amber); }
.day.state-partial_outage { border: 2px solid var(--orange); background: transparent; }
.day.state-major_outage { border-radius: 999px 999px 0.24rem 0.24rem; background: var(--red); }
.day::after { content: attr(data-label); position: absolute; z-index: 5; bottom: calc(100% + 0.55rem); left: 50%; width: max-content; max-width: 14rem; padding: 0.35rem 0.55rem; border: 1px solid var(--line-strong); border-radius: 0.4rem; background: var(--surface); color: var(--text); font-size: 0.75rem; line-height: 1.35; opacity: 0; pointer-events: none; transform: translate(-50%, 0.25rem); }
.day:hover::after, .day:focus::after { opacity: 1; transform: translate(-50%, 0); }
.day:first-child::after { left: 0; transform: translate(0, 0.25rem); }
.day:first-child:hover::after, .day:first-child:focus::after { transform: translate(0, 0); }
.day:last-child::after { right: 0; left: auto; transform: translate(0, 0.25rem); }
.day:last-child:hover::after, .day:last-child:focus::after { transform: translate(0, 0); }
.history-legend { display: flex; flex-wrap: wrap; gap: 0.85rem 1.25rem; margin-top: 1rem; color: var(--muted); font-size: 0.78rem; }
.history-legend span { display: inline-flex; align-items: center; gap: 0.36rem; }
.history-legend i { display: inline-block; width: 0.62rem; height: 0.78rem; border-radius: 0.1rem; background: currentColor; }
.history-legend i.state-operational { color: var(--green); }
.history-legend i.state-degraded_performance { height: 0.24rem; color: var(--amber); }
.history-legend i.state-partial_outage { border: 2px solid var(--orange); background: transparent; }
.history-legend i.state-major_outage { border-radius: 999px 999px 0.1rem 0.1rem; color: var(--red); }
.text-link, .back-link { display: inline-flex; margin-top: 1.75rem; color: var(--brand); font-weight: 750; text-decoration: none; }
.page-intro { max-width: 46rem; margin-bottom: 1rem; padding: clamp(1.35rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--panel-shadow); }
.page-intro p, .incident-detail-head p, .not-found p { color: var(--muted); font-size: 1.05rem; }
.archive { padding-inline: clamp(1.35rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--panel-shadow); }
.archive-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, auto); gap: 2rem; align-items: center; padding: 1.65rem 0; border-bottom: 1px solid var(--line); }
.archive-row > div:first-child { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.5rem 1rem; align-items: center; }
.archive-row h2 { font-size: 1.2rem; }
.archive-row p { grid-column: 2; margin: 0; color: var(--muted); font-size: 0.86rem; }
.archive-date { display: grid; gap: 0.35rem; color: var(--muted); font-size: 0.83rem; text-align: right; }
.incident-detail { max-width: 54rem; padding: clamp(1.35rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--panel-shadow); }
.incident-detail-head { margin-top: 2rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--line-strong); }
.incident-detail-head h1 { margin-top: 0.75rem; font-size: clamp(2.4rem, 6vw, 4.6rem); }
.incident-detail-head .incident-duration { font-size: 0.88rem; }
.incident-detail .incident-timeline { margin-top: 2.5rem; }
.not-found { display: flex; min-height: 55vh; flex-direction: column; align-items: flex-start; justify-content: center; max-width: 40rem; padding: clamp(1.35rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--panel-shadow); }
.not-found h1 { margin-top: 1.5rem; }
footer { display: flex; justify-content: space-between; gap: 2rem; padding-block: 2rem 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8rem; }
footer p { margin: 0; }
.revision { text-align: right; }

@media (max-width: 760px) {
  .site-header { align-items: flex-start; min-height: auto; padding-block: 1.35rem; }
  .header-actions { align-items: flex-end; gap: 0.75rem; }
  nav { align-items: flex-end; flex-direction: column; gap: 0.35rem; }
  nav a:nth-child(3) { display: none; }
  html { font-size: 100%; }
  main { padding-block: 1.5rem 3rem; }
  .confidence, .section-heading, .component-group, .archive-row { grid-template-columns: 1fr; }
  .confidence { gap: 1.5rem; }
  .confidence-state { align-items: flex-start; }
  .component-group { gap: 0; }
  .component-group > h3 { padding-bottom: 0.6rem; }
  .component-row { min-height: 4.2rem; }
  .component-reading span { max-width: 8.5rem; text-align: right; }
  .incident-head { flex-direction: column; gap: 0.6rem; }
  .day-rail { gap: 0.16rem; }
  .day { min-height: 2.25rem; }
  .archive-row { gap: 0.9rem; }
  .archive-date { text-align: left; }
  footer { flex-direction: column; }
  .revision { text-align: left; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .day::after { transition: opacity 120ms ease-out, transform 120ms ease-out; }
  .confidence-state .state-icon { animation: status-settle 700ms cubic-bezier(0.16, 1, 0.3, 1) both; }
  @keyframes status-settle { from { clip-path: circle(22% at 50% 50%); filter: blur(2px); } to { clip-path: circle(75% at 50% 50%); filter: blur(0); } }
}

@media print {
  .site-header nav, .skip-link, footer { display: none; }
  .page-shell { background: #fff; }
  body { color: #111; background: #fff; }
  main { padding-block: 2rem; }
}
