:root {
  --ink: #111111;
  --paper: #f7f7f5;
  --white: #ffffff;
  --muted: #686868;
  --line: #d8d8d3;
  --blue: #0089ff;
  --blue-dark: #0069c7;
  --blue-soft: #eaf5ff;
  --success: #0b7a55;
  --error: #b42318;
  --shadow: 0 24px 70px rgba(17, 17, 17, 0.11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 99; padding: .75rem 1rem; background: var(--ink); color: white; border-radius: .5rem; }
.skip-link:focus { top: 1rem; }

.site-header { max-width: 1240px; margin: 0 auto; padding: 28px 32px 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; background: var(--ink); color: white; border-radius: 50%; font: 700 14px/1 "Outfit", sans-serif; letter-spacing: .04em; }
.brand strong, .brand small { display: block; }
.brand strong { font: 700 16px/1.1 "Outfit", sans-serif; letter-spacing: .08em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: .16em; }
.header-proof { display: flex; gap: 10px; color: var(--muted); font-size: 13px; }
.header-proof span + span::before { content: "•"; margin-right: 10px; }
.header-side { display: grid; justify-items: end; gap: 8px; }
.funnel-nav { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.7); }
.funnel-nav a { padding: 6px 10px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 700; }
.funnel-nav a:hover { color: var(--ink); }
.funnel-nav a[aria-current="page"] { background: var(--ink); color: white; }

.hero { max-width: 1240px; margin: 0 auto; padding: 58px 32px 80px; }
.hero-copy { width: 100%; max-width: none; margin-bottom: 40px; }
.eyebrow, .step-kicker { margin: 0 0 12px; color: var(--blue-dark); font: 700 12px/1 "Outfit", sans-serif; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 22px; font: 600 clamp(3.2rem, 7vw, 6.8rem)/.91 "Outfit", sans-serif; letter-spacing: -.055em; }
h1 em { color: var(--blue); font-style: normal; }
.lede { width: 100%; max-width: none; margin-bottom: 26px; color: #3b3b3b; font-size: clamp(1.08rem, 2vw, 1.3rem); }
.trust-row { display: flex; flex-wrap: wrap; gap: 12px; }
.trust-row span { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.62); color: var(--muted); font-size: 14px; }
.trust-row b { color: var(--ink); }

.experience-grid { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 620px); justify-content: center; align-items: start; gap: 24px; }
.video-panel, .form-shell { border: 1px solid #cbcbc6; background: var(--white); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.video-panel { display: flex; flex-direction: column; width: 100%; min-height: 0; background: var(--ink); color: white; }
.video-frame { position: relative; flex: none; aspect-ratio: 9 / 16; background: linear-gradient(145deg, #1d1d1d, #050505); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-poster { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; overflow: hidden; border: 0; background: #111; color: white; cursor: pointer; text-align: left; }
.video-poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,.05) 58%); }
.video-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play-button { position: absolute; z-index: 1; left: 28px; bottom: 70px; display: grid; place-items: center; width: 58px; height: 58px; padding-left: 4px; border-radius: 50%; background: var(--blue); box-shadow: 0 12px 32px rgba(0,0,0,.28); font-size: 19px; }
.play-copy { position: absolute; z-index: 1; left: 28px; right: 24px; bottom: 24px; }
.play-copy b, .play-copy small { display: block; }
.play-copy b { font: 700 18px/1.1 "Outfit", sans-serif; }
.play-copy small { margin-top: 3px; color: #d5d5d5; font-size: 13px; }
.video-poster:focus-visible { outline: 4px solid var(--blue); outline-offset: -4px; }
.video-caption { display: flex; align-items: center; gap: 12px; padding: 18px 20px 20px; }
.video-caption .avatar { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid #5f5f5f; border-radius: 50%; color: white; font: 700 13px/1 "Outfit", sans-serif; }
.video-caption strong, .video-caption span { display: block; }
.video-caption div span { color: #aeaeae; font-size: 13px; }

.form-shell { width: 100%; min-height: 690px; padding: 30px; display: flex; flex-direction: column; }
.form-topline { min-height: 68px; display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.form-topline h2 { margin-bottom: 0; font: 600 29px/1.04 "Outfit", sans-serif; letter-spacing: -.025em; }
.step-count { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: var(--paper); color: var(--muted); font-size: 13px; }
.progress-track { height: 6px; margin: 22px 0 32px; overflow: hidden; border-radius: 99px; background: #e6e6e2; }
.progress-track div { width: 6.666%; height: 100%; border-radius: inherit; background: var(--blue); transition: width .28s ease; }
#buyer-form, #refinance-form { display: flex; flex: 1; flex-direction: column; }
#question-stage { outline: none; }
.question-label { display: block; margin-bottom: 18px; font: 600 clamp(1.55rem, 3vw, 2.25rem)/1.08 "Outfit", sans-serif; letter-spacing: -.025em; }
.question-help { margin: -8px 0 18px; color: var(--muted); }
.option-grid { display: grid; gap: 10px; }
.option-label { position: relative; display: flex; align-items: center; min-height: 50px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: white; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease; }
.option-label:hover { border-color: #7fbfff; background: #fbfdff; transform: translateY(-1px); }
.option-label:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 2px rgba(0,137,255,.14); }
.option-label input { width: 18px; height: 18px; margin: 0 12px 0 0; accent-color: var(--blue); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 7px; }
.field span { font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-height: 52px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); }
.field textarea { resize: vertical; }
.field small { color: var(--muted); font-weight: 500; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(0,137,255,.18); border-color: var(--blue); }
.span-two { grid-column: 1 / -1; }
.consent { align-items: flex-start; font-size: 13px; line-height: 1.45; }
.consent input { flex: 0 0 auto; margin-top: 2px; }
.form-error { margin: 16px 0 0; color: var(--error); font-weight: 600; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: auto; padding-top: 28px; }
.back-button, .next-button { min-height: 50px; border-radius: 12px; font-weight: 700; cursor: pointer; }
.back-button { padding: 0 18px; border: 1px solid var(--line); background: white; }
.next-button { margin-left: auto; min-width: 160px; padding: 0 20px; border: 1px solid var(--ink); background: var(--ink); color: white; box-shadow: 0 8px 22px rgba(17,17,17,.14); }
.next-button:hover { background: #2b2b2b; }
.next-button:focus-visible, .back-button:focus-visible, .option-label:focus-within { outline: 3px solid rgba(0,137,255,.3); outline-offset: 2px; }
.next-button[disabled] { cursor: wait; opacity: .65; }
.save-note { margin-top: 18px; color: var(--muted); font-size: 13px; }
.save-note span { color: var(--success); font-weight: 700; }

.success-state { display: grid; align-content: center; min-height: 320px; text-align: center; }
.success-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 50%; background: #e6f6ef; color: var(--success); font-size: 28px; font-weight: 700; }
.success-state h3 { margin: 0 0 12px; font: 600 34px/1.05 "Outfit", sans-serif; }
.success-state p { max-width: 470px; margin: 0 auto; color: var(--muted); }
.preview-notice { margin-top: 18px !important; padding: 12px 14px; border: 1px solid #b7d9f5; border-radius: 10px; background: var(--blue-soft); color: #174f79 !important; text-align: left; font-size: 13px; }
.partner-form-shell { min-height: 720px; }
.realtor-form { display: flex; flex: 1; flex-direction: column; margin-top: 24px; }
.partner-submit { width: 100%; margin: 24px 0 0; }

.aftercare { padding: 90px max(32px, calc((100vw - 1176px) / 2)); background: var(--ink); color: white; }
.aftercare .eyebrow { color: #76bdff; }
.aftercare-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.aftercare-grid > div { border-top: 1px solid #464646; padding-top: 20px; }
.aftercare-grid span { color: #76bdff; font: 700 12px/1 "Outfit", sans-serif; letter-spacing: .12em; }
.aftercare-grid h2 { margin: 14px 0 8px; font: 600 27px/1.05 "Outfit", sans-serif; }
.aftercare-grid p { color: #b9b9b9; }

footer { padding: 34px max(32px, calc((100vw - 1176px) / 2)); background: white; }
.footer-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.footer-brand strong, .footer-brand span { display: block; }
.footer-brand span { color: var(--muted); font-size: 13px; }
.footer-main img { max-width: 190px; height: auto; }
.footer-main nav { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 14px; font-size: 13px; }
.legal { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .experience-grid { grid-template-columns: minmax(0, 1fr); max-width: 620px; margin: 0 auto; }
  .video-panel { width: min(100%, 340px); min-height: auto; margin: 0 auto; }
  .video-frame { flex: none; }
  .form-shell { min-height: 620px; }
  .aftercare-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-main { grid-template-columns: 1fr; }
  .footer-main nav { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .site-header { padding: 18px 18px 12px; }
  .header-proof { display: none; }
  .header-side { max-width: 58%; }
  .funnel-nav { gap: 1px; }
  .funnel-nav a { padding: 6px 7px; font-size: 10px; }
  .brand-mark { width: 40px; height: 40px; }
  .hero { padding: 38px 16px 56px; }
  .hero-copy { margin-bottom: 28px; }
  h1 { font-size: clamp(3.15rem, 15vw, 4.8rem); }
  .lede { font-size: 1.04rem; }
  .trust-row { gap: 8px; }
  .trust-row span { font-size: 12px; }
  .experience-grid { gap: 14px; }
  .video-panel, .form-shell { border-radius: 18px; }
  .video-caption { padding: 13px 15px; }
  .play-button { left: 20px; bottom: 62px; width: 50px; height: 50px; }
  .play-copy { left: 20px; bottom: 18px; }
  .form-shell { min-height: 610px; padding: 22px 18px; }
  .partner-form-shell { min-height: auto; }
  .form-topline h2 { font-size: 24px; }
  .progress-track { margin: 18px 0 26px; }
  .question-label { font-size: 1.75rem; }
  .field-grid { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .form-actions { position: sticky; bottom: 0; margin: auto -18px -22px; padding: 16px 18px 18px; background: linear-gradient(to bottom, rgba(255,255,255,.86), white 28%); }
  .next-button { min-width: 148px; }
  .aftercare { padding: 62px 20px; }
  footer { padding: 30px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

.adaptive-hero { padding-top: 48px; }
.adaptive-intro { margin-bottom: 40px; }
.adaptive-intro .hero-copy { width: 100%; max-width: none; margin-bottom: 0; }
.adaptive-intro h1 { font-size: clamp(3rem, 6.2vw, 6rem); }
.adaptive-intro .lede { max-width: none; }
.adaptive-form-shell { max-width: 820px; min-height: 560px; margin: 0 auto; }
.context-row { display: flex; align-items: center; gap: 8px; width: max-content; max-width: 100%; margin: 6px 0 -6px; padding: 7px 10px; border-radius: 999px; background: var(--blue-soft); color: #174f79; font-size: 13px; font-weight: 700; }
.context-row[hidden] { display: none; }
.context-row button { padding: 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer; font-size: 12px; }
.field textarea { font: inherit; }
.consent small { display: block; margin-top: 5px; color: var(--muted); }

@media (max-width: 620px) {
  .adaptive-hero { padding-top: 34px; }
  .adaptive-intro { margin-bottom: 26px; }
  .adaptive-intro h1 { font-size: clamp(3rem, 15vw, 4.5rem); }
  .adaptive-form-shell { min-height: 600px; }
}
