/* MarketDrive — The Growth Gauge */
:root {
  --paper: #F5F2EC;
  --ink: #14161D;
  --navy: #1A2332;
  --cobalt: #2B4EE6;
  --cobalt-light: #4A6AF0;
  --cobalt-muted: rgba(43, 78, 230, 0.12);
  --text: #1C1E26;
  --text-muted: #5A5F6E;
  --border: rgba(20, 22, 29, 0.1);
  --radius: 6px;
  --radius-lg: 12px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "Space Mono", monospace;
  --max-width: 1200px;
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding-top: var(--header-h);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
}

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

a {
  color: var(--cobalt);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { color: var(--cobalt-light); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.75em;
  color: var(--ink);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1em; padding-left: 1.35em; }
li { margin-bottom: 0.4em; }

/* Surfaces */
.surface-paper { background: var(--paper); color: var(--text); }
.surface-ink { background: var(--ink); color: #E8E6E1; }
.surface-ink h1, .surface-ink h2, .surface-ink h3, .surface-ink h4 { color: #fff; }
.surface-ink a { color: #8BA4FF; }
.surface-navy { background: var(--navy); color: #D8DDE8; }
.surface-navy h1, .surface-navy h2, .surface-navy h3, .surface-navy h4 { color: #fff; }
.surface-navy a { color: #8BA4FF; }
.surface-cobalt { background: var(--cobalt); color: #fff; }
.surface-cobalt h1, .surface-cobalt h2, .surface-cobalt h3, .surface-cobalt h4 { color: #fff; }
.surface-cobalt a { color: #fff; text-decoration-color: rgba(255,255,255,0.5); }

.accent-cobalt { color: var(--cobalt); }

/* Layout */
.container {
  width: min(100% - 2.5rem, var(--max-width));
  margin-inline: auto;
}

.section {
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.section-tight { padding: clamp(2rem, 5vw, 3.5rem) 0; }

.grid-2 {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; align-items: start; }
}

.grid-3 {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 640px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Header — always dark for readable nav on scroll */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--ink);
  color: #F5F2EC;
  border-bottom: 1px solid rgba(245, 242, 236, 0.1);
  height: var(--header-h);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  border-bottom-color: rgba(245, 242, 236, 0.14);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #F5F2EC;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--ink);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
}

.logo-mark svg { width: 22px; height: 22px; }

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #F5F2EC;
  transition: transform 0.2s, opacity 0.2s;
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
}

.site-nav {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--ink);
  padding: 2rem;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
}

.site-nav.is-open { display: flex; }

@media (min-width: 900px) {
  .site-nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 0;
    gap: 0.25rem;
    overflow: visible;
  }
}

.site-nav a {
  font-size: 0.9375rem;
  color: #F5F2EC;
  text-decoration: none;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}

.site-nav a:hover,
.site-nav a.is-active {
  background: rgba(245, 242, 236, 0.12);
  color: #fff;
}

.header-cta { display: none; }

@media (min-width: 900px) {
  .header-cta { display: inline-flex; }
}

.nav-cta-mobile {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(245, 242, 236, 0.15);
}

@media (min-width: 900px) {
  .nav-cta-mobile { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--cobalt);
  color: #fff;
  border-color: var(--cobalt);
}

.btn-primary:hover {
  background: var(--cobalt-light);
  border-color: var(--cobalt-light);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: #fff;
}

.btn-outline-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

.btn-outline-light:hover {
  background: #fff;
  color: var(--cobalt);
  border-color: #fff;
}

/* Hero — THE DRIVE */
.hero-toprow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero-toprow .tag { color: var(--cobalt); }
.hero-headline { padding-top: 1rem; }
.hero-body { padding-bottom: 2.5rem; }
.hero-sub { max-width: 56ch; font-size: 1.05rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.hero-trust { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-muted); letter-spacing: 0.06em; margin: 0; }
.hero-plate-frame { position: relative; }
.hero-plate-frame::before, .hero-plate-frame::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid var(--cobalt);
  pointer-events: none;
}
.hero-plate-frame::before { top: -6px; left: -6px; border-right: none; border-bottom: none; }
.hero-plate-frame::after { bottom: -6px; right: -6px; border-left: none; border-top: none; }
.accent-cobalt { color: var(--cobalt); }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cobalt);
  margin: 0 0 1rem;
}

.hero-slogan {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 52ch;
  margin-bottom: 2rem;
}

.hero-plate {
  margin-top: 2rem;
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 8px 8px 0 var(--cobalt-muted);
}

.hero-plate img {
  width: 100%;
  aspect-ratio: 21/9;
  object-fit: cover;
}

/* Growth Gauge */
.growth-gauge {
  margin-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.gauge-baseline {
  height: 4px;
  background: linear-gradient(90deg, var(--ink) 0%, var(--cobalt) 50%, var(--ink) 100%);
  border-radius: 2px;
  position: relative;
}

.gauge-baseline::before,
.gauge-baseline::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cobalt);
  border: 2px solid var(--paper);
}

.gauge-baseline::before { left: 0; }
.gauge-baseline::after { right: 0; background: var(--ink); }

.gauge-ticks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.gauge-ticks span:nth-child(3) {
  color: var(--cobalt);
  font-weight: 700;
}

/* Page hero (inner pages) */
.page-hero {
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2rem, 4vw, 3rem);
}

.page-hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cobalt);
  margin-bottom: 0.75rem;
}

.page-hero .lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 60ch;
}

/* Cards */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  height: 100%;
}

.card-dark {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}

.card h3 { margin-bottom: 0.5em; }

.card-icon {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cobalt);
  margin-bottom: 0.75rem;
}

/* Metrics */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .metrics-row { grid-template-columns: repeat(4, 1fr); }
}

.metric {
  text-align: center;
  padding: 1.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
}

.metric-value {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 600;
  color: var(--cobalt);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.metric-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Process steps */
.process-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .process-grid { grid-template-columns: repeat(4, 1fr); }
}

.process-step {
  position: relative;
  padding: 1.5rem;
  border-left: 3px solid var(--cobalt);
  background: rgba(43, 78, 230, 0.04);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.process-step.is-active {
  background: var(--cobalt-muted);
  border-left-color: var(--ink);
}

.process-step .step-num {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--cobalt);
  margin-bottom: 0.5rem;
}

/* Image frames */
.img-frame {
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.img-frame img { width: 100%; object-fit: cover; }

.img-caption {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-family: var(--font-mono);
}

/* Case studies */
.case-card {
  display: grid;
  gap: 1.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

@media (min-width: 768px) {
  .case-card:has(.img-frame) {
    grid-template-columns: minmax(280px, 1fr) 1.2fr;
  }
  .case-card:not(:has(.img-frame)) {
    grid-template-columns: 1fr;
  }
}

.case-card .case-body { padding: 1.75rem; }

.case-card:not(:has(.img-frame)) .case-body {
  max-width: none;
}

.case-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cobalt);
  margin-bottom: 0.5rem;
}

.case-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.case-metric strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--cobalt);
}

.case-metric span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* FAQ */
.faq-list { max-width: 780px; }

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.faq-question::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--cobalt);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item.is-open .faq-question::after {
  content: "−";
}

.faq-answer {
  display: none;
  padding: 0 0 1.25rem;
  color: var(--text-muted);
}

.faq-item.is-open .faq-answer { display: block; }

/* CTA band */
.cta-band {
  text-align: center;
  padding: clamp(3rem, 7vw, 5rem) 2rem;
  border-radius: var(--radius-lg);
}

.cta-band h2 { margin-bottom: 0.5em; }

.cta-band p {
  max-width: 48ch;
  margin: 0 auto 1.75rem;
  opacity: 0.9;
}

/* Contact form */
.form-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px var(--cobalt-muted);
}

.form-group textarea { min-height: 140px; resize: vertical; }

.form-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.form-consent {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.form-consent input { margin-top: 0.25rem; flex-shrink: 0; }

.form-alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.form-alert-success {
  background: rgba(43, 78, 230, 0.1);
  border: 1px solid var(--cobalt);
  color: var(--ink);
}

.form-alert-error {
  background: rgba(200, 50, 50, 0.08);
  border: 1px solid #c83232;
  color: #8b1a1a;
}

.contact-details {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-details li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.contact-details strong {
  display: block;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

/* Legal prose */
.legal-prose {
  max-width: 780px;
}

.legal-prose h2 {
  font-size: 1.375rem;
  margin-top: 2.5rem;
}

.legal-prose h2:first-child { margin-top: 0; }

.legal-prose h3 {
  font-size: 1.125rem;
  margin-top: 1.75rem;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.legal-nav a {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  background: #fff;
}

.legal-nav a:hover,
.legal-nav a.is-active {
  border-color: var(--cobalt);
  color: var(--cobalt);
  background: var(--cobalt-muted);
}

/* 404 */
.error-page {
  min-height: calc(100vh - var(--header-h) - 200px);
  display: flex;
  align-items: center;
  text-align: center;
  padding: 4rem 0;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 6rem;
  font-weight: 700;
  color: var(--cobalt-muted);
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  padding: clamp(3rem, 6vw, 4.5rem) 0 2rem;
  font-size: 0.875rem;
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

.footer-brand p { color: var(--text-muted); max-width: 36ch; }

.footer-heading {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li { margin-bottom: 0.5rem; }

.footer-links a {
  color: inherit;
  text-decoration: none;
}

.footer-links a:hover { color: var(--cobalt); text-decoration: underline; }

.footer-disclaimer {
  padding: 1.5rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.surface-ink .footer-disclaimer {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(232, 230, 225, 0.75);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.surface-ink .footer-bottom { border-color: rgba(255,255,255,0.1); }

/* Service detail */
.service-block {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.service-block:last-child { border-bottom: none; }

.service-block h2 { font-size: 1.5rem; }

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.mb-lg { margin-bottom: 2.5rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--navy);
  color: #F5F2EC;
  padding: 1.5rem 2rem;
  z-index: 200;
  box-shadow: 0 -4px 30px rgba(0,0,0,.25);
  display: none;
}
.cookie-banner.is-visible { display: block; }
.cookie-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.cookie-inner p { max-width: 720px; font-size: 0.9rem; line-height: 1.55; margin: 0; }
.cookie-btns { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.cookie-btns button { cursor: pointer; flex-shrink: 0; }
.cookie-banner .btn-primary {
  background: #fff;
  color: var(--cobalt);
  border: 2px solid #fff;
}
.cookie-banner .btn-primary:hover {
  background: var(--cobalt);
  color: #fff;
  border-color: var(--cobalt);
}
.cookie-banner .btn-outline-light {
  color: #F5F2EC;
  background: transparent;
  border: 2px solid rgba(245, 242, 236, 0.75);
}
.cookie-banner .btn-outline-light:hover {
  background: rgba(245, 242, 236, 0.12);
  color: #fff;
  border-color: #F5F2EC;
}
.cookie-panel .btn-outline {
  color: var(--ink);
  border-color: var(--ink);
}
.cookie-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,22,29,.82);
  z-index: 201;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.cookie-modal.is-open { display: flex; }
.cookie-panel {
  background: var(--paper);
  color: var(--ink);
  padding: 2rem;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
}
.cookie-panel label { display: flex; gap: 0.75rem; margin: 0.75rem 0; font-size: 0.9rem; }

.js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 1; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .js .reveal.is-visible { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .js .reveal { transition: none; } }
