/* ============================================================
   TruLata — Base / reset / typography / primitives
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; scroll-padding-top: 90px; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text-on-light);
  background: var(--ink); /* dark page base so the transparent nav band above the hero reads dark */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
ul { list-style: none; padding: 0; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---- Headings ---- */
h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
}
h3 { font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
h1, h2 { text-wrap: balance; }
p { text-wrap: pretty; }

/* ---- Layout primitives ---- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.narrow { max-width: var(--maxw-narrow); }
.section { padding-block: var(--section-y); position: relative; }

/* ---- Section themes ---- */
.theme-dark {
  background: var(--ink);
  color: var(--text-on-dark);
}
.theme-dark h1, .theme-dark h2, .theme-dark h3 { color: #fff; }
.theme-light {
  background: var(--paper);
  color: var(--text-on-light);
}
.theme-light h1, .theme-light h2, .theme-light h3 { color: var(--ink); }
.theme-paper { background: var(--paper-50); }

/* Safety net: drive text color off data-theme so a section can never end up
   dark-on-dark / light-on-light even if the theme-* class is missing.
   (Backgrounds stay owned by each section's own rule.) */
[data-theme="dark"] { color: var(--text-on-dark); }
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3 { color: #fff; }
[data-theme="dark"] .eyebrow { color: var(--warm); }
[data-theme="dark"] .lead { color: var(--text-on-dark-dim); }
[data-theme="light"] { color: var(--text-on-light); }
[data-theme="light"] h1, [data-theme="light"] h2, [data-theme="light"] h3 { color: var(--ink); }
[data-theme="light"] .eyebrow { color: var(--warm-deep); }
[data-theme="light"] .lead { color: var(--text-on-light-dim); }

/* ---- Signature gradient text ---- */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* fallback */
  -webkit-text-fill-color: transparent;
  /* keep descenders (g, y, p) from clipping under background-clip:text */
  padding-bottom: 0.08em;
}

/* ---- Eyebrow ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  background: var(--warm-deep);
  border-radius: 2px;
}
.theme-dark .eyebrow::before, [data-theme="dark"] .eyebrow::before { background: var(--warm); }
/* brighter gradient text on dark for legibility */
.theme-dark .grad-text,
.hero .grad-text,
.product .grad-text,
.cta .grad-text,
.services .grad-text { background-image: var(--grad-bright); }

.theme-dark .eyebrow { color: var(--warm); }
.theme-light .eyebrow { color: var(--warm-deep); }

/* ---- Lead paragraph ---- */
.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  max-width: 56ch;
}
.theme-dark .lead { color: var(--text-on-dark-dim); }
.theme-light .lead { color: var(--text-on-light-dim); }

/* ---- Buttons ---- */
.btn {
  --pad-y: 0.95rem;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.6rem;
  padding: var(--pad-y) 1.7rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  border-radius: 100px;
  position: relative;
  isolation: isolate;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), color 0.3s ease;
  will-change: transform;
}
.btn .btn-arrow { transition: transform 0.4s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(4px); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  color: #fff;
  background: var(--grad);
  background-size: 160% 160%;
  background-position: 0% 50%;
  box-shadow: 0 18px 40px -16px rgba(58,67,173,0.7);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background-position 0.6s var(--ease);
}
.btn-primary:hover {
  background-position: 100% 50%;
  box-shadow: 0 22px 55px -14px rgba(154,63,193,0.7);
}

.btn-ghost {
  border: 1px solid rgba(255,255,255,0.28);
  color: #fff;
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.06); }
.theme-light .btn-ghost { border-color: var(--line); color: var(--ink); }
.theme-light .btn-ghost:hover { border-color: var(--ink); background: var(--paper-50); }

.btn-text {
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---- Reveal animation (IntersectionObserver) ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---- Focus ---- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
