/* ==========================================================================
   Headcomp landing — shared styles
   Used by: index, concierge, consulting, partner, range-builder,
            equity-calculator, blog/index, blog/_template, blog/post pages

   Breakpoints:
     --bp-large  : 1024px (tablet / 3-col to 2-col)
     --bp-mobile : 768px  (mobile nav on, drawer, 2-col to 1-col)
     --bp-small  : 640px  (tight phones)
   ========================================================================== */

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

/* Tokens */
:root {
  --cream: #F7F4EE;
  --warm-white: #FDFBF8;
  --ink: #1A1714;
  --ink-light: #4A453F;
  --ink-muted: #8A8178;
  --rust: #C4531A;
  --rust-light: #F0E8DF;
  --border: #E2DBD0;
  --serif: 'Lora', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--warm-white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- NAV chrome ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 251, 248, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav-logo span { color: var(--rust); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--ink-light);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--ink); }

.nav-cta {
  background: var(--ink) !important;
  color: var(--warm-white) !important;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 500 !important;
  font-size: 0.875rem !important;
  transition: background 0.2s !important;
}

.nav-cta:hover { background: var(--rust) !important; }

/* ---------- Nav dropdown (Free Tools) — desktop + mobile accordion ---------- */
.nav-dropdown { position: relative; }

.nav-dropdown-trigger {
  font-size: 0.875rem;
  color: var(--ink-light);
  font-weight: 400;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--sans);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
  min-height: 44px;
}

.nav-dropdown-trigger:hover { color: var(--ink); }
.nav-dropdown-trigger svg { transition: transform 0.2s; }

.nav-dropdown:hover .nav-dropdown-trigger svg,
.nav-dropdown.open .nav-dropdown-trigger svg { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(26, 23, 20, 0.1);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
  z-index: 200;
  overflow: hidden;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--ink-light);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s, color 0.1s;
  min-height: 44px;
}

.nav-dropdown-menu a:last-child { border-bottom: none; }

.nav-dropdown-menu a:hover {
  background: var(--cream);
  color: var(--ink);
}

.nav-dropdown-menu .dd-label {
  font-weight: 500;
  color: var(--ink);
  display: block;
  margin-bottom: 2px;
}

.nav-dropdown-menu .dd-desc {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* ---------- Hamburger (mobile only) ---------- */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  margin: -10px -10px -10px 0;
  color: var(--ink);
  line-height: 0;
}
.nav-hamburger:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 2px;
  border-radius: 4px;
}
.nav-hamburger svg { width: 24px; height: 24px; }
.nav-hamburger .icon-close { display: none; }
nav.nav-open .nav-hamburger .icon-open { display: none; }
nav.nav-open .nav-hamburger .icon-close { display: inline; }

/* Prevent background scroll when drawer is open */
body.nav-drawer-open { overflow: hidden; }

/* ---------- Buttons ---------- */
.btn-primary {
  background: var(--ink);
  color: var(--warm-white);
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  display: inline-block;
  font-family: var(--sans);
  border: none;
  cursor: pointer;
  min-height: 44px;
}
.btn-primary:hover { background: var(--rust); transform: translateY(-1px); }

.btn-secondary {
  color: var(--ink-light);
  font-size: 0.95rem;
  font-weight: 400;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
  padding: 10px 4px;
}
.btn-secondary:hover { color: var(--ink); }
.btn-secondary::after { content: '\2192'; }

.btn-ghost {
  color: var(--ink-light);
  font-size: 0.875rem;
  font-weight: 400;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
  padding: 10px 4px;
}
.btn-ghost:hover { color: var(--rust); }
.btn-ghost::after { content: '\2192'; }

/* ---------- Hero base ---------- */
.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 100px 40px 80px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--rust-light);
  color: var(--rust);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 36px;
}

.hero-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--rust);
  flex-shrink: 0;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 28px;
}

.hero h1 em {
  font-style: italic;
  color: var(--rust);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--ink-light);
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: 1.7;
  font-weight: 300;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Section helpers ---------- */
.section {
  max-width: 860px;
  margin: 0 auto;
  padding: 80px 40px;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 16px;
}

.section-title em { font-style: italic; color: var(--rust); }

.section-desc {
  font-size: 1rem;
  color: var(--ink-light);
  max-width: 480px;
  line-height: 1.7;
  font-weight: 300;
  margin-bottom: 56px;
}

.section-divider {
  max-width: 860px;
  margin: 80px auto 0;
  padding: 0 40px;
  border-top: 1px solid var(--border);
}

/* ---------- Footer variants ---------- */
/* Dark footer with inline link list (index, consulting, blog) */
footer.dark {
  border-top: 1px solid rgba(255,255,255,0.08);
  background: var(--ink);
  padding: 32px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

footer.dark .footer-logo {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: rgba(253,251,248,0.5);
}

footer.dark .footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

footer.dark .footer-links a {
  font-size: 0.8rem;
  color: rgba(253,251,248,0.3);
  text-decoration: none;
  transition: color 0.2s;
  padding: 10px 4px;
  display: inline-block;
}

footer.dark .footer-links a:hover { color: rgba(253,251,248,0.7); }

/* Light centered footer (concierge, partner, range-builder, equity-calculator) */
footer.light {
  border-top: 1px solid var(--border);
  padding: 40px;
  text-align: center;
}

footer.light .footer-logo {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

footer.light .footer-logo span { color: var(--rust); }

footer.light p {
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 300;
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* --- Tablet: collapse 3-col grids, loosen nav --- */
@media (max-width: 1024px) {
  .steps,
  .pricing-cards,
  .steps-grid,
  .inputs-grid:not(.inputs-grid-keep) {
    grid-template-columns: 1fr 1fr !important;
  }
  .nav-links { gap: 20px; }
}

/* --- Mobile: hamburger + drawer --- */
@media (max-width: 768px) {
  nav {
    padding: 0 20px;
    position: sticky;
    /* Clear backdrop-filter so position:fixed descendants (the drawer)
       use the viewport as containing block, not the 60px nav. */
    backdrop-filter: none;
    background: var(--warm-white);
  }

  .nav-hamburger { display: inline-flex; }

  /* Turn nav-links into a full-screen slide-down drawer */
  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--warm-white);
    border-top: 1px solid var(--border);
    padding: 8px 20px 32px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    overflow-y: auto;
    z-index: 150;
  }

  nav.nav-open .nav-links {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid var(--border);
  }
  .nav-links li:last-child { border-bottom: none; }

  .nav-links a:not(.nav-cta) {
    display: block;
    padding: 16px 4px;
    font-size: 1rem;
    min-height: 48px;
  }

  .nav-cta {
    display: inline-block;
    margin-top: 16px;
    padding: 14px 22px !important;
    font-size: 0.95rem !important;
  }

  /* Free Tools becomes tap-to-expand accordion in drawer */
  .nav-dropdown-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 16px 4px;
    font-size: 1rem;
    min-height: 48px;
  }

  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: var(--cream);
    margin: 0 -20px;
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
  }

  .nav-dropdown.open .nav-dropdown-menu {
    max-height: 400px;
  }

  .nav-dropdown-menu a {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }

  /* Hero / section padding */
  .hero {
    padding: 64px 20px 48px;
  }
  .hero-sub { margin-bottom: 32px; font-size: 1.05rem; }
  .hero-eyebrow { margin-bottom: 24px; }

  .section { padding: 56px 20px; }
  .section-desc { margin-bottom: 40px; }
  .section-divider { padding: 0 20px; margin-top: 56px; }

  /* Collapse remaining multi-col grids */
  .steps,
  .pricing-cards,
  .steps-grid,
  .features-grid,
  .plans-grid,
  .guarantees-inner,
  .who-grid,
  .inputs-grid:not(.inputs-grid-keep),
  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  /* Footers */
  footer.dark {
    flex-direction: column;
    gap: 16px;
    padding: 32px 20px;
    text-align: center;
  }
  footer.light { padding: 32px 20px; }

  /* Proof bar & similar centered stat rows */
  .proof-inner { justify-content: center; gap: 24px; }
  .proof-bar { padding: 32px 20px; }

  /* CTA section */
  .cta-section { padding: 64px 20px !important; }
}

/* --- Small phones --- */
@media (max-width: 640px) {
  .hero {
    padding: 48px 18px 36px;
  }
  .hero h1 { font-size: clamp(1.9rem, 8vw, 2.4rem); margin-bottom: 20px; }
  .hero-eyebrow { margin-bottom: 20px; font-size: 0.72rem; }
  .hero-sub { font-size: 1rem; line-height: 1.6; margin-bottom: 28px; }

  .section { padding: 48px 18px; }
  .section-divider { padding: 0 18px; margin-top: 48px; }

  nav { padding: 0 16px; }
  .nav-logo { font-size: 1.1rem; }

  .btn-primary { padding: 13px 22px; font-size: 0.9rem; width: auto; }
  .hero-actions { gap: 12px; }

  footer.dark, footer.light { padding: 28px 18px; }
}
