/* ============================================================
   Stevva — Marketing site / Insights shared stylesheet
   Builds on the design-system tokens (assets/styles.css).
   Exposes two tweak hooks on :root:
     --site-accent       (color tweak — drives CTAs, links, active states)
     --site-font-head / --site-font-body  (typeface tweak)
   ============================================================ */

:root {
  --site-accent: var(--ink);
  --site-accent-contrast: #ffffff;
  --site-font-head: var(--font-sans);
  --site-font-body: var(--font-sans);
  --site-max: 1180px;
  --site-measure: 720px; /* long-form reading width */
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--site-font-body);
  color: var(--text-body);
  background: var(--bg-page);
}

h1, h2, h3, h4, h5, h6 { font-family: var(--site-font-head); }

/* ---- Layout helpers ------------------------------------- */
.wrap { width: 100%; max-width: var(--site-max); margin-inline: auto; padding-inline: var(--space-5); }
.measure { max-width: var(--site-measure); }
.eyebrow {
  font-size: var(--text-xs); font-weight: var(--fw-heavy);
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase;
  color: var(--text-muted); margin: 0;
}
.muted { color: var(--text-secondary); }
.dim   { color: var(--text-muted); }

/* ---- Buttons -------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--site-font-head); font-weight: var(--fw-heavy);
  font-size: var(--text-sm); line-height: 1; letter-spacing: -0.01em;
  padding: 0.85em 1.35em; border-radius: var(--radius-md);
  border: var(--border-width-strong) solid transparent; cursor: pointer;
  transition: background var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
  text-decoration: none;
}
.btn-primary { background: var(--site-accent); color: var(--site-accent-contrast); }
.btn-primary:hover { filter: brightness(0.9); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--border-default); }
.btn-outline:hover { border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); padding-inline: 0.4em; }
.btn-ghost:hover { color: var(--site-accent); }
.btn-lg { font-size: var(--text-base); padding: 1em 1.6em; }

/* ---- Site header / nav ---------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header__inner {
  display: flex; align-items: center; gap: var(--space-6);
  height: 68px;
}
.brand { display: inline-flex; align-items: baseline; gap: 0.5ch; text-decoration: none; color: var(--ink-strong); }
.brand__mark {
  font-family: var(--site-font-head); font-weight: var(--fw-black);
  font-size: 1.5rem; letter-spacing: -0.03em; line-height: 1;
}
.brand__rule { width: 1px; height: 18px; background: var(--border-default); margin-inline: 0.35rem; align-self: center; }
.brand__tag {
  font-size: 0.62rem; font-weight: var(--fw-heavy); letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--text-muted); align-self: center;
}
.site-nav { display: flex; align-items: center; gap: var(--space-5); margin-left: auto; }
.site-nav a:not(.btn) {
  font-size: var(--text-sm); font-weight: var(--fw-regular); color: var(--text-secondary);
  text-decoration: none; white-space: nowrap; transition: color var(--dur-fast) var(--ease-out);
}
.site-nav a:not(.btn):hover, .site-nav a:not(.btn)[aria-current="page"] { color: var(--ink-strong); }
.site-nav .btn { margin-left: var(--space-2); }
.nav-divider { width: 1px; height: 20px; background: var(--border-subtle); }

/* ---- Category tag (divisional accent) ------------------- */
.tag {
  display: inline-flex; align-items: center; gap: 0.5ch;
  font-size: var(--text-xs); font-weight: var(--fw-heavy);
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.34em 0.7em; border-radius: var(--radius-pill);
  background: var(--cat-soft, var(--grey-100)); color: var(--cat, var(--ink-soft));
}
.tag--dot::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* division color map (applied via data-cat on the element) */
[data-cat="setup"]       { --cat: var(--accent-incorporations); --cat-soft: var(--accent-incorporations-soft); }
[data-cat="tax"]         { --cat: var(--accent-tax);            --cat-soft: var(--accent-tax-soft); }
[data-cat="legal"]       { --cat: var(--accent-legal);          --cat-soft: var(--accent-legal-soft); }
[data-cat="immigration"] { --cat: var(--accent-immigration);    --cat-soft: var(--accent-immigration-soft); }
[data-cat="payroll"]     { --cat: var(--accent-payroll);        --cat-soft: var(--accent-payroll-soft); }
[data-cat="realestate"]  { --cat: var(--accent-realestate);     --cat-soft: var(--accent-realestate-soft); }

/* ---- CTA band ------------------------------------------- */
.cta-band { background: var(--ink); color: var(--text-on-ink); }
.cta-band h2 { color: #fff; }
.cta-band p { color: var(--text-on-ink-muted); }
.cta-band .btn-primary { background: #fff; color: var(--ink); border-color: #fff; }
.cta-band .btn-primary:hover { filter: none; background: var(--grey-100); }
.cta-band .btn-outline { color: #fff; border-color: rgba(255,255,255,0.4); }
.cta-band .btn-outline:hover { border-color: #fff; }

/* ---- Footer --------------------------------------------- */
.site-footer { background: var(--ink); color: var(--text-on-ink-muted); padding-block: var(--space-9) var(--space-6); }
.site-footer a { color: var(--text-on-ink-muted); text-decoration: none; transition: color var(--dur-fast); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: var(--space-6); }
.footer-col h4 {
  font-size: var(--text-xs); font-weight: var(--fw-heavy); letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--text-on-ink); margin-bottom: var(--space-4);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.footer-col li { font-size: var(--text-sm); }
.footer-brand .brand__mark { color: #fff; }
.footer-brand p { font-size: var(--text-sm); max-width: 30ch; margin-top: var(--space-3); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between;
  margin-top: var(--space-8); padding-top: var(--space-5);
  border-top: 1px solid rgba(255,255,255,0.1); font-size: var(--text-xs);
}

/* ---- Cards (shared) ------------------------------------- */
.card {
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ---- Image placeholder (striped) ------------------------ */
.ph {
  position: relative; background: var(--grey-100);
  background-image: repeating-linear-gradient(135deg,
    transparent 0 14px, rgba(28,36,43,0.035) 14px 28px);
  display: grid; place-items: center; overflow: hidden;
}
.ph__label {
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted);
  letter-spacing: 0.02em; padding: 0.4em 0.7em; background: color-mix(in srgb, var(--paper) 70%, transparent);
  border-radius: var(--radius-sm);
}

/* ---- Misc ----------------------------------------------- */
.section { padding-block: var(--space-9); }
.section-sm { padding-block: var(--space-7); }
hr.rule { border: 0; border-top: 1px solid var(--border-subtle); margin: 0; }

@media (max-width: 920px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .site-nav { gap: var(--space-4); }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Mega menu (Services)
   ============================================================ */
[data-cat="accounting"] { --cat: var(--accent-tax); --cat-soft: var(--accent-tax-soft); }
[data-cat="audit"]      { --cat: var(--accent-audit);        --cat-soft: var(--accent-audit-soft); }

.nav-item.has-mega { position: static; display: inline-flex; align-items: center; }
.nav-trigger {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 0; cursor: pointer; font: inherit;
  font-family: var(--site-font-body); font-size: var(--text-sm);
  font-weight: var(--fw-regular); color: var(--text-secondary); padding: 0;
  transition: color var(--dur-fast) var(--ease-out);
}
.has-mega.is-open .nav-trigger, .nav-trigger[aria-expanded="true"] { color: var(--ink-strong); }
.nav-caret { transition: transform var(--dur-base) var(--ease-out); }
.has-mega.is-open .nav-caret { transform: rotate(180deg); }

/* ---- Simple dropdown (About) ---------------------------- */
.nav-item.has-drop { position: relative; display: inline-flex; align-items: center; }
.has-drop.is-open .nav-trigger, .has-drop .nav-trigger[aria-expanded="true"] { color: var(--ink-strong); }
.has-drop.is-open .nav-caret { transform: rotate(180deg); }
.drop {
  position: fixed; top: 67px; left: 0;
  transform: translateY(-8px);
  min-width: 286px; background: var(--white);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: var(--space-3);
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden; pointer-events: none; z-index: 48;
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              visibility var(--dur-base);
}
.has-drop.is-open .drop, .has-drop:focus-within .drop {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateY(0);
}
.drop::before {
  content: ""; position: absolute; left: 0; right: 0; top: -26px; height: 26px;
}
.drop__link {
  display: flex; flex-direction: column; gap: 3px;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  text-decoration: none; border-left: 2px solid transparent;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.drop__link:hover { background: var(--paper); border-left-color: var(--site-accent, var(--accent-tax)); }
.site-nav .drop__link .drop__t { font-size: var(--text-sm); font-weight: var(--fw-heavy); color: var(--ink-strong); }
.site-nav .drop__link .drop__d { font-size: var(--text-xs); color: var(--text-muted); line-height: var(--lh-snug); }

.mega {
  position: fixed; top: 67px; left: 50%;
  width: min(1040px, calc(100vw - 32px));
  transform: translateX(-50%) translateY(-8px);
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
  opacity: 0; visibility: hidden; pointer-events: none; z-index: 48;
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              visibility var(--dur-base);
}
.has-mega.is-open .mega, .has-mega:focus-within .mega {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
/* invisible bridge so the cursor can cross the gap from header to panel */
.mega::before {
  content: ""; position: absolute; top: -22px; left: -40px; right: -40px; height: 24px;
}
.mega__inner { display: grid; grid-template-columns: 300px 1fr; }
.mega__rail {
  background: var(--grey-50); border-right: 1px solid var(--border-subtle);
  padding: var(--space-5) var(--space-4); display: flex; flex-direction: column;
  justify-content: space-evenly; gap: var(--space-2);
}
.mega__cat {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  text-align: left; background: none; border: 0; cursor: pointer; font: inherit;
  font-family: var(--site-font-head); font-size: var(--text-base); font-weight: var(--fw-regular);
  color: var(--text-secondary); padding: 1rem 0.85rem; border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
/* Color hint bar per division accent (--cat from data-cat) */
.mega__cat::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 0; border-radius: 0 3px 3px 0; background: var(--cat, var(--ink));
  transition: height var(--dur-fast) var(--ease-out);
}
.mega__cat:hover::before { height: 38%; }
.mega__cat.is-active::before { height: 62%; }
.mega__cat:hover { color: var(--ink-strong); background: var(--white); }
.mega__cat.is-active { color: var(--cat, var(--ink-strong)); background: var(--white); font-weight: var(--fw-heavy); box-shadow: var(--shadow-xs); }
.mega__chev { color: var(--text-muted); font-size: 1.2em; line-height: 1; }
.mega__cat.is-active .mega__chev { color: var(--cat, var(--ink)); }

.mega__panels { padding: var(--space-6) var(--space-7); display: grid; }
/* All panels share a single grid cell, so the panel always sizes to the
   TALLEST category and keeps a constant height as you move between them. */
.mega__panel {
  grid-area: 1 / 1; visibility: hidden; opacity: 0; pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out);
}
.mega__panel.is-active { visibility: visible; opacity: 1; }
/* Only the OPEN menu's active panel is interactive. Without this the active
   panel keeps pointer-events:auto while hidden, making its content hit-testable
   mid-page and triggering an accidental open. */
.has-mega.is-open .mega__panel.is-active { pointer-events: auto; }
.mega__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6) var(--space-7); }
.mega__gtitle {
  font-size: var(--text-xs); font-weight: var(--fw-heavy); letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--cat, var(--text-muted)); margin-bottom: var(--space-3);
  padding-bottom: var(--space-2); border-bottom: 1px solid color-mix(in srgb, var(--cat, var(--ink)) 35%, transparent);
}
.mega__group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.mega__group li a {
  display: block; padding: 0.5rem 0.6rem; margin-left: -0.6rem; border-radius: var(--radius-sm);
  font-size: var(--text-sm); color: var(--ink); text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.mega__group li a:hover { color: var(--cat, var(--ink)); background: color-mix(in srgb, var(--cat, var(--ink)) 10%, transparent); }
/* audit has one long list — flow it into two columns */
.mega__panel[data-cat="audit"] .mega__grid { grid-template-columns: 1fr; }
.mega__panel[data-cat="audit"] .mega__group ul { display: block; column-count: 2; column-gap: var(--space-7); }
.mega__panel[data-cat="audit"] .mega__group li { break-inside: avoid; }

@media (max-width: 940px) {
  .mega__inner { grid-template-columns: 1fr; }
  .mega__rail { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border-subtle); }
  .mega__panels { min-height: 0; }
  .mega__grid, .mega__panel[data-cat="audit"] .mega__grid { grid-template-columns: 1fr; }
  .mega__panel[data-cat="audit"] .mega__group ul { column-count: 1; }
}

/* ============================================================
   Mobile navigation (hamburger drawer) — built by nav.js
   ============================================================ */
.nav-burger { display: none; }

@media (max-width: 880px) {
  .site-nav { display: none; }
  .nav-burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    margin-left: auto; width: 44px; height: 44px; padding: 11px 10px;
    background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .nav-burger span {
    display: block; height: 2px; width: 100%; background: var(--ink); border-radius: 2px;
    transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
  }
  body.mnav-open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.mnav-open .nav-burger span:nth-child(2) { opacity: 0; }
  body.mnav-open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 460px) {
  .brand__rule, .brand__tag { display: none; }
}

body.mnav-open { overflow: hidden; }

.mobile-nav { position: fixed; inset: 0; z-index: 100; visibility: hidden; opacity: 0; transition: opacity var(--dur-base) var(--ease-out), visibility var(--dur-base); }
.mobile-nav::before { content: ""; position: absolute; inset: 0; background: rgba(16,22,28,0.45); }
.mobile-nav.is-open { visibility: visible; opacity: 1; }
.mobile-nav__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(88vw, 380px);
  background: var(--paper); box-shadow: -12px 0 44px rgba(16,22,28,0.20);
  transform: translateX(100%); transition: transform var(--dur-base) var(--ease-out);
  display: flex; flex-direction: column; padding: 76px var(--space-5) var(--space-6);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.mobile-nav.is-open .mobile-nav__panel { transform: translateX(0); }
.mnav__close {
  position: absolute; top: 14px; right: 12px; width: 44px; height: 44px;
  display: grid; place-items: center; background: none; border: 0; cursor: pointer; color: var(--ink);
}
.mnav__link {
  display: block; padding: 0.85em 0; font-family: var(--site-font-head);
  font-size: var(--text-lg); font-weight: var(--fw-heavy); color: var(--ink-strong);
  text-decoration: none; border-bottom: 1px solid var(--border-subtle);
}
.mnav__acc {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  background: none; border: 0; border-bottom: 1px solid var(--border-subtle); cursor: pointer;
  padding: 0.85em 0; font-family: var(--site-font-head); font-size: var(--text-lg);
  font-weight: var(--fw-heavy); color: var(--ink-strong); text-align: left;
}
.mnav__acc svg { flex: none; color: var(--text-muted); transition: transform var(--dur-base) var(--ease-out); }
.mnav__acc[aria-expanded="true"] svg { transform: rotate(180deg); }
.mnav__sub { display: none; padding: var(--space-2) 0 var(--space-3); }
.mnav__sub.is-open { display: block; }
.mnav__cat-acc {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  background: none; border: 0; border-bottom: 1px solid var(--border-subtle); cursor: pointer;
  padding: 0.7em 0; font-family: var(--site-font-head); font-size: var(--text-base);
  font-weight: var(--fw-heavy); color: var(--ink-strong); text-align: left;
}
.mnav__cat-acc svg { flex: none; color: var(--text-muted); transition: transform var(--dur-base) var(--ease-out); }
.mnav__cat-acc[aria-expanded="true"] { color: var(--cat, var(--ink-strong)); }
.mnav__cat-acc[aria-expanded="true"] svg { transform: rotate(180deg); color: var(--cat, var(--text-muted)); }
.mnav__cat-sub { display: none; padding: var(--space-2) 0 var(--space-4) var(--space-4); border-bottom: 1px solid var(--border-subtle); }
.mnav__cat-sub.is-open { display: block; }
.mnav__grouplabel {
  font-size: var(--text-xs); font-weight: var(--fw-heavy); letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--cat, var(--text-muted));
  margin: var(--space-3) 0 var(--space-1);
}
.mnav__grouplabel:first-child { margin-top: var(--space-2); }
.mnav__sublink { display: block; padding: 0.5em 0; font-size: var(--text-base); color: var(--text-secondary); text-decoration: none; }
.mnav__sublink:hover { color: var(--cat, var(--ink-strong)); }
.mnav__btn { margin-top: var(--space-5); justify-content: center; }
