/* =========================================================================
   PLUMB - askplumb.com - marketing site
   A single-page survey document. Dark blueprint ink, one signal flare,
   measured lines that draw as you scroll. Deliberately not an AI template:
   no gradients on large surfaces, no glow, no bento. Bloomberg Terminal
   meets an Ordnance Survey explanatory note.
   Depends on tokens.css + interactions.css (linked separately in the head).
   ========================================================================= */

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

/* 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). */
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(--signal-500); color: #fff; font-weight: 500; font-size: 14px;
  padding: 9px 16px; border-radius: var(--radius-sm); text-decoration: none;
  transform: translateY(-150%); transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); outline: none; }

/* ---------- layout ------------------------------------------------------ */
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter, 96px); }
:root { --gutter: 96px; }

section { position: relative; }

/* A measured eyebrow: registration crosshair + mono index + label. */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-subtle);
  margin: 0 0 22px;
}
.eyebrow::before {
  content: ""; width: 9px; height: 9px; flex: none;
  background:
    linear-gradient(var(--signal-500), var(--signal-500)) 50% 0 / 1px 100% no-repeat,
    linear-gradient(var(--signal-500), var(--signal-500)) 0 50% / 100% 1px no-repeat;
}
.eyebrow .idx { color: var(--signal-400); }
.eyebrow .sep { color: var(--fg-faint); }

/* ---------- buttons ----------------------------------------------------- */
.btn {
  position: relative; overflow: hidden; cursor: pointer;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  border-radius: var(--radius-sm); padding: 10px 18px;
  border: 1px solid transparent; display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--signal-500); color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 1px 0 rgba(0,0,0,0.25); }
.btn-primary:hover { background: var(--signal-400); }
.btn-primary:active { background: var(--signal-600); box-shadow: none; }
.btn-secondary { background: var(--ink-750); color: var(--paper-100); border-color: var(--ink-600); }
.btn-secondary:hover { background: var(--ink-700); border-color: var(--border-strong); }
.btn-secondary:active { background: var(--ink-800); }
.btn-ghost { background: transparent; color: var(--steel-200); }
.btn-ghost:hover { background: var(--ink-750); color: var(--paper-100); }
.btn .chev { display: inline-block; transition: transform var(--dur-base) var(--ease-plumb); }
.btn:hover .chev { transform: translateX(3px); }
.btn-lg { padding: 13px 22px; font-size: 15px; }

/* ---------- nav --------------------------------------------------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 64px;
  display: flex; align-items: center;
  border-bottom: 1px solid transparent;
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              backdrop-filter var(--dur-base) var(--ease-out);
}
.nav.scrolled {
  background: color-mix(in oklab, var(--ink-900) 82%, transparent);
  backdrop-filter: blur(10px) saturate(1.1);
  border-bottom-color: var(--border-subtle);
}
.nav .wrap { display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand .word { font-family: var(--font-display); font-size: 21px; font-weight: 500;
  letter-spacing: -0.02em; color: var(--fg-bright); }
.nav .spacer { flex: 1; }
.nav .coords { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--fg-faint); display: none; }
.nav-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- hero -------------------------------------------------------- */
.hero { padding-top: 150px; padding-bottom: 96px; position: relative; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 56px; align-items: center; }
.hero-copy { max-width: 560px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(40px, 5.4vw, 64px); line-height: 1.04;
  letter-spacing: -0.025em; color: var(--fg-bright); margin: 18px 0 0;
}
.hero h1 .flare { color: var(--signal-500); }
.hero .lead { font-size: var(--text-lg); line-height: 1.55; color: var(--fg-muted);
  max-width: 500px; margin: 24px 0 0; }
.hero-cta { display: flex; align-items: center; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-note { display: flex; align-items: center; gap: 9px; margin-top: 26px;
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-subtle); letter-spacing: 0.02em; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal-500);
  animation: plumb-pulse 2.4s var(--ease-out) infinite; flex: none; }

/* The schematic frame - a survey drawing that draws itself on load. */
.schematic {
  position: relative; aspect-ratio: 6 / 5; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); background: var(--ink-850); overflow: hidden;
  box-shadow: var(--shadow-2);
  background-image:
    linear-gradient(rgba(140,158,194,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140,158,194,0.055) 1px, transparent 1px);
  background-size: 26px 26px;
}
.schematic svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* SVG groups that rotate (the plumb settle) need the user-unit origin to bind */
.schematic .plumb-group,
.steps-visual .step-datum { transform-box: view-box; }
/* With JS on, the bobs start hidden and JS fades them in once their line is
   drawn. Without JS they stay visible (the drawing is complete and static). */
html.js .plumb-bob, html.js .sd-bob { opacity: 0; }
.schematic .reg {
  position: absolute; font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.1em; color: var(--fg-faint); z-index: 2;
}
.schematic .reg.tl { top: 12px; left: 14px; } .schematic .reg.tr { top: 12px; right: 14px; }
.schematic .reg.bl { bottom: 12px; left: 14px; } .schematic .reg.br { bottom: 12px; right: 14px; }

/* corner registration crosshairs (survey framing) ------------------------ */
.frame-cross { position: absolute; width: 11px; height: 11px; pointer-events: none; z-index: 3; }
.frame-cross::before, .frame-cross::after { content: ""; position: absolute; background: var(--steel-500); }
.frame-cross::before { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-0.5px); }
.frame-cross::after { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-0.5px); }
.frame-cross.tl { top: 10px; left: 10px; } .frame-cross.tr { top: 10px; right: 10px; }
.frame-cross.bl { bottom: 10px; left: 10px; } .frame-cross.br { bottom: 10px; right: 10px; }

/* ---------- generic section heading ------------------------------------ */
.section { padding: 92px 0; }
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; letter-spacing: -0.02em;
  color: var(--fg-bright); margin: 0;
}
.section-head .sub { font-size: var(--text-lg); line-height: 1.55; color: var(--fg-muted);
  margin: 18px 0 0; max-width: 600px; }

/* A measured rule that separates sections - drawn across on scroll. */
.measure { position: relative; height: 40px; }
.measure svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- problem: three sceptical columns ---------------------------- */
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--border-subtle); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); overflow: hidden; }
.cols-3 .col { background: var(--ink-900); padding: 28px 26px 30px; }
.col .col-idx { font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint);
  letter-spacing: 0.1em; }
.col h3 { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 500;
  color: var(--fg-bright); margin: 14px 0 10px; letter-spacing: -0.01em; }
.col p { margin: 0; font-size: var(--text-base); line-height: 1.55; color: var(--fg-muted); }

/* ---------- pillars: faster / consistent / defensible ------------------ */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pillar {
  position: relative; padding: 26px 24px 28px; background: var(--ink-800);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  border-top: 2px solid var(--signal-500);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
  transition: transform var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.pillar:hover { transform: translateY(-3px); background: var(--ink-750);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 14px 30px -12px rgba(0,0,0,0.65); }
.pillar .num { font-family: var(--font-mono); font-size: 12px; color: var(--signal-400);
  letter-spacing: 0.08em; }
.pillar h3 { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 500;
  color: var(--fg-bright); margin: 12px 0 12px; letter-spacing: -0.01em; }
.pillar p { margin: 0; font-size: var(--text-base); line-height: 1.55; color: var(--fg-muted); }
.pillar p .mono { font-family: var(--font-mono); font-size: 12px; color: var(--steel-200); }

/* ---------- how it works: numbered steps with plumb datums ------------- */
.steps { display: grid; grid-template-columns: 320px 1fr; gap: 56px; align-items: start; }
.steps-visual { position: relative; aspect-ratio: 4 / 5; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); background: var(--ink-850); overflow: hidden;
  background-image:
    linear-gradient(rgba(140,158,194,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140,158,194,0.05) 1px, transparent 1px);
  background-size: 24px 24px; }
.steps-visual svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.step-list { display: flex; flex-direction: column; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 4px 20px;
  padding: 24px 0; border-top: 1px solid var(--border-subtle); }
.step:first-child { border-top: none; }
.step .s-num { font-family: var(--font-mono); font-size: 13px; color: var(--signal-400);
  letter-spacing: 0.06em; padding-top: 3px; }
.step h3 { grid-column: 2; font-family: var(--font-display); font-size: var(--text-xl);
  font-weight: 500; color: var(--fg-bright); margin: 0 0 8px; letter-spacing: -0.01em; }
.step p { grid-column: 2; margin: 0; font-size: var(--text-base); line-height: 1.55; color: var(--fg-muted); }

/* ---------- audience strip --------------------------------------------- */
.audience { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border-subtle); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); overflow: hidden; }
.aud { background: var(--ink-900); padding: 24px 22px 26px;
  transition: background var(--dur-base) var(--ease-out); }
.aud:hover { background: var(--ink-850); }
.aud .a-mono { font-family: var(--font-mono); font-size: 11px; color: var(--signal-400);
  letter-spacing: 0.08em; }
.aud h3 { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 500;
  color: var(--fg-bright); margin: 12px 0 8px; }
.aud p { margin: 0; font-size: var(--text-sm); line-height: 1.5; color: var(--fg-subtle); }

/* ---------- contact CTA band ------------------------------------------- */
.contact { padding: 96px 0 100px; position: relative; }
.contact-card {
  position: relative; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  background: var(--ink-850); padding: 64px 64px; overflow: hidden;
  background-image:
    linear-gradient(rgba(140,158,194,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140,158,194,0.045) 1px, transparent 1px);
  background-size: 28px 28px;
}
.contact-card h2 { font-family: var(--font-display); font-weight: 500;
  font-size: clamp(30px, 4vw, 46px); line-height: 1.06; letter-spacing: -0.025em;
  color: var(--fg-bright); margin: 16px 0 0; max-width: 620px; }
.contact-card p { font-size: var(--text-lg); line-height: 1.55; color: var(--fg-muted);
  max-width: 520px; margin: 20px 0 0; }
.contact-card .hero-cta { margin-top: 30px; }

/* ---------- footer ------------------------------------------------------ */
.footer { border-top: 1px solid var(--border-subtle); padding: 48px 0 56px; }
.footer .wrap { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: start; }
.footer .f-brand { display: flex; flex-direction: column; gap: 14px; }
.footer .f-legal { font-family: var(--font-mono); font-size: 11px; line-height: 1.7;
  color: var(--fg-faint); letter-spacing: 0.02em; }
.footer .f-links { display: flex; gap: 26px; }
.footer .f-links a { font-size: var(--text-sm); color: var(--fg-muted); text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out); }
.footer .f-links a:hover { color: var(--fg-bright); }

/* ---------- modal ------------------------------------------------------- */
.modal-scrim {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: color-mix(in oklab, var(--ink-950) 80%, transparent);
  backdrop-filter: blur(4px);
}
.modal-scrim.open { display: flex; }
.modal {
  position: relative; width: 100%; max-width: 460px;
  background: var(--ink-850); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3); padding: 32px 32px 30px;
  animation: plumb-drawer-in var(--dur-slow) var(--ease-settle) both;
}
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }
.modal .m-close { position: absolute; top: 16px; right: 16px; width: 30px; height: 30px;
  display: grid; place-items: center; border-radius: var(--radius-sm); cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--fg-subtle);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.modal .m-close:hover { background: var(--ink-750); color: var(--fg-bright); }
.modal .eyebrow { margin-bottom: 14px; }
.modal h3 { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 500;
  color: var(--fg-bright); margin: 0 0 8px; letter-spacing: -0.01em; }
.modal .m-sub { font-size: var(--text-sm); line-height: 1.5; color: var(--fg-muted); margin: 0 0 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-subtle); margin-bottom: 7px; }
.field label .opt { color: var(--fg-faint); text-transform: none; letter-spacing: 0; }
.field input {
  width: 100%; font-family: var(--font-body); font-size: 14px; color: var(--fg-bright);
  background: var(--ink-900); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; outline: none;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.field input::placeholder { color: var(--fg-faint); }
/* honeypot - kept in the layout flow off-screen, never shown to people */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field input:focus { border-color: var(--signal-500);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--signal-500) 22%, transparent); }
.field input:user-invalid { border-color: var(--risk-500); }
.modal .btn-primary { width: 100%; justify-content: center; margin-top: 6px; }
.modal .m-fine { font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-faint);
  letter-spacing: 0.02em; margin: 16px 0 0; line-height: 1.6; }
.modal .m-error { font-size: var(--text-sm); line-height: 1.5; color: var(--risk-500);
  background: var(--risk-bg); border: 1px solid color-mix(in oklab, var(--risk-500) 35%, transparent);
  border-radius: var(--radius-sm); padding: 10px 12px; margin: 14px 0 0; }
/* primary button radar sweep while sending */
.modal .btn-primary[data-analyzing]::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: plumb-radar var(--dur-radar) var(--ease-radar) infinite; }
.modal .m-success { text-align: left; }
.modal .m-success .ok-mark { width: 40px; height: 40px; margin-bottom: 18px; }

/* ---------- responsive -------------------------------------------------- */
@media (max-width: 1080px) { :root { --gutter: 56px; } }
@media (max-width: 920px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .schematic { max-width: 520px; }
  .steps { grid-template-columns: 1fr; gap: 36px; }
  .steps-visual { max-width: 360px; aspect-ratio: 5 / 4; }
}
@media (max-width: 760px) {
  :root { --gutter: 28px; }
  .nav-actions .btn-login-text { display: none; }
  .cols-3, .pillars, .audience { grid-template-columns: 1fr; }
  .pillars { gap: 12px; }
  .contact-card { padding: 40px 28px; }
  .footer .wrap { grid-template-columns: 1fr; }
  .hero { padding-top: 120px; }
  .section { padding: 64px 0; }
}

/* =========================================================================
   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(--ink-850) 96%, transparent);
  backdrop-filter: blur(10px) saturate(1.1);
  border-top: 1px solid var(--border);
  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-bright); font-weight: 500; }
.cc-banner .cc-copy a { color: var(--accent); text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 40%, transparent); }
.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; }
}
