/* ==========================================================================
   Morrison & Barnes — base
   Tokens, fonts, reset, typography, buttons.
   Kept framework-free so every rule ports straight into a WordPress theme.
   ========================================================================== */

/* ---------- Fonts -------------------------------------------------------
   Both families are lifted from the client's existing staging install.
   See README.md — licensing needs confirming before go-live.
   ---------------------------------------------------------------------- */
@font-face {
  font-family: "Editor";
  src: url("../assets/fonts/editor-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Editor";
  src: url("../assets/fonts/editor-medium.woff2") format("woff2");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Acumin";
  src: url("../assets/fonts/Acumin-Pro.woff2") format("woff2"),
       url("../assets/fonts/Acumin-Pro.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------------------------------------------------- */
:root {
  /* Sampled from the client's staging build, not guessed. */
  --navy-950: #050c22;
  --navy-900: #0b1a48;
  --navy-800: #10245e;
  --navy-700: #1f3253;
  --navy-600: #2c4272;

  --blue-500: #2a27e9;
  --blue-400: #4c4af0;
  --blue-600: #1e1cc4;

  --white: #ffffff;
  --grey-100: #f4f5f8;
  --grey-300: #dedede;
  --grey-400: #b2b2b2;
  --grey-500: #8a93a6;

  --ink: var(--white);
  --muted: var(--grey-400);

  --font-display: "Editor", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Acumin", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;

  --shell: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --step-2:  clamp(1.6rem, 1.35rem + 1.2vw, 2.4rem);
  --step-3:  clamp(2.1rem, 1.6rem + 2.4vw, 3.6rem);
  --step-4:  clamp(2.8rem, 1.8rem + 4.6vw, 6rem);
  --step-5:  clamp(3.4rem, 1.6rem + 8vw, 9rem);

  --header-h: 84px;
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --speed: 0.6s;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
/* Lenis owns scrolling once JS boots; native smooth would fight it. */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--navy-950);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

h1, h2, h3, h4, p, figure, blockquote, address { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
address { font-style: normal; }

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

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { background: none; border: 0; cursor: pointer; }

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

::selection { background: var(--blue-500); color: var(--white); }

/* ---------- Typography ------------------------------------------------- */
h1, h2, h3, h4,
.section-title, .hero-title {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--step--1);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--grey-500);
  margin-bottom: 1rem;
}

.section-title {
  font-size: var(--step-3);
}
.section-title em {
  display: block;
  font-style: italic;
  color: var(--blue-400);
}

.prose p + p { margin-top: 1.15rem; }
.prose a {
  color: var(--blue-400);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.25s var(--ease);
}
.prose a:hover { color: var(--white); }
.prose--center { text-align: center; max-width: 68ch; margin-inline: auto; }

.legal-note {
  margin-top: 2.5rem;
  font-size: var(--step--1);
  color: var(--grey-500);
  max-width: 60ch;
}

/* ---------- Buttons ---------------------------------------------------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--white);
  --btn-bd: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.95em 1.9em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease),
              border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--white);
  transform: translateY(101%);
  transition: transform 0.45s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:hover::after { transform: translateY(0); }
.btn:active { transform: translateY(0); }

.btn--primary { --btn-bg: var(--blue-500); --btn-bd: var(--blue-500); }
.btn--primary:hover { color: var(--navy-950); border-color: var(--white); }

.btn--ghost { --btn-bd: rgba(255, 255, 255, 0.4); }
.btn--ghost:hover { color: var(--navy-950); border-color: var(--white); }

.btn--text {
  padding-inline: 0;
  border: 0;
  color: var(--blue-400);
}
.btn--text::after { display: none; }
.btn--text::before {
  content: "";
  position: absolute;
  left: 0; bottom: 0.4em;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0.35);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.btn--text:hover { color: var(--white); transform: none; }
.btn--text:hover::before { transform: scaleX(1); }

/* Quiet text CTA. For places where body copy needs a way onward but a button
   would shout -- it borrows the eyebrow's small-caps voice rather than the
   button's, so it reads as secondary navigation sitting inside editorial
   copy. Deliberately not blue: it follows a paragraph and should not pull
   the eye the way an inline link does. */
.quiet-cta {
  margin-top: 1.75rem;
}
.quiet-cta a {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  position: relative;
  padding-bottom: 0.55em;
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey-400);
  text-decoration: none;
  transition: color 0.35s var(--ease);
}
.quiet-cta a::before {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0.28);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.quiet-cta__arrow {
  transition: transform 0.45s var(--ease);
}
.quiet-cta a:hover { color: var(--white); }
.quiet-cta a:hover::before { transform: scaleX(1); }
.quiet-cta a:hover .quiet-cta__arrow { transform: translateX(0.35em); }
@media (prefers-reduced-motion: reduce) {
  .quiet-cta a::before,
  .quiet-cta__arrow { transition: none; }
}

.btn--sm { padding: 0.72em 1.3em; font-size: 0.75rem; }
.btn--lg { padding: 1.1em 2.4em; }
.btn--block { width: 100%; }

.btn-icon { width: 1.1em; height: 1.1em; fill: currentColor; }

/* ---------- Utilities -------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 999;
  padding: 0.8rem 1.2rem;
  background: var(--blue-500);
  color: var(--white);
  font-size: var(--step--1);
  transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 1rem; }

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

/* Reveal — JS adds .is-in. Content is visible by default so a JS failure
   can never leave the page blank (the gsap.from trap from the PMG build). */
[data-reveal] {
  opacity: 1;
  transform: none;
}
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s var(--ease), transform 0.85s var(--ease);
  will-change: opacity, transform;
}
/* Directional variants, so two-column sections resolve inwards instead of
   every block sliding the same way. */
.js [data-reveal="left"]  { transform: translate3d(-46px, 12px, 0); }
.js [data-reveal="right"] { transform: translate3d(46px, 12px, 0); }
.js [data-reveal="scale"] { transform: translate3d(0, 24px, 0) scale(0.955); }
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Word-by-word heading reveal. The spans are built by main.js; without JS the
   heading is just a heading. */
[data-split-lines] .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  /* Room for descenders and italic overhang, which overflow:hidden would
     otherwise shave off. Cancelled again so line spacing is unaffected.

     Measured, not guessed: at line-height 0.95em this serif puts its baseline
     0.83em below the box top, and its deepest descender ink 0.13em below the
     box. The old 0.14em left ~1% clearance, so on a 1x display the rounding
     alone sliced the p in "phone" flat. These values give ~2.5x the ink's
     actual reach in every direction, which absorbs font-size, zoom and
     device-pixel rounding. Widening the window means a word sliding up from
     below would show through it early, so main.js starts the words at
     yPercent 150 rather than 110 -- change the two together. */
  padding: 0.2em 0.2em 0.32em 0.12em;
  margin: -0.2em -0.2em -0.32em -0.12em;
}
/* The italic face throws its terminals farther past the advance width than the
   roman, so italic words need a wider window on the right. */
[data-split-lines] em .word {
  padding-right: 0.34em;
  margin-right: -0.34em;
}
[data-split-lines] .word > span { display: inline-block; will-change: transform; }
[data-split-lines] em .word > span { color: var(--blue-400); }

/* Elements nudged by the scroll-linked parallax bus. main.js writes --py;
   composing it here means an element keeps any transform of its own. */
[data-parallax] {
  transform: translate3d(0, var(--py, 0px), 0);
  will-change: transform;
}

/* ---------- Reduced motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  [data-parallax] { --py: 0px !important; }
  .result-hero__glow, .results-panel__hint::after { animation: none; }
}
