/* layout.css — shared nav + footer styles for all pages.
   Source of truth: index.html nav/footer. Every page that includes
   /js/layout.js for nav/footer injection must also include this stylesheet.
   Pages can still override or extend these rules locally. */

:root{
  /* Site masthead gradient (nav + hero). Both radial glows are anchored in
     FIXED PIXELS from the element's top edge (not %) so the rendered gradient
     is independent of the header's height. This guarantees the nav strip
     (first ~72px) looks pixel-identical on every page — a 72px nav-only header
     (maths, terms…) and a 1000px+ hero header (index, products) both show the
     same dark band and lime top-right glow, and the hero continues the same
     gradient seamlessly below (no band/restart at the nav boundary). */
  --hero-gradient:radial-gradient(1100px 620px at 84% -60px, rgba(155,229,100,.25), transparent 60%),radial-gradient(900px 560px at 10% 560px, rgba(47,107,79,.18), transparent 60%),linear-gradient(180deg, #0d1b16 0%, #14302a 320px, #14302a 100%);
}

/* ============================================================
   Masthead — gradient header (nav-only OR nav + hero)

   Single source of truth for the site's dark header. Any page uses it as:
     <header class="hero">
       <div class="wrap"><div data-nav></div></div>
       [optional hero content inside the header, e.g. <div class="hero-inner">…</div>]
     </header>

   * The header paints --hero-gradient. Because the radial glows are anchored
     in FIXED PIXELS (see :root), the nav strip (first ~72px) renders
     pixel-identical on every page regardless of header height, and an optional
     hero inside the header continues the SAME gradient seamlessly — there is
     no band or restart at the nav/hero boundary.
   * IMPORTANT: never put text-align on the header here — it would cascade into
     the nav (centering the mobile menu). Pages that want centered hero content
     put text-align:center on their own .hero-inner rule instead (see coaches,
     login, signup…). Hero-inner width/padding also stay page-level (they vary:
     460px auth forms vs 640px coaches vs 820px guides hub).
   * Legacy aliases (header.top, .cv-header, .partner-hero) are included so
     older pages don't need renaming; prefer class="hero" for new pages.
   ============================================================ */
header.hero, header.top, header.cv-header, header.partner-hero{
  position:relative;
  background:var(--hero-gradient);
  color:var(--cream);
  padding:0;
  display:flow-root; /* contain hero bottom margins so the gradient covers them */
}
header.hero .wrap, header.top .wrap, header.cv-header .wrap, header.partner-hero .wrap{
  max-width:1140px;margin:0 auto;padding:0 24px;
}

/* ============================================================
   Canonical hero anatomy — ONE component for every page.

   Markup contract (call it anywhere inside a `header.hero`):
     <header class="hero">
       <div class="wrap"><div data-nav></div>…</div>
       <div class="hero-inner">             ← content hero (LEFT, wide)
         <span class="hero-eyebrow">…</span>   optional pill
         <h1>…<em>…</em></h1>
         <p class="hero-lede">…</p>
         <div class="hero-actions">…</div>
         <div class="hero-meta">…</div>
       </div>
     </header>

   Alignment is set by the class on .hero-inner:
     * .hero-inner            — CONTENT hero: left-aligned, wide (820px),
                                fluid H1 (content marketing pages).
     * .hero-inner--center    — FORM hero: centered, narrow (640px), smaller
                                H1 (auth/task pages: login, signup, coach…).
   Guide articles use header.hero.article-hero + .hero-inner (compact H1).

   Pages should NOT redefine these classes locally — layout.css is the single
   source. Page-local rules only tweak CONTENT (colors on .hero-lede, etc.).
   ============================================================ */
.hero-inner{
  max-width:820px;
  margin:48px 0 0;
  padding:0 0 56px;
  text-align:left;
}
.hero-inner--center{
  max-width:640px;
  margin:44px auto 0;
  padding:0 0 56px;
  text-align:center;
}
.hero-inner h1{
  font-family:'Fraunces',serif;font-weight:800;color:var(--cream);
  font-size:clamp(34px,5vw,58px);line-height:1.08;margin:0 0 14px;
}
.hero-inner h1 em{font-style:italic;color:var(--lime)}
.hero-inner--center h1{font-size:clamp(26px,3.6vw,34px);margin-bottom:8px}
/* --tool: compact scale for tool/utility pages (e.g. CV builder) whose header
   sits above a full-height working surface. */
.hero-inner--tool{max-width:820px;margin:18px 0 0;padding:0 0 12px}
.hero-inner--tool h1{font-size:26px;line-height:1.15;margin:4px 0 6px}
.hero-inner--tool .hero-lede{font-size:14px;max-width:620px}
.hero-inner--tool .hero-meta{margin-top:12px;font-size:13px}
header.hero.article-hero .hero-inner{max-width:820px;margin-top:40px;padding-bottom:44px}
header.hero.article-hero .hero-inner h1{font-size:clamp(28px,3.8vw,42px)}
.hero-eyebrow{
  display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;
  font-size:12px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;
  color:var(--lime);background:rgba(155,229,100,.1);
  border:1px solid rgba(155,229,100,.28);
  padding:6px 14px;border-radius:999px;margin-bottom:18px;
}
.hero-eyebrow::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--lime)}
.hero-eyebrow--plain{
  background:none;border:none;padding:0;letter-spacing:.12em;font-size:12px;
}
.hero-eyebrow--plain::before{content:none}
.hero-lede{
  font-size:clamp(16px,2vw,19px);color:rgba(246,243,234,.82);
  max-width:62ch;margin:0;
}
.hero-inner--center .hero-lede{margin:0 auto}
.hero-actions{
  display:flex;gap:14px;align-items:center;flex-wrap:wrap;
  margin-top:26px;
}
.hero-inner--center .hero-actions{justify-content:center}

/* ---- Hero meta strip ---- */
/* Facts under hero copy — same visual language across the site: either
   lime-dot bullets (<span class="dot"></span><span>…</span>) or rich
   label/separator spans (<b>Phase</b>: …·<span class="sep">·</span>…).
   Alignment follows the hero (left for content, center for forms). */
.hero-meta{
  display:flex;flex-wrap:wrap;align-items:center;gap:10px 24px;
  margin-top:28px;font-size:14px;color:rgba(246,243,234,.68);
}
.hero-inner--center .hero-meta{justify-content:center}
.hero-meta .dot{width:5px;height:5px;border-radius:50%;background:var(--lime);flex-shrink:0}
.hero-meta b{color:var(--cream);font-weight:700}
.hero-meta .sep{opacity:.4}

/* ---- Accessibility: visible keyboard focus (WIG) ----
   Every focusable element gets a clear lime ring on :focus-visible only
   (never on mouse click), so keyboard users always know where they are.
   :focus-vvisible matches all interactive elements without needing a list. */
:focus-visible{
  outline:2px solid var(--lime);
  outline-offset:2px;
  border-radius:4px;
}
/* Native inputs/selects already show a UA focus; keep it predictable. */
input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:2px solid var(--leaf);
  outline-offset:1px;
}

/* ---- Skip link (WIG: jump straight to main content) ---- */
.skip-link{
  position:absolute;
  left:-9999px;
  top:0;
  z-index:200;
  background:var(--ink);
  color:var(--lime);
  padding:10px 18px;
  border-radius:0 0 10px 0;
  font-weight:600;
  font-size:14px;
  text-decoration:none;
}
.skip-link:focus{
  left:0;
  color:var(--lime);
}

/* Heading anchors land below the fixed-height nav */
h1,h2,h3{text-wrap:balance}
h2[id],h3[id],h4[id],section[id]{
  scroll-margin-top:96px;
}

/* ---- Nav ---- */
/* flex:1 + width:100% so the injected nav fills its container even when a page
   wraps it in a flex container (e.g. a page-local `header .wrap{display:flex}`),
   which would otherwise shrink-wrap the nav to its content and make it
   inconsistent. `flex:1` is ignored on the block-wrapped pages (index/terms/etc).

   The nav is transparent — the parent <header> provides the gradient
   background (via --hero-gradient), which flows through the nav seamlessly.
   This avoids any color-jump at the nav/hero boundary on hero pages. */
nav{display:flex;align-items:center;justify-content:space-between;position:relative;flex:1 1 auto;width:100%;color:var(--cream);padding:14px 0}
nav .logo{display:flex;align-items:center;gap:10px;font-family:'Fraunces',serif;font-weight:800;font-size:22px;color:var(--cream);text-decoration:none}
nav .logo:hover{color:var(--cream)}
nav .logo .logo-mark{width:34px;height:34px;border-radius:10px;flex-shrink:0}
nav .links{display:flex;gap:28px;align-items:center;flex-wrap:nowrap;min-width:0}
nav .links a{text-decoration:none;color:rgba(246,243,234,.78);font-size:15px;font-weight:500}
nav .links a:hover{color:var(--cream)}
/* Log in / Dashboard / Log out links must never wrap onto two lines. */
nav .links .nav-auth-link{white-space:nowrap;flex-shrink:0}
nav .links .dropdown{position:relative}
nav .links .dropdown .drop-btn{cursor:pointer;display:flex;align-items:center;gap:4px}
nav .links .dropdown .drop-btn .arrow{font-size:11px;opacity:.6;transition:transform .2s}
nav .links .dropdown:hover .drop-btn .arrow{transform:rotate(180deg)}
nav .links .dropdown .drop-menu{display:none;position:absolute;top:100%;left:-8px;background:#0d1b16;min-width:220px;padding:6px;border:1px solid rgba(155,229,100,.12);border-radius:10px;box-shadow:0 8px 30px rgba(0,0,0,.4);z-index:70;flex-direction:column;gap:2px}
nav .links .dropdown .drop-menu-wide{min-width:264px}
nav .links .dropdown .drop-menu a{padding:10px 14px;font-size:14px;white-space:nowrap;border-radius:6px}
nav .links .dropdown .drop-menu a:hover{background:rgba(155,229,100,.1);color:var(--cream)}
/* Menu section labels and dividers (used inside product-bucket dropdowns) */
nav .links .dropdown .drop-menu .menu-label{
  display:block;padding:10px 14px 2px;font-size:11px;font-weight:700;
  letter-spacing:.12em;text-transform:uppercase;color:var(--lime);
}
nav .links .dropdown .drop-menu .menu-divider{
  display:block;height:1px;margin:5px 10px;background:rgba(246,243,234,.14);
}
/* "Coming soon" pill for not-yet-launched products */
nav .links .dropdown .drop-menu .pill-soon{
  display:inline-block;margin-left:6px;padding:2px 8px;font-size:10px;
  font-weight:700;line-height:1.4;letter-spacing:.04em;border-radius:999px;
  background:rgba(193,75,58,.18);color:#e08a7c;border:1px solid rgba(193,75,58,.5);
  vertical-align:middle;white-space:nowrap;text-transform:uppercase;
}
/* Bundle CTA inside a firm dropdown (McKinsey/BCG/Bain); top border replaces the old divider span */
nav .links .dropdown .drop-menu a.menu-cta{
  margin-top:2px;padding-top:12px;color:var(--lime);font-weight:600;
  border-top:1px solid rgba(246,243,234,.08);border-radius:0 0 6px 6px;
}
nav .links .dropdown .drop-menu a.menu-cta:hover{background:rgba(155,229,100,.12)}
nav .links .dropdown:hover .drop-menu{display:flex}
/* The nav CTA ("Get access") — styled here so it renders identically on
   every page regardless of page-local .btn/.btn-primary/.btn-sm rules.
   line-height is pinned (products.css .btn sets line-height:1, other pages
   inherit 1.65) so the pill height is identical everywhere. */
nav .links a.btn,
nav .links a.btn-primary,
nav .links a.btn-sm{
  display:inline-flex;align-items:center;gap:10px;
  padding:11px 22px;border-radius:999px;border:none;cursor:pointer;
  font-weight:600;font-size:14px;line-height:1;text-decoration:none;white-space:nowrap;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
}
nav .links a.btn-primary{background:var(--ink);color:var(--lime);box-shadow:0 4px 14px rgba(0,0,0,.25)}
nav .links a.btn-primary:hover{color:var(--lime);transform:translateY(-2px)}
.nav-toggle{display:none;background:transparent;border:none;cursor:pointer;padding:6px;border-radius:8px}
.nav-toggle span{display:block;width:24px;height:2px;background:var(--cream);margin:5px 0;transition:transform .2s,opacity .2s}
.nav-toggle.open span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.nav-toggle.open span:nth-child(2){opacity:0}
.nav-toggle.open span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

/* Tighten the desktop nav between 761px and ~900px.
   The full link set (McKinsey / BCG / Bain / Free / FAQ / Log in + CTA) would
   otherwise overflow horizontally just above the ≤760px hamburger breakpoint
   (no scrollable overflow was measured on every layout.js page at 768px). */
@media(max-width:900px){
  nav .links{gap:14px}
  nav .links > .dropdown > .drop-btn,
  nav .links > a{font-size:13.5px}
  nav .links a.btn-sm{padding:10px 15px;font-size:13px}
}

/* ---- Footer ---- */
footer{background:var(--ink);color:rgba(246,243,234,.6);padding:60px 0 30px}
footer .wrap{max-width:1140px;margin:0 auto;padding:0 24px}
footer .brand{margin:0 0 40px;max-width:560px}
footer .brand .logo{display:flex;align-items:center;gap:10px;font-family:'Fraunces',serif;font-weight:800;font-size:22px;color:var(--cream);flex-wrap:wrap;min-width:0}
footer .brand .logo .logo-mark{width:34px;height:34px;border-radius:10px;flex:0 0 auto}
footer .brand .logo span{flex:1 1 auto;min-width:0}
footer .brand p{font-size:14px;line-height:1.6;color:rgba(246,243,234,.6);margin:14px 0 0;max-width:520px}
footer .row{display:grid;grid-template-columns:repeat(4,1fr);gap:48px 40px;align-items:start}
footer .col{min-width:0}
footer .col.guides{grid-column:span 1}
footer h5{color:var(--cream);font-size:13px;letter-spacing:.1em;text-transform:uppercase;margin:0 0 14px}
footer h5.legal{margin-top:26px}
footer a{display:block;color:rgba(246,243,234,.6);text-decoration:none;font-size:14px;padding:4px 0;line-height:1.5}
footer a:hover{color:var(--lime)}
footer .bottom{margin-top:40px;padding-top:24px;border-top:1px solid rgba(246,243,234,.1);display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap;font-size:13px}
@media(max-width:900px){
  footer .row{grid-template-columns:repeat(2,1fr);gap:40px 40px}
}
@media(max-width:520px){
  footer .row{grid-template-columns:1fr;gap:32px}
}

/* ---- Mobile nav ---- */
@media(max-width:760px){
  .nav-toggle{display:block}
  nav .links{
    display:none;position:absolute;top:calc(100% + 8px);right:0;left:0;
    flex-direction:column;align-items:stretch;gap:0;
    background:#0d1b16;border:1px solid rgba(155,229,100,.18);border-radius:14px;
    padding:8px;z-index:60;box-shadow:0 20px 50px rgba(0,0,0,.4);
  }
  nav .links.open{display:flex}
  nav .links a{padding:12px 16px;border-radius:8px;font-size:16px}
  nav .links a:hover{background:rgba(155,229,100,.08);color:var(--cream)}
  nav .links a.btn{margin-top:6px;text-align:center}
  nav .links .dropdown .drop-btn .arrow{font-size:20px;opacity:.7;min-width:24px;text-align:center}
  nav .links .dropdown .drop-menu{position:static;box-shadow:none;border:none;padding:0 0 0 16px;background:transparent;min-width:auto;display:none}
  nav .links .dropdown .drop-menu a{padding:10px 16px;font-size:15px;border-radius:6px}
  nav .links .dropdown.open .drop-menu{display:flex}
}

/* Visually hidden but available to screen readers */
.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0;
}

/* ---- Reduced motion (WIG: honor prefers-reduced-motion) ----
   Kill transforms, opacity animations and smooth scrolling for users who
   ask for less motion. Buttons/navs still work; they just disable animating. */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
    scroll-behavior:auto !important;
  }
}
