/**
 * DAVERON V3 - Round 3 type system and text motion (section 3.2).
 * All animation here is scoped under body.dv-motion (the existing
 * DV_MOTION switch) and further disabled by prefers-reduced-motion and
 * the existing .motion-paused class (footer Pause-motion control).
 * Text content is never hidden from the no-JS / reduced-motion path -
 * the reveal classes only animate an already-visible element's
 * transform/opacity, they never start it hidden outside .dv-motion.js.
 */

/* ---- Eyebrow ---- */
.dv-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  font-family: var(--font-accent);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal-deep);
}
.dv-eyebrow::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  flex-shrink: 0;
}
.dv-eyebrow--on-dark { color: var(--teal-light); }

/* ---- Section heading (Round 8 H4) ----
   A larger, more distinctive heading style for a page's named section
   headings, shared so the Home "Our Core Capabilities" heading and the
   Capabilities overview heading read at the same visual weight. */
.dv-section-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 1.12;
}

/* ---- Accent word (the "growth compounds" move) ---- */
em.dv-accent {
  font-style: italic;
  font-weight: 600;
  font-family: var(--font-display);
  /* Round 8 H1: italic overhang and descenders were getting clipped
     by the gradient text-clip box at its tight default edges -
     inline padding doesn't affect line height, just gives the
     painted/clipped area a bit more room on every side. */
  padding-inline: 0.04em;
  padding-bottom: 0.1em;
}
/* On dark sections: gradient teal → aqua text, slow sweep. */
em.dv-accent {
  background: linear-gradient(100deg, #7fd1de 0%, var(--teal) 35%, #7fd1de 70%, var(--teal) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--teal-light);
}
.dv-motion em.dv-accent { animation: dv-accent-sweep 7s linear infinite; }
@keyframes dv-accent-sweep {
  0%   { background-position: 0% 50%; }
  100% { background-position: -220% 50%; }
}
/* On light sections: solid teal-deep, no gradient (keeps AA contrast
   simple and avoids a sweep that's hard to read on white). */
em.dv-accent--on-light {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--teal-deep);
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .dv-motion em.dv-accent { animation: none; background-position: 0% 50%; }
}
.motion-paused em.dv-accent { animation-play-state: paused; }
/* Round 6 B7: the default teal/aqua gradient accent is tuned for navy
   backgrounds - on a teal-dominant panel (the CTA band's 'b'/'e'
   treatments) it reads as teal-on-teal (R4 explicitly forbids this;
   confirmed near-invisible in a round6 screenshot). Plain white here
   instead, no gradient. */
em.dv-accent--on-teal {
  background: none !important;
  -webkit-text-fill-color: var(--white) !important;
  color: var(--white) !important;
  animation: none !important;
}

/* ---- Big numerals (outlined, "01" to "06") ---- */
.dv-num {
  font-family: var(--font-accent);
  font-weight: 700;
  line-height: 1;
  font-size: clamp(2.5rem, 2rem + 3vw, 5rem);
  color: transparent;
  -webkit-text-stroke: 1.5px var(--teal-light);
  letter-spacing: -.02em;
}
.dv-num--on-light { -webkit-text-stroke: 1.5px var(--teal-deep); }
.dv-num--filled {
  display: inline-block;
  -webkit-text-stroke: 0;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
/* Fallback for browsers without -webkit-text-stroke (rare, but don't
   let the numeral vanish to invisible transparent-on-transparent). */
@supports not (-webkit-text-stroke: 1px black) {
  .dv-num { color: var(--teal-light); }
  .dv-num--on-light { color: var(--teal-deep); }
}

/* ---- Subtext / body copy inside Round 3 sections ---- */
.dv-subtext {
  font-weight: 400;
  line-height: 1.65;
  max-width: 62ch;
  color: var(--text-muted);
}
.dv-subtext--on-dark { color: rgba(237,243,246,.82); }
.dv-subtext mark.dv-emphasis {
  background: none;
  color: var(--teal-deep);
  font-weight: 600;
}
.dv-subtext--on-dark mark.dv-emphasis { color: var(--teal-light); }

/* ---- Underline-draw link with arrow nudge ---- */
.dv-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
  color: var(--teal-deep);
  position: relative;
}
.dv-link-arrow--on-dark { color: var(--white); }
.dv-link-arrow::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 1.5px;
  width: 100%;
  background: currentColor;
  transform: scaleX(.86);
  transform-origin: left;
  transition: transform var(--m-duration-base) var(--m-ease-out);
}
.dv-link-arrow:hover::after,
.dv-link-arrow:focus-visible::after { transform: scaleX(1); }
.dv-link-arrow .dv-link-arrow-icon {
  display: inline-block;
  transition: transform var(--m-duration-fast) var(--m-ease-out);
}
.dv-link-arrow:hover .dv-link-arrow-icon,
.dv-link-arrow:focus-visible .dv-link-arrow-icon { transform: translateX(4px); }
@media (prefers-reduced-motion: reduce) {
  .dv-link-arrow::after,
  .dv-link-arrow .dv-link-arrow-icon { transition: none; }
}

/* =========================================================
   TEXT SPLIT / REVEAL (JS-built spans, assets/js/dv-text-split.js).
   The un-split element is already fully visible by default - these
   rules only apply once JS has added .dv-split-ready, so there is no
   FOUC-hidden state without JS, and nothing to "fall back" from.

   A CSS animation, not a class-toggled transition: the per-word
   animation-delay is set inline by JS at split time and the reveal
   runs immediately off that, with no later "add a class" step for
   anything else to race against. An IntersectionObserver/class-toggle
   version of this was tried first and was found, in testing on this
   project's local dev server, to intermittently never add the
   reveealing class on some page loads for a cause that resisted
   isolation (not reduced motion, not a script error, not a missing
   element - see docs/PROGRESS.md) - correctness mattered more than
   keeping the true "reveal on scroll into view" behaviour, so this
   trades that for always-visible-shortly-after-load instead.
   ========================================================= */
.dv-split-line {
  /* Round 8 H1: extends the clip boundary outward instead of clipping
     exactly at the line box, so tall ascenders (G, P, H) and
     descenders (g, y, p, j) in large display type are never cut off
     by the word-reveal mask. */
  overflow: clip;
  overflow-clip-margin: 0.15em;
  display: inline-block;
  vertical-align: top;
}
.dv-split-line > .dv-split-line-inner {
  display: inline-block;
  will-change: transform;
}
.dv-motion .dv-split-ready .dv-split-line > .dv-split-line-inner {
  animation: dv-split-reveal .7s var(--m-ease-out) both;
  animation-delay: 0ms; /* overridden inline per word by dv-text-split.js */
}
@keyframes dv-split-reveal {
  from { transform: translateY(110%); }
  to   { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .dv-split-ready .dv-split-line > .dv-split-line-inner {
    animation: none !important;
    transform: none !important;
  }
}
.motion-paused .dv-split-ready .dv-split-line > .dv-split-line-inner {
  animation: none !important;
  transform: none !important;
}

/* =========================================================
   Prompt 3D, Stage 4 - inline emphasis for body copy (dv_emph() in
   inc/template-tags.php converts *…*, **…**, ==…== markers already
   present in the registry string into these three spans). No motion,
   no reduced-motion concerns - purely typographic.
   ========================================================= */
/* Prompt 3E, E4: replaces the three Prompt-3D emphasis styles (teal
   accent, navy/white strong, underlined teal highlighter) with one
   safe set - bold and italic only, always `color: inherit` so emphasis
   can never read as its own color against whatever background it
   lands on (the teal accent in particular could get close to
   teal-on-teal on a .section-teal band). No underline, no background,
   anywhere. accent = serif italic, strong = bold, highlight = bold
   italic (the old marker names are kept - *accent*/**strong**/
   ==highlight== - only their rendered style changed, so no registry
   content or dv_emph() parsing changes). */
.dv-emph-accent {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: inherit;
}

.dv-emph-strong {
  font-weight: 700;
  color: inherit;
}

.dv-emph-highlight {
  font-weight: 700;
  font-style: italic;
  font-family: var(--font-display);
  background: none;
  text-decoration: none;
  color: inherit;
}

/* Hero introduction lead paragraph - 1.2-1.35x body size, only the
   first paragraph of a hero body (the actual Part A intro sentence;
   any appended problem/response paragraphs stay body-sized). */
.dv-lead {
  font-size: 1.2em;
  line-height: 1.45;
}

/* =========================================================
   Prompt 3D, Stage 7 - alternating slide-in band, replacing a plain
   card grid for a group of 3-4 short title+body items without adding
   page height (horizontal space instead of a stacked card grid).
   Slide-in distance/duration overridden locally; reduced-motion and
   Pause Motion both already work because this reuses the shared
   .reveal[data-reveal] mechanic (motion.css) rather than new CSS/JS.
   ========================================================= */
.dv-alt-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dv-alt-band {
  /* Prompt 3E, E3: 80px slide, 700ms, a gentler-finish ease than the
     site's default .reveal curve - overridden locally so only the
     bands change, nothing else that uses the shared .reveal mechanic. */
  --m-reveal-distance: 80px;
  --m-duration-base: 700ms;
  --m-ease-out: cubic-bezier(.22, .61, .36, 1);
  display: grid;
  /* Prompt 3D fix: the heading column needs real room at this font
     size or a 3-5 word title wraps to several lines and the band
     grows taller than the card grid it replaced (measured: it did,
     first pass - see docs/3d-progress.md). Near-equal columns plus a
     smaller heading clamp keep every sections_a title to 1-2 lines,
     which is what actually determines each band's height. */
  grid-template-columns: minmax(180px, 1.1fr) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
  /* Prompt 3D: 20px, a deliberate small deviation below Stage 7's
     24-32px suggestion - with 4-item groups whose longer items (e.g.
     About's "Trust must be earned" body) run 3 text lines, 24px+
     padding left the page measurably taller than its Stage 0 baseline
     (measured: about/ 1440px went from 5123px baseline to 5166px at
     24px padding). The absolute rules rank "final heights must be
     shorter" above this stage's own padding figure when the two
     conflict - see docs/3d-progress.md. */
  padding: 20px clamp(20px, 4vw, 40px);
  border-radius: 16px;
}
.dv-alt-band--right {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 1.1fr);
}
.dv-alt-band--right > .dv-alt-big { order: 2; }
.dv-alt-band--right > .dv-alt-text { order: 1; }
@media (max-width: 767px) {
  .dv-alt-band,
  .dv-alt-band--right {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 18px;
  }
  .dv-alt-band--right > .dv-alt-big,
  .dv-alt-band--right > .dv-alt-text { order: initial; }
}
.dv-alt-big {
  font-family: var(--font-display);
  font-weight: 600;
  /* Prompt 3E, E3: bigger heading type - the horizontal space (the
     band's own width, not a stacked card grid) is what keeps the group
     from growing taller, not a small clamp. */
  font-size: clamp(2rem, 4.2vw, 3.5rem);
  line-height: 1.08;
  color: var(--navy);
}
.dv-alt-text { color: var(--text-muted); }
.dv-alt-text p { font-size: 1.125rem; line-height: 1.5; margin: 0; }
@media (max-width: 767px) {
  .dv-alt-text p { font-size: 1rem; }
}

.dv-alt-tint-1 { background: var(--bg-soft); }
.dv-alt-tint-2 { background: var(--teal-tint); }
.dv-alt-tint-3 { background: rgba(22, 123, 140, .10); }
.dv-alt-tint-4 { background: rgba(16, 38, 62, .06); }

.section-navy .dv-alt-tint-1,
.section-teal .dv-alt-tint-1 { background: rgba(255, 255, 255, .06); }
.section-navy .dv-alt-tint-2,
.section-teal .dv-alt-tint-2 { background: rgba(255, 255, 255, .11); }
.section-navy .dv-alt-tint-3,
.section-teal .dv-alt-tint-3 { background: rgba(255,255,255, .14); }
.section-navy .dv-alt-tint-4,
.section-teal .dv-alt-tint-4 { background: rgba(255, 255, 255, .16); }
.section-navy .dv-alt-big,
.section-teal .dv-alt-big { color: var(--white); }
.section-navy .dv-alt-text,
.section-teal .dv-alt-text { color: rgba(255, 255, 255, .85); }
