/* ============================================================================
   common.css — Invisionary Financial
   Shared baseline used by every page. Page-specific styles live in each
   HTML file's inline <style> block, which loads AFTER this file and can
   override anything below.
   ========================================================================== */

/* ---- Custom properties ---- */
:root {
  /* Brand navy scale */
  --navy-900: #0A1B33;
  --navy-800: #0E2442; /* canonical brand */
  --navy-700: #16335B;
  --navy-600: #214B82;
  --navy-500: #3F6FB0;
  --navy-200: #B8C8DC;
  --navy-100: #DCE5EF;
  --navy-050: #EFF3F8;

  /* Ink (neutral) scale */
  --ink-900: #0E1620;
  --ink-800: #1F2A37;
  --ink-700: #364152;
  --ink-600: #4B5868;
  --ink-500: #6B7686;
  --ink-400: #98A1AE;
  --ink-300: #C7CDD6;
  --ink-200: #E3E7ED;
  --ink-100: #F1F3F6;
  --ink-050: #F8F9FB;
  --white: #FFFFFF;

  /* Translucent rules used on dark surfaces */
  --rule-on-dark: rgba(255, 255, 255, 0.16);
  --muted-on-dark: rgba(255, 255, 255, 0.78);

  /* Layout */
  --container-max: 1200px;
  --nav-h: 72px;
  --radius-sm: 6px;
  --radius-md: 10px;

  /* Type */
  --font-sans: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Motion */
  --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 240ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 480ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem; /* 17px base */
  line-height: 1.6;
  color: var(--ink-800);
  background: var(--ink-050); /* function pages override to --white in their inline <style> */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: var(--nav-h); /* offset for fixed nav */
}

section { scroll-margin-top: var(--nav-h); }

img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--navy-800); color: white; }

/* ---- Eyebrow utility ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy-600);
}
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: currentColor;
}
.eyebrow.eyebrow-light { color: var(--navy-200); }

/* ---- Section heading utilities ----
   Default scale is the function-page scale (smaller, with em + on-dark variants).
   index.html overrides to its slightly larger scale in its inline <style>. */
.section-title {
  font-size: clamp(1.875rem, 4vw, 2.625rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink-900);
  margin-top: 18px;
  max-width: 22ch;
}
.section-title strong { font-weight: 800; color: var(--navy-800); }
.section-title em { font-style: italic; font-weight: 400; color: var(--navy-700); }
.section-title.on-dark { color: var(--white); }
.section-title.on-dark strong { color: var(--white); }
.section-title.on-dark em { color: var(--navy-100); }

.section-lede {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink-600);
  margin-top: 16px;
  max-width: 56ch;
}
.section-lede.on-dark { color: var(--navy-100); }

.section-inner { max-width: var(--container-max); margin: 0 auto; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-base), color var(--t-base), border-color var(--t-base), transform var(--t-base);
  white-space: nowrap;
}
.btn-primary { background: var(--navy-800); color: white; border-color: var(--navy-800); }
.btn-primary:hover { background: var(--navy-900); border-color: var(--navy-900); }
.btn-light { background: white; color: var(--navy-800); border-color: white; }
.btn-light:hover { background: var(--navy-050); border-color: var(--navy-050); }
.btn .arrow { transition: transform var(--t-base); }
.btn:hover .arrow { transform: translateX(2px); }

/* Nav-style CTA (white outline-on-hover, used in fixed nav) */
.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  background: var(--white);
  color: var(--navy-800);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  border: 1px solid var(--white);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--t-base), color var(--t-base);
}
.btn-nav:hover { background: transparent; color: var(--white); }
.btn-nav .arrow { transition: transform var(--t-base); }
.btn-nav:hover .arrow { transform: translateX(3px); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--navy-800);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-base), color var(--t-base);
}
.text-link:hover { color: var(--navy-900); border-color: var(--navy-800); }
.text-link.text-link-light { color: white; }
.text-link.text-link-light:hover { border-color: white; }

/* ---- Header / Nav (fixed, navy, vertical logo) ---- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--navy-800);
  border-bottom: 1px solid var(--rule-on-dark);
  padding: 0 32px;
}
.header-inner {
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
}
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.logo img {
  height: 55px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 36px;
  margin-left: auto;
  margin-right: 24px;
}
.nav a {
  color: var(--muted-on-dark);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: -0.005em;
  position: relative;
  padding: 6px 0;
  transition: color var(--t-base);
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 1px;
  background: var(--white);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--t-slow);
}
.nav a:hover { color: var(--white); }
.nav a:hover::after { transform: scaleX(1); }
.nav a.active { color: var(--white); }
.nav a.active::after { transform: scaleX(1); }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  color: var(--white);
}
.mobile-toggle svg { display: block; }

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--navy-050);
  border-bottom: 1px solid var(--ink-200);
  padding: 24px 32px 32px;
  z-index: 99;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 14px 0;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--ink-800);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-200);
}
.mobile-menu a:last-of-type { border-bottom: none; }

/* ---- Footer (standardized to 64/48/32/32 sitewide) ---- */
.site-footer {
  background: var(--navy-900);
  color: var(--navy-100);
  padding: 64px 32px 32px;
}
.footer-inner { max-width: var(--container-max); margin: 0 auto; }
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-brand .logo img {
  height: 64px;
  margin-bottom: 20px;
}
.footer-brand p {
  font-size: 0.9375rem;
  color: var(--navy-200);
  line-height: 1.55;
  max-width: 36ch;
}
.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: white;
  margin-bottom: 18px;
}
.footer-col a, .footer-col p {
  display: block;
  font-size: 0.9375rem;
  color: var(--navy-200);
  text-decoration: none;
  padding: 6px 0;
  transition: color var(--t-base);
  line-height: 1.5;
}
.footer-col a:hover { color: white; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 32px;
  font-size: 0.8125rem;
  color: var(--navy-200);
  opacity: 0.7;
}
.footer-legal { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-legal a {
  color: var(--navy-200);
  text-decoration: none;
  transition: color var(--t-base);
}
.footer-legal a:hover { color: white; }

/* ---- Responsive: nav/footer breakpoints ---- */
@media (max-width: 980px) {
  .nav { display: none; }
  .header-inner > .btn-nav { display: none; }
  .mobile-toggle { display: block; }

  .footer-top { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .site-header { padding: 0 20px; }
  .site-footer { padding-left: 20px; padding-right: 20px; }
  .footer-top { grid-template-columns: 1fr; padding-bottom: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .logo img { height: 48px; }
}

/* ---- Motion preference ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
