/* ============================================================
   StatGazer Home v2 — proof-led, Home-only styles
   ============================================================ */

.home-v2 .section {
  padding-block: clamp(72px, 8vw, 112px);
}

/* The open state must become focusable before main.js moves focus into it. */
.home-v2 .menu {
  transition: opacity 200ms var(--ease), visibility 0s linear 200ms;
}

.home-v2 .menu.is-open {
  transition-delay: 0s;
}

/* ---- Hero: claim + inspectable work product ---- */
.home-hero {
  padding-top: clamp(28px, 5vh, 56px);
  padding-bottom: clamp(52px, 5vw, 58px);
}

.home-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
}

.home-hero__copy,
.home-hero__proof,
.home-proof__stage,
.notebook-output,
.proof-side,
.engagement-card,
.home-faq__grid > * {
  min-width: 0;
}

.home-hero .status {
  margin-bottom: 20px;
}

.home-hero h1 {
  max-width: 16ch;
  font-size: clamp(2.45rem, 1.55rem + 2.8vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.018em;
}

.home-hero__lead {
  max-width: 55ch;
  margin-top: 24px;
  font-size: clamp(1.08rem, 1rem + 0.35vw, 1.28rem);
  line-height: 1.5;
  color: var(--muted);
}

.home-hero .hero__cta {
  margin-top: 30px;
}

.home-hero__microcopy {
  max-width: 58ch;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  line-height: 1.7;
  letter-spacing: 0.065em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.home-hero__proof {
  margin: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: 18px 22px 0 var(--accent-tint);
  overflow: hidden;
}

.artifact-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.artifact-bar__identity {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.artifact-bar__identity img {
  width: 24px;
  height: 24px;
  flex: none;
}

.artifact-bar__ref {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.575rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-memo {
  padding: clamp(22px, 3vw, 34px);
}

.artifact-disclosure {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  margin-bottom: 18px;
  padding: 6px 9px;
  border: 1px solid rgba(180, 83, 9, 0.45);
  border-radius: var(--r-chip);
  background: #FFF7ED;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  line-height: 1.35;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #92400E;
}

.artifact-disclosure::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #B45309;
  flex: none;
}

.hero-memo__kicker {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-memo__title {
  max-width: 24ch;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.1rem + 0.85vw, 1.85rem);
  line-height: 1.08;
  color: var(--ink);
}

.hero-memo__summary {
  max-width: 58ch;
  margin-top: 12px;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--muted);
}

.memo-table-wrap {
  width: 100%;
  margin-top: 22px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface);
}

.memo-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.memo-table th,
.memo-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.memo-table th:first-child,
.memo-table td:first-child {
  width: 48%;
}

.memo-table th {
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.memo-table td {
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--ink);
}

.memo-table td:not(:first-child) {
  font-family: var(--font-mono);
  font-weight: 600;
}

.memo-table .down {
  color: #B45309;
}

.memo-table tr:last-child td {
  border-bottom: 0;
}

.hero-finding {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.hero-finding__severity {
  padding: 4px 7px;
  border-radius: var(--r-chip);
  background: #B45309;
  font-family: var(--font-mono);
  font-size: 0.575rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #FFFFFF;
}

.hero-finding__copy strong {
  display: block;
  font-size: 0.875rem;
  line-height: 1.35;
}

.hero-finding__copy span {
  display: block;
  margin-top: 3px;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted);
}

.home-hero__proof figcaption {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--navy);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  line-height: 1.5;
  letter-spacing: 0.035em;
  color: var(--muted-on-dark);
}

.home-hero__proof figcaption a {
  color: var(--accent-on-dark);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.home-hero__trust {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 24px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.home-hero__trust li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  line-height: 1.45;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.home-hero__trust li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* ---- Founder trust, intentionally early and compact ---- */
.home-founder {
  padding-block: clamp(30px, 4vw, 46px);
}

.home-founder__grid {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.home-founder__portrait {
  width: 78px;
  height: 78px;
  overflow: hidden;
  border: 1px solid var(--border-dark);
  border-radius: var(--r-card);
  background: var(--accent-on-dark);
}

.home-founder__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: grayscale(100%) contrast(1.12);
}

.home-founder__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
}

.home-founder__name {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.15rem + 0.65vw, 1.75rem);
  line-height: 1.12;
  color: var(--on-dark);
}

.home-founder__role {
  margin-top: 5px;
  font-size: var(--fs-small);
  line-height: 1.45;
  color: var(--muted-on-dark);
}

.home-founder__ledger {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-dark);
}

.home-founder__ledger li {
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  line-height: 1.5;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
}

.home-founder__link {
  grid-column: 1 / -1;
  justify-self: start;
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  letter-spacing: 0.065em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ---- Proof lab ---- */
.home-proof__head {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: end;
}

.home-proof__head .heading {
  max-width: 15ch;
}

.home-proof__intro {
  max-width: 57ch;
  color: var(--muted);
  font-size: var(--fs-lead);
  line-height: 1.5;
}

.home-proof__stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  margin-top: clamp(42px, 6vw, 72px);
}

.notebook-output {
  margin: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-card);
  background: var(--surface);
  overflow: hidden;
}

.notebook-output__top,
.code-artifact__top,
.finding-register__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.065em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.notebook-output__top strong,
.code-artifact__top strong,
.finding-register__top strong {
  color: var(--ink);
}

.notebook-output__image {
  width: 100%;
  height: auto;
  background: var(--bg);
}

.notebook-output figcaption {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--muted);
}

.notebook-output figcaption strong {
  color: var(--ink);
}

.notebook-output__full {
  width: fit-content;
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.proof-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.code-artifact,
.finding-register {
  border: 1px solid var(--border-strong);
  border-radius: var(--r-card);
  background: var(--surface);
  overflow: hidden;
}

.code-artifact pre {
  max-width: 100%;
  margin: 0;
  padding: 20px;
  overflow: auto;
  background: var(--navy);
  color: #DCE8EE;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.65;
  tab-size: 2;
}

.code-artifact .code-comment {
  color: var(--accent-on-dark);
}

.code-artifact__note {
  padding: 14px 16px;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted);
}

.finding-register__body {
  padding: 20px;
}

.finding-register__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: var(--r-chip);
  background: #FFF7ED;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: #92400E;
}

.finding-register h3 {
  margin-top: 14px;
  font-size: 1.1rem;
  line-height: 1.2;
}

.finding-register p {
  margin-top: 9px;
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--muted);
}

.artifact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.artifact-links a {
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---- Engagements: one flagship path, compact secondary work ---- */
.home-engagements {
  padding-block: clamp(80px, 10vw, 132px);
}

.home-engagements__top {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: end;
}

.home-engagements__top h2 {
  max-width: 15ch;
  font-size: var(--fs-h2);
  line-height: 1.04;
}

.home-engagements__top .lead {
  max-width: 56ch;
}

.engagement-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: clamp(42px, 6vw, 72px);
}

.engagement-card {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid var(--border-dark);
  border-radius: var(--r-card);
  background: var(--navy);
}

.engagement-card--primary {
  background:
    linear-gradient(150deg, rgba(59, 169, 166, 0.11), transparent 48%),
    var(--navy);
  border-color: rgba(59, 169, 166, 0.54);
}

.engagement-card__label {
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
}

.engagement-card h3 {
  max-width: 23ch;
  margin-top: 16px;
  font-size: clamp(1.45rem, 1.2rem + 0.75vw, 2rem);
  line-height: 1.12;
}

.engagement-card__summary {
  max-width: 55ch;
  margin-top: 13px;
  color: var(--muted-on-dark);
}

.engagement-card__facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-dark);
}

.engagement-card__facts div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
}

.engagement-card__facts dt {
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
}

.engagement-card__facts dd {
  font-size: var(--fs-small);
  color: var(--on-dark);
}

.engagement-card__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  margin-top: auto;
  padding-top: 26px;
}

.engagement-card__links a:not(.btn) {
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.practice-rail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin-top: 16px;
  border: 1px solid var(--border-dark);
  border-radius: var(--r-card);
  background: var(--border-dark);
  overflow: hidden;
}

.practice-rail a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  background: var(--surface-ink);
  color: var(--on-dark);
}

.practice-rail a.practice-rail__allocator {
  grid-column: 1 / -1;
  flex-wrap: wrap;
}

.practice-rail a:focus-visible {
  outline-offset: -4px;
  box-shadow: inset 0 0 0 2px var(--accent-on-dark);
}

.practice-rail a span:first-child {
  font-size: var(--fs-small);
}

.practice-rail a span:last-child {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
}

/* ---- Process and assurance ---- */
.home-process__head {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: end;
}

.home-process__head .heading {
  max-width: 15ch;
}

.home-process__head .lead {
  max-width: 56ch;
}

.review-flow {
  display: grid;
  grid-template-columns: 1fr;
  margin: clamp(42px, 6vw, 72px) 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.review-flow__step {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.review-flow__index {
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  letter-spacing: 0.06em;
  color: var(--accent);
}

.review-flow__step h3 {
  margin-top: 11px;
  font-size: 1.2rem;
  line-height: 1.2;
}

.review-flow__step p {
  margin-top: 9px;
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--muted);
}

.review-flow__deliverable {
  display: block;
  margin-top: 13px;
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  line-height: 1.5;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.assurance-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 36px;
}

.assurance-strip article {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface);
}

.assurance-strip h3 {
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}

.assurance-strip p {
  margin-top: 9px;
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--muted);
}

/* ---- FAQ + final conversion path ---- */
.home-faq__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}

.home-faq__intro .heading {
  max-width: 14ch;
}

.home-faq__intro .lead {
  margin-top: 20px;
}

.home-faq .faq {
  margin-top: 0;
}

.home-contact {
  padding-top: 0;
}

.home-contact .contact__panel {
  padding: clamp(38px, 6vw, 76px);
  background:
    linear-gradient(135deg, rgba(14, 124, 123, 0.085), transparent 58%),
    var(--surface);
}

.home-contact__note {
  max-width: 56ch;
  margin: 22px auto 0;
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  line-height: 1.65;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ---- Responsive ---- */
@media (min-width: 640px) {
  .home-hero__trust,
  .home-founder__ledger,
  .assurance-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-founder__grid {
    grid-template-columns: 88px minmax(0, 1fr) auto;
  }

  .home-founder__portrait {
    width: 88px;
    height: 88px;
  }

  .home-founder__ledger {
    grid-column: 2 / -1;
  }

  .home-founder__link {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    justify-self: end;
  }

  .practice-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-flow__step {
    padding: 28px;
    border-right: 1px solid var(--border);
  }

  .review-flow__step:nth-child(2n) {
    border-right: 0;
  }
}

@media (min-width: 880px) {
  .home-proof__stage {
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
    align-items: start;
  }

  .engagement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .engagement-card--primary {
    grid-column: 1 / -1;
    grid-row: auto;
  }

}

@media (min-width: 920px) {
  .home-hero__grid {
    grid-template-columns: minmax(0, 0.92fr) minmax(440px, 1.08fr);
  }
}

@media (min-width: 920px) and (max-width: 1040px) {
  .hero-memo {
    padding: 24px;
  }

  .memo-table {
    min-width: 0;
  }

  .memo-table th,
  .memo-table td {
    padding: 9px 8px;
  }

  .memo-table th {
    font-size: 0.49rem;
    letter-spacing: 0.025em;
  }

  .memo-table td {
    font-size: 0.69rem;
  }
}

@media (min-width: 1080px) {
  .engagement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .engagement-card--primary {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .review-flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .review-flow__step,
  .review-flow__step:nth-child(2n) {
    border-right: 1px solid var(--border);
  }

  .review-flow__step:last-child {
    border-right: 0;
  }
}

@media (min-width: 1024px) {
  .home-faq__grid {
    grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.25fr);
    gap: clamp(40px, 5vw, 72px);
  }
}

@media (max-width: 919px) {
  .home-proof__head,
  .home-engagements__top,
  .home-process__head {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-hero__proof {
    max-width: 680px;
  }
}

@media (max-width: 700px) {
  .home-v2 .section {
    padding-block: 64px;
  }

  .home-founder__ledger {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .home-hero {
    padding-top: 36px;
    padding-bottom: 56px;
  }

  .home-hero h1 {
    font-size: clamp(2.28rem, 10.5vw, 3rem);
  }

  .home-hero .hero__cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .home-hero .hero__cta .btn {
    justify-content: center;
    width: 100%;
    min-width: 0;
    white-space: normal;
    text-align: center;
  }

  .home-hero__proof {
    box-shadow: 9px 11px 0 var(--accent-tint);
  }

  .artifact-bar {
    align-items: flex-start;
  }

  .artifact-bar__ref {
    display: none;
  }

  .memo-table {
    min-width: 0;
  }

  .memo-table th,
  .memo-table td {
    padding: 9px 4px;
  }

  .memo-table th {
    font-size: 0.55rem;
    letter-spacing: 0.02em;
  }

  .memo-table td {
    font-size: 0.72rem;
  }

  .memo-table th:first-child,
  .memo-table td:first-child {
    width: 44%;
  }

  .home-founder__grid {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .home-founder__portrait {
    width: 72px;
    height: 72px;
  }

  .engagement-card__facts div {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  .engagement-card__links .btn {
    justify-content: center;
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .practice-rail a {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-v2 .menu {
    transition: none;
  }
}
