/* Self-hosted fonts: removes the third-party round-trip and lets us preload.
   Regenerate by re-fetching the Google Fonts css2 API for:
   Familjen Grotesk 500;600 · Public Sans 400;500 · IBM Plex Mono 400;500 */

@font-face {
  font-family: 'Familjen Grotesk';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url('/fonts/familjen-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/public-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   Aviran — "Calibrated Instrument"
   Vanilla CSS. No framework, no reset library.
   ============================================================ */

:root {
  /* Palette — neutral ramp, black line accent, no brand color */
  --ground:     #F6F5F9;
  --plate:      #FFFFFF;
  --ink:        #17141F;
  --ink-soft:   #57536A;
  --rule:       #D7D3E2;
  --rule-soft:  #E6E2F0;

  --signal:     var(--ink);  /* was violet; now black, outline-only usage */
  --graphite:   #626D72;  /* Waiting — no signal yet; AA on both ground and plate */
  --alert:      #C0182B;  /* Blocking */

  /* Type */
  --display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body:    "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Layout */
  --shell: 1120px;
  --pad: 32px;

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

/* ── Reset-ish ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, ol, ul, figure, table { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ── Accessibility helpers ─────────────────────────────────── */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff;
  padding: 10px 16px; z-index: 100; border-radius: 0 0 3px 0;
}
.skip-link:focus { left: 0; }

:where(a, button, summary, [role="tab"], [role="tabpanel"]):focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Structure ─────────────────────────────────────────────── */
.shell { max-width: var(--shell); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: 104px 0; }
.section + .section { border-top: 1px solid var(--rule); }

/* ── Type ──────────────────────────────────────────────────── */
.display {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
/* the explicit <br> sets the break; balancing fights it */
.display--xl { font-size: clamp(2.5rem, 5.4vw, 4rem); text-wrap: normal; }
.display--lg { font-size: clamp(1.85rem, 3.2vw, 2.6rem); }

.kicker {
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.lede {
  font-size: 1.18rem;
  color: var(--ink-soft);
  max-width: 56ch;
  margin-top: 24px;
}

.footnote { font-size: 0.86rem; color: var(--ink-soft); margin-top: 28px; }
.footnote abbr { text-decoration: none; font-style: normal; }

.mono { font-family: var(--mono); font-variant-ligatures: none; }

@media (max-width: 620px) { .brk { display: none; } }

/* ── Nav ───────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav__inner {
  display: flex; align-items: center; gap: 32px;
  height: 66px;
}
.wordmark {
  display: inline-flex; align-items: center;
  font-family: var(--display); font-weight: 600; font-size: 1.15rem;
  letter-spacing: -0.02em; text-decoration: none;
}
.nav__links { display: flex; gap: 26px; margin-left: auto; }
.nav__links a {
  text-decoration: none; font-size: 0.95rem; color: var(--ink-soft);
  transition: color .16s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__cta { flex: none; }

@media (max-width: 720px) {
  .nav__links { display: none; }
  .nav__cta { margin-left: auto; }
}

/* ── Buttons ───────────────────────────────────────────────── */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 22px;
  font-family: var(--display); font-weight: 500; font-size: 0.95rem;
  text-decoration: none; border-radius: 3px;
  transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.btn--primary { background: none; color: var(--ink); border: 1.5px solid var(--ink); }
.btn--primary:hover { background: var(--rule-soft); }
.btn--ghost { border: 1px solid var(--rule); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }
.nav__cta { height: 38px; padding: 0 16px; font-size: 0.9rem; }

/* ============================================================
   THE PLATE — the Product Contract as an inspectable document
   ============================================================ */
.plate {
  background: var(--plate);
  border: 1px solid var(--rule);
  border-radius: 5px;
  box-shadow:
    0 1px 1px rgba(23, 20, 31, 0.03),
    0 18px 40px -24px rgba(23, 20, 31, 0.22);
  overflow: hidden;
}

.plate__masthead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
}
.plate__title {
  font-family: var(--display); font-weight: 600; font-size: 0.98rem;
  letter-spacing: -0.01em;
}
.plate__meta { font-size: 0.72rem; color: var(--ink-soft); }

.plate__body { padding: 20px; }

.plate__preamble {
  font-size: 0.85rem; line-height: 1.6; color: var(--ink-soft);
  padding-bottom: 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--rule-soft);
}

.plate__note {
  font-size: 0.78rem; color: var(--ink-soft);
  padding: 12px 20px;
  border-top: 1px solid var(--rule-soft);
}

/* ── The ledger ────────────────────────────────────────────── */
.ledger { width: 100%; border-collapse: collapse; }

.ledger th {
  font-family: var(--display); font-weight: 500; font-size: 0.74rem;
  color: var(--ink-soft); text-align: left;
  padding: 10px 12px 8px 0;
  border-bottom: 1px solid var(--rule);
}
.ledger td {
  font-size: 0.86rem;
  padding: 11px 12px 11px 0;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: baseline;
}
.ledger tbody tr:last-child td { border-bottom: 0; }
.ledger td:last-child, .ledger th:last-child { padding-right: 0; }

.ledger .col-src {
  width: 118px; font-size: 0.75rem; color: var(--ink-soft);
  white-space: nowrap;
}
.ledger .col-state { width: 112px; }
.ledger td .mono { font-size: 0.8em; }

.ledger--compact td { font-size: 0.85rem; padding: 9px 12px 9px 0; }

/* ── States: color only, no dots ───────────────────────────── */
.state {
  display: inline-flex; align-items: center;
  font-size: 0.8rem; font-weight: 500; color: var(--ink);
  white-space: nowrap;
}
.state--ok { color: var(--ink); font-weight: 600; }
.state--wait { color: var(--graphite); }
.state--block { color: var(--alert); font-weight: 600; }

/* ── Hero ──────────────────────────────────────────────────── */
.hero { padding-top: 84px; }
.hero-title { display: flex; flex-direction: column; }
.hero-title__big {
  display: block;
  font-size: clamp(3.4rem, 7.8vw, 6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.02;
}
.hero-title__small {
  display: block;
  margin-top: 0.4em;
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink-soft);
}
/* ── The loop: a cycle, not a numbered list ────────────────── */
.loop__steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  margin-top: 46px;
  position: relative;
}
.loop__step {
  position: relative;
  padding: 26px 32px 26px 0;
  border-top: 1px solid var(--rule);
}
.loop__step + .loop__step { padding-left: 32px; }
.loop__step h3 {
  font-family: var(--display); font-weight: 600; font-size: 1.22rem;
  letter-spacing: -0.02em; margin-bottom: 10px;
}
.loop__step p { font-size: 0.92rem; color: var(--ink-soft); }

/* return device: the loop closes back on itself */
.loop__return {
  height: 26px; margin: 0 4px 0 4px;
  border: 1px solid var(--rule);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  position: relative;
}
.loop__return::before {
  content: ""; position: absolute; top: -1px; left: -1px;
  width: 8px; height: 8px;
  border-left: 1px solid var(--rule);
  border-top: 1px solid var(--rule);
  transform: rotate(45deg) translate(1px, 1px);
  transform-origin: top left;
}

@media (max-width: 800px) {
  .loop__steps { grid-template-columns: 1fr; }
  .loop__step, .loop__step + .loop__step { padding: 22px 0 22px 20px; }
  .loop__step { border-top: 0; border-left: 1px solid var(--rule); }
  .loop__return { display: none; }
}

/* ── Capabilities ──────────────────────────────────────────── */
.caps__list { margin-top: 42px; }
.caps__row {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 40px;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}
.caps__row:last-child { border-bottom: 1px solid var(--rule); }
.caps__row dt {
  font-family: var(--display); font-weight: 600; font-size: 1.14rem;
  letter-spacing: -0.02em;
}
.caps__row dd { font-size: 0.95rem; color: var(--ink-soft); max-width: 68ch; }

@media (max-width: 800px) {
  .caps__row { grid-template-columns: 1fr; gap: 10px; }
}

/* ── Process ───────────────────────────────────────────────── */
.process__head { max-width: 62ch; }
.process__intro { margin-top: 18px; color: var(--ink-soft); font-size: 1.02rem; }

.process__layout {
  display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 56px;
  margin-top: 52px;
  align-items: start;
}

/* the progress spine — the only numerals on the page */
.spine { border-left: 1px solid var(--rule); }
.spine__item {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px;
  align-items: baseline;
  width: 100%; text-align: left; cursor: pointer;
  padding: 16px 12px 16px 20px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.spine__item:hover { background: color-mix(in srgb, var(--plate) 60%, transparent); }
.spine__item.is-active { border-left-color: var(--signal); }
.spine__num {
  font-family: var(--display); font-weight: 600; font-size: 0.92rem;
  color: var(--graphite);
  line-height: 1.5;
  transition: color .18s var(--ease);
}
.spine__item.is-active .spine__num { color: var(--signal); }
.spine__name {
  font-family: var(--display); font-weight: 500; font-size: 1.02rem;
  color: var(--ink-soft); letter-spacing: -0.01em;
  transition: color .18s var(--ease);
}
.spine__item.is-active .spine__name { color: var(--ink); }

.panel__title {
  font-family: var(--display); font-weight: 600; font-size: 1.5rem;
  letter-spacing: -0.02em;
}
.panel__body { margin-top: 14px; color: var(--ink-soft); font-size: 0.98rem; max-width: 62ch; }
.panel__points { margin-top: 20px; display: grid; gap: 8px; }
.panel__points li {
  position: relative; padding-left: 20px;
  font-size: 0.92rem; color: var(--ink-soft);
}
.panel__points li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 6px; height: 1px; background: var(--graphite);
}
.plate--sm { margin-top: 30px; max-width: 680px; }

@media (max-width: 900px) {
  .process__layout { grid-template-columns: 1fr; gap: 34px; }
  .spine { display: flex; overflow-x: auto; border-left: 0; border-bottom: 1px solid var(--rule); }
  .spine__li { flex: none; }
  .spine__item {
    border-left: 0; border-bottom: 1px solid transparent;
    margin-left: 0; margin-bottom: -1px;
    padding: 12px 18px 12px 0; gap: 10px;
    grid-template-columns: auto minmax(0, 1fr);
  }
  .spine__item.is-active { border-bottom-color: var(--signal); background: none; }
  .spine__name { white-space: nowrap; }
}

/* ── Config diff ───────────────────────────────────────────── */
.revised { display: grid; }
.revised__row {
  display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.8rem;
}
.revised__row:last-child { border-bottom: 0; }
.revised__row dt { color: var(--ink-soft); }
.revised__row dd { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.was { color: var(--graphite); text-decoration: line-through; text-decoration-thickness: 1px; }
.arrow {
  width: 11px; height: 1px; background: var(--rule); flex: none; position: relative;
}
.arrow::after {
  content: ""; position: absolute; right: 0; top: -2px;
  width: 5px; height: 5px;
  border-top: 1px solid var(--rule); border-right: 1px solid var(--rule);
  transform: rotate(45deg);
}
.now { color: var(--ink); font-weight: 500; }
.now--same { color: var(--ink-soft); font-weight: 400; }

@media (max-width: 560px) {
  .revised__row { grid-template-columns: 1fr; gap: 4px; }
}

/* ── Audit trail ledger ────────────────────────────────────── */
.trail { position: relative; }
.trail__row {
  display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.85rem;
}
.trail__row:last-child { border-bottom: 0; }
.trail__ts { font-size: 0.74rem; color: var(--ink-soft); white-space: nowrap; }
.trail__what .mono { font-size: 0.86em; }

@media (max-width: 560px) {
  .trail__row { grid-template-columns: 1fr; gap: 3px; }
}

/* ── FAQ ───────────────────────────────────────────────────── */
.faq__list { margin-top: 40px; }
.qa { border-top: 1px solid var(--rule); }
.qa:last-child { border-bottom: 1px solid var(--rule); }
.qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 24px 0; cursor: pointer; list-style: none;
}
.qa summary::-webkit-details-marker { display: none; }
.qa__q {
  font-family: var(--display); font-weight: 500; font-size: 1.12rem;
  letter-spacing: -0.015em;
}
.qa summary::after {
  content: ""; flex: none;
  width: 9px; height: 9px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .2s var(--ease);
}
.qa[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.qa__a { padding-bottom: 26px; max-width: 76ch; }
.qa__a p { color: var(--ink-soft); font-size: 0.95rem; }

/* ── CTA ───────────────────────────────────────────────────── */
.cta__card {
  background: var(--plate);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 60px;
  box-shadow: 0 18px 40px -28px rgba(23, 20, 31, 0.2);
}
.cta__lede { margin-top: 18px; color: var(--ink-soft); font-size: 1.1rem; max-width: 52ch; }

@media (max-width: 620px) { .cta__card { padding: 34px 24px; } }

/* ── Footer ────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--rule); padding: 52px 0; }
.footer__inner {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 40px; flex-wrap: wrap;
}
.footer__tag { margin-top: 12px; font-size: 0.9rem; color: var(--ink-soft); max-width: 40ch; }
.footer__nav { display: flex; flex-direction: column; gap: 9px; }
.footer__nav a {
  text-decoration: none; font-size: 0.9rem; color: var(--ink-soft);
  transition: color .16s var(--ease);
}
.footer__nav a:hover { color: var(--ink); }
.footer__legal { font-size: 0.82rem; color: var(--ink-soft); }

/* ── Small screens ─────────────────────────────────────────── */
@media (max-width: 560px) {
  :root { --pad: 20px; }
  body { font-size: 16px; }
  .section { padding: 68px 0; }
  .hero { padding-top: 52px; }
  .actions { gap: 10px; }
  .actions .btn { width: 100%; }
  .plate__masthead { flex-direction: column; align-items: flex-start; gap: 4px; }
  .plate__body { padding: 16px; }

  /* Narrow: the ledger stops being a squeezed table and becomes
     one record per row — requirement, then its source and state. */
  .ledger--rows, .ledger--rows tbody { display: block; }
  .ledger--rows thead {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .ledger--rows tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule-soft);
  }
  .ledger--rows tbody tr:first-child { padding-top: 4px; }
  .ledger--rows tbody tr:last-child { border-bottom: 0; padding-bottom: 0; }
  .ledger--rows td { display: block; border: 0; padding: 0; }
  .ledger--rows td:not(.col-src):not(.col-state) {
    grid-column: 1 / -1; order: 1;
    font-size: 0.92rem; line-height: 1.45;
  }
  .ledger--rows .col-src {
    grid-column: 1; order: 2; width: auto;
    white-space: nowrap; align-self: center;
  }
  .ledger--rows .col-state {
    grid-column: 2; order: 3; width: auto; justify-self: end;
  }
}
