/* ============================================================
   Clearcost — global.css (shared)
   Tokens, base, type, buttons, navbar, hero, stats, CTA banner, footer. Loaded on every page.
   ============================================================ */


:root {
  --bg: #F4F4F4;
  --ink: #2E2E2E;
  --ink-2: #535353;
  --muted: #8B8B8B;
  --surface: #FFFFFF;
  --surface-grey: #EAEAEA;
  --deep: #1F1F1F;
  --accent: #FF5A1F;
  --accent-hover: #E64A12;
  --hairline: rgba(46, 46, 46, 0.35);
  --hairline-light: rgba(255, 255, 255, 0.6);

  --sans: 'DM Sans', sans-serif;
  --mono: 'DM Mono', monospace;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --t: all 0.45s var(--ease);
  --glow-0: 0 0 28px 0 rgba(255, 90, 31, 0), 0 14px 44px -10px rgba(255, 90, 31, 0);
  --glow: 0 0 28px 0 rgba(255, 90, 31, 0.16), 0 14px 44px -10px rgba(255, 90, 31, 0.32);
  --text-glow: 0 0 18px rgba(255, 90, 31, 0.35);

  --pad-x: clamp(20px, 3vw, 40px);
  --section-y: clamp(80px, 9vw, 140px);
}

/* ---------- base ---------- */

html { overflow-anchor: none; scroll-behavior: smooth; }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
input, select, textarea, button { font-family: var(--sans); }
::selection { background: var(--accent); color: var(--deep); }
[id] { scroll-margin-top: 96px; }
.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;
}

/* ---------- shared type ---------- */

.kicker {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}
.h2 {
  margin: 0;
  font-size: clamp(32px, 3.8vw, 3.75rem);
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.h2 strong, .statement strong { font-weight: 700; color: var(--accent); }
.h2-legacy {
  margin: 0;
  font-size: clamp(32px, 4.4vw, 68px);
  line-height: 0.95;
  font-weight: 500;
  letter-spacing: -0.045em;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border: 0.5px solid var(--hairline);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 1rem;
  text-transform: uppercase;
  white-space: nowrap;
}
.tag--sm { padding: 14px 20px; }
.tag svg { flex: none; }

.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  text-align: center;
}
.wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--section-y) var(--pad-x);
}

/* ---------- buttons ---------- */

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 0.9em 1.5em;
  border: 0.5px solid var(--hairline);
  border-radius: 0.9rem;
  font-size: 1rem;
  font-weight: 500;
  color: inherit;
  background: transparent;
  transition: var(--t);
  box-shadow: var(--glow-0);
}
.btn-outline:hover { background: var(--ink); color: #FFFFFF; box-shadow: var(--glow); }

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 14px;
  text-transform: uppercase;
  padding: 18px 32px;
  background: var(--accent);
  color: #FFFFFF;
  border: 0;
  border-radius: 100px;
  transition: var(--t);
  box-shadow: var(--glow-0);
}
.btn-pill:hover { background: var(--accent-hover); box-shadow: var(--glow); }
.btn-pill svg { flex: none; }

/* ============================================================
   NAVBAR — fixed floating glass bar
   ============================================================ */

.nav {
  position: fixed;
  left: 0; right: 0; top: 0;
  z-index: 50;
  padding: 0.75rem;
}
.nav-bar {
  position: relative;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 56rem;
  padding: 0.5rem 0.5rem 0.5rem 1.5rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 0.5px solid var(--hairline-light);
  box-shadow: 0 4px 24px rgba(31, 31, 31, 0.08);
  transition: max-width 0.6s var(--ease), box-shadow 0.4s ease-out;
}
.nav.is-stuck .nav-bar {
  max-width: 46rem;
  box-shadow: 0 8px 32px rgba(31, 31, 31, 0.12), 0 0 0 1px rgba(46, 46, 46, 0.08);
}
.nav-logo { display: flex; align-items: center; }
.nav-logo img {
  height: 30px;
  width: auto;
  /* placeholder logo is white — darkened. Replace with a dark asset in production. */
  filter: brightness(0) invert(0.18);
}
.nav-right { display: flex; align-items: center; gap: 1.5rem; }
.nav-links {
  display: none;
  align-items: center;
  gap: 1.25rem;
  margin: 0; padding: 0;
  list-style: none;
  font-size: 15px;
}
.nav-links a { color: var(--ink); transition: var(--t); }
.nav-links a:hover { color: var(--muted); text-shadow: var(--text-glow); }
.nav-links a.is-active { color: var(--accent); }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 2rem; height: 2rem;
  padding: 0; border: 0;
  background: transparent;
  cursor: pointer;
}
.nav-toggle-bar {
  width: 18px; height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.25s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

.nav-mobile {
  display: none;
  margin: 0.5rem auto 0;
  max-width: 56rem;
  border-radius: 1rem;
  background: #FFFFFF;
  padding: 0.5rem 1.5rem 1rem;
  flex-direction: column;
  font-size: 15px;
}
.nav.is-open .nav-mobile { display: flex; }
.nav-mobile a { padding: 0.6rem 0; border-top: 0.5px solid #EAEAEA; }
.nav-mobile a:first-child { border-top: 0; }
.nav-mobile a.is-active { color: var(--accent); }

@media (min-width: 640px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
  .nav-mobile { display: none !important; }
}

/* CTA "Book a review" — arrow swap on hover */
.nav-cta {
  position: relative;
  display: inline-grid;
  align-items: center;
  cursor: pointer;
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: scale 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-cta:active { scale: 0.96 0.93; }
.nav-cta-inner {
  position: relative;
  grid-area: 1 / 1;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375em;
  overflow: clip;
  padding: 0.75em 1.25em 0.75em 1.5em;
  border-radius: 0.9rem;
  pointer-events: none;
}
.nav-cta-bg {
  grid-area: 1 / 1;
  width: 100%; height: 100%;
  border-radius: 0.9rem;
  background: var(--accent);
  box-shadow: var(--glow-0);
  transition: box-shadow 0.5s var(--ease);
}
.nav-cta-icon {
  flex: none;
  width: 0.875em; height: 0.875em;
  transition: translate 0.5s var(--ease), opacity 0.15s ease-out;
}
.nav-cta-icon.is-left { position: absolute; left: 1.25em; opacity: 0; translate: -1.5em; }
.nav-cta-text { flex: none; transition: translate 0.5s var(--ease); }
@media (hover: hover) {
  .nav-cta:hover .nav-cta-icon.is-left { opacity: 1; translate: 0; }
  .nav-cta:hover .nav-cta-icon.is-right { opacity: 0; translate: 1.5em; }
  .nav-cta:hover .nav-cta-text { translate: 0.75em; }
  .nav-cta:hover .nav-cta-bg {
    box-shadow: 0 0 28px 0 rgba(255, 90, 31, 0.22), 0 14px 44px -10px rgba(255, 90, 31, 0.45);
  }
}

/* ============================================================
   HERO — shared pattern on all pages
   ============================================================ */

.hero {
  position: relative;
  height: 100vh;
  min-height: 640px;
  overflow: hidden;
  background: var(--deep);
  display: flex;
  align-items: flex-end;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.hero-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(31, 31, 31, 0) 45%, rgba(31, 31, 31, 0.65) 100%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  width: 100%;
  padding: 0 2.5rem 4rem;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.hero h1 {
  margin: 0;
  font-size: clamp(52px, 6.5vw, 6.5rem);
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.04em;
  max-width: 16ch;
  text-wrap: balance;
}
.hero-row { display: flex; align-items: center; gap: 2.5rem; flex-wrap: wrap; }
.hero--dark .tag { border-color: var(--hairline-light); }
.hero-divider { width: 1px; align-self: stretch; min-height: 84px; background: rgba(46, 46, 46, 0.4); }
.hero--dark .hero-divider { background: rgba(255, 255, 255, 0.5); }
.hero-desc { margin: 0; max-width: 360px; font-size: 1.25rem; line-height: 1.45; }
.hero-desc--wide { max-width: 520px; }

/* light heroes */
.hero--light { background: var(--bg); }
.hero--light .hero-content { color: var(--ink); }

/* Stats row */
.stats { border-top: 0.5px solid var(--hairline); border-bottom: 0.5px solid var(--hairline); }
.stats-grid {
  max-width: 1200px; /* matches the feature-icon grid above so both sit on the same axis */
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.stat {
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.stat-value { font-size: clamp(40px, 4vw, 64px); font-weight: 500; letter-spacing: -0.05em; line-height: 1; }
.stat-label { font-family: var(--mono); font-size: 13px; text-transform: uppercase; color: var(--muted); }
/* dark variant (About) */
.stats--dark { background: var(--ink); color: var(--bg); border: 0; }
.stats--dark .stats-grid { padding: clamp(64px, 7vw, 100px) var(--pad-x); gap: 24px; }
.stats--dark .stat { padding: 0; }

/* ============================================================
   CTA BANNER — "Your team, amplified"
   ============================================================ */

.cta-wrap { max-width: 1440px; margin: 0 auto; padding: 0 var(--pad-x) var(--section-y); }
.cta {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--deep);
}
.cta-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.55;
  pointer-events: none;
}
.cta-content {
  position: relative;
  padding: clamp(28px, 4vw, 56px);
  color: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 900px;
}
.cta-kicker { font-family: var(--mono); font-size: 13px; text-transform: uppercase; }
.cta h2 { margin: 0; font-size: clamp(30px, 3.7vw, 58px); line-height: 0.98; font-weight: 500; letter-spacing: -0.045em; }

/* ============================================================
   FOOTER
   ============================================================ */

.footer { background: var(--ink); color: var(--bg); overflow: hidden; }
.footer-grid {
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(64px, 7vw, 100px) var(--pad-x) 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 40px 32px;
}
.footer-col { display: flex; flex-direction: column; gap: 14px; }
.footer-col h4 {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-col a { font-size: 16px; line-height: 1.3; align-self: flex-start; transition: color 0.3s ease; }
.footer-col a:hover { color: var(--accent); }
.footer-text { font-size: 17px; line-height: 1.5; }
.newsletter { display: flex; border-bottom: 0.5px solid var(--hairline-light); }
.newsletter input {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  padding: 10px 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--bg);
}
.newsletter input::placeholder { color: var(--muted); }
/* stop browser autofill painting a white box on the dark footer */
.newsletter input:-webkit-autofill,
.newsletter input:-webkit-autofill:hover,
.newsletter input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--bg);
  caret-color: var(--bg);
  box-shadow: 0 0 0 1000px var(--ink) inset;
  transition: background-color 9999s ease-out 0s;
}
.newsletter button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  padding: 12px 0;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  transition: color 0.3s ease;
}
.newsletter button:hover { color: var(--accent); }
.newsletter button[disabled] { opacity: 0.6; cursor: wait; }
.newsletter.has-error { border-bottom-color: var(--accent); }
.newsletter-msg { font-size: 13px; line-height: 1.5; color: var(--bg); }
.newsletter-msg.is-error { color: var(--accent); }
.newsletter-msg[hidden] { display: none; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.footer-note { font-size: 13px; line-height: 1.5; color: var(--muted); }
.footer-note a { text-decoration: underline; text-underline-offset: 2px; }
.footer-note a:hover { color: var(--accent); }
.footer-wordmark-wrap { max-width: 1440px; margin: 0 auto; padding: clamp(48px, 6vw, 80px) var(--pad-x) 0; }
.footer-wordmark {
  font-size: clamp(64px, 15vw, 230px);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 0.78;
  text-transform: uppercase;
  white-space: nowrap;
}
.footer-bottom {
  max-width: 1440px;
  margin: 32px auto 0;
  padding: 28px var(--pad-x);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 0.5px solid #535353;
}
.footer-bottom a:hover { color: var(--accent); }

/* ============================================================
   MOTION PREFERENCES
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Chip row wrapper (Services rows and Contact interest picker) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ============================================================
   PHOTO TREATMENT — all photographic imagery is greyscale
   (hero artwork and the logo are excluded on purpose)
   ============================================================ */

.card-img img,
.industries-img img,
.story-img img,
.service-img img,
.founder-img img,
.director-img img,
.member-img img,
.contact-img img,
.cta-img {
  filter: grayscale(1);
}

/* ============================================================
   RESPONSIVE — tablet and phone
   ============================================================ */

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 28px 12px; }
}

@media (max-width: 640px) {
  :root { --pad-x: 20px; --section-y: 4rem; }

  /* hero: compact so heading, tag and copy fit a phone screen */
  .hero { height: 70vh; height: 70svh; min-height: 480px; }
  .hero-content { padding: 0 1.25rem 2.5rem; gap: 1.25rem; }
  .hero h1 { font-size: clamp(38px, 11vw, 52px); max-width: none; }
  .hero-row { gap: 1rem; }
  .hero-divider { display: none; }
  .hero-desc { font-size: 1.0625rem; max-width: none; }

  /* tags must be allowed to wrap on narrow screens */
  .tag { white-space: normal; font-size: 0.8125rem; line-height: 1.3; padding: 10px 14px; gap: 8px; }
  .tag svg { width: 20px; height: 20px; }

  .section-head { gap: 1.25rem; }
  .h2 { font-size: clamp(28px, 8vw, 34px); }
  .h2-legacy { font-size: clamp(30px, 8.5vw, 36px); }
  .kicker { margin-bottom: 14px; }

  .stat-value { font-size: clamp(32px, 9vw, 40px); }
  .stat-label { font-size: 11px; }

  .cta { min-height: 400px; }
  .cta-content { gap: 18px; }
  .btn-pill { padding: 16px 26px; }

  .footer-grid { gap: 32px 24px; }
  .footer-wordmark { font-size: clamp(40px, 14vw, 230px); }

  .nav { padding: 0.5rem; }
  .nav-bar { padding: 0.4rem 0.4rem 0.4rem 1rem; }
  .nav-logo img { height: 26px; }
  .nav-cta { font-size: 0.9375rem; }
  /* hamburger sits centred between the logo and the CTA */
  .nav-bar { gap: 0.75rem; }
  .nav-right { flex: 1; gap: 0.5rem; }
  .nav-toggle { margin: 0 auto; }
}
