/* primary-path.com. The color tokens (surfaces, text, cobalt accent,
   status colors, light and dark) come from the console's own stylesheet
   at build time (scripts/build_site.py writes assets/tokens.css), so the
   site and the product cannot drift apart. What is here is the site's
   type scale, layout and components. */

@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Geist Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  --page: min(1320px, 100% - 2 * var(--gutter));
  --gutter: clamp(16px, 4vw, 48px);
  --t-hero: clamp(2.35rem, 1.2rem + 4.2vw, 4.4rem);
  --t-h2: clamp(1.6rem, 1.1rem + 1.7vw, 2.4rem);
  --t-h3: clamp(1.05rem, 0.98rem + 0.3vw, 1.2rem);
  --t-body: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  --t-small: 0.875rem;
  --t-mono: 0.8125rem;
  --section: clamp(72px, 9vw, 136px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.6;
  background: var(--surface-0);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code, pre, .mono { font-family: var(--font-mono); font-variant-ligatures: none; }
code { font-size: 0.9em; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0; font-weight: 600; }
p { margin: 0; }
.wrap { width: var(--page); margin-inline: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 12px; z-index: 10; background: var(--surface-1); padding: 8px 12px; }

/* -- header ------------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--surface-0);
  border-bottom: 1px solid var(--border);
}
.top .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.wordmark {
  font-family: var(--font-mono); font-weight: 600; font-size: 1rem;
  color: var(--text-primary); text-decoration: none; letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 10px;
}
.wordmark svg { width: 20px; height: 20px; color: var(--accent); }
.top nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.top nav a { color: var(--text-secondary); text-decoration: none; font-size: var(--t-small); }
.top nav a:hover, .top nav a[aria-current] { color: var(--text-primary); }
.theme {
  border: 1px solid var(--border); background: transparent; color: var(--text-secondary);
  border-radius: var(--radius); width: 34px; height: 34px; cursor: pointer;
  display: inline-grid; place-items: center;
}
.theme svg { width: 16px; height: 16px; }
@media (max-width: 720px) {
  .top nav a.opt { display: none; }
  .top nav { gap: 16px; }
}

/* -- buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: var(--t-small); font-weight: 550;
  padding: 11px 18px; border-radius: var(--radius); text-decoration: none;
  border: 1px solid var(--border-strong); color: var(--text-primary);
  background: var(--surface-1); cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.btn:hover { border-color: var(--text-muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text-primary)); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--accent); padding-inline: 4px; }

/* -- hero --------------------------------------------------------------- */
.hero { padding-block: clamp(56px, 8vw, 112px) var(--section); }
.hero .wrap {
  display: grid; gap: clamp(40px, 5vw, 80px);
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); align-items: start;
}
@media (max-width: 980px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } }
.eyebrow {
  font-family: var(--font-mono); font-size: var(--t-mono); color: var(--text-secondary);
  display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 28px;
}
.eyebrow span + span::before { content: "·"; margin-right: 14px; color: var(--text-muted); }
.hero h1 { font-size: var(--t-hero); font-weight: 650; letter-spacing: -0.035em; max-width: 13ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { margin-top: 26px; font-size: clamp(1.05rem, 0.98rem + 0.45vw, 1.28rem); color: var(--text-secondary); max-width: 38em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* the live chain: the product's claim, checked on the visitor's machine */
.ledger {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface-1); overflow: hidden;
}
.ledger header {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--border);
}
.ledger header h2 { font-size: var(--t-small); font-weight: 600; letter-spacing: 0; }
.ledger header .src { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
.verdict {
  margin: 14px 18px 0; padding: 12px 14px; border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.55;
  background: var(--surface-inset); color: var(--text-secondary);
  display: grid; grid-template-columns: auto 1fr; gap: 2px 10px;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.verdict b { font-weight: 650; }
.verdict[data-state="ok"] { background: var(--ok-bg); color: var(--ok); }
.verdict[data-state="broken"] { background: var(--danger-bg); color: var(--danger); }
.verdict .mark { font-weight: 700; }
.chain {
  list-style: none; margin: 12px 0 0; padding: 0 0 6px;
  max-height: 318px; overflow-y: auto; font-family: var(--font-mono); font-size: 0.75rem;
  scrollbar-width: thin;
}
.chain li {
  display: grid; grid-template-columns: 3ch minmax(0, 9.5rem) minmax(0, 1fr) auto;
  gap: 12px; align-items: baseline; padding: 7px 18px;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  color: var(--text-secondary);
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.chain li:first-child { border-top: 0; }
.chain .seq { color: var(--text-muted); text-align: right; }
.chain .type { color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-sans); font-size: 0.8rem; }
.chain .hash { color: var(--text-muted); }
.chain li.key .type { color: var(--accent); }
.chain li.bad { background: var(--danger-bg); color: var(--danger); }
.chain li.bad .type, .chain li.bad .hash, .chain li.bad .seq { color: var(--danger); }
.chain li.after { opacity: 0.55; }
.ledger footer {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  padding: 12px 18px 16px; border-top: 1px solid var(--border);
}
.ledger footer p { font-size: 0.8rem; color: var(--text-muted); max-width: 34em; }

/* -- sections ----------------------------------------------------------- */
section { padding-block: var(--section); border-top: 1px solid var(--border); }
.kicker { font-family: var(--font-mono); font-size: var(--t-mono); color: var(--accent); margin-bottom: 18px; }
section h2 { font-size: var(--t-h2); max-width: 20ch; }
.split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }
.intro { color: var(--text-secondary); margin-top: 20px; max-width: 34em; }

/* failure modes: a ruled list, not a card grid */
.ruled { list-style: none; margin: 0; padding: 0; }
.ruled li { padding: 26px 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: 11rem 1fr; gap: 24px; }
.ruled li:first-child { border-top: 0; padding-top: 4px; }
.ruled h3 { font-size: var(--t-h3); }
.ruled p { color: var(--text-secondary); }
@media (max-width: 640px) { .ruled li { grid-template-columns: minmax(0, 1fr); gap: 8px; } }

/* how it works: five links of one chain */
.steps {
  list-style: none; margin: 48px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-1);
}
.steps li { padding: 22px 20px 24px; position: relative; }
.steps li + li { border-left: 1px solid var(--border); }
.steps li + li::before {
  content: ""; position: absolute; left: -5px; top: 30px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--surface-1); border: 1px solid var(--border-strong);
}
.steps .n { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
.steps h3 { font-size: var(--t-h3); margin: 10px 0 8px; }
.steps p { font-size: var(--t-small); color: var(--text-secondary); }
.steps li:last-child .n { color: var(--accent); }
@media (max-width: 980px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li + li { border-left: 0; border-top: 1px solid var(--border); }
  .steps li + li::before { left: 26px; top: -5px; }
}
.contract { margin-top: 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .contract { grid-template-columns: minmax(0, 1fr); } }
.contract p { color: var(--text-secondary); max-width: 32em; }
.contract p + p { margin-top: 14px; }

pre {
  margin: 0; padding: 18px 20px; border-radius: var(--radius); overflow-x: auto;
  background: var(--surface-inset); border: 1px solid var(--border);
  font-size: var(--t-mono); line-height: 1.7; color: var(--text-primary);
}
pre .c { color: var(--text-muted); }
.code { position: relative; }
.code pre { padding-top: 40px; }
.copy {
  position: absolute; top: 10px; right: 10px; font: inherit; font-size: 0.75rem;
  border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary);
  border-radius: var(--radius-sm); padding: 4px 9px; cursor: pointer;
}
.copy:hover { color: var(--text-primary); }

/* demos */
.demos { display: grid; gap: clamp(56px, 7vw, 96px); margin-top: 56px; }
.demo { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.demo:nth-child(2) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); }
.demo:nth-child(2) figure { order: 2; }
@media (max-width: 900px) {
  .demo, .demo:nth-child(2) { grid-template-columns: minmax(0, 1fr); }
  .demo:nth-child(2) figure { order: 0; }
}
.demo figure { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-1); }
.demo h3 { font-size: var(--t-h3); }
.demo p { color: var(--text-secondary); margin-top: 12px; }
.demo pre { margin-top: 20px; }

/* use cases: rows that link into the docs */
.cases { margin-top: 48px; border-top: 1px solid var(--border); }
.cases a {
  display: grid; grid-template-columns: 16rem minmax(0, 1fr) auto; gap: 24px; align-items: baseline;
  padding: 24px 4px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit;
  transition: background 0.2s var(--ease);
}
.cases a:hover { background: var(--surface-1); }
.cases h3 { font-size: var(--t-h3); }
.cases p { color: var(--text-secondary); }
.cases .go { font-family: var(--font-mono); font-size: var(--t-mono); color: var(--accent); white-space: nowrap; }
@media (max-width: 760px) { .cases a { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

/* trust facts */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; margin: 0; }
.facts div { padding: 22px 0; border-top: 1px solid var(--border); }
.facts dt { font-weight: 600; }
.facts dd { margin: 6px 0 0; color: var(--text-secondary); }
@media (max-width: 760px) { .facts { grid-template-columns: minmax(0, 1fr); } }

/* quickstart */
.quick { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
@media (max-width: 900px) { .quick { grid-template-columns: minmax(0, 1fr); } }
.quick .code + .code { margin-top: 16px; }
.quick .note { margin-top: 20px; font-size: var(--t-small); color: var(--text-muted); }

/* download page */
.page-head { padding-block: clamp(48px, 7vw, 96px) 40px; }
.page-head h1 { font-size: var(--t-h2); }
.page-head p { color: var(--text-secondary); margin-top: 16px; max-width: 40em; }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.table th, .table td { text-align: left; padding: 14px 16px 14px 0; border-top: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; border-top: 0; }
.table td:first-child { font-weight: 600; width: 22%; }
.table code { white-space: nowrap; }
.scroll-x { overflow-x: auto; }
.stack > * + * { margin-top: 18px; }
section.first { border-top: 0; padding-top: 0; }
.gap-top { margin-top: 32px; }
.files { padding-left: 1.1em; }

/* footer */
.foot { border-top: 1px solid var(--border); padding-block: 48px 64px; color: var(--text-muted); font-size: var(--t-small); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 24px 40px; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.foot a { color: var(--text-secondary); text-decoration: none; }
.foot a:hover { color: var(--text-primary); }

/* one orchestrated entrance, nothing after */
@media (prefers-reduced-motion: no-preference) {
  .hero .copyblock > * { animation: rise 0.7s var(--ease) both; }
  .hero .copyblock > :nth-child(2) { animation-delay: 0.05s; }
  .hero .copyblock > :nth-child(3) { animation-delay: 0.1s; }
  .hero .copyblock > :nth-child(4) { animation-delay: 0.15s; }
  .hero .ledger { animation: rise 0.8s 0.2s var(--ease) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
