/* First State Logic LLC: site design.
   One stylesheet, no scripts, no external fonts or images (works under a strict CSP).
   Order: tokens, base, layout, header, hero, sections, components, footer, small pages, print. */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light dark;

  /* Brand (brand/final/README.md) */
  --navy: #0B2545;
  --gold: #D9A441;
  --pale: #E8EEF7;
  --navy-deep: #061528;

  /* Light theme roles */
  --bg: #FAF8F3;            /* warm paper, a quiet nod to "buff" */
  --surface: #EEF2F8;
  --ink: #0B2545;
  --ink-muted: #43546D;     /* 7.2:1 on --bg */
  --accent-text: #73510D;   /* gold dark enough for text on paper, 6.6:1 */
  --rule: #C9D2E0;
  --rule-strong: #0B2545;
  --focus: #0B2545;
  --tile-border: transparent;

  /* Type: system faces only. Space Grotesk (the logo face) is used if the visitor has it. */
  --font-display: "Space Grotesk", "Avenir Next", "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --font-body: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Type scale: 1.2 on phones growing to 1.333 on wide screens, all in rem so text zoom works */
  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.44rem, 1.25rem + 0.95vw, 2rem);
  --step-3: clamp(1.73rem, 1.4rem + 1.65vw, 2.66rem);
  --step-4: clamp(2.07rem, 1.5rem + 2.85vw, 3.55rem);
  --step-5: clamp(2.3rem, 1.45rem + 4.25vw, 4.5rem);

  /* Spacing: 4 px base, doubling rhythm */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --section-gap: clamp(3.5rem, 2.5rem + 5vw, 7rem);

  --radius-tile: clamp(1.25rem, 1rem + 1.2vw, 2rem);   /* the logo tile's corner */
  --radius: 0.5rem;
  --bar: 0.375rem;                                       /* the logo's gold bar */
  --measure: 62ch;
  --page: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #061528;
    --surface: #0B2545;
    --ink: #E8EEF7;
    --ink-muted: #A9B8CE;   /* 8.6:1 on --bg */
    --accent-text: #D9A441; /* 7.9:1 on --bg */
    --rule: #223A5C;
    --rule-strong: #E8EEF7;
    --focus: #D9A441;
    --tile-border: #223A5C;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--s-5);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p, ul, ol, dl, dd, figure, address { margin: 0; }
ul, ol { padding: 0; list-style: none; }
address { font-style: normal; }
img { max-width: 100%; height: auto; display: block; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 0.125em;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 0.22em; }

:focus-visible {
  outline: 0.1875rem solid var(--focus);
  outline-offset: 0.1875rem;
  border-radius: 0.25rem;
}

::selection { background: var(--gold); color: var(--navy); }

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -6rem;
  z-index: 10;
  padding: var(--s-3) var(--s-4);
  background: var(--navy);
  color: #FFFFFF;
  border-radius: var(--radius);
  font-weight: 600;
}
.skip-link:focus { top: var(--s-4); outline-color: var(--gold); }

/* ---------- 3. Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block-start: var(--section-gap); }

/* Section = a label rail on the left, content on the right (stacked on phones) */
.section__grid {
  display: grid;
  gap: var(--s-5);
  border-top: 0.125rem solid var(--rule-strong);
  padding-top: var(--s-5);
}

.label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: flex;
  gap: var(--s-3);
  align-items: baseline;
}
.label__no { color: var(--accent-text); font-weight: 700; }

.section h2 { font-size: var(--step-4); }
.section__body > * + * { margin-top: var(--s-5); }
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--s-4); }
.lede { font-size: var(--step-1); line-height: 1.4; }
.muted { color: var(--ink-muted); }
.small { font-size: var(--step--1); }

@media (min-width: 56em) {
  .section__grid {
    grid-template-columns: minmax(10rem, 3fr) 9fr;
    gap: var(--s-7);
  }
  .label { flex-direction: column; gap: var(--s-1); position: sticky; top: var(--s-5); align-self: start; }
}

/* ---------- 4. Header ---------- */
.site-header { padding-block: var(--s-4); }
.site-header__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2) var(--s-5);
}
.brand { display: inline-block; text-decoration: none; border-radius: var(--radius); }
.brand img { width: clamp(12.5rem, 10rem + 9vw, 16rem); }

.nav ul { display: flex; flex-wrap: wrap; margin-inline: calc(var(--s-3) * -1); }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;               /* 44 px tap target */
  padding-inline: var(--s-3);
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration-color: transparent;
}
.nav a:hover, .nav a[aria-current="page"] { text-decoration-color: var(--gold); }

/* ---------- 5. Hero: the logo tile, scaled up ---------- */
.hero { padding-block-start: var(--s-3); }
.hero__tile {
  position: relative;
  overflow: hidden;
  background-color: var(--navy);
  /* faint drafting grid */
  background-image:
    linear-gradient(rgba(232, 238, 247, 0.045) 0.0625rem, transparent 0.0625rem),
    linear-gradient(90deg, rgba(232, 238, 247, 0.045) 0.0625rem, transparent 0.0625rem);
  background-size: 3rem 3rem;
  color: #FFFFFF;
  border: 0.0625rem solid var(--tile-border);
  border-radius: var(--radius-tile);
  padding: clamp(1.5rem, 0.75rem + 4.5vw, 4.5rem);
  display: grid;
  gap: var(--s-7);
  --focus: #D9A441;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--s-5);
}

/* On a phone the two halves stack, so the line never breaks after a dangling dot. */
@media (max-width: 39.99em) {
  .eyebrow span { display: block; }
  .eyebrow__dot { display: none !important; }
}

.hero h1 { font-size: var(--step-5); max-width: 14ch; }

/* The gold bar from under the logo's monogram */
.bar {
  display: block;
  width: min(100%, 11rem);
  height: var(--bar);
  border-radius: var(--bar);
  background: var(--gold);
  margin-block: var(--s-5);
}

.hero .lede { color: #D3DCEA; max-width: 34ch; }

.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 3rem;
  padding: var(--s-2) var(--s-5);
  border-radius: 62.5rem;
  border: 0.125rem solid var(--gold);
  background: var(--gold);
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
}
.btn:hover { background: #E6B85F; border-color: #E6B85F; }
.btn--ghost { background: transparent; color: #FFFFFF; border-color: rgba(232, 238, 247, 0.55); }
.btn--ghost:hover { background: rgba(232, 238, 247, 0.1); border-color: #FFFFFF; }
.btn--ink { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn--ink:hover { background: var(--ink); border-color: var(--gold); }
.btn .arrow { font-family: var(--font-mono); }

/* The argument: two premises and a conclusion */
.proof {
  align-self: end;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  line-height: 1.5;
  border-top: 0.0625rem solid rgba(232, 238, 247, 0.3);
}
.proof li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: var(--s-3);
  padding-block: var(--s-3);
  border-bottom: 0.0625rem solid rgba(232, 238, 247, 0.3);
  color: #D3DCEA;
}
.proof__mark { color: var(--gold); font-weight: 700; }
.proof__mark--therefore { font-size: 1.5em; line-height: 1; }
.proof li:last-child { color: #FFFFFF; font-weight: 700; border-bottom: var(--bar) solid var(--gold); }

@media (min-width: 56em) {
  .hero__tile { grid-template-columns: 7fr 5fr; gap: var(--s-8); align-items: end; }
}

/* ---------- 6. Flagship: TrueOdo ---------- */
.product__head { display: flex; align-items: center; gap: var(--s-4); }
.product__mark { width: 3.5rem; height: 3.5rem; border-radius: 0.8rem; flex: none; }
.status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: clamp(0.6875rem, 3.2vw, var(--step--1));
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-transform: uppercase;
  border: 0.0625rem solid var(--rule-strong);
  border-radius: 62.5rem;
  padding: var(--s-1) var(--s-3);
}

.product { display: grid; gap: var(--s-6); }
@media (min-width: 75em) {
  .product { grid-template-columns: 1fr 1fr; gap: var(--s-7); align-items: start; }
}

.numbered { counter-reset: n; border-top: 0.0625rem solid var(--rule); }
.numbered li {
  counter-increment: n;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: var(--s-3);
  padding-block: var(--s-3);
  border-bottom: 0.0625rem solid var(--rule);
}
.numbered li::before {
  content: counter(n, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--accent-text);
  padding-top: 0.2em;
}
.numbered strong { font-family: var(--font-display); }

/* The zero ledger: an odometer that reads all zeros, then the same fact line by line */
.ledger {
  background: var(--surface);
  border: 0.0625rem solid var(--rule);
  border-radius: var(--radius-tile);
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
}
.ledger__title {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.odo {
  display: flex;
  gap: 0.25rem;
  margin-block: var(--s-4) var(--s-5);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--step-4);
  line-height: 1;
}
.odo span {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 4rem;
  padding-block: 0.4em;
  text-align: center;
  background: var(--navy-deep);
  color: #FFFFFF;
  border-radius: 0.375rem;
  border: 0.0625rem solid #223A5C;
}
.odo span::after {                       /* the seam between number wheels */
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  border-top: 0.0625rem solid rgba(232, 238, 247, 0.16);
}
.odo span:last-child { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.odo span:last-child::after { border-top-color: rgba(11, 37, 69, 0.2); }

.ledger dl > div {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  padding-block: var(--s-2);
}
.ledger dl { font-size: 1rem; }
.ledger dt { order: 1; }
.ledger dl > div::after {                /* dotted leader */
  content: "";
  order: 2;
  flex: 1;
  min-width: 1rem;
  border-bottom: 0.125rem dotted var(--rule-strong);
  opacity: 0.4;
  transform: translateY(-0.25em);
}
.ledger dd { order: 3; font-family: var(--font-mono); font-weight: 700; }
.ledger__note { margin-top: var(--s-4); }

/* ---------- 7. What we build: rows, not cards ---------- */
.rows { border-top: 0.0625rem solid var(--rule); }
.rows > div {
  display: grid;
  gap: var(--s-2) var(--s-6);
  padding-block: var(--s-5);
  border-bottom: 0.0625rem solid var(--rule);
}
.rows dt { font-family: var(--font-display); font-weight: 700; font-size: var(--step-2); line-height: 1.15; letter-spacing: -0.01em; }
.rows dd { color: var(--ink-muted); max-width: 46ch; }
@media (min-width: 44em) {
  .rows > div { grid-template-columns: 5fr 6fr; align-items: baseline; }
}

/* ---------- 8. Contact ---------- */
.contact__mail {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 0.6rem + 3.4vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  padding-block: var(--s-2);
}
.contact__grid { display: grid; gap: var(--s-5); }
.contact__grid dt {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--s-1);
}
.contact__grid a { display: inline-flex; align-items: center; min-height: 2.75rem; }
@media (min-width: 44em) {
  .contact__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 9. Footer ---------- */
.site-footer { margin-top: var(--section-gap); padding-block: var(--s-6); border-top: 0.0625rem solid var(--rule); }
.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-2) var(--s-6);
  color: var(--ink-muted);
  font-size: var(--step--1);
}
.site-footer a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.site-footer p { display: flex; align-items: center; min-height: 2.75rem; }

/* ---------- 10. Small pages (coming soon, 404) ---------- */
.notice { padding-block-start: var(--s-3); }
.notice .hero__tile { grid-template-columns: 1fr; min-height: min(60vh, 34rem); align-content: center; }
.notice h1 { font-size: var(--step-5); max-width: 12ch; }
.notice__code { font-family: var(--font-mono); color: var(--gold); letter-spacing: 0.08em; }

/* ---------- 11. Motion: only for people who have not asked for less ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  a, .btn { transition: text-decoration-color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }
}

/* ---------- 12. Forced colors and print ---------- */
@media (forced-colors: active) {
  .bar, .odo span { border: 0.0625rem solid CanvasText; }
  .btn { border-color: ButtonText; }
}

@media print {
  :root { --bg: #FFFFFF; --ink: #000000; --ink-muted: #333333; --surface: #FFFFFF; }
  .nav, .skip-link, .actions { display: none; }
  .hero__tile { background: none; color: #000000; border: 0.0625rem solid #000000; }
  .hero .lede, .proof li, .proof li:last-child { color: #000000; }
  .eyebrow, .proof__mark { color: #000000; }
}

a[href^="tel:"] { white-space: nowrap; }
