/* Headstart AI - site styles. Register: engineering document.
   One file, shared by / and /audit. No frameworks. */

:root {
  --ink: #f2f2f2;
  --muted: #a7adb4;
  --faint: #767d84;
  --rule: #242424;
  --bg: #000000;
  --bg-alt: #101010;
  --link: #1ed760;
  --measure: 720px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---- Nav ---- */
header.site {
  border-bottom: 1px solid var(--rule);
}
header.site .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  flex-wrap: wrap;
}
.logo {
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
header.site nav {
  margin-left: auto;
  display: flex;
  gap: 1.25rem;
}
header.site nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
}
header.site nav a:hover { color: var(--ink); text-decoration: underline; }

/* ---- Hero ---- */
.hero { padding: 4.5rem 0 3.5rem; }
h1 {
  font-size: 2.25rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 1rem;
}
.hero .sub {
  font-size: 1.1875rem;
  color: var(--muted);
  margin: 0 0 2rem;
  max-width: 38em;
}
.btn {
  display: inline-block;
  background: var(--ink);
  color: #000;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
}
.btn:hover { background: #fff; }

/* ---- Numbers strip ---- */
.numbers {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--bg-alt);
  padding: 2.25rem 0 1.75rem;
}
.numbers .grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.stat .fig {
  font-family: var(--mono);
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat .cap {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}
.numbers .src {
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 1.75rem 0 0;
}

/* ---- Sections ---- */
section.block { padding: 3.25rem 0 0; }
section.block:last-of-type { padding-bottom: 3.25rem; }
h2 {
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
}
.block p { margin: 0 0 1rem; max-width: 40em; }

/* ---- How it works ---- */
ol.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}
ol.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.25rem 2.5rem;
}
ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--mono);
}
ol.steps strong { display: block; margin-bottom: 0.15rem; }
ol.steps p { margin: 0; color: var(--muted); }

/* ---- Pricing ---- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0 1rem;
}
.price-card {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.25rem;
}
.price-card h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.price-card .amount {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.price-card .amount small {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--muted);
}
.price-card p { font-size: 0.9063rem; color: var(--muted); margin: 0; }
.footnote { font-size: 0.9063rem; color: var(--muted); }

/* ---- About ---- */
.about {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
}
.about .photo {
  flex: 0 0 132px;
  width: 132px;
  height: 132px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  /* placeholder styling until a real photo lands at /assets/max.jpg */
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 0.8125rem;
}
.about .links { margin-top: 0.75rem; font-size: 0.9375rem; }

/* ---- Contact ---- */
.contact-email {
  font-family: var(--mono);
  font-size: 1.125rem;
}
form.capture {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.5rem;
  max-width: 26rem;
  flex-wrap: wrap;
}
form.capture label {
  flex-basis: 100%;
  font-weight: 600;
  font-size: 0.9375rem;
}
form.capture input[type="email"] {
  flex: 1 1 14rem;
  font: inherit;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg-alt);
  color: var(--ink);
}
form.capture button {
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--ink);
  color: #000;
  cursor: pointer;
}
form.capture button:hover { background: #fff; }
.privacy-line { font-size: 0.8438rem; color: var(--faint); margin-top: 0.5rem; }

/* ---- Footer ---- */
footer.site {
  border-top: 1px solid var(--rule);
  margin-top: 3.5rem;
  padding: 1.5rem 0 2.5rem;
  font-size: 0.9063rem;
  color: var(--muted);
}

/* ---- Audit article ---- */
article.audit { padding: 3rem 0 1rem; }
article.audit h1 { font-size: 1.875rem; }
article.audit h2 { margin-top: 2.5rem; }
article.audit h3 { font-size: 1.125rem; margin: 2rem 0 0.75rem; }
article.audit table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.25rem 0;
  font-size: 0.9375rem;
}
article.audit th, article.audit td {
  border: 1px solid var(--rule);
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
article.audit th { background: var(--bg-alt); }
article.audit code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-alt);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
article.audit pre {
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
}
article.audit pre code { background: none; padding: 0; }
article.audit blockquote {
  margin: 1.25rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}
.audit-cta {
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  padding-top: 1.25rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
  h1 { font-size: 1.75rem; }
  .hero { padding: 3rem 0 2.5rem; }
  .numbers .grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; }
  .about { flex-direction: column; }
}

.form-status { flex-basis: 100%; font-size: 0.9063rem; color: var(--muted); margin: 0.25rem 0 0; min-height: 1.2em; }

/* ---- Chaptered audit (carousel) ---- */
.chapters h1 { margin-bottom: 2rem; }
.viewport { overflow: hidden; }
html.paged .viewport { transition: height 0.45s ease; }
html.paged .track {
  display: flex;
  align-items: flex-start;
  transition: transform 0.45s ease;
}
html.paged .chapter { flex: 0 0 100%; min-width: 100%; }
html.paged .chapter:not(.active) { visibility: hidden; }
html:not(.paged) .chapter { margin-bottom: 2.75rem; }
@media (prefers-reduced-motion: reduce) {
  html.paged .track, html.paged .viewport { transition: none; }
}

.chapter h2 { font-size: 1.25rem; margin: 0 0 1.25rem; }
.ch-num {
  font-family: var(--mono);
  color: var(--faint);
  font-weight: 600;
  margin-right: 0.35rem;
}

/* pager: [<]  o o — o o  [>] */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  border-top: 1px solid var(--rule);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
}
.pager-btn {
  font: inherit;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  transition: border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}
.pager-btn:hover:not(:disabled) { border-color: var(--ink); background: var(--bg-alt); }
.pager-btn:disabled { opacity: 0.3; cursor: default; }
.dots { display: flex; align-items: center; gap: 0.6rem; }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  border: none;
  padding: 0;
  background: var(--rule);
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}
.dot:hover { background: var(--faint); }
.dot[aria-current="true"] { width: 26px; background: var(--link); }
.pager-where {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.8125rem;
  text-align: center;
  margin-top: 0.75rem;
}
html:not(.paged) .pager, html:not(.paged) .pager-where { display: none; }

/* ---- Subpages (pricing, contact) ---- */
main.subpage section.block:first-child { padding-top: 3rem; }
main.subpage h1 { font-size: 1.875rem; margin: 0 0 1rem; }

/* ---- Viewport-fit shell: page chrome pinned, no body scroll ---- */
html, body { height: 100%; }
body { display: flex; flex-direction: column; overflow: hidden; }
main { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
footer.site { margin-top: 0; padding: 0.9rem 0 1rem; }
header.site .wrap { padding-top: 0.8rem; padding-bottom: 0.8rem; }

/* vertical rhythm scales with the display */
.hero { padding: clamp(1.5rem, 7vh, 4rem) 0 clamp(1rem, 4vh, 2.75rem); }
h1 { font-size: clamp(1.55rem, 1rem + 2.4vh, 2.25rem); }
.hero .sub { margin-bottom: clamp(1rem, 3vh, 2rem); }
.numbers { padding: clamp(1rem, 3vh, 2rem) 0 clamp(0.9rem, 2.5vh, 1.5rem); }
.stat .fig { font-size: clamp(1.6rem, 1rem + 2.2vh, 2.5rem); }
.numbers .src { margin-top: clamp(0.75rem, 2vh, 1.5rem); }
section.block { padding: clamp(1.25rem, 4vh, 3rem) 0 0; }
section.block:last-of-type { padding-bottom: clamp(1.25rem, 4vh, 3rem); }

/* home: problem + how-it-works sit side by side on wide displays */
.wrapw {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
}
.home-cols .wrap { max-width: none; padding: 0; }
@media (max-width: 1023px) {
  .wrapw { display: block; max-width: 45rem; }
}

/* audit: article fills the shell; measure adapts to fit the chapter */
main.fitshell { overflow: hidden; display: flex; flex-direction: column; }
article.audit { padding: 0; }
.chapters { flex: 1 1 auto; display: flex; min-height: 0; }
.chapters > .wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: var(--m, 46rem);
  transition: max-width 0.45s ease;
}
.chapters h1 { margin: clamp(0.75rem, 2.5vh, 1.75rem) 0 clamp(0.75rem, 2.5vh, 1.5rem); }
.chapters .viewport { flex: 1 1 auto; min-height: 0; }
html.paged .chapter { font-size: calc(1.0625rem * var(--fs, 1)); }
html.paged .track { height: 100%; }
html.paged .chapter.active { overflow-y: auto; max-height: 100%; }
.no-anim .wrap, .no-anim .track { transition: none !important; }
.pager { margin-top: clamp(0.5rem, 2vh, 1.25rem); padding-top: clamp(0.6rem, 2vh, 1.25rem); }
.pager-where { margin: 0.4rem 0 clamp(0.4rem, 1.5vh, 0.9rem); }
@media (prefers-reduced-motion: reduce) { .chapters > .wrap { transition: none; } }

/* ---- Home spec sheet ---- */
.spec {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 52rem;
  padding-top: clamp(0.5rem, 2vh, 1.5rem);
  padding-bottom: clamp(0.5rem, 2vh, 1.5rem);
}
.spec-hero { margin-bottom: clamp(1rem, 3.5vh, 2.5rem); }
.spec-hero h1 { margin-bottom: clamp(0.5rem, 1.5vh, 1rem); }
.spec-hero .sub {
  font-size: clamp(1rem, 0.8rem + 0.7vh, 1.1875rem);
  color: var(--muted);
  margin: 0;
  max-width: 40em;
}
.spec-rows { margin: 0; }
.spec-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1.5rem;
  padding: clamp(0.7rem, 2.2vh, 1.25rem) 0;
  border-top: 1px solid var(--rule);
  animation: rowin 0.5s ease backwards;
}
.spec-row:nth-child(1) { animation-delay: 0.05s; }
.spec-row:nth-child(2) { animation-delay: 0.15s; }
.spec-row:nth-child(3) { animation-delay: 0.25s; }
.spec-row:nth-child(4) { animation-delay: 0.35s; }
.spec-row:nth-child(5) { animation-delay: 0.45s; }
@keyframes rowin {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .spec-row { animation: none; } }
.spec-row dt {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  padding-top: 0.3rem;
}
.spec-row dd {
  margin: 0;
  font-size: clamp(0.9375rem, 0.85rem + 0.45vh, 1.0625rem);
  line-height: 1.55;
  color: var(--ink);
  max-width: 44em;
}
.spec-row dd a { white-space: nowrap; }
@media (max-width: 640px) {
  .spec { justify-content: flex-start; }
  .spec-row { grid-template-columns: 1fr; gap: 0.35rem; }
}

/* ---- Black scheme extras ---- */
.logo { display: flex; align-items: center; gap: 0.6rem; }
.logo img { width: 56px; height: 56px; }

/* dark, discreet scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

.price-note { font-size: 0.8438rem; color: var(--faint); margin-top: 0.75rem !important; border-top: 1px solid var(--rule); padding-top: 0.75rem; }
.convo { font-size: 1.125rem; margin-bottom: 1rem; }
