/* =========================================================
   in2vate.com — Global styles (every page)
   Tokens, base, buttons and the shared components:
   header, closing CTA panel and footer.
   Page-specific styles live in home.css, contact/contact.css, …
   Tokens follow the in2vate Website Style Guide v1.0
   ========================================================= */

:root {
  /* Brand */
  --navy: #0B2265;
  --deep-navy: #071A4F;
  --navy-mid: #0B2E77;
  --teal: #008D72;
  --teal-dark: #00745E;
  --teal-light: #3CC9A4;   /* on navy only */
  --teal-tint: #EAF6F1;

  /* Neutrals & text */
  --ink: #1B2A4A;
  --slate: #5A6472;
  --stone: #8A8A82;
  --sand: #EAEAE5;
  --paper: #F4F4F1;
  --white: #FFFFFF;
  --border: #E5E5E0;
  --border-btn: #C9CFD9;
  --row-hover: #FAFAF8;

  /* Feedback — proposed error color, pending design approval (style guide has none) */
  --error: #B42318;
  --error-tint: #FDF1F0;

  /* Type */
  --font-display: "Poppins", sans-serif;
  --font-body: "Mulish", Helvetica, sans-serif;
  --fs-h1: clamp(33px, 4.6vw, 62px);
  --fs-h2: clamp(22px, 2.4vw, 32px);
  --fs-h3: clamp(18px, 1.4vw, 20px);
  --fs-lead: clamp(16px, 1.5vw, 19px);
  --fs-quote: clamp(17px, 1.6vw, 21px);
  --measure: 62ch;

  /* Layout */
  --container: 1300px;
  --gutter: clamp(16px, 3vw, 40px);
  --section-y: clamp(42px, 5.5vw, 84px);
  --hero-y: clamp(50px, 7vw, 104px);
  --hero-overlap: clamp(24px, 4vw, 52px); /* hero visual overlap into the next section */
  --header-h: 63px; /* kept in sync with the real header height by main.js */

  /* Radius */
  --r-btn: 8px;
  --r-btn-lg: 9px;
  --r-tile: 10px;
  --r-menu: 12px;
  --r-card: 16px;
  --r-card-sm: 14px;   /* cards and hero visual on phones */
  --r-label: 6px;
  --r-visual: 16px;
  --r-rail: 22px;

  /* Elevation (navy-tinted) */
  --shadow-rest: 0 2px 14px rgba(11, 34, 101, 0.07);
  --shadow-hover: 0 10px 30px rgba(11, 34, 101, 0.13);
  --shadow-menu: 0 14px 34px rgba(11, 34, 101, 0.14);
  --shadow-visual: 0 14px 34px rgba(7, 26, 79, 0.4);

  /* Gradients */
  --grad-hero-glow: radial-gradient(120% 85% at 82% 8%, rgba(14, 127, 110, 0.8) 0%, rgba(7, 26, 79, 0) 62%);

  --focus: 0 0 0 3px var(--white), 0 0 0 5px var(--teal);
}

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

html { scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  color: inherit;
  margin: 0;
  text-wrap: pretty;
}

p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: var(--teal); }

/* Transparent outline keeps the ring visible in Windows forced-colors mode */
:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus); border-radius: 4px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  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-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: var(--r-btn);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Eyebrow ---------- */
.eyebrow {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--teal);
}
.eyebrow-on-dark { color: var(--teal-light); }
/* Labels containing the brand name are never uppercased */
.eyebrow-brand { text-transform: none; letter-spacing: 0.04em; font-size: 13px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn-sm { font-size: 13px; padding: 9px 16px; }
.btn-lg { font-size: 14.5px; padding: 15px 28px; border-radius: var(--r-btn-lg); }

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

.btn-secondary { background: transparent; color: var(--navy); border-color: var(--border-btn); }
.btn-secondary:hover { border-color: var(--navy); background: var(--white); }

.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, 0.5); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }

/* =========================================================
   HEADER (shared)
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 32px);
  padding-block: 13px;
}

.brand img { height: 34px; width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 24px);
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.3vw, 20px);
}

.nav-link {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 6px 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-link:hover { color: var(--teal); }
/* Current page: color plus an underline, so it is not shown by color alone */
.nav-link[aria-current="page"],
.dropdown-toggle.is-current { --current-mark: inset 0 -2px 0 var(--teal); color: var(--teal); box-shadow: var(--current-mark); }
/* Keep the focus ring on the current link (its marker is also a box-shadow) */
.nav-link[aria-current="page"]:focus-visible,
.dropdown-toggle.is-current:focus-visible { box-shadow: var(--focus), var(--current-mark); }
.caret { font-size: 14px; line-height: 1; transition: transform 0.15s ease; }

.nav-actions { display: flex; align-items: center; gap: 10px; }
/* The header is white, so the secondary hover uses Paper to stay visible */
.nav-actions .btn-secondary:hover { background: var(--paper); }

/* Risk dropdown — opened by main.js (hover, click, keyboard) */
.has-dropdown { position: relative; }

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: -14px;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-menu);
  box-shadow: var(--shadow-menu);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}
/* hover bridge so the menu doesn't close crossing the gap */
.dropdown::before { content: ""; position: absolute; inset: -12px 0 auto; height: 12px; }

.dropdown a {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  padding: 11px 14px;
  border-radius: var(--r-btn);
}
.dropdown a:hover { background: var(--paper); color: var(--teal); }

.has-dropdown.is-open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.has-dropdown.is-open .caret { transform: rotate(180deg); }

/* Mobile menu button (hidden on desktop) */
.menu-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-btn);
  border-radius: var(--r-btn);
  background: var(--white);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  position: relative;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.menu-toggle-bars::before,
.menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }

.menu-toggle[aria-expanded="true"] .menu-toggle-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* =========================================================
   CLOSING CTA PANEL (shared; every page except Contact)
   ========================================================= */
.cta-band { background: var(--sand); color: var(--ink); }

.cta-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(24px, 3.5vw, 56px);
  padding-block: var(--section-y);
}
.cta-band h2 {
  font-size: var(--fs-h2);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin-bottom: 10px;
}
.cta-band p {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--slate);
  max-width: var(--measure);
}
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* =========================================================
   FOOTER (shared)
   ========================================================= */
.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.72);
  font-size: 14.5px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: clamp(28px, 4vw, 56px);
  padding-block: var(--section-y);
}

.footer-brand p { line-height: 1.65; margin-top: 16px; max-width: 34ch; }

.footer-heading {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 16px;
}

.site-footer ul { display: flex; flex-direction: column; gap: 10px; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-block: 20px;
  font-size: 13px;
}

/* Logo on a white tile — used until the white reverse logo is supplied */
.logo-tile {
  background: var(--white);
  border-radius: var(--r-tile);
  padding: 14px 18px;
  justify-self: start;
  width: fit-content;
}
.logo-tile img { height: 42px; width: auto; }
.logo-tile-sm { padding: 10px 14px; }
.logo-tile-sm img { height: 32px; }

/* =========================================================
   RESPONSIVE (shared components)
   ========================================================= */

/* Below the nav breakpoint: collapse nav into the menu panel.
   Keep in sync with NAV_DESKTOP_MQ in main.js. */
@media (max-width: 1100px) {
  .menu-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-menu);
    padding: 8px var(--gutter) 20px;
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    display: none;
  }
  .site-nav.is-open { display: flex; }

  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list > li { border-bottom: 1px solid var(--border); }

  .nav-link {
    width: 100%;
    justify-content: space-between;
    font-size: 16px;
    padding: 14px 4px;
  }
  .nav-link[aria-current="page"],
  .dropdown-toggle.is-current { --current-mark: inset 3px 0 0 var(--teal); padding-left: 12px; }

  .dropdown {
    position: static;
    min-width: 0;
    padding: 0 0 10px 12px;
    border: 0;
    box-shadow: none;
    transform: none;
    display: none;
    opacity: 1;
    visibility: visible;
    transition: none;
  }
  .dropdown::before { display: none; }
  .has-dropdown.is-open .dropdown { display: flex; }
  .dropdown a { font-size: 15px; font-weight: 500; padding: 10px 12px; }

  .nav-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 18px;
  }
  .nav-actions .btn { font-size: 15px; padding: 13px 18px; }

  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .cta-inner { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }

  .cta-actions { flex-direction: column; align-items: stretch; }
  .cta-actions .btn { width: 100%; }

  .footer-grid { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
