/* ============================================================
   360ROI Global Stylesheet (Reference Build)
   Source of truth: Website/Technical/360ROI-design-tokens.md
   Light is the default theme. Dark is an opt-in toggle that
   respects the visitor's system setting and persists.
   Intentionally dark bands (hero, CTA, footer) stay dark in
   both modes as design accents.
   ============================================================ */

/* ---------- 1. Brand tokens (fixed in both themes) ---------- */
:root {
  --purple-360: #533078;
  --blue-roi:   #3C78C0;
  --violet-deep:#482478;
  --steel:      #486CB4;
  --sky:        #4884C0;
  --brand-gradient: linear-gradient(120deg, #482478 0%, #533078 30%, #486CB4 70%, #3C78C0 100%);

  --cta:       #E0741A;
  --cta-hover: #C45F12;

  --maxw: 1120px;
  --maxw-narrow: 900px;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(30,30,32,0.07);
  --shadow-lg: 0 8px 28px rgba(30,30,32,0.10);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;

  /* ---- Semantic tokens: LIGHT THEME (default) ---- */
  --bg:        #FFFFFF;   /* page background */
  --surface:   #FFFFFF;   /* cards, header, form, dropdown */
  --surface-2: #F4F5F7;   /* alternating sections, BLUF */
  --border:    #E8E8EE;   /* hairlines */
  --header-bg: rgba(255,255,255,0.96);
  --text:      #1E1E20;   /* body text */
  --heading:   #533078;   /* H1-H4 */
  --link:      #3C78C0;   /* inline links */
  --slate:     #6B6C72;   /* muted labels (darkened from spec for AA on white) */
  --growth:    #16A06B;   /* positive metrics */
  --footer-bg: #1E1E20;   /* charcoal footer, both modes */
}

/* ---- Semantic tokens: DARK THEME ---- */
[data-theme="dark"] {
  --bg:        #141118;
  --surface:   #1E1A26;
  --surface-2: #251F30;
  --border:    rgba(255,255,255,0.12);
  --header-bg: rgba(20,17,24,0.94);
  --text:      #E9E7EE;
  --heading:   #CDB9F2;   /* lightened purple for contrast on dark */
  --link:      #87B6EE;   /* lightened blue for contrast on dark */
  --slate:     #A6A4AE;
  --growth:    #2DC389;
  --footer-bg: #100E14;
  --shadow:    0 2px 14px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 32px rgba(0,0,0,0.5);
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
h1, h2, h3, h4 { color: var(--heading); line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0 0 0.6em; letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; margin: 1.6em 0 0.5em; }
p { margin: 0 0 1.1em; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: var(--text); font-weight: 700; }
img { max-width: 100%; height: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--purple-360);
  color: #fff; padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: var(--maxw-narrow); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section--cloud { background: var(--surface-2); }
.section--dark { background: var(--footer-bg); color: #fff; }
.section--dark h2, .section--dark h3 { color: #fff; }
.section--dark .stat .label { color: rgba(255,255,255,0.82); }
.section--dark .eyebrow { color: var(--sky); }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem;
  font-weight: 700; color: var(--blue-roi); margin: 0 0 0.8em;
}

/* ---------- 3. Buttons ---------- */
.btn {
  display: inline-block; font-weight: 700; font-size: 1rem;
  padding: 14px 26px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--cta); color: #1E1E20; }
.btn--primary:hover { background: var(--cta-hover); color: #1E1E20; }
.btn--secondary { background: transparent; border-color: var(--heading); color: var(--heading); }
.btn--secondary:hover { background: var(--surface-2); }
.btn--on-dark { background: var(--cta); color: #1E1E20; }
.btn--ghost-light { background: transparent; border-color: rgba(255,255,255,0.6); color: #fff; }
.btn--ghost-light:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ---------- 4. Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; background: var(--header-bg);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 12px; }
.brand { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.brand .n360 { color: var(--heading); }
.brand .roi { color: var(--blue-roi); }
.brand:hover { text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a.navlink, .nav .dropdown > button {
  font: inherit; font-size: 0.97rem; font-weight: 600; color: var(--text);
  background: none; border: 0; padding: 10px 14px; cursor: pointer; border-radius: 6px;
}
.nav a.navlink:hover, .nav .dropdown > button:hover { color: var(--heading); text-decoration: none; background: var(--surface-2); }
.nav .nav-cta { margin-left: 4px; }
.nav-toggle { display: none; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: 100%; left: 0; min-width: 240px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .15s, transform .15s; display: flex; flex-direction: column;
}
.dropdown:hover .dropdown-menu, .dropdown:focus-within .dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown-menu a { padding: 10px 12px; border-radius: 6px; color: var(--text); font-size: 0.95rem; font-weight: 600; }
.dropdown-menu a:hover { background: var(--surface-2); color: var(--heading); text-decoration: none; }
.dropdown-menu .menu-note { color: var(--slate); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .1em; padding: 8px 12px 4px; }

/* Theme toggle */
.theme-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; font-size: 1.1rem; line-height: 1;
  transition: background .15s, border-color .15s;
}
.theme-toggle:hover { background: var(--surface-2); border-color: var(--heading); }
.theme-toggle .ico-sun { display: none; }
[data-theme="dark"] .theme-toggle .ico-sun { display: inline; }
[data-theme="dark"] .theme-toggle .ico-moon { display: none; }

/* ---------- 5. Hero (dark accent, both modes) ---------- */
.hero { background: var(--brand-gradient); color: #fff; padding: 84px 0 78px; }
.hero h1 { color: #fff; max-width: 18ch; }
.hero .subhead { font-size: 1.22rem; max-width: 60ch; margin: 1.1em 0 1.8em; color: rgba(255,255,255,0.92); }
.hero .hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero .secondary-paths { margin-top: 1.4em; font-size: 0.98rem; color: rgba(255,255,255,0.85); }
.hero .secondary-paths a { color: #fff; text-decoration: underline; font-weight: 600; }
.hero .secondary-paths span { opacity: 0.5; margin: 0 10px; }

/* ---------- 6. BLUF + callouts ---------- */
.bluf {
  background: var(--surface-2); border-left: 5px solid var(--purple-360);
  padding: 26px 28px; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 28px;
  font-size: 1.12rem; color: var(--text);
}
[data-theme="dark"] .bluf { border-left-color: var(--heading); }
.bluf p:last-child { margin-bottom: 0; }
.callout {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px;
  background: var(--surface); box-shadow: var(--shadow); margin: 0 0 8px;
}
.callout .label { font-weight: 800; color: var(--heading); }

/* ---------- 7. Prose ---------- */
.prose h2 { margin-top: 1.4em; }
.prose > p:first-of-type { margin-top: 0; }
.prose .inline-cta { display: inline-block; margin: 0.3em 0 1.4em; font-weight: 700; color: var(--link); }
.lede { font-size: 1.18rem; color: var(--text); }

/* ---------- 8. Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; color: var(--heading); }
.card .num { font-size: 0.8rem; font-weight: 800; color: var(--blue-roi); letter-spacing: .1em; }
[data-theme="dark"] .card .num { color: var(--sky); }
a.card:hover { border-color: var(--heading); text-decoration: none; }

/* ---------- 9. Stat blocks ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; align-items: start; }
.stat { text-align: center; padding: 8px; }
.stat .figure { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; color: var(--growth); line-height: 1.2; white-space: nowrap; }
.stat .figure.brandfig { color: var(--heading); }
.stat .label { margin-top: 10px; color: var(--text); font-size: 0.98rem; }

/* ---------- 10. FAQ ---------- */
.faq details { border-bottom: 1px solid var(--border); padding: 6px 0; }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 36px 16px 0; position: relative;
  font-weight: 700; color: var(--heading); font-size: 1.06rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 14px; font-size: 1.5rem;
  color: var(--link); font-weight: 400; transition: transform .2s;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { padding-bottom: 4px; }
.faq .answer { padding: 0 0 18px; color: var(--text); }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---------- 11. CTA band (dark accent, both modes) ---------- */
.cta-band { background: var(--brand-gradient); color: #fff; padding: 72px 0; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.92); max-width: 64ch; }
.cta-band .email-backup { font-size: 0.96rem; color: rgba(255,255,255,0.85); margin-top: 1.2em; }
.cta-band .email-backup a { color: #fff; text-decoration: underline; }

/* ---------- 12. Footer (dark accent, both modes) ---------- */
.site-footer { background: var(--footer-bg); color: #fff; padding: 56px 0 28px; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: #fff; font-size: 0.82rem; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 14px; }
.site-footer a { color: rgba(255,255,255,0.78); display: block; padding: 5px 0; font-size: 0.95rem; }
.site-footer a:hover { color: #fff; }
.site-footer .brand { color: #fff; }
.site-footer .brand .n360 { color: #fff; }
.site-footer .brand .roi { color: var(--sky); }
.site-footer .tagline { color: #9B9DA1; font-size: 0.92rem; margin-top: 12px; max-width: 30ch; }
.site-footer .legal {
  border-top: 1px solid rgba(255,255,255,0.14); margin-top: 36px; padding-top: 20px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  color: #9B9DA1; font-size: 0.85rem;
}
.site-footer .legal a { display: inline; color: #9B9DA1; }
.site-footer .legal a:hover { color: #fff; }

/* ---------- 13. Forms ---------- */
.form-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow-lg);
}
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; color: var(--text); margin-bottom: 6px; font-size: 0.95rem; }
.field .req { color: var(--cta); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 8px;
  font: inherit; font-size: 1rem; color: var(--text); background: var(--bg);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue-roi); box-shadow: 0 0 0 3px rgba(60,120,192,0.18);
}
.field .hint { font-size: 0.85rem; color: var(--slate); margin-top: 5px; }
.form-note { font-size: 0.88rem; color: var(--slate); margin-top: 12px; }

/* ---------- 14. Misc ---------- */
.breadcrumb { font-size: 0.85rem; color: rgba(255,255,255,0.8); margin-bottom: 1em; }
.breadcrumb a { color: #fff; text-decoration: underline; }
.breadcrumb span { opacity: 0.6; margin: 0 8px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 8px 0 8px 32px; position: relative; }
.checklist li::before {
  content: "\2713"; position: absolute; left: 0; top: 8px; color: var(--growth);
  font-weight: 800; background: rgba(22,160,107,0.14); width: 22px; height: 22px;
  border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; line-height: 1;
}
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 44px; align-items: start; }
.tag-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 0; }
.tag { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 0.9rem; font-weight: 600; color: var(--text); }

/* ---------- 15. Responsive ---------- */
@media (max-width: 920px) {
  .nav-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.25rem; line-height: 1; }
  .nav-toggle:hover { background: var(--surface-2); border-color: var(--heading); }
  .nav { display: none; position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: 8px 24px 18px; max-height: calc(100vh - 70px); overflow-y: auto; }
  .nav.nav--open { display: flex; }
  .nav a.navlink, .nav .dropdown > button { width: 100%; text-align: left; padding: 12px 6px; font-size: 1.05rem; }
  .nav .dropdown { width: 100%; }
  .nav .dropdown-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; min-width: 0; padding: 0 0 6px 10px; }
  .grid-2, .grid-3, .grid-4, .stat-grid, .site-footer .cols, .two-col { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .hero { padding: 60px 0 56px; }
}

/* ---------- 16. Table of contents (long pages) ---------- */
/* Anchored headings clear the 70px sticky header on jump */
h2[id], h3[id], section[id] { scroll-margin-top: 88px; }

.toc {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; margin: 28px 0 0;
}
.toc .toc-label {
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.74rem;
  font-weight: 700; color: var(--slate); margin: 0 0 12px;
}
.toc ol {
  margin: 0; padding: 0; list-style: none;
  counter-reset: toc; columns: 2; column-gap: 36px;
}
.toc li {
  counter-increment: toc; position: relative; padding-left: 28px;
  margin: 0 0 10px; break-inside: avoid; font-size: 0.98rem; line-height: 1.45;
}
.toc li::before {
  content: counter(toc, decimal-leading-zero); position: absolute; left: 0; top: 2px;
  font-size: 0.76rem; font-weight: 800; color: var(--blue-roi); letter-spacing: .04em;
}
[data-theme="dark"] .toc li::before { color: var(--sky); }
.toc a { color: var(--text); font-weight: 600; }
.toc a:hover { color: var(--heading); text-decoration: none; }
@media (max-width: 600px) { .toc ol { columns: 1; } }

/* ---------- 17. Hero with inline form (prototype) ---------- */
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero-grid .form-card { margin: 0; }
.hero-form .eyebrow { margin-bottom: 0.5em; }
.hero-form h3 { color: var(--heading); }
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Brand logo (real image mark) ---------- */
.brand-logo{height:52px;width:auto;display:block}
.site-header .brand{display:inline-flex;align-items:center}
.site-footer .brand{display:inline-flex;align-items:center}
[data-theme="light"] .site-header .brand-logo--dark{display:none}
[data-theme="dark"] .site-header .brand-logo--light{display:none}
@media (max-width:600px){.brand-logo{height:44px}}

/* ---------- 18. About page spacing prototype (opt-in, Workstream A) ---------- */
.section--tight { padding: 48px 0; }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 44px; align-items: start; }
.about-cols > p { margin-top: 0; }
@media (max-width: 920px) {
  .section--tight { padding: 36px 0; }
  .about-cols { grid-template-columns: 1fr; gap: 0; }
}
.about-cols > p:last-child:nth-child(odd) { grid-column: 1 / -1; }
