/* ==== 00-base.css ==== */
/* 00-base.css — design tokens, reset, shared components (orchestrator-owned). */

:root {
  --paper: #F6F4EE;
  --paper-2: #EFECE3;
  --card: #FFFFFF;
  --ink: #14151F;
  --muted: #4A4B58;          /* 7.8:1 on paper */
  --rule: rgba(20, 21, 31, .12);
  --navy: #031742;           /* Horizen Labs logo navy */
  --navy-deep: #020F2D;
  --on-navy: #FFFFFF;        /* 17.4:1 on navy */
  --on-navy-muted: #B9C1D6;  /* 9.7:1 on navy */
  --rule-on-navy: rgba(255, 255, 255, .16);

  /* Data palette: fills, bars and swatches only, never text. */
  --cn: #E5484D;
  --us: #3E8EF7;
  --eu: #F5C518;
  --other: #30A46C;
  --unknown: #8B8D98;

  --font: -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --container: 1180px;
  --gutter: 20px;
  --section-y: clamp(64px, 10vw, 128px);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 21, 31, .06), 0 8px 24px rgba(20, 21, 31, .06);
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .14em; }
code, pre { font-family: var(--mono); font-size: .9em; }
[id] { scroll-margin-top: 80px; }

/* Typography */
h1, .h1 {
  font-size: clamp(2.75rem, 8vw, 6rem);
  line-height: .98;
  font-weight: 900;
  letter-spacing: -.035em;
}
h2, .h2 {
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  line-height: 1.08;
  font-weight: 850;
  letter-spacing: -.025em;
}
h3, .h3 {
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.01em;
}
.lede { font-size: clamp(1.125rem, 1.6vw, 1.3rem); line-height: 1.5; color: var(--muted); max-width: 62ch; }
.small { font-size: .875rem; line-height: 1.5; color: var(--muted); }
.kicker {
  display: inline-block;
  font-size: .8125rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-head { display: grid; gap: 14px; max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }

/* Layout */
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.band--paper2 { background: var(--paper-2); }
.band--navy { background: var(--navy); color: var(--on-navy); }
.band--navy .kicker, .band--navy .lede, .band--navy .small { color: var(--on-navy-muted); }
.band--navy-deep { background: var(--navy-deep); color: var(--on-navy); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 48px;
  padding: .75em 1.35em;
  border: 2px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--navy); color: var(--on-navy); }
.btn--primary:hover { background: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--on-navy { background: var(--on-navy); color: var(--navy); }
.btn--on-navy:hover { background: var(--paper-2); }
.btn--ghost-on-navy { background: transparent; color: var(--on-navy); border-color: var(--on-navy); }
.btn--ghost-on-navy:hover { background: var(--on-navy); color: var(--navy); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Badge */
.badge {
  display: inline-block;
  padding: .2em .65em;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Code block */
.code {
  margin: 0;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #F6F4EE;
  overflow-x: auto;
  font-size: .875rem;
  line-height: 1.7;
  tab-size: 2;
}
.code code { font-size: inherit; }
:not(pre) > code { padding: .1em .35em; border-radius: 4px; background: rgba(20, 21, 31, .07); }
.band--navy :not(pre) > code { background: rgba(255, 255, 255, .12); }

/* Card surface */
.surface { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Lockup: moatleak mark + wordmark + "by" + Horizen Labs logo */
.lockup { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.lockup__mark { width: 24px; height: 24px; flex: none; }
.lockup__word { font-weight: 900; font-size: 1.375rem; letter-spacing: -.02em; line-height: 1; }
.lockup__by { font-size: .8125rem; font-weight: 600; opacity: .8; margin-left: 4px; }
.lockup__hl { height: 18px; width: auto; }

/* Accessibility helpers */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 100;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink); font-weight: 800;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 4px; }
.band--navy :focus-visible, .band--navy-deep :focus-visible, .site-header :focus-visible { outline-color: var(--on-navy); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ==== 05-header.css ==== */
.site-header { position: sticky; top: 0; z-index: 50; min-height: 64px; }
.site-header .site-header__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.site-header .lockup { gap: 8px; min-width: 0; }
.site-header .lockup__word { font-size: 1.25rem; }
.site-header .lockup__hl { height: 14px; }
.site-header .site-header__nav { display: none; gap: 28px; margin-inline: auto; }
.site-header .site-header__nav a { color: var(--on-navy-muted); text-decoration: none; font-weight: 600; font-size: .9375rem; }
.site-header .site-header__nav a:hover, .site-header .site-header__nav a[aria-current] { color: var(--on-navy); text-decoration: underline; }
.site-header .site-header__cta { min-height: 40px; padding: .4em 1em; font-size: .9375rem; white-space: nowrap; flex: none; }
@media (min-width: 420px) {
  .site-header .lockup__hl { height: 18px; }
  .site-header .site-header__cta { padding: .5em 1.25em; }
}
@media (min-width: 960px) { .site-header .site-header__nav { display: flex; } }
@media (max-width: 359px) { .site-header .lockup__by, .site-header .lockup__hl { display: none; } }

/* ==== 10-hero.css ==== */
#top.hero { padding-top: 48px; padding-bottom: 32px; }
#top .hero__grid { display: grid; gap: 40px; align-items: center; }
#top .hero__text { display: grid; gap: 22px; justify-items: start; }
#top .hero__sub { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 800; line-height: 1.2; letter-spacing: -.015em; color: var(--ink); }
#top .hero__trust { margin-top: 4px; }
#top .hero__media { display: grid; gap: 12px; width: 100%; max-width: 460px; margin-inline: auto; }
#top .hero__frame { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); box-shadow: var(--shadow); background: var(--card); }
#top .hero__video { width: 100%; height: 100%; object-fit: cover; }
#top .hero__toggle { position: absolute; right: 12px; top: 12px; min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--navy); color: var(--on-navy); font: inherit; font-size: .875rem; font-weight: 700; cursor: pointer; }
#top .hero__toggle:hover { background: var(--ink); }
#top .hero__toggle:focus-visible { outline: 3px solid var(--on-navy); outline-offset: 2px; box-shadow: 0 0 0 5px var(--navy); }
#top .hero__toggle[hidden] { display: none; }
@media (min-width: 1024px) {
  #top.hero { padding-top: 80px; padding-bottom: 48px; }
  #top .hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; }
  #top .hero__media { margin-inline: 0 0; justify-self: end; }
}
@media (prefers-reduced-motion: reduce) { #top .hero__toggle { display: none; } }

/* ==== 20-insight.css ==== */
#insight .insight__grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 1024px) { #insight .insight__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
#insight .insight__block { padding: 28px; display: flex; flex-direction: column; gap: 14px; border-top: 4px solid transparent; }
#insight .insight__block--navy { border-top: 4px solid var(--navy); }
#insight .insight__label { margin: 0; }
#insight .insight__headline { font-size: clamp(1.35rem, 2.1vw, 1.75rem); font-weight: 850; color: var(--ink); line-height: 1.2; letter-spacing: -.015em; }
#insight .insight__support { font-size: 1rem; color: var(--muted); line-height: 1.5; }
#insight .insight__bar { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; }
#insight .insight__seg { display: block; height: 100%; min-width: 3px; }
#insight .insight__seg--us { width: 63%; background: var(--us); }
#insight .insight__seg--cn { width: 36%; background: var(--cn); }
#insight .insight__seg--unknown { width: 1%; background: var(--unknown); }
#insight .insight__note { max-width: 80ch; margin-top: 28px; }

/* ==== 30-gallery.css ==== */
#gallery { overflow-x: clip; }
#gallery .gallery__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(250px, 72vw, 330px);
  gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scroll-padding-left: 8px;
  padding: 8px 0 32px 8px;
  margin: -8px calc(-1 * (100vw - min(100vw, var(--container) + 2 * var(--gutter))) / 2 - var(--gutter)) -32px -8px;
}
#gallery .gallery__track > li { scroll-snap-align: start; }
#gallery .gallery__track:focus-visible { outline: 3px solid var(--navy); outline-offset: 4px; }
#gallery .gallery__card { display: grid; gap: 12px; align-content: start; }
#gallery .gallery__card a { display: block; border-radius: var(--radius); }
#gallery .gallery__card img {
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--rule); box-shadow: var(--shadow); background: var(--card);
}
#gallery .gallery__more { margin-top: 32px; }

/* ==== 40-how.css ==== */
#how .how__steps { display: grid; grid-template-columns: 1fr; gap: 20px; counter-reset: how-step; }
@media (min-width: 1024px) { #how .how__steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
#how .how__steps > li { padding: 28px; counter-increment: how-step; display: flex; flex-direction: column; gap: 10px; }
#how .how__steps > li::before { content: counter(how-step); font-size: 2.5rem; font-weight: 900; line-height: 1; color: var(--navy); letter-spacing: -.03em; }
#how .how__steps p { color: var(--muted); }
#how .how__steps code { white-space: nowrap; }
#how .how__install { margin-top: 28px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1024px) { #how .how__install { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; } }
#how .how__install .code { min-width: 0; }

/* ==== 50-privacy.css ==== */
#privacy .privacy__wrap { position: relative; padding-top: var(--section-y); }
#privacy .privacy__wrap::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); border-top: 1px solid var(--rule); }
#privacy.section { padding-top: 0; }
#privacy .privacy__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 1024px) { #privacy .privacy__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
#privacy .privacy__col { padding: 28px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
#privacy .privacy__table { width: 100%; border-collapse: collapse; font-size: .9375rem; line-height: 1.45; }
#privacy .privacy__table th { text-align: left; font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 10px 8px 0; border-bottom: 2px solid var(--ink); }
#privacy .privacy__table tbody th, #privacy .privacy__table td { padding: 10px 10px 10px 0; vertical-align: top; border-bottom: 1px solid var(--rule); }
#privacy .privacy__table tbody th { text-align: left; font-size: inherit; font-weight: 400; letter-spacing: 0; text-transform: none; color: inherit; border-bottom: 1px solid var(--rule); }
#privacy .privacy__table tr:last-child th, #privacy .privacy__table tr:last-child td { border-bottom: 0; }
#privacy .privacy__table td code { overflow-wrap: anywhere; font-size: .82em; }
#privacy .privacy__never { display: grid; gap: 14px; }
#privacy .privacy__never li { position: relative; padding-left: 32px; }
#privacy .privacy__never li::before { content: "\2715"; position: absolute; left: 0; top: .1em; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: var(--on-navy); font-size: .7rem; font-weight: 900; line-height: 22px; text-align: center; }
#privacy .privacy__never code { overflow-wrap: anywhere; }
#privacy .privacy__verify { display: grid; gap: 18px; }
#privacy .privacy__verify li { display: grid; gap: 10px; min-width: 0; }
#privacy .privacy__verify .code { min-width: 0; font-size: .8125rem; white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: visible; }
#privacy .privacy__verify .code code { white-space: inherit; overflow-wrap: inherit; }
#privacy .privacy__site { margin-top: 28px; display: flex; align-items: center; gap: 12px; max-width: 80ch; }
#privacy .privacy__icon { flex: none; }

/* ==== 60-report.css ==== */
#report .report__grid { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: start; }
@media (min-width: 1024px) { #report .report__grid { grid-template-columns: 1.4fr 1fr; gap: 48px; } }
#report .report__list { list-style: none; margin: 0; padding: 0; }
#report .report__list li { padding: 14px 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 2px; }
#report .report__list li:first-child { border-top: 1px solid var(--rule); }
#report .report__list strong { font-size: 1.125rem; font-weight: 800; color: var(--ink); }
#report .report__gloss { color: var(--muted); font-size: 1rem; line-height: 1.5; }
#report .report__read { padding: 28px; border-top: 4px solid var(--navy); }
#report .report__read h3 { margin: 0 0 16px; }
#report .report__read ul { margin: 0; padding-left: 1.2em; display: grid; gap: 14px; line-height: 1.5; }

/* ==== 70-roadmap.css ==== */
#roadmap .roadmap__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 1024px) { #roadmap .roadmap__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
#roadmap .roadmap__list li { padding: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
#roadmap .badge { color: var(--muted); }
#roadmap .roadmap__list h3 { margin: 0; }
#roadmap .roadmap__list p { margin: 0; color: var(--muted); line-height: 1.55; }
#roadmap .roadmap__note { margin-top: 28px; }
#roadmap .roadmap__note a { text-decoration: underline; text-underline-offset: 3px; }

/* ==== 80-faq.css ==== */
#faq { padding-top: 0; }
#faq .faq__list { max-width: 820px; border-top: 1px solid var(--rule); }
#faq .faq__item { border-bottom: 1px solid var(--rule); }
#faq .faq__item summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 12px 0; cursor: pointer; font-weight: 800; font-size: 1.125rem; line-height: 1.35; color: var(--ink); }
#faq .faq__item summary::-webkit-details-marker { display: none; }
#faq .faq__item summary::after { content: "+"; flex: none; font-size: 1.75rem; font-weight: 500; line-height: 1; color: var(--navy); }
#faq .faq__item[open] summary::after { content: "\2212"; }
#faq .faq__answer { padding: 0 0 20px; max-width: 70ch; }
#faq .faq__answer p { margin: 0; color: var(--muted); line-height: 1.6; }
#faq .faq__answer a { text-decoration: underline; text-underline-offset: 3px; }

/* ==== 90-cta.css ==== */
#sovereign .cta__frame { display: grid; grid-template-columns: 1fr; gap: 28px; padding: clamp(28px, 6vw, 72px); border: 1px solid var(--rule-on-navy); border-radius: var(--radius); align-items: center; }
@media (min-width: 1024px) { #sovereign .cta__frame { grid-template-columns: 1fr 1fr; gap: 64px; } }
#sovereign .cta__lead { display: grid; gap: 20px; }
#sovereign .cta__by { text-transform: none; margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#sovereign .cta__by img { height: 22px; width: auto; display: block; }
#sovereign h2 { color: var(--on-navy); font-size: clamp(2rem, 4.5vw, 3.25rem); line-height: 1.1; margin: 0; }
#sovereign .cta__body { display: grid; gap: 20px; justify-items: start; }
#sovereign .cta__body p { margin: 0; }

/* ==== 99-footer.css ==== */
.site-footer { padding-block: 56px; color: var(--on-navy-muted); }
.site-footer .site-footer__grid { display: grid; gap: 32px; }
.site-footer .site-footer__brand, .site-footer .site-footer__meta { display: grid; gap: 14px; align-content: start; }
.site-footer .lockup { color: var(--on-navy); }
.site-footer .small { color: var(--on-navy-muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--on-navy); text-decoration: underline; }
@media (min-width: 720px) {
  .site-footer .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 48px; }
  .site-footer .site-footer__meta { justify-items: end; text-align: right; }
  .site-footer ul { justify-content: flex-end; }
}
