/* ==========================================================================
   Massachusetts Capital Mortgage Corp. — "The Mortgage Workshop"
   Tokens -> base -> layout -> components -> pages -> utilities
   ========================================================================== */

:root {
  color-scheme: light;

  /* Neutrals: warm paper, green-black ink */
  --paper: #f6f2ea;
  --paper-2: #ece5d7;
  --card: #fffdf8;
  --ink: #16211c;
  --ink-2: #33403a;
  --muted: #59635e;
  --line: #dcd3c3;
  --line-2: #c4b8a3;

  /* Brand */
  --forest: #1e4d33;
  --forest-2: #2b6644;
  --forest-tint: #e2ebe2;
  --ember: #c2410c;
  --ember-2: #9a3412;
  --ember-glow: #f0703a;
  --ember-tint: #fbeadf;
  --brass: #b08433;
  --blueprint: #14304a;
  --blueprint-2: #1b3d5c;

  /* On dark */
  --on-dark: #f3eee4;
  --on-dark-muted: #b8c1ba;
  --focus: #2459c9;

  /* Type */
  --f-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Shape & depth */
  --r-sm: 4px;
  --r: 8px;
  --r-lg: 14px;
  --shadow-sm: 0 1px 0 rgba(22, 33, 28, .06), 0 2px 6px -2px rgba(22, 33, 28, .12);
  --shadow: 0 1px 0 rgba(22, 33, 28, .05), 0 18px 40px -22px rgba(22, 33, 28, .45);

  /* Space */
  --gutter: 16px;
  --section: clamp(56px, 4rem + 3vw, 112px);
  --header-h: 76px;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; } }

/* Larger-text mode (replaces the old "visually impaired version" plugin) */
html.is-large { font-size: 118.75%; }
html.is-large { --muted: #3d4742; --line: #b9ad98; }

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font: 400 1.0625rem/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--forest); text-decoration-thickness: 1px; text-underline-offset: .2em; transition: color .2s var(--ease); }
a:hover { color: var(--ember-2); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
::selection { background: #f6c8b0; color: var(--ink); }

h1, h2, h3, h4 { font-family: var(--f-display); color: var(--ink); margin: 0 0 .5em; font-optical-sizing: auto; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 1.4rem + 3.6vw, 4.1rem); line-height: 1.03; font-weight: 700; letter-spacing: -.022em; }
h2 { font-size: clamp(1.8rem, 1.25rem + 2vw, 2.8rem); line-height: 1.08; font-weight: 650; letter-spacing: -.018em; }
h3 { font-size: clamp(1.2rem, 1.1rem + .4vw, 1.4rem); line-height: 1.25; font-weight: 620; letter-spacing: -.008em; }
h4 { font-size: 1.1rem; font-weight: 620; }
h1 em, h2 em, h3 em { font-style: italic; font-weight: inherit; color: var(--ember); }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li + li { margin-top: .35em; }
strong { color: var(--ink); font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
small { font-size: .875rem; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--on-dark); padding: 12px 16px; border-radius: var(--r); font-weight: 600; }
.skip:focus { top: 12px; color: var(--on-dark); }

.icon { width: 1.25em; height: 1.25em; flex: none; }
.icon--xs { width: .9em; height: .9em; display: inline-block; vertical-align: -.08em; margin-left: .25em; }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 880px; }
.wrap--text { max-width: 780px; }
.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * .6); }
.section--alt { background: var(--paper-2); }
.section--card { background: var(--card); border-block: 1px solid var(--line); }

.grid-2, .grid-3, .grid-4 { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.split { display: grid; gap: 40px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) {
  .split { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 64px; }
  .split--even { grid-template-columns: 1fr 1fr; }
  .split--rev { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
  .split--center { align-items: center; }
  .sticky { position: sticky; top: calc(var(--header-h) + 24px); }
}

/* --------------------------------------------------------------------------
   Tags, rules & small type
   -------------------------------------------------------------------------- */
.tag {
  position: relative;
  display: inline-flex; align-items: center; gap: .4em;
  font: 500 .72rem/1.35 var(--f-mono);
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--forest);
  background: var(--card);
  border: 1.5px solid currentColor;
  border-radius: 3px 10px 10px 3px;
  padding: .5em .85em .5em 1.6em;
  max-width: 100%;
  margin-bottom: 1.1rem;
}
.tag::before { /* the punched hole of a tool tag */
  content: ""; position: absolute; left: .6em; top: 50%;
  width: .45em; height: .45em; margin-top: -.225em;
  border: 1.5px solid currentColor; border-radius: 50%;
}
.tag--light { color: var(--on-dark); background: transparent; }
.tag--ember { color: var(--ember-2); background: var(--ember-tint); }

.tape { /* measuring tape divider */
  height: 16px;
  background:
    repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px 10px) left bottom / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, var(--line-2) 0 1.5px, transparent 1.5px 50px) left bottom / 100% 14px no-repeat;
  border-bottom: 1px solid var(--line-2);
}

.lede { font-size: clamp(1.08rem, 1rem + .35vw, 1.25rem); line-height: 1.6; color: var(--ink-2); max-width: 60ch; }
.kicker { font: 500 .78rem/1.4 var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.fine-print { font-size: .85rem; line-height: 1.55; color: var(--muted); max-width: 80ch; margin-top: 1.5rem; }
.muted { color: var(--muted); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: .7em 1.3em;
  font: 600 1rem/1.2 var(--f-body);
  text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent; border-radius: var(--r);
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--ember { background: var(--ember); color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.08), inset 0 -2px 0 rgba(0,0,0,.14); }
.btn--ember:hover { background: var(--ember-2); color: #fff; }
.btn--ink { background: var(--ink); color: var(--on-dark); }
.btn--ink:hover { background: var(--forest); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--on-dark); }
.btn--light { background: var(--on-dark); color: var(--ink); }
.btn--light:hover { background: #fff; color: var(--ink); }
.btn--lg { min-height: 56px; font-size: 1.0625rem; padding-inline: 1.5em; }
.btn--block { width: 100%; }
.btn .icon { width: 1.1em; height: 1.1em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.75rem; }

.link-arrow { display: inline-flex; align-items: center; gap: .4em; font-weight: 600; text-decoration: none; color: var(--forest); }
.link-arrow .icon { width: 1em; height: 1em; transition: transform .2s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   Top bar & masthead
   -------------------------------------------------------------------------- */
.topbar { background: var(--ink); color: var(--on-dark-muted); font-size: .8125rem; }
.topbar__row { display: flex; align-items: center; gap: 20px; min-height: 40px; }
.topbar__item { display: inline-flex; align-items: center; gap: .45em; color: inherit; text-decoration: none; white-space: nowrap; }
.topbar__item .icon { width: 1.05em; height: 1.05em; opacity: .85; }
.topbar a.topbar__item:hover { color: #fff; }
.topbar__ru { color: var(--on-dark); }
.topbar__spacer { flex: 1; }
.topbar__btn { background: none; border: 0; padding: 6px 0; font: inherit; cursor: pointer; min-height: 40px; }
.topbar__btn:hover, .topbar__btn[aria-pressed="true"] { color: #fff; }
.topbar__btn[aria-pressed="true"] span { text-decoration: underline; text-underline-offset: .25em; }
.topbar__phone { color: var(--on-dark); font-weight: 600; }
@media (max-width: 860px) { .topbar__item:first-child { display: none; } }
@media (max-width: 560px) {
  .topbar__phone { display: none; }
  .topbar__row { gap: 12px; }
  .topbar { font-size: .78rem; }
}

.masthead {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
}
/* The blur sits on a pseudo-element: backdrop-filter on .masthead itself would
   make it the containing block for the fixed mobile nav and clip the panel */
.masthead::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(246, 242, 234, .94);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
}
.menu-open .masthead::before { background: var(--paper); }
.masthead__row { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }

.brand { display: inline-flex; align-items: center; text-decoration: none; flex: none; }
.brand__logo { display: block; width: auto; height: 50px; }

.masthead__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.menu-toggle {
  display: inline-flex; align-items: center; gap: .45em;
  min-height: 46px; padding: 0 14px;
  background: var(--card); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: var(--r);
  font: 600 .95rem var(--f-body); cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.menu-toggle .icon { width: 1.25em; height: 1.25em; }
.menu-toggle[aria-expanded="true"] { background: var(--ink); color: var(--on-dark); }

/* Mobile-first nav: full-height panel under the masthead */
.nav { display: none; }
.nav__list { list-style: none; margin: 0; padding: 0; }
.nav__item { margin: 0; }
.nav__link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  font: 600 1rem/1.2 var(--f-body); color: var(--ink); text-decoration: none;
  background: none; border: 0; cursor: pointer; text-align: left;
}
.nav__chev { flex: none; transition: transform .25s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease); }
.nav__link[aria-expanded="true"] .nav__chev { transform: rotate(180deg); }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu li { margin: 0; }
.menu a { display: block; text-decoration: none; }
.menu__label { display: block; font-weight: 600; color: var(--ink); }
.menu__hint { display: block; font-size: .85rem; color: var(--muted); }

@media (max-width: 1199.98px) {
  .nav.is-open {
    display: flex; flex-direction: column;
    position: fixed; left: 0; right: 0; bottom: 0; top: var(--nav-top, 116px);
    background: var(--paper); overflow-y: auto; overscroll-behavior: contain;
    padding: 8px var(--gutter) calc(20px + env(safe-area-inset-bottom));
    z-index: 49;
    animation: nav-in .28s var(--ease);
  }
  .menu-open .dock { display: none; }
  .nav__list { margin-bottom: 28px; }
  .nav__item { border-bottom: 1px solid var(--line); }
  .nav__link {
    min-height: 62px; padding: 0 2px;
    font: 600 1.375rem/1.2 var(--f-display); letter-spacing: -.01em;
  }
  .nav__link:hover { color: var(--forest); }
  .nav__item.is-current > .nav__link { color: var(--forest); }
  .nav__item.is-current > .nav__link::after { /* ember dot marks the current section */
    content: ""; order: -1; flex: none;
    width: 8px; height: 8px; border-radius: 50%; background: var(--ember);
  }
  .nav__item.is-current > .nav__link .nav__chev { margin-left: auto; }
  .nav__item.is-current > .nav__link:not(:has(.nav__chev)) { justify-content: flex-start; }
  .nav__chev {
    width: 34px; height: 34px; padding: 8px;
    border: 1.5px solid var(--line-2); border-radius: 50%;
  }
  .nav__link[aria-expanded="true"] .nav__chev { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }

  /* Accordion: animate open by growing the grid row from 0fr to 1fr */
  .menu {
    display: grid; grid-template-rows: 0fr; visibility: hidden;
    transition: grid-template-rows .3s var(--ease), visibility 0s linear .3s;
  }
  .nav__link[aria-expanded="true"] + .menu { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; }
  .menu ul { min-height: 0; overflow: hidden; margin-left: 6px; border-left: 2px solid var(--line); }
  .menu li:first-child { padding-top: 2px; }
  .menu li:last-child { padding-bottom: 16px; }
  .menu a { margin-left: -2px; padding: 9px 12px 9px 18px; border-left: 2px solid transparent; border-radius: 0 var(--r) var(--r) 0; }
  .menu a:hover { background: var(--paper-2); }
  .menu a[aria-current="page"] { border-left-color: var(--ember); background: var(--ember-tint); }
  .menu a[aria-current="page"] .menu__label { color: var(--ember-2); }

  .nav__mobile-extra {
    margin-top: auto; padding: 20px;
    background: var(--ink); color: var(--on-dark-muted);
    border-radius: var(--r-lg);
  }
  .nav__help-title { margin: 0; font: 600 1.25rem/1.25 var(--f-display); color: var(--on-dark); }
  .nav__mobile-extra p:not(.nav__help-title) { margin: 6px 0 16px; font-size: .9rem; line-height: 1.5; }
}
@keyframes nav-in { from { opacity: 0; transform: translateY(-8px); } }

.masthead__call .icon { width: 1.05em; height: 1.05em; }
@media (max-width: 640px) {
  .masthead__call { display: none; }
  .brand__logo { height: 38px; }
}

@media (min-width: 1200px) {
  .menu-toggle { display: none; }
  .nav, .nav.is-open { display: block; position: static; padding: 0; background: none; overflow: visible; border: 0; margin-left: 8px; }
  .nav__list { display: flex; align-items: center; gap: 2px; }
  .nav__item { border: 0; position: relative; }
  .nav__link {
    min-height: 44px; padding: 0 10px; gap: 4px;
    font-size: .95rem; font-weight: 500; color: var(--ink-2);
    border-radius: var(--r); white-space: nowrap;
  }
  .nav__link:hover, .nav__link[aria-expanded="true"] { color: var(--ink); background: var(--paper-2); }
  .nav__item.is-current > .nav__link, .nav__link[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ember); border-radius: 0; }
  .nav__chev { width: .95em; height: .95em; opacity: .7; }
  .menu {
    display: none;
    position: absolute; top: 100%; left: -8px;
    min-width: 310px; padding: 10px 0 0;
  }
  .nav__link[aria-expanded="true"] + .menu { display: block; }
  .menu a { padding: 10px 12px; border-radius: var(--r); }
  .menu a:hover, .menu a[aria-current="page"] { background: var(--paper-2); }
  .menu ul {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow); padding: 8px;
  }
  .nav__mobile-extra { display: none; }
}
@media (min-width: 1200px) and (hover: hover) {
  .has-menu:not(.is-dismissed):hover > .menu { display: block; }
}
@media (min-width: 1200px) and (max-width: 1439px) {
  .masthead__call span { display: none; }
  .masthead__call { padding-inline: 14px; }
  .masthead__call::after { content: "Call"; }
}

/* Mobile quick-contact dock */
.dock { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: 68px; }
  .dock {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: var(--ink); box-shadow: 0 -8px 24px -12px rgba(0,0,0,.5);
  }
  .dock__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    min-height: 50px; border-radius: var(--r);
    font-weight: 600; text-decoration: none;
    background: #24312b; color: var(--on-dark);
  }
  .dock__btn--call { background: var(--ember); color: #fff; }
  .dock__btn:hover { color: #fff; }
}

/* --------------------------------------------------------------------------
   Home hero + slideshow
   -------------------------------------------------------------------------- */
.hero { padding-block: clamp(32px, 2rem + 2vw, 72px) clamp(40px, 3rem + 2vw, 88px); position: relative; }
.hero__grid { display: grid; gap: 36px; grid-template-columns: 1fr; align-items: center; }
.hero__grid > *, .page-hero__grid > *, .split > * { min-width: 0; }
@media (min-width: 1024px) { .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 56px; } }
.hero h1 { font-size: clamp(2.3rem, 1.3rem + 3.4vw, 3.55rem); }
.hero h1 { margin-bottom: .45em; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 1.5rem; padding: 0; list-style: none; font-size: .92rem; color: var(--muted); }
.hero__meta li { display: inline-flex; align-items: center; gap: .4em; margin: 0; }
.hero__meta .icon { color: var(--forest); width: 1.1em; height: 1.1em; }

.show {
  position: relative;
  background:
    radial-gradient(circle at 12px 12px, #4b5a52 2.5px, transparent 3px),
    radial-gradient(circle at calc(100% - 12px) 12px, #4b5a52 2.5px, transparent 3px),
    radial-gradient(circle at 12px calc(100% - 12px), #4b5a52 2.5px, transparent 3px),
    radial-gradient(circle at calc(100% - 12px) calc(100% - 12px), #4b5a52 2.5px, transparent 3px),
    var(--ink);
  border-radius: var(--r-lg);
  padding: 22px 22px 12px;
  box-shadow: var(--shadow);
}
@media (max-width: 560px) { .show { padding: 10px 10px 6px; background: var(--ink); border-radius: 10px; } }
.show__frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: #0f1713; container-type: inline-size; }
.show__slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .7s var(--ease), visibility 0s linear .7s; }
.show__slide.is-active { opacity: 1; visibility: visible; transition: opacity .7s var(--ease), visibility 0s; }
.show__slide picture, .show__slide img { width: 100%; height: 100%; }
.show__slide > picture img { object-fit: cover; }

.show__bar { display: flex; align-items: center; gap: 12px; padding-top: 10px; color: var(--on-dark); min-height: 54px; }
.show__count { font: 500 .8rem var(--f-mono); color: var(--on-dark-muted); letter-spacing: .06em; flex: none; }
.show__count b { color: var(--on-dark); font-weight: 500; }
.show__link { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: .45em; color: var(--on-dark); font-weight: 500; font-size: .95rem; text-decoration: none; }
.show__link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.show__link .icon { width: 1em; height: 1em; color: var(--ember-glow); transition: transform .2s var(--ease); }
.show__link:hover { color: #fff; }
.show__link:hover .icon { transform: translateX(3px); }
.show__controls { display: flex; gap: 6px; flex: none; }
.show__btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  background: #24312b; color: var(--on-dark); border: 1px solid #34443c; border-radius: var(--r);
  cursor: pointer; transition: background-color .2s var(--ease);
}
.show__btn:hover { background: #2f3f37; }
.show__btn .icon { width: 18px; height: 18px; }
.show { --focus: #f2c14e; }


/* --------------------------------------------------------------------------
   Facts strip
   -------------------------------------------------------------------------- */
.facts { border-block: 1px solid var(--line-2); background: var(--card); }
.facts__grid { display: grid; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .facts__grid { grid-template-columns: repeat(4, 1fr); } }
.fact { padding: 26px 20px 24px; border-left: 1px solid var(--line); }
.fact:nth-child(odd) { border-left: 0; }
@media (min-width: 900px) { .fact:nth-child(odd) { border-left: 1px solid var(--line); } .fact:first-child { border-left: 0; } }
@media (max-width: 899px) { .fact:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }
.fact__num { display: block; font: 700 clamp(1.9rem, 1.4rem + 1.6vw, 2.7rem)/1 var(--f-display); color: var(--ink); letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; }
.fact__label { display: block; margin-top: 10px; font-size: .9rem; line-height: 1.45; color: var(--muted); }

/* --------------------------------------------------------------------------
   Section heads
   -------------------------------------------------------------------------- */
.section-head { max-width: 760px; margin-bottom: clamp(28px, 2rem + 1vw, 48px); }
.section-head p { font-size: 1.1rem; color: var(--ink-2); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--row { max-width: none; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px 40px; }
.section-head--row > div { max-width: 720px; }

/* --------------------------------------------------------------------------
   Bench cards (services)
   -------------------------------------------------------------------------- */
.bench {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 28px 26px 24px; text-decoration: none;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
a.bench:hover { border-color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink-2); }
.bench__no { position: absolute; top: 22px; right: 24px; font: 500 .75rem var(--f-mono); color: var(--muted); letter-spacing: .08em; }
.bench__icon { display: inline-grid; place-items: center; width: 52px; height: 52px; margin-bottom: 20px; border-radius: 10px; background: var(--forest-tint); color: var(--forest); }
.bench__icon .icon { width: 26px; height: 26px; }
.bench h3 { margin-bottom: .4em; }
.bench p { margin-bottom: 1.25em; }
.bench__quip { font-family: var(--f-display); font-style: italic; color: var(--ember-2); font-size: 1rem; margin-bottom: .6em; }
.bench__more { margin-top: auto; display: inline-flex; align-items: center; gap: .4em; font-weight: 600; color: var(--forest); }
.bench__more .icon { width: 1em; height: 1em; transition: transform .2s var(--ease); }
a.bench:hover .bench__more .icon { transform: translateX(4px); }

/* Plain info card */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 26px; }
.card h3 { margin-bottom: .45em; }
.card > :last-child { margin-bottom: 0; }
.card--ink { background: var(--ink); border-color: var(--ink); color: var(--on-dark-muted); }
.card--ink h3, .card--ink strong { color: var(--on-dark); }
.card__icon { width: 30px; height: 30px; color: var(--forest); margin-bottom: 14px; }
.card--ink a:not(.btn) { color: #9fd0b0; }
.card--ink .card__icon { color: #8fc2a1; }

/* --------------------------------------------------------------------------
   Crew badges
   -------------------------------------------------------------------------- */
.crew { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .crew { grid-template-columns: 1fr 1fr; } }
.badge {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--card); color: var(--ink-2); text-decoration: none;
  border: 1px solid var(--line-2); border-radius: 16px;
  padding: 0 22px 24px; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
a.badge:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: var(--shadow); color: var(--ink-2); }
.badge__clip { position: absolute; top: 12px; left: 50%; width: 54px; height: 10px; margin-left: -27px; border-radius: 6px; background: var(--paper); box-shadow: inset 0 1px 2px rgba(0,0,0,.35); z-index: 1; }
.badge__top {
  align-self: stretch; display: flex; justify-content: space-between; gap: 8px;
  margin: 0 -22px 22px; padding: 34px 18px 12px;
  background: var(--forest); color: #d7e6da;
  font: 500 .68rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase;
}
.badge__photo { width: 124px; height: 124px; border-radius: 50%; object-fit: cover; border: 4px solid var(--card); outline: 1.5px solid var(--line-2); margin-top: -10px; }
.badge__nick { margin-top: 14px; font: italic 700 2.1rem/1 var(--f-display); color: var(--ember); letter-spacing: -.02em; }
.badge__name { margin-top: 6px; font: 650 1.2rem/1.2 var(--f-display); color: var(--ink); }
.badge__title { font: 500 .74rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.badge__blurb { margin-top: 14px; font-size: .95rem; line-height: 1.55; }
.badge__langs { display: inline-flex; align-items: center; gap: .4em; margin-top: 14px; font-size: .85rem; color: var(--forest); font-weight: 500; }
.badge__langs .icon { width: 1.1em; height: 1.1em; }
.badge__more { display: inline-flex; align-items: center; gap: .4em; margin-top: 16px; font-weight: 600; color: var(--forest); }
.badge__more .icon { width: 1em; height: 1em; }

/* --------------------------------------------------------------------------
   Steps
   -------------------------------------------------------------------------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { position: relative; margin: 0; padding: 26px 24px 28px 0; border-top: 2px solid var(--ink); counter-increment: step; }
@media (min-width: 900px) { .steps li { padding-right: 28px; } .steps li + li { padding-left: 0; } }
.steps li::before {
  content: "Step " counter(step, decimal-leading-zero);
  display: inline-block; margin-bottom: 14px;
  font: 500 .72rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ember-2);
}
.steps li::after { content: ""; position: absolute; top: -7px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
.section--alt .steps li::after { background: var(--paper-2); }
.steps h3 { margin-bottom: .4em; }
.steps p { margin: 0; }

/* --------------------------------------------------------------------------
   Chips (program list) & toggles
   -------------------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.chips li { margin: 0; }
.chip {
  display: inline-flex; align-items: center; gap: .5em; min-height: 44px;
  padding: .55em 1em; border-radius: 999px;
  background: var(--card); border: 1.5px solid var(--line-2); color: var(--ink);
  font: 500 .95rem var(--f-body); text-decoration: none; cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip .icon { width: 1em; height: 1em; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }
.chip--small { min-height: 44px; font-size: .85rem; padding: .35em .95em; }

/* --------------------------------------------------------------------------
   Dark sections
   -------------------------------------------------------------------------- */
.section--dark { background: var(--ink); color: var(--on-dark-muted); --focus: #f2c14e; }
.section--dark h2, .section--dark h3, .section--dark strong { color: var(--on-dark); }
.section--dark a:not(.btn) { color: #9fd0b0; }
.section--dark .tag { color: var(--on-dark); background: transparent; }
.section--blueprint {
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 24px),
    var(--blueprint);
  color: #c6d3df; --focus: #f2c14e;
}
.section--blueprint h2, .section--blueprint h3, .section--blueprint strong { color: #fff; }
.section--blueprint .tag { color: #fff; background: transparent; }
.section--blueprint em { color: #ffb48a; }
.section--dark em, .cta-band em { color: #ffb48a; }
.section--blueprint .section-head p { color: #c6d3df; }
.section--forest { background: var(--forest); color: #d4e3d8; --focus: #f2c14e; }
.section--forest h2, .section--forest h3, .section--forest strong { color: #fff; }
.section--forest .tag { color: #fff; background: transparent; }
.section--forest em { color: #ffb48a; }
.section--forest .lede, .section--forest .checks { color: #e2ece4; }
.section--forest .checks li::before { background-color: #d7e6da; }

.tool-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 28px; border-radius: 12px; text-decoration: none;
  background: rgba(255,255,255,.04); border: 1px dashed rgba(255,255,255,.35); color: #c6d3df;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.tool-card:hover { background: rgba(255,255,255,.08); border-color: #fff; color: #dbe5ee; }
.tool-card > .icon { width: 34px; height: 34px; color: #ffb48a; }
.tool-card h3 { margin: 6px 0 0; }
.tool-card p { margin: 0; }
.tool-card .link-arrow { color: #fff; margin-top: 8px; }

/* --------------------------------------------------------------------------
   Interior page hero
   -------------------------------------------------------------------------- */
.page-hero {
  position: relative;
  background:
    linear-gradient(var(--paper), rgba(246,242,234,.6) 40%, var(--paper)),
    repeating-linear-gradient(0deg, rgba(22,33,28,.045) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(22,33,28,.045) 0 1px, transparent 1px 28px);
}
.page-hero__grid { display: grid; gap: 36px; grid-template-columns: 1fr; padding-block: clamp(28px, 1.5rem + 2vw, 56px) clamp(40px, 2.5rem + 2vw, 72px); align-items: center; }
@media (min-width: 1000px) { .page-hero__grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 64px; } }
.page-hero__grid--solo { grid-template-columns: 1fr !important; }
.page-hero__grid--solo .page-hero__text { max-width: 860px; }
.page-hero h1 { font-size: clamp(2.1rem, 1.3rem + 3vw, 3.6rem); }

.crumbs { margin-bottom: 18px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; padding: 0; margin: 0; font: 500 .75rem var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.crumbs li { margin: 0; display: inline-flex; align-items: center; }
.crumbs li + li::before { content: "/"; margin: 0 .7em; color: var(--line-2); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ember-2); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); }

/* Spec sheet card */
.spec { background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
.spec__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; background: var(--ink); color: var(--on-dark); font: 500 .72rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; }
.spec__head span:last-child { color: var(--on-dark-muted); }
.spec dl { margin: 0; }
.spec__row { display: grid; grid-template-columns: minmax(110px, .8fr) 1.4fr; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line); }
.spec__row:first-child { border-top: 0; }
.spec dt { font: 500 .72rem/1.6 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-top: .15em; }
.spec dd { margin: 0; color: var(--ink); font-size: .98rem; line-height: 1.5; }
.spec__foot { padding: 14px 18px; border-top: 1px solid var(--line); background: var(--paper); font-size: .85rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   Prose & content blocks
   -------------------------------------------------------------------------- */
.prose { max-width: 70ch; }
.prose h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); margin-top: 2.2em; }
.prose h2:first-child, .prose > :first-child { margin-top: 0; }
.prose .tag + h2, .prose .tag + h3 { margin-top: 0; }
.prose h3 { margin-top: 1.8em; }
.prose ul:not(.checks):not(.chips), .prose ol { padding-left: 1.3em; }
.prose li::marker { color: var(--ember); }
.prose table { margin-block: 1.5em; }

.checks { list-style: none; padding: 0; margin: 0 0 1.25em; }
.checks li { position: relative; padding-left: 1.9em; }
.checks li + li { margin-top: .6em; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .28em; width: 1.15em; height: 1.15em; border-radius: 50%;
  background: var(--forest-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e4d33' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 64% no-repeat;
}
.checks--x li::before {
  background: #f3e1d8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a3412' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / 58% no-repeat;
}

.callout {
  position: relative; margin: 1.75em 0; padding: 18px 20px 18px 22px;
  background: var(--ember-tint); border-left: 4px solid var(--ember); border-radius: 0 var(--r) var(--r) 0;
  color: var(--ink-2);
}
.callout__label { display: block; margin-bottom: 4px; font: 500 .72rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ember-2); }
.callout p:last-child { margin-bottom: 0; }
.callout--green { background: var(--forest-tint); border-left-color: var(--forest); }
.callout--green .callout__label { color: var(--forest); }

.pull { font: italic 600 clamp(1.4rem, 1.1rem + 1vw, 1.9rem)/1.3 var(--f-display); color: var(--ink); border-top: 2px solid var(--ink); padding-top: 18px; margin: 2em 0; max-width: 30ch; }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 2rem; padding: 0; list-style: none; }
.toc li { margin: 0; }

/* Anchor program blocks (self-employed, investment, programs pages) */
.program { padding-block: 36px; border-top: 1px solid var(--line); scroll-margin-top: 110px; }
.program:first-child { border-top: 0; padding-top: 0; }
.program__head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.program__head h2, .program__head h3 { margin: 0; }
.program__icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; background: var(--forest-tint); color: var(--forest); flex: none; }
.program__icon .icon { width: 24px; height: 24px; }
.program .grid-2 { margin-top: 18px; }
.program h4 { font: 500 .74rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6em; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 560px; }
.tbl caption { text-align: left; padding: 14px 18px; font: 500 .74rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.tbl th, .tbl td { padding: 14px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tbl thead th { background: var(--ink); color: var(--on-dark); font: 600 .95rem var(--f-body); border-bottom: 0; }
.tbl tbody th { font: 500 .74rem/1.6 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); width: 22%; background: var(--paper); }
.tbl tr:last-child th, .tbl tr:last-child td { border-bottom: 0; }

/* FAQ */
.faq__list { border-top: 2px solid var(--ink); }
.faq__item { border-bottom: 1px solid var(--line-2); }
.faq__item summary {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  min-height: 64px; padding: 18px 2px; cursor: pointer; list-style: none;
  font: 600 clamp(1.05rem, 1rem + .3vw, 1.2rem)/1.35 var(--f-display); color: var(--ink);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: var(--ember-2); }
.faq__chev { width: 22px; height: 22px; transition: transform .25s var(--ease); color: var(--muted); }
.faq__item[open] .faq__chev { transform: rotate(180deg); }
.faq__a { padding: 0 2px 22px; max-width: 70ch; }
.faq__a p:last-child { margin-bottom: 0; }

/* Related links */
.related { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .related { grid-template-columns: repeat(3, 1fr); } }
.related__card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 22px 56px 22px 22px; border-radius: 12px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-2);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.related__card:hover { border-color: var(--ink); transform: translateY(-2px); color: var(--ink-2); }
.related__icon { width: 24px; height: 24px; color: var(--forest); margin-bottom: 6px; }
.related__title { font: 650 1.12rem/1.25 var(--f-display); color: var(--ink); }
.related__text { font-size: .93rem; color: var(--muted); }
.related__go { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--ember); transition: transform .2s var(--ease); }
.related__card:hover .related__go { transform: translate(4px, -50%); }

/* --------------------------------------------------------------------------
   CTA band
   -------------------------------------------------------------------------- */
.cta-band {
  position: relative; overflow: hidden;
  background: radial-gradient(70% 120% at 100% 100%, rgba(194, 65, 12, .38), transparent 60%), var(--ink);
  color: var(--on-dark-muted); padding-block: clamp(56px, 3rem + 3vw, 96px);
  --focus: #f2c14e;
}
.cta-band__grid { display: grid; gap: 32px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 960px) { .cta-band__grid { grid-template-columns: 1.3fr 1fr; gap: 64px; } }
.cta-band h2 { color: var(--on-dark); font-size: clamp(2rem, 1.3rem + 2.6vw, 3.3rem); }
.cta-band p { max-width: 56ch; }
.cta-band__actions { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 480px) and (max-width: 959px) { .cta-band__actions { flex-direction: row; flex-wrap: wrap; } }
.cta-band__fine { margin: 6px 0 0; font-size: .875rem; color: var(--on-dark-muted); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer { background: #0f1713; color: var(--on-dark-muted); font-size: .95rem; --focus: #f2c14e; }
.footer__grid { display: grid; gap: 36px 28px; grid-template-columns: 1fr; padding-block: 64px 48px; }
@media (min-width: 640px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .footer__grid { grid-template-columns: 1.55fr 1fr 1fr .85fr 1.1fr; } }
@media (min-width: 640px) and (max-width: 1099px) { .footer__brand { grid-column: 1 / -1; } }
.footer__blurb { margin: 18px 0 20px; max-width: 42ch; }
.footer__h { font: 500 .72rem var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: #8fa197; margin: 0 0 14px; }
.footer__col ul { list-style: none; padding: 0; margin: 0 0 28px; }
.footer__col li + li { margin-top: 2px; }
.footer__col a { display: inline-block; padding: 5px 0; color: var(--on-dark); text-decoration: none; }
.footer__col a:hover { color: #ffb48a; text-decoration: underline; }
.footer__visit p { display: flex; gap: 10px; margin: 0 0 14px; color: var(--on-dark); }
.footer__visit .icon { width: 1.1em; height: 1.1em; margin-top: .25em; color: #8fc2a1; }
.footer__visit a { color: var(--on-dark); }
.footer__eho { margin-top: 22px; width: 64px; height: auto; }

.plates { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.plate {
  display: inline-block; padding: 8px 24px; white-space: nowrap;
  font: 500 .7rem var(--f-mono); letter-spacing: .02em; color: var(--on-dark);
  border: 1px solid #39483f; border-radius: 4px;
  background:
    radial-gradient(circle at 11px 50%, #6f7f76 2px, transparent 2.6px),
    radial-gradient(circle at calc(100% - 11px) 50%, #6f7f76 2px, transparent 2.6px),
    linear-gradient(#1a2520, #141d19);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.footer__legal { border-top: 1px solid #24312b; padding-block: 26px 30px; font-size: .83rem; line-height: 1.6; }
.footer__legal p { max-width: 120ch; }
.footer__bottom { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; }
.footer__bottom a { color: var(--on-dark); }
.footer__bottom a:hover { color: #ffb48a; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form { display: grid; gap: 18px; }
.form__row { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .form__row { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; color: var(--ink); font-size: .98rem; }
.field .req { color: var(--ember-2); font-weight: 600; }
.field .opt { color: var(--muted); font-weight: 400; font-size: .88rem; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 52px; padding: 12px 14px;
  font: 400 1rem/1.4 var(--f-body); color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line-2); border-radius: var(--r);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--muted); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(30, 77, 51, .2); }
.field .hint { font-size: .86rem; color: var(--muted); }
.field .error { display: none; align-items: center; gap: .35em; font-size: .88rem; color: var(--ember-2); font-weight: 500; }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--ember-2); }
.field.is-invalid .error { display: flex; }
.field .error .icon { width: 1em; height: 1em; }
/* reCAPTCHA attribution is shown in the form note, so the floating badge may be hidden */
.grecaptcha-badge { visibility: hidden; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form__note { font-size: .86rem; color: var(--muted); margin: 0; }
.form-panel h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin-bottom: .3em; }
.req { color: var(--ember-2); font-weight: 600; }
.spec__phone { font: 650 1.3rem var(--f-display); color: var(--ink); text-decoration: none; }
.spec__phone:hover { color: var(--ember-2); }
.form-panel { background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; padding: clamp(22px, 1rem + 2vw, 40px); box-shadow: var(--shadow-sm); }
.alert { display: flex; gap: 12px; padding: 16px 18px; border-radius: var(--r); margin-bottom: 20px; }
.alert .icon { width: 1.4em; height: 1.4em; flex: none; margin-top: .1em; }
.alert--ok { background: var(--forest-tint); color: var(--forest); }
.alert--ok strong { color: var(--forest); }
.alert--err { background: #f8e3da; color: var(--ember-2); }
.alert--err strong { color: var(--ember-2); }
.alert p { margin: 0; color: var(--ink-2); }

/* Input with unit adornment */
.input-unit { position: relative; display: flex; align-items: center; }
.input-unit > span { position: absolute; font-weight: 500; color: var(--muted); pointer-events: none; }
.input-unit > span:first-child { left: 14px; }
.input-unit > span:last-child:not(:first-child) { right: 14px; }
.input-unit--pre input { padding-left: 30px; }
.input-unit--post input { padding-right: 40px; }

/* Segmented control */
.seg { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; }
.seg legend { font-weight: 600; color: var(--ink); font-size: .98rem; margin-bottom: 6px; padding: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: inline-grid; place-items: center; min-width: 64px; min-height: 46px; padding: 0 14px; border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--card); font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Calculator
   -------------------------------------------------------------------------- */
.calc { display: grid; gap: 28px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1000px) { .calc { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; } }
.calc fieldset.group { border: 0; padding: 0; margin: 0 0 6px; }
.calc .group__title { display: flex; align-items: center; gap: 10px; font: 500 .74rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; padding: 0; width: 100%; }
.calc .group__title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.readout {
  background: var(--ink); color: var(--on-dark-muted); border-radius: 16px; padding: clamp(22px, 1rem + 2vw, 36px);
  box-shadow: var(--shadow); --focus: #f2c14e;
}
.readout__label { font: 500 .74rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-muted); }
.readout__big { display: block; margin: 8px 0 4px; font: 600 clamp(2.4rem, 1.6rem + 3vw, 3.6rem)/1 var(--f-mono); color: #fff; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.readout__sub { font-size: .95rem; }
.readout__rows { margin: 22px 0 0; border-top: 1px solid #2c3a33; }
.readout__row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid #2c3a33; font-size: .95rem; }
.readout__row dt { color: var(--on-dark-muted); }
.readout__row dd { margin: 0; color: var(--on-dark); font: 500 .98rem var(--f-mono); font-variant-numeric: tabular-nums; text-align: right; }
.readout__row--total dt, .readout__row--total dd { color: #fff; font-weight: 600; }
.readout__bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; margin: 18px 0 8px; background: #2c3a33; }
.readout__bar span:first-child { background: #8fc2a1; }
.readout__bar span:last-child { background: var(--ember-glow); }
.readout__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .85rem; }
.readout__legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.readout__note { margin: 18px 0 0; font-size: .82rem; line-height: 1.5; color: #9aa69f; }
.amort { margin-top: 24px; }
.amort summary { cursor: pointer; font-weight: 600; color: var(--ink); min-height: 44px; display: flex; align-items: center; }
.amort .tbl { min-width: 520px; font-size: .9rem; }
.amort .tbl td, .amort .tbl th { padding: 10px 14px; font-variant-numeric: tabular-nums; }
.amort .tbl tbody th { width: auto; }

/* --------------------------------------------------------------------------
   Comparison tool
   -------------------------------------------------------------------------- */
.compare-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.compare-status { font-size: .9rem; color: var(--muted); margin-bottom: 22px; min-height: 1.5em; }
.compare-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .compare-grid[data-count="2"] { grid-template-columns: repeat(2, 1fr); } .compare-grid[data-count="3"] { grid-template-columns: repeat(3, 1fr); } }
.pcol { background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.pcol__head { padding: 18px 20px; background: var(--ink); color: var(--on-dark); }
.pcol__head h3 { color: var(--on-dark); margin: 0 0 4px; }
.pcol__head p { margin: 0; font-size: .9rem; color: var(--on-dark-muted); }
.pcol dl { margin: 0; flex: 1; }
.pcol__row { padding: 14px 20px; border-top: 1px solid var(--line); }
.pcol__row:first-child { border-top: 0; }
.pcol dt { font: 500 .7rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.pcol dd { margin: 0; font-size: .95rem; line-height: 1.5; color: var(--ink-2); }
.pcol__foot { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--paper); }
.compare-grid--all { grid-template-columns: 1fr; }
@media (min-width: 760px) { .compare-grid--all { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .compare-grid--all { grid-template-columns: repeat(3, 1fr); } }

/* --------------------------------------------------------------------------
   Profile page
   -------------------------------------------------------------------------- */
.profile-badge { max-width: 380px; margin-inline: auto; }
.profile-badge .badge { padding-bottom: 28px; }
.facts-list { display: grid; gap: 0; margin: 0; border-top: 2px solid var(--ink); }
.facts-list div { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts-list dt { font: 500 .72rem/1.7 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.facts-list dd { margin: 0; color: var(--ink); }
@media (max-width: 520px) { .facts-list div { grid-template-columns: 1fr; gap: 2px; } }

/* Town cards */
.towns { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .towns { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .towns { grid-template-columns: repeat(3, 1fr); } }
.town { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.town h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 1.2rem; margin-bottom: .35em; }
.town h3 span { font: 500 .68rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.town p { margin: 0; font-size: .95rem; }
.town--home { background: var(--forest); border-color: var(--forest); color: #d4e3d8; }
.town--home h3, .town--home h3 span { color: #fff; }

/* Map */
.map { width: 100%; aspect-ratio: 16 / 10; border: 0; border-radius: 12px; background: var(--paper-2); display: block; }

/* Glossary */
.gloss { display: grid; gap: 0; margin: 0; border-top: 2px solid var(--ink); }
.gloss div { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px 24px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .gloss div { grid-template-columns: 220px 1fr; } }
.gloss dt { font: 650 1.08rem var(--f-display); color: var(--ink); }
.gloss dd { margin: 0; }

/* Article cards */
.article-card { display: flex; flex-direction: column; gap: 8px; padding: 24px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); transition: border-color .2s var(--ease), transform .2s var(--ease); }
.article-card:hover { border-color: var(--ink); transform: translateY(-2px); color: var(--ink-2); }
.article-card h3 { margin: 4px 0 2px; }
.article-card p { margin: 0; font-size: .96rem; }
.article-card .link-arrow { margin-top: auto; padding-top: 10px; }

/* 404 */
.lost { text-align: center; padding-block: clamp(64px, 5rem + 4vw, 140px); }
.lost__code { font: 700 clamp(5rem, 3rem + 10vw, 10rem)/.9 var(--f-display); color: var(--ink); letter-spacing: -.04em; }
.lost__code em { color: var(--ember); }
.lost .actions { justify-content: center; }

/* --------------------------------------------------------------------------
   Page-group components
   -------------------------------------------------------------------------- */
/* People & place pages (about, team, profiles, Russian-speaking, service areas) */
.card--ink a:not(.btn):hover { color: #ffb48a; }

/* Single profile badge in a page hero */
.profile-badge .badge { box-shadow: var(--shadow); }
.profile-badge .badge__photo { width: 140px; height: 140px; }
.profile-badge .badge__contact { display: flex; flex-direction: column; gap: 8px; align-self: stretch; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); font-size: .95rem; }
.profile-badge .badge__contact a { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 44px; font-weight: 600; text-decoration: none; }
.profile-badge .badge__contact .icon { width: 1.05em; height: 1.05em; }

/* Service lines on the Russian-speaking page */
.svc { display: grid; gap: 0; grid-template-columns: 1fr; border-top: 2px solid var(--ink); list-style: none; padding: 0; margin: 0; }
@media (min-width: 760px) { .svc { grid-template-columns: 1fr 1fr; column-gap: 40px; } }
.svc li { margin: 0; border-bottom: 1px solid var(--line); }
.svc a { display: grid; grid-template-columns: 40px 1fr 20px; gap: 14px; align-items: center; padding: 16px 2px; text-decoration: none; color: var(--ink-2); }
.svc a:hover { color: var(--ink-2); }
.svc a:hover .svc__go { transform: translateX(4px); color: var(--ember); }
.svc__icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--forest-tint); color: var(--forest); }
.svc__icon .icon { width: 20px; height: 20px; }
.svc__title { display: block; font: 650 1.06rem/1.3 var(--f-display); color: var(--ink); }
.svc__text { display: block; font-size: .9rem; color: var(--muted); margin-top: 2px; }
.svc__go { color: var(--muted); transition: transform .2s var(--ease), color .2s var(--ease); }
.svc__go .icon { width: 18px; height: 18px; }

/* Area chips on dark background */
.section--forest .chip { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.section--forest .chip:hover { border-color: #fff; color: #fff; }
.card--ink .muted { color: var(--on-dark-muted); }
.section--forest .fine-print { color: #d4e3d8; margin-top: 1.25rem; }
.section--forest .section-head p { color: #e2ece4; }
.town--link { display: block; text-decoration: none; color: var(--ink-2); border-style: dashed; border-color: var(--line-2); transition: border-color .2s var(--ease); }
.town--link:hover { border-color: var(--ink); color: var(--ink-2); }
.town--link .link-arrow { margin-top: 8px; display: flex; }

/* Borrower pages (home purchase, refinancing, self-employed, investment, immigrant) */
.card--ink .kicker { display: block; color: var(--on-dark-muted); margin-bottom: .6em; }
.card--ink .btn { margin-top: .5em; }
.program .callout { margin-bottom: 0; }
.doc-cols h3 { display: flex; align-items: center; gap: 10px; }
.doc-cols h3 .icon { color: var(--forest); width: 22px; height: 22px; }
.note-only { padding-top: 0; }
.note-only .fine-print { margin-top: 0; }

/* Utilities */
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 2rem; }
.mx-auto { margin-inline: auto; }
.measure { max-width: 880px; }

/* --------------------------------------------------------------------------
   Motion & print
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .masthead, .dock, .cta-band, .footer__grid, .show__bar { display: none !important; }
  body { background: #fff; padding: 0; }
}
