/* =========================================================================
   K. L. Fulford Associates, Inc. - site stylesheet
   Dark blue theme, sidebar navigation (top bar on phones). No framework.
   Mobile first; the sidebar layout starts at 56rem (~900px).
   All text colours were checked for >= 7:1 contrast (WCAG AAA).
   ========================================================================= */

/* ---- Design tokens ---------------------------------------------------- */
:root {
  --bg:            #0f2038;   /* page background            */
  --bg-deep:       #0a1626;   /* sidebar / inputs           */
  --panel:         #16314f;   /* cards, panels              */
  --panel-light:   #1b3a5e;   /* top of card gradient       */
  --line:          #2a4a73;   /* hairlines, card borders    */
  --line-strong:   #6f90bb;   /* form borders (3:1+ on bg)  */

  --text:          #eaf0f7;
  --text-muted:    #b9c8da;
  --heading:       #ffffff;
  --link:          #9ec5f5;
  --link-hover:    #cfe3fb;

  --accent:        #d4b06a;   /* muted brass: rules, buttons */
  --accent-hover:  #e3c486;
  --focus:         #f0d28a;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  --radius: 4px;
  --sidebar-w: 17.5rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --measure: 68ch;

  color-scheme: dark;
}

/* ---- Base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;          /* 17px */
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-head);
  color: var(--heading);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 .6em;
  text-wrap: balance;
}
h1 { font-size: clamp(1.95rem, 1.2rem + 3.2vw, 2.9rem); }
h2 { font-size: clamp(1.45rem, 1.15rem + 1.2vw, 1.85rem); }
h3 { font-size: 1.2rem; }

p  { margin: 0 0 1.1em; max-width: var(--measure); }
ul { margin: 0 0 1.1em; padding-left: 1.25rem; }

a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--link-hover); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: absolute; left: .75rem; top: -4rem; z-index: 100;
  padding: .7rem 1rem; background: var(--accent); color: var(--bg-deep);
  font-weight: 700; border-radius: var(--radius);
}
.skip-link:focus { top: .75rem; }

/* ---- Layout: top bar on phones, sidebar on wide screens ---------------- */
.layout { min-height: 100vh; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, #0d1d33 0%, var(--bg-deep) 100%);
  border-bottom: 1px solid var(--line);
}

.header-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .6rem var(--gutter);
}

.brand {
  display: flex; align-items: center; gap: .8rem;
  color: var(--heading); text-decoration: none;
}
.brand:hover { color: var(--heading); }
.brand-mark { width: 2.6rem; flex: none; }
.brand-name {
  font-family: var(--font-head); font-weight: 700;
  font-size: 1.05rem; line-height: 1.2;
}
.brand-tag { display: none; }

/* Menu button (only shown when JavaScript is available) */
.nav-toggle {
  display: none;
  align-items: center; gap: .6rem;
  min-height: 44px; padding: .4rem .9rem;
  font: inherit; font-weight: 600; color: var(--text);
  background: transparent; border: 1px solid var(--line-strong); border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle:hover { background: rgba(255, 255, 255, .06); }
.js .nav-toggle { display: inline-flex; }
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block; width: 1.15rem; height: 2px; background: currentColor; border-radius: 1px;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after  { top:  6px; }

/* Navigation */
.site-nav { padding: 0 var(--gutter) 1rem; max-height: 80vh; overflow-y: auto; }
.js .site-nav { display: none; }
.js .site-nav.is-open { display: block; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; min-height: 44px; padding: .6rem 1rem;
  color: var(--text); text-decoration: none;
  border-left: 3px solid transparent; border-radius: 0 var(--radius) var(--radius) 0;
}
.site-nav a:hover { background: rgba(255, 255, 255, .06); color: var(--heading); }
.site-nav a[aria-current="page"] {
  color: var(--heading); font-weight: 600;
  border-left-color: var(--accent);
  background: linear-gradient(90deg, rgba(212, 176, 106, .16), rgba(212, 176, 106, 0));
}
.site-nav .nav-secondary {
  margin-top: .75rem; padding-top: .75rem;
  border-top: 1px solid var(--line);
}
.nav-secondary a { font-size: .95rem; color: var(--text-muted); }

.side-note { display: none; }

.site-body { display: flex; flex-direction: column; min-height: 100vh; min-width: 0;
  background: linear-gradient(180deg, #112543 0%, var(--bg) 40%, #0d1c33 100%); }
.site-main { flex: 1 0 auto; }

/* ---- Page hero ---------------------------------------------------------- */
.page-hero {
  background:
    linear-gradient(135deg, rgba(44, 82, 130, .55) 0%, rgba(22, 49, 79, 0) 65%),
    var(--panel);
  border-bottom: 1px solid var(--line);
}
.page-hero .wrap { padding-block: clamp(2rem, 5vw, 4rem); }
.page-hero h1::after {
  content: ""; display: block; width: 3.5rem; height: 3px; margin-top: 1rem;
  background: var(--accent);
}
.eyebrow {
  margin: 0 0 .6rem; font-size: .85rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent);
}
.lede { font-size: 1.2rem; line-height: 1.6; max-width: 44rem; margin-bottom: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.75rem; }

.wrap { width: 100%; max-width: 64rem; margin-inline: auto; padding-inline: var(--gutter); }
.content { padding-block: clamp(1.75rem, 4vw, 3.25rem); }
.content > section + section { margin-top: clamp(2rem, 5vw, 3.5rem); }

/* ---- Components --------------------------------------------------------- */
.btn {
  display: inline-block; min-height: 44px; padding: .65rem 1.4rem;
  font: inherit; font-weight: 700; line-height: 1.4; text-align: center; text-decoration: none;
  color: var(--bg-deep); background: var(--accent);
  border: 2px solid var(--accent); border-radius: var(--radius); cursor: pointer;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--bg-deep); }
.btn-outline { color: var(--heading); background: transparent; border-color: var(--line-strong); }
.btn-outline:hover { color: var(--heading); background: rgba(255, 255, 255, .08); border-color: var(--text-muted); }

.facts {
  display: grid; gap: 1px; margin: 0; padding: 0; list-style: none;
  grid-template-columns: 1fr;                       /* stacked rows on phones */
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.facts li { display: flex; align-items: baseline; gap: 1rem; padding: 1rem 1.25rem; background: var(--bg-deep); }
.facts strong { flex: none; min-width: 7.5rem; }
@media (min-width: 36rem) {
  .facts { grid-template-columns: repeat(3, 1fr); }
  .facts li { display: block; padding: 1.1rem 1.25rem; }
  .facts strong { min-width: 0; }
}
.facts strong {
  display: block; font-family: var(--font-head); font-size: 1.7rem; line-height: 1.2; color: var(--accent);
}
.facts span { color: var(--text-muted); font-size: .95rem; }

.card-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); }
.card-grid--wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }  /* 2 across for a set of four */
.card {
  padding: 1.5rem;
  background: linear-gradient(180deg, var(--panel-light) 0%, var(--panel) 100%);
  border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 10px 24px rgba(0, 0, 0, .25);
}
.card p:last-child { margin-bottom: 0; }
.card-link { display: inline-block; margin-top: .25rem; font-weight: 600; }

.check-list { list-style: none; padding: 0; margin: 0 0 1.1em; }
.check-list li { position: relative; padding-left: 1.5rem; margin-bottom: .45rem; max-width: var(--measure); }
.check-list li::before {
  content: ""; position: absolute; left: .1rem; top: .62em;
  width: .5rem; height: .5rem; background: var(--accent); transform: rotate(45deg);
}

.service {
  padding: 1.5rem 0 1.5rem 1.5rem; border-left: 3px solid var(--accent); scroll-margin-top: 5.5rem;
}
.service + .service { margin-top: .5rem; }
.service h2 { margin-bottom: .4em; }

.cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem;
  padding: clamp(1.4rem, 3vw, 2rem);
  background: linear-gradient(135deg, var(--panel-light), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
}
.cta h2 { margin-bottom: .25em; font-size: 1.4rem; }
.cta p { margin: 0; }

/* ---- Forms -------------------------------------------------------------- */
.form-panel {
  max-width: 40rem; padding: clamp(1.25rem, 3vw, 2rem);
  background: linear-gradient(180deg, var(--panel-light) 0%, var(--panel) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 10px 24px rgba(0, 0, 0, .25);
}
.form-field { margin-bottom: 1.25rem; }
.form-field label { display: block; margin-bottom: .4rem; font-weight: 600; }
.form-field input,
.form-field textarea {
  display: block; width: 100%; min-height: 44px; padding: .65rem .8rem;
  font: inherit; color: var(--text); background: var(--bg-deep);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.form-field textarea { min-height: 9rem; resize: vertical; }
.form-field input:focus-visible,
.form-field textarea:focus-visible { outline-offset: 1px; border-color: var(--focus); }
.form-hint { margin: 0 0 1.25rem; color: var(--text-muted); font-size: .95rem; }

/* ---- Footer ------------------------------------------------------------- */
.site-footer {
  flex: none; padding: 1.5rem var(--gutter);
  border-top: 1px solid var(--line); background: var(--bg-deep);
  color: var(--text-muted); font-size: .9rem; text-align: center;
}
.site-footer p { margin: 0 auto; }

/* ---- Wide screens: sidebar --------------------------------------------- */
@media (min-width: 56rem) {
  .layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

  .site-header {
    top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto;
    padding: 2.25rem 1.25rem 1.5rem;
    background:
      linear-gradient(180deg, rgba(44, 82, 130, .22) 0%, rgba(44, 82, 130, 0) 35%),
      linear-gradient(180deg, #0c1b30 0%, #08121f 100%);
    border-bottom: 0; border-right: 1px solid var(--line);
  }
  .header-bar { display: block; padding: 0 .5rem 1.5rem; }
  .brand { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .brand-mark { width: 5.25rem; }
  .brand-name { font-size: 1.3rem; }
  .brand-tag {
    display: block; margin-top: .3rem; font-family: var(--font-body); font-weight: 600;
    font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
  }
  .js .nav-toggle, .nav-toggle { display: none; }

  .site-nav, .js .site-nav { display: block; padding: 1rem 0 0; max-height: none; overflow: visible;
    border-top: 1px solid var(--line); }
  .site-nav a { padding: .65rem 1rem; }

  .side-note {
    display: block; margin: auto .5rem 0; padding-top: 1.5rem;
    font-size: .875rem; line-height: 1.5; color: var(--text-muted);
  }
}

@media (min-width: 56rem) and (max-height: 40rem) {
  .brand-mark { width: 3.5rem; }
  .header-bar { padding-bottom: .75rem; }
}

/* ---- Motion & print ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  a, .btn, .nav-toggle, .site-nav a { transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
}

@media print {
  body { color: #000; background: #fff; font-size: 11pt; }
  .site-header, .site-footer, .skip-link, .hero-actions, .cta { display: none; }
  .layout { display: block; }
  .page-hero, .card, .form-panel { background: none; box-shadow: none; border-color: #999; }
  h1, h2, h3 { color: #000; }
  a { color: #000; }
}
