/* ==========================================================================
   CapScope marketing site — modern dev-tool design system
   Dark-first. Light mode via [data-theme="light"] on <html>.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --accent: #f89c1c;
  --accent-text: #f89c1c;
  --accent-ink: #160f04;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;

  --radius: 14px;
  --radius-sm: 9px;
  --container: 1180px;
  --header-h: 64px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="dark"],
html:not([data-theme]) {
  color-scheme: dark;

  --bg: #08090c;
  --bg-2: #0c0e13;
  --surface: #101319;
  --surface-2: #151923;
  --surface-3: #1b2130;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #f2f4f8;
  --text-2: #b6bccb;
  --muted: #8b93a7;

  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.75);
  --header-bg: rgba(8, 9, 12, 0.72);
  --code-bg: #0a0c11;
}

html[data-theme="light"] {
  color-scheme: light;

  --bg: #ffffff;
  --bg-2: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --surface-3: #eceff6;
  --border: rgba(12, 17, 33, 0.11);
  --border-strong: rgba(12, 17, 33, 0.2);

  --text: #0b1020;
  --text-2: #3d465c;
  --muted: #6b7488;

  --shadow: 0 24px 50px -24px rgba(16, 24, 40, 0.3);
  --header-bg: rgba(255, 255, 255, 0.82);
  --code-bg: #0c0f16;

  --accent-text: #b45309;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  margin: 0 0 1rem;
  color: var(--text-2);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.6rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--text);
}

h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  letter-spacing: -0.04em;
  font-weight: 800;
}
h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
  font-weight: 750;
}
h3 {
  font-size: 1.28rem;
}
h4 {
  font-size: 1rem;
}

::selection {
  background: rgba(248, 156, 28, 0.32);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
}

:not(pre) > code {
  font-size: 0.875em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.42em;
  color: var(--text);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding: 92px 0;
  position: relative;
}
.section-tight {
  padding: 64px 0;
}
.section-alt {
  background: var(--bg-2);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 680px;
  margin-bottom: 48px;
}
.section-head.center {
  margin-inline: auto;
  text-align: center;
}
.section-head p {
  font-size: 1.08rem;
  color: var(--muted);
  margin-bottom: 0;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 18px;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.mono {
  font-family: var(--font-mono);
}
.text-grad {
  color: var(--accent-text);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1;
  padding: 13px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.16s var(--ease), background 0.16s var(--ease),
    border-color 0.16s var(--ease), color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.btn svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 84%, #ffffff);
  box-shadow: 0 14px 30px -18px rgba(248, 156, 28, 0.85);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-outline:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-2);
}

.btn-sm {
  padding: 9px 14px;
  font-size: 0.86rem;
  border-radius: 8px;
}

.btn-lg {
  padding: 16px 28px;
  font-size: 1rem;
}

/* GitHub star button */
.btn-github {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  font-family: var(--font-sans);
}
.btn-github:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}
.btn-github .gh-label {
  font-weight: 600;
}
.btn-github .gh-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--text-2);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
  margin-right: auto;
}
.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: none;
  border: 1px solid rgba(22, 15, 4, 0.25);
}
.brand-mark svg {
  width: 17px;
  height: 17px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links > a:not(.btn) {
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.nav-links > a:not(.btn):hover,
.nav-links > a.active {
  color: var(--text);
  background: var(--surface-2);
}
.nav-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin-inline: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.icon-btn svg {
  width: 17px;
  height: 17px;
}
.theme-toggle .icon-sun {
  display: none;
}
html[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}
html[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

.nav-toggle {
  display: none;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 84px 0 64px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto;
  height: 720px;
  background: radial-gradient(56% 50% at 50% 36%, rgba(248, 156, 28, 0.15) 0%, rgba(248, 156, 28, 0) 72%);
  pointer-events: none;
  z-index: 0;
}
html[data-theme="light"] .hero::before {
  opacity: 0.55;
}

/* Live log wall behind the hero — real CapScope output, scrolling upward.
   Dimmed in the horizontal centre so the headline stays readable. */
.hero-logs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  opacity: 0.5;
  /* fade out at the very top and bottom of the section */
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 16%, #000 74%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 16%, #000 74%, transparent 100%);
}
html[data-theme="light"] .hero-logs {
  opacity: 0.3;
}
.hero-logs-fade {
  height: 100%;
  /* fade out the horizontal centre, where the headline and sub sit */
  -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.35) 30%, transparent 46%, transparent 54%, rgba(0, 0, 0, 0.35) 70%, #000 100%);
  mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.35) 30%, transparent 46%, transparent 54%, rgba(0, 0, 0, 0.35) 70%, #000 100%);
}
.hero-logs-track {
  display: flex;
  flex-direction: column;
  animation: logScroll 46s linear infinite;
  will-change: transform;
}
@keyframes logScroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(0, -50%, 0);
  }
}
.hero-logs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 2.05;
  color: var(--muted);
  text-align: left;
}
.hero-logs-list li {
  /* pre lives on the li, not the ul: on the ul the source newlines
     between <li> elements would become significant and add blank rows */
  white-space: pre;
  padding-left: clamp(12px, 4vw, 60px);
  overflow: hidden;
}
.hl-t { color: #5b6478; }
.hl-info { color: #60a5fa; }
.hl-warn { color: #fbbf24; }
.hl-err { color: #f87171; }
.hl-ok { color: #34d399; }
.hl-key { color: #a78bfa; }
html[data-theme="light"] .hl-t { color: #94a0b4; }
html[data-theme="light"] .hl-info { color: #2563eb; }
html[data-theme="light"] .hl-warn { color: #b45309; }
html[data-theme="light"] .hl-err { color: #dc2626; }
html[data-theme="light"] .hl-ok { color: #059669; }
html[data-theme="light"] .hl-key { color: #7c3aed; }
.hero .container {
  position: relative;
  z-index: 1;
}
.hero-inner {
  max-width: 860px;
  margin-inline: auto;
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 10px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-2);
  margin-bottom: 18px;
}
.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2.2s infinite;
}
.pill b {
  color: var(--text);
  font-weight: 600;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

.hero h1 {
  margin-bottom: 14px;
}
.hero .sub {
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  color: var(--muted);
  max-width: 720px;
  margin: 0 auto 26px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.hero-meta {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.hero-meta svg {
  width: 14px;
  height: 14px;
  color: var(--accent-text);
}

/* Hero visual: terminal + snapshot card */
.hero-visual {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 68px auto 0;
}

.terminal {
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-align: left;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.terminal-bar .tdot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
}
.terminal-bar .tdot:nth-child(2) {
  background: #febc2e;
}
.terminal-bar .tdot:nth-child(3) {
  background: #28c840;
}
.terminal-bar .title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #7c869c;
}
.terminal-bar .badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.1);
  border-radius: 999px;
  padding: 2px 9px;
}
.terminal-body {
  margin: 0;
  padding: 18px 20px;
  font-size: 0.83rem;
  line-height: 1.75;
  color: #cbd5e1;
  overflow-x: auto;
}
.terminal-body .l {
  white-space: pre;
  opacity: 0;
  animation: lineIn 0.5s var(--ease) forwards;
}
.terminal-body .l:nth-child(1) { animation-delay: 0.15s; }
.terminal-body .l:nth-child(2) { animation-delay: 0.35s; }
.terminal-body .l:nth-child(3) { animation-delay: 0.55s; }
.terminal-body .l:nth-child(4) { animation-delay: 0.75s; }
.terminal-body .l:nth-child(5) { animation-delay: 0.95s; }
.terminal-body .l:nth-child(6) { animation-delay: 1.15s; }
.terminal-body .l:nth-child(7) { animation-delay: 1.35s; }
@keyframes lineIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.t-time { color: #5b6478; }
.t-info { color: #60a5fa; }
.t-warn { color: #fbbf24; }
.t-err { color: #f87171; }
.t-ok { color: #34d399; }
.t-key { color: #a78bfa; }

.cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: #34d399;
  vertical-align: text-bottom;
  animation: blink 1.05s steps(2, start) infinite;
}
@keyframes blink {
  to {
    visibility: hidden;
  }
}

.float-card {
  position: absolute;
  right: -14px;
  bottom: -34px;
  width: 292px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 16px 17px;
  box-shadow: var(--shadow);
  text-align: left;
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
.float-card .fc-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 9px;
}
.float-card .fc-head svg {
  width: 16px;
  height: 16px;
  color: var(--err);
}
.float-card .fc-kind {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--err);
  border: 1px solid color-mix(in srgb, var(--err) 45%, transparent);
  background: color-mix(in srgb, var(--err) 12%, transparent);
  border-radius: 999px;
  padding: 2px 8px;
}
.float-card .fc-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  padding: 4px 0;
  border-top: 1px dashed var(--border);
}
.float-card .fc-row b {
  color: var(--text);
  font-weight: 500;
}
.float-card .fc-summary {
  margin-top: 10px;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
}

/* ---------- Stats strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  padding: 26px 24px;
  border-right: 1px solid var(--border);
}
.stat:last-child {
  border-right: none;
}
.stat .num {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}
.stat .lbl {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- Cards / features ---------- */
.grid {
  display: grid;
  gap: 20px;
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}
.card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.card p {
  font-size: 0.93rem;
  color: var(--muted);
  margin: 0;
}

.icon-box {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  color: var(--accent-text);
  margin-bottom: 16px;
}
.icon-box svg {
  width: 20px;
  height: 20px;
}
.icon-box.cyan,
.icon-box.violet {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--accent-text);
}
.icon-box.ok {
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
  color: var(--ok);
}
.icon-box.warn {
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  color: var(--warn);
}
.icon-box.err {
  background: color-mix(in srgb, var(--err) 14%, transparent);
  border-color: color-mix(in srgb, var(--err) 35%, transparent);
  color: var(--err);
}

/* split problem/solution */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: stretch;
}
.panel > .ticklist {
  height: 100%;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.panel.bad {
  border-color: color-mix(in srgb, var(--err) 30%, var(--border));
}
.panel.good {
  border-color: color-mix(in srgb, var(--ok) 32%, var(--border));
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 16px;
}
.panel-title svg {
  width: 18px;
  height: 18px;
}
.panel.bad .panel-title svg {
  color: var(--err);
}
.panel.good .panel-title svg {
  color: var(--ok);
}
.ticklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 13px;
}
.ticklist li {
  display: flex;
  gap: 11px;
  font-size: 0.94rem;
  color: var(--text-2);
  line-height: 1.55;
}
.ticklist li > svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 3px;
}
.ticklist li b {
  color: var(--text);
  font-weight: 600;
}
.ticklist.good li > svg {
  color: var(--ok);
}
.ticklist.bad li > svg {
  color: var(--err);
}

/* ---------- Code blocks ---------- */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0;
}
.code-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px 9px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #7c869c;
}
.code-head .copy-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: #aab3c5;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.code-head .copy-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.code-head .copy-btn svg {
  width: 13px;
  height: 13px;
}
.code-block pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 0.845rem;
  line-height: 1.7;
  color: #dbe4f0;
}
.code-block code {
  background: none;
  border: none;
  padding: 0;
  white-space: pre;
  color: inherit;
  font-size: inherit;
}
.c-comment { color: #6b7488; }
.c-str { color: #7ee787; }
.c-key { color: #79c0ff; }
.c-cmd { color: #a5d6ff; }
.c-flag { color: #d2a8ff; }
.c-num { color: #f0b775; }

/* ---------- Platforms ---------- */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.platform {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), background 0.18s var(--ease);
}
.platform:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  background: var(--surface-2);
}
.platform .p-ico {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text);
}
.platform .p-ico svg {
  width: 19px;
  height: 19px;
}
.platform .p-name {
  font-weight: 650;
  font-size: 0.97rem;
}
.platform .p-sub {
  font-size: 0.8rem;
  color: var(--muted);
}
.platform .p-arrow {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.18s var(--ease), color 0.18s var(--ease);
}
.platform .p-arrow svg {
  width: 17px;
  height: 17px;
}
.platform:hover .p-arrow {
  color: var(--accent-text);
  transform: translateX(4px);
}

/* ---------- Steps ---------- */
.steps {
  counter-reset: step;
  display: grid;
  gap: 26px;
}
.step {
  position: relative;
  padding-left: 62px;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-text);
}
.step::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 42px;
  bottom: -24px;
  width: 1px;
  background: var(--border);
}
.step:last-child::after {
  display: none;
}
.step h3 {
  font-size: 1.06rem;
  margin-bottom: 6px;
}
.step p {
  font-size: 0.94rem;
  margin-bottom: 8px;
}

/* ---------- Callouts ---------- */
.callout {
  display: flex;
  gap: 13px;
  padding: 16px 18px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.93rem;
  color: var(--text-2);
  margin: 20px 0;
  line-height: 1.6;
}
.callout svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
}
.callout b {
  color: var(--text);
}
.callout.info {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}
.callout.info svg {
  color: var(--accent-text);
}
/* naming callout: keep "CapScope" and its two halves picked out in brand orange */
.callout.name-note b {
  color: var(--accent-text);
}
.callout.warn {
  border-color: color-mix(in srgb, var(--warn) 42%, var(--border));
  background: color-mix(in srgb, var(--warn) 9%, var(--surface));
}
.callout.warn svg {
  color: var(--warn);
}
.callout.danger {
  border-color: color-mix(in srgb, var(--err) 42%, var(--border));
  background: color-mix(in srgb, var(--err) 9%, var(--surface));
}
.callout.danger svg {
  color: var(--err);
}
.callout.ok {
  border-color: color-mix(in srgb, var(--ok) 42%, var(--border));
  background: color-mix(in srgb, var(--ok) 9%, var(--surface));
}
.callout.ok svg {
  color: var(--ok);
}

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--surface);
  padding: 56px 44px;
  text-align: center;
}
.cta-band p {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 26px;
}
.cta-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Docs / guides layout ---------- */
.docs-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding: 44px 0 88px;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  padding-right: 6px;
  font-size: 0.9rem;
}
.sidebar-group {
  margin-bottom: 26px;
}
.sidebar-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  border-left: 1px solid var(--border);
}
.sidebar a {
  display: block;
  padding: 6px 14px;
  color: var(--muted);
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color 0.14s var(--ease), border-color 0.14s var(--ease), background 0.14s var(--ease);
}
.sidebar a:hover {
  color: var(--text);
}
.sidebar a.active {
  color: var(--accent-text);
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-bottom: 14px;
}
.breadcrumbs a:hover {
  color: var(--accent-text);
}
.breadcrumbs svg {
  width: 13px;
  height: 13px;
}

.doc-content {
  min-width: 0;
  max-width: 820px;
}
.doc-content > h1 {
  font-size: clamp(2rem, 3.6vw, 2.7rem);
  margin-bottom: 14px;
}
.doc-lead {
  font-size: 1.09rem;
  color: var(--muted);
  margin-bottom: 34px;
}
.doc-content h2 {
  font-size: 1.5rem;
  margin-top: 52px;
  padding-top: 4px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.doc-content h3 {
  font-size: 1.13rem;
  margin-top: 32px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.doc-content ul,
.doc-content ol {
  color: var(--text-2);
  padding-left: 22px;
  margin: 0 0 1rem;
}
.doc-content li {
  margin-bottom: 7px;
}
.doc-content li::marker {
  color: var(--accent-text);
}
.doc-content a:not(.btn):not(.card):not(.platform) {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.doc-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 44px 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 20px 0 26px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.89rem;
  background: var(--surface);
}
th,
td {
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  background: var(--surface-2);
  font-weight: 650;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr:hover td {
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}
td code {
  white-space: nowrap;
}
td:first-child code {
  color: var(--accent-text);
}

.endpoint {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 26px 0 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.method {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid;
}
.method.get {
  color: #34d399;
  border-color: color-mix(in srgb, #34d399 45%, transparent);
  background: color-mix(in srgb, #34d399 12%, transparent);
}
.method.post {
  color: #7dd3fc;
  border-color: color-mix(in srgb, #7dd3fc 45%, transparent);
  background: color-mix(in srgb, #7dd3fc 12%, transparent);
}
.endpoint .path {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}
.endpoint .ep-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-left: auto;
}

.doc-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}
.pager-link {
  flex: 1;
  max-width: 48%;
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  transition: border-color 0.16s var(--ease), transform 0.16s var(--ease);
}
.pager-link:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.pager-link .dir {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.pager-link .ttl {
  display: block;
  font-weight: 650;
  font-size: 0.95rem;
  margin-top: 3px;
}
.pager-link.next {
  text-align: right;
  margin-left: auto;
}

/* doc cards (docs hub) */
.doc-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 26px 0;
}
a.card {
  display: block;
}
a.card:hover {
  border-color: var(--accent);
}
a.card .card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
a.card .card-top svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 0.16s var(--ease), color 0.16s var(--ease);
}
a.card:hover .card-top svg {
  color: var(--accent-text);
  transform: translateX(4px);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding-top: 72px;
  overflow: hidden;
}

.footer-wordmark {
  text-align: center;
  line-height: 0.82;
  /* bottom padding gives the descender of the "p" room so it isn't
     clipped by .site-footer's overflow: hidden now that this is last */
  padding: 0 12px 0.12em;
  margin: 52px 0 0;
  user-select: none;
}
.footer-wordmark a {
  display: inline-block;
  font-size: clamp(3.6rem, 17.5vw, 15rem);
  font-weight: 850;
  letter-spacing: -0.055em;
  background: linear-gradient(180deg, var(--text) 6%, color-mix(in srgb, var(--text) 14%, transparent) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: background 0.3s var(--ease);
}
.footer-wordmark a:hover {
  background: none;
  color: var(--accent-text);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 34px;
  padding-bottom: 48px;
}
.footer-brand .brand {
  margin-bottom: 14px;
}
.footer-brand p {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 300px;
}
.footer-brand p b {
  display: block;
  color: var(--text);
  font-weight: 650;
  margin-bottom: 4px;
}
/* naming line: "Cap" and "Scope" picked out in brand orange */
.footer-brand p.footer-origin {
  font-size: 0.82rem;
  line-height: 1.5;
  margin-top: -6px;
  color: var(--muted);
}
.footer-brand p.footer-origin strong {
  color: var(--accent-text);
  font-weight: 650;
}
.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.footer-col h4 {
  font-size: 0.76rem;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 600;
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}
.footer-col a {
  font-size: 0.92rem;
  color: var(--text-2);
  transition: color 0.14s var(--ease);
}
.footer-col a:hover {
  color: var(--accent-text);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.83rem;
  color: var(--muted);
}
.footer-bottom .fb-right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-bottom a:hover {
  color: var(--text);
}
.footer-bottom .mono {
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .hero-logs-track {
    animation: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .docs-layout {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 34px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .section {
    padding: 66px 0;
  }
  .grid-3,
  .platform-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat:nth-child(2) {
    border-right: none;
  }
  .stat:nth-child(1),
  .stat:nth-child(2) {
    border-bottom: 1px solid var(--border);
  }
  .split {
    grid-template-columns: 1fr;
  }
  .float-card {
    position: static;
    width: auto;
    margin-top: 18px;
    animation: none;
  }
  .cta-band {
    padding: 40px 24px;
  }

  .nav-toggle {
    display: grid;
  }
  .nav-links {
    position: fixed;
    inset: var(--header-h) 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px 22px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
    box-shadow: var(--shadow);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav-links > a:not(.btn) {
    padding: 12px 12px;
    font-size: 1rem;
  }
  .nav-links .btn {
    width: 100%;
    margin-top: 6px;
  }
  .nav-sep {
    display: none;
  }

  .docs-layout {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-top: 28px;
  }
  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    background: var(--surface);
  }
  .doc-pager {
    flex-direction: column;
  }
  .pager-link {
    max-width: 100%;
  }
  .pager-link.next {
    text-align: left;
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .grid-2,
  .grid-3,
  .grid-4,
  .platform-grid,
  .doc-card-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 56px 0 48px;
  }
  .hero-visual {
    margin-top: 44px;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 26px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .doc-content h2 {
    margin-top: 40px;
  }
}
