/* Layout: navy masthead carrying the white CFS lockup; each page opens with a
   drawing-style "title block" (section, sheet, NMLS) beside the headline, then
   a single reading column with wide photo/figure breaks. Compliance notice is
   the footer's "general notes" sheet. */
:root {
  --navy: #3264a0;          /* masthead + footer ground: CFS logo blue (Mike chose option B 10/10) */
  --navy-ink: #e9eff6;      /* text on navy, both themes */
  --blue: #3264a0;          /* CFS blue: links, rules, focus */
  --brick: #a2382b;         /* legacy CFS red: Apply Now only */
  --brick-ink: #ffffff;
  --paper: #f5f7f9;         /* page ground, cool neutral biased to the blue */
  --surface: #ffffff;
  --ink: #1d2126;           /* logo near-black */
  --muted: #586370;
  --line: #d8dee6;
  --tint: #e8eef6;          /* pale blue wash for callouts */

  --display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --ui: "Archivo", "Segoe UI", Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: 2.25rem;
  --step-4: clamp(2.25rem, 5vw, 3.5rem);
  --measure: 68ch;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 4px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #234a7a; --navy-ink: #eef3f9; --blue: #86acdc; --brick: #d0624f; --brick-ink: #ffffff;
    --paper: #0f161d; --surface: #151f29; --ink: #e5e9ee; --muted: #9eabb9; --line: #263443; --tint: #182838;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy: #234a7a; --navy-ink: #eef3f9; --blue: #86acdc; --brick: #d0624f; --brick-ink: #ffffff;
  --paper: #0f161d; --surface: #151f29; --ink: #e5e9ee; --muted: #9eabb9; --line: #263443; --tint: #182838;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--step-0)/1.65 var(--body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--display); color: var(--ink); line-height: 1.12; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-4); font-weight: 800; font-stretch: 112%; letter-spacing: -0.01em; }
h2 { font-size: var(--step-3); font-weight: 750; font-stretch: 108%; }
h3 { font-size: var(--step-1); font-weight: 700; font-stretch: 100%; }
p { margin: 0; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 20; }
.skip:focus { left: 1rem; }
.label { font: 600 var(--step--1)/1.2 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- masthead ---------- */
.util { background: var(--navy); color: var(--navy-ink); font: 500 .8125rem/1 var(--ui); border-bottom: 1px solid rgba(255,255,255,.12); }
.util .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between; padding-block: .55rem; }
.util a { color: var(--navy-ink); text-decoration: none; opacity: .9; }
.util a:hover { opacity: 1; text-decoration: underline; }
.util ul { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.util .phone { font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; }

.mast { background: var(--navy); color: var(--navy-ink); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.mast .wrap { display: flex; align-items: center; gap: 1.5rem; padding-block: .85rem; }
.brand { display: block; flex: 0 0 auto; }
.brand img { width: clamp(210px, 26vw, 300px); }
.nav { margin-left: auto; display: flex; align-items: center; gap: .25rem; font-family: var(--ui); }
.nav > ul { display: flex; list-style: none; margin: 0; padding: 0; gap: .15rem; }
.nav li { position: relative; }
.nav a.top { display: block; padding: .6rem .8rem; color: var(--navy-ink); text-decoration: none; font-weight: 600; font-size: .95rem; letter-spacing: .02em; border-radius: var(--radius); }
.nav a.top:hover, .nav li:focus-within > a.top { background: rgba(255,255,255,.08); }
.nav a.top[aria-current="true"] { box-shadow: inset 0 -3px 0 var(--brick); }
.nav .sub { position: absolute; left: 0; top: 100%; min-width: 15rem; list-style: none; margin: 0; padding: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(0,0,0,.18); display: none; }
.nav li:hover > .sub, .nav li:focus-within > .sub { display: block; }
.nav .sub a { display: block; padding: .5rem .7rem; color: var(--ink); text-decoration: none; font-size: .925rem; border-radius: 3px; }
.nav .sub a:hover, .nav .sub a[aria-current="page"] { background: var(--tint); color: var(--blue); }
.btn { display: inline-flex; align-items: center; gap: .5rem; font: 700 .95rem/1 var(--ui); letter-spacing: .04em; text-transform: uppercase; text-decoration: none; padding: .85rem 1.2rem; border-radius: var(--radius); border: 2px solid transparent; cursor: pointer; }
.btn-apply { background: var(--brick); color: var(--brick-ink); }
.btn-apply:hover { filter: brightness(1.08); }
.btn-line { border-color: currentColor; color: var(--blue); background: transparent; }
.btn-line:hover { background: var(--tint); }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.35); color: var(--navy-ink); font: 600 .9rem/1 var(--ui); padding: .6rem .8rem; border-radius: var(--radius); }

@media (max-width: 960px) {
  .menu-toggle { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--navy); padding: .5rem var(--gutter) 1.25rem; flex-direction: column; align-items: stretch; max-height: calc(100vh - 5rem); overflow-y: auto; }
  .nav.open { display: flex; }
  .nav > ul { flex-direction: column; }
  .nav .sub { position: static; display: block; background: transparent; border: 0; box-shadow: none; padding: 0 0 .5rem .8rem; }
  .nav .sub a { color: var(--navy-ink); opacity: .85; }
  .nav .sub a:hover, .nav .sub a[aria-current="page"] { background: rgba(255,255,255,.08); color: var(--navy-ink); }
  .nav .btn-apply { margin-top: .75rem; justify-content: center; }
  .util .hide-sm { display: none; }
}

/* ---------- page head with title block ---------- */
.pagehead { background: var(--surface); border-bottom: 1px solid var(--line); }
.pagehead .wrap { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 2rem 3rem; align-items: end; padding-block: clamp(2rem, 5vw, 3.5rem); }
.pagehead .eyebrow { margin-bottom: .75rem; color: var(--brick); }
.pagehead .lede { margin-top: 1rem; font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 60ch; }
.titleblock { border: 1.5px solid var(--ink); font: 500 .75rem/1.25 var(--ui); text-transform: uppercase; letter-spacing: .06em; display: grid; grid-template-columns: 1fr 1fr; }
.titleblock div { padding: .5rem .6rem; border-top: 1px solid var(--ink); min-width: 0; }
.titleblock div:nth-child(-n+2) { border-top: 0; }
.titleblock div:nth-child(odd) { border-right: 1px solid var(--ink); }
.titleblock .wide { grid-column: 1 / -1; border-right: 0 !important; }
.titleblock span { display: block; color: var(--muted); font-size: .625rem; margin-bottom: .2rem; }
.titleblock b { font-weight: 700; color: var(--ink); font-size: .8125rem; overflow-wrap: anywhere; }
@media (max-width: 760px) { .pagehead .wrap { grid-template-columns: minmax(0, 1fr); } .titleblock { max-width: 22rem; } }

/* ---------- body content ---------- */
main { display: block; }
.section { padding-block: clamp(2.25rem, 6vw, 4rem); }
.section + .section { border-top: 1px solid var(--line); }
.section.alt { background: var(--surface); }
.prose { max-width: var(--measure); display: grid; gap: 1.1rem; }
.prose h2 { margin-top: 1.25rem; font-size: var(--step-2); }
.prose h3 { margin-top: .75rem; }
.prose ul, .prose ol { margin: 0; padding-left: 1.3rem; display: grid; gap: .45rem; }
.prose li::marker { color: var(--blue); }
.prose strong { font-weight: 650; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } }
.figure { margin: 0; display: grid; gap: .5rem; }
.figure img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); background: var(--line); }
.figure figcaption { font: 500 var(--step--1)/1.4 var(--ui); color: var(--muted); }
.callout { background: var(--tint); border-left: 4px solid var(--blue); padding: 1.1rem 1.25rem; border-radius: 0 var(--radius) var(--radius) 0; display: grid; gap: .6rem; }
.callout .label { color: var(--blue); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1.25rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; display: grid; gap: .75rem; align-content: start; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--blue); }
.card .more { font: 700 .875rem/1 var(--ui); letter-spacing: .04em; text-transform: uppercase; text-decoration: none; }

/* home hero */
.hero { position: relative; background: var(--navy); color: var(--navy-ink); overflow: hidden; }
.hero picture, .hero > img { position: absolute; inset: 0; }
.hero > img { width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,26,41,.92) 0%, rgba(8,26,41,.72) 45%, rgba(8,26,41,.15) 100%); }
.hero .wrap { position: relative; z-index: 1; padding-block: clamp(3.5rem, 10vw, 7.5rem); display: grid; gap: 1.25rem; }
.hero h1 { color: #fff; max-width: 15ch; font-size: clamp(2.5rem, 6.4vw, 4.6rem); }
.hero p { max-width: 46ch; font-size: var(--step-1); line-height: 1.5; color: #dbe6f1; }
.hero .label { color: #b9cde3; }
.hero .btn-line { color: #fff; }
.hero .btn-line:hover { background: rgba(255,255,255,.1); }
.hero .credit { position: absolute; z-index: 1; right: var(--gutter); bottom: .75rem; font: 500 .75rem/1.2 var(--ui); color: #c9d6e3; }
/* Narrow screens: the photo sits above the headline at full strength instead of behind it. */
@media (max-width: 700px) {
  .hero { display: flex; flex-direction: column; }
  .hero > img { order: 0; }
  .hero .credit { order: 1; }
  .hero .wrap { order: 2; }
  .hero::after { display: none; }
  .hero > img { position: relative; height: auto; aspect-ratio: 3 / 2; }
  .hero .wrap { padding-block: 1.75rem 2.25rem; }
  .hero .credit { position: static; display: block; padding: .5rem var(--gutter) 0; }
}

/* numbered build sequence (process is a real order) */
.seq { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 0; border-top: 2px solid var(--ink); }
.seq li { padding: 1rem 1rem 1.25rem 0; border-bottom: 1px solid var(--line); display: grid; gap: .35rem; align-content: start; }
.seq .n { font: 800 .8125rem/1 var(--ui); letter-spacing: .1em; color: var(--brick); }
.seq h3 { font-size: 1.05rem; }
.seq p { font-size: .95rem; color: var(--muted); line-height: 1.5; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: s; }
.steps > li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 15rem); gap: 1.5rem; padding-block: 1.75rem; border-top: 1px solid var(--line); align-items: start; }
.steps > li:first-child { border-top: 2px solid var(--ink); }
.steps .n { font: 800 2.25rem/1 var(--display); font-stretch: 115%; color: var(--blue); font-variant-numeric: tabular-nums; }
.steps .body { display: grid; gap: .6rem; max-width: 60ch; }
.steps img { border-radius: var(--radius); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
@media (max-width: 760px) { .steps > li { grid-template-columns: 3rem minmax(0, 1fr); } .steps img { grid-column: 2; } }

/* lists of documents */
.doclist { columns: 2 18rem; column-gap: 2.5rem; list-style: none; margin: 0; padding: 0; }
.doclist li { break-inside: avoid; padding: .55rem 0 .55rem 1.6rem; border-bottom: 1px solid var(--line); position: relative; line-height: 1.4; }
.doclist li::before { content: ""; position: absolute; left: .1rem; top: .85rem; width: .75rem; height: .75rem; border: 1.5px solid var(--blue); border-radius: 2px; }
.docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: .5rem 2rem; list-style: none; margin: 0; padding: 0; }
.docs a { display: flex; gap: .75rem; align-items: baseline; padding: .7rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-family: var(--ui); font-weight: 500; }
.docs a:hover { color: var(--blue); }
.docs .ft { flex: 0 0 auto; font: 700 .6875rem/1 var(--ui); letter-spacing: .06em; color: var(--brick); border: 1px solid currentColor; padding: .2rem .3rem; border-radius: 2px; }

/* FAQ + glossary */
.faq { display: grid; gap: 0; max-width: var(--measure); }
.faq details { border-top: 1px solid var(--line); padding-block: .25rem; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 1rem 2rem 1rem 0; font: 650 1.1rem/1.35 var(--display); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: .85rem; font: 400 1.5rem/1 var(--ui); color: var(--blue); }
.faq details[open] summary::after { content: "\2212"; }
.faq .a { padding: 0 0 1.25rem; display: grid; gap: .9rem; }
.az { display: flex; flex-wrap: wrap; gap: .25rem; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 4.6rem); background: var(--paper); padding-block: .75rem; z-index: 2; border-bottom: 1px solid var(--line); }
.az a { font: 700 .875rem/1 var(--ui); padding: .45rem .55rem; text-decoration: none; border-radius: 3px; }
.az a:hover { background: var(--tint); }
.terms { display: grid; gap: 0; max-width: var(--measure); }
.terms h2 { font-size: var(--step-3); color: var(--blue); padding-top: 1.5rem; scroll-margin-top: 9rem; }
.terms dl { margin: 0; }
.terms dt { font: 700 1.05rem/1.3 var(--display); margin-top: 1.1rem; scroll-margin-top: 9rem; }
.terms dd { margin: .3rem 0 0; }

/* gallery */
.projects { display: grid; gap: clamp(2.5rem, 6vw, 4rem); }
.project { display: grid; gap: 1rem; }
.project header { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: .5rem; }
.project h2 { font-size: var(--step-2); }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(16rem, 30%); gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; }
.strip a { scroll-snap-align: start; display: block; }
.strip img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); background: var(--line); }
@media (max-width: 600px) { .strip { grid-auto-columns: 82%; } }
.teaser { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.teaser figure { margin: 0; display: grid; gap: .4rem; }
.teaser img { aspect-ratio: 1; object-fit: cover; width: 100%; border-radius: var(--radius); }
.teaser figcaption { font: 500 .8125rem/1.3 var(--ui); color: var(--muted); }
@media (max-width: 760px) { .teaser { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* testimonials */
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1.25rem; }
.quotes blockquote { margin: 0; padding: 1.25rem 0 0; border-top: 2px solid var(--blue); display: grid; gap: .6rem; }
.quotes p { font-size: 1.1rem; line-height: 1.5; }
.quotes cite { font: 600 var(--step--1)/1.3 var(--ui); font-style: normal; color: var(--muted); }

/* forms */
.form { display: grid; gap: 1.1rem; max-width: 46rem; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin: 0; display: grid; gap: 1rem; background: var(--surface); }
.form legend { font: 700 var(--step--1)/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; padding-inline: .4rem; color: var(--blue); }
.field { display: grid; gap: .35rem; }
.field label, .field .q { font: 600 .95rem/1.35 var(--ui); }
.field .req { color: var(--brick); }
.form input[type=text], .form input[type=email], .form input[type=tel], .form select, .form textarea { width: 100%; font: 400 1rem/1.4 var(--ui); padding: .65rem .75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); }
.form textarea { min-height: 7rem; resize: vertical; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-family: var(--ui); }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.form .note { font: 500 .875rem/1.45 var(--ui); color: var(--muted); }
.form .status { font: 600 .95rem/1.4 var(--ui); color: var(--blue); }
.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.tabs button { font: 700 .9rem/1 var(--ui); letter-spacing: .04em; text-transform: uppercase; padding: .8rem 1rem; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius); cursor: pointer; }
.tabs button[aria-selected="true"] { border-color: var(--blue); color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); }

.broker-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .5rem 2rem; list-style: none; padding: 0; margin: 0; }
.broker-list a { display: block; padding: .8rem 0; border-bottom: 1px solid var(--line); font: 600 1rem/1.3 var(--ui); text-decoration: none; }
.draft-note { background: var(--tint); border: 1px dashed var(--blue); border-radius: var(--radius); padding: 1rem 1.25rem; font: 500 .9375rem/1.5 var(--ui); display: grid; gap: .4rem; }
.draft-note b { color: var(--brick); }

/* ---------- footer ---------- */
.foot { background: var(--navy); color: var(--navy-ink); font: 400 .875rem/1.55 var(--ui); margin-top: 0; }
.foot a { color: var(--navy-ink); }
.foot .top { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 2rem; padding-block: 3rem 2rem; }
.foot h2 { font: 700 .75rem/1 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: #dfe8f2; margin-bottom: .9rem; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.foot ul a { text-decoration: none; opacity: .9; }
.foot ul a:hover { text-decoration: underline; opacity: 1; }
.foot .addr { display: grid; gap: .3rem; font-style: normal; }
.foot .addr img { width: 220px; margin-bottom: .75rem; }
.foot .notes { border-top: 1px solid rgba(255,255,255,.25); padding-block: 1.75rem 2.25rem; display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 1.5rem; font-size: .78rem; line-height: 1.6; color: #eef3f9; }
.foot .notes p + p { margin-top: .75rem; }
.foot .ehl { width: 4.5rem; background: #fff; padding: .35rem; border-radius: 3px; }
.foot .legal { border-top: 1px solid rgba(255,255,255,.25); padding-block: 1rem 1.5rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; font-size: .8rem; color: #e3ebf4; }
@media (max-width: 860px) { .foot .top { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot .top > :first-child { grid-column: 1 / -1; } }
@media (max-width: 520px) { .foot .notes { grid-template-columns: minmax(0, 1fr); } }

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