/* invarith.ai — single stylesheet. The site has no JavaScript of its own. */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --bg: #f7f6f2;
  --bg-alt: #f0eee8;
  --surface: #ffffff;
  --ink: #121417;
  --ink-2: #3a3f47;
  --muted: #5f656f;
  --line: #e2dfd6;
  --line-strong: #cbc7bb;
  --accent: #0e6b5c;
  --accent-ink: #ffffff;
  --ok: #18733a;
  --ok-soft: #e3f2e7;
  --bad: #b42318;
  --bad-soft: #fbe8e6;
  --warn: #8a5a00;
  --warn-soft: #f9efd6;
  --shadow: 0 1px 2px rgba(18, 20, 23, 0.04), 0 18px 40px -18px rgba(18, 20, 23, 0.18);

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013;
    --bg-alt: #13161a;
    --surface: #171a1f;
    --ink: #ecedee;
    --ink-2: #c9cdd3;
    --muted: #9aa0aa;
    --line: #252a31;
    --line-strong: #383e48;
    --accent: #5cc8b0;
    --accent-ink: #062a23;
    --ok: #5ccb83;
    --ok-soft: #142a1c;
    --bad: #f28b80;
    --bad-soft: #351b18;
    --warn: #e6b450;
    --warn-soft: #322910;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 44px -18px rgba(0, 0, 0, 0.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* Brand -------------------------------------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 19px;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.mark { width: 28px; height: 28px; flex: none; }
.mark rect { fill: var(--accent); }
.mark path {
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 2.6;
  stroke-linecap: round;
}
.brand-sm { font-size: 16px; gap: 8px; }
.brand-sm .mark { width: 22px; height: 22px; }

/* Header ------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.site-header nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
}
.nav-link {
  color: var(--muted);
  text-decoration: none;
}
.nav-link:hover { color: var(--ink); }
.nav-cta {
  text-decoration: none;
  padding: 7px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}
.nav-cta:hover { border-color: var(--ink); }

/* Shared type -------------------------------------------------------- */

.eyebrow, .kicker {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 480;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.7rem, 1.7rem + 3.6vw, 4.6rem);
  line-height: 1.02;
  margin: 18px 0 22px;
}

h2 {
  font-size: clamp(2rem, 1.45rem + 2vw, 3.1rem);
  line-height: 1.08;
  margin: 14px 0 0;
  max-width: 19em;
}

h3 {
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.lede {
  font-size: clamp(1.06rem, 1rem + 0.3vw, 1.22rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 33em;
  text-wrap: pretty;
}

/* Buttons ------------------------------------------------------------ */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-secondary {
  border: 1px solid var(--line-strong);
}
.btn-secondary:hover { border-color: var(--ink); }

/* Hero --------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
  padding-top: 64px;
  padding-bottom: 112px;
}

/* Spec panel (illustrative) ------------------------------------------ */

.spec {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  font-size: 14px;
}
.spec-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
  font-family: var(--mono);
  font-size: 12.5px;
}
.dim { color: var(--muted); }
.spec-badge {
  color: var(--accent);
  white-space: nowrap;
}
.spec-label {
  padding: 16px 18px 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.invariants { padding-bottom: 8px; }
.invariants li {
  display: grid;
  grid-template-columns: 52px 86px 1fr;
  gap: 8px;
  padding: 5px 18px;
  line-height: 1.45;
}
.inv-id {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  padding-top: 1px;
}
.inv-tag {
  justify-self: start;
  align-self: start;
  margin-top: 1px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 6px;
}

.changes li {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-areas:
    "pr who title result"
    "detail detail detail detail";
  align-items: center;
  column-gap: 10px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  animation: rise 0.5s ease both;
}
.changes li:nth-child(1) { animation-delay: 0.35s; }
.changes li:nth-child(2) { animation-delay: 0.85s; }
.changes li:nth-child(3) { animation-delay: 1.35s; }

.pr {
  grid-area: pr;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.who {
  grid-area: who;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 7px;
}
.title { grid-area: title; }
.changes .result { grid-area: result; justify-self: end; }
.detail {
  grid-area: detail;
  margin-top: 8px;
  padding-left: 10px;
  border-left: 2px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
}
.spec-foot {
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* Result chips -------------------------------------------------------- */

.result {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.result::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.result.ok { color: var(--ok); background: var(--ok-soft); }
.result.bad { color: var(--bad); background: var(--bad-soft); }
.result.warn { color: var(--warn); background: var(--warn-soft); }

/* Sections ------------------------------------------------------------ */

.band {
  border-top: 1px solid var(--line);
  padding: 104px 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 64px;
  align-items: start;
}
.prose { padding-top: 36px; }
.prose p {
  color: var(--ink-2);
  font-size: 18px;
  max-width: 34em;
  text-wrap: pretty;
}
.prose p + p { margin-top: 1em; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 56px;
  border-top: 1px solid var(--line);
}
.steps li { padding: 28px 32px 0 0; }
.steps li + li {
  padding-left: 32px;
  border-left: 1px solid var(--line);
}
.step-no {
  display: block;
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}
.steps p, .cards p, .outcomes p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 16px;
  text-wrap: pretty;
}

.outcomes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 48px;
}
.outcomes li {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.outcomes p { margin-top: 14px; color: var(--ink-2); }
.note {
  margin-top: 32px;
  padding-left: 16px;
  border-left: 2px solid var(--accent);
  max-width: 44em;
  color: var(--ink-2);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 48px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.cards li {
  padding: 28px;
  background: var(--bg);
}

.cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
  padding: clamp(32px, 5vw, 64px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.cta-copy {
  margin-top: 16px;
  max-width: 34em;
  color: var(--ink-2);
  text-wrap: pretty;
}
.cta-alt {
  margin-top: 24px;
  color: var(--muted);
  font-size: 15px;
}
.cta-alt a {
  color: var(--ink);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.cta-alt a:hover { color: var(--accent); }

/* Contact form -------------------------------------------------------- */

.contact-form {
  display: grid;
  gap: 18px;
}
.field {
  display: grid;
  gap: 6px;
}
.field label {
  font-size: 14px;
  font-weight: 600;
}
.optional {
  font-weight: 400;
  color: var(--muted);
}
.field input,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming in on focus */
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}
.field textarea {
  min-height: 116px;
  resize: vertical;
}
.field input:hover,
.field textarea:hover { border-color: var(--muted); }
.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
  border-radius: 10px;
}
.field input:user-invalid,
.field textarea:user-invalid { border-color: var(--bad); }

/* The spam trap: off screen for people, still in the form for bots. */
.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-submit .cf-turnstile:not(:empty) { margin-bottom: 14px; }
.contact-form .btn {
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
.form-note {
  font-size: 13.5px;
  color: var(--muted);
}
.form-note a { color: var(--ink-2); text-underline-offset: 3px; }
.form-note a:hover { color: var(--accent); }

/* Footer -------------------------------------------------------------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 40px;
  padding-bottom: 56px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.site-footer a { text-decoration: none; }
.site-footer p a:hover { color: var(--ink); }

/* 404, thanks and error pages ----------------------------------------- */

.not-found, .notice {
  min-height: calc(100vh - 76px - 130px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 48px;
  padding-bottom: 96px;
}
.not-found .lede, .notice .lede { margin-top: 4px; }
.notice-links {
  margin-top: 28px;
  color: var(--ink-2);
}
.notice-links a { text-underline-offset: 3px; }
.notice-links a:hover { color: var(--accent); }

/* Privacy notice ------------------------------------------------------- */

.doc {
  max-width: 760px;
  padding-top: 48px;
  padding-bottom: 104px;
}
.doc h1 { margin-bottom: 8px; }
.doc-meta {
  margin-bottom: 40px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}
.doc h2 {
  margin-top: 48px;
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem);
}
.doc h3 { margin-top: 28px; }
.doc p {
  margin-top: 10px;
  color: var(--ink-2);
  text-wrap: pretty;
}
.doc a { text-underline-offset: 3px; }
.doc a:hover { color: var(--accent); }

/* Motion -------------------------------------------------------------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .changes li { animation: none; }
}

/* Responsive ---------------------------------------------------------- */

@media (max-width: 960px) {
  .hero, .split, .cta { grid-template-columns: minmax(0, 1fr); }
  .hero { gap: 56px; padding-top: 40px; padding-bottom: 88px; }
  .split { gap: 24px; align-items: start; }
  .prose { padding-top: 0; }
  .cta { gap: 40px; }
  .steps, .outcomes { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { border-top: 0; margin-top: 40px; }
  .steps li, .steps li + li {
    padding: 24px 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .step-no { margin-bottom: 10px; }
  .band { padding: 80px 0; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .site-header { height: 64px; }
  .hero { padding-top: 28px; }
  .eyebrow { font-size: 11px; letter-spacing: 0.06em; }
  .nav-link { display: none; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .cards li { padding: 22px; }
  .outcomes li { padding: 20px; }
  .prose p { font-size: 17px; }
  .band { padding: 64px 0; }
  .spec-head { padding: 11px 14px; }
  .spec-label { padding-left: 14px; padding-right: 14px; }
  .invariants li { padding: 5px 14px; grid-template-columns: 44px 80px 1fr; }
  .changes li {
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas:
      "pr who result"
      "title title title"
      "detail detail detail";
    row-gap: 6px;
    padding: 12px 14px;
  }
  .spec-foot { padding: 10px 14px; }
  .doc { padding-top: 28px; padding-bottom: 72px; }
}
