/* Prop 37 Home Loan Guide: color-block system. Tokens and rules: design-system/MASTER.md */
:root {
  --canvas: #f7f7f7;
  --white: #ffffff;
  --ink: #000000;
  --graphite: #101516;
  --muted: #4a5254;
  --line: #e5e7eb;
  --steel: #bec6cc;
  --blue: #1f86ff;      /* 80% first mortgage */
  --pink: #f6609f;      /* 17% state loan */
  --yellow: #ffbb38;    /* 3% your money */
  --green: #1ec072;
  --blush: #ffb4ed;
  --orange: #ff5500;    /* main action only */
  --link: #0f5fc0;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 3px 11px rgba(0,0,0,.05), 0 17px 20px rgba(0,0,0,.03);
  --gutter: clamp(16px, 4vw, 40px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 1.0625rem/1.6 var(--body); }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--link); text-underline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: 8px; top: -60px; z-index: 60; background: var(--ink); color: var(--white); padding: 10px 14px; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

h1, h2, .foot-name, .card h3, .fact-v { font-family: var(--display); }
h1 { font-weight: 800; font-size: clamp(2.75rem, 7.2vw, 5.5rem); line-height: .98; letter-spacing: -.03em; text-wrap: balance; }
h1 em { font-style: normal; background: var(--yellow); padding: 0 .12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
h2 { font-weight: 800; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -.02em; text-wrap: balance; }
h3 { font-size: 1.1875rem; font-weight: 600; line-height: 1.3; }
.eyebrow { display: block; font: 600 .8125rem/1.3 var(--body); letter-spacing: .02em; color: var(--muted); margin-bottom: 10px; }
.lede { font-size: clamp(1.125rem, 1.7vw, 1.3125rem); line-height: 1.5; max-width: 60ch; }
.byline, .meta-line { font-size: .875rem; color: var(--muted); }
.byline { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px; }

.ribbon { background: var(--ink); color: var(--white); font-size: .75rem; padding: 6px 16px; text-align: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 26px; border-radius: 9999px; border: 1px solid transparent; font: 600 1rem/1.1 var(--body); text-decoration: none; cursor: pointer; transition: background-color .15s ease, color .15s ease, transform .15s ease; }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--graphite); transform: translateY(-1px); }
.btn-cta { background: var(--orange); color: var(--ink); }
.btn-cta:hover { background: #ff7a33; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--white); }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 9999px; background: var(--white); border: 1px solid var(--line); font: 600 .8125rem/1.2 var(--body); }
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }

/* Header */
.site-head { position: sticky; top: 0; z-index: 50; background: var(--canvas); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.brand-mark { position: relative; width: 28px; height: 28px; display: block; }
.brand-mark i { position: absolute; display: block; }
.brand-mark i:nth-child(1) { left: 0; top: 0; width: 80%; height: 100%; background: var(--blue); }
.brand-mark i:nth-child(2) { right: 0; top: 0; width: 20%; height: 85%; background: var(--pink); }
.brand-mark i:nth-child(3) { right: 0; bottom: 0; width: 20%; height: 15%; background: var(--yellow); }
.brand-name { font: 800 1.125rem/1 var(--display); letter-spacing: -.01em; white-space: nowrap; }
.brand-name em { font-style: normal; font-weight: 600; }
.nav { display: flex; gap: 20px; margin-left: auto; }
.nav a { color: var(--ink); font: 500 .9375rem/1 var(--body); text-decoration: none; padding: 8px 0; white-space: nowrap; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current] { border-bottom-color: var(--orange); }
.head-cta { min-height: 42px; padding: 0 18px; font-size: .9375rem; flex: none; }
.menu { display: none; margin-left: auto; position: relative; }
.menu summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 0 18px; border: 1px solid var(--ink); border-radius: 9999px; font-weight: 600; font-size: .9375rem; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(320px, calc(100vw - 32px)); background: var(--white); border-radius: 6px; box-shadow: var(--shadow); border: 1px solid var(--line); padding: 8px; display: grid; }
.menu-panel a:not(.btn) { padding: 11px 12px; color: var(--ink); text-decoration: none; border-radius: 6px; }
.menu-panel a:not(.btn):hover { background: var(--canvas); }
.menu-panel .btn { margin: 8px 4px 4px; }

/* Hero */
.hero { padding: clamp(36px, 6vw, 72px) 0 clamp(44px, 7vw, 84px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero .pill { margin-bottom: 20px; }
.hero .lede { margin-top: 20px; }
.hero .meta-line { margin-top: 20px; }

/* The 3 / 17 / 80 stack: area matches the real share of the price */
.stack { position: relative; display: grid; grid-template-columns: 80fr 20fr; aspect-ratio: 1 / 1; width: 100%; container-type: inline-size; }
.stack-col { display: grid; grid-template-rows: 85fr 15fr; }
.blk { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(10px, 2vw, 20px); overflow: hidden; }
.blk b { font: 800 clamp(1.25rem, 3vw, 2.25rem)/1 var(--display); letter-spacing: -.02em; }
.blk span { font-size: .8125rem; line-height: 1.25; margin-top: 4px; }
.blk-80 { background: var(--blue); }
.blk-80 b { font-size: clamp(4rem, 12vw, 9rem); letter-spacing: -.04em; }
.blk-80 span { font-size: 1rem; }
.blk-17 { background: var(--pink); }
.blk-3 { background: var(--yellow); }
/* The narrow column scales with the stack so the numbers always fit inside it */
.blk-17, .blk-3 { padding: 2cqw; min-width: 0; }
.blk-17 b, .blk-3 b { font-size: 6.4cqw; }
.blk-17 span { font-size: 2.6cqw; }
.stack-key { display: grid; gap: 6px; margin-top: 14px; font-size: .9375rem; }
.stack-key li { display: flex; align-items: flex-start; gap: 10px; }
.stack-key i { flex: none; width: 14px; height: 14px; margin-top: 5px; }

/* Bands */
.band { padding: clamp(48px, 7vw, 88px) 0; }
.band.alt { background: var(--white); }
.band.yellow { background: var(--yellow); }
.band.ink { background: var(--graphite); color: var(--white); }
.band.ink a:not(.btn):not(.card) { color: var(--white); }
.band.ink .eyebrow { color: var(--steel); }
.head { max-width: 760px; margin-bottom: clamp(24px, 4vw, 40px); }
.head p { margin-top: 12px; }

.phero { position: relative; overflow: hidden; padding: clamp(32px, 5vw, 64px) 0 clamp(36px, 5vw, 60px); background: var(--white); border-bottom: 1px solid var(--line); }
.phero::before, .phero::after { content: ""; position: absolute; }
.phero::before { right: 0; top: 0; width: clamp(60px, 12vw, 170px); height: 100%; background: var(--blue); }
.phero::after { right: clamp(60px, 12vw, 170px); top: 0; width: clamp(24px, 3vw, 44px); height: 62%; background: var(--pink); }
.phero .wrap { position: relative; z-index: 1; }
.phero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); max-width: 16ch; margin-bottom: 18px; }
.phero .lede { max-width: 56ch; padding-right: clamp(0px, 8vw, 200px); }
.crumbs { font-size: .875rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: inherit; }

/* Article */
.article { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.toc { position: sticky; top: 92px; font-size: .9375rem; }
.toc p { font-weight: 600; margin-bottom: 10px; }
.toc ol { display: grid; gap: 8px; border-left: 3px solid var(--blue); padding-left: 14px; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.prose { max-width: 72ch; min-width: 0; }
.prose > section + section, .prose > section + aside { margin-top: clamp(40px, 6vw, 64px); }
.prose h2 { margin-bottom: 16px; }
.prose h3 { margin: 26px 0 8px; }
.prose p { margin-bottom: 1em; }
.prose ul, .prose ol { margin: 0 0 1.2em; }
.prose ul:not(.checks) li { position: relative; padding-left: 20px; margin-bottom: .5em; }
.prose ul:not(.checks) li::before { content: ""; position: absolute; left: 0; top: .6em; width: 9px; height: 9px; background: var(--blue); }
.prose > section > ol:not(.timeline), .prose > ol:not(.timeline) { counter-reset: s; }
.prose > section > ol:not(.timeline) > li, .prose > ol:not(.timeline) > li { counter-increment: s; position: relative; padding-left: 40px; margin-bottom: .75em; }
.prose > section > ol:not(.timeline) > li::before, .prose > ol:not(.timeline) > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; display: grid; place-items: center; background: var(--yellow); font: 700 .875rem/1 var(--display); }
.checks { display: grid; gap: 8px; }
.checks li { position: relative; padding-left: 28px; }
.checks li::before { content: ""; position: absolute; left: 0; top: .35em; width: 16px; height: 16px; background: var(--green); clip-path: polygon(14% 44%, 0 58%, 40% 100%, 100% 16%, 84% 4%, 38% 70%); }
.callout { background: var(--white); border-left: 6px solid var(--blue); padding: 16px 18px; margin: 22px 0; border-radius: 0 6px 6px 0; }
.callout p:last-child { margin-bottom: 0; }
.callout.warn { border-left-color: var(--orange); }
.photo { margin: 24px 0; }
.photo img { width: 100%; height: auto; border-radius: 6px; aspect-ratio: 3 / 2; object-fit: cover; }
.photo figcaption { font-size: .875rem; color: var(--muted); margin-top: 8px; }
.sources { background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 20px 22px; font-size: .9375rem; }
.sources h2 { font: 700 1.25rem/1.2 var(--display); margin-bottom: 12px; }

/* Tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 6px; background: var(--white); margin: 0 0 1.2em; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-weight: 600; font-size: .8125rem; background: var(--canvas); white-space: nowrap; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 600; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 9999px; font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.badge-yes { background: var(--green); }
.badge-wait { background: var(--yellow); }
.badge-no { background: var(--blush); }
#county-table td, #county-table thead th { white-space: nowrap; }

/* Timeline */
.timeline { margin: 8px 0 1.2em; border-left: 3px solid var(--line); }
.timeline li { position: relative; padding: 0 0 22px 22px; }
.timeline li::before { content: ""; position: absolute; left: -8px; top: 6px; width: 13px; height: 13px; background: var(--steel); }
.timeline li.done::before { background: var(--green); }
.timeline li.next::before { background: var(--yellow); }
.timeline time { font-size: .875rem; color: var(--muted); }
.timeline h3 { margin: 2px 0 2px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cards.four { grid-template-columns: repeat(4, 1fr); }
.cards.two { grid-template-columns: repeat(2, 1fr); }
.card { display: block; background: var(--white); border-radius: 6px; padding: 20px; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
a.card { transition: transform .15s ease; }
a.card:hover { transform: translateY(-3px); }
.card h3 { font-weight: 800; font-size: 1.375rem; line-height: 1.15; letter-spacing: -.01em; margin-bottom: 8px; }
.card p { font-size: .9375rem; line-height: 1.5; }
.more { display: block; margin-top: 12px; font-weight: 600; font-size: .9375rem; }
.c-blue { background: var(--blue); }
.c-pink { background: var(--pink); }
.c-yellow { background: var(--yellow); }
.c-green { background: var(--green); }
.c-blush { background: var(--blush); }

/* Big numbers */
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--ink); border: 1px solid var(--ink); }
.number { background: var(--graphite); color: var(--white); padding: 22px; }
.number b { display: block; font: 800 clamp(2.25rem, 4.6vw, 3.5rem)/1 var(--display); letter-spacing: -.02em; }
.number:nth-child(1) b { color: var(--blue); }
.number:nth-child(2) b { color: var(--blush); }
.number:nth-child(3) b { color: var(--yellow); }
.number:nth-child(4) b { color: var(--green); }
.number span { display: block; margin-top: 10px; font-size: .9375rem; line-height: 1.4; }

/* FAQ */
.faq { border-top: 2px solid var(--ink); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; font-weight: 600; font-size: 1.0625rem; line-height: 1.35; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font: 800 1.375rem/1 var(--display); flex: none; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-a { padding: 0 28px 18px 0; }
.faq-a p:last-child { margin-bottom: 0; }

/* Tools */
.tool { background: var(--white); border-radius: 6px; box-shadow: var(--shadow); padding: clamp(18px, 3vw, 28px); margin: 22px 0; }
.tool h2, .tool h3 { margin-top: 0; }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: 5px; }
.tool input[type=number], .tool input[type=search], .tool select, .pro-form input, .pro-form select, .pro-form textarea { display: block; width: 100%; min-height: 48px; padding: 10px 12px; font: 400 1rem var(--body); background: var(--white); color: var(--ink); border: 1px solid var(--steel); border-radius: 6px; }
.pro-form textarea { min-height: 130px; }
.pro-form .field-label { margin-top: 14px; }
.pro-form .btn { margin-top: 16px; }
.hp { position: absolute; left: -9999px; }
.form-note { font-size: .875rem; color: var(--muted); margin-top: 10px; }
.bar { display: flex; height: 44px; margin: 18px 0 6px; overflow: hidden; }
.bar i { display: block; transition: width .2s ease; }
#bar-you { background: var(--yellow); }
#bar-state { background: var(--pink); }
#bar-first { background: var(--blue); }
.out { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin-top: 14px; }
.out dt { font-size: .8125rem; color: var(--muted); }
.out dd { font: 800 1.5rem/1.15 var(--display); }
.out .total dd { font-size: 2.25rem; }
.fact-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.fact-list dt { font-size: .8125rem; color: var(--muted); }
.fact-list dd { font: 800 1.5rem/1.15 var(--display); }
.check-list { display: grid; gap: 10px; margin-bottom: 14px; }
.check-list label { display: flex; gap: 10px; align-items: flex-start; }
.check-list input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--orange); }
.check-out { font-weight: 600; }

/* Related, signup */
.related { padding: clamp(44px, 6vw, 72px) 0; background: var(--white); }
.signup { background: var(--blue); padding: clamp(48px, 7vw, 88px) 0; }
.signup-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.signup h2 { font-size: clamp(2.25rem, 5vw, 3.75rem); margin: 14px 0; }
.signup .form-note { color: var(--ink); }
.signup a { color: var(--ink); }
.signup-card { background: var(--white); border-radius: 6px; padding: clamp(16px, 2.4vw, 26px); box-shadow: var(--shadow); scroll-margin-top: 90px; }
.signup-embed { min-height: 320px; }
.signup-embed--todo { display: grid; align-content: center; gap: 6px; padding: 22px; border: 1px dashed var(--steel); }

.center-page { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 60px 0; }
.center-page .lede { margin: 18px auto 0; }
.center-page .ctas { justify-content: center; }
.center-page h1 { margin-top: 16px; }

/* Footer */
.site-foot { background: var(--graphite); color: var(--white); padding-bottom: 28px; font-size: .9375rem; }
.foot-blocks { display: grid; grid-template-columns: 50fr 30fr 17fr 3fr; height: 14px; margin-bottom: 48px; }
.foot-blocks i { display: block; }
.foot-blocks i:nth-child(1) { background: var(--blue); }
.foot-blocks i:nth-child(2) { background: var(--green); }
.foot-blocks i:nth-child(3) { background: var(--pink); }
.foot-blocks i:nth-child(4) { background: var(--yellow); }
.site-foot a { color: var(--white); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 32px; }
.foot-name { font-weight: 800; font-size: 1.5rem; line-height: 1.1; margin-bottom: 12px; }
.foot-name em { font-style: normal; font-weight: 600; }
.foot-disclaimer { color: #d5dadc; }
.foot-updated { margin-top: 12px; color: var(--steel); font-size: .875rem; }
.foot-h { font-weight: 600; margin-bottom: 10px; }
.foot-h a { color: var(--yellow); }
.foot-links { display: grid; gap: 7px; color: #d5dadc; }
.foot-links a { color: #d5dadc; }
.foot-legal { margin-top: 40px; padding-top: 14px; border-top: 1px solid #333b3d; font-size: .8125rem; color: var(--steel); }

@media (max-width: 1100px) {
  .nav { gap: 14px; }
  .nav a { font-size: .875rem; }
}
@media (max-width: 960px) {
  .nav, .head-cta { display: none; }
  .menu { display: block; }
  .hero-grid, .signup-inner { grid-template-columns: minmax(0, 1fr); }
  .article { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards, .cards.four { grid-template-columns: repeat(2, 1fr); }
  .numbers { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  .stack { max-width: 520px; }
}
@media (max-width: 620px) {
  body { font-size: 1rem; }
  .brand-name { font-size: 1rem; }
  .cards, .cards.four, .cards.two, .tool-grid, .toc ol { grid-template-columns: minmax(0, 1fr); }
  .out, .fact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phero::before { width: 28px; }
  .phero::after { right: 28px; width: 14px; }
  .phero .lede { padding-right: 34px; }
  .phero h1 { padding-right: 34px; }
  .ctas .btn { flex: 1 1 100%; }
  .foot-grid { gap: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
