/*
 * The marketing site's look, by hand rather than through its Tailwind sheet: the
 * same three faces (latin subsets copied from its build, OFL — see
 * fonts/LICENSE.md), the same achromatic greys, and the one petrol accent, used
 * here for the one thing it means on the site — something that is ON.
 *
 * Light only, like bracemark.com.
 */

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/inter-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(/fonts/bricolage-grotesque-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/ibm-plex-mono-400-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/ibm-plex-mono-500-latin.woff2) format('woff2');
}

:root {
  color-scheme: light;

  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.54 0 0);
  --border: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --radius: 0.625rem;

  --signal: oklch(0.43 0.062 205);
  --signal-strong: oklch(0.36 0.062 205);
  --signal-soft: oklch(0.968 0.014 205);
  --signal-line: oklch(0.9 0.028 205);

  /* Status colours exist only here. Each is paired with a word on the page, so
     none of them carries meaning alone. */
  --down: oklch(0.577 0.245 27.325);
  --down-soft: oklch(0.971 0.013 17.38);
  --down-line: oklch(0.885 0.062 18.334);
  --minor: oklch(0.769 0.165 70.08);
  --incident: oklch(0.555 0.163 48.998);
  --incident-soft: oklch(0.987 0.022 95.277);
  --incident-line: oklch(0.924 0.12 95.746);
  --none: oklch(0.922 0 0);

  --font-sans: Inter, ui-sans-serif, system-ui, sans-serif;
  --font-display: 'Bricolage Grotesque', Inter, ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.75rem;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ol,
ul {
  margin: 0;
}
ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--signal);
  text-decoration: underline;
  text-decoration-color: var(--signal-line);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--signal-strong);
  text-decoration-color: currentColor;
}
a:focus-visible {
  outline: 3px solid color-mix(in oklch, var(--ring) 50%, transparent);
  outline-offset: 2px;
  border-radius: 2px;
}

.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 {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--foreground);
  color: var(--background);
  border-radius: calc(var(--radius) - 2px);
  z-index: 10;
}
.skip:focus {
  top: 1rem;
}

.wrap {
  max-width: 48rem;
  margin: 0 auto;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}
@media (min-width: 768px) {
  .wrap {
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
  }
}

/* header */

.site-header {
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--foreground);
  text-decoration: none;
}
.brand:hover {
  color: var(--foreground);
}
.mark {
  height: 1.75rem;
  width: auto;
}
.wordmark {
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.brand-tag,
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.brand-tag {
  padding-left: 0.625rem;
  border-left: 1px solid var(--border);
}
.header-link {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-decoration: none;
}
.header-link:hover {
  color: var(--foreground);
}

/* hero */

.hero {
  padding: 3.5rem 0 2.5rem;
}
.hero .eyebrow + h1 {
  margin-top: 0.75rem;
}
.hero h1 {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 5vw, 2.75rem);
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero-dot {
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 999px;
  background: var(--none);
}
.hero--up .hero-dot {
  background: var(--signal);
  box-shadow: 0 0 0 6px var(--signal-soft);
}
.hero--down .hero-dot {
  background: var(--down);
  box-shadow: 0 0 0 6px var(--down-soft);
}
.hero--incident .hero-dot {
  background: var(--incident);
  box-shadow: 0 0 0 6px var(--incident-soft);
}
.checked {
  margin-top: 1rem;
  color: var(--muted-foreground);
}
.checked time {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--foreground);
}
.stale {
  color: var(--incident);
}

/* sections */

.block {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}
.block > .eyebrow {
  margin-bottom: 1.25rem;
}

/* services */

.services {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.service {
  padding: 1.25rem;
}
.service + .service {
  border-top: 1px solid var(--border);
}
.service-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.service-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.75rem;
}
.service h3 {
  font-size: 1rem;
  font-weight: 600;
}
.host {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.service-desc {
  margin-top: 0.25rem;
  color: var(--muted-foreground);
}
.service-alert {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--down-line);
  border-radius: calc(var(--radius) - 2px);
  background: var(--down-soft);
}
.service-alert time {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.625rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
  line-height: 1.625rem;
  font-weight: 500;
}
.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--none);
}
.pill--up {
  border-color: var(--signal-line);
  background: var(--signal-soft);
  color: var(--signal-strong);
}
.pill--up .dot {
  background: var(--signal);
}
.pill--down {
  border-color: var(--down-line);
  background: var(--down-soft);
  color: var(--down);
}
.pill--down .dot {
  background: var(--down);
}

.bars {
  margin-top: 1rem;
  display: flex;
  gap: 2px;
  height: 2rem;
}
.bar {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 1px;
  background: var(--none);
}
.bar--up {
  background: var(--signal);
}
.bar--minor {
  background: var(--minor);
}
.bar--major {
  background: var(--down);
}
.bars .bar:hover {
  opacity: 0.7;
}
.bars-legend {
  margin-top: 0.375rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
}
.uptime {
  color: var(--foreground);
}
.short {
  display: none;
}
/* 90 bars under ~4px each stop reading as days, so a phone shows the last 30. */
@media (max-width: 520px) {
  .bars .bar:nth-child(-n + 60) {
    display: none;
  }
  .long {
    display: none;
  }
  .short {
    display: inline;
  }
}

.key {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
}
.key > span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.key .bar {
  display: inline-block;
  flex: none;
  width: 0.375rem;
  height: 0.875rem;
}

/* incidents and the past */

.incident {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.incident + .incident {
  margin-top: 1rem;
}
.incident--open {
  border-color: var(--incident-line);
  background: var(--incident-soft);
}
.incident h3 {
  margin-top: 0.25rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.incident-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}
.state {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--incident);
}
.state--resolved {
  color: var(--signal);
}
.updates {
  margin-top: 1rem;
}
.updates > li + li {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.update-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
}
.prose p + p,
.prose p + ul,
.prose ul + p {
  margin-top: 0.75rem;
}
.prose ul {
  list-style: disc;
  padding-left: 1.25rem;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
.prose strong {
  font-weight: 600;
}

.past > li + li {
  margin-top: 1rem;
}
.past-item > .update-meta {
  margin-bottom: 0.125rem;
}
.past-item > .incident {
  background: var(--background);
}
.outage-line strong {
  font-weight: 600;
}
.empty {
  color: var(--muted-foreground);
}

.how .prose {
  color: var(--muted-foreground);
  max-width: 40rem;
}

/* footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

@media (prefers-reduced-motion: no-preference) {
  .bars .bar {
    transition: opacity 120ms ease;
  }
}
