/* ==========================================================================
   DBS Kenya — design tokens
   Palette: ink navy (structure) / cash gold (action) / trust emerald (proof)
   Type: Fraunces (display) + Manrope (body/UI) + IBM Plex Mono (USSD & refs)
   ========================================================================== */
:root {
  --ink:        #12213B;
  --ink-2:      #182a4a;
  --paper:      #F7F5F0;
  --paper-2:    #EFEBE1;
  --gold:       #E3A008;
  --gold-dark:  #b97e05;
  --emerald:    #1B8A6B;
  --emerald-l:  #e4f5ef;
  --text:       #1b2436;
  --muted:      #5b6785;
  --line:       #e3e0d6;
  --radius:     14px;
  --shadow:     0 10px 30px rgba(18,33,59,.10);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Manrope', -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--page-bg, var(--paper));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.site-shell { background: var(--content-bg, var(--paper)); min-height: 100vh; }
body.layout-boxed .site-shell {
  max-width: 1400px;
  margin: 0 auto;
  box-shadow: 0 0 60px rgba(18,33,59,.12);
  border-left: 1px solid rgba(18,33,59,.08);
  border-right: 1px solid rgba(18,33,59,.08);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--ink);
  padding: 10px 16px; z-index: 999; font-weight: 700;
}
.skip-link:focus { left: 12px; top: 12px; }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.15;
}
h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { color: var(--muted); margin: 0 0 1em; }
.mono { font-family: var(--font-mono); }
body.no-copy { -webkit-user-select: none; user-select: none; }
body.no-copy input, body.no-copy textarea, body.no-copy .mono, body.no-copy .allow-copy {
  -webkit-user-select: text; user-select: text;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  padding: 13px 24px; border-radius: 999px; border: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:focus-visible { outline: 3px solid var(--emerald); outline-offset: 2px; }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--paper); border: 1.5px solid rgba(247,245,240,.4); }
.btn-outline:hover { border-color: var(--paper); }
.btn-emerald { background: var(--emerald); color: #fff; }
.btn-block { width: 100%; }

/* Header */
.site-header { background: var(--header-bg, var(--ink)); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 12px; }
.header-inner.align-center { justify-content: center; position: relative; }
.header-inner.align-center .brand { position: absolute; left: 24px; }
.brand { display: flex; align-items: baseline; gap: 4px; min-width: 0; flex-shrink: 1; overflow: hidden; }
.brand-mark { font-family: var(--font-display); font-weight: 700; color: var(--gold); font-size: 26px; flex-shrink: 0; }
.brand-name { font-family: var(--font-display); font-weight: 700; color: var(--paper); font-size: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-logo { height: var(--logo-height, 40px); max-height: 64px; width: auto; }

.main-nav ul { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; align-items: center; }
.main-nav a {
  color: var(--paper); font-weight: 700; font-size: var(--nav-font-size, 14px);
  letter-spacing: .03em; text-transform: var(--nav-text-case, uppercase); opacity: .9;
  padding: 8px 14px; border-radius: 999px; display: inline-block; transition: background .15s ease, opacity .15s ease;
}
.main-nav a.active { background: var(--nav-active-bg, rgba(255,255,255,.12)); opacity: 1; }
.main-nav a:hover { opacity: 1; color: var(--gold); }
.has-dropdown { position: relative; }
.dropdown {
  display: none; position: absolute; top: 100%; left: 0; background: var(--header-bg, var(--ink));
  list-style: none; padding: 8px; margin: 6px 0 0; border-radius: 10px; min-width: 200px;
  box-shadow: var(--shadow); flex-direction: column; gap: 0; z-index: 60;
}
.has-dropdown:hover .dropdown, .has-dropdown:focus-within .dropdown { display: flex; }
.dropdown li a {
  display: block; padding: 10px 12px; border-radius: 6px; font-size: var(--nav-font-size, 14px);
  text-transform: var(--nav-text-case, uppercase);
}
.dropdown li a:hover { background: rgba(255,255,255,.08); }

.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  align-items: center; gap: 8px; padding: 6px 4px;
}
.nav-toggle-label {
  color: var(--paper); font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em;
}
.nav-toggle-icon { display: block; width: 24px; height: 18px; position: relative; flex-shrink: 0; }
.nav-toggle-icon span {
  display: block; position: absolute; left: 0; width: 100%; height: 2px; background: var(--paper);
  border-radius: 2px; transition: transform .2s ease, opacity .2s ease, top .2s ease;
}
.nav-toggle-icon span:nth-child(1) { top: 0; }
.nav-toggle-icon span:nth-child(2) { top: 8px; }
.nav-toggle-icon span:nth-child(3) { top: 16px; }
/* When open: hamburger becomes an X - the universal, unambiguous close symbol */
.nav-toggle.open .nav-toggle-icon span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.nav-toggle.open .nav-toggle-icon span:nth-child(2) { opacity: 0; }
.nav-toggle.open .nav-toggle-icon span:nth-child(3) { top: 8px; transform: rotate(-45deg); }
.app-download-btn {
  display: inline-flex; align-items: center; white-space: nowrap; font-weight: 700;
  font-size: 13px; padding: 9px 18px; border-radius: 999px;
  transition: transform .15s ease, filter .15s ease; flex-shrink: 0;
  max-width: 42vw; overflow: hidden; text-overflow: ellipsis;
}
.app-download-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }

/* Hero */
.hero { background: var(--ink); color: var(--paper); padding: 64px 0 80px; overflow: hidden; position: relative; }
.hero::before {
  content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(227,160,8,.18), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--gold); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.hero h1 { color: var(--paper); margin-bottom: 18px; }
.hero p.lead { color: rgba(247,245,240,.75); font-size: 1.1rem; max-width: 46ch; }
.hero-ctas { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 40px; }
.hero-stats .stat b { display: block; font-family: var(--font-display); font-size: 1.7rem; color: var(--gold); }
.hero-stats .stat span { font-size: 13px; color: rgba(247,245,240,.65); }

/* ---------- Homepage hero style templates (same content, different layout) ---------- */

/* Classic (default): text left, calculator right - no overrides needed, this is the base style above. */

/* Reversed: calculator left, text right */
.hero.tpl-reversed .hero-grid > div:first-child { order: 2; }
.hero.tpl-reversed .hero-grid > .calc-card { order: 1; }

/* Centered: text centered above, calculator centered below, narrower column */
.hero.tpl-centered .hero-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 32px; }
.hero.tpl-centered .hero-grid > div:first-child { max-width: 640px; }
.hero.tpl-centered .hero-grid > div:first-child p.lead { max-width: none; margin-left: auto; margin-right: auto; }
.hero.tpl-centered .hero-ctas { justify-content: center; }
.hero.tpl-centered .hero-stats { justify-content: center; }
.hero.tpl-centered .calc-card { max-width: 440px; width: 100%; }

/* Minimal: lighter, plainer hero - no full dark background block. The calculator keeps
   its own configured color (--calc-bg) just like every other template, for consistency. */
.hero.tpl-minimal { background: var(--content-bg, var(--paper)); color: var(--text); padding: 56px 0 64px; }
.hero.tpl-minimal::before { display: none; }
.hero.tpl-minimal h1 { color: var(--ink); }
.hero.tpl-minimal p.lead { color: var(--muted); }
.hero.tpl-minimal .eyebrow { color: var(--emerald); }
.hero.tpl-minimal .eyebrow::before { background: var(--emerald); }
.hero.tpl-minimal .hero-stats .stat span { color: var(--muted); }
.hero.tpl-minimal .btn-outline { color: var(--ink); border-color: var(--line); }
.hero.tpl-minimal .calc-card { box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,.06); }

/* ---------- Image Side: text left, photo stacked above the calculator on the right ---------- */
.hero-side-stack { display: flex; flex-direction: column; gap: 20px; }
.hero-photo-side { border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4 / 3; }
.hero-photo-side img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Image Backdrop: photo fills the whole hero, text overlaid with a dark gradient for legibility.
   "Light" is identical on desktop - the only difference is how mobile handles it (see mobile block below). ---------- */
.hero.tpl-image-backdrop, .hero.tpl-image-backdrop-light { padding: 90px 0 100px; }
.hero-photo-backdrop { position: absolute; inset: 0; z-index: 0; }
.hero-photo-backdrop img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-photo-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(18,33,59,.94) 0%, rgba(18,33,59,.82) 38%, rgba(18,33,59,.35) 75%, rgba(18,33,59,.15) 100%);
}
.hero.tpl-image-backdrop .hero-grid, .hero.tpl-image-backdrop-light .hero-grid { position: relative; z-index: 2; }
.hero.tpl-image-backdrop::before, .hero.tpl-image-backdrop-light::before { display: none; }

/* ---------- Image Split: photo fills one half edge-to-edge, content fills the other on a solid background ---------- */
.hero.tpl-image-split { padding: 0; overflow: hidden; }
.hero.tpl-image-split::before { display: none; }
.hero-photo-split { position: absolute; top: 0; bottom: 0; right: 0; width: 46%; z-index: 0; }
.hero-photo-split img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero.tpl-image-split .hero-grid { grid-template-columns: 1fr; position: relative; z-index: 1; padding: 72px 0; max-width: 54%; margin: 0; padding-left: 24px; }
.hero.tpl-image-split .calc-card { max-width: 440px; }

/* ---------- Image Top: photo banner above the hero content ---------- */
.hero-photo-top { width: 100%; max-height: 380px; overflow: hidden; }
.hero-photo-top img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero.tpl-image-top { padding-top: 48px; }

/* ---------- Mobile Calc First: desktop identical to Classic, mobile shows
   the calculator above the text (an experiment to see if this improves
   mobile conversion, since the calculator is the primary call to action) ---------- */
@media (max-width: 900px) {
  .hero.tpl-mobile-calc-first .hero-grid > div:first-child { order: 2; }
  .hero.tpl-mobile-calc-first .hero-grid > .calc-card,
  .hero.tpl-mobile-calc-first .hero-grid > .hero-side-stack { order: 1; margin-bottom: 24px; }
}

/* ---------- Mobile Calc First (Light): same reorder, plus a lighter,
   less "heavy" background on mobile only - a second variant to compare ---------- */
@media (max-width: 900px) {
  .hero.tpl-mobile-calc-first-light .hero-grid > div:first-child { order: 2; }
  .hero.tpl-mobile-calc-first-light .hero-grid > .calc-card,
  .hero.tpl-mobile-calc-first-light .hero-grid > .hero-side-stack { order: 1; margin-bottom: 24px; }
  .hero.tpl-mobile-calc-first-light { background: var(--content-bg, var(--paper)); }
  .hero.tpl-mobile-calc-first-light::before { display: none; }
  .hero.tpl-mobile-calc-first-light h1 { color: var(--ink); }
  .hero.tpl-mobile-calc-first-light p.lead { color: var(--muted); }
  .hero.tpl-mobile-calc-first-light .eyebrow { color: var(--emerald); }
  .hero.tpl-mobile-calc-first-light .eyebrow::before { background: var(--emerald); }
  .hero.tpl-mobile-calc-first-light .hero-stats .stat span { color: var(--muted); }
  .hero.tpl-mobile-calc-first-light .btn-outline { color: var(--ink); border-color: var(--line); }
}

/* Signature element: phone / USSD calculator card */
.calc-card {
  background: var(--calc-bg, var(--ink-2)); border-radius: 20px; padding: 24px; box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.06);
}
.calc-card h3 { color: var(--paper); font-size: 15px; font-weight: 600; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; font-family: var(--font-body); }
.calc-tabs { display: flex; gap: 6px; margin: 14px 0 18px; background: var(--ink); border-radius: 999px; padding: 4px; }
.calc-tabs button {
  flex: 1; background: none; border: none; color: rgba(247,245,240,.6); font-family: var(--font-body);
  font-weight: 600; font-size: 12.5px; padding: 9px 6px; border-radius: 999px; cursor: pointer;
}
.calc-tabs button.active { background: var(--gold); color: var(--ink); }
.calc-field { margin-bottom: 14px; }
.calc-field label { display: block; font-size: 12.5px; color: rgba(247,245,240,.6); margin-bottom: 6px; }
.calc-field input {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12);
  background: var(--ink); color: var(--paper); font-family: var(--font-mono); font-size: 16px;
}
.calc-result { display: flex; justify-content: space-between; align-items: center; background: var(--emerald-l); border-radius: 12px; padding: 14px 16px; margin: 16px 0; }
.calc-result span { font-size: 12.5px; color: var(--emerald); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.calc-result b { font-family: var(--font-mono); font-size: 1.3rem; color: var(--ink); }
.ussd-preview {
  background: var(--ink); border: 1px dashed rgba(227,160,8,.5); border-radius: 12px;
  padding: 14px 16px; font-family: var(--font-mono); color: var(--gold); font-size: 1.15rem;
  letter-spacing: .03em; text-align: center; min-height: 26px;
}
.calc-hint { font-size: 12px; color: rgba(247,245,240,.5); margin-top: 10px; text-align: center; }

/* Sections */
.section { padding: 72px 0; }
.section-alt { background: var(--paper-2); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head .eyebrow { color: var(--emerald); }
.section-head .eyebrow::before { background: var(--emerald); }

.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service-card {
  background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px;
}
.service-card .rate { font-family: var(--font-mono); color: var(--emerald); font-weight: 600; font-size: 1.1rem; }
.service-card a.btn { margin-top: auto; }

/* ---------- Blog ---------- */
.blog-grid { display: grid; gap: 28px; }
.blog-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.blog-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.blog-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.blog-list { display: flex; flex-direction: column; gap: 20px; }

.blog-card {
  display: flex; flex-direction: column; background: #fff; border-radius: var(--radius);
  border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease; color: var(--text);
}
.blog-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(18,33,59,.12); }
.blog-list .blog-card { flex-direction: row; align-items: stretch; }
.blog-card-image { aspect-ratio: 16/10; overflow: hidden; background: var(--paper-2); flex-shrink: 0; }
.blog-list .blog-card-image { width: 260px; aspect-ratio: auto; }
.blog-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.blog-card-date { font-size: 12.5px; color: var(--emerald); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.blog-card-body h3 { font-size: 1.1rem; margin: 0; color: var(--ink); }
.blog-card-body p { font-size: 14px; margin: 0; }
.blog-card-readmore { font-size: 13.5px; font-weight: 700; color: var(--gold-dark); margin-top: auto; padding-top: 6px; }

.blog-post-meta { color: var(--muted); font-size: 14px; }
.blog-post-image { border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; box-shadow: var(--shadow); }
.blog-post-image img { width: 100%; display: block; }
.blog-post-content { font-size: 16px; line-height: 1.75; }
.blog-post-content h2 { margin-top: 32px; }
.blog-post-content h3 { margin-top: 24px; }
.blog-post-content img { border-radius: 12px; margin: 16px 0; }
.blog-post-content ul, .blog-post-content ol { padding-left: 22px; }
.ad-slot { margin: 36px auto; max-width: 728px; text-align: center; }
.ad-slot-label { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.table-scroll { overflow-x: auto; margin: 20px 0; }
.blog-post-content table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 480px; }
.blog-post-content th, .blog-post-content td { padding: 10px 14px; border: 1px solid var(--line); text-align: left; }
.blog-post-content th { background: var(--paper-2); font-weight: 700; color: var(--ink); }
.blog-post-content tr:nth-child(even) td { background: var(--paper-2); }

.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step { position: relative; padding-left: 4px; }
.step .num {
  counter-increment: step; font-family: var(--font-display); font-size: 2.4rem; color: var(--gold);
  opacity: .5; display: block; margin-bottom: 6px;
}
.step .num::before { content: counter(step, decimal-leading-zero); }

.faq-item { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq-item summary { cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 22px; color: var(--gold); }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin-top: 12px; }

.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.trust-item { background: #fff; border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); }
.trust-item .icon { width: 40px; height: 40px; border-radius: 10px; background: var(--emerald-l); color: var(--emerald); display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 12px; }

.hours-banner {
  background: var(--ink); color: var(--paper); border-radius: var(--radius); padding: 24px 28px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.hours-banner .mono { color: var(--gold); }

/* Forms (conversion pages) */
.form-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.conv-form { background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.field input, .field select {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  font-family: var(--font-body); font-size: 15px; background: var(--paper);
}
.field small { color: var(--muted); font-size: 12.5px; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; display: none; }
.form-msg.error { background: #fde8e8; color: #9b2226; display: block; }
.form-msg.success { background: var(--emerald-l); color: var(--emerald); display: block; }
.service-unavailable {
  background: #fff8ec; border: 1.5px dashed var(--gold); border-radius: var(--radius);
  padding: 32px 28px; text-align: center;
}
.service-unavailable .icon { font-size: 2rem; margin-bottom: 10px; }
.service-unavailable p { color: var(--ink); font-weight: 600; margin: 0; }

/* Modal (confirmation / USSD dial) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(18,33,59,.6); display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: var(--radius); max-width: 460px; width: 100%; padding: 30px; text-align: center; }
.modal-box .ref { font-family: var(--font-mono); font-size: 1.1rem; color: var(--emerald); margin: 10px 0; }
.modal-box .ussd-preview { color: var(--ink); border-color: var(--gold); background: var(--paper-2); margin: 16px 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

footer.site-footer { background: var(--ink); color: rgba(247,245,240,.7); padding: 56px 0 0; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 40px; }
.footer-col h3 { color: var(--paper); font-family: var(--font-body); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col a:hover { color: var(--gold); }
.footer-brand { margin-bottom: 10px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0; font-size: 13px; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .cards-3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  /* Image templates: stack the photo above content on narrower screens */
  .hero-photo-split { position: static; width: 100%; height: 240px; margin-bottom: 24px; }
  .hero.tpl-image-split { padding: 32px 0; }
  .hero.tpl-image-split .hero-grid { max-width: 100%; padding: 0 24px; margin: 0 auto; }

  /* Image Backdrop (dark): keeps the photo + dark overlay on mobile too, but now
     shows the calculator before the text - previously had no mobile-specific
     ordering at all, so it silently fell back to a plain text-first stack. */
  .hero.tpl-image-backdrop .hero-grid { max-width: 100%; }
  .hero.tpl-image-backdrop .hero-photo-overlay { background: rgba(18,33,59,.88); }
  .hero.tpl-image-backdrop .hero-grid > div:first-child { order: 2; }
  .hero.tpl-image-backdrop .hero-grid > .calc-card { order: 1; margin-bottom: 24px; }

  /* Image Backdrop (Light): identical to the dark version on desktop (same
     backdrop photo), but on mobile drops the image/dark-overlay treatment
     entirely in favor of a plain light background - calculator still first. */
  .hero.tpl-image-backdrop-light { background: var(--content-bg, var(--paper)); }
  .hero.tpl-image-backdrop-light .hero-photo-backdrop,
  .hero.tpl-image-backdrop-light .hero-photo-overlay { display: none; }
  .hero.tpl-image-backdrop-light .hero-grid { max-width: 100%; }
  .hero.tpl-image-backdrop-light h1 { color: var(--ink); }
  .hero.tpl-image-backdrop-light p.lead { color: var(--muted); }
  .hero.tpl-image-backdrop-light .eyebrow { color: var(--emerald); }
  .hero.tpl-image-backdrop-light .eyebrow::before { background: var(--emerald); }
  .hero.tpl-image-backdrop-light .hero-stats .stat span { color: var(--muted); }
  .hero.tpl-image-backdrop-light .btn-outline { color: var(--ink); border-color: var(--line); }
  .hero.tpl-image-backdrop-light .hero-grid > div:first-child { order: 2; }
  .hero.tpl-image-backdrop-light .hero-grid > .calc-card { order: 1; margin-bottom: 24px; }

  .hero-photo-top { max-height: 220px; }
  .blog-grid.cols-3, .blog-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .blog-list .blog-card { flex-direction: column; }
  .blog-list .blog-card-image { width: 100%; aspect-ratio: 16/10; }
  .trust-grid { grid-template-columns: 1fr; }
  .form-layout { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .main-nav { display: none; position: absolute; top: 76px; left: 0; right: 0; background: var(--ink); padding: 12px 24px 24px; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: flex-start; gap: 4px; }
  .dropdown { display: flex !important; position: static; box-shadow: none; background: none; padding-left: 16px; margin: 0; }
  .nav-toggle { display: flex; }
  .brand-mark, .brand-name { font-size: 21px; }
  .header-inner { gap: 8px; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .app-download-btn { padding: 8px 13px; font-size: 12px; max-width: 38vw; }
  .blog-grid.cols-2, .blog-grid.cols-3, .blog-grid.cols-4 { grid-template-columns: 1fr; }
}

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