/* Aging in Place 2026: State of the Industry - stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT@0,9..144,400..700,50;1,9..144,400..700,50&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --ink: #14161b; --ink-2: #454a55; --ink-3: #737a87; --hair: #e3e6eb; --hair-2: #d3d8e0;
  --paper: #f4f5f7; --surface: #ffffff; --wash: #eef1f6;
  --blueprint: #16306e; --blueprint-deep: #0f2454; --blueprint-line: rgba(255,255,255,0.12);
  --porch: #f6b34d; --porch-glow: rgba(246,179,77,0.55);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --font-display: 'Fraunces', 'Iowan Old Style', Charter, Georgia, serif;
  --font-ui: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Menlo, Consolas, monospace;
  --measure: 68ch; --page: 1120px; --radius: 6px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-ui); font-size: 17px; line-height: 1.6; font-feature-settings: 'kern', 'liga'; }
[hidden] { display: none !important; }
a { color: var(--blueprint); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--s1); }
:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
p { margin: 0 0 1em; max-width: var(--measure); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.12; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: clamp(30px, 3.6vw, 44px); }
h3 { font-size: clamp(21px, 2.2vw, 26px); font-weight: 500; }
h4 { font-family: var(--font-ui); font-weight: 600; font-size: 17px; }
strong { font-weight: 600; }
sup.ref { font-size: 11px; line-height: 0; vertical-align: super; font-family: var(--font-mono); margin-left: 2px; }
sup.ref a { text-decoration: none; color: var(--ink-3); }
sup.ref a:hover { color: var(--s1); }
.eyebrow { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.wrap { max-width: var(--page); margin: 0 auto; padding: 0 28px; }
@media (max-width: 640px) { .wrap { padding: 0 18px; } body { font-size: 16px; } }

/* ---------- hero ---------- */
.hero { background: var(--blueprint); color: #fff; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(var(--blueprint-line) 1px, transparent 1px), linear-gradient(90deg, var(--blueprint-line) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.25)); -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.25)); pointer-events: none; }
.hero .wrap { position: relative; padding-top: 56px; padding-bottom: 48px; }
.hero .eyebrow { color: rgba(255,255,255,0.72); }
.hero h1 { font-size: clamp(38px, 5.6vw, 72px); font-weight: 500; max-width: 15ch; margin: 18px 0 20px; font-variation-settings: 'SOFT' 50, 'opsz' 144; }
.hero h1 em { font-style: italic; color: var(--porch); }
.hero .dek { font-size: clamp(17px, 1.6vw, 20px); color: rgba(255,255,255,0.82); max-width: 58ch; margin: 0 0 40px; }
.hero-waffles { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin: 0 0 44px; }
@media (max-width: 760px) { .hero-waffles { grid-template-columns: 1fr; gap: 28px; } }
.waffle-card { display: grid; grid-template-columns: 200px 1fr; gap: 22px; align-items: center; }
@media (max-width: 460px) { .waffle-card { grid-template-columns: 1fr; } }
.waffle svg { width: 100%; height: auto; display: block; }
.waffle .house { fill: rgba(255,255,255,0.14); }
.waffle .house.lit { fill: var(--porch); filter: drop-shadow(0 0 3px var(--porch-glow)); animation: light-up 0.5s ease-out both; animation-delay: calc(var(--i) * 14ms + 250ms); }
@keyframes light-up { from { fill: rgba(255,255,255,0.14); filter: none; } to { fill: var(--porch); } }
.waffle-big { font-family: var(--font-display); font-size: clamp(54px, 6vw, 80px); line-height: 0.95; font-weight: 500; letter-spacing: -0.02em; font-variation-settings: 'SOFT' 50, 'opsz' 144; }
.waffle-big small { font-size: 0.42em; color: rgba(255,255,255,0.7); letter-spacing: 0; margin-left: 4px; }
.waffle-lbl { margin: 10px 0 0; font-size: 16px; color: rgba(255,255,255,0.86); max-width: 30ch; line-height: 1.4; }
.waffle-src { display: block; margin-top: 8px; font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,0.55); letter-spacing: 0.04em; }
.hero-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border-top: 1px solid rgba(255,255,255,0.2); }
.hero-strip .k { padding: 16px 18px 14px 0; border-right: 1px solid rgba(255,255,255,0.14); margin-right: 18px; }
.hero-strip .k:last-child { border-right: 0; }
.hero-strip .kv { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
.hero-strip .kl { font-size: 13px; color: rgba(255,255,255,0.72); margin-top: 4px; line-height: 1.3; }
.hero-meta { margin-top: 26px; font-family: var(--font-mono); font-size: 11.5px; color: rgba(255,255,255,0.6); letter-spacing: 0.06em; display: flex; gap: 24px; flex-wrap: wrap; }
.hero-meta a { color: var(--porch); text-decoration: underline; text-decoration-color: rgba(246,179,77,0.55); text-underline-offset: 3px; }
.hero-meta a:hover { color: #fff; }

/* ---------- sticky section nav ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(244,245,247,0.92); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--hair); }
.nav .wrap { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-top: 0; padding-bottom: 0; }
.nav .wrap::-webkit-scrollbar { display: none; }
.nav a { flex: 0 0 auto; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--ink-2); text-decoration: none; padding: 12px 10px; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--blueprint); }
.nav a.active { color: var(--blueprint); border-bottom-color: var(--blueprint); }
.nav a b { font-weight: 600; color: var(--ink-3); margin-right: 5px; }

/* ---------- sections ---------- */
.sec { padding: 64px 0 24px; border-top: 1px solid var(--hair-2); }
.sec:first-of-type { border-top: 0; }
.sec-head { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: start; margin-bottom: 28px; }
.sec-num { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); padding-top: 14px; letter-spacing: 0.08em; }
.sec-head .dek { font-size: 19px; color: var(--ink-2); max-width: 62ch; margin: 12px 0 0; line-height: 1.5; }
@media (max-width: 640px) { .sec { padding-top: 44px; } .sec-head { grid-template-columns: 1fr; gap: 4px; } .sec-num { padding-top: 0; } }
.lede { font-size: 19px; line-height: 1.55; }
.prose { max-width: var(--measure); }
.prose h3 { margin: 32px 0 10px; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin: 0 0 0.45em; }
.prose li::marker { color: var(--ink-3); }

/* findings list */
.findings { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; counter-reset: f; }
@media (max-width: 760px) { .findings { grid-template-columns: 1fr; } }
.findings li { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 18px 20px 18px 56px; position: relative; counter-increment: f; line-height: 1.5; }
.findings li::before { content: counter(f, decimal-leading-zero); position: absolute; left: 18px; top: 18px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.findings li b { display: block; font-weight: 600; color: var(--ink); margin-bottom: 4px; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 12px; margin: 8px 0 28px; }
.fig .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .tiles, .fig .tiles { grid-template-columns: 1fr; } }
.tile { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 16px 18px 14px; }
.tile .tl { font-size: 13px; color: var(--ink-3); line-height: 1.3; }
.tile .tv { font-size: 30px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.1; margin: 6px 0 4px; color: var(--ink); }
.tile .td { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.tile .td.up { color: #006300; }
.tile .td.down { color: #b42318; }

/* figures */
.fig { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 20px 22px 16px; margin: 0 0 22px; }
.fig-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.fig-n { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.1em; }
.fig-t { font-weight: 600; font-size: 17px; margin: 0; }
.fig-s { font-size: 14px; color: var(--ink-2); margin: 0 0 14px; max-width: 80ch; }
.fig-src { font-size: 12.5px; color: var(--ink-3); margin: 10px 0 0; line-height: 1.45; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 22px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.grid-2 .fig, .grid-3 .fig { margin: 0; }
.fig-row { margin-bottom: 22px; }

/* charts (engine hooks) */
.chart svg { display: block; overflow: visible; font-family: var(--font-ui); }
.chart .hit { outline: none; cursor: default; }
.chart .hit:focus-visible { stroke: var(--s1); stroke-width: 2; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; font-size: 13px; color: var(--ink-2); }
.chart-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.chart-table { margin-top: 10px; font-size: 13px; }
.chart-table summary { cursor: pointer; color: var(--ink-3); font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.chart-table table { border-collapse: collapse; width: 100%; margin-top: 8px; }
.chart-table th, .chart-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--hair); font-weight: 400; }
.chart-table th[scope=col] { font-weight: 600; color: var(--ink-2); }
.chart-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.chart-tip { position: absolute; z-index: 50; background: var(--ink); color: #fff; border-radius: 6px; padding: 9px 12px; font-size: 13px; line-height: 1.4; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,0.25); max-width: 300px; }
.tip-h { font-weight: 600; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-sw { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }
.tip-l { color: rgba(255,255,255,0.78); flex: 1; }
.tip-v { font-variant-numeric: tabular-nums; font-weight: 600; margin-left: 12px; }
.tip-n { color: rgba(255,255,255,0.7); font-size: 12px; margin-top: 5px; max-width: 260px; }
.donut-wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.donut-legend { display: grid; gap: 7px; font-size: 14px; min-width: 200px; flex: 1; }
.donut-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; }
.donut-row .dv { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); }
.chart-donut .seg { cursor: default; transition: opacity 0.15s; outline: none; }
.chart-donut .seg:focus-visible { stroke: var(--ink); stroke-width: 2; }

/* map */
.map-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.map-toolbar button { font: 500 12.5px var(--font-ui); padding: 7px 12px; border: 1px solid var(--hair-2); background: var(--surface); color: var(--ink-2); border-radius: 999px; cursor: pointer; }
.map-toolbar button:hover { border-color: var(--s1); color: var(--blueprint); }
.map-toolbar button[aria-pressed=true] { background: var(--blueprint); color: #fff; border-color: var(--blueprint); }
.map-wrap svg.usmap { width: 100%; height: auto; display: block; }
.usmap .state { cursor: default; outline: none; transition: fill-opacity 0.12s; }
.usmap .state:hover { fill-opacity: 0.85; }
.map-chips-label { font: 500 11.5px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); align-self: center; margin-right: 2px; }
.map-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--font-mono); padding: 4px 9px; border: 1px solid var(--hair-2); background: var(--surface); border-radius: 999px; color: var(--ink-2); cursor: default; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 0 0; font-size: 13px; color: var(--ink-2); }
.map-legend-title { font-weight: 600; color: var(--ink); margin-right: 4px; }
.map-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.map-note { font-size: 13px; color: var(--ink-3); margin: 8px 0 0; max-width: 90ch; }

/* data tables */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--hair); border-radius: var(--radius); background: var(--surface);
  background-image: linear-gradient(to right, var(--surface) 30%, rgba(255,255,255,0)), linear-gradient(to left, var(--surface) 30%, rgba(255,255,255,0)), radial-gradient(farthest-side at 0 50%, rgba(20,22,27,0.13), rgba(20,22,27,0)), radial-gradient(farthest-side at 100% 50%, rgba(20,22,27,0.13), rgba(20,22,27,0));
  background-position: left center, right center, left center, right center; background-repeat: no-repeat;
  background-size: 34px 100%, 34px 100%, 12px 100%, 12px 100%; background-attachment: local, local, scroll, scroll; }
.tbl-hint { font: 500 11.5px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin: 8px 0 0; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 14px; }
table.tbl th, table.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--hair); text-align: left; vertical-align: top; }
table.tbl thead th { position: sticky; top: 0; background: var(--wash); font-weight: 600; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
table.tbl th[data-key] { cursor: pointer; user-select: none; }
table.tbl th[data-key]::after { content: ' \2195'; color: var(--ink-3); font-size: 11px; }
table.tbl th[aria-sort=descending]::after { content: ' \2193'; color: var(--blueprint); }
table.tbl th[aria-sort=ascending]::after { content: ' \2191'; color: var(--blueprint); }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl tbody tr:hover { background: #f8f9fb; }
table.tbl tbody th { font-weight: 500; white-space: nowrap; }
table.tbl .rank { color: var(--ink-3); font-family: var(--font-mono); font-size: 12px; }
table.tbl .bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--s1); vertical-align: middle; margin-right: 8px; }
table.tbl td .tag { display: inline-block; font: 500 11px var(--font-mono); padding: 2px 7px; border-radius: 999px; background: var(--wash); color: var(--ink-2); letter-spacing: 0.03em; white-space: nowrap; }
table.tbl td .tag.hot { background: #fdeee6; color: #9a3a12; }
table.tbl td .tag.warn { background: #fff4d6; color: #7a5200; }
table.tbl td .tag.exit { background: #f1f1f3; color: #555; }
table.companies th, table.companies td { padding: 9px 10px; }
table.companies td:nth-child(2) { white-space: nowrap; }
table.companies td:nth-child(3) { min-width: 185px; }
table.companies td:nth-child(4) { min-width: 210px; }
table.companies td:nth-child(5) { min-width: 165px; color: var(--ink-2); }
table.companies td:last-child { width: 1%; }
table.states th, table.states td { padding: 8px 10px; }

/* callouts & timeline */
.callout { border-left: 3px solid var(--porch); background: var(--surface); padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; margin: 8px 0 24px; max-width: 78ch; }
.callout .eyebrow { margin-bottom: 6px; }
.callout p:last-child { margin-bottom: 0; }
.timeline { list-style: none; padding: 0; margin: 0 0 20px; border-left: 2px solid var(--hair-2); }
.timeline li { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 0 0 20px 22px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--blueprint); }
.timeline .when { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); padding-top: 2px; letter-spacing: 0.02em; }
.timeline .what b { display: block; font-weight: 600; margin-bottom: 2px; }
.timeline .what p { margin: 0; font-size: 15.5px; color: var(--ink-2); max-width: 78ch; }
@media (max-width: 640px) { .timeline li { grid-template-columns: 1fr; gap: 2px; } }

/* tech matrix & watchlist */
.matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 22px; }
.mx { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 18px 20px; }
.mx h4 { margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.mx h4 .sw { width: 10px; height: 10px; }
.mx .mx-who { font-size: 13.5px; color: var(--ink-2); margin: 0 0 8px; }
.mx p { font-size: 14.5px; margin: 0; color: var(--ink-2); }
.mx .mx-heat { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-top: 10px; }
.outlook { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 12px; }
.outlook li { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 16px 18px; display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: start; }
.outlook .conf { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; text-align: center; white-space: nowrap; }
.outlook .conf.high { background: #e4f4ea; color: #0b5d2a; }
.outlook .conf.med { background: #fff4d6; color: #7a5200; }
.outlook .conf.low { background: #f1f1f3; color: #555; }
.outlook b { display: block; margin-bottom: 3px; }
.outlook p { margin: 0; font-size: 15px; color: var(--ink-2); }
@media (max-width: 640px) { .outlook li { grid-template-columns: 1fr; gap: 8px; } }

/* sources */
.sources { font-size: 14px; columns: 2; column-gap: 32px; padding-left: 1.4em; margin: 0; }
.sources li { break-inside: avoid; margin: 0 0 8px; color: var(--ink-2); line-height: 1.45; }
.sources li::marker { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.sources a { word-break: break-word; }
@media (max-width: 760px) { .sources { columns: 1; } }
.method { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 22px; font-size: 15px; }
.method p { max-width: none; }
footer { padding: 28px 0 48px; color: var(--ink-3); font-size: 13px; border-top: 1px solid var(--hair-2); margin-top: 40px; }
footer p { max-width: none; }

/* print */
@media print {
  body { background: #fff; font-size: 12px; }
  .nav, .map-toolbar, .chart-table summary { display: none !important; }
  .chart-table { display: block; } .chart-table[open], .chart-table { } details.chart-table > table { display: table; }
  .hero { background: var(--blueprint) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .fig, .tile, .findings li, .outlook li, .mx { break-inside: avoid; border-color: #ccc; }
  .sec { padding-top: 28px; break-before: auto; }
  .waffle .house.lit { animation: none; fill: var(--porch); }
  a { color: inherit; text-decoration: none; }
  .sources { columns: 2; }
}
