/* LandingLeak shared styles.
   Hand written CSS. Spacing and type values follow the landing-page-design skill's
   scale (spacing 2/4/8/12/16/24/32/40/48/64/80/96 and its type steps), as plain CSS.
   Palette and overrides come from docs/brief.md (the packet wins). */

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-latin-wght.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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;
}

:root {
  --navy: #0e1a2b;
  --white: #ffffff;
  --red: #e5484d;     /* leaks: large numerals and shapes only on white (3.9:1) */
  --green: #30a46c;   /* fixes: icons and shapes only on white (3.2:1); text OK on navy */
  --amber: #ffb224;   /* one highlight per screen */
  --muted: #4a5568;   /* secondary text on white, 7.5:1 */
  --line: #d5dae1;
  --ring-gray: #6b7280;
  --surface: #f3f4f6;
  --on-navy-muted: #b8c1cc;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 8px;
  --radius-lg: 16px;
  --gutter: 16px;
  --max: 1120px;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--white);
  color: var(--navy);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 28px;
  font-weight: 400;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; text-wrap: balance; }
p, li { text-wrap: pretty; }
p { margin: 0; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* The hidden attribute always wins over component display rules. */
[hidden] { display: none !important; }

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

/* Skip link */
.skip-link {
  position: absolute;
  left: 8px;
  top: -64px;
  z-index: 10;
  padding: 12px 16px;
  background: var(--amber);
  color: var(--navy);
  font-weight: 700;
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* Focus: navy ring on light, amber ring on navy */
:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}
.on-navy :focus-visible,
.site-header :focus-visible { outline-color: var(--amber); }

/* ---------- Header (solid, flat) ---------- */
.site-header {
  background: var(--navy);
  color: var(--white);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.wordmark {
  font-size: 18px;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--white);
  white-space: nowrap;
}
.header-nav { display: flex; align-items: center; gap: 24px; }
.header-link {
  display: none; /* dropped on small phones: link and button do not fit at full size */
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  text-decoration: none;
  color: var(--white);
  padding: 12px 4px;
  border-radius: 4px;
  transition: color 300ms var(--ease);
}
.header-link:hover { color: var(--amber); text-decoration: underline; text-underline-offset: 4px; }
.header-link:active { transform: translateY(1px); }
@media (min-width: 560px) {
  .header-link { display: inline-block; }
  .wordmark { font-size: 20px; }
  .btn-header { padding: 8px 16px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 24px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-size: 18px;
  line-height: 28px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 300ms var(--ease), color 300ms var(--ease),
    border-color 300ms var(--ease), transform 200ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: #22324a; }
.btn-light { background: var(--white); color: var(--navy); }
.btn-light:hover { background: var(--surface); }
.btn-header {
  min-height: 52px;
  padding: 8px 12px;
  font-size: 16px;
  line-height: 24px;
  background: var(--white);
  color: var(--navy);
  white-space: nowrap;
}
.btn-header:hover { background: var(--amber); }
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--navy); }
.btn-block { width: 100%; }
@media (min-width: 720px) { .btn-block-mobile { width: auto; } }
.btn[disabled],
.btn[aria-disabled="true"] { cursor: not-allowed; opacity: 0.7; transform: none; }
.btn.is-loading { position: relative; overflow: hidden; }
.btn.is-loading::after {
  /* loading state: a progress bar along the bottom edge, not a spinner */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: var(--amber);
  transform-origin: left center;
  animation: loading-bar 1200ms var(--ease) infinite;
}
@keyframes loading-bar {
  0% { transform: scaleX(0.05); opacity: 1; }
  80% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* ---------- Hero ---------- */
.hero { padding: 24px 0 48px; }
.hero-grid { display: grid; gap: 32px; }
.hero h1 {
  font-size: 30px;
  line-height: 36px;
  letter-spacing: -0.02em;
  max-width: 680px;
}
.hero h1 .hl {
  text-decoration: underline;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 6px;
  text-underline-offset: 4px;
  text-decoration-skip-ink: none;
}
.hero-sub {
  margin-top: 16px;
  max-width: 680px;
  font-size: 18px;
  line-height: 28px;
  color: var(--navy);
}
.hero-cta { margin-top: 24px; }
.hero-source {
  margin-top: 8px;
  max-width: 680px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}
@media (min-width: 380px) {
  .hero h1 { font-size: 36px; line-height: 40px; }
}
@media (min-width: 720px) {
  .hero { padding: 48px 0 64px; }
  .hero h1 { font-size: 48px; line-height: 1.1; }
  .hero-sub { font-size: 20px; line-height: 28px; margin-top: 24px; }
  .hero-cta { margin-top: 32px; }
}
@media (min-width: 960px) {
  .hero { padding: 64px 0 80px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 64px; align-items: center; }
  .hero h1 { font-size: 60px; line-height: 1.05; }
}

/* ---------- Video ---------- */
.video-wrap { display: flex; justify-content: center; }
.video-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  height: min(70vh, 600px);
  max-width: 100%;
  border-radius: var(--radius-lg);
  background: var(--navy);
  color: var(--white);
  overflow: hidden;
}
@supports not (aspect-ratio: 9 / 16) {
  .video-frame { width: 300px; height: 533px; }
}
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
}
.play-glyph {
  width: 72px;
  height: 72px;
  border-radius: 9999px;
  border: 2px solid var(--white);
  display: grid;
  place-items: center;
}
.video-placeholder p {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  max-width: 200px;
}
.nowrap { white-space: nowrap; }
.video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}
.video-frame video[hidden] { display: none; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-tight { padding: 48px 0; }
.section-surface { background: var(--surface); }
.section-navy { background: var(--navy); color: var(--white); }
.section h2 {
  font-size: 30px;
  line-height: 36px;
  letter-spacing: -0.02em;
  max-width: 680px;
}
.section-lede { margin-top: 16px; max-width: 680px; }
@media (min-width: 720px) {
  .section { padding: 96px 0; }
  .section h2 { font-size: 48px; line-height: 1.1; }
}

/* ---------- Score block ---------- */
.score-grid { display: grid; gap: 32px; }
@media (min-width: 960px) {
  .score-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 64px; align-items: start; }
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
}
@media (min-width: 480px) { .card { padding: 32px 24px; } }
.hours-line {
  margin-top: 12px;
  font-size: 16px;
  line-height: 24px;
  color: var(--muted);
  text-align: center;
}

/* Leak ring (static, neutral) */
.ring-figure { margin: 0; }
.ring-figure figcaption {
  margin-top: 8px;
  font-size: 16px;
  line-height: 24px;
  color: var(--muted);
  text-align: center;
}
.ring-svg { width: 100%; max-width: 360px; margin: 0 auto; }
.ring-svg .seg {
  fill: none;
  stroke: var(--ring-gray);
  stroke-width: 18;
  stroke-linecap: butt;
}
.ring-svg text {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  fill: var(--navy);
}
.js .ring-svg.will-draw .seg { stroke-dashoffset: var(--len); }
.js .ring-svg.is-drawn .seg {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 800ms var(--ease);
}
.js .ring-svg.is-drawn .seg:nth-of-type(2) { transition-delay: 120ms; }
.js .ring-svg.is-drawn .seg:nth-of-type(3) { transition-delay: 240ms; }
.js .ring-svg.is-drawn .seg:nth-of-type(4) { transition-delay: 360ms; }

/* ---------- Forms ---------- */
.field { margin-top: 24px; }
.field:first-child { margin-top: 0; }
.label {
  display: block;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}
.input {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 18px; /* at least 16px so iOS does not zoom */
  line-height: 24px;
  transition: border-color 300ms var(--ease);
}
.input:hover { border-color: var(--ring-gray); }
.input:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(14, 26, 43, 0.25); }
.input[aria-invalid="true"] { border-color: var(--red); }
.input::placeholder { color: #8a94a3; }
.field-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 8px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: #b4232a; /* darker red for text on white, 6.3:1 */
}
.field-error:empty { display: none; }
.field-error::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 8px;
  border-radius: 9999px;
  background: var(--red);
}

/* SMS consent: visible, readable, never collapsed */
.consent { margin-top: 24px; }
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  padding: 4px 0;
}
.check input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--navy);
  cursor: pointer;
}
.consent-text {
  margin-top: 8px;
  font-size: 15px;
  line-height: 22px;
  color: var(--muted);
}
.consent-text a { color: var(--navy); font-weight: 600; text-underline-offset: 2px; }

.form-actions { margin-top: 24px; }
.form-error {
  margin-top: 16px;
  padding: 12px 16px;
  border: 2px solid var(--red);
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: #b4232a;
}
.form-error[hidden] { display: none; }

/* Honeypot */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Confirmation */
.confirm { text-align: left; }
.confirm[hidden] { display: none; }
.confirm-mark {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  background: var(--green);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
.confirm-title {
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
}
.confirm p + p { margin-top: 12px; }
.confirm .btn { margin-top: 24px; }

/* ---------- Stepped application ---------- */
.apply-card { max-width: 640px; }
.progress { margin-bottom: 24px; }
.progress-label {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: var(--muted);
}
.progress-track {
  margin-top: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--surface);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 100%;
  background: var(--navy);
  transform-origin: left center;
  transform: scaleX(0.125);
  transition: transform 500ms var(--ease);
}
.step { border: 0; margin: 0; padding: 0; min-width: 0; }
.step[hidden] { display: none; }
.step-q {
  display: block;
  padding: 0;
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  text-wrap: balance;
  margin-bottom: 24px;
}
.step-q:focus { outline: none; }
.step-q:focus-visible { outline: 3px solid var(--navy); outline-offset: 4px; }
.choices { display: grid; gap: 12px; }
.choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 300ms var(--ease), background-color 300ms var(--ease), transform 200ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.choice:hover { border-color: var(--navy); }
.choice:active { transform: scale(0.98); }
.choice[aria-pressed="true"] { border-color: var(--navy); background: var(--surface); }
.choice .tick { visibility: hidden; flex: none; }
.choice[aria-pressed="true"] .tick { visibility: visible; }
.step-nav {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.step-nav .btn-ghost { flex: 0 0 auto; }
.step-nav .btn-primary { flex: 1 1 auto; }

/* ---------- What happens next ---------- */
.steps-list {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  gap: 24px;
  max-width: 760px;
}
.steps-list li { display: flex; gap: 16px; align-items: flex-start; }
.step-num {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: var(--amber);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  line-height: 28px;
}
.steps-list p { padding-top: 6px; }

/* ---------- Four leaks ---------- */
.leak-intro { margin-top: 16px; max-width: 680px; color: var(--muted); }
.leak-why {
  margin-top: 24px;
  max-width: 680px;
  font-weight: 600;
}
.leaks { display: grid; gap: 24px; margin-top: 48px; }
@media (min-width: 720px) { .leaks { grid-template-columns: 1fr 1fr; gap: 32px; } }
.leak {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
}
@media (min-width: 480px) { .leak { padding: 32px 24px; } }
.leak-count {
  font-size: 72px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--red);
}
@media (min-width: 960px) { .leak-count { font-size: 96px; } }
.leak-count-label {
  margin-top: 8px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: var(--muted);
}
.leak-source {
  margin-top: 4px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}
.leak h3 {
  margin-top: 16px;
  font-size: 24px;
  line-height: 32px;
}
.leak p { margin-top: 12px; }
.leak .fix {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 16px;
  font-weight: 600;
}
.leak .fix svg { flex: none; margin-top: 4px; }
.leaks-cta { margin-top: 48px; }

/* ---------- Method footnote and footer ---------- */
.method {
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.method p {
  max-width: 760px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}
.site-footer {
  background: var(--navy);
  color: var(--white);
  padding: 32px 0;
  font-size: 16px;
  line-height: 24px;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}
.footer-row a {
  display: inline-block;
  padding: 12px 0;
  text-underline-offset: 4px;
  transition: color 300ms var(--ease);
}
.footer-row a:hover { color: var(--amber); }
.footer-row .sep { color: var(--on-navy-muted); }

/* ---------- Legal pages and 404 ---------- */
.legal { padding: 48px 0 64px; }
.legal .container { max-width: 760px; }
.legal h1 { font-size: 36px; line-height: 40px; letter-spacing: -0.02em; }
.legal .meta { margin-top: 12px; color: var(--muted); font-size: 16px; line-height: 24px; }
.legal h2 { margin-top: 48px; font-size: 24px; line-height: 32px; }
.legal h3 { margin-top: 24px; font-size: 20px; line-height: 28px; }
.legal p, .legal ul { margin-top: 16px; }
.legal ul { padding-left: 24px; }
.legal li + li { margin-top: 8px; }
.legal a { font-weight: 600; text-underline-offset: 2px; }
.legal .back { margin-top: 48px; }
@media (min-width: 720px) { .legal h1 { font-size: 48px; line-height: 1.1; } }

.notfound { padding: 96px 0; min-height: 60vh; }
.notfound h1 { font-size: 36px; line-height: 40px; max-width: 680px; }
.notfound p { margin-top: 16px; max-width: 680px; }
.notfound .btn { margin-top: 32px; }

/* ---------- Reveal (below the fold only, once) ---------- */
.js .reveal { opacity: 0; transform: translateY(32px); }
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

/* ---------- Reduced motion: nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .js .ring-svg.will-draw .seg { stroke-dashoffset: 0; }
  .btn:active, .choice:active { transform: none; }
}
