/* ============================================================
   EchoLeads — design tokens
   Palette + type per approved plan (OpenHands-inspired)
   ============================================================ */

:root {
  --yellow: #F5F06E;
  --ink: #111110;
  --charcoal: #2B2B27;
  --cream: #FAF7F0;
  --white: #FFFFFF;

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;

  /* type scale (mobile first) */
  --text-h1: clamp(2.35rem, 8vw, 4.25rem);
  --text-h2: clamp(1.75rem, 5vw, 2.75rem);
  --text-h3: 1.185rem;
  --text-body: 1.0625rem;
  --text-small: 0.875rem;
  --text-mono: 0.8125rem;

  --container: 72rem;
  --gutter: 1.25rem;
  --band-y: clamp(4rem, 10vw, 7.5rem);
  --radius: 10px;
}

/* ============================================================
   Reset / base
   ============================================================ */

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a, button, summary { touch-action: manipulation; }

img, svg { max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); line-height: 1.1; }
h3 { font-size: var(--text-h3); line-height: 1.3; letter-spacing: -0.01em; }

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

strong { font-weight: 600; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.band--dark :focus-visible { outline-color: var(--yellow); }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.skip-link {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 30;
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius);
  transform: translateY(-250%);
}

.skip-link:focus-visible {
  transform: none;
  outline-color: var(--yellow);
}

/* ============================================================
   Bands (alternating full-bleed sections)
   ============================================================ */

.band { padding-block: var(--band-y); }

/* keep anchored sections clear of the sticky header */
[id] { scroll-margin-top: 5rem; }

.band--yellow { background: var(--yellow); }
.band--white  { background: var(--white); }
.band--cream  { background: var(--cream); }

.band--dark {
  background: var(--ink);
  color: var(--white);
}

/* OpenHands signature: faint dot grid on yellow.
   The dots live on a separate ::before layer that script.js pins to the viewport by
   GPU transform (--dot-y), so the grid holds still inside each yellow frame while the
   text scrolls up over it. Using transform (not background-position) keeps it composited
   and smooth on iOS. With no JS / reduced motion, --dot-y stays 0 and dots scroll normally. */
.band--dots {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--yellow);
}

.band--dots::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10vh;
  height: 120vh;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(17, 17, 16, 0.16) 1.2px, transparent 1.2px);
  background-size: 26px 26px;
  background-position: center top;
  transform: translate3d(0, var(--dot-y, 0px), 0);
}

@media (prefers-reduced-motion: no-preference) {
  .band--dots::before { will-change: transform; }
}

.band__header {
  max-width: 44rem;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.band__sub {
  font-size: 1.125rem;
  max-width: 38rem;
}

.band__kicker {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  color: var(--yellow);
}

/* ============================================================
   Mono utility text
   ============================================================ */

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 1.1rem;
}

.eyebrow--on-dark { color: var(--yellow); }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 0.8rem 1.5rem;
  min-height: 44px;
  transition: transform 120ms ease, background-color 120ms ease;
}

.btn--solid {
  background: var(--ink);
  color: var(--white);
  border: 2px solid var(--ink);
}

.btn--solid:hover { background: var(--charcoal); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}

.btn--ghost:hover { background: rgba(17, 17, 16, 0.06); }

.btn--lg { padding: 1rem 1.9rem; font-size: 1.0625rem; }

.btn:active { transform: translateY(1px); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.cta-row--center {
  justify-content: center;
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
}

/* ============================================================
   Header / nav
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--white);
  border-bottom: 1px solid var(--ink);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.8rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark__mark { width: 1.35em; height: 1.35em; flex: none; }

.nav__toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
  padding: 0.4rem 0.6rem;
  background: none;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  color: var(--ink);
}

.nav__toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
}

.nav__menu {
  display: none;
  align-items: center;
  gap: 1.6rem;
}

.nav__menu a:not(.btn) {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.6rem 0;
}

.nav__menu a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; }

.nav__menu .btn { padding: 0.6rem 1.2rem; }

/* mobile: menu drops below header when open */
.nav__menu.is-open {
  display: flex;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  background: var(--white);
  border-bottom: 1px solid var(--ink);
  padding: 0.5rem var(--gutter) 1.25rem;
}

.nav__menu.is-open a:not(.btn) {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(17, 17, 16, 0.12);
}

.nav__menu.is-open .btn { margin-top: 1rem; }

@media (min-width: 48rem) {
  .nav__toggle { display: none; }
  .nav__menu { display: flex; position: static; }
}

/* ============================================================
   Client logo strip (center-focused, looping, swipeable)
   ============================================================ */

.clients {
  background: var(--white);
  padding-block: 0.85rem 1rem;
}

.clients__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(17, 17, 16, 0.6);
  text-align: center;
  margin: 0 0 0.5rem;
}

/* Constrained, centred viewport — the strip lives in the middle of the page,
   not edge-to-edge, with the logos fading out at both ends. */
.clients__viewport {
  max-width: 40rem;
  margin-inline: auto;
  overflow-x: auto;
  overflow-y: hidden;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

.clients__viewport::-webkit-scrollbar { display: none; }
.clients__viewport.is-dragging { cursor: grabbing; }

.clients__track {
  list-style: none;
  margin: 0;
  display: flex;
  width: max-content;
  align-items: center;
  gap: 0.2rem;
  padding-block: 0.3rem;
}

.client {
  flex: 0 0 auto;
  width: 116px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
}

.client img {
  max-height: 30px;
  max-width: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
  /* Friction against casual saving: no drag, no long-press callout, no selection.
     Pointer events pass through to the scroller so swipe/drag still work. */
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
  opacity: 0.4;
  filter: grayscale(1);
  transform: scale(0.8);
  transition:
    opacity 350ms ease,
    filter 350ms ease,
    transform 350ms cubic-bezier(0.22, 1, 0.36, 1);
}

.client.is-active img {
  opacity: 1;
  filter: none;
  transform: scale(1.5);
}

@media (prefers-reduced-motion: reduce) {
  .client img {
    transition: none;
    transform: none;
    opacity: 0.7;
  }
  .client.is-active img { transform: none; opacity: 1; filter: none; }
}

/* ============================================================
   Hero
   ============================================================ */

.hero__inner {
  text-align: center;
  max-width: 52rem;
  padding-block: clamp(1.5rem, 5vw, 3.5rem);
}

.hero h1 { margin-inline: auto; }

.hero__sub {
  font-size: clamp(1.0625rem, 2.2vw, 1.25rem);
  max-width: 38rem;
  margin: 0 auto 2.2rem;
}

.hero .cta-row { justify-content: center; }

.hero__note {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  margin-top: 1.4rem;
}

/* ============================================================
   Split (editorial two-column) layouts
   ============================================================ */

.split {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

@media (min-width: 60rem) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--reverse .split__lead { order: 2; }
  .split--reverse .split__panel { order: 1; }
}

.signature {
  font-family: var(--font-mono);
  font-size: var(--text-small);
  margin-top: 1.6rem;
}

/* ============================================================
   Stat cards (charcoal, yellow figures)
   ============================================================ */

.stat-stack {
  display: grid;
  gap: 0.9rem;
}

.stat-card {
  background: var(--charcoal);
  color: var(--white);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
}

.stat-card__figure {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 4.5vw, 2.8rem);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--yellow);
  flex: none;
  min-width: 5.2ch;
}

.stat-card__label {
  font-size: 0.9375rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

.stat-stack__source {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(17, 17, 16, 0.62);
  margin-top: 0.35rem;
}

.stat-card--feature {
  flex-direction: column;
  gap: 0.8rem;
  padding: clamp(2rem, 5vw, 3rem);
}

.stat-card--feature .stat-card__figure {
  font-size: clamp(3.5rem, 9vw, 5.5rem);
}

.stat-card--feature .stat-card__label { font-size: 1.0625rem; }

/* ============================================================
   Card grids (dark band + white band)
   ============================================================ */

.card-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 48rem) {
  .card-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}

.dark-card {
  background: var(--charcoal);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
}

.dark-card__icon {
  width: 44px;
  height: 44px;
  color: var(--yellow);
  margin-bottom: 1.1rem;
}

.dark-card h3 { color: var(--white); }

.dark-card p {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.82);
}

.line-card {
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
  background: var(--white);
}

.line-card p { font-size: 0.9375rem; }

/* ============================================================
   Steps (the plan)
   ============================================================ */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  counter-reset: step;
}

@media (min-width: 48rem) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}

.step {
  background: var(--white);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
}

.step__num {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.8rem;
}

.step p:not(.step__num) { font-size: 0.9375rem; }

/* ============================================================
   Explanatory paragraph + FAQ
   ============================================================ */

.explain {
  max-width: 46rem;
  margin-bottom: clamp(3.5rem, 8vw, 6rem);
  font-size: 1.125rem;
  line-height: 1.7;
}

@media (min-width: 60rem) {
  .faq { grid-template-columns: 1fr 1.6fr; }
}

.faq__title {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  margin-bottom: 1.2rem;
}

.faq__list {
  border-top: 1px solid var(--ink);
}

.faq__item {
  border-bottom: 1px solid var(--ink);
}

.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  padding: 1.35rem 0.2rem;
  min-height: 44px;
}

.faq__item summary::-webkit-details-marker { display: none; }

.faq__plus {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
}

.faq__plus::before,
.faq__plus::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  background: var(--ink);
  transition: transform 160ms ease;
}

.faq__plus::before { width: 18px; height: 2px; }
.faq__plus::after { width: 2px; height: 18px; }

.faq__item[open] .faq__plus::after { transform: rotate(90deg); }

.faq__item > p {
  padding: 0 2.6rem 1.4rem 0.2rem;
  font-size: 1rem;
  max-width: 40rem;
}

/* summary without the plus span (last item fallback) */
.faq__item summary:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ============================================================
   Subpages (about / contact / terms)
   ============================================================ */

.page-hero { padding-block: clamp(3rem, 7vw, 5rem); }

.page-hero__title {
  max-width: 40rem;
  margin-bottom: 0;
}

.prose {
  max-width: 46rem;
}

.prose h2 {
  font-size: 1.5rem;
  margin-top: 2.2em;
}

.prose a:not(.btn) {
  font-weight: 500;
  text-underline-offset: 3px;
}

.prose .cta-row { margin-block: 2rem; }

.prose__note {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: rgba(17, 17, 16, 0.62);
}

/* ============================================================
   Footer
   ============================================================ */

.footer__inner {
  text-align: center;
  display: grid;
  gap: 1.8rem;
  justify-items: center;
}

.footer__wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.8rem, 10vw, 6rem);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
}

.footer__mark { width: 0.9em; height: 0.9em; }

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.8rem;
}

.footer__links a {
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  padding: 0.6rem 0;
}

.footer__links a:hover { text-decoration: underline; text-underline-offset: 4px; }

.footer__legal {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

/* ============================================================
   Reveal on scroll (progressive enhancement)
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(32px);
    transition:
      opacity 1000ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 1000ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  /* cascade across grids, stacks, and the hero */
  .card-grid > .reveal:nth-child(2),
  .steps > .reveal:nth-child(2),
  .stat-stack > .reveal:nth-child(2),
  .hero__inner > .reveal:nth-child(2) { transition-delay: 160ms; }

  .card-grid > .reveal:nth-child(3),
  .steps > .reveal:nth-child(3),
  .stat-stack > .reveal:nth-child(3),
  .hero__inner > .reveal:nth-child(3) { transition-delay: 320ms; }

  .hero__inner > .reveal:nth-child(4) { transition-delay: 480ms; }
  .hero__inner > .reveal:nth-child(5) { transition-delay: 640ms; }

  [data-parallax] { will-change: transform; }
}
