/* ============================================================
   global.css
   Middlebrook Technology Advisors
   Shared styles, loaded on every page via layout.cfm.
   Page-specific styles live in each page's scoped <style> block.

   TABLE OF CONTENTS
   1.  Design tokens
   2.  Reset and base
   3.  Typography
   4.  Site header and navigation
   5.  Mobile navigation drawer
   6.  Layout: containers and section bands
   7.  Section headings and eyebrows
   7b. Shared page bands (page hero, CTA)
   8.  Buttons
   9.  Forms (contact page)
   10. Footer
   11. Utilities and accessibility
   12. Responsive
   ============================================================ */


/* ============================================================
   1. DESIGN TOKENS
   Colors sampled from the logo and homepage mockup.
   ============================================================ */
:root {
  /* Brand */
  --c-navy:        #0A2E44;  /* logo navy, headings, nav */
  --c-navy-deep:   #03233A;  /* hero + CTA bands, footer */
  --c-teal:        #017F86;  /* buttons, eyebrows, icons, active nav */
  --c-teal-dark:   #00676D;  /* button hover */
  --c-teal-bright: #1FBFA6;  /* logo swoosh highlight, accents on dark */
  --c-teal-soft:   #7DC5BD;  /* eyebrow text on navy */

  /* Surfaces */
  --c-white:       #FFFFFF;
  --c-ice:         #F8FBFD;  /* services band */
  --c-mist:        #EEF6F8;  /* founder band */
  --c-border:      #DCE6EC;

  /* Text */
  --c-ink:         #0A2E44;  /* headings */
  --c-text:        #22313C;  /* body */
  --c-muted:       #4E5E69;  /* secondary copy */
  --c-on-dark:     #FFFFFF;
  --c-on-dark-muted: rgba(255, 255, 255, 0.78);

  /* Status (contact form) */
  --c-error:       #A4262C;
  --c-success:     #146B43;

  /* Type
     --font-headline: h1/h2 page and section headlines
     --font-display:  h3, card titles, nav, buttons, eyebrows
     --font-body:     everything else */
  --font-headline: 'Montserrat', 'Red Hat Display', Arial, sans-serif;
  --font-display:  'Red Hat Display', Arial, sans-serif;
  --font-body:     'Red Hat Text', Arial, sans-serif;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;   /* buttons, inputs */
  --radius-lg: 12px;  /* cards */

  /* Shadows */
  --shadow-card:  0 4px 18px rgba(10, 46, 68, 0.08);
  --shadow-hover: 0 10px 28px rgba(10, 46, 68, 0.12);

  /* Layout */
  --nav-height:    92px;
  --content-width: 1180px;
  --narrow-width:  760px;
}


/* ============================================================
   2. RESET AND BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 8px);
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

ul[role="list"], ol[role="list"] {
  list-style: none;
}

a {
  color: var(--c-teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--c-teal-dark);
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}


/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1, h2 {
  font-family: var(--font-headline);
  font-weight: 800;
  color: var(--c-ink);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--c-ink);
  line-height: 1.25;
}

h1 { font-size: clamp(32px, 4.4vw, 50px); }
h2 { font-size: clamp(28px, 3.4vw, 40px); }
h3 { font-size: 20px; }
h4 { font-size: 17px; }

p + p {
  margin-top: var(--space-4);
}

.lead {
  font-size: clamp(18px, 1.6vw, 20px);
  line-height: 1.55;
}


/* ============================================================
   4. SITE HEADER AND NAVIGATION
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-height);
  background: var(--c-white);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.2s, border-color 0.2s;
}

/* Toggled by nav.js once the page scrolls */
.site-header.is-scrolled {
  border-bottom-color: var(--c-border);
  box-shadow: 0 2px 14px rgba(10, 46, 68, 0.08);
}

.site-header-inner {
  max-width: var(--content-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

.site-logo {
  flex-shrink: 0;
  display: block;
}

.site-logo img {
  width: auto;
  height: 52px;
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: var(--space-2) 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--c-navy);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 3px;
  border-radius: 2px;
  background: var(--c-teal);
  transform: scaleX(0);
  transition: transform 0.2s;
}

.nav-link:hover {
  color: var(--c-teal);
}

.nav-link--active {
  color: var(--c-teal);
}

.nav-link--active::after {
  transform: scaleX(1);
}

/* Visually hidden checkbox drives the no-JS drawer */
.mobile-nav-toggle {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.nav-hamburger:hover {
  background: var(--c-mist);
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-navy);
  transition: transform 0.2s, opacity 0.2s;
}

.nav-hamburger[aria-expanded="true"] .hamburger-line:nth-child(1),
.mobile-nav-toggle:checked ~ .site-header .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger[aria-expanded="true"] .hamburger-line:nth-child(2),
.mobile-nav-toggle:checked ~ .site-header .hamburger-line:nth-child(2) {
  opacity: 0;
}

.nav-hamburger[aria-expanded="true"] .hamburger-line:nth-child(3),
.mobile-nav-toggle:checked ~ .site-header .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ============================================================
   5. MOBILE NAVIGATION DRAWER
   ============================================================ */
.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 400;
  width: min(320px, 85vw);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--c-navy-deep);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}

.mobile-nav.is-open,
.mobile-nav-toggle:checked ~ .mobile-nav {
  transform: translateX(0);
  visibility: visible;
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 350;
  background: rgba(3, 35, 58, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.mobile-nav-overlay.is-visible,
.mobile-nav-toggle:checked ~ .mobile-nav-overlay {
  opacity: 1;
  visibility: visible;
}

body:has(.mobile-nav-toggle:checked) {
  overflow: hidden;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-logo {
  width: 180px;
  height: auto;
}

.mobile-nav-close {
  flex-shrink: 0;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--c-on-dark-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.mobile-nav-close:hover {
  color: var(--c-white);
  background: rgba(255, 255, 255, 0.08);
}

.mobile-nav-body {
  flex: 1;
  padding: var(--space-3) 0;
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
}

.mobile-nav-link {
  display: block;
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-on-dark-muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s;
}

.mobile-nav-link:hover {
  color: var(--c-white);
  background: rgba(255, 255, 255, 0.05);
}

.mobile-nav-link--active {
  color: var(--c-white);
  border-left-color: var(--c-teal-bright);
}


/* ============================================================
   6. LAYOUT: CONTAINERS AND SECTION BANDS
   ============================================================ */
.site-main {
  min-height: calc(100vh - var(--nav-height));
}

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--narrow {
  max-width: calc(var(--narrow-width) + (var(--space-6) * 2));
}

.section {
  padding: var(--space-16) 0;
}

.section--ice   { background: var(--c-ice); }
.section--mist  { background: var(--c-mist); }

.section--navy {
  background: var(--c-navy-deep);
  color: var(--c-on-dark);
}

.section--navy h1,
.section--navy h2,
.section--navy h3 {
  color: var(--c-on-dark);
}

.section--navy p {
  color: var(--c-on-dark-muted);
}


/* ============================================================
   7. SECTION HEADINGS AND EYEBROWS
   ============================================================ */
.section-head {
  text-align: center;
  margin-bottom: var(--space-10);
}

.section-title {
  margin-top: var(--space-2);
}

/* Small tracked label above a section title.
   Centered version gets rules on both sides (mockup: OUR SERVICES). */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-teal);
}

.eyebrow--ruled::before,
.eyebrow--ruled::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  background: currentColor;
}

.section--navy .eyebrow {
  color: var(--c-teal-soft);
}


/* ============================================================
   7b. SHARED PAGE BANDS
   .page-hero: navy header on interior pages (contact, services...)
   .cta-band:  closing call to action (/includes/cta_band.cfm)
   ============================================================ */
.page-hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-16) 0 var(--space-12);
  background: radial-gradient(120% 160% at 90% 0%, var(--c-navy) 0%, var(--c-navy-deep) 60%);
  color: var(--c-on-dark);
}

.page-hero .eyebrow {
  color: var(--c-teal-soft);
}

.page-hero-title {
  margin-top: var(--space-2);
  max-width: 22ch;
  color: var(--c-on-dark);
}

.page-hero-sub {
  margin-top: var(--space-4);
  max-width: 58ch;
  font-size: clamp(18px, 1.6vw, 20px);
  font-style: italic;
  color: var(--c-on-dark-muted);
}

.cta-band {
  position: relative;
  overflow: hidden;
}

.cta-swoosh {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(520px, 50%);
  height: 100%;
  pointer-events: none;
}

.cta-inner {
  position: relative;
  z-index: 1;
}

.cta-sub {
  margin-top: var(--space-3);
  font-size: clamp(18px, 1.6vw, 20px);
  font-style: italic;
}

.cta-actions {
  justify-content: center;
  margin-top: var(--space-8);
}


/* ============================================================
   8. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 48px;
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn i {
  font-size: 0.95em;
}

/* Solid teal: Let's Talk, Get in Touch */
.btn--primary {
  background: var(--c-teal);
  color: var(--c-white);
}

.btn--primary:hover {
  background: var(--c-teal-dark);
  color: var(--c-white);
}

/* White outline on navy: How We Help, Schedule a Call */
.btn--outline-light {
  background: transparent;
  color: var(--c-white);
  border-color: rgba(255, 255, 255, 0.85);
}

.btn--outline-light:hover {
  background: var(--c-white);
  color: var(--c-navy);
  border-color: var(--c-white);
}

/* Navy outline on light backgrounds */
.btn--outline {
  background: transparent;
  color: var(--c-navy);
  border-color: var(--c-navy);
}

.btn--outline:hover {
  background: var(--c-navy);
  color: var(--c-white);
}

.btn--lg {
  min-height: 56px;
  padding: var(--space-4) var(--space-8);
  font-size: 18px;
}

.btn--block {
  width: 100%;
}

.btn:disabled,
.btn.is-loading {
  opacity: 0.65;
  cursor: wait;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}


/* ============================================================
   9. FORMS (contact page)
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--c-ink);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: 16px;  /* 16px+ stops iOS zoom on focus */
  color: var(--c-text);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-textarea {
  min-height: 160px;
  resize: vertical;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #8696A0;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--c-teal);
  box-shadow: 0 0 0 3px rgba(1, 127, 134, 0.18);
}

.form-input[aria-invalid="true"],
.form-textarea[aria-invalid="true"] {
  border-color: var(--c-error);
  box-shadow: 0 0 0 3px rgba(164, 38, 44, 0.14);
}

.form-hint {
  font-size: 14px;
  color: var(--c-muted);
}

.form-status {
  min-height: 22px;
  font-size: 15px;
  text-align: center;
}

.form-status--error {
  color: var(--c-error);
  font-weight: 700;
}

.form-status--success {
  color: var(--c-success);
  font-weight: 700;
}


/* ============================================================
   10. FOOTER
   ============================================================ */
.site-footer {
  background: var(--c-navy-deep);
  color: var(--c-on-dark-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-12) var(--space-6) var(--space-8);
}

.footer-grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-10);
}

.footer-logo {
  display: inline-block;
}

.footer-logo img {
  width: 240px;
  height: auto;
}

.footer-tagline {
  margin-top: var(--space-4);
  max-width: 34ch;
  font-size: 15px;
  font-style: italic;
  color: var(--c-on-dark-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-8);
}

.footer-link {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--c-white);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--c-teal-bright);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
}

.footer-bottom-link {
  color: var(--c-on-dark-muted);
}

.footer-bottom-link:hover {
  color: var(--c-white);
}


/* ============================================================
   11. UTILITIES AND ACCESSIBILITY
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 1000;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--c-white);
  background: var(--c-navy);
  border-radius: var(--radius-md);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-4);
  color: var(--c-white);
}

:focus-visible {
  outline: 3px solid var(--c-teal);
  outline-offset: 3px;
}

.section--navy :focus-visible,
.site-footer :focus-visible,
.mobile-nav :focus-visible {
  outline-color: var(--c-teal-bright);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.text-center { text-align: center; }

/* nav.js scroll sentinel */
.header-scroll-sentinel {
  position: absolute;
  top: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* ============================================================
   12. RESPONSIVE
   ============================================================ */

/* Tablet: collapse nav to hamburger */
@media (max-width: 860px) {
  :root {
    --nav-height: 76px;
  }

  .site-nav {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .site-logo img {
    height: 42px;
  }

  .section {
    padding: var(--space-12) 0;
  }

  .footer-grid {
    flex-direction: column;
    gap: var(--space-8);
  }
}

/* Mobile */
@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .container,
  .site-header-inner {
    padding: 0 var(--space-5);
  }

  .site-logo img {
    height: 34px;
  }

  .eyebrow {
    font-size: 13px;
    gap: var(--space-3);
  }

  .eyebrow--ruled::before,
  .eyebrow--ruled::after {
    width: 24px;
  }

  .btn-row .btn {
    flex: 1 1 100%;
  }

  .page-hero {
    padding: var(--space-12) 0 var(--space-10);
  }

  .cta-swoosh {
    opacity: 0.6;
  }

  .site-footer-inner {
    padding: var(--space-10) var(--space-5) var(--space-6);
  }
}
