/* ==========================================================================
   Home Resilience & FORTIFIED — landing page
   ========================================================================== */

:root {
  --green: #1E7B34;
  --green-dark: #145A26;
  --green-tint: #BFE3C8;
  --check: #7FD196;
  --navy: #0B3B6E;
  --navy-deep: #062A50;
  --navy-footer: #0B2A4A;
  --hero-shade: 8, 24, 44;         /* rgb of the hero overlay */
  --ink: #1D2A36;
  --ink-muted: #4F5D6B;
  --on-dark-muted: #B9C8D8;
  --footer-text: #C9D6E3;
  --band: #EDEDED;
  --line: #D5DBE1;
  --white: #fff;
  --font: "Montserrat", Arial, Helvetica, sans-serif;
  --container: 1240px;
  --gutter: 40px;
  --shadow: 0 18px 40px rgba(11, 42, 74, .14);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }
ul { margin: 0; padding: 0; list-style: none; }
main:focus, section[tabindex="-1"]:focus { outline: none; }
/* Keep anchored sections and focused elements clear of the fixed nav (WCAG 2.4.11) */
html { scroll-padding-top: calc(var(--nav-h, 100px) + 16px); }

/* Focus: two-tone ring visible on light and dark backgrounds */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--navy-footer);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--white);
}
.site-header a:focus-visible, .site-header button:focus-visible,
.hero a:focus-visible, .on-dark a:focus-visible, .site-footer a:focus-visible {
  outline-color: var(--white);
  box-shadow: 0 0 0 5px var(--navy-footer);
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--white); color: var(--navy-footer);
  padding: 12px 18px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Type ---------- */
.eyebrow {
  margin: 0 0 14px;
  font-size: 13px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--green);
}
.eyebrow-light { color: var(--green-tint); margin-bottom: 18px; }
h2 { font-size: 38px; font-weight: 400; color: var(--navy); margin-bottom: 20px; }
h2.light { font-weight: 300; color: var(--white); }
.h2-sm { font-size: 30px; margin-bottom: 10px; }
.h2-md { font-size: 32px; }
.mb-md { margin-bottom: 36px; }
.mb-lg { margin-bottom: 48px; }
.body-lg { font-size: 17px; line-height: 1.7; }
.split-text .body-lg { margin-bottom: 32px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 12px 22px;
  font-family: var(--font); font-size: 14px; font-weight: 600; letter-spacing: .02em;
  text-decoration: none; text-align: center; border-radius: 0;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-solid { background: var(--green); color: var(--white); border: 2px solid var(--green); }
.btn-solid:hover { background: var(--green-dark); border-color: var(--green-dark); color: var(--white); }
.btn-ghost { background: transparent; color: var(--white); border: 2px solid var(--white); }
.btn-ghost:hover { background: var(--white); color: var(--navy-footer); }
.btn-dark { background: transparent; color: var(--navy-footer); border: 2px solid var(--navy-footer); }
.btn-dark:hover { background: var(--navy-footer); color: var(--white); }
.btn-group { display: flex; flex-wrap: wrap; gap: 16px; }

/* ---------- Header / nav ----------
   The header is sticky with a negative top equal to the co-brand banner's height,
   so the banner scrolls away and the nav bar (absolutely positioned just below it)
   stays pinned to the top of the viewport. script.js keeps --cobrand-h and --nav-h
   in sync with the real heights and adds .is-scrolled once the page moves. */
.site-header {
  position: sticky;
  top: calc(var(--cobrand-h, 44px) * -1);
  z-index: 50;
}
.nav-wrap {
  background-color: rgba(11, 42, 74, 0);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: background-color .3s ease, box-shadow .3s ease;
}
.site-header.is-scrolled .nav-wrap,
.no-js .nav-wrap {
  background-color: rgba(11, 42, 74, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.cobrand {
  background: var(--green); color: var(--white);
  text-align: center; padding: 10px 20px;
  font-size: 14px; font-weight: 500; line-height: 1.45;
}
.nav-wrap { position: absolute; left: 0; right: 0; top: 100%; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 18px; padding-bottom: 18px; }
.nav-logo { display: block; padding: 4px 0; }
.nav-logo img { width: 120px; }
.nav-links { display: flex; align-items: center; gap: 30px; font-size: 14px; font-weight: 500; }
.nav-links a:not(.btn) { display: inline-block; padding: 10px 0; color: var(--white); text-decoration: none; white-space: nowrap; }
.nav-links a:not(.btn):hover { color: var(--green-tint); text-decoration: underline; text-underline-offset: 4px; }
.nav-cta { margin-left: 18px; }
.nav-cta .btn { min-height: 44px; padding: 9px 18px; white-space: nowrap; }

.menu-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0;
  background: var(--green); border: 2px solid var(--green); color: var(--white);
  cursor: pointer;
}
.menu-toggle:hover { background: var(--green-dark); border-color: var(--green-dark); }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

/* ---------- Hero ---------- */
.hero {
  color: var(--white);
  background-color: #08182C;
  background-image:
    linear-gradient(90deg, rgba(var(--hero-shade), .72) 0%, rgba(var(--hero-shade), .4) 45%, rgba(var(--hero-shade), 0) 75%),
    url("images/hero-storm.jpg");
  background-size: cover;
  background-position: 70% center;
}
.hero-inner { padding-top: 190px; padding-bottom: 140px; }
.hero-inner > * { max-width: 640px; }
.hero h1 { font-size: 54px; line-height: 1.12; font-weight: 300; margin-bottom: 24px; }
.hero-lede { font-size: 18px; max-width: 580px; margin-bottom: 36px; }

/* ---------- Sections ---------- */
.section { padding: 110px 0; }
.section-white { background: var(--white); }
.bg-grid { background: var(--white) url("images/graph-paper.png") repeat; }
.bg-navy { background: var(--navy); color: var(--white); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split-5-7 { grid-template-columns: 5fr 7fr; }
.split-top { align-items: start; }

.section-img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; margin-bottom: 36px; }
.section-img-bottom { margin: 32px 0 0; }
#financing .body-lg { margin-bottom: 0; }

/* Browser-frame screenshot */
.browser-frame { margin: 0; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); }
.browser-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: #EEF1F4; border-bottom: 1px solid var(--line); }
.browser-bar span { width: 10px; height: 10px; border-radius: 50%; background: #C6CDD4; }
.browser-bar em { margin-left: 12px; font-style: normal; font-size: 12px; color: var(--ink-muted); }
.browser-frame img { width: 100%; }

/* Feature (image + navy panel) */
.feature { display: grid; grid-template-columns: 1fr 1fr; box-shadow: var(--shadow); }
.feature-img { width: 100%; height: 100%; min-height: 360px; object-fit: cover; object-position: 68% center; }
.feature-body { background: var(--navy); color: var(--white); padding: 56px 52px; }
.feature-body > p { margin-bottom: 26px; line-height: 1.7; }
.checklist { display: flex; flex-direction: column; gap: 14px; margin-bottom: 34px; line-height: 1.5; }
.checklist li { position: relative; padding-left: 34px; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 22px; height: 22px;
  background: no-repeat center / 22px 22px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237FD196' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E");
}
.feature .btn-group { gap: 14px; }

/* Callout */
.callout {
  margin-top: 56px; display: grid; grid-template-columns: auto 1fr auto; gap: 32px; align-items: center;
  background: var(--band); padding: 32px 40px;
}
.callout-badge { width: 72px; }
.callout h3 { font-size: 24px; font-weight: 500; color: var(--navy); margin-bottom: 8px; }

/* Link panels */
.link-panel-dark { background: var(--navy-deep); padding: 44px 44px 28px; }
.link-panel-dark h3 { font-size: 18px; font-weight: 500; margin-bottom: 10px; }
.link-panel-light { background: var(--white); border: 1px solid var(--line); padding: 36px 40px 20px; box-shadow: 0 18px 40px rgba(11, 42, 74, .10); }
.link-panel-light .eyebrow { margin-bottom: 6px; line-height: 1.6; }
.link-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0; text-decoration: none;
}
.link-list li:not(:last-child) a { border-bottom: 1px solid var(--line); }
.link-list strong { display: block; font-size: 17px; font-weight: 600; }
.link-list small { display: block; font-size: 14px; margin-top: 4px; color: var(--ink-muted); }
.link-list svg { flex: none; }
.link-panel-light a { color: var(--navy-footer); }
.link-panel-light a:hover { color: var(--green); }
.link-panel-dark a { color: var(--white); }
.link-panel-dark a:hover { color: var(--green-tint); }
.link-panel-dark li:not(:last-child) a { border-bottom-color: rgba(255, 255, 255, .22); }
.link-panel-dark small { color: var(--on-dark-muted); }

/* Band */
.band { background: var(--band); padding: 64px 0; }
.band-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 40px; align-items: center; }
.band-icon { color: var(--navy); }
.band p { max-width: 720px; line-height: 1.7; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
.card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 32px 28px; background: var(--white);
  border-top: 4px solid var(--green); box-shadow: 0 10px 30px rgba(11, 42, 74, .12);
}
.card svg { color: var(--green); }
.card h3 { font-size: 20px; font-weight: 600; color: var(--navy); }
.card p { font-size: 15px; flex: 1; }
.card-links { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.card-links a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; display: inline-block; padding: 3px 0; }

/* Resources */
.resources { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.resources a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; height: 100%; padding: 20px 22px;
  background: var(--white); border: 1px solid var(--line);
  color: var(--navy-footer); text-decoration: none; font-weight: 500;
}
.resources a:hover { border-color: var(--green); color: var(--green); }
.resources svg { flex: none; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-footer); color: var(--footer-text);
  padding: 64px 20px 56px; text-align: center; font-size: 14px; line-height: 1.55;
}
.site-footer img { width: 110px; margin: 0 auto 22px; }
.site-footer p { margin-bottom: 8px; }
.site-footer p:last-of-type { margin-bottom: 18px; }
.site-footer ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px; font-weight: 500; }
.site-footer a { color: var(--footer-text); text-decoration: underline; text-underline-offset: 3px; display: inline-block; padding: 6px 0; }
.site-footer a:hover { color: var(--white); }

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Collapse nav into menu button (full nav needs ~1035px in Montserrat; 1100px leaves breathing room) */
@media (max-width: 1099px) {
  .js .menu-toggle { display: inline-flex; }
  .js .nav { flex-wrap: nowrap; }
  .js .nav-links {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--navy-footer);
    padding: 8px var(--gutter) 24px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, .3);
    font-size: 16px;
    max-height: calc(100vh - var(--nav-h, 80px));
    max-height: calc(100dvh - var(--nav-h, 80px));
    overflow-y: auto;
  }
  .site-header.menu-open .nav-wrap { background-color: var(--navy-footer); }
  .js .nav-links.is-open { display: flex; }
  .js .nav-links a:not(.btn) { display: block; padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, .16); }
  .js .nav-cta { margin: 20px 0 0; }
  .js .nav-cta .btn { width: 100%; min-height: 50px; font-size: 15px; }
  /* No-JS fallback: links simply wrap */
  .no-js .nav { flex-wrap: wrap; }
  .no-js .nav-links { flex-wrap: wrap; gap: 4px 22px; }
}

@media (max-width: 860px) {
  :root { --gutter: 20px; }
  .section { padding: 64px 0; }
  .split, .split-5-7, .feature { grid-template-columns: 1fr; gap: 28px; }
  h2 { font-size: 28px; margin-bottom: 16px; }
  .h2-sm, .h2-md { font-size: 26px; }
  .body-lg { font-size: 16px; line-height: 1.65; }

  .btn-group { flex-direction: column; gap: 12px; }
  .btn-group .btn, .split-text > .btn, .callout .btn, .band .btn { width: 100%; min-height: 50px; font-size: 15px; }

  /* Risk: screenshot sits between copy and button */
  .split-5-7 { display: flex; flex-direction: column; align-items: stretch; }
  .split-5-7 .split-text { display: contents; }
  .split-5-7 .split-text > .btn { order: 3; }
  .split-5-7 .browser-frame { order: 2; }
  .split-text .body-lg { margin-bottom: 0; }
  .browser-bar { padding: 9px 12px; }
  .browser-bar span { width: 8px; height: 8px; }
  .browser-bar em { display: none; }

  /* Feature: image full-bleed above panel */
  #fortified { padding-top: 0; }
  #fortified .container { padding: 0; }
  .feature { gap: 0; box-shadow: none; }
  .feature-img { height: 260px; min-height: 0; object-position: 72% center; }
  .feature-body { padding: 40px 20px 44px; }
  .callout { margin: 40px 20px 0; grid-template-columns: 52px 1fr; gap: 12px 16px; padding: 28px 22px; }
  .callout-badge { width: 52px; }
  .callout h3 { font-size: 22px; margin: 0; align-self: center; }
  .callout > div { display: contents; }
  .callout p { grid-column: 1 / -1; }
  .callout .btn { grid-column: 1 / -1; margin-top: 8px; }

  /* Flood: image full-bleed above copy */
  #flood { padding-top: 0; padding-bottom: 48px; }
  #flood .split > div:first-child { margin: 0 calc(var(--gutter) * -1); }
  #flood .section-img { height: 240px; aspect-ratio: auto; margin-bottom: 40px; }
  #flood h2, #flood .body-lg { padding: 0 var(--gutter); }
  .link-panel-dark { padding: 26px 20px 12px; }
  .link-panel-light { padding: 24px 20px 8px; }
  .link-list a { padding: 16px 0; }
  .link-list strong { font-size: 16px; }

  /* Financing: image between copy and links */
  .section-img-bottom { margin-top: 26px; }

  .band { padding: 48px 0; }
  .band-inner { grid-template-columns: 1fr; gap: 16px; }
  .band-icon { width: 44px; height: 44px; }
  .band p { margin-bottom: 8px; }

  .mb-lg { margin-bottom: 28px; }
  .mb-md { margin-bottom: 24px; }
  .cards { grid-template-columns: 1fr; gap: 20px; }
  .card { padding: 26px 22px; gap: 12px; }
  .resources { grid-template-columns: 1fr; gap: 10px; }
  .resources a { padding: 16px 18px; font-size: 15px; }

  .site-footer { padding: 48px 20px 44px; }
  .site-footer img { width: 100px; }
  .site-footer ul { flex-direction: column; align-items: center; gap: 0; }
}

/* Small desktop hero: shift the photo so the house clears a narrower copy column */
@media (min-width: 1025px) and (max-width: 1365px) {
  .hero { background-position: 55% center; }
  .hero-inner > * { max-width: 520px; }
  .hero h1 { font-size: 48px; }
}

/* Tablet landscape / small laptop hero: copy left, house right.
   The photo is a fixed 600px tall and pinned to the right edge, so the house
   holds its place at the right while the copy column narrows with the viewport. */
@media (min-width: 861px) and (max-width: 1024px) {
  .hero {
    background-image:
      linear-gradient(180deg, rgba(var(--hero-shade), 0) 0, rgba(var(--hero-shade), 0) 470px, rgba(var(--hero-shade), .95) 600px, rgba(var(--hero-shade), .95) 100%),
      linear-gradient(90deg, rgba(var(--hero-shade), .75) 0%, rgba(var(--hero-shade), .45) 45%, rgba(var(--hero-shade), 0) 62%),
      url("images/hero-storm.jpg");
    background-size: 100% 100%, 100% 100%, auto 600px;
    background-repeat: no-repeat;
    background-position: 0 0, 0 0, right -263px top 0;
  }
  .hero-inner { padding-top: 130px; padding-bottom: 80px; }
  .hero-inner > * { max-width: min(520px, calc(100vw - 420px)); }
  .hero h1 { font-size: clamp(40px, 5vw, 48px); }
  .hero-lede { font-size: 17px; }
}

/* Tablet portrait hero: the house can't sit beside the copy at these widths,
   so the photo becomes a band across the top and the copy sits on navy below it. */
@media (min-width: 601px) and (max-width: 860px) {
  .hero {
    background-image:
      linear-gradient(180deg, rgba(var(--hero-shade), 0) 0, rgba(var(--hero-shade), 0) 44vw, rgba(var(--hero-shade), .95) 55vw, rgba(var(--hero-shade), .95) 100%),
      url("images/hero-storm.jpg");
    background-size: 100% 100%, 130% auto;
    background-repeat: no-repeat;
    background-position: 0 0, 80% top;
  }
  .hero-inner { padding-top: calc(55vw + 8px); padding-bottom: 80px; }
  .hero h1 { font-size: clamp(38px, 5vw, 48px); }
}

/* Phone hero: photo on top with the full house in view, copy on navy below */
@media (max-width: 600px) {
  .cobrand { font-size: 12px; padding: 9px 16px; }
  .nav { padding-top: 14px; padding-bottom: 14px; }
  .nav-logo img { width: 100px; }
  .hero {
    background-image:
      linear-gradient(180deg, rgba(var(--hero-shade), 0) 0, rgba(var(--hero-shade), 0) 300px, rgba(var(--hero-shade), .95) 390px, rgba(var(--hero-shade), .95) 100%),
      url("images/hero-storm.jpg");
    background-size: 100% 100%, auto 420px;
    background-repeat: no-repeat;
    background-position: 0 0, 75% -30px;
  }
  .hero-inner { padding-top: 380px; padding-bottom: 56px; }
  .hero h1 { font-size: 34px; line-height: 1.15; margin-bottom: 18px; }
  .hero-lede { font-size: 16px; margin-bottom: 28px; }
  .eyebrow { font-size: 12px; }
}

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