/* MarshyOS site styles
   One stylesheet for every page. Sections:
   0. Fonts   1. Tokens   2. Base   3. Layout helpers   4. Header and menu
   5. Buttons and links   6. Report page visuals   7. Home
   8. Reports   9. AI builds   10. Contact   11. Footer
   12. Viewer   13. Motion and accessibility */

/* Fonts are served from this site (SIL Open Font License, see /site/fonts/LICENSE.txt). */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/site/fonts/newsreader-latin-opsz-normal.woff2") format("woff2-variations"), url("/site/fonts/newsreader-latin-opsz-normal.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: "Newsreader";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/site/fonts/newsreader-latin-ext-opsz-normal.woff2") format("woff2-variations"), url("/site/fonts/newsreader-latin-ext-opsz-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/site/fonts/hanken-grotesk-latin-400-normal.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: "Hanken Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/site/fonts/hanken-grotesk-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("/site/fonts/hanken-grotesk-latin-500-normal.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: "Hanken Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("/site/fonts/hanken-grotesk-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/site/fonts/hanken-grotesk-latin-600-normal.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: "Hanken Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/site/fonts/hanken-grotesk-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* 1. Tokens ---------------------------------------------------------- */
:root {
  --ink: #1B2A41;
  --ink-deep: #121D2E;
  --teal: #127C77;
  --paper: #F5F6F4;
  --white: #FFFFFF;
  --grey-700: #4A5363;
  --grey-500: #757D8A;
  --grey-300: #CFD4DA;
  --grey-200: #E3E6E9;
  --grey-100: #ECEEF0;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;

  --step-hero: clamp(2.5rem, 1.3rem + 3.7vw, 4.75rem);
  --step-1: clamp(2rem, 1.4rem + 2.6vw, 3.5rem);
  --step-2: clamp(1.45rem, 1.2rem + 1vw, 2rem);
  --step-3: 1.25rem;
  --step-body: 1.0625rem;
  --step-small: 0.875rem;

  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(5rem, 10vw, 9.5rem);
  --header-h: 72px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  font-optical-sizing: auto;
}

h1 { font-size: var(--step-hero); }
h2 { font-size: var(--step-1); }
h3 { font-size: var(--step-2); line-height: 1.2; }

p { margin: 0; }

ul, ol { margin: 0; padding: 0; }

a { color: inherit; }

::selection { background: var(--ink); color: var(--white); }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--white);
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.section { padding: var(--section) 0; }
.section--tight { padding: calc(var(--section) * 0.6) 0; }
.section--white { background: var(--white); }
.section--ink { background: var(--ink); color: var(--white); }

.lede {
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  line-height: 1.55;
  color: var(--grey-700);
  max-width: 34em;
}
.section--ink .lede { color: #C9D1DC; }

.measure { max-width: 36em; }

.section-head { max-width: 40rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head p { margin-top: 1.25rem; }

/* 4. Header and menu ------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(245, 246, 244, 0);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.is-scrolled {
  background: rgba(245, 246, 244, 0.94);
  box-shadow: 0 1px 0 var(--grey-200);
}
@supports (backdrop-filter: blur(8px)) {
  .site-header.is-scrolled {
    background: rgba(245, 246, 244, 0.82);
    backdrop-filter: blur(8px);
  }
}

.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
  line-height: 1;
}
.wordmark span { color: var(--teal); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-left: auto;
}
.site-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--grey-700);
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--grey-300); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

.header-cta { margin-left: 0.5rem; }

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 44px; height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  position: relative;
}
.menu-toggle span {
  position: absolute;
  left: 11px; right: 11px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s ease, opacity 0.2s ease;
}
.menu-toggle span:nth-child(1) { top: 17px; }
.menu-toggle span:nth-child(2) { top: 26px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--paper);
  padding: calc(var(--header-h) + 2rem) var(--gutter) 2rem;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.mobile-menu.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease;
}
.mobile-menu nav { display: flex; flex-direction: column; gap: 0.25rem; }
.mobile-menu nav a {
  font-family: var(--serif);
  font-size: 2.4rem;
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--grey-200);
}
.mobile-menu .btn { margin-top: auto; align-self: stretch; text-align: center; }

body.menu-open { overflow: hidden; }

/* 5. Buttons and links ----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--sans);
  font-size: 0.975rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:hover { background: var(--ink-deep); border-color: var(--ink-deep); }
.btn--small { min-height: 40px; padding: 0.5rem 1rem; font-size: 0.9rem; }
.btn--light { background: var(--white); color: var(--ink); border-color: var(--white); }
.btn--light:hover { background: var(--paper); border-color: var(--paper); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--grey-300); }
.btn--ghost:hover { background: var(--white); border-color: var(--ink); }

.text-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--grey-300);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  transition: text-decoration-color 0.2s ease;
}
.text-link:hover { text-decoration-color: var(--teal); }
.section--ink .text-link { color: var(--white); text-decoration-color: rgba(255, 255, 255, 0.35); }
.section--ink .text-link:hover { text-decoration-color: var(--white); }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
}

/* 6. Report page visuals ----------------------------------------------
   Pages are drawn in HTML so they stay sharp at any size. Sizes inside a
   page use em, so one font-size on .page scales the whole page. */
.page {
  position: relative;
  aspect-ratio: 1 / 1.414;
  background: var(--white);
  color: var(--ink);
  border-radius: 2px;
  font-size: 10px;
  padding: 2.4em 2.4em 2em;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 1px 1px rgba(27, 42, 65, 0.06),
    0 8px 18px -6px rgba(27, 42, 65, 0.14),
    0 28px 48px -24px rgba(27, 42, 65, 0.22);
  user-select: none;
}

.pg-run {
  display: flex;
  justify-content: space-between;
  font-size: 0.7em;
  color: var(--grey-500);
  padding-bottom: 0.8em;
  border-bottom: 1px solid var(--grey-200);
  margin-bottom: 1.6em;
}

.pg-title {
  font-family: var(--serif);
  font-size: 1.9em;
  line-height: 1.1;
  margin-bottom: 0.9em;
}

.pg-sub {
  font-family: var(--serif);
  font-size: 1.1em;
  margin: 1.2em 0 0.6em;
}

.ln {
  display: block;
  height: 0.55em;
  border-radius: 1px;
  background: var(--grey-100);
  margin: 0.62em 0;
}
.ln--90 { width: 90%; } .ln--80 { width: 80%; } .ln--70 { width: 70%; }
.ln--60 { width: 60%; } .ln--45 { width: 45%; }

.pg-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  font-size: 0.65em;
  color: var(--grey-500);
  padding-top: 0.8em;
}

/* Cover */
.page--cover { padding: 0; }
.cover-band {
  background: var(--ink);
  color: var(--white);
  padding: 2.4em 2.4em 2.2em;
}
.cover-band .cover-mark { font-family: var(--serif); font-size: 1.3em; }
.cover-band .cover-mark span { color: #7FC4BF; }
.cover-body { padding: 3em 2.4em 2em; display: flex; flex-direction: column; flex: 1; }
.cover-kind { font-size: 0.85em; color: var(--teal); margin-bottom: 0.9em; }
.cover-title { font-family: var(--serif); font-size: 2.9em; line-height: 1.02; letter-spacing: -0.02em; }
.cover-rule { width: 3.2em; height: 2px; background: var(--teal); margin: 1.6em 0; }
.cover-meta { font-size: 0.75em; color: var(--grey-700); display: grid; gap: 0.5em; }
.cover-meta div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--grey-100); padding-bottom: 0.4em; }
.cover-meta dt { color: var(--grey-500); }
.cover-meta dd { margin: 0; }
.page--cover .pg-foot { padding: 0 2.4em 2em; }

/* The answer */
.answer-box {
  border-left: 2px solid var(--teal);
  background: #F2F8F7;
  padding: 1em 1.2em;
  margin-bottom: 1.4em;
}
.answer-box strong { display: block; font-size: 0.8em; color: var(--teal); font-weight: 600; margin-bottom: 0.3em; }
.answer-box p { font-family: var(--serif); font-size: 1.15em; line-height: 1.3; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6em; margin-bottom: 1.2em; }
.tile { border: 1px solid var(--grey-200); padding: 0.7em; }
.tile span { display: block; font-size: 0.7em; color: var(--grey-500); }
.tile b { font-family: var(--serif); font-weight: 400; font-size: 1.05em; }

/* Risk matrix (used inside a page and on its own) */
.risk {
  display: grid;
  grid-template-columns: 1.4em 1fr;
  grid-template-rows: 1fr 1.4em;
  gap: 0.3em;
  aspect-ratio: 1 / 0.86;
}
.risk-y, .risk-x { font-size: 0.65em; color: var(--grey-500); display: flex; align-items: center; justify-content: center; }
.risk-y { writing-mode: vertical-rl; transform: rotate(180deg); }
.risk-x { grid-column: 2; }
.risk-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
}
.risk-grid i { background: var(--grey-100); }
.risk-grid i.hot { background: #DCE6EE; }
.risk-grid i.hotter { background: #C4D4E1; }
.risk-dot {
  position: absolute;
  width: 1.7em; height: 1.7em;
  margin: -0.85em 0 0 -0.85em;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font-size: 0.75em;
  display: grid;
  place-items: center;
}
.risk-dot--accent { background: var(--teal); }
.risk-key { list-style: none; font-size: 0.72em; color: var(--grey-700); margin-top: 1em; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, auto); grid-auto-flow: column; gap: 0.35em 1em; }
.risk-key b { font-weight: 600; color: var(--ink); margin-right: 0.3em; }

/* Money model */
.money { display: flex; align-items: flex-end; gap: 0.5em; height: 9em; border-bottom: 1px solid var(--grey-300); padding: 0 0.3em; }
.money i { flex: 1; background: var(--grey-200); }
.money i.base { background: var(--ink); }
.money i.up { background: var(--teal); }
.money-legend { display: flex; gap: 1.2em; font-size: 0.7em; color: var(--grey-500); margin: 0.7em 0 1.2em; }
.money-legend span::before { content: ""; display: inline-block; width: 0.8em; height: 0.8em; margin-right: 0.4em; vertical-align: -0.05em; background: var(--grey-200); }
.money-legend .l-base::before { background: var(--ink); }
.money-legend .l-up::before { background: var(--teal); }

/* Questions */
.qs { list-style: none; counter-reset: q; }
.qs li {
  counter-increment: q;
  display: grid;
  grid-template-columns: 1.8em 1fr;
  gap: 0.3em;
  font-family: var(--serif);
  font-size: 1.02em;
  line-height: 1.3;
  padding: 0.65em 0;
  border-bottom: 1px solid var(--grey-100);
}
.qs li::before { content: counter(q) "."; color: var(--teal); font-family: var(--sans); font-size: 0.85em; padding-top: 0.12em; }

/* 7. Home ------------------------------------------------------------ */
.hero {
  padding: clamp(3rem, 8vw, 7rem) 0 clamp(4rem, 9vw, 8rem);
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
}
.hero h1 { max-width: none; }
.hero-line { display: block; overflow: hidden; padding-bottom: 0.06em; }
@media (min-width: 861px) { .hero-line { white-space: nowrap; } }
.hero-line > span { display: block; }
.hero .lede { margin: 1.75rem 0 2.5rem; }

.hero-stack {
  position: relative;
  height: clamp(340px, 42vw, 540px);
}
.hero-stack .page {
  position: absolute;
  width: 72%;
  top: 50%;
  left: 50%;
  font-size: clamp(7px, 0.85vw, 11px);
}
.hero-stack .page:nth-child(1) { transform: translate(-38%, -46%) rotate(5deg); }
.hero-stack .page:nth-child(2) { transform: translate(-56%, -52%) rotate(-3deg); }
.hero-stack .page:nth-child(3) { transform: translate(-50%, -50%) rotate(0deg); }

/* Two ways we work */
.ways {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
}
.way { padding: 0 clamp(1.5rem, 4vw, 4rem) 0 0; }
.way + .way {
  padding: 0 0 0 clamp(1.5rem, 4vw, 4rem);
  border-left: 1px solid var(--grey-300);
}
.way-kind { font-size: 0.95rem; color: var(--teal); margin-bottom: 1rem; }
.way h3 { font-size: var(--step-2); max-width: 15em; }
.way p { margin: 1.25rem 0 1.5rem; color: var(--grey-700); max-width: 30em; }
.ticks { list-style: none; margin-bottom: 2rem; }
.ticks li {
  position: relative;
  padding: 0.7rem 0 0.7rem 1.6rem;
  border-top: 1px solid var(--grey-200);
}
.ticks li:last-child { border-bottom: 1px solid var(--grey-200); }
.ticks li::before {
  content: "";
  position: absolute;
  left: 0; top: 1.25rem;
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  border: 1.5px solid var(--teal);
}

.engine { margin-top: clamp(2rem, 4vw, 3rem); }
.engine-lines { width: 100%; height: 64px; }
.engine-lines path { fill: none; stroke: var(--teal); stroke-width: 1.5; }
.engine-bar {
  border-top: 2px solid var(--ink);
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}
.engine-bar strong { font-family: var(--serif); font-weight: 400; font-size: var(--step-3); }
.engine-bar p { color: var(--grey-700); max-width: 32em; }

/* Sample teaser */
.teaser-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 2.4vw, 2rem);
  margin-bottom: 3rem;
}
.teaser-grid figure { margin: 0; }
.teaser-grid .page { font-size: clamp(5.5px, 0.78vw, 10px); }
.teaser-grid figcaption { margin-top: 1rem; font-size: var(--step-small); color: var(--grey-700); }

/* Steps (a real sequence, so numbered) */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  counter-reset: step;
}
.steps--four { grid-template-columns: repeat(4, 1fr); }
.steps li { counter-increment: step; border-top: 1px solid currentColor; padding-top: 1.25rem; }
.steps li::before {
  content: counter(step);
  display: block;
  font-family: var(--serif);
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 1.25rem;
  color: var(--teal);
}
.section--ink .steps li::before { color: #7FC4BF; }
.steps h3 { font-size: var(--step-3); font-family: var(--sans); font-weight: 600; letter-spacing: 0; line-height: 1.35; margin-bottom: 0.5rem; }
.steps p { color: var(--grey-700); font-size: 0.98rem; }
.section--ink .steps p { color: #C9D1DC; }

/* Standards */
.standards {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.standard-list { list-style: none; }
.standard-list li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--grey-300);
}
.standard-list li:last-child { border-bottom: 1px solid var(--grey-300); }
.standard-list strong { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; line-height: 1.25; }
.standard-list span { color: var(--grey-700); }

/* Closing call to action */
.closing { text-align: left; }
.closing h2 { max-width: 13em; margin-bottom: 2.5rem; }

/* 8. Reports --------------------------------------------------------- */
.page-intro { padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem); }
.page-intro h1 { font-size: clamp(2.6rem, 1.8rem + 3.6vw, 4.6rem); max-width: 11em; }
.page-intro .lede { margin-top: 1.75rem; }

/* Fanned sample pages. Without JavaScript the pages sit in a simple row. */
.fan-section { background: var(--white); }
.fan-scroll { position: relative; }
.fan-stage {
  padding: clamp(3rem, 6vw, 5rem) 0;
}
.fan-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem 3rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}
.fan-head h2 { max-width: 12em; }
.fan-head p { color: var(--grey-700); max-width: 26em; margin-top: 1rem; }

.fan {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  justify-content: center;
}
.fan > li { flex: 0 1 200px; }
.fan-page {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  text-align: left;
  font: inherit;
  color: inherit;
}
.fan-page .page { font-size: clamp(5px, 0.56vw, 8px); transition: box-shadow 0.25s ease; }
.fan-page:hover .page {
  box-shadow:
    0 1px 1px rgba(27, 42, 65, 0.08),
    0 14px 26px -8px rgba(27, 42, 65, 0.22),
    0 40px 60px -30px rgba(27, 42, 65, 0.3);
}
.fan-label { display: block; margin-top: 0.9rem; font-size: var(--step-small); color: var(--grey-700); }

/* Live mode: set by main.js on wide screens when motion is allowed */
.fan-live .fan-scroll { height: 260vh; }
.fan-live .fan-stage {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 0;
}
.fan-live .fan {
  position: relative;
  display: block;
  height: min(52vh, 460px);
}
.fan-live .fan > li {
  position: absolute;
  left: 50%;
  top: 0;
  width: min(15.5vw, 230px);
  margin-left: calc(min(15.5vw, 230px) / -2);
}
.fan-live .fan-page .page { font-size: clamp(5px, 0.6vw, 8.5px); }
.fan-live .fan-label { text-align: center; }

.fan-actions { margin-top: clamp(2rem, 4vw, 3rem); display: flex; flex-wrap: wrap; gap: 1rem 1.75rem; align-items: center; }
.fan-hint { font-size: var(--step-small); color: var(--grey-500); }

/* Contents list styled like the report's own contents page */
.contents {
  list-style: none;
  counter-reset: sec;
  max-width: 46rem;
}
.contents li {
  counter-increment: sec;
  display: grid;
  grid-template-columns: 2.5rem auto 1fr;
  grid-template-areas: "num name leader" ". desc desc";
  align-items: baseline;
  column-gap: 0.75rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--grey-200);
}
.contents li::before {
  content: counter(sec);
  grid-area: num;
  font-family: var(--serif);
  color: var(--teal);
  font-size: 1.15rem;
}
.contents .name { grid-area: name; font-family: var(--serif); font-size: 1.45rem; line-height: 1.2; }
.contents .leader { grid-area: leader; border-bottom: 1px dotted var(--grey-300); transform: translateY(-0.3em); }
.contents .desc { grid-area: desc; color: var(--grey-700); margin-top: 0.35rem; max-width: 34em; }

.covers-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

/* Two levels: a two-column comparison, ruled rather than boxed */
.levels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 2px solid var(--ink);
}
.level { padding: 2rem clamp(1.5rem, 4vw, 3.5rem) 2rem 0; }
.level + .level { padding-left: clamp(1.5rem, 4vw, 3.5rem); padding-right: 0; border-left: 1px solid var(--grey-300); }
.level h3 { margin-bottom: 0.75rem; }
.level .price { font-family: var(--serif); font-size: 1.6rem; margin: 1.25rem 0 0.25rem; }
.level .price-note { font-size: var(--step-small); color: var(--grey-500); }
.level p { color: var(--grey-700); max-width: 28em; }
.level dl { margin: 1.5rem 0 0; display: grid; gap: 0; }
.level dl div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: 0.7rem 0; border-top: 1px solid var(--grey-200); font-size: 0.97rem; }
.level dt { color: var(--grey-500); }
.level dd { margin: 0; }

.small-print { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem 3rem; font-size: 0.95rem; color: var(--grey-700); }
.small-print li { border-top: 1px solid var(--grey-300); padding-top: 1rem; }

/* 9. AI builds ------------------------------------------------------- */
.builds { display: grid; gap: 0; }
.build {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-top: 1px solid var(--grey-300);
}
.build:last-child { border-bottom: 1px solid var(--grey-300); }
.build h3 { margin-bottom: 1rem; }
.build p { color: var(--grey-700); max-width: 30em; }
.build .saves { margin-top: 1.25rem; color: var(--ink); padding-left: 1rem; border-left: 2px solid var(--teal); }

.flow { width: 100%; max-width: 340px; justify-self: end; }
.flow .node rect { fill: var(--white); stroke: var(--grey-300); stroke-width: 1; }
.flow .node--in rect { fill: var(--paper); }
.flow .node--out rect { fill: var(--ink); stroke: var(--ink); }
.flow .node text { font-family: var(--sans); font-size: 12.5px; fill: var(--ink); }
.flow .node--out text { fill: var(--white); font-weight: 500; }
.flow .wire { fill: none; stroke: var(--teal); stroke-width: 1.5; }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--ink); }
.tier { padding: 2rem clamp(1.25rem, 3vw, 2.5rem); }
.tier:first-child { padding-left: 0; }
.tier:last-child { padding-right: 0; }
.tier + .tier { border-left: 1px solid var(--grey-300); }
.tier h3 { font-size: 1.6rem; margin-bottom: 0.75rem; }
.tier .price { font-family: var(--serif); font-size: 1.35rem; margin-bottom: 1rem; }
.tier p { color: var(--grey-700); font-size: 0.98rem; }

/* Under the hood: three building blocks, ruled like the tiers */
.hood {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 2px solid var(--ink);
  margin-bottom: clamp(1rem, 3vw, 2rem);
}
.hood li { display: flex; flex-direction: column; padding: 2rem clamp(1.25rem, 3vw, 2.5rem); }
.hood li:first-child { padding-left: 0; }
.hood li:last-child { padding-right: 0; }
.hood li + li { border-left: 1px solid var(--grey-300); }
.hood h3 { font-size: 1.6rem; margin-bottom: 0.9rem; }
.hood p { color: var(--grey-700); }
.hood .tech { margin-bottom: 1.25rem; }
.hood .means { margin-top: auto; color: var(--ink); }
.hood .tech, .tier .tech { font-size: 0.85rem; color: var(--grey-500); }

.tech { font-size: 0.85rem; color: var(--grey-500); margin-top: 0.75rem; }
.means { padding-left: 1rem; border-left: 2px solid var(--teal); color: var(--ink); }

.build--feature h3 { margin-bottom: 1rem; }
.data-note { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--grey-300); color: var(--ink); }
.data-note strong { font-weight: 600; }

.flow .node--lib rect { fill: #F2F8F7; stroke: var(--teal); }
.flow .tag rect { fill: none; stroke: #7FC4BF; stroke-width: 1; }
.flow .tag text { font-family: var(--sans); font-size: 10.5px; fill: #DDEFEE; }
.flow .wire--trace { stroke-dasharray: 3 4; }

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

/* 10. Contact -------------------------------------------------------- */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: start;
}
.contact-aside p { color: var(--grey-700); margin-top: 1.25rem; }
.contact-aside dl { margin: 2.5rem 0 0; }
.contact-aside dl div { padding: 1rem 0; border-top: 1px solid var(--grey-300); }
.contact-aside dl div:last-child { border-bottom: 1px solid var(--grey-300); }
.contact-aside dt { font-size: var(--step-small); color: var(--grey-500); margin-bottom: 0.2rem; }
.contact-aside dd { margin: 0; font-size: 1.1rem; }

.form { background: var(--white); padding: clamp(1.5rem, 4vw, 3rem); border-radius: 4px; }
.field { display: grid; gap: 0.45rem; margin-bottom: 1.4rem; }
.field label, .field legend { font-size: 0.92rem; font-weight: 500; }
.field input, .field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--grey-300);
  border-radius: 4px;
  padding: 0.8rem 0.9rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--teal); background: var(--white); box-shadow: 0 0 0 3px rgba(18, 124, 119, 0.15); }
.field textarea { min-height: 9rem; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }

fieldset.field { border: 0; padding: 0; margin: 0 0 1.75rem; }
.choices { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.45rem; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: inline-block;
  padding: 0.6rem 1rem;
  border: 1px solid var(--grey-300);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.choice input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--white); }
.choice input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }

.form-note { margin-top: 1rem; font-size: var(--step-small); color: var(--grey-500); }
.form-status { margin-top: 1rem; font-size: 0.95rem; color: var(--teal); min-height: 1.5em; }

/* 11. Footer --------------------------------------------------------- */
.site-footer {
  background: var(--ink);
  color: #C9D1DC;
  padding: clamp(3.5rem, 7vw, 5.5rem) 0 2.5rem;
  font-size: 0.95rem;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem 4rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.site-footer .wordmark { color: var(--white); font-size: 1.8rem; }
.site-footer .wordmark span { color: #7FC4BF; }
.footer-line { margin-top: 1rem; max-width: 22em; }
.footer-links { list-style: none; display: grid; grid-template-columns: repeat(2, auto); gap: 0.7rem 3.5rem; }
.footer-links a { text-decoration: none; color: var(--white); }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 0.3em; }
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1.75rem;
  font-size: 0.85rem;
  color: #93A0B2;
}
.footer-legal nav { display: flex; gap: 1.5rem; }
.footer-legal a { color: #93A0B2; text-underline-offset: 0.3em; }
.footer-legal a:hover { color: var(--white); }

/* Legal pages (rendered by Next.js from lib/legal/) */
.legal { max-width: 48rem; padding-top: clamp(3rem, 7vw, 5.5rem); padding-bottom: clamp(4rem, 8vw, 7rem); }
.legal h1 { font-size: clamp(2.4rem, 1.8rem + 2.6vw, 3.6rem); margin: 0.75rem 0 2rem; }
.legal h2 { font-size: 1.6rem; margin: 2.5rem 0 0.9rem; }
.legal p, .legal li { color: var(--grey-700); max-width: 40em; }
.legal p + p { margin-top: 1rem; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal ul { padding-left: 1.3rem; display: grid; gap: 0.6rem; margin: 1rem 0; }
.legal-updated { font-size: var(--step-small); color: var(--grey-500) !important; }

/* 12. Page viewer (dialog) ------------------------------------------- */
.viewer {
  width: min(92vw, 640px, calc(78vh / 1.414));
  max-height: 94vh;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  overflow: visible;
}
.viewer::backdrop { background: rgba(18, 29, 46, 0.86); }
.viewer-inner { display: flex; flex-direction: column; gap: 1rem; }
.viewer-page { container-type: inline-size; }
.viewer-page .page { font-size: clamp(7px, 1.65vw, 14.5px); font-size: 3.7cqw; width: 100%; }
.viewer-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; }
.viewer-caption { font-family: var(--serif); font-size: 1.3rem; }
.viewer-count { font-size: var(--step-small); color: #AFBACA; }
.viewer-controls { display: flex; gap: 0.5rem; }
.viewer-controls button {
  min-width: 44px; min-height: 44px;
  padding: 0 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}
.viewer-controls button:hover { background: rgba(255, 255, 255, 0.1); }

/* Smooth scrolling (Lenis) and anchor offsets */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
section[id] { scroll-margin-top: var(--header-h); }
body.menu-open .site-header { background: var(--paper); box-shadow: none; backdrop-filter: none; }

/* 13. Responsive ----------------------------------------------------- */
@media (max-width: 1024px) {
  .steps--four { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) and (min-width: 861px) {
  .tiers--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiers--four .tier:nth-child(2) { padding-right: 0; }
  .tiers--four .tier:nth-child(3) { border-left: 0; padding-left: 0; }
  .tiers--four .tier:nth-child(n + 3) { border-top: 1px solid var(--grey-300); }
  .small-print { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .site-nav, .header-cta { display: none; }
  .menu-toggle { display: block; }

  .hero .wrap { grid-template-columns: 1fr; }
  .hero-stack { height: clamp(300px, 80vw, 460px); max-width: 460px; width: 100%; margin: 0 auto; }
  .hero-stack .page { font-size: clamp(6px, 1.9vw, 9.5px); width: 64%; }

  .ways { grid-template-columns: 1fr; }
  .way, .way + .way { padding: 0; border-left: 0; }
  .way + .way { margin-top: 3.5rem; padding-top: 3.5rem; border-top: 1px solid var(--grey-300); }
  .engine-lines { display: none; }
  .engine { margin-top: 3.5rem; }

  .teaser-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  .teaser-grid .page { font-size: clamp(5px, 1.55vw, 9px); }

  .steps { grid-template-columns: 1fr; gap: 2.25rem; }
  .steps--four { grid-template-columns: 1fr; }

  .standards, .covers-layout, .contact-layout { grid-template-columns: 1fr; }

  .fan { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0.5rem var(--gutter) 2.5rem; margin: 0 calc(var(--gutter) * -1); -webkit-overflow-scrolling: touch; }
  .fan > li { flex: 0 0 62%; scroll-snap-align: center; }
  .fan-page .page { font-size: clamp(6px, 1.9vw, 9px); }

  .levels { grid-template-columns: 1fr; }
  .level, .level + .level { padding: 2rem 0; border-left: 0; }
  .level + .level { border-top: 1px solid var(--grey-300); }

  .build { grid-template-columns: 1fr; }
  .flow { justify-self: start; }

  .tiers { grid-template-columns: 1fr; }
  .hood { grid-template-columns: 1fr; }
  .hood li, .hood li:first-child, .hood li:last-child { padding: 2rem 0; }
  .hood li + li { border-left: 0; border-top: 1px solid var(--grey-300); }
  .tier, .tier:first-child, .tier:last-child { padding: 2rem 0; }
  .tier + .tier { border-left: 0; border-top: 1px solid var(--grey-300); }

  .small-print { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  :root { --header-h: 64px; }
  .field-row { grid-template-columns: 1fr; }
  .contents li { grid-template-columns: 2rem 1fr; grid-template-areas: "num name" ". desc"; }
  .contents .leader { display: none; }
  .contents .name { font-size: 1.3rem; }
  .footer-links { grid-template-columns: 1fr 1fr; gap: 0.7rem 2rem; }
  .actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
