/* ==========================================================================
   SparkHire Consultants — main.css
   Design tokens, base styles, layout primitives, header & footer.
   Mobile-first: wider breakpoints live in responsive.css.
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic-latin.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette */
  --navy-900: #101d35;
  --navy-800: #16284a;
  --navy-700: #1e3560;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --blue-300: #93c5fd;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-100: #ccfbf1;
  --teal-50: #f0fdfa;
  --teal-300: #5eead4;
  --offwhite: #f8fafc;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --white: #ffffff;
  --amber-50: #fffbeb;
  --amber-700: #b45309;
  --red-700: #b91c1c;
  --red-50: #fef2f2;
  --green-700: #15803d;
  --green-50: #f0fdf4;

  /* Semantic colours */
  --color-bg: var(--white);
  --color-bg-alt: var(--offwhite);
  --color-surface: var(--white);
  --color-text: var(--slate-600);
  --color-heading: var(--navy-900);
  --color-muted: var(--slate-500);
  --color-border: var(--slate-200);
  --color-border-strong: var(--slate-300);
  --color-link: var(--teal-700);
  --color-link-hover: #115e59;
  --color-accent: var(--teal-700);
  --color-focus: var(--teal-700);
  --color-error: var(--red-700);
  --color-success: var(--green-700);

  /* Typography */
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  --step--1: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-0: clamp(1rem, 0.97rem + 0.13vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.07rem + 0.25vw, 1.25rem);
  --step-2: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-3: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --step-4: clamp(2rem, 1.6rem + 1.9vw, 3rem);
  --step-5: clamp(2.5rem, 1.85rem + 3vw, 4.25rem);
  --step-6: clamp(2.75rem, 1.9rem + 4.2vw, 5.5rem);

  --leading-tight: 1.08;
  --leading-snug: 1.3;
  --leading-body: 1.65;

  /* Spacing (8px base) */
  --space-1: 0.25rem;  /* 4 */
  --space-2: 0.5rem;   /* 8 */
  --space-3: 0.75rem;  /* 12 */
  --space-4: 1rem;     /* 16 */
  --space-5: 1.5rem;   /* 24 */
  --space-6: 2rem;     /* 32 */
  --space-7: 2.5rem;   /* 40 */
  --space-8: 3rem;     /* 48 */
  --space-9: 4rem;     /* 64 */
  --space-10: 5rem;    /* 80 */
  --space-11: 6rem;    /* 96 */
  --space-12: 8rem;    /* 128 */
  --section-space: clamp(4rem, 2.8rem + 6vw, 8rem);

  /* Layout */
  --container: 76rem;
  --container-narrow: 48rem;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --header-h: 4.5rem;

  /* Shape & depth */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(16 29 53 / 0.06);
  --shadow-md: 0 1px 2px rgb(16 29 53 / 0.04), 0 8px 24px -8px rgb(16 29 53 / 0.12);
  --shadow-lg: 0 2px 4px rgb(16 29 53 / 0.04), 0 24px 48px -16px rgb(16 29 53 / 0.22);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur: 250ms;
  --dur-slow: 600ms;

  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p, h1, h2, h3, h4, h5, h6, li, dd { overflow-wrap: break-word; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-heading);
  line-height: var(--leading-snug);
  font-weight: 700;
  text-wrap: balance;
}
.display, h1, .h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-6);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}
h2, .h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-5);
  line-height: 1.1;
  letter-spacing: -0.005em;
}
h3, .h3 { font-size: var(--step-2); letter-spacing: -0.01em; }
h4, .h4 { font-size: var(--step-1); }
.h-sans { font-family: var(--font-sans); font-weight: 700; letter-spacing: -0.02em; }
h1 em, h2 em, .display em {
  font-style: italic;
  color: var(--teal-700);
}
p { text-wrap: pretty; }
.lead { font-size: var(--step-1); line-height: 1.6; color: var(--slate-600); max-width: 40rem; }
.small, small { font-size: var(--step--1); }
strong { color: var(--slate-700); font-weight: 700; }

a { color: var(--color-link); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--color-link-hover); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-700);
  margin-bottom: var(--space-4);
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.on-dark .eyebrow { color: var(--teal-300); }

.prose { max-width: 42rem; }
.prose > * + * { margin-top: var(--space-4); }
.prose h2 { font-size: var(--step-4); margin-top: var(--space-8); }
.prose h3 { margin-top: var(--space-6); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: var(--space-2); }
.prose li::marker { color: var(--teal-600); }
.prose blockquote {
  border-left: 3px solid var(--teal-600);
  padding: var(--space-2) 0 var(--space-2) var(--space-5);
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--navy-900);
  line-height: 1.4;
}

/* ---------- Accessibility helpers ---------- */
.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: var(--space-4);
  top: -100px;
  z-index: 1000;
  padding: var(--space-3) var(--space-5);
  background: var(--navy-900);
  color: var(--white);
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: var(--space-4); color: var(--white); }

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-dark :focus-visible { outline-color: var(--teal-300); }

/* ---------- Layout primitives ---------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}
.container--narrow { width: min(100% - 2 * var(--gutter), var(--container-narrow)); }
.section { padding-block: var(--section-space); }
.section--tight { padding-block: clamp(3rem, 2rem + 4vw, 5rem); }
.section--alt { background: var(--color-bg-alt); }
.section--dark {
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgb(37 99 235 / 0.22), transparent 60%),
    radial-gradient(40rem 24rem at -10% 110%, rgb(13 148 136 / 0.18), transparent 60%),
    var(--navy-900);
  color: #cbd5e1;
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--white); }
.section--dark h2 em, .section--dark h1 em { color: var(--teal-300); }
.section--dark a:not(.btn) { color: var(--teal-300); }
.section--dark strong { color: var(--white); }

.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem); }
.section-head p { margin-top: var(--space-4); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head--split { display: grid; gap: var(--space-5); max-width: none; align-items: end; }

.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-6); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.grid { display: grid; gap: var(--space-5); }
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
.split { display: grid; gap: var(--space-8); align-items: center; }

/* ---------- Icons ---------- */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--sm { width: 1rem; height: 1rem; }
.icon--lg { width: 1.75rem; height: 1.75rem; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--navy-900);
  color: #cbd5e1;
  font-size: var(--step--1);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 2.5rem;
}
.topbar__links { display: flex; gap: var(--space-5); align-items: center; flex-wrap: wrap; }
.topbar a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: #e2e8f0;
  text-decoration: none;
  padding-block: var(--space-2);
}
.topbar a:hover { color: var(--white); text-decoration: underline; }
.topbar__note { display: none; color: #94a3b8; }
.topbar__hide-sm { display: none !important; }

/* ---------- Header & navigation ---------- */
.header-sentinel { height: 1px; margin-bottom: -1px; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgb(255 255 255 / 0.96);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur), box-shadow var(--dur);
}
/* Blur lives on a pseudo-element: backdrop-filter on the header itself would make it
   the containing block for the fixed-position mobile menu and clip it. */
@supports (backdrop-filter: blur(8px)) {
  .site-header { background: transparent; isolation: isolate; }
  .site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgb(255 255 255 / 0.88);
    backdrop-filter: saturate(1.6) blur(12px);
  }
}
.site-header.is-stuck { border-bottom-color: var(--color-border); box-shadow: var(--shadow-sm); }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--navy-900);
  flex-shrink: 0;
}
.brand:hover { color: var(--navy-900); }
.brand__mark { width: 2.75rem; height: 2.75rem; object-fit: contain; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em; }
.brand__accent { color: var(--teal-700); }
.brand__sub { font-size: 0.625rem; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; color: var(--slate-700); margin-top: 2px; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--navy-900);
  font-weight: 700;
  font-size: 0.9375rem;
}
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.primary-nav {
  position: fixed;
  inset: var(--nav-top, 4.5rem) 0 0 0;
  background: var(--white);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-5) var(--gutter) var(--space-9);
  border-top: 1px solid var(--color-border);
}
.primary-nav:not(.is-open) { display: none; }

.nav-list { list-style: none; padding: 0; display: flex; flex-direction: column; }
.nav-list > li { border-bottom: 1px solid var(--slate-100); }
.nav-link, .nav-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-4) 0;
  font-weight: 650;
  font-size: 1.0625rem;
  color: var(--navy-900);
  text-decoration: none;
  background: none;
  border: 0;
  text-align: left;
}
.nav-link:hover, .nav-trigger:hover { color: var(--teal-700); }
.nav-link[aria-current="page"], .nav-trigger.is-current { color: var(--teal-700); }
.nav-trigger .icon { transition: transform var(--dur) var(--ease-out); }
.nav-trigger[aria-expanded="true"] .icon { transform: rotate(180deg); }

.dropdown { list-style: none; padding: 0 0 var(--space-4); display: grid; gap: var(--space-1); }
.dropdown:not(.is-open) { display: none; }
.dropdown a {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  color: var(--navy-900);
  text-decoration: none;
}
.dropdown a:hover { background: var(--slate-100); color: var(--navy-900); }
.dropdown a .icon { color: var(--teal-700); margin-top: 2px; }
.dropdown__title { display: block; font-weight: 700; font-size: 0.9375rem; }
.dropdown__desc { display: block; font-size: 0.8125rem; color: var(--slate-500); line-height: 1.45; }
.dropdown__footer { grid-column: 1 / -1; }
.dropdown__footer a { color: var(--teal-700); font-weight: 700; font-size: 0.9375rem; }

.nav-actions { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-6); }
.header-cta { display: none; }

body.nav-open { overflow: hidden; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--step--1);
  color: var(--slate-500);
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: var(--space-2); }
.breadcrumbs li + li::before {
  content: "";
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.6;
}
.breadcrumbs a { color: var(--slate-600); text-decoration: none; }
.breadcrumbs a:hover { color: var(--teal-700); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--navy-900); font-weight: 600; }
.on-dark .breadcrumbs, .on-dark .breadcrumbs a { color: #cbd5e1; }
.on-dark .breadcrumbs [aria-current="page"] { color: var(--white); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  position: relative;
  padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem) clamp(3.5rem, 2.5rem + 5vw, 6.5rem);
  background:
    linear-gradient(to bottom, transparent 70%, var(--white)),
    radial-gradient(50rem 24rem at 100% 0%, rgb(37 99 235 / 0.09), transparent 70%),
    radial-gradient(40rem 20rem at 0% 20%, rgb(13 148 136 / 0.08), transparent 70%),
    var(--offwhite);
  overflow: hidden;
}
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgb(16 29 53 / 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(16 29 53 / 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 70% 0%, #000 10%, transparent 65%);
  pointer-events: none;
}
.page-hero > .container { position: relative; z-index: 1; }
.page-hero h1 { font-size: var(--step-5); margin-top: var(--space-6); max-width: 18ch; }
.page-hero .lead { margin-top: var(--space-5); }
.page-hero__grid { display: grid; gap: var(--space-8); align-items: end; }
.page-hero__aside { display: grid; gap: var(--space-3); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-900);
  color: #cbd5e1;
  font-size: 0.9375rem;
  padding-top: var(--space-10);
}
.site-footer a { color: #e2e8f0; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.site-footer h2 {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-300);
  margin-bottom: var(--space-4);
}
.footer-grid { display: grid; gap: var(--space-8); grid-template-columns: 1fr 1fr; }
.footer-brand { grid-column: 1 / -1; max-width: 26rem; }
.footer-logo { display: inline-block; padding: var(--space-3) var(--space-5); background: var(--white); border-radius: var(--radius-lg); }
.footer-logo img { width: 200px; height: auto; }
.footer-logo:focus-visible { outline-color: var(--teal-300); }
.footer-brand p { margin-top: var(--space-4); }
.footer-tagline { font-family: var(--font-display); font-style: italic; font-size: var(--step-2); color: var(--white); line-height: 1.3; }
.footer-list { list-style: none; padding: 0; display: grid; gap: var(--space-3); }
.footer-contact li { display: flex; gap: var(--space-3); align-items: flex-start; }
.footer-contact .icon { margin-top: 3px; color: var(--teal-300); }
.footer-notice {
  margin-top: var(--space-9);
  padding: var(--space-5);
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 0.03);
  font-size: var(--step--1);
  line-height: 1.6;
  display: flex;
  gap: var(--space-3);
}
.footer-notice .icon { color: var(--teal-300); margin-top: 2px; }
.footer-bottom {
  margin-top: var(--space-7);
  padding-block: var(--space-6);
  border-top: 1px solid rgb(255 255 255 / 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  font-size: var(--step--1);
  color: #94a3b8;
}
.footer-legal { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.footer-legal a { color: #cbd5e1; }

/* ---------- Reveal on scroll (progressive) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  }
  .js [data-reveal].is-visible { opacity: 1; transform: none; }
}

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

/* ---------- Print ---------- */
@media print {
  .topbar, .site-header, .site-footer, .back-to-top, .skip-link, .nav-toggle { display: none !important; }
  body { color: #000; }
  a { color: #000; }
}

/* Long email addresses in the footer must not push the page wider than the viewport */
.footer-grid > * { min-width: 0; }
.footer-contact a { overflow-wrap: anywhere; }
