/* ==========================================================================
   LEQApp — main.css  (Theme global stylesheet, owner: T-E)
   --------------------------------------------------------------------------
   Built ON TOP of tokens.css. Assumes every --leqa-* custom property already
   exists (tokens.css is enqueued BEFORE this file by functions.php — T-A).
   Never redefine a token here; always use var(--leqa-*).

   LOAD ORDER (decided by T-E, implemented by T-A in functions.php):
     1. tokens.css        (design tokens — :root vars)
     2. main.css          (THIS file: reset, type, shared primitives, motion)
     3. sections/nav.css
     4. sections/hero.css
     5. sections/features.css
     6. sections/how-it-works.css
     7. sections/screenshots.css
     8. sections/download.css
     9. sections/changelog.css
    10. sections/faq.css
    11. sections/cta.css
   Section CSS files style ONLY their own .leqa-<block>; they compose with the
   shared primitives below and never redefine them.

   --------------------------------------------------------------------------
   CONTRACT FOR TEMPLATE AGENTS (class names + data-attributes)
   --------------------------------------------------------------------------
   LAYOUT PRIMITIVES (use, do not redefine):
     .leqa-container            max-width content well (--leqa-maxw) + gutters
     .leqa-container--narrow    narrow well (--leqa-maxw-narrow) for prose/FAQ
     .leqa-section              vertical section rhythm (--leqa-section-y)
     .leqa-section--tight       half vertical rhythm
     .leqa-grid                 base CSS grid (gap via --leqa-space-5)
     .leqa-stack                vertical flow with --leqa-space-4 gap
     .leqa-section-head         centered eyebrow+title+lead heading group

   TEXT / DISPLAY HELPERS:
     .leqa-eyebrow              uppercase tracked label (accent)
     .leqa-display              Fraunces display heading look
     .leqa-lead                 lead paragraph size
     .leqa-mono                 JetBrains Mono inline
     .leqa-muted                muted text color
     .leqa-balance              text-wrap: balance for headings

   BUTTONS:
     .leqa-btn                  base button/link button
       .leqa-btn--primary       solid green CTA
       .leqa-btn--ghost         outline / secondary
       .leqa-btn--sm            small size
       .leqa-btn--lg            large size
     (use <a class="leqa-btn ..."> or <button class="leqa-btn ...">)

   SURFACES / BADGES:
     .leqa-card                 elevated card surface
       .leqa-card--feature      feature card variant
       .leqa-card--glow         adds the signature glow ring
     .leqa-badge                pill badge
       .leqa-badge--version     version badge (mono); fill via JS .leqa-badge__value
       .leqa-badge--accent      accent-tinted badge
     .leqa-divider              hairline rule

   ACCESSIBILITY:
     .leqa-visually-hidden      screen-reader-only text
     .leqa-skip-link            skip-to-content link (in header.php)

   STATE CLASSES (toggled by main.js — combine with a .leqa-* block only):
     .is-scrolled    on .leqa-nav once page is scrolled past threshold
     .is-open        on .leqa-nav (mobile menu open) / on <details> etc.
     .is-active      active nav link / toggle
     .is-revealed    on [data-reveal] elements once they scroll into view
     .is-loading     transient loading state (e.g. version badge)

   DATA-ATTRIBUTE HOOKS (main.js reads these — template agents add them):
     [data-reveal]                 element animates in on scroll (opacity+rise)
     [data-reveal-delay="1..6"]    stagger step (multiplied by --leqa-stagger)
     [data-nav-toggle]             mobile menu toggle button (aria-expanded)
     [data-nav-menu]               the collapsible menu container
     [data-theme-toggle]           light/dark toggle button (aria-pressed)
     [data-version-target]         text node filled with latest version string
     [data-pubdate-target]         text node filled with formatted pub_date
     [data-download="nsis"|"msi"]  anchor href set to the resolved installer URL
     [data-version-endpoint]       (optional) override the /version/latest URL
   ========================================================================== */

/* ==========================================================================
   1. Reset / normalize (minimal, modern)
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Offset in-page anchor targets to clear the sticky nav. */
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--leqa-bg);
  color: var(--leqa-text);
  font-family: var(--leqa-font-body);
  font-size: var(--leqa-fs-body);
  font-weight: var(--leqa-weight-body);
  line-height: var(--leqa-lh-body);
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color var(--leqa-dur) var(--leqa-ease),
    color var(--leqa-dur) var(--leqa-ease);
}

img,
picture,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

svg {
  fill: currentColor;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

:where(p, li, figcaption) {
  text-wrap: pretty;
}

hr {
  border: 0;
  height: var(--leqa-border-width);
  background: var(--leqa-border);
}

/* ==========================================================================
   2. Base typography
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--leqa-font-display);
  font-weight: var(--leqa-weight-medium);
  line-height: var(--leqa-lh-tight);
  letter-spacing: var(--leqa-tracking-tight);
  color: var(--leqa-text);
  text-wrap: balance;
  /* Drive Fraunces optical sizing toward the larger, more characterful axis. */
  font-optical-sizing: auto;
}

h1 {
  font-size: var(--leqa-fs-h1);
  font-variation-settings: "opsz" 144;
}

h2 {
  font-size: var(--leqa-fs-h2);
  font-variation-settings: "opsz" 80;
}

h3 {
  font-size: var(--leqa-fs-h3);
  line-height: var(--leqa-lh-snug);
  font-variation-settings: "opsz" 40;
}

h4 {
  font-size: var(--leqa-fs-h4);
  line-height: var(--leqa-lh-snug);
  font-variation-settings: "opsz" 28;
}

h5 {
  font-size: var(--leqa-fs-h5);
  line-height: var(--leqa-lh-snug);
}

h6 {
  font-size: var(--leqa-fs-h6);
  line-height: var(--leqa-lh-snug);
}

p {
  font-size: inherit;
}

a {
  color: var(--leqa-accent);
  text-decoration: none;
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
  transition: color var(--leqa-dur-fast) var(--leqa-ease);
}

a:hover {
  color: var(--leqa-accent-hover);
  text-decoration: underline;
}

strong,
b {
  font-weight: var(--leqa-weight-semibold);
}

small {
  font-size: var(--leqa-fs-small);
}

code,
kbd,
samp,
pre {
  font-family: var(--leqa-font-mono);
  font-size: 0.92em;
}

kbd {
  display: inline-block;
  padding: 0.12em 0.5em;
  border: var(--leqa-border-width) solid var(--leqa-border-strong);
  border-bottom-width: 2px;
  border-radius: var(--leqa-radius-sm);
  background: var(--leqa-bg-elev-2);
  color: var(--leqa-text);
  font-size: 0.85em;
  line-height: 1.4;
}

::selection {
  background: var(--leqa-accent);
  color: var(--leqa-accent-contrast);
}

::-moz-selection {
  background: var(--leqa-accent);
  color: var(--leqa-accent-contrast);
}

/* ==========================================================================
   3. Focus — visible, on-brand, keyboard-only
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--leqa-accent);
  outline-offset: 2px;
  border-radius: var(--leqa-radius-sm);
}

/* Remove the default outline only when focus-visible is supported and we
   provide our own. */
:focus:not(:focus-visible) {
  outline: none;
}

/* ==========================================================================
   4. Layout primitives
   ========================================================================== */
.leqa-container {
  width: 100%;
  max-width: var(--leqa-maxw);
  margin-inline: auto;
  padding-inline: var(--leqa-gutter);
}

.leqa-container--narrow {
  max-width: var(--leqa-maxw-narrow);
}

.leqa-section {
  position: relative;
  padding-block: var(--leqa-section-y);
}

.leqa-section--tight {
  padding-block: calc(var(--leqa-section-y) * 0.5);
}

.leqa-grid {
  display: grid;
  gap: var(--leqa-space-5);
}

.leqa-stack {
  display: flex;
  flex-direction: column;
  gap: var(--leqa-space-4);
}

/* Centered heading group used at the top of most sections. */
.leqa-section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--leqa-space-4);
  max-width: 46rem;
  margin-inline: auto;
  margin-bottom: var(--leqa-space-8);
  text-align: center;
}

.leqa-section-head .leqa-lead {
  color: var(--leqa-text-muted);
}

.leqa-section-head--start {
  align-items: flex-start;
  text-align: start;
  margin-inline: 0;
}

/* ==========================================================================
   5. Text / display helpers
   ========================================================================== */
.leqa-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--leqa-space-2);
  font-family: var(--leqa-font-body);
  font-size: var(--leqa-fs-eyebrow);
  font-weight: var(--leqa-weight-semibold);
  letter-spacing: var(--leqa-tracking-eyebrow);
  text-transform: uppercase;
  color: var(--leqa-accent);
  line-height: 1;
}

/* Small leading tick before eyebrow text — a quiet "signal on" mark. */
.leqa-eyebrow::before {
  content: "";
  inline-size: 1.5rem;
  block-size: 2px;
  border-radius: var(--leqa-radius-pill);
  background: linear-gradient(90deg, transparent, var(--leqa-accent));
}

.leqa-eyebrow--plain::before {
  display: none;
}

.leqa-display {
  font-family: var(--leqa-font-display);
  font-weight: var(--leqa-weight-medium);
  line-height: var(--leqa-lh-tight);
  letter-spacing: var(--leqa-tracking-tight);
  text-wrap: balance;
}

.leqa-lead {
  font-size: var(--leqa-fs-lead);
  line-height: 1.45;
  color: var(--leqa-text-muted);
  font-weight: var(--leqa-weight-body);
}

.leqa-mono {
  font-family: var(--leqa-font-mono);
  font-feature-settings: "tnum";
  letter-spacing: 0;
}

.leqa-muted {
  color: var(--leqa-text-muted);
}

.leqa-faint {
  color: var(--leqa-text-faint);
}

.leqa-accent-text {
  color: var(--leqa-accent);
}

/* Editorial italic accent (Fraunces italic) — e.g. one emphasized word. */
.leqa-italic {
  font-style: italic;
  font-variation-settings: "opsz" 144;
}

.leqa-balance {
  text-wrap: balance;
}

/* ==========================================================================
   6. Buttons — primary green CTA + secondary ghost
   ========================================================================== */
.leqa-btn {
  --_btn-bg: transparent;
  --_btn-fg: var(--leqa-text);
  --_btn-border: var(--leqa-border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--leqa-space-2);
  min-height: 44px; /* a11y hit target */
  padding: 0.75rem 1.35rem;
  border: var(--leqa-border-width) solid var(--_btn-border);
  border-radius: var(--leqa-radius-pill);
  background: var(--_btn-bg);
  color: var(--_btn-fg);
  font-family: var(--leqa-font-body);
  font-size: var(--leqa-fs-small);
  font-weight: var(--leqa-weight-semibold);
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: transform var(--leqa-dur-fast) var(--leqa-ease),
    background-color var(--leqa-dur-fast) var(--leqa-ease),
    border-color var(--leqa-dur-fast) var(--leqa-ease),
    color var(--leqa-dur-fast) var(--leqa-ease),
    box-shadow var(--leqa-dur) var(--leqa-ease);
}

.leqa-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.leqa-btn:active {
  transform: translateY(0);
}

.leqa-btn svg {
  inline-size: 1.15em;
  block-size: 1.15em;
  flex: none;
}

/* Primary — solid signature green. */
.leqa-btn--primary {
  --_btn-bg: var(--leqa-accent);
  --_btn-fg: var(--leqa-accent-contrast);
  --_btn-border: var(--leqa-accent);
  box-shadow: 0 0 0 0 var(--leqa-glow);
}

.leqa-btn--primary:hover {
  --_btn-bg: var(--leqa-accent-hover);
  --_btn-border: var(--leqa-accent-hover);
  --_btn-fg: var(--leqa-accent-contrast);
  color: var(--leqa-accent-contrast);
  box-shadow: 0 0 30px -6px var(--leqa-glow);
}

.leqa-btn--primary:active {
  --_btn-bg: var(--leqa-accent-press);
  --_btn-border: var(--leqa-accent-press);
}

/* Ghost — secondary outline. */
.leqa-btn--ghost {
  --_btn-bg: transparent;
  --_btn-fg: var(--leqa-text);
  --_btn-border: var(--leqa-border-strong);
}

.leqa-btn--ghost:hover {
  --_btn-fg: var(--leqa-text);
  color: var(--leqa-text);
  --_btn-border: var(--leqa-accent);
  background: var(--leqa-accent-soft);
}

/* Quiet/link-style button (no border). */
.leqa-btn--quiet {
  --_btn-border: transparent;
  --_btn-fg: var(--leqa-text-muted);
  min-height: 0;
  padding: 0.4rem 0.6rem;
}

.leqa-btn--quiet:hover {
  --_btn-fg: var(--leqa-text);
  color: var(--leqa-text);
  background: var(--leqa-bg-elev-2);
}

.leqa-btn--sm {
  min-height: 36px;
  padding: 0.5rem 0.95rem;
  font-size: var(--leqa-fs-eyebrow);
}

.leqa-btn--lg {
  min-height: 52px;
  padding: 0.95rem 1.8rem;
  font-size: var(--leqa-fs-body);
}

.leqa-btn--block {
  display: flex;
  width: 100%;
}

.leqa-btn[disabled],
.leqa-btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

/* Group of buttons (e.g. hero CTAs). */
.leqa-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--leqa-space-3);
  align-items: center;
}

/* ==========================================================================
   7. Surfaces — cards, badges, dividers
   ========================================================================== */
.leqa-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--leqa-space-3);
  padding: var(--leqa-space-6);
  background: var(--leqa-bg-elev);
  border: var(--leqa-border-width) solid var(--leqa-border);
  border-radius: var(--leqa-radius-lg);
  box-shadow: var(--leqa-shadow-sm);
  transition: border-color var(--leqa-dur) var(--leqa-ease),
    transform var(--leqa-dur) var(--leqa-ease),
    box-shadow var(--leqa-dur) var(--leqa-ease),
    background-color var(--leqa-dur) var(--leqa-ease);
}

.leqa-card--interactive:hover {
  border-color: var(--leqa-border-strong);
  transform: translateY(-3px);
  box-shadow: var(--leqa-shadow);
}

.leqa-card--glow {
  border-color: var(--leqa-border-strong);
  box-shadow: var(--leqa-shadow-glow);
}

.leqa-card__title {
  font-size: var(--leqa-fs-h5);
}

.leqa-card__text {
  color: var(--leqa-text-muted);
  font-size: var(--leqa-fs-small);
  line-height: var(--leqa-lh-body);
}

/* Badge / pill */
.leqa-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--leqa-space-2);
  padding: 0.3rem 0.7rem;
  border: var(--leqa-border-width) solid var(--leqa-border);
  border-radius: var(--leqa-radius-pill);
  background: var(--leqa-bg-elev);
  color: var(--leqa-text-muted);
  font-size: var(--leqa-fs-eyebrow);
  font-weight: var(--leqa-weight-medium);
  line-height: 1;
}

.leqa-badge--accent {
  border-color: transparent;
  background: var(--leqa-accent-soft);
  color: var(--leqa-accent);
}

.leqa-badge--version {
  font-family: var(--leqa-font-mono);
  letter-spacing: 0;
}

.leqa-badge--version .leqa-badge__value {
  font-weight: var(--leqa-weight-medium);
  color: var(--leqa-accent);
}

/* Live status dot — the "signal on" mark next to the version badge. */
.leqa-badge__dot {
  inline-size: 7px;
  block-size: 7px;
  border-radius: 5px;
  background: var(--leqa-accent);
  box-shadow: 0 0 0 0 var(--leqa-glow);
  animation: leqa-pulse 2.4s var(--leqa-ease-in-out) infinite;
}

.leqa-divider {
  height: var(--leqa-border-width);
  width: 100%;
  background: var(--leqa-border);
  border: 0;
}

/* ==========================================================================
   8. Prose (generic pages, changelog body) — composed by .leqa-prose
   ========================================================================== */
.leqa-prose {
  max-width: var(--leqa-maxw-narrow);
  color: var(--leqa-text);
}

.leqa-prose > * + * {
  margin-top: var(--leqa-space-5);
}

.leqa-prose h2,
.leqa-prose h3,
.leqa-prose h4 {
  margin-top: var(--leqa-space-7);
}

.leqa-prose h2 + *,
.leqa-prose h3 + *,
.leqa-prose h4 + * {
  margin-top: var(--leqa-space-3);
}

.leqa-prose p,
.leqa-prose li {
  color: var(--leqa-text-muted);
}

.leqa-prose strong {
  color: var(--leqa-text);
}

.leqa-prose ul,
.leqa-prose ol {
  padding-left: 1.4em;
  display: flex;
  flex-direction: column;
  gap: var(--leqa-space-2);
}

.leqa-prose ul {
  list-style: none;
  padding-left: 0;
}

.leqa-prose ul > li {
  position: relative;
  padding-left: 1.6em;
}

.leqa-prose ul > li::before {
  content: "";
  position: absolute;
  left: 0.1em;
  top: 0.62em;
  inline-size: 0.55em;
  block-size: 0.55em;
  border-radius: var(--leqa-radius-sm);
  background: var(--leqa-accent);
  transform: rotate(45deg);
}

.leqa-prose blockquote {
  padding-left: var(--leqa-space-5);
  border-left: 2px solid var(--leqa-accent);
  color: var(--leqa-text);
  font-style: italic;
}

.leqa-prose pre {
  padding: var(--leqa-space-5);
  background: var(--leqa-bg-elev-2);
  border: var(--leqa-border-width) solid var(--leqa-border);
  border-radius: var(--leqa-radius);
  overflow-x: auto;
  font-size: var(--leqa-fs-small);
  line-height: 1.55;
}

.leqa-prose :not(pre) > code {
  padding: 0.12em 0.4em;
  background: var(--leqa-bg-elev-2);
  border-radius: var(--leqa-radius-sm);
  color: var(--leqa-accent);
}

.leqa-prose a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* ==========================================================================
   9. Accessibility utilities
   ========================================================================== */
.leqa-visually-hidden,
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Skip-link (rendered in header.php by T-A) */
.leqa-skip-link {
  position: fixed;
  top: var(--leqa-space-3);
  left: var(--leqa-space-3);
  z-index: 1000;
  padding: 0.7rem 1.1rem;
  background: var(--leqa-accent);
  color: var(--leqa-accent-contrast);
  font-weight: var(--leqa-weight-semibold);
  border-radius: var(--leqa-radius-sm);
  box-shadow: var(--leqa-shadow);
  transform: translateY(-150%);
  transition: transform var(--leqa-dur) var(--leqa-ease);
}

.leqa-skip-link:focus {
  transform: translateY(0);
  color: var(--leqa-accent-contrast);
  text-decoration: none;
}

/* ==========================================================================
   10. Atmospheric page backdrop primitive (the ONE memorable touch)
   --------------------------------------------------------------------------
   A faint, fixed signal-grid + radial green glow. The hero owns the strong
   version of this motif (sections/hero.css); here we expose a reusable,
   pointer-events-none backdrop element that hero.php / front-page.php can
   drop in as <div class="leqa-backdrop" aria-hidden="true"></div>.
   ========================================================================== */
.leqa-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.leqa-backdrop::before {
  /* Fine signal grid echoing the logo. */
  content: "";
  position: absolute;
  inset: -2px;
  background-image: linear-gradient(
      to right,
      var(--leqa-surface-line) var(--leqa-border-width),
      transparent var(--leqa-border-width)
    ),
    linear-gradient(
      to bottom,
      var(--leqa-surface-line) var(--leqa-border-width),
      transparent var(--leqa-border-width)
    );
  background-size: 64px 64px;
  opacity: 0.35;
  -webkit-mask-image: radial-gradient(
    120% 80% at 50% -10%,
    #000 0%,
    transparent 70%
  );
  mask-image: radial-gradient(120% 80% at 50% -10%, #000 0%, transparent 70%);
}

.leqa-backdrop::after {
  /* Single signature glow, top-center. */
  content: "";
  position: absolute;
  top: -28vh;
  left: 50%;
  inline-size: min(1100px, 120vw);
  block-size: min(1100px, 120vw);
  transform: translateX(-50%);
  background: radial-gradient(
    circle at center,
    var(--leqa-glow) 0%,
    rgba(114, 255, 100, 0.06) 32%,
    transparent 62%
  );
  opacity: 0.6;
  filter: blur(8px);
}

/* ==========================================================================
   11. Motion — scroll reveals + keyframes
   --------------------------------------------------------------------------
   [data-reveal] elements start hidden and animate when main.js adds
   .is-revealed (IntersectionObserver). [data-reveal-delay="N"] staggers.
   ========================================================================== */
:root {
  --leqa-stagger: 70ms;
}

/* Initial (pre-reveal) state — only when JS is active so no-JS users see
   content immediately. main.js sets <html class="leqa-js"> early. */
.leqa-js [data-reveal],
.leqa-js [data-leqa-reveal] {
  opacity: 0;
  transform: translateY(12px);
  will-change: opacity, transform;
  transition: opacity var(--leqa-dur-slow) var(--leqa-ease),
    transform var(--leqa-dur-slow) var(--leqa-ease);
}

.leqa-js [data-reveal].is-revealed,
.leqa-js [data-leqa-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* Stagger steps (1..6). main.js may also set inline --leqa-reveal-delay. */
[data-reveal-delay="1"] { transition-delay: calc(var(--leqa-stagger) * 1); }
[data-reveal-delay="2"] { transition-delay: calc(var(--leqa-stagger) * 2); }
[data-reveal-delay="3"] { transition-delay: calc(var(--leqa-stagger) * 3); }
[data-reveal-delay="4"] { transition-delay: calc(var(--leqa-stagger) * 4); }
[data-reveal-delay="5"] { transition-delay: calc(var(--leqa-stagger) * 5); }
[data-reveal-delay="6"] { transition-delay: calc(var(--leqa-stagger) * 6); }

/* Hero load orchestration utility (one well-orchestrated entrance).
   hero.php marks children with [data-hero-rise]; .leqa-hero gets .is-loaded
   from main.js (or a CSS fallback) to play the staggered entrance. */
.leqa-js [data-hero-rise] {
  opacity: 0;
  transform: translateY(16px);
}

.leqa-hero.is-loaded [data-hero-rise] {
  animation: leqa-rise var(--leqa-dur-slow) var(--leqa-ease) both;
}

.leqa-hero.is-loaded [data-hero-rise="1"] { animation-delay: 60ms; }
.leqa-hero.is-loaded [data-hero-rise="2"] { animation-delay: 160ms; }
.leqa-hero.is-loaded [data-hero-rise="3"] { animation-delay: 260ms; }
.leqa-hero.is-loaded [data-hero-rise="4"] { animation-delay: 360ms; }
.leqa-hero.is-loaded [data-hero-rise="5"] { animation-delay: 460ms; }
.leqa-hero.is-loaded [data-hero-rise="6"] { animation-delay: 560ms; }

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

@keyframes leqa-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes leqa-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--leqa-glow);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 5px rgba(114, 255, 100, 0);
    opacity: 0.7;
  }
}

/* Slow drift of the hero glow — referenced by sections/hero.css too. */
@keyframes leqa-glow-drift {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translateX(-50%) translateY(2%) scale(1.04);
    opacity: 0.75;
  }
}

/* Loudness-meter sweep — the thin animated waveform/meter motif.
   Sections may use .leqa-meter / .leqa-meter__bar for the loudness echo. */
.leqa-meter {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 1.5rem;
}

.leqa-meter__bar {
  inline-size: 3px;
  block-size: 30%;
  border-radius: var(--leqa-radius-pill);
  background: var(--leqa-accent);
  opacity: 0.85;
  transform-origin: bottom;
  animation: leqa-meter-bounce 1.1s var(--leqa-ease-in-out) infinite;
}

.leqa-meter__bar:nth-child(2) { animation-delay: 0.12s; }
.leqa-meter__bar:nth-child(3) { animation-delay: 0.24s; }
.leqa-meter__bar:nth-child(4) { animation-delay: 0.36s; }
.leqa-meter__bar:nth-child(5) { animation-delay: 0.48s; }
.leqa-meter__bar:nth-child(6) { animation-delay: 0.60s; }
.leqa-meter__bar:nth-child(7) { animation-delay: 0.72s; }

@keyframes leqa-meter-bounce {
  0%,
  100% { block-size: 25%; opacity: 0.55; }
  50% { block-size: 100%; opacity: 1; }
}

/* ==========================================================================
   12. Reveal-on-load loading state for the version badge (JS-driven)
   ========================================================================== */
.leqa-badge.is-loading .leqa-badge__value {
  color: var(--leqa-text-faint);
}

[data-version-target]:empty::before,
.leqa-badge.is-loading [data-version-target]::before {
  content: "…";
  color: var(--leqa-text-faint);
}

/* ==========================================================================
   13. Footer base (footer-cta owned by T-D; T-A provides shell)
   ========================================================================== */
.leqa-footer {
  border-top: var(--leqa-border-width) solid var(--leqa-border);
  background: var(--leqa-bg-elev);
  color: var(--leqa-text-muted);
}

.leqa-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--leqa-space-5);
  padding-block: var(--leqa-space-7);
}

.leqa-footer__brand {
  display: flex;
  align-items: center;
  gap: var(--leqa-space-3);
}

.leqa-footer__logo {
  height: 28px;
  width: auto;
}

.leqa-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--leqa-space-5);
  list-style: none;
}

.leqa-footer__nav a {
  color: var(--leqa-text-muted);
  font-size: var(--leqa-fs-small);
}

.leqa-footer__nav a:hover {
  color: var(--leqa-text);
  text-decoration: none;
}

.leqa-footer__legal {
  width: 100%;
  padding-block: var(--leqa-space-5);
  border-top: var(--leqa-border-width) solid var(--leqa-border);
  font-size: var(--leqa-fs-small);
  color: var(--leqa-text-faint);
}

/* ==========================================================================
   14. Search form (T-A) + generic WP bits
   ========================================================================== */
.leqa-search {
  display: flex;
  gap: var(--leqa-space-2);
  align-items: stretch;
}

.leqa-search input[type="search"],
.leqa-input {
  flex: 1;
  min-height: 44px;
  padding: 0.65rem 0.95rem;
  background: var(--leqa-bg-elev-2);
  border: var(--leqa-border-width) solid var(--leqa-border);
  border-radius: var(--leqa-radius-sm);
  color: var(--leqa-text);
  font-size: var(--leqa-fs-small);
  transition: border-color var(--leqa-dur-fast) var(--leqa-ease),
    box-shadow var(--leqa-dur-fast) var(--leqa-ease);
}

.leqa-search input[type="search"]::placeholder,
.leqa-input::placeholder {
  color: var(--leqa-text-faint);
}

.leqa-search input[type="search"]:focus-visible,
.leqa-input:focus-visible {
  outline: none;
  border-color: var(--leqa-accent);
  box-shadow: var(--leqa-shadow-glow);
}

/* ==========================================================================
   15. Responsive helpers (mobile-first; primitives above are fluid already)
   ========================================================================== */
@media (max-width: 640px) {
  html {
    scroll-padding-top: 76px;
  }

  .leqa-btn-row .leqa-btn {
    flex: 1 1 auto;
  }

  .leqa-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   16. prefers-reduced-motion — freeze non-essential motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  /* Reveal elements simply appear. */
  .leqa-js [data-reveal],
  .leqa-js [data-leqa-reveal],
  .leqa-js [data-hero-rise] {
    opacity: 1 !important;
    transform: none !important;
  }

  .leqa-backdrop::after {
    animation: none !important;
  }

  .leqa-meter__bar {
    block-size: 60% !important;
    animation: none !important;
  }

  .leqa-badge__dot {
    animation: none !important;
  }
}

/* ==========================================================================
   17. Print — clean, ink-friendly
   ========================================================================== */
@media print {
  .leqa-nav,
  .leqa-backdrop,
  .leqa-cta,
  .leqa-skip-link {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}

