/* Theme follows the City's official website (canoncity.org): white header with the City seal, navy and
   mid-blue sections, white rounded cards, pill buttons, purple accents, Poppins throughout.
   The seal is the City's own SVG; the mountain-ridge and contour art in img/ is original (scripts/art).
   Poppins is self-hosted (SIL OFL, see fonts/), so pages make no third-party requests. */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/poppins-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: italic; font-weight: 400; font-display: swap; src: url(../fonts/poppins-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/poppins-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/poppins-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/poppins-latin-700-normal.woff2) format("woff2"); }

:root {
  --navy: #304b6f;
  --navy-dark: #22364f;
  --blue: #4677b1;
  --blue-soft: #dfeaf6;
  --sky: #cee9f9;
  --sky-light: #eaf7fd;
  --purple: #4e2e84;
  --purple-soft: #f0ebf7;
  --gold: #deb408;
  --ink: #383838;
  --muted: #5b6470;
  --line: #d3dde8;
  --field: #8493a6;
  --left: var(--blue);
  --right: var(--purple);
  --shadow: 0 4px 18px rgba(34, 54, 79, 0.12);
  --shadow-up: 0 10px 28px rgba(34, 54, 79, 0.28);
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 40px);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--sky-light);
  line-height: 1.6;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 17px; min-height: 100vh; display: flex; flex-direction: column; background: var(--sky-light); }
body.home { background: var(--blue); }
body > main { flex: 1 0 auto; width: 100%; }
strong, b { font-weight: 600; }
a { color: var(--purple); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.band :focus-visible, .site-footer :focus-visible, .demo-banner :focus-visible { outline-color: #fff; }
.choice:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }

h1, h2 { font-weight: 700; color: var(--navy); text-transform: uppercase; line-height: 1.15; letter-spacing: 0.01em; }
h1 { font-size: clamp(26px, 4.6vw, 34px); margin: 14px 0 6px; }
h2 { font-size: clamp(21px, 3.4vw, 25px); margin: 28px 0 10px; }
h3 { font-weight: 600; color: var(--navy); }
.eyebrow { margin: 0; font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--purple); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: 15px; color: var(--muted); }

/* Demo banner and header */
.demo-banner { background: var(--navy-dark); color: #fff; text-align: center; padding: 8px 16px; font-size: 14px; font-weight: 500; line-height: 1.45; }
.site-header { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 20px; padding: 12px var(--gutter); background: #fff; box-shadow: 0 2px 14px rgba(34, 54, 79, 0.16); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); }
.brand:hover { color: var(--navy); }
.brand-seal { display: block; width: 64px; height: auto; flex: none; }
.brand-name { display: flex; flex-direction: column; font-weight: 700; text-transform: uppercase; line-height: 1.05; }
.brand-city { font-size: 25px; letter-spacing: 0.01em; }
.brand-state { font-size: 14.5px; letter-spacing: 0.02em; margin-top: 2px; }
.brand-sub { margin-left: 6px; padding-left: 18px; border-left: 2px solid var(--line); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--purple); line-height: 1.3; }
/* Language switch: one pill with two segments. */
.lang { display: flex; gap: 2px; padding: 3px; border: 2px solid var(--navy); border-radius: 999px; background: #fff; }
.lang button { min-height: 38px; padding: 4px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--navy); font: inherit; font-weight: 600; font-size: 14px; letter-spacing: 0; text-transform: none; box-shadow: none; }
.lang button:hover { background: var(--sky-light); color: var(--navy); }
.lang button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.lang-note { margin: 0; padding: 12px var(--gutter); background: var(--purple-soft); color: var(--ink); border-bottom: 3px solid var(--purple); }
.sheet .lang-note { margin: 0 0 8px; padding: 12px 16px; border: 0; border-left: 4px solid var(--purple); border-radius: 8px; }

/* Mountain ridges (original art) */
.ridges { height: clamp(110px, 15vw, 240px); background: bottom center / cover no-repeat; }
.hero .ridges { background-image: url(../img/ridges-hero.svg); }
.site-footer .ridges { height: clamp(90px, 11vw, 190px); background-image: url(../img/ridges-footer.svg); }

/* Landing page */
.hero { background: linear-gradient(180deg, #fff 0%, var(--sky-light) 40%, var(--sky) 100%); text-align: center; }
.hero-inner { max-width: 900px; margin: 0 auto; padding: clamp(36px, 6vw, 64px) var(--gutter) 8px; }
.peak { display: block; width: 66px; height: 30px; margin: 0 auto 10px; color: var(--navy); }
.hero h1 { font-size: clamp(42px, 8.5vw, 84px); line-height: 1.02; margin: 10px 0 18px; letter-spacing: 0; }
.lead { font-size: clamp(17px, 2.1vw, 19px); line-height: 1.65; margin: 0 auto; max-width: 760px; }
.band { position: relative; margin-top: -1px; background: var(--blue) url(../img/topo-lines.svg) center top / 1600px auto repeat; color: #fff; padding: 8px var(--gutter) clamp(36px, 5vw, 56px); }
.band-inner { max-width: 1080px; margin: 0 auto; }
.about { background: #fff; color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-up); padding: clamp(20px, 3vw, 30px) clamp(20px, 3.4vw, 36px); }
.about h2 { margin: 0 0 12px; font-size: 19px; letter-spacing: 0.06em; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 36px; }
.facts li { position: relative; padding-left: 24px; }
.facts li::before { content: ""; position: absolute; left: 3px; top: 0.62em; width: 9px; height: 9px; border-radius: 50%; background: var(--purple); }
.band-title { color: #fff; text-align: center; margin: clamp(34px, 5vw, 52px) 0 20px; font-size: clamp(24px, 4vw, 34px); }
.band-title .peak { color: #fff; }
.band .small { color: #fff; text-align: center; margin: 8px 0 0; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 0 0 22px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 26px 26px 24px; border-radius: var(--radius); background: #fff; color: var(--ink); text-decoration: none; box-shadow: var(--shadow-up); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.choice:hover { color: var(--ink); transform: translateY(-3px); box-shadow: 0 16px 36px rgba(20, 32, 50, 0.34); }
.choice-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--sky); color: var(--navy); margin-bottom: 4px; }
.choice-icon svg { width: 36px; height: 36px; }
.choice-employer .choice-icon { background: var(--purple-soft); color: var(--purple); }
.choice-title { font-size: clamp(20px, 2.4vw, 23px); font-weight: 700; color: var(--navy); line-height: 1.3; }
.choice-sub { line-height: 1.5; }
.choice-time { font-size: 13.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--purple); }
.choice-go { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.choice-go::after { content: "\2192"; font-size: 1.15em; line-height: 1; }
.choice-employer .choice-go { background: var(--purple); }
.choice:hover .choice-go { background: var(--blue); }
.choice-employer:hover .choice-go { background: #6a46a8; }
@media (prefers-reduced-motion: reduce) { .choice { transition: none; } .choice:hover { transform: none; } }

/* Survey: one white sheet on the light-sky page */
.page { width: 100%; max-width: 880px; margin: 0 auto; padding: 24px var(--gutter) 40px; }
.sheet { max-width: 880px; margin: clamp(16px, 3vw, 36px) auto clamp(28px, 4vw, 48px); width: calc(100% - 2 * clamp(10px, 3vw, 32px)); padding: clamp(20px, 3.5vw, 40px) clamp(18px, 4vw, 48px) clamp(18px, 3vw, 32px); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.survey-name { margin: 0; font-weight: 600; font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--purple); }
.progress { display: flex; align-items: center; gap: 14px; margin: 10px 0 2px; font-size: 13.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.progress .bar { flex: 1; height: 10px; background: var(--blue-soft); border-radius: 999px; overflow: hidden; }
.progress .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--navy), var(--blue)); }
.purpose { color: var(--muted); font-style: italic; margin: 0 0 10px; }
.intro { background: var(--sky-light); border-left: 4px solid var(--blue); padding: 14px 18px; border-radius: 8px; margin: 14px 0 6px; }

.question { border: 0; border-top: 1px solid var(--line); margin: 0 0 26px; padding: 22px 0 0; min-width: 0; }
/* Floating the legend keeps it inside the fieldset, below the divider line, instead of straddling it. */
.question > legend { float: left; width: 100%; margin-bottom: 6px; }
.question > legend ~ * { clear: both; }
.question legend, .grid-title, .text-label { padding: 0; font-weight: 600; font-size: 18px; line-height: 1.45; color: var(--navy); }
.qnum { color: var(--purple); font-weight: 700; }
.text-label { display: block; margin-bottom: 8px; }
.cond { font-style: italic; font-weight: 400; color: var(--muted); }
.help { color: var(--muted); margin: 4px 0 8px; font-size: 15.5px; }
.lead-in { margin: 6px 0; }
.options { display: grid; gap: 8px; margin-top: 10px; }
.option { display: flex; align-items: flex-start; gap: 12px; min-height: 50px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; transition: border-color 0.1s ease, background-color 0.1s ease; }
.option:hover { border-color: var(--blue); background: #f7fbfe; }
.option:has(input:checked) { border-color: var(--navy); background: var(--sky-light); box-shadow: inset 4px 0 0 var(--blue); }
.option input { flex: none; width: 21px; height: 21px; margin: 2px 0 0; accent-color: var(--navy); }
.option input:disabled + label { color: #8a8a8a; }
.option label { flex: 1; cursor: pointer; line-height: 1.5; }
.amount { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.amount label { width: 100%; }
.amount input { width: 180px; font: inherit; font-size: 17px; padding: 10px 14px; border: 1.5px solid var(--field); border-radius: 10px; }
.dollar { font-weight: 600; color: var(--navy); }
input[type="text"], input[type="email"], textarea { width: 100%; font: inherit; font-size: 17px; padding: 10px 14px; border: 1.5px solid var(--field); border-radius: 10px; background: #fff; color: var(--ink); }
input[type="text"]:focus, input[type="email"]:focus, textarea:focus, .amount input:focus { border-color: var(--navy); }

button { min-height: 48px; padding: 11px 28px; border: 2px solid var(--navy); border-radius: 999px; background: var(--navy); color: #fff; font: inherit; font-weight: 600; font-size: 16px; line-height: 1.3; cursor: pointer; box-shadow: 0 2px 8px rgba(34, 54, 79, 0.18); }
button:hover { background: var(--purple); border-color: var(--purple); }
button.secondary { background: #fff; color: var(--navy); }
button.secondary:hover { background: var(--sky-light); border-color: var(--navy); color: var(--navy); }
button.link { min-height: 0; padding: 4px 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--purple); font-weight: 500; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
button.link:hover { background: none; color: var(--navy); }
.nav { display: flex; justify-content: space-between; gap: 12px; margin: 30px 0 6px; padding-top: 22px; border-top: 1px solid var(--line); }
.nav button:only-child { margin-left: auto; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.grid .grid-row { margin: 12px 0; padding: 8px 14px 14px; border: 1.5px solid var(--line); border-radius: 10px; }
.grid .grid-row legend { padding: 0 6px; font-weight: 600; font-size: 16px; color: var(--navy); }
.grid-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
@media (max-width: 640px) { .grid-options { grid-template-columns: 1fr 1fr; } }

.contact { display: grid; gap: 10px; margin-top: 30px; padding: 20px; border-radius: 12px; background: var(--sky-light); }
.contact h2 { margin: 0; }
.contact button { justify-self: start; }

/* Dashboard */
.dash { max-width: 1240px; margin: 0 auto; padding: 28px var(--gutter) 44px; }
.dash-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: end; justify-content: space-between; }
.dash-head h1 { margin-top: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; }
.filters label { display: grid; gap: 2px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--navy); }
.filters select { min-height: 44px; padding: 6px 10px; border: 1.5px solid var(--field); border-radius: 10px; background: #fff; font: inherit; font-size: 15.5px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 16px; }
@media (max-width: 900px) { .panels { grid-template-columns: 1fr; } }
.panel { padding: 16px 18px; border-top: 6px solid var(--left); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.panel.right { border-top-color: var(--right); }
.panel h2 { margin: 4px 0 14px; }
.card { margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card .note { margin: 0 0 8px; font-size: 13.5px; color: var(--muted); }
.kpis { display: flex; flex-wrap: wrap; gap: 10px; }
.kpi { min-width: 120px; padding: 8px 14px; border-radius: 10px; background: var(--sky-light); font-size: 14px; }
.panel.right .kpi { background: var(--purple-soft); }
.kpi b { display: block; font-size: 28px; font-weight: 700; line-height: 1.2; color: var(--navy); }
.bars { display: grid; gap: 6px; }
.barrow { display: grid; grid-template-columns: minmax(120px, 42%) 1fr 52px; gap: 8px; align-items: center; font-size: 14px; }
.barrow .track { height: 14px; border-radius: 999px; background: var(--blue-soft); overflow: hidden; }
.barrow .val { height: 100%; border-radius: 999px; background: var(--left); }
.right .barrow .val, .val.r { background: var(--right); }
.barrow .num { text-align: right; font-variant-numeric: tabular-nums; }
.pair .track { height: 9px; }
.pair-tracks { display: grid; gap: 2px; }
.legend { display: flex; gap: 14px; margin-bottom: 6px; font-size: 13.5px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: var(--left); }
.legend span.r::before { background: var(--right); }
.diverge { display: grid; grid-template-columns: minmax(120px, 42%) 1fr 52px; gap: 8px; align-items: center; font-size: 14px; }
.diverge .axis { position: relative; height: 14px; border-radius: 3px; background: var(--blue-soft); }
.diverge .axis::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--muted); }
.diverge .pos, .diverge .neg { position: absolute; top: 0; bottom: 0; }
.diverge .pos { left: 50%; background: var(--left); }
.diverge .neg { right: 50%; background: #9aa7b8; }
.compare { margin-top: 22px; padding: 16px 18px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.compare h2 { margin-top: 4px; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .compare-grid { grid-template-columns: 1fr; } }
.suggestive { color: #7a5200; font-weight: 600; }
.hidden-small { color: var(--muted); font-style: italic; font-size: 14px; }

/* Footer */
.site-footer { margin-top: auto; }
.footer-inner { background: var(--navy); color: var(--sky); text-align: center; padding: 8px var(--gutter) 40px; }
.footer-seal { display: block; width: 76px; height: auto; margin: 0 auto 16px; }
.site-footer p { margin: 0; }
.credit-label { font-weight: 600; font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.1em; text-wrap: balance; }
.site-footer .credit-firms { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 0.35em; margin-top: 8px; font-weight: 700; font-size: clamp(21px, 3.4vw, 30px); line-height: 1.25; text-transform: uppercase; color: #fff; }
.credit-firms .amp { color: var(--gold); }
.site-footer a { color: #fff; }

/* Phones */
/* Below 720px the "Housing Survey" label stays for screen readers only, so the language switch fits beside the logo. */
@media (max-width: 720px) {
  .brand-sub { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; padding: 0; border: 0; }
}
@media (max-width: 760px) {
  .facts { grid-template-columns: 1fr; }
  .choices { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .site-header { padding-top: 10px; padding-bottom: 10px; }
  .brand { gap: 9px; }
  .brand-seal { width: 50px; }
  .brand-city { font-size: 19px; }
  .brand-state { font-size: 11.5px; }
  .site-header { column-gap: 10px; }
  .lang button { min-height: 34px; padding: 2px 10px; font-size: 13px; }
  .question legend, .grid-title, .text-label { font-size: 17px; }
  .choice { padding: 22px 20px 20px; }
  .credit-label { font-size: 12px; letter-spacing: 0.06em; }
}
@media (max-width: 400px) {
  .site-header { padding-left: 12px; padding-right: 12px; }
  .brand { gap: 7px; }
  .brand-seal { width: 42px; }
  .brand-city { font-size: 16.5px; }
  .brand-state { font-size: 10.5px; }
  .lang { padding: 2px; }
  .lang button { padding: 2px 9px; font-size: 12.5px; }
}
