:root {
  --bg: #ffffff;
  --bg-soft: #f5f7f9;
  --card: #ffffff;
  --text: #0d1117;
  --muted: #57606a;
  --border: #d8dee4;
  --accent: #0f9d58;
  --accent-text: #ffffff;
  --accent-soft: #e3f6ec;
  --bad: #cf222e;
  --bad-soft: #fde8e8;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f14;
    --bg-soft: #111720;
    --card: #131a24;
    --text: #e6edf3;
    --muted: #8b98a7;
    --border: #243040;
    --accent: #2fd27a;
    --accent-text: #04120a;
    --accent-soft: #10291c;
    --bad: #ff6b6b;
    --bad-soft: #2d1416;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap { max-width: 1080px; margin-inline: auto; padding-inline: 20px; }

/* Nav */
.nav { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; padding-bottom: 20px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; text-decoration: none; }
.logo img { width: 28px; height: 28px; display: block; }

.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav-link:hover { color: var(--text); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 20px; border-radius: 10px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-small { padding: 8px 14px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* Hero */
.hero { padding-top: 72px; padding-bottom: 56px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
h1 { margin: 0 auto; max-width: 820px; font-size: clamp(36px, 6.4vw, 64px); line-height: 1.05; letter-spacing: -0.035em; }
h1 em { font-style: normal; color: var(--accent); }
.lede { margin: 24px auto 0; max-width: 640px; color: var(--muted); font-size: clamp(17px, 2.2vw, 20px); }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.cta-note { margin-top: 14px; font-size: 14px; color: var(--muted); text-align: center; }

/* Sections */
section { padding-top: 48px; padding-bottom: 48px; }
.section-title { margin: 0 0 8px; font-size: clamp(26px, 3.6vw, 34px); letter-spacing: -0.025em; text-align: center; }
.section-sub { margin: 0 0 28px; color: var(--muted); text-align: center; }
.race .section-title, .features .section-title, .faq .section-title { margin-bottom: 28px; }

/* Outage race */
.race-card { padding: 28px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.race-row { display: grid; grid-template-columns: 190px 1fr 110px; align-items: center; gap: 16px; margin-bottom: 18px; }
.race-label { display: flex; flex-direction: column; line-height: 1.3; }
.race-label span { color: var(--muted); font-size: 14px; }
.track { height: 14px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.bar { height: 100%; border-radius: 999px; }
.bar-fast { width: 4%; min-width: 14px; background: var(--accent); }
.bar-slow { width: 100%; background: var(--bad); }
.race-time { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.race-time.good { color: var(--accent); }
.race-time.bad { color: var(--bad); }
.race-axis { display: flex; justify-content: space-between; margin-left: 206px; margin-right: 126px; color: var(--muted); font-size: 12px; }
.footnote { margin: 16px 0 0; color: var(--muted); font-size: 13px; }

/* Features */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.feature h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--muted); }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; align-items: stretch; }
.plan { position: relative; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.plan h3 { margin: 0; font-size: 17px; }
.price { margin: 8px 0 16px; font-size: 36px; font-weight: 800; letter-spacing: -0.03em; }
.price span { color: var(--muted); font-size: 16px; font-weight: 500; }
.plan ul { margin: 0; padding: 0; list-style: none; }
.plan li { padding: 6px 0 6px 24px; position: relative; color: var(--muted); }
.plan li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 10px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.plan-featured { border-color: var(--accent); box-shadow: var(--shadow); }
.badge { position: absolute; top: -12px; left: 24px; margin: 0; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 700; }

/* Waitlist */
.join-card { max-width: 680px; margin: 0 auto; padding: 36px; border: 1px solid var(--border); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.join-card h2 { margin: 0 0 8px; text-align: center; font-size: clamp(26px, 3.6vw, 34px); letter-spacing: -0.025em; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.field em { color: var(--muted); font-style: normal; font-weight: 400; }
.field-wide { grid-column: 1 / -1; }
input, select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; font-weight: 400;
}
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-error { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 14px; }
.form-error[hidden] { display: none; }
.joined { text-align: center; }
.joined p { margin: 0; color: var(--muted); }

/* FAQ */
.faq { max-width: 760px; }
details { border-bottom: 1px solid var(--border); padding: 18px 0; }
summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--muted); font-weight: 400; }
details[open] summary::after { content: "–"; }
details p { margin: 12px 0 0; color: var(--muted); }

/* Footer */
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 32px; padding-bottom: 40px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }

/* Responsive */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: repeat(2, 1fr); row-gap: 28px; }
  .plans .plan-featured { grid-column: span 2; }
}

@media (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .hero { padding-top: 40px; padding-bottom: 32px; }
  section { padding-top: 32px; padding-bottom: 32px; }
  .grid, .plans, .form { grid-template-columns: 1fr; }
  .plans .plan-featured { grid-column: auto; }
  .race-card, .join-card { padding: 20px; }
  .race-row { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .race-row .track { grid-column: 1 / -1; grid-row: 2; }
  .race-axis { margin: 0; }
  .race-axis span:not(:first-child):not(:last-child) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
  html { scroll-behavior: auto; }
}

/* Blog, docs and comparison pages */
.content { padding-top: 24px; padding-bottom: 64px; }
.with-sidebar { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; }
.sidebar { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 16px; align-self: start; }
.sidebar a { padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.sidebar a[aria-current="page"], .sidebar a:hover { color: var(--text); background: var(--bg-soft); }
.prose { max-width: 720px; font-size: 17px; line-height: 1.7; }
.prose h1 { font-size: clamp(30px, 4.5vw, 42px); line-height: 1.15; letter-spacing: -0.025em; margin: 8px 0 12px; }
.prose h2 { margin-top: 40px; font-size: 24px; letter-spacing: -0.015em; }
.prose h3 { margin-top: 28px; font-size: 19px; }
.prose a { color: var(--accent); }
.prose code { padding: 1px 6px; border-radius: 6px; background: var(--bg-soft); font-size: 0.9em; }
.prose pre { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-soft); overflow-x: auto; font-size: 14px; line-height: 1.5; }
.prose pre code { padding: 0; background: none; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose blockquote { margin: 0; padding-left: 16px; border-left: 3px solid var(--border); color: var(--muted); }
.crumbs, .meta { color: var(--muted); font-size: 14px; }
.crumbs a { color: var(--muted); }
.post-list { list-style: none; padding: 0; }
.post-list li { padding: 16px 0; border-bottom: 1px solid var(--border); }
.post-list a { font-weight: 700; font-size: 19px; }
.post-list p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.draft-note, .draft-tag { padding: 2px 8px; border-radius: 6px; background: var(--bad-soft); color: var(--bad); font-size: 13px; }
@media (max-width: 760px) {
  .with-sidebar { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
}

.plans-two { grid-template-columns: repeat(2, minmax(0, 320px)); justify-content: center; }
@media (max-width: 640px) { .plans-two { grid-template-columns: 1fr; } }
.plans-two .plan-featured { grid-column: auto; }

/* Docs: sidebar groups, search, headings, table of contents, code, changelog */
.sidebar-group { margin: 14px 10px 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.docs-search { width: 100%; padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
.search-results { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.search-results a { display: flex; flex-direction: column; padding: 6px 8px; }
.search-results a span { font-size: 12px; color: var(--muted); }
.search-empty { margin: 4px 8px; font-size: 14px; color: var(--muted); }
.prose h2, .prose h3 { position: relative; scroll-margin-top: 16px; }
.prose .anchor { position: absolute; left: -1.1em; padding-right: 0.3em; color: var(--muted); text-decoration: none; opacity: 0; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus { opacity: 1; }
.toc { display: flex; flex-direction: column; gap: 2px; margin: 0 0 24px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; font-size: 14px; }
.toc p { margin: 0 0 4px; font-weight: 600; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); }
.toc .toc-3 { padding-left: 14px; }
.prose pre { position: relative; }
.copy-code { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; opacity: 0; }
.prose pre:hover .copy-code, .copy-code:focus { opacity: 1; }
@media (hover: none) { .copy-code { opacity: 1; } }
.page-foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.changelog-entry { padding: 8px 0 24px; border-bottom: 1px solid var(--border); }
.changelog-entry h2 { margin-top: 4px; }
.search-results[hidden], .docs-search[hidden] { display: none; }
/* Long code and wide tables scroll inside themselves instead of widening the page on phones. */
.prose { min-width: 0; overflow-wrap: anywhere; }
.prose pre, .prose table { max-width: 100%; }
.prose table { display: block; overflow-x: auto; }
.prose pre code, .prose td code { overflow-wrap: normal; }
