/*
 * USA HOMEOWNER GUIDE — Design System
 * Aesthetic: Civic Editorial Americana
 * Performance: <1.5s LCP on 4G target
 *
 * Fonts: Public Sans (US Web Design System typeface) + Source Serif 4
 * Loaded via Google Fonts with system fallback for first paint.
 *
 * Color philosophy: deep navy + flag-red on warm cream. Cream is the
 * single most differentiating choice — printed/heritage feel, not generic SaaS.
 */

/* ===================================================================
   FONT LOADING — self-hosted variable woff2 (no Google Fonts hop)
   =================================================================== */

@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/public-sans-variable.woff2') format('woff2-variations'),
       url('fonts/public-sans-variable.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('fonts/source-serif-4-variable.woff2') format('woff2-variations'),
       url('fonts/source-serif-4-variable.woff2') format('woff2');
}

/* ===================================================================
   DESIGN TOKENS
   =================================================================== */

:root {
  /* --- Colors --- */
  --navy:           #1A2B5C;
  --navy-dark:      #131F47;
  --navy-light:     #2C4180;
  --flag-red:       #B22234;
  --flag-red-dark:  #8E1A28;
  --cream:          #FAF7F2;
  --cream-warm:     #F4EFE7;
  --cream-deep:     #ECE5D5;
  --ink:            #1F2937;
  --muted:          #6B7280;
  --rule:           #D6D2C5;
  --rule-dark:      #B5AF9E;
  --gold:           #C9A961;
  --gold-dark:      #9F8542;
  --success:        #2A7D4F;
  --warn:           #C8102E;
  --paper:          #FFFFFF;

  /* --- Typography --- */
  --font-display: 'Source Serif 4', 'Source Serif Pro', 'Charter', 'Georgia', serif;
  --font-body:    'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, Menlo, monospace;

  /* --- Spacing scale (4-based) --- */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  24px;
  --s-6:  32px;
  --s-7:  48px;
  --s-8:  64px;
  --s-9:  96px;

  /* --- Layout --- */
  --container-max:  1080px;
  --form-card-max:  680px;
  --header-height:  80px;

  /* --- Borders & elevation --- */
  --border-thin:    1px solid var(--rule);
  --border-medium:  2px solid var(--navy);
  --shadow-card:    0 2px 8px rgba(26, 43, 92, 0.06), 0 1px 3px rgba(26, 43, 92, 0.04);
  --shadow-button:  0 2px 0 var(--navy-dark);
  --shadow-button-red: 0 2px 0 var(--flag-red-dark);
  --shadow-hover:   0 6px 20px rgba(26, 43, 92, 0.10);

  /* --- Motion --- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===================================================================
   RESET
   =================================================================== */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Force light rendering — opt out of Chrome auto-dark-mode for web contents */
  color-scheme: only light !important;
  background-color: #FAF7F2 !important;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;

  /* Very subtle paper-grain texture overlay.
     Differentiates from generic flat white SaaS aesthetics. */
  background-image:
    radial-gradient(circle at 1px 1px, rgba(26, 43, 92, 0.018) 1px, transparent 0);
  background-size: 24px 24px;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ===================================================================
   TYPOGRAPHY
   =================================================================== */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy);
  letter-spacing: -0.015em;
  line-height: 1.1;
  font-weight: 600;
  font-feature-settings: 'liga', 'kern';
}

h1 {
  font-size: clamp(2rem, 4vw + 1rem, 3.25rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.5rem, 2.5vw + 1rem, 2.25rem);
}

h3 {
  font-size: clamp(1.125rem, 1.25vw + 1rem, 1.5rem);
}

p {
  color: var(--ink);
  line-height: 1.625;
}

.subhead {
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.55;
  max-width: 52ch;
  margin-inline: auto;
}

/* The signature small-caps "eyebrow" label that flags every screen
   with civic-document gravitas. */
.eyebrow,
.step-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--s-3);
}

.eyebrow::before,
.eyebrow::after {
  content: '';
  display: inline-block;
  height: 1px;
  width: 28px;
  background-color: var(--navy);
  opacity: 0.4;
}

a {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s var(--ease-out);
}

a:hover {
  color: var(--flag-red);
  text-decoration-style: solid;
}

strong, b {
  font-weight: 700;
  color: var(--navy);
}

/* ===================================================================
   LAYOUT
   =================================================================== */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

@media (max-width: 540px) {
  .container { padding: 0 var(--s-4); }
}

/* ===================================================================
   HEADER (masthead)
   =================================================================== */

.site-header {
  padding: var(--s-4) 0;
  background: var(--cream);
  border-bottom: 1px solid var(--rule);
  position: relative;
}

/* Red/blue masthead stripe — flag accent without being cheesy */
.site-header::after {
  content: '';
  display: block;
  height: 3px;
  width: 100%;
  position: absolute;
  bottom: -3px;
  left: 0;
  background: linear-gradient(
    to right,
    var(--navy) 0%, var(--navy) 33.33%,
    var(--paper) 33.33%, var(--paper) 66.66%,
    var(--flag-red) 66.66%, var(--flag-red) 100%
  );
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo svg,
.logo img {
  height: 80px;
  width: auto;
  display: block;
}

@media (max-width: 540px) {
  .logo svg,
  .logo img {
    height: 60px;
  }
}

.header-meta {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-align: right;
}

.header-meta strong {
  display: block;
  color: var(--navy);
  font-size: 0.75rem;
}

@media (max-width: 540px) {
  .header-meta { display: none; }
}

/* ---- Centered-logo header variant ----
   Apply both classes on the header: <header class="site-header site-header-centered">
   Centers a larger logo across the top, suppresses the right-side meta.
   Pairs well with the celebratory/qualifier moments. */
.site-header-centered .header-row {
  justify-content: center;
}
.site-header-centered .header-meta {
  display: none;
}
.site-header-centered .logo {
  gap: 0;
}
.site-header-centered .logo svg,
.site-header-centered .logo img {
  height: 110px;
}
@media (max-width: 540px) {
  .site-header-centered .logo svg,
  .site-header-centered .logo img {
    height: 84px;
  }
}

/* ===================================================================
   PROGRESS BAR
   =================================================================== */

.progress {
  height: 3px;
  width: 100%;
  background-color: var(--rule);
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--navy);
  transition: width 0.6s var(--ease-out);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background-color: var(--flag-red);
}

/* ===================================================================
   MAIN / FORM CARD
   =================================================================== */

.main {
  flex: 1;
  padding: var(--s-4) 0 var(--s-7);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.form-card {
  width: 100%;
  max-width: var(--form-card-max);
  margin-inline: auto;
  background: var(--paper);
  border: 1px solid var(--rule);
  position: relative;
  padding: var(--s-6) var(--s-6) var(--s-6);
  box-shadow: var(--shadow-card);
}

/* Editorial top accent stripe — navy with red tip,
   like a magazine section header */
.form-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 4px;
  background:
    linear-gradient(to right,
      var(--navy) 0%,
      var(--navy) 70%,
      var(--flag-red) 70%,
      var(--flag-red) 100%);
}

.form-card-head {
  text-align: center;
  margin-bottom: var(--s-6);
}

.form-card-head h1,
.form-card-head h2 {
  margin-bottom: var(--s-3);
}

.form-card-head .subhead {
  margin-top: var(--s-3);
}

/* ===================================================================
   STEP CONTEXT (small label + counter)
   =================================================================== */

.step-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  padding-bottom: var(--s-4);
  margin-bottom: var(--s-5);
  border-bottom: 1px solid var(--rule);
}

.step-context strong {
  color: var(--navy);
}

/* ===================================================================
   BUTTONS — square edges, stamped/shadow feel
   =================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 14px 32px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out), background-color 0.15s var(--ease-out);
  position: relative;
  border-radius: 0;
}

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

.btn-primary {
  background-color: var(--navy);
  color: var(--cream);
  box-shadow: var(--shadow-button);
}

.btn-primary:hover {
  background-color: var(--navy-dark);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 var(--navy-dark);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--navy-dark);
}

.btn-red {
  background-color: var(--flag-red);
  color: var(--paper);
  box-shadow: var(--shadow-button-red);
}

.btn-red:hover {
  background-color: var(--flag-red-dark);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 var(--flag-red-dark);
}

.btn-red:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--flag-red-dark);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-large {
  font-size: 1.0625rem;
  padding: 18px 36px;
}

/* ===================================================================
   CHOICE TILES — multi-choice question answer cards
   =================================================================== */

.choices {
  display: grid;
  gap: var(--s-3);
}

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

@media (max-width: 540px) {
  .choices.choices-grid {
    grid-template-columns: 1fr;
  }
}

.choice {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: var(--paper);
  border: 1px solid var(--rule);
  text-align: left;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s var(--ease-out),
              background-color 0.15s var(--ease-out),
              transform 0.15s var(--ease-out),
              box-shadow 0.15s var(--ease-out);
  position: relative;
  width: 100%;
}

.choice:hover {
  border-color: var(--navy);
  background: var(--cream-warm);
  transform: translateX(2px);
  box-shadow: -3px 0 0 var(--flag-red);
}

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

.choice.choice-grid {
  flex-direction: column;
  text-align: center;
  padding: var(--s-5) var(--s-4);
  gap: var(--s-3);
}

.choice.choice-grid:hover {
  transform: translateY(-2px);
  box-shadow: 0 -3px 0 var(--flag-red);
}

.choice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.choice-icon svg {
  width: 32px;
  height: 32px;
  color: var(--navy);
  display: block;
  stroke-width: 1.5;
}

.choice.choice-grid .choice-icon svg {
  width: 44px;
  height: 44px;
}

.choice-label {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.choice-meta {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 4px;
}

.choice-arrow {
  flex-shrink: 0;
  color: var(--rule);
  transition: color 0.15s var(--ease-out), transform 0.15s var(--ease-out);
}

.choice-arrow svg {
  width: 18px;
  height: 18px;
}

.choice:hover .choice-arrow {
  color: var(--navy);
  transform: translateX(2px);
}

/* ===================================================================
   INPUT FIELDS
   =================================================================== */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--s-4);
}

.field-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--navy);
  text-transform: uppercase;
}

.input,
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink);
  transition: border-color 0.15s var(--ease-out),
              box-shadow 0.15s var(--ease-out);
  border-radius: 0;
}

.input:focus,
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--navy);
}

.input::placeholder,
.field input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.input-icon {
  position: relative;
}

.input-icon svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

/* Specificity bump: match the .field input[type="..."] rule's specificity so the
   left padding actually wins. Without these attribute selectors, the icon
   overlaps the placeholder text on the address input. */
.input-icon input[type="text"],
.input-icon input[type="email"],
.input-icon input[type="tel"],
.input-icon input[type="number"] {
  padding-left: 42px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}

@media (max-width: 540px) {
  .field-row { grid-template-columns: 1fr; }
}

/* ===================================================================
   HERO FIGURE — magazine-style photo + caption on landing pages
   =================================================================== */

.hero-figure {
  max-width: 880px;
  margin: var(--s-6) auto var(--s-5);
  padding: 0;
  position: relative;
}

.hero-figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-card);
}

.hero-figure figcaption {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: var(--s-3);
  text-align: center;
  padding: 0 var(--s-4);
  line-height: 1.5;
}

.hero-figure figcaption strong {
  color: var(--navy);
  margin-right: 6px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  font-size: 0.6875rem;
}

/* ===================================================================
   STAR DIVIDER — editorial section break
   =================================================================== */

.star-divider {
  text-align: center;
  margin: var(--s-6) 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
}

.star-divider::before,
.star-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.star-divider svg {
  width: 14px;
  height: 14px;
  color: var(--gold);
  flex-shrink: 0;
}

/* ===================================================================
   TESTIMONIAL — magazine pull-quote treatment
   =================================================================== */

.testimonial {
  max-width: var(--form-card-max);
  margin: var(--s-6) auto 0;
  padding: var(--s-5) var(--s-6);
  background: var(--cream-warm);
  border-left: 3px solid var(--flag-red);
  position: relative;
}

/* Circular profile avatar shown above the testimonial stars.
   Filled by testimonials.js based on user's geo region. */
.testimonial-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--cream);
  border: 1px solid var(--rule);
  box-shadow: inset 0 0 0 2px var(--paper), 0 1px 3px rgba(26, 43, 92, 0.10);
  margin-bottom: var(--s-3);
  flex-shrink: 0;
}

.testimonial-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.testimonial-stars {
  display: flex;
  gap: 2px;
  margin-bottom: var(--s-3);
  color: var(--gold);
}

.testimonial-stars svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: none;
}

.testimonial-body {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: var(--s-3);
}

.testimonial-meta {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.testimonial-meta strong {
  color: var(--navy);
  font-weight: 700;
}

/* ===================================================================
   TRUST ROW — small trust signals beneath form
   =================================================================== */

.trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-5);
  margin-top: var(--s-5);
  flex-wrap: wrap;
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.trust-item svg {
  width: 14px;
  height: 14px;
  color: var(--navy);
  flex-shrink: 0;
}

/* ===================================================================
   TCPA BLOCK — compliance text, demoted visually
   =================================================================== */

.tcpa {
  font-size: 0.6875rem;
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
  max-width: 56ch;
  margin-inline: auto;
}

.tcpa a {
  color: var(--muted);
  font-size: inherit;
  text-decoration-color: var(--rule);
}

.tcpa-links {
  display: flex;
  justify-content: center;
  gap: var(--s-3);
  margin-top: var(--s-2);
}

/* ===================================================================
   FOOTER
   =================================================================== */

.site-footer {
  padding: var(--s-6) 0;
  text-align: center;
  border-top: 1px solid var(--rule);
  background: var(--cream);
  margin-top: var(--s-7);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-bottom: var(--s-3);
}

.footer-links a {
  color: var(--muted);
  font-size: 0.75rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--navy);
}

.footer-meta {
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* ===================================================================
   HERO (landing page)
   =================================================================== */

.hero {
  padding: var(--s-4) 0 var(--s-5);
  text-align: center;
  position: relative;
}

.hero-headline {
  font-size: clamp(2.25rem, 4vw + 0.75rem, 3.25rem);
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin-bottom: var(--s-3);
  max-width: 22ch;
  margin-inline: auto;
}

.hero-headline em {
  font-style: italic;
  color: var(--flag-red);
  font-weight: 600;
}

.hero-sub {
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 auto var(--s-5);
  line-height: 1.5;
}

/* Decorative star pair flanking the headline */
.hero-stars {
  display: flex;
  justify-content: center;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
  color: var(--flag-red);
}

.hero-stars svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ===================================================================
   CELEBRATORY HEADER (final step)
   =================================================================== */

.qualified-stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 2px solid var(--success);
  color: var(--success);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: var(--s-4);
  transform: rotate(-1.5deg);
  background: var(--cream);
}

.qualified-stamp svg {
  width: 16px;
  height: 16px;
}

/* ===================================================================
   UTILITY
   =================================================================== */

.text-center { text-align: center; }
.text-navy   { color: var(--navy); }
.text-red    { color: var(--flag-red); }
.text-muted  { color: var(--muted); }

.mt-1 { margin-top: var(--s-1); }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.mt-7 { margin-top: var(--s-7); }

.hidden { display: none !important; }

/* ===================================================================
   ANIMATIONS
   =================================================================== */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fade-up 0.55s var(--ease-out) backwards; }

.fade-up-1 { animation-delay: 0ms; }
.fade-up-2 { animation-delay: 70ms; }
.fade-up-3 { animation-delay: 140ms; }
.fade-up-4 { animation-delay: 210ms; }
.fade-up-5 { animation-delay: 280ms; }
.fade-up-6 { animation-delay: 350ms; }

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

/* ===================================================================
   STEP 7 — celebratory close enhancements
   =================================================================== */

/* Specificity icon — small star/check sized to match text */
.specificity-icon {
  width: 1em;
  height: 1em;
  color: var(--gold);
  display: inline-block;
  vertical-align: -0.15em;
  margin-right: 0.3em;
  flex-shrink: 0;
}

/* "What happens next" — 3-step process list, numbered circles */
.next-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin: var(--s-5) 0;
  padding: 0;
}

.next-steps li {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--ink);
}

.next-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: var(--navy);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: 50%;
  margin-top: 1px;
}

.next-step-text {
  flex: 1;
  padding-top: 1px;
}

.next-step-text strong {
  color: var(--navy);
}

/* ===================================================================
   MOBILE TWEAKS — aggressive vertical compression so the form-card
   (question + first answers) lands above the fold on mobile viewports.
   =================================================================== */

@media (max-width: 640px) {
  .form-card {
    padding: var(--s-4) var(--s-4) var(--s-4);
  }
  /* Bottom padding on .main respects iOS Safari's safe-area inset AND
     adds a 72px buffer so the bottom toolbar can't overlap the CTA. */
  .main {
    padding: var(--s-4) 0 calc(var(--s-6) + env(safe-area-inset-bottom, 0px) + 72px);
  }
  /* Compact hero on mobile — headline + subline stay visible so the ad's
     value-prop carries through, but tightened so the question card sits
     just below the fold. */
  .hero {
    display: block;
    padding: var(--s-3) 0 var(--s-4);
  }
  .hero-stars {
    margin-bottom: var(--s-2);
  }
  .hero-stars svg {
    width: 13px;
    height: 13px;
  }
  .hero .eyebrow {
    font-size: 0.625rem;
    margin-bottom: var(--s-2);
  }
  .hero-headline {
    font-size: 1.875rem;
    line-height: 1.08;
    margin-bottom: var(--s-2);
    max-width: 20ch;
  }
  .hero-sub {
    font-size: 0.9375rem;
    line-height: 1.45;
    margin-bottom: 0;
    max-width: 40ch;
  }
  /* Form-card head spacing */
  .form-card-head {
    margin-bottom: var(--s-4);
  }
  .form-card-head h1,
  .form-card-head h2 {
    font-size: 1.5rem;
    line-height: 1.2;
  }
  /* Hide explainer subheads inside form-card on mobile.
     The question H1/H2 carries the meaning; the subhead is over-explanation
     that eats ~60-80px and pushes answer tiles below the fold. */
  .form-card-head .subhead {
    display: none;
  }
  /* Step-context band: tighter */
  .step-context {
    padding-bottom: var(--s-3);
    margin-bottom: var(--s-3);
    font-size: 0.625rem;
  }
  /* Tighter row-format choice tiles on mobile, even for the choice-grid
     layout that's column-format on desktop. Drops each tile from ~100px to
     ~60px tall and keeps the icon next to the label instead of above it. */
  .choice {
    padding: var(--s-3) var(--s-4);
    gap: var(--s-3);
  }
  .choice.choice-grid {
    flex-direction: row;
    text-align: left;
    padding: var(--s-3) var(--s-4);
    gap: var(--s-3);
  }
  .choice.choice-grid .choice-icon svg {
    width: 28px;
    height: 28px;
  }
  .choice.choice-grid:hover {
    /* Replace vertical lift with horizontal nudge to match the row layout */
    transform: translateX(2px);
    box-shadow: -3px 0 0 var(--flag-red);
  }
}

@media (max-width: 400px) {
  .form-card {
    padding: var(--s-4);
  }
  .btn-large {
    padding: 16px 24px;
    font-size: 1rem;
  }
  .hero-headline {
    font-size: 1.75rem;
  }
  .form-card-head h1,
  .form-card-head h2 {
    font-size: 1.375rem;
  }
}

/* ===================================================================
   HOMEBUDDY-STYLE LONG-LANDER COMPONENTS
   Used by Variant E (cost calculator) and enhancement sections in A/B/C/D.
   =================================================================== */

/* --- Cost-lander hero (no progress bar bias, big-headline + ZIP) --- */

.hero-cost {
  padding: var(--s-7) 0 var(--s-5);
  text-align: center;
}

.hero-cost .hero-headline {
  font-size: clamp(2rem, 4vw + 1rem, 3.5rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
  max-width: 22ch;
  margin-bottom: var(--s-4);
}

/* --- ZIP-entry form card (compact, ZIP-only) --- */

.form-card-zip {
  max-width: 560px;
  padding: var(--s-6) var(--s-5);
}

.form-card-zip h2 {
  font-size: clamp(1.25rem, 1.6vw + 1rem, 1.625rem);
  text-align: center;
  margin-bottom: var(--s-4);
}

.zip-field {
  max-width: 420px;
  margin: 0 auto var(--s-4);
}

.zip-field input {
  text-align: center;
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  padding: 16px;
}

.cost-microcopy {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: var(--s-3);
  letter-spacing: 0.05em;
}

/* --- Content section wrapper (generic dense section on long landers) --- */

.content-section {
  max-width: 880px;
  margin: var(--s-7) auto 0;
  padding: 0 var(--s-4);
}

.content-section .section-head {
  text-align: center;
  margin-bottom: var(--s-6);
}

.content-section .section-head h2 {
  margin-bottom: var(--s-3);
  max-width: 22ch;
  margin-inline: auto;
}

.content-section .section-head p {
  color: var(--muted);
  font-size: 1.0625rem;
  max-width: 52ch;
  margin: 0 auto;
}

/* --- Benefits list (single column with checkmarks) --- */

.benefits-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3) var(--s-5);
  max-width: 720px;
  margin: 0 auto;
}

@media (max-width: 540px) {
  .benefits-list { grid-template-columns: 1fr; }
}

.benefits-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
  padding: 8px 0;
  border-bottom: 1px dotted var(--rule);
}

.benefits-list li::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  background-color: var(--success);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12 L10 17 L19 7'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12 L10 17 L19 7'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* --- Project types (2-card row) --- */

.project-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-4);
}

@media (max-width: 640px) {
  .project-types { grid-template-columns: 1fr; }
}

.project-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--rule);
}

.project-card .project-body {
  padding: var(--s-4) var(--s-5);
}

.project-card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--s-2);
}

.project-card p {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.5;
}

/* --- Advantages grid (6 tiles with icons) --- */

.advantages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
}

@media (max-width: 720px) {
  .advantages-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  .advantages-grid { grid-template-columns: 1fr; }
}

.advantage-tile {
  padding: var(--s-5) var(--s-4);
  background: var(--paper);
  border: 1px solid var(--rule);
  text-align: center;
}

.advantage-tile svg {
  width: 36px;
  height: 36px;
  color: var(--flag-red);
  stroke-width: 1.5;
  margin: 0 auto var(--s-3);
}

.advantage-tile h3 {
  font-size: 1.0625rem;
  margin-bottom: var(--s-2);
}

.advantage-tile p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}

/* --- Photo gallery (responsive 3 / 2 / 1 columns, magazine-style) ---
   Aspect-ratio is set on the FIGURE (not the img) so CSS Grid's default
   stretch behavior doesn't distort the frame. img fills figure with
   object-fit: cover. Source images are 16:9 so we match that to avoid
   awkward crops. */

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
}

@media (max-width: 900px) {
  .photo-gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
  .photo-gallery { grid-template-columns: 1fr; }
}

.photo-gallery figure {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--cream-warm);
  aspect-ratio: 16 / 9;
}

.photo-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease-out);
}

.photo-gallery figure:hover img {
  transform: scale(1.04);
}

.photo-gallery figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  background: linear-gradient(to top, rgba(26, 43, 92, 0.85), rgba(26, 43, 92, 0));
  color: var(--cream);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* --- Symptom checklist (2-col, civic doc feel) --- */

.symptom-list {
  max-width: 720px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: var(--s-5) var(--s-6);
  position: relative;
}

.symptom-list::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 3px;
  background:
    linear-gradient(to right,
      var(--navy) 0%, var(--navy) 50%,
      var(--flag-red) 50%, var(--flag-red) 100%);
}

.symptom-list ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3) var(--s-5);
}

@media (max-width: 540px) {
  .symptom-list ul { grid-template-columns: 1fr; }
}

.symptom-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9375rem;
  color: var(--ink);
  line-height: 1.45;
  padding: 6px 0;
  border-bottom: 1px dotted var(--rule);
}

.symptom-list li::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  background-color: var(--flag-red);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 L22 21 L2 21 Z'/%3E%3Cpath d='M12 10 V14'/%3E%3Ccircle cx='12' cy='17.5' r='0.5' fill='white'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 L22 21 L2 21 Z'/%3E%3Cpath d='M12 10 V14'/%3E%3Ccircle cx='12' cy='17.5' r='0.5' fill='white'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* --- "How It Works" 3-step --- */

.how-it-works {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
  max-width: 880px;
  margin: 0 auto;
  position: relative;
}

@media (max-width: 720px) {
  .how-it-works { grid-template-columns: 1fr; gap: var(--s-4); }
}

.how-step {
  text-align: center;
  position: relative;
  padding: 0 var(--s-3);
}

.how-step .step-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--flag-red);
  line-height: 1;
  margin-bottom: var(--s-3);
  letter-spacing: -0.02em;
}

.how-step h3 {
  font-size: 1.125rem;
  margin-bottom: var(--s-2);
}

.how-step p {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 26ch;
  margin: 0 auto;
}

/* dotted connectors between desktop steps */
.how-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 24px;
  right: -24px;
  width: 32px;
  height: 1px;
  background-image: linear-gradient(to right, var(--rule) 0, var(--rule) 5px, transparent 5px, transparent 8px);
  background-size: 8px 1px;
  background-repeat: repeat-x;
}

@media (max-width: 720px) {
  .how-step:not(:last-child)::after { display: none; }
}

/* --- CTA band (boxed ZIP-repeat band) --- */

.cta-band {
  background: var(--navy);
  color: var(--cream);
  margin-top: var(--s-7);
  padding: var(--s-7) var(--s-5);
  position: relative;
}

.cta-band::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background:
    linear-gradient(to right,
      var(--flag-red) 0%, var(--flag-red) 33%,
      var(--paper) 33%, var(--paper) 66%,
      var(--navy-light) 66%, var(--navy-light) 100%);
}

.cta-band-inner {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}

.cta-band h2 {
  color: var(--cream);
  font-size: clamp(1.5rem, 2vw + 1rem, 2rem);
  margin-bottom: var(--s-4);
}

.cta-band h2 em {
  font-style: italic;
  color: var(--gold);
}

.cta-band .zip-field input {
  background: var(--paper);
}

.cta-band .cost-microcopy {
  color: rgba(250, 247, 242, 0.7);
}

.cta-band .btn-primary {
  background: var(--flag-red);
  color: var(--paper);
  box-shadow: 0 2px 0 var(--flag-red-dark);
}

.cta-band .btn-primary:hover {
  background: var(--flag-red-dark);
  box-shadow: 0 3px 0 var(--flag-red-dark);
}

/* --- Stats strip (formalize the inline-styled one for reuse) --- */

.stats-strip-block {
  margin-top: var(--s-7);
  padding: var(--s-5) 0;
  border-top: 1px solid var(--rule);
  border-bottom: 3px double var(--rule);
  text-align: center;
}

.stats-strip-block .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
  max-width: 720px;
  margin: 0 auto;
}

.stats-strip-block .stat-num {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  letter-spacing: -0.01em;
}

.stats-strip-block .stat-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

.stats-strip-block .stat-divider {
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  padding: 0 var(--s-4);
}

@media (max-width: 540px) {
  .stats-strip-block .stats-grid { grid-template-columns: 1fr; gap: var(--s-3); }
  .stats-strip-block .stat-divider { border: none; padding: var(--s-3) 0; border-top: 1px dotted var(--rule); border-bottom: 1px dotted var(--rule); }
}
