/* =========================================================================
   PLUMB - askplumb.com - marketing site (design system v2)
   THE REPORT IS A MEASURED DRAWING: bone paper, graphite ink, one clay
   signal, drafting furniture. The hero is the evidence cloud - one point
   per evidence record - settling into the plumb bob on an ink plate.
   Deliberately not an AI template: no gradients, no glow, no bento.
   Depends on interactions.css + tokens.css + chrome.css (linked separately
   in the head; buttons/plates/stations come from chrome.css).
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; }
img, svg, canvas { max-width: 100%; }
button { font: inherit; }
h1, h2, h3, p { margin: 0; }

/* JS-only entrance state. Set by an inline script so no-JS / reduced-motion
   readers always see content (entrances are an enhancement, never a gate).
   Translate-only, so content is never hidden if an animation is skipped. */
html.js [data-reveal] { opacity: 0; transform: translateY(14px); }
html.js [data-reveal].in {
  opacity: 1; transform: none;
  transition: opacity 480ms var(--ease-out), transform 480ms var(--ease-out);
}
@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] { opacity: 1; transform: none; }
}

/* skip link - visible only when focused by keyboard */
.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  background: var(--graphite-900); color: var(--fg-on-ink);
  font: 500 var(--text-sm) var(--font-body);
  padding: 10px 14px; border-radius: var(--radius-control);
  transform: translateY(-64px); transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus { transform: none; }

/* layout */
.wrap {
  max-width: 1200px; margin: 0 auto;
  padding-left: var(--gutter, 96px); padding-right: var(--gutter, 96px);
}
:root { --gutter: 96px; }
@media (max-width: 1080px) { :root { --gutter: 40px; } }
@media (max-width: 640px)  { :root { --gutter: 20px; } }

/* display headlines end on the clay full stop */
.fstop { color: var(--clay-500); }

/* Legacy eyebrow markup on sub-pages (<span class="idx">C</span><span
   class="sep">/</span> Legal) - the v2 mono annotation, index in clay. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  line-height: 1;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--fg-muted);
}
.eyebrow .idx { color: var(--clay-600); }
.eyebrow .sep { color: var(--fg-subtle); padding: 0 2px; }

h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 3.8vw, 52px);
  line-height: 1.06;
  letter-spacing: var(--track-display);
  font-weight: 600;
  color: var(--fg);
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.6vw, var(--text-3xl));
  line-height: var(--leading-snug);
  letter-spacing: var(--track-tight);
  font-weight: 600;
  color: var(--fg);
}
h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: var(--track-tight);
  color: var(--fg);
}

/* =========================================================================
   NAV - a sheet header. Over the ink hero it draws in the on-ink palette
   (no backdrop filter - nothing may cost frames over the canvas); once
   scrolled onto the paper it rules in solid.
   ========================================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              opacity 700ms var(--ease-out);
}
.nav .wrap {
  display: flex; align-items: center; gap: 18px;
  height: 62px;
}
.nav.scrolled, .nav.nav-solid {
  background: color-mix(in oklab, var(--paper-0) 92%, transparent);
  backdrop-filter: blur(10px) saturate(1.05);
  border-bottom-color: var(--line);
}
/* over the ink (index page, not yet scrolled) */
.nav:not(.scrolled):not(.nav-solid) .word { color: var(--fg-on-ink); }
.nav:not(.scrolled):not(.nav-solid) .coords { color: var(--fg-on-ink-muted); }
.nav:not(.scrolled):not(.nav-solid) .nav-link { color: var(--fg-on-ink-muted); }
.nav:not(.scrolled):not(.nav-solid) .nav-link:hover { color: var(--fg-on-ink); }
.nav:not(.scrolled):not(.nav-solid) .btn--ink {
  background: transparent; color: var(--fg-on-ink);
  border: 1px solid var(--fg-on-ink-faint);
}
.nav:not(.scrolled):not(.nav-solid) .btn--ink:hover { border-color: var(--fg-on-ink); }
.nav .brand, .footer .brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--fg);
}
.nav .word, .footer .word {
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
  letter-spacing: var(--track-tight); color: var(--fg);
}
.nav .spacer { flex: 1; }
.nav .coords {
  font: 400 var(--text-2xs) var(--font-mono);
  letter-spacing: var(--track-stamp);
  color: var(--fg-subtle);
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-actions .btn { text-decoration: none; }
.nav-link { border-color: transparent; }
@media (max-width: 640px) {
  .nav .coords { display: none; }
  .nav-link[href="guides/"] { display: none; }
}
@media (max-width: 420px) {
  /* keep both CTAs on one line at phone widths */
  .nav .wrap { gap: 10px; }
  .nav-link[data-login] { display: none; }
  .nav-actions .btn { white-space: nowrap; }
}

/* =========================================================================
   HERO - the full-screen ink plate. The whole first view is black; the
   evidence cloud lands on it, the chrome reveals, and scrolling scrubs
   the cloud through its formations (bob -> layers -> site -> wordmark)
   while the sheet stays pinned. The paper hand-off sits pages down.
   Nothing over the canvas may cost frames: no blur, no filters, and the
   copy layer ignores the pointer so the cloud's gather stays live.
   ========================================================================= */
.hero {
  position: relative;
  /* the scroll track: ~one viewport per formation + a hold on the wordmark */
  height: 440vh;
  height: 440svh;
  background: var(--bg-ink);
}
.hero-sticky {
  position: sticky; top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex; align-items: center;
}
@media (max-width: 980px) {
  /* the bob hangs from the top of the sheet; the copy anchors to its foot */
  .hero-sticky { align-items: flex-end; }
  .hero-wrap { padding-bottom: 72px; }
}
@media (max-width: 640px) {
  /* the claim carries the message on phones; the lead crushes the sheet */
  .hero-copy .lead { display: none; }
  .hero-copy h1 { margin-bottom: 14px; }
}
.hero canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  max-width: none;
}
.hero .reg {
  position: absolute; z-index: 2;
  font: 400 var(--text-3xs) var(--font-mono);
  letter-spacing: var(--track-stamp);
  color: var(--fg-on-ink-faint);
}
.hero .reg.tl { top: 74px; left: 18px; }
.hero .reg.tr { top: 74px; right: 18px; }
.hero .reg.bl { bottom: 18px; left: 18px; }
.hero .reg.br { bottom: 18px; right: 18px; }

.hero-wrap { position: relative; z-index: 2; width: 100%; pointer-events: none; }
.hero-copy { max-width: 560px; }
.hero-cta .btn { pointer-events: auto; }

/* Fully black load: nav + hero chrome hold back until the cloud has
   landed (site.js adds .cloud-landed to <body>; a hard fallback timer and
   the no-js/reduced-motion paths reveal immediately). :has() scopes the
   nav hiding to the page that actually has the hero. */
html.js body:has(.hero):not(.cloud-landed) .nav,
html.js body:not(.cloud-landed) .hero-ui {
  opacity: 0;
}
.hero-ui {
  transition: opacity 700ms var(--ease-out);
}
@media (prefers-reduced-motion: reduce) {
  html.js body:has(.hero):not(.cloud-landed) .nav,
  html.js body:not(.cloud-landed) .hero-ui { opacity: 1; }
}

.scroll-cue {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 2; margin: 0;
  font: 500 var(--text-3xs) var(--font-mono);
  letter-spacing: var(--track-eyebrow);
  color: var(--fg-on-ink-muted);
  transition: opacity 400ms var(--ease-out);
}

/* Formation annotations - the surveyor labels each constraint plane, then
   the combined plan. Positioned by js (placeLabels); shown only while
   their formation dwells. The leading rule reads as a dimension leader. */
.stage-labels span {
  position: absolute; z-index: 2;
  transform: translateY(-50%);
  white-space: nowrap;
  font: 500 var(--text-3xs) var(--font-mono);
  letter-spacing: var(--track-eyebrow);
  color: var(--fg-on-ink-muted);
  opacity: 0;
  transition: opacity 420ms var(--ease-out);
}
.stage-labels span::before {
  content: "";
  display: inline-block;
  width: 16px; height: 1px;
  background: var(--fg-on-ink-faint);
  margin-right: 9px;
  vertical-align: middle;
}
/* narrow screens: the overview label sits centred below the plan, so the
   leader becomes a vertical tick pointing up at it - and the label may wrap */
.stage-labels span.below {
  transform: translateX(-50%);
  text-align: center;
  white-space: normal;
  max-width: calc(100vw - 48px);
}
.stage-labels span.below::before {
  display: block;
  width: 1px; height: 16px;
  margin: 0 auto 8px;
}

.hero-eyebrow { margin-bottom: 20px; color: var(--fg-on-ink-muted); }
.hero-copy h1 { margin-bottom: 22px; color: var(--fg-on-ink); }
.hero-claim {
  font: 500 var(--text-md) var(--font-body);
  color: var(--fg-on-ink);
  margin-bottom: 10px;
}
.hero-copy .lead {
  font: 400 var(--text-lg) var(--font-body);
  line-height: var(--leading-body);
  color: var(--fg-on-ink-muted);
  max-width: 46ch;
  margin-bottom: 28px;
}
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-cta .btn { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.chev { display: inline-block; }

.stage-cap {
  position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%);
  z-index: 2; margin: 0; text-align: center; white-space: nowrap;
  font: 400 var(--text-3xs) var(--font-mono);
  letter-spacing: var(--track-eyebrow);
  color: var(--fg-on-ink-faint);
}
@media (max-width: 640px) { .stage-cap { display: none; } }

/* The sheet hands off to ivory only at the very end of the scroll track -
   pages below the opening view - and cuts sharper than a long wash. */
.hero-fade {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  height: 110px;
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--paper-0) 0%, transparent) 0%,
    color-mix(in oklab, var(--paper-0) 78%, transparent) 55%,
    var(--paper-0) 100%);
  pointer-events: none;
}

/* the title-block strip on the paper, just under the ink */
.hero-tblock { margin: 28px 0 0; }
@media (max-width: 900px) { .tblock .tb-opt { display: none; } }

/* =========================================================================
   SECTIONS
   ========================================================================= */
.section { padding: 84px 0 0; }
.section .wrap { border-top: 1px solid var(--line); padding-top: 40px; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head .t-eyebrow { margin-bottom: 16px; }
.section-head h2 { margin-bottom: 14px; }
.section-head .sub {
  font: 400 var(--text-lg) var(--font-body);
  line-height: var(--leading-body);
  color: var(--fg-body);
}

/* problem - three annotated columns */
.cols-3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px;
}
@media (max-width: 900px) { .cols-3 { grid-template-columns: 1fr; gap: 28px; } }
.col .col-idx {
  display: block;
  font: 400 var(--text-2xs) var(--font-mono);
  letter-spacing: var(--track-stamp);
  color: var(--fg-subtle);
  border-top: 1px solid var(--line-strong);
  padding-top: 12px; margin-bottom: 14px;
}
.col h3 { margin-bottom: 10px; }
.col p { font-size: var(--text-md); color: var(--fg-body); }

/* pillars - three registered plates with ghost numerals */
.pillars {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
@media (max-width: 900px) { .pillars { grid-template-columns: 1fr; } }
.pillar { padding: 26px 26px 30px; }
.pillar .num {
  display: block;
  font: 700 44px/1 var(--font-display);
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1.1px var(--graphite-300);
  margin-bottom: 18px;
}
.pillar h3 { margin-bottom: 10px; }
.pillar p { font-size: var(--text-md); color: var(--fg-body); }
.mono-inline { font-family: var(--font-mono); font-size: 0.92em; }
.pillars-dim { margin-top: 20px; }

/* how it works - stations on the datum (chrome.css .stations/.stn/.mod) */
.how-stations { max-width: 720px; }
.how-stations .mod h3 { margin-bottom: 8px; }
.how-stations .mod p { font-size: var(--text-md); color: var(--fg-body); max-width: 58ch; }
.how-stations .mod { margin-bottom: 44px; }
@media (max-width: 720px) {
  /* the station margin machinery needs width; fold the numerals inline */
  .stations { padding-left: 0; }
  .stations .datum, .stations .datum-bob, .stn::before { display: none; }
  .stn .stn-n {
    position: static; width: auto; text-align: left;
    font-size: 22px; -webkit-text-stroke-width: 1px;
  }
  .stn { gap: 10px; }
}

/* audience - four ruled cells with mono tags */
.audience {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
}
@media (max-width: 980px) { .audience { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .audience { grid-template-columns: 1fr; } }
.aud .a-mono {
  display: block;
  font: 700 var(--text-3xs) var(--font-mono);
  letter-spacing: var(--track-eyebrow);
  color: var(--fg-muted);
  border-top: 1px solid var(--line-strong);
  padding-top: 12px; margin-bottom: 12px;
}
.aud h3 { font-size: var(--text-md); margin-bottom: 8px; }
.aud p { font-size: var(--text-sm); color: var(--fg-muted); }

/* faq */
.faq { max-width: 760px; }
.faq-item {
  border-top: 1px solid var(--line);
  padding: 22px 0;
  display: grid; grid-template-columns: 64px 1fr; gap: 4px 18px;
}
.faq-item .q-num {
  font: 400 var(--text-2xs) var(--font-mono);
  letter-spacing: var(--track-stamp);
  color: var(--fg-subtle);
  padding-top: 3px;
}
.faq-item h3 { grid-column: 2; font-size: var(--text-md); margin-bottom: 8px; }
.faq-item p { grid-column: 2; font-size: var(--text-base); color: var(--fg-body); }
@media (max-width: 560px) {
  .faq-item { grid-template-columns: 1fr; }
  .faq-item h3, .faq-item p { grid-column: 1; }
}
.faq-more {
  margin-top: 28px;
  font-size: var(--text-sm);
  color: var(--fg-muted);
  max-width: 760px;
  line-height: var(--leading-loose);
}

/* =========================================================================
   CONTACT - the ink plate (brand moment #2 of 2)
   ========================================================================= */
.contact { padding: 96px 0 0; }
.contact-card {
  padding: 48px 48px 52px;
  max-width: 820px; margin: 0 auto;
}
.contact-card .t-eyebrow.on-ink { color: var(--fg-on-ink-muted); margin-bottom: 18px; }
.contact-card h2 { color: var(--fg-on-ink); margin-bottom: 14px; }
.contact-card p { color: var(--fg-on-ink-muted); max-width: 52ch; margin-bottom: 26px; }
.contact-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.contact-cta .btn { text-decoration: none; }
@media (max-width: 640px) { .contact-card { padding: 32px 24px 36px; } }

/* =========================================================================
   FOOTER
   ========================================================================= */
.footer { margin-top: 96px; border-top: 2px solid var(--graphite-900); }
.footer .wrap {
  display: flex; gap: 32px; align-items: flex-start; justify-content: space-between;
  padding-top: 32px; padding-bottom: 44px; flex-wrap: wrap;
}
.f-legal {
  margin-top: 14px;
  font: 400 var(--text-2xs) var(--font-mono);
  letter-spacing: 0.04em;
  line-height: 1.8;
  color: var(--fg-muted);
}
.f-links { display: flex; gap: 20px; flex-wrap: wrap; padding-top: 6px; }
.f-links a {
  font: 400 var(--text-sm) var(--font-body);
  color: var(--fg-muted); text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.f-links a:hover { color: var(--fg); }

/* =========================================================================
   CONTACT MODAL - a plate mounted over the graphite scrim
   ========================================================================= */
.modal-scrim {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: var(--bg-scrim);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out);
}
.modal-scrim.open { opacity: 1; pointer-events: auto; }
.modal {
  position: relative;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-3);
  transform: translateY(14px);
  transition: transform var(--dur-slow) var(--ease-settle);
}
.modal-scrim.open .modal { transform: none; }
/* The plate is decorated: a 1px border plus corner brackets that sit 1px
   outside the box (.plate::before/::after). It must NOT be the scroll
   viewport - those corners overflow it by 1px and render a phantom scrollbar
   at every screen size. Scroll the inner content instead; its own padding
   keeps input focus-rings clear of the clip edge, and the plate is free to
   draw its corners without clipping. */
#modalBody {
  padding: 30px 30px 26px;
  max-height: calc(100vh - 42px);  /* viewport - scrim padding (40) - plate border (2) */
  overflow-y: auto;
}
@media (prefers-reduced-motion: reduce) {
  .modal-scrim, .modal { transition: none; }
}
.modal .t-eyebrow { margin-bottom: 14px; }
.modal h3 { font-size: var(--text-xl); margin-bottom: 8px; }
.m-sub { font-size: var(--text-sm); color: var(--fg-muted); margin-bottom: 16px; }
.m-close {
  position: absolute; top: 14px; right: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-control);
  background: transparent; color: var(--fg-muted); cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.m-close:hover { color: var(--fg); border-color: var(--graphite-500); }
.field { margin-bottom: 12px; }
.field label {
  display: block; margin-bottom: 6px;
  font: 500 var(--text-xs) var(--font-body);
  color: var(--fg-body);
}
.field .opt { color: var(--fg-subtle); font-weight: 400; }
.field .fld { width: 100%; }
.hp { position: absolute; left: -9999px; top: -9999px; height: 1px; width: 1px; overflow: hidden; }
/* Invisible Turnstile host: no visible widget, but pin it to a zero box so a
   stray challenge iframe can never add whitespace. Not display:none - that can
   break Turnstile's execution. */
#cf-host { position: fixed; width: 0; height: 0; overflow: hidden; }
.m-fine {
  margin-top: 12px;
  font: 400 var(--text-3xs) var(--font-mono);
  letter-spacing: 0.06em; line-height: 1.8;
  color: var(--fg-muted);
}
.m-error { font-size: var(--text-sm); color: var(--sev-high); margin: 12px 0 0; }
.m-success { text-align: center; padding: 12px 4px 4px; }
.m-success .t-eyebrow { margin: 16px 0 10px; }
.m-success h3 { margin-bottom: 8px; }
.m-success .m-sub { margin-bottom: 20px; }
.m-success .stamp { margin-bottom: 18px; }
/* Narrow phones: trim the scrim gap and plate padding so the fixed 300px
   Turnstile widget fits the content width without a horizontal scrollbar. */
@media (max-width: 420px) {
  .modal-scrim { padding: 12px; }
  #modalBody {
    padding: 24px 16px 20px;
    max-height: calc(100vh - 26px);  /* viewport - scrim padding (24) - plate border (2) */
  }
}

/* =========================================================================
   COOKIE CONSENT - banner injected by js/consent.js on every page
   ========================================================================= */
.cc-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; gap: 22px; align-items: center; justify-content: center;
  padding: 16px var(--gutter, 96px); flex-wrap: wrap;
  background: color-mix(in oklab, var(--paper-0) 96%, transparent);
  backdrop-filter: blur(10px) saturate(1.05);
  border-top: 1px solid var(--line-strong);
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease-settle);
}
.cc-banner.in { transform: translateY(0); }
.cc-banner .cc-copy { font-size: var(--text-sm); line-height: 1.5; color: var(--fg-muted);
  max-width: 640px; flex: 1 1 360px; }
.cc-banner .cc-copy strong { color: var(--fg); font-weight: 500; }
.cc-banner .cc-copy a { color: var(--clay-600); text-decoration: none;
  border-bottom: 1px solid var(--clay-300); }
.cc-banner .cc-actions { display: flex; gap: 8px; flex: none; }
@media (prefers-reduced-motion: reduce) {
  .cc-banner { transition: none; }
}
@media (max-width: 760px) {
  .cc-banner { padding: 16px 20px; }
  .cc-banner .cc-actions { width: 100%; }
  .cc-banner .cc-actions .btn { flex: 1; justify-content: center; text-align: center; }
}
