/* Sibylline Codex marketing site. Pure static, no external resources.
   Design language shared with the API Explorer (web/src/style.css):
   editorial legal-tech, soft off-white ground, 1px hairline rules,
   no rounded corners, ink + blue + signal yellow. The webfonts the
   Explorer loads (Libre Franklin, IBM Plex Mono) lead the stacks
   here too but fall back to system fonts: this site makes no
   external requests. */

:root {
  /* palette (mirrors the Explorer's tokens) */
  --ink: #0a0a0a;
  --paper: #faf9f6;
  --surface: #ffffff;
  --surface-alt: #f7f6f2;
  --blue: #1f35ff;
  --blue-hover: #0a1fd6;
  --accent-yellow: #e5ff00;
  --pink: #f5156e;

  /* hairlines */
  --line: #0a0a0a;
  --line-soft: #c9c6bd;
  --line-faint: #e5e2da;

  /* text */
  --text: #0a0a0a;
  --text-muted: #666666;

  --sans:
    "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 1180px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-yellow);
  color: var(--ink);
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-alt);
  border: 1px solid var(--line-faint);
  border-radius: 0;
  padding: 0.08em 0.38em;
  color: var(--ink);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--blue);
  color: var(--surface);
  padding: 10px 18px;
  border-radius: 0;
  font-weight: 700;
}

.skip-link:focus {
  left: 0;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line-faint);
  transition: border-color 0.3s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--line-soft);
}

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
  display: block;
}

.beta-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  padding: 2.5px 8px;
  transform: translateY(1px);
}

.nav-links {
  display: flex;
  gap: 26px;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.nav-links a:hover {
  color: var(--ink);
  text-decoration: none;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 0;
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--surface);
}

.btn-primary:hover {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
}

.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--surface);
}

.btn-small {
  padding: 9px 16px;
  font-size: 13px;
  margin-left: 8px;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper);
}

#mesh {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(84px, 12vh, 150px) 24px clamp(64px, 9vh, 110px);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 22px;
}

.eyebrow .sep {
  color: var(--line-soft);
  margin: 0 4px;
}

h1 {
  font-weight: 800;
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 0 0 26px;
  max-width: 24ch;
  text-wrap: balance;
}

h1 em {
  font-style: normal;
  background: var(--accent-yellow);
  padding: 0 0.08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.lede {
  max-width: 62ch;
  font-size: clamp(16.5px, 1.5vw, 18.5px);
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0 0 38px;
}

.lede strong {
  color: var(--ink);
  font-weight: 700;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: clamp(52px, 8vh, 84px);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--ink);
}

.stat {
  padding: 26px 26px 6px 0;
  border-right: 1px solid var(--line-faint);
  margin-right: 26px;
}

.stat:last-child {
  border-right: none;
  margin-right: 0;
}

.stat dd {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat dt {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.stats-note {
  margin: 26px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
}

.stats-note code {
  font-size: 11px;
}

/* ---------- sections ---------- */

section {
  padding: clamp(76px, 10vh, 128px) 24px;
}

.section-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(40px, 6vh, 64px);
}

h2 {
  font-weight: 800;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  text-wrap: balance;
}

.section-head p {
  color: var(--text-muted);
  font-size: 17px;
  margin: 0;
}

/* the mono label keeps its blue against the .section-head p override */
.section-head .eyebrow,
.contact-box .eyebrow {
  color: var(--blue);
  font-size: 12px;
  margin-bottom: 22px;
}

.alt {
  background: var(--surface-alt);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

/* ---------- corpus cards ---------- */

.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.card {
  position: relative;
  border-radius: 0;
  padding: 28px 26px 24px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.card-flag {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.card-flag .code {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--blue);
  color: var(--surface);
  padding: 4px 9px;
}

.card-flag .name {
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-count {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--line-faint);
  padding-bottom: 14px;
  margin: 0 0 14px;
}

.card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.card li {
  position: relative;
  padding: 7px 0 7px 22px;
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.card li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 15px;
  width: 7px;
  height: 7px;
  background: var(--blue);
}

.card li strong {
  color: var(--ink);
  font-weight: 700;
}

/* ---------- pillars ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.pillar {
  border-radius: 0;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 26px 24px;
  transition: border-color 0.2s ease;
}

.pillar:hover {
  border-color: var(--ink);
}

.pillar .glyph {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: var(--surface-alt);
  border: 1px solid var(--ink);
  margin-bottom: 18px;
}

.pillar .glyph svg {
  display: block;
}

.pillar h3 {
  font-weight: 700;
  font-size: 17.5px;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.pillar p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.62;
}

.pillar p code {
  white-space: normal;
}

/* ---------- developer section ---------- */

.dev-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

.dev-grid > * {
  /* long code lines scroll inside their panel instead of widening the column */
  min-width: 0;
}

.codepanel {
  border-radius: 0;
  border: 1px solid var(--ink);
  background: var(--ink);
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--line-soft);
}

.codepanel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink);
  background: var(--surface);
}

.codepanel-head .dot {
  width: 9px;
  height: 9px;
  background: var(--blue);
}

.codepanel-head .label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink);
  letter-spacing: 0.1em;
}

.copy-btn {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 5px 12px;
  cursor: pointer;
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s;
}

.copy-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

.codepanel pre {
  margin: 0;
  padding: 20px 20px 22px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  color: #f2f1ec;
}

.codepanel pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  white-space: pre;
}

.tok-c {
  color: #9a9a94;
  font-style: italic;
}

.tok-cmd {
  color: var(--accent-yellow);
}

.tok-s {
  color: #aab6ff;
}

.tok-k {
  color: #8d9cff;
}

.dev-note {
  margin: 14px 2px 0;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.dev-note code {
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.toolchips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 34px;
}

.toolchips .chip {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  border: 1px solid var(--line-soft);
  background: var(--surface);
  border-radius: 0;
  padding: 5px 12px;
}

.toolchips-label {
  width: 100%;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 2px;
}

/* ---------- Testphase ---------- */

.contact-box {
  border-radius: 0;
  border: 1px solid var(--ink);
  background: var(--surface);
  box-shadow: 8px 8px 0 var(--ink);
  padding: clamp(44px, 6vw, 72px);
  text-align: center;
}

.contact-box h2 {
  margin-bottom: 14px;
}

.contact-box p {
  max-width: 58ch;
  margin: 0 auto 32px;
  color: var(--text-muted);
}

.contact-box .cta-row {
  justify-content: center;
  margin-bottom: 0;
}

.contact-note {
  margin: 26px auto 0;
  max-width: 60ch;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 48px 24px 42px;
  background: var(--surface-alt);
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 36px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.footer-brand img {
  width: 26px;
  height: 26px;
}

.site-footer p {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 52ch;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 9px;
  justify-self: end;
  text-align: right;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--blue);
}

.footer-meta {
  max-width: var(--maxw);
  margin: 36px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--line-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- legal pages ---------- */

.legal-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

.legal-main h1 {
  font-size: clamp(32px, 5vw, 44px);
  max-width: none;
}

.legal-main h2 {
  font-size: 22px;
  margin-top: 44px;
}

.legal-main p,
.legal-main li {
  color: var(--text-muted);
  font-size: 15.5px;
}

.todo {
  display: block;
  border: 1px solid var(--ink);
  background: var(--accent-yellow);
  border-radius: 0;
  padding: 14px 18px;
  color: var(--ink);
  font-size: 14px;
  margin: 14px 0;
}

.todo::before {
  content: "TODO · ";
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.back-link {
  display: inline-block;
  margin-bottom: 36px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- reveal animation ---------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1),
    transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
  transition-delay: var(--reveal-delay, 0s);
}

html.js .reveal.in {
  opacity: 1;
  transform: none;
}

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

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn,
  .card,
  .pillar {
    transition: none;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .cards-3,
  .pillars {
    grid-template-columns: 1fr 1fr;
  }

  .dev-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
    border-bottom: 1px solid var(--line-faint);
    padding-bottom: 18px;
  }
}

/* The "Sibylline Codex" wordmark plus the full link row need roughly 930px;
   collapse the links earlier than the 720px layout switch so the header
   never wraps in between. */
@media (max-width: 960px) {
  .nav-links {
    display: none;
  }

  .nav > .btn {
    margin-left: auto;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .nav {
    padding: 12px 18px;
    gap: 14px;
  }

  /* The longer "Sibylline Codex" wordmark must stay on one line next to the
     Beta tag and the API Explorer button on narrow screens. */
  .brand {
    font-size: 16px;
    gap: 8px;
    white-space: nowrap;
  }

  .brand img {
    width: 26px;
    height: 26px;
  }

  .nav .beta-tag {
    padding: 2px 6px;
  }

  .nav-links {
    display: none;
  }

  .nav > .btn {
    margin-left: auto;
  }

  section {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero-inner {
    padding-left: 18px;
    padding-right: 18px;
  }

  .cards-3,
  .pillars {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
  }

  .stat dd {
    font-size: 26px;
  }

  .cta-row .btn {
    flex: 1 1 auto;
  }

  .contact-box {
    box-shadow: 5px 5px 0 var(--ink);
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-self: start;
    text-align: left;
  }
}
