/* =========================================================================
   Lattice Solutions — Design System
   Plain CSS. Dark-first with a Light/Dark theme toggle (data-theme on <html>).
   ========================================================================= */

/* ---------- Design tokens ------------------------------------------------ */
:root {
  /* Brand */
  --brand-1: #6366f1; /* indigo  */
  --brand-2: #3b82f6; /* blue    */
  --brand-3: #22d3ee; /* cyan    */
  --brand-4: #8b5cf6; /* violet  */
  --gradient: linear-gradient(135deg, var(--brand-1), var(--brand-2) 45%, var(--brand-3));
  --gradient-soft: linear-gradient(135deg, rgba(99,102,241,.18), rgba(34,211,238,.18));

  /* Radii */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Spacing scale */
  --s-1: .25rem;
  --s-2: .5rem;
  --s-3: .75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: 8rem;

  /* Fluid type scale */
  --fs-display: clamp(2.6rem, 1.4rem + 5.2vw, 5rem);
  --fs-h1: clamp(2.1rem, 1.4rem + 3vw, 3.5rem);
  --fs-h2: clamp(1.7rem, 1.2rem + 2vw, 2.6rem);
  --fs-h3: clamp(1.25rem, 1.05rem + .8vw, 1.6rem);
  --fs-lead: clamp(1.05rem, .98rem + .5vw, 1.3rem);
  --fs-body: 1rem;
  --fs-sm: .875rem;
  --fs-xs: .75rem;

  /* Layout */
  --container: 1200px;
  --container-narrow: 820px;
  --nav-h: 72px;

  /* Motion */
  --ease: cubic-bezier(.4, .14, .3, 1);
  --t-fast: .18s;
  --t: .32s;
  --t-slow: .6s;

  --z-nav: 100;
  --z-drawer: 200;
  --z-toast: 300;
}

/* Dark theme (default) */
:root,
:root[data-theme="dark"] {
  --bg: #0b1220;
  --bg-2: #0e1a2b;
  --bg-grid: rgba(255, 255, 255, .04);
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .07);
  --surface-solid: #111c30;
  --glass-border: rgba(255, 255, 255, .1);
  --text: #e8eef7;
  --text-muted: #9aa8bd;
  --text-faint: #6b7a90;
  --border: rgba(255, 255, 255, .1);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 18px 50px -12px rgba(0, 0, 0, .6);
  --glow: 0 0 60px -12px rgba(99, 102, 241, .5);
  --nav-bg: rgba(11, 18, 32, .72);
  --on-brand: #ffffff;
  color-scheme: dark;
}

/* Light theme */
:root[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-2: #eef2f9;
  --bg-grid: rgba(11, 18, 32, .04);
  --surface: rgba(255, 255, 255, .75);
  --surface-2: #ffffff;
  --surface-solid: #ffffff;
  --glass-border: rgba(11, 18, 32, .1);
  --text: #0b1220;
  --text-muted: #51617a;
  --text-faint: #7a8aa1;
  --border: rgba(11, 18, 32, .1);
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-2: 0 24px 50px -16px rgba(16, 24, 40, .22);
  --glow: 0 0 60px -18px rgba(59, 130, 246, .35);
  --nav-bg: rgba(255, 255, 255, .78);
  --on-brand: #ffffff;
  color-scheme: light;
}

/* ---------- Reset / base ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}

/* Ambient background wash */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 78% -5%, rgba(99, 102, 241, .22), transparent 60%),
    radial-gradient(50% 45% at 8% 8%, rgba(34, 211, 238, .16), transparent 55%),
    var(--bg);
  transition: background var(--t) var(--ease);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 75%);
  pointer-events: none;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
ul, ol { list-style: none; padding: 0; }
input, textarea, select, button { font: inherit; }

h1, h2, h3, h4 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.02em;
}

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

::selection { background: rgba(99, 102, 241, .35); color: #fff; }

/* ---------- Skip link ---------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: var(--z-toast);
  background: var(--surface-solid);
  color: var(--text);
  padding: .65rem 1rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Layout helpers ---------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2rem);
}
.container.narrow { max-width: var(--container-narrow); }

.section { padding-block: clamp(3.5rem, 8vw, 7rem); position: relative; }
.section.tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
}

.section-head { max-width: 760px; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: var(--fs-h2); margin-top: .8rem; }
.section-head p { color: var(--text-muted); font-size: var(--fs-lead); margin-top: 1rem; }

.grad-text {
  background: linear-gradient(120deg, var(--brand-3), var(--brand-1) 55%, var(--brand-4));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead { font-size: var(--fs-lead); color: var(--text-muted); }
.text-muted { color: var(--text-muted); }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--s-2); }
.mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); }
.mx-auto { margin-inline: auto; }
.jc-center { justify-content: center; }
.gap-4 { gap: var(--s-4); }
.accent-link { color: var(--brand-3); }
.title-sm { font-size: 1.1rem; }
.media-fill { position: absolute; inset: 0; background: var(--gradient-soft); }
.grid-center { display: grid; place-items: center; }
.hero-center { min-height: 70vh; display: grid; align-items: center; }
.error-num { font-family: "Space Grotesk", sans-serif; font-size: clamp(5rem, 20vw, 10rem); font-weight: 700; line-height: 1; }

/* Image helpers — drop an <img> into any placeholder and it fills cleanly */
.split-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.person .avatar img { width: 100%; height: 100%; object-fit: cover; }
.card-media { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-md); margin-bottom: 1rem; }
.trust-logos img { height: 26px; width: auto; opacity: .8; filter: grayscale(1); transition: opacity var(--t) var(--ease); }
.trust-logos img:hover { opacity: 1; filter: none; }

/* ---------- Buttons ------------------------------------------------------ */
.btn {
  --pad-y: .85rem;
  --pad-x: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: var(--pad-y) var(--pad-x);
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: .01em;
  line-height: 1;
  white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease),
    background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
  will-change: transform;
}
.btn svg { width: 1.05em; height: 1.05em; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--gradient);
  color: var(--on-brand);
  box-shadow: 0 10px 30px -10px rgba(99, 102, 241, .6);
}
.btn-primary:hover { box-shadow: 0 16px 40px -10px rgba(59, 130, 246, .7); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--glass-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--brand-2); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--brand-2); color: var(--brand-2); }

.btn-lg { --pad-y: 1.05rem; --pad-x: 1.9rem; font-size: 1rem; }
.btn-block { width: 100%; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
  color: var(--brand-3);
}
.link-arrow svg { transition: transform var(--t) var(--ease); width: 1em; }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- Pills / badges ---------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .85rem;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--glass-border);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-muted);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-3); box-shadow: 0 0 10px var(--brand-3); }

/* ---------- Cards / glass ----------------------------------------------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: clamp(1.4rem, 2.5vw, 2rem);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-1);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease),
    border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-2); border-color: rgba(99, 102, 241, .4); }

/* Gradient outline effect on hover */
.card.glow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--t) var(--ease);
  pointer-events: none;
}
.card.glow:hover::after { opacity: 1; }

.icon-badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: var(--gradient-soft);
  border: 1px solid var(--glass-border);
  color: var(--brand-3);
  margin-bottom: 1.1rem;
}
.icon-badge svg { width: 26px; height: 26px; }

.card h3 { font-size: var(--fs-h3); margin-bottom: .55rem; }
.card p { color: var(--text-muted); font-size: .95rem; }

/* ---------- Grids -------------------------------------------------------- */
.grid { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Bento */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(1rem, 2vw, 1.4rem); }
.bento .card { grid-column: span 2; }
.bento .card.wide { grid-column: span 3; }
.bento .card.feature { grid-column: span 4; }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento .card, .bento .card.wide, .bento .card.feature { grid-column: span 1; }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4, .bento { grid-template-columns: 1fr; }
}

/* ---------- Navbar ------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  transition: height var(--t) var(--ease), background var(--t) var(--ease),
    box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  height: 60px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-1);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.brand:hover .brand-mark { transform: rotate(90deg); }
.brand-mark { width: 30px; height: 30px; transition: transform var(--t-slow) var(--ease); }
.brand b { font-weight: 700; }
.brand span { color: var(--text-muted); font-weight: 500; }

.nav-links { display: flex; align-items: center; gap: .35rem; }
.nav-links a {
  padding: .5rem .8rem;
  border-radius: var(--r-sm);
  font-size: .92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: "";
  display: block;
  height: 2px;
  border-radius: 2px;
  margin-top: 3px;
  background: var(--gradient);
}

.nav-actions { display: flex; align-items: center; gap: .6rem; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text);
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.theme-toggle:hover { background: var(--surface-2); transform: rotate(15deg); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--glass-border);
  position: relative;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transform: translate(-50%, -50%);
  transition: transform var(--t) var(--ease), opacity var(--t) var(--ease);
}
.nav-toggle span::before { transform: translate(-50%, -7px); }
.nav-toggle span::after { transform: translate(-50%, 5px); }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translate(-50%, 0) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translate(-50%, 0) rotate(-45deg); }

/* Mobile drawer */
.drawer {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  z-index: var(--z-drawer);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  padding: 1.5rem clamp(1.1rem, 4vw, 2rem) 2rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  transform: translateX(100%);
  transition: transform var(--t) var(--ease);
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer a {
  padding: .95rem .4rem;
  font-size: 1.15rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.drawer a.active { color: var(--brand-3); }
.drawer .btn { margin-top: 1.2rem; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-cta-desktop { display: none; }
  .nav-toggle { display: block; }
}
@media (min-width: 901px) {
  .drawer { display: none; }
}

/* ---------- Hero --------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(2.5rem, 7vw, 6rem));
  padding-bottom: clamp(3rem, 8vw, 6rem);
  overflow: hidden;
}
#lattice-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: .9;
}
.hero-inner { max-width: 860px; }
.hero h1 { font-size: var(--fs-display); margin: 1.2rem 0 0; }
.hero p.lead { margin-top: 1.4rem; max-width: 620px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

.trust {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.trust p { font-size: var(--fs-xs); letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); }
.trust-logos { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(1.2rem, 4vw, 2.6rem); }
.trust-logos span { font-family: "Space Grotesk", sans-serif; font-weight: 600; color: var(--text-muted); opacity: .8; font-size: 1.05rem; }

/* ---------- Marquee ------------------------------------------------------ */
.marquee { overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 3rem; width: max-content; animation: marquee 32s linear infinite; }
.marquee-track span { font-family: "Space Grotesk", sans-serif; font-weight: 600; color: var(--text-muted); font-size: 1.2rem; white-space: nowrap; display: inline-flex; align-items: center; gap: 3rem; }
.marquee-track span::after { content: "◆"; color: var(--brand-3); font-size: .7rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Stats -------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1rem, 3vw, 2rem); }
.stat { text-align: center; padding: 1.2rem .5rem; }
.stat .num { font-family: "Space Grotesk", sans-serif; font-size: clamp(2.2rem, 1.4rem + 3vw, 3.4rem); font-weight: 700; line-height: 1; }
.stat .label { margin-top: .6rem; color: var(--text-muted); font-size: .9rem; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Pillars / problem cards ------------------------------------- */
.pillar .num-chip {
  font-family: "Space Grotesk", sans-serif;
  font-size: .85rem;
  font-weight: 700;
  color: var(--brand-3);
  letter-spacing: .1em;
}

/* ---------- Persona tabs ------------------------------------------------- */
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.8rem; }
.tab {
  padding: .7rem 1.2rem;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: .9rem;
  transition: all var(--t-fast) var(--ease);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--gradient); color: var(--on-brand); border-color: transparent; box-shadow: 0 10px 24px -12px rgba(99, 102, 241, .7); }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade-up var(--t-slow) var(--ease); }

.persona-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(1.4rem, 3vw, 2.5rem); align-items: center; }
.persona-grid h3 { font-size: var(--fs-h3); margin-bottom: .8rem; }
.persona-grid ul { display: grid; gap: .7rem; margin-top: 1.2rem; }
.persona-grid li { display: flex; gap: .7rem; align-items: flex-start; color: var(--text-muted); }
.persona-grid li svg { flex: none; width: 20px; height: 20px; color: var(--brand-3); margin-top: 2px; }
.persona-metric { display: grid; place-content: center; text-align: center; gap: .4rem; min-height: 240px; }
.persona-metric .big { font-family: "Space Grotesk", sans-serif; font-size: clamp(3rem, 2rem + 5vw, 5rem); font-weight: 700; line-height: 1; }
@media (max-width: 760px) { .persona-grid { grid-template-columns: 1fr; } .persona-metric { min-height: 160px; } }

/* ---------- Timeline (methodology) -------------------------------------- */
.timeline { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-top: 2rem; }
.timeline::before { content: ""; position: absolute; top: 26px; left: 6%; right: 6%; height: 2px; background: linear-gradient(90deg, var(--brand-1), var(--brand-3)); opacity: .35; }
.tl-step { text-align: center; position: relative; padding-top: 3.6rem; }
.tl-step .node {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-solid); border: 2px solid var(--brand-2);
  display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: var(--brand-3);
  box-shadow: 0 0 0 6px var(--bg);
}
.tl-step h4 { font-family: "Space Grotesk", sans-serif; font-size: 1.05rem; margin-bottom: .4rem; }
.tl-step p { color: var(--text-muted); font-size: .85rem; }
@media (max-width: 820px) {
  .timeline { grid-template-columns: 1fr; gap: .4rem; }
  .timeline::before { top: 0; bottom: 0; left: 20px; right: auto; width: 2px; height: auto; }
  .tl-step { text-align: left; padding: .6rem 0 1.2rem 3.4rem; }
  .tl-step .node { top: 4px; left: 20px; transform: translateX(-50%); }
}

/* ---------- Testimonials carousel --------------------------------------- */
.carousel { position: relative; }
.carousel-track { display: flex; overflow: hidden; }
.quote {
  flex: 0 0 100%;
  padding: clamp(1.6rem, 4vw, 3rem);
  text-align: center;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  align-content: center;
  gap: 1.4rem;
}
.quote.active { opacity: 1; transform: none; position: relative; pointer-events: auto; }
.quote blockquote { font-family: "Space Grotesk", sans-serif; font-size: clamp(1.2rem, .9rem + 1.4vw, 1.9rem); line-height: 1.35; font-weight: 500; }
.quote .who { color: var(--text-muted); font-size: .95rem; }
.quote .who b { color: var(--text); font-weight: 600; }
.carousel-wrap { position: relative; min-height: 260px; display: grid; }
.carousel-dots { display: flex; justify-content: center; gap: .5rem; margin-top: 1rem; }
.carousel-dots button { width: 9px; height: 9px; border-radius: 50%; border: none; background: var(--border); transition: all var(--t) var(--ease); }
.carousel-dots button[aria-current="true"] { background: var(--gradient); width: 26px; border-radius: 6px; }

/* ---------- Case studies ------------------------------------------------- */
.case { display: flex; flex-direction: column; gap: 1rem; overflow: hidden; }
.case .metric-row { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); }
.case .metric { display: grid; }
.case .metric b { font-family: "Space Grotesk", sans-serif; font-size: 1.5rem; color: var(--text); }
.case .metric span { font-size: .78rem; color: var(--text-muted); }
.case .tag { font-size: var(--fs-xs); color: var(--brand-3); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

/* Filter chips */
.chips { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2rem; }
.chip {
  padding: .5rem 1rem; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--glass-border);
  font-size: .85rem; font-weight: 600; color: var(--text-muted);
  transition: all var(--t-fast) var(--ease);
}
.chip[aria-pressed="true"] { background: var(--gradient); color: var(--on-brand); border-color: transparent; }

/* ---------- Team --------------------------------------------------------- */
.person { text-align: center; }
.person .avatar {
  width: 100%; aspect-ratio: 1; border-radius: var(--r-lg);
  background: var(--gradient-soft); border: 1px solid var(--glass-border);
  display: grid; place-items: center; margin-bottom: 1rem; overflow: hidden;
}
.person .avatar span { font-family: "Space Grotesk", sans-serif; font-size: 2.4rem; font-weight: 700; color: var(--brand-3); }
.person h3 { font-size: 1.1rem; margin-bottom: .2rem; }
.person .role { color: var(--brand-3); font-size: .85rem; font-weight: 600; }
.person p { color: var(--text-muted); font-size: .9rem; margin-top: .5rem; }

/* ---------- Pricing ------------------------------------------------------ */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2vw, 1.5rem); align-items: stretch; }
.price { display: flex; flex-direction: column; }
.price.featured { border-color: rgba(99, 102, 241, .5); box-shadow: var(--glow); }
.price .badge-top { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--gradient); color: var(--on-brand); font-size: var(--fs-xs); font-weight: 700; padding: .3rem .9rem; border-radius: var(--r-pill); letter-spacing: .05em; }
.price h3 { font-size: 1.3rem; }
.price .amount { font-family: "Space Grotesk", sans-serif; font-size: 2.4rem; font-weight: 700; margin: .6rem 0 .2rem; }
.price .amount small { font-size: .9rem; color: var(--text-muted); font-weight: 400; }
.price .desc { color: var(--text-muted); font-size: .9rem; min-height: 44px; }
.price ul { display: grid; gap: .7rem; margin: 1.4rem 0; }
.price li { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; color: var(--text-muted); }
.price li svg { flex: none; width: 18px; height: 18px; color: var(--brand-3); margin-top: 3px; }
.price .btn { margin-top: auto; }
@media (max-width: 860px) { .price-grid { grid-template-columns: 1fr; } }

/* ---------- FAQ / accordion --------------------------------------------- */
.faq { display: grid; gap: .8rem; max-width: 820px; margin-inline: auto; }
.faq details { background: var(--surface); border: 1px solid var(--glass-border); border-radius: var(--r-md); overflow: hidden; }
.faq summary { padding: 1.1rem 1.3rem; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--brand-3); transition: transform var(--t) var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 1.3rem 1.2rem; color: var(--text-muted); }

/* ---------- CTA band ----------------------------------------------------- */
.cta-band { position: relative; border-radius: var(--r-xl); padding: clamp(2.5rem, 6vw, 5rem); text-align: center; overflow: hidden; border: 1px solid var(--glass-border); background: var(--surface); }
.cta-band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 120% at 50% 0%, rgba(99, 102, 241, .35), transparent 60%), radial-gradient(50% 120% at 100% 100%, rgba(34, 211, 238, .25), transparent 55%); z-index: -1; }
.cta-band h2 { font-size: var(--fs-h2); max-width: 640px; margin-inline: auto; }
.cta-band p { color: var(--text-muted); font-size: var(--fs-lead); max-width: 560px; margin: 1rem auto 2rem; }
.cta-band .hero-cta { justify-content: center; }

/* ---------- Forms -------------------------------------------------------- */
.form { display: grid; gap: 1.1rem; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }
.field { display: grid; gap: .4rem; }
.field label { font-size: var(--fs-sm); font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }
.field textarea { resize: vertical; min-height: 140px; }
.field .err { color: #fb7185; font-size: var(--fs-xs); display: none; }
.field.invalid input, .field.invalid textarea { border-color: #fb7185; }
.field.invalid .err { display: block; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-note { font-size: var(--fs-sm); color: var(--text-muted); }
.form-status { padding: .9rem 1.1rem; border-radius: var(--r-md); font-size: .9rem; display: none; }
.form-status.show { display: block; }
.form-status.success { background: rgba(34, 197, 94, .12); border: 1px solid rgba(34, 197, 94, .4); color: #86efac; }
.form-status.error { background: rgba(251, 113, 133, .12); border: 1px solid rgba(251, 113, 133, .4); color: #fda4af; }

/* Contact split */
.contact-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info { display: grid; gap: 1.2rem; }
.contact-info .item { display: flex; gap: .9rem; align-items: flex-start; }
.contact-info .item svg { flex: none; width: 22px; height: 22px; color: var(--brand-3); margin-top: 3px; }
.contact-info .item b { display: block; }
.contact-info .item span { color: var(--text-muted); font-size: .92rem; }

/* ---------- Article / blog ---------------------------------------------- */
.post-card { display: flex; flex-direction: column; gap: .8rem; }
.post-card .meta { font-size: var(--fs-xs); color: var(--text-muted); letter-spacing: .04em; text-transform: uppercase; }
.post-card h3 { font-size: 1.2rem; }
.post-card p { font-size: .92rem; }

.article { max-width: 760px; margin-inline: auto; }
.article-header { padding-top: calc(var(--nav-h) + 3rem); text-align: center; }
.article-header h1 { font-size: var(--fs-h1); margin: 1rem 0; }
.article-body { padding-block: 2.5rem; }
.article-body p, .article-body ul { color: var(--text-muted); margin-bottom: 1.3rem; font-size: 1.05rem; }
.article-body h2 { font-size: var(--fs-h3); margin: 2.2rem 0 1rem; color: var(--text); }
.article-body ul { list-style: disc; padding-left: 1.4rem; display: grid; gap: .5rem; }
.article-body blockquote { border-left: 3px solid var(--brand-2); padding-left: 1.2rem; margin: 1.6rem 0; font-style: italic; color: var(--text); }

/* ---------- Footer ------------------------------------------------------- */
.footer { border-top: 1px solid var(--border); margin-top: clamp(3rem, 8vw, 6rem); padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; background: linear-gradient(180deg, transparent, rgba(99, 102, 241, .05)); }
.footer-top { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2rem; }
.footer-brand p { color: var(--text-muted); font-size: .92rem; margin: 1rem 0 1.4rem; max-width: 320px; }
.newsletter { display: flex; gap: .5rem; max-width: 340px; }
.newsletter input { flex: 1; padding: .7rem .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill); color: var(--text); }
.newsletter input:focus { outline: none; border-color: var(--brand-2); }
.footer-col h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-faint); margin-bottom: 1rem; font-family: "Inter", sans-serif; }
.footer-col a { display: block; color: var(--text-muted); font-size: .92rem; padding: .3rem 0; transition: color var(--t-fast) var(--ease); }
.footer-col a:hover { color: var(--brand-3); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .85rem; }
.socials { display: flex; gap: .6rem; }
.socials a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--glass-border); transition: all var(--t-fast) var(--ease); }
.socials a:hover { color: var(--brand-3); border-color: var(--brand-2); transform: translateY(-2px); }
.socials svg { width: 18px; height: 18px; }
@media (max-width: 760px) { .footer-top { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-top { grid-template-columns: 1fr; } }

/* ---------- Page header (interior pages) -------------------------------- */
.page-header { padding-top: calc(var(--nav-h) + clamp(2.5rem, 6vw, 4.5rem)); padding-bottom: clamp(1.5rem, 4vw, 3rem); position: relative; overflow: hidden; }
.page-header h1 { font-size: var(--fs-h1); margin: 1rem 0 0; max-width: 780px; }
.page-header p { color: var(--text-muted); font-size: var(--fs-lead); margin-top: 1rem; max-width: 620px; }

/* ---------- Split feature ------------------------------------------------ */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.split.reverse .split-media { order: -1; }
.split-media { border-radius: var(--r-lg); border: 1px solid var(--glass-border); background: var(--surface); aspect-ratio: 4 / 3; overflow: hidden; position: relative; }
.split h2 { font-size: var(--fs-h2); margin-bottom: 1rem; }
.split p { color: var(--text-muted); margin-bottom: 1rem; }
.check-list { display: grid; gap: .8rem; margin-top: 1.2rem; }
.check-list li { display: flex; gap: .7rem; align-items: flex-start; }
.check-list svg { flex: none; width: 20px; height: 20px; color: var(--brand-3); margin-top: 3px; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } .split.reverse .split-media { order: 0; } }

/* ---------- Reveal animations ------------------------------------------- */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal-delay="1"] { transition-delay: .08s; }
[data-reveal-delay="2"] { transition-delay: .16s; }
[data-reveal-delay="3"] { transition-delay: .24s; }
[data-reveal-delay="4"] { transition-delay: .32s; }

@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Reduced motion ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
}
