:root {
  color-scheme: light dark;
  --rp-foundation-color-smoke-50: #FFFFFF;
  --rp-foundation-color-smoke-100: #FAFAFA;
  --rp-foundation-color-smoke-200: #F7F8FA;
  --rp-foundation-color-smoke-300: #E5E7EB;
  --rp-foundation-color-graphite-500: #6B7280;
  --rp-foundation-color-graphite-700: #4B5563;
  --rp-foundation-color-graphite-900: #17191C;
  --rp-foundation-color-action-primary: #17191C;
  --rp-foundation-color-action-primary-in-dark: #F7F8FA;
  --rp-foundation-color-hue-red: #E03E45;
  --rp-foundation-color-hue-orange: #D26707;
  --rp-foundation-color-hue-yellow: #AC8211;
  --rp-foundation-color-hue-green: #32A155;
  --rp-foundation-color-hue-teal: #149D99;
  --rp-foundation-color-hue-blue: #4087EE;
  --rp-foundation-color-hue-indigo: #7C77EC;
  --rp-foundation-color-hue-purple: #A867D5;
  --rp-foundation-color-hue-pink: #D4558E;
  --rp-foundation-color-state-attention: #AC8211;
  --rp-foundation-color-state-paused: #6B7280;
  --rp-foundation-color-state-success: #32A155;
  --rp-foundation-color-state-unread: #4087EE;
  --rp-foundation-color-state-risk: #E03E45;
  --rp-foundation-space-xs: 4px;
  --rp-foundation-space-sm: 8px;
  --rp-foundation-space-md: 16px;
  --rp-foundation-space-lg: 24px;
  --rp-foundation-space-xl: 32px;
  --rp-foundation-space-2xl: 48px;
  --rp-foundation-space-3xl: 64px;
  --rp-foundation-radius-control: 12px;
  --rp-foundation-radius-panel: 28px;
  --rp-foundation-radius-pill: 999px;
  --rp-foundation-size-control: 32px;
  --rp-foundation-size-control-nested: 24px;
  --rp-foundation-size-menu-row: 28px;
  --rp-foundation-size-touch-target: 44px;
  --rp-foundation-elevation-panel: 0 20px 60px rgba(10, 11, 13, 0.08);
  --rp-foundation-elevation-lifted: 0 24px 80px rgba(10, 11, 13, 0.12);
  --rp-foundation-motion-feedback: 140ms;
  --rp-foundation-motion-quick: 160ms;
  --rp-foundation-motion-standard: 240ms;
  --rp-foundation-motion-settle: 320ms;
  --rp-foundation-motion-spring: 340ms;
  --rp-foundation-motion-spring-sheet: 600ms;
  --rp-foundation-ease-standard: cubic-bezier(0.22, 0, 0.12, 1);
  --rp-foundation-ease-settle: cubic-bezier(0.22, 1, 0.36, 1);
  --rp-foundation-ease-pop: cubic-bezier(0.34, 1.36, 0.64, 1);
  --rp-foundation-ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --rp-selection-mark-fill: #4087EE;
  --rp-selection-mark-foreground: #FFFFFF;
  --rp-state-attention: #AC8211;
  --rp-state-paused: #6B7280;
  --rp-state-success: #32A155;
  --rp-state-unread: #4087EE;
  --rp-state-risk: #E03E45;
  --rp-space-dense: 8px;
  --rp-space-stack: 16px;
  --rp-space-section: 24px;
  --rp-space-panel: 32px;
  --rp-radius-control: 12px;
  --rp-radius-panel: 28px;
  --rp-radius-pill: 999px;
  --rp-elevation-panel: 0 20px 60px rgba(10, 11, 13, 0.08);
  --rp-elevation-lifted: 0 24px 80px rgba(10, 11, 13, 0.12);
  --rp-motion-feedback: 140ms;
  --rp-motion-quick: 160ms;
  --rp-motion-standard: 240ms;
  --rp-motion-settle: 320ms;
  --rp-motion-spring: 340ms;
  --rp-motion-spring-sheet: 600ms;
  --rp-ease-standard: cubic-bezier(0.22, 0, 0.12, 1);
  --rp-ease-settle: cubic-bezier(0.22, 1, 0.36, 1);
  --rp-ease-pop: cubic-bezier(0.34, 1.36, 0.64, 1);
  --rp-ease-exit: cubic-bezier(0.4, 0, 1, 1);
}

:root, [data-ripple-theme="light"], [data-ripple-theme="dark"] {
  --rp-surface-canvas: light-dark(#FAFAFA, #202124);
  --rp-surface-soft: light-dark(#F7F8FA, #26292C);
  --rp-surface-panel: light-dark(rgba(255, 255, 255, 0.94), rgba(38, 41, 44, 0.96));
  --rp-surface-overlay: light-dark(rgba(255, 255, 255, 0.82), rgba(17, 19, 21, 0.88));
  --rp-surface-emphasis: light-dark(#17191C, #F7F8FA);
  --rp-text-primary: light-dark(#17191C, #F7F8FA);
  --rp-text-secondary: light-dark(#4B5563, #D1D5DB);
  --rp-text-muted: light-dark(#6B7280, #9CA3AF);
  --rp-text-description: light-dark(#737373, #A3A3A3);
  --rp-text-inverse: light-dark(#FFFFFF, #F7F8FA);
  --rp-icon-primary: light-dark(#17191C, #F7F8FA);
  --rp-icon-secondary: light-dark(#4B5563, #D1D5DB);
  --rp-icon-inverse: light-dark(#FFFFFF, #F7F8FA);
  --rp-border-subtle: light-dark(rgba(10, 11, 13, 0.08), rgba(247, 248, 250, 0.14));
  --rp-border-strong: light-dark(rgba(10, 11, 13, 0.12), rgba(247, 248, 250, 0.22));
  --rp-border-emphasis: light-dark(#17191C, #F7F8FA);
  --rp-action-primary: light-dark(#17191C, #F7F8FA);
  --rp-tint-neutral-fill: light-dark(rgba(23, 25, 28, 0.07), rgba(247, 248, 250, 0.09));
  --rp-tint-neutral-ink: light-dark(#4B5563, #D1D5DB);
  --rp-tint-neutral-swatch: light-dark(rgba(107, 114, 128, 0.35), rgba(107, 114, 128, 0.55));
  --rp-tint-red-fill: light-dark(rgba(224, 62, 69, 0.12), rgba(224, 62, 69, 0.16));
  --rp-tint-red-ink: light-dark(#B4363C, #EC8B8F);
  --rp-tint-red-swatch: light-dark(rgba(224, 62, 69, 0.35), rgba(224, 62, 69, 0.55));
  --rp-tint-orange-fill: light-dark(rgba(210, 103, 7, 0.12), rgba(210, 103, 7, 0.16));
  --rp-tint-orange-ink: light-dark(#A9560C, #E4A46A);
  --rp-tint-orange-swatch: light-dark(rgba(210, 103, 7, 0.35), rgba(210, 103, 7, 0.55));
  --rp-tint-yellow-fill: light-dark(rgba(172, 130, 17, 0.12), rgba(172, 130, 17, 0.16));
  --rp-tint-yellow-ink: light-dark(#8B6B13, #CDB470);
  --rp-tint-yellow-swatch: light-dark(rgba(172, 130, 17, 0.35), rgba(172, 130, 17, 0.55));
  --rp-tint-green-fill: light-dark(rgba(50, 161, 85, 0.12), rgba(50, 161, 85, 0.16));
  --rp-tint-green-ink: light-dark(#2C8348, #84C799);
  --rp-tint-green-swatch: light-dark(rgba(50, 161, 85, 0.35), rgba(50, 161, 85, 0.55));
  --rp-tint-teal-fill: light-dark(rgba(20, 157, 153, 0.12), rgba(20, 157, 153, 0.16));
  --rp-tint-teal-ink: light-dark(#15807E, #72C4C2);
  --rp-tint-teal-swatch: light-dark(rgba(20, 157, 153, 0.35), rgba(20, 157, 153, 0.55));
  --rp-tint-blue-fill: light-dark(rgba(64, 135, 238, 0.12), rgba(64, 135, 238, 0.16));
  --rp-tint-blue-ink: light-dark(#376FC0, #8CB7F5);
  --rp-tint-blue-swatch: light-dark(rgba(64, 135, 238, 0.35), rgba(64, 135, 238, 0.55));
  --rp-tint-indigo-fill: light-dark(rgba(124, 119, 236, 0.12), rgba(124, 119, 236, 0.16));
  --rp-tint-indigo-ink: light-dark(#6662BE, #B0ADF4);
  --rp-tint-indigo-swatch: light-dark(rgba(124, 119, 236, 0.35), rgba(124, 119, 236, 0.55));
  --rp-tint-purple-fill: light-dark(rgba(168, 103, 213, 0.12), rgba(168, 103, 213, 0.16));
  --rp-tint-purple-ink: light-dark(#8856AC, #CBA4E6);
  --rp-tint-purple-swatch: light-dark(rgba(168, 103, 213, 0.35), rgba(168, 103, 213, 0.55));
  --rp-tint-pink-fill: light-dark(rgba(212, 85, 142, 0.12), rgba(212, 85, 142, 0.16));
  --rp-tint-pink-ink: light-dark(#AA4875, #E599BB);
  --rp-tint-pink-swatch: light-dark(rgba(212, 85, 142, 0.35), rgba(212, 85, 142, 0.55));
}

[data-ripple-theme="light"] { color-scheme: light; }
[data-ripple-theme="dark"] {
  color-scheme: dark;
}

/*
 * Ripple's status page, after the signed-out pages' shell (apps/web PublicPage). The Worker serves this
 * file after the shared design tokens, so every color and motion below comes from them.
 */

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

@font-face {
  font-family: "Berkeley Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/berkeley-mono.otf") format("opentype");
}

:root {
  /* The web app's page and grouped-panel fills (apps/web/src/styles/ripple-tokens.css), which the
     shared tokens don't carry. */
  --status-page-fill: light-dark(#ffffff, #26292c);
  --status-panel-fill: light-dark(color-mix(in srgb, #17191c 3%, #f7f8fa), rgba(255, 255, 255, 0.055));
  --status-font-sans: "Inter", "SF Pro Display", "Helvetica Neue", sans-serif;
  --status-font-mono: "Berkeley Mono", "SF Mono", "SFMono-Regular", ui-monospace, monospace;
  /* A day apart from the one before it. */
  --status-run-gap: 2px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--status-page-fill);
  color: var(--rp-text-primary);
  font-family: var(--status-font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a {
  color: inherit;
}

:is(a, summary, .day):focus-visible {
  outline: 2px solid var(--rp-text-muted);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Ripple's mono voice (apps/web MetaLabel): a capitalized heading names a group, a figure is a time,
   a duration or a count. */
.label {
  margin: 0;
  color: var(--rp-text-muted);
  font-family: var(--status-font-mono);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.figure,
time {
  font-family: var(--status-font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* The page: a top bar, the content, and a footer that keeps to the foot of the screen. */
.page {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--rp-space-section);
  padding-block: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-bottom, 0px));
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
}

.top {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rp-space-stack);
}

.home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.mark {
  display: block;
  height: 16px;
  width: auto;
  aspect-ratio: 190 / 224;
}

.follow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 4px;
  color: var(--rp-text-secondary);
  font-size: 13px;
  font-weight: 450;
  text-decoration: none;
  transition: color var(--rp-motion-feedback) var(--rp-ease-standard);
}

.follow:hover {
  color: var(--rp-text-primary);
}

.main {
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
  display: grid;
  align-content: start;
  gap: var(--rp-space-panel);
  padding-block: var(--rp-space-section) 40px;
}

.hero {
  display: grid;
  gap: 8px;
}

.hero p {
  margin: 0;
}

.hero h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero-date {
  color: var(--rp-text-muted);
}

.sub {
  color: var(--rp-text-muted);
}

.sub time {
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
}

.announcement {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--status-panel-fill);
  color: var(--rp-text-secondary);
  text-wrap: pretty;
}

/* A state on its hue's tint (apps/web StatusPill). */
.pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding-inline: 8px;
  border-radius: var(--rp-radius-pill);
  background: var(--tone-fill);
  color: var(--tone-ink);
  outline: 1px solid transparent;
  outline-offset: -1px;
  font-size: 12px;
  font-weight: 450;
  line-height: 1;
  white-space: nowrap;
}

.pill svg {
  flex: none;
  margin-inline-start: -2px;
}

[data-tone="green"] { --tone-fill: var(--rp-tint-green-fill); --tone-ink: var(--rp-tint-green-ink); }
[data-tone="yellow"] { --tone-fill: var(--rp-tint-yellow-fill); --tone-ink: var(--rp-tint-yellow-ink); }
[data-tone="red"] { --tone-fill: var(--rp-tint-red-fill); --tone-ink: var(--rp-tint-red-ink); }
[data-tone="neutral"] { --tone-fill: var(--rp-tint-neutral-fill); --tone-ink: var(--rp-tint-neutral-ink); }

/* What's going on now leads, on the tint of its worst state. */
.incident {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--tone-fill);
  color: var(--tone-ink);
}

.incident header {
  display: grid;
  gap: 8px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.incident .pill {
  background: color-mix(in srgb, var(--tone-ink) 12%, transparent);
}

.incident h2 {
  margin: 0;
  color: var(--rp-text-primary);
  font-size: 15px;
  font-weight: 500;
  text-wrap: balance;
}

.window {
  margin: 0;
  color: var(--rp-text-secondary);
  font-size: 13px;
}

.window time {
  font-size: 12px;
}

/* Updates, newest first, on a line of dots. */
.updates {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.updates li {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 2px;
}

.updates li::before {
  content: "";
  grid-row: span 2;
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
}

.updates li:first-child::before {
  opacity: 1;
}

.updates time {
  color: var(--rp-text-muted);
  line-height: 15px;
}

.message p {
  margin: 0;
  color: var(--rp-text-secondary);
  font-size: 13.5px;
  text-wrap: pretty;
}

.message p + p {
  margin-top: 6px;
}

/* Each part on its own card inside one grouped panel. */
.parts ul {
  margin: 0;
  padding: 6px;
  list-style: none;
  display: grid;
  gap: 4px;
  border-radius: 20px;
  background: var(--status-panel-fill);
}

.part {
  display: grid;
  gap: 12px;
  padding: 14px 14px 12px;
  border-radius: 15px;
  background: var(--status-page-fill);
}

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

.part-name {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.part-name h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.part-name p {
  margin: 0;
  color: var(--rp-text-muted);
  font-size: 13px;
  text-wrap: pretty;
}

.uptime {
  padding-top: 2px;
  color: var(--rp-text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

/*
 * The ribbon: a column per day. Quiet days of one state run together; a new state starts a new run
 * after a small gap, and every run has round ends. Hovering or focusing a day reads it out over the
 * axis, so nothing floats past the page's edges.
 */
.history {
  position: relative;
  display: grid;
  gap: 8px;
}

.ribbon {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  height: 10px;
}

/* Fills are opaque so each day can paint a pixel over the one before, closing the hairline seams
   that fractional columns leave. */
.day {
  background: var(--day-fill);
  transition: background var(--rp-motion-feedback) var(--rp-ease-standard);
}

.day:not(.start) {
  box-shadow: -1px 0 0 var(--day-fill);
}

.day.start {
  border-start-start-radius: var(--rp-radius-pill);
  border-end-start-radius: var(--rp-radius-pill);
}

.day.start:not(:first-child) {
  margin-inline-start: var(--status-run-gap);
}

.day.end {
  border-start-end-radius: var(--rp-radius-pill);
  border-end-end-radius: var(--rp-radius-pill);
}

/* A filter would contain the reading below, so hover darkens the fill instead. */
.day:hover {
  background: color-mix(in srgb, var(--day-fill) 84%, var(--rp-text-primary));
}

.day[data-state="operational"] { --day-fill: color-mix(in srgb, var(--rp-state-success) 72%, var(--status-page-fill)); }
.day[data-state="not_monitored"] { --day-fill: color-mix(in srgb, var(--rp-text-primary) 7%, var(--status-page-fill)); }
.day[data-state="degraded"] { --day-fill: var(--rp-state-attention); }
.day[data-state="downtime"] { --day-fill: var(--rp-state-risk); }
.day[data-state="maintenance"] { --day-fill: color-mix(in srgb, var(--rp-text-muted) 45%, var(--status-page-fill)); }

/* Focus from a tap reads out too; only the ring waits for the keyboard. */
.day:hover::after,
.day:focus::after {
  content: attr(data-reading);
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  background: var(--status-page-fill);
  color: var(--rp-text-primary);
  font-size: 11.5px;
  line-height: 16px;
  pointer-events: none;
}

.axis {
  display: flex;
  justify-content: space-between;
  color: var(--rp-text-muted);
  font-size: 11.5px;
  line-height: 16px;
}

/* Words for the range a ribbon shows: all its days, or the phone's latest. */
.phone-only {
  display: none;
}

/* Past incidents open in place. */
.past {
  display: grid;
  gap: 8px;
}

.past .label {
  padding-inline: 12px;
}

.past-list {
  display: grid;
  gap: 2px;
}

.past-incident summary {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  list-style: none;
  transition: background var(--rp-motion-feedback) var(--rp-ease-standard);
}

.past-incident summary::-webkit-details-marker {
  display: none;
}

.past-incident summary:hover {
  background: var(--status-panel-fill);
}

.past-incident summary time,
.past-duration {
  color: var(--rp-text-muted);
}

.past-duration {
  white-space: nowrap;
}

.past-incident summary svg {
  color: var(--rp-text-muted);
  transition: rotate var(--rp-motion-standard) var(--rp-ease-settle);
}

.past-incident[open] summary svg {
  rotate: 90deg;
}

.past-incident .updates {
  padding: 4px 12px 14px 78px;
  color: var(--rp-text-muted);
}

.footer {
  display: grid;
  justify-items: center;
  color: var(--rp-text-muted);
  font-size: 12px;
  text-align: center;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: var(--rp-space-stack);
}

.footer a {
  border-radius: 2px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.18em;
}

.footer a:hover {
  color: var(--rp-text-secondary);
  text-decoration-color: currentColor;
}

/* Phones show the latest 30 days, matching PHONE_DAYS in page.ts. */
@media (max-width: 559px) {
  .hero h1 {
    font-size: 28px;
  }

  .day:nth-last-child(n + 31) {
    display: none;
  }

  .day:nth-last-child(30) {
    margin-inline-start: 0;
    border-start-start-radius: var(--rp-radius-pill);
    border-end-start-radius: var(--rp-radius-pill);
  }

  .wide-only {
    display: none;
  }

  .phone-only {
    display: inline;
  }

  .past-incident summary {
    grid-template-columns: 48px minmax(0, 1fr) auto 14px;
  }

  .past-incident .updates {
    padding-inline-start: 70px;
  }
}

@media (forced-colors: active) {
  .day {
    forced-color-adjust: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
  }
}
