/* =========================================================
   PROMPT 4D, D7 - Our Firm only: Our Principles' own full-width
   section, five columns separated by thin lines only (reuses the
   structure of the six-capabilities row removed in this same prompt -
   see docs/4d-progress.md). Loaded only on the Generic (Our Firm)
   template.
   ========================================================= */
.dv-principles-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  column-gap: 0;
  row-gap: 2rem;
}
.dv-principles-row-col {
  padding-inline: 1.5rem;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.dv-principles-row-col:nth-child(5n+1) { border-left: none; }

@media (max-width: 1099px) {
  .dv-principles-row { grid-template-columns: repeat(3, 1fr); }
  .dv-principles-row-col:nth-child(5n+1) { border-left: 1px solid var(--border); }
  .dv-principles-row-col:nth-child(3n+1) { border-left: none; }
}
@media (max-width: 699px) {
  .dv-principles-row { grid-template-columns: repeat(2, 1fr); }
  .dv-principles-row-col:nth-child(3n+1) { border-left: 1px solid var(--border); }
  .dv-principles-row-col:nth-child(2n+1) { border-left: none; }
}
@media (max-width: 479px) {
  .dv-principles-row { grid-template-columns: 1fr; }
  .dv-principles-row-col {
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 1.5rem 0 0;
  }
  .dv-principles-row-col:first-child { border-top: none; padding-top: 0; }
}

.dv-principles-row-col i.fa-solid {
  color: var(--navy);
  transition: transform .25s var(--m-ease-out);
}
.dv-principles-row-col:hover i.fa-solid,
.dv-principles-row-col:focus-within i.fa-solid {
  transform: translateY(-6px);
}

.dv-principles-row-text {
  font-size: clamp(1.5rem, 2vw, 1.875rem);
  line-height: 1.3;
  color: var(--navy);
}

/* Icons (and their column) rise and fade in, staggered 100ms, when
   the row scrolls into view - once. No SVG draw-on, just opacity/
   transform, gated so no-JS/reduced-motion visitors see the final
   state immediately. */
html.js .dv-motion .dv-principles-row-col {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s var(--m-ease-out), transform .5s var(--m-ease-out);
  transition-delay: calc(var(--dv-principles-i, 0) * 100ms);
}
html.js .dv-motion [data-dv-principles-row].is-played .dv-principles-row-col {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .dv-principles-row-col,
  .dv-principles-row-col i.fa-solid {
    transition: none !important;
  }
  .dv-principles-row-col:hover i.fa-solid,
  .dv-principles-row-col:focus-within i.fa-solid {
    transform: none;
  }
}

/* =========================================================
   PROMPT 4D, D8 - "What Makes DAVERON Different" stacking-cards
   scroll section. Final-state-first: base rules below show the
   heading already at the top and the cards already stacked in
   normal flow with a plain gap - exactly the narrow/reduced-motion/
   no-JS layout the brief asks for. The pinned/animated desktop
   version is layered on top entirely by dv-4c-firm.js, which also
   switches these same elements to absolute positioning only once it
   actually sets the pin up.
   ========================================================= */
.dv-diffstack-section {
  position: relative;
  background: #edf3f6;
  overflow: hidden;
}
.dv-diffstack-pin {
  position: relative;
  box-sizing: border-box;
  padding-block: clamp(3rem, 6vw, 5rem);
}
/* Prompt 4E, E5: reserve the floating header's own height (96px) plus
   32px above the heading - the pinned state's padding-top used to be
   a flat clamp(3rem,6vw,5rem), which left the heading touching (and,
   once it moved to "top", actually going UNDER) the header. Only
   affects the pinned (>=768px) state; the unpinned fallback below
   keeps its own padding.
   Prompt 4I, I5: padding-bottom is zeroed here too - the unpinned
   rule's clamp(3rem,6vw,5rem) bottom padding was left in place once
   pinned, stealing up to 80px from dv-4c-firm.js's own height budget
   (layout()'s `available` already reserves exactly 24px at the
   bottom) without JS ever knowing about it - the actual cause of card
   4 being cut off: the real content height (padding-top + heading +
   cards + this leftover padding-bottom) exceeded the pin's 100vh box,
   and overflow:hidden clipped the difference off the bottom. */
.dv-diffstack-pin.is-pinned {
  padding-top: calc(96px + 32px);
  padding-bottom: 0;
}
/* Prompt 4E, E13: the eyebrow chip and the heading move together
   (center -> top) as one unit - see dv-4c-firm.js, which now animates
   this wrapper instead of the heading alone. */
.dv-diffstack-head {
  text-align: center;
}
.dv-diffstack-head .dv-eyebrow-chip {
  margin-bottom: 16px;
}
/* Prompt 4I, I4/I5: sizing/color/alignment now come entirely from the
   shared .dv-section-title class on this same element (was its own
   oversized clamp(3rem,6vw,5.5rem) that ran past the viewport edge) -
   only the extra bottom margin this component's layout needs stays. */
.dv-diffstack-heading {
  margin-bottom: 0;
}
.dv-diffstack-cards {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: min(980px, 90vw);
  margin-inline: auto;
}
.dv-diffstack-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(16, 38, 62, .16);
}
/* Prompt 4G, G2: the problem was the content sitting in normal flow
   padded by the card's own padding, which let it run down close to
   (or past) the overlap line with the next card instead of being
   centered in the strip that stays visible. Height is set live by
   dv-4c-firm.js's layout() to exactly that visible strip (card height
   minus --dv-overlap, read from the same value the stacking step
   itself uses - the last card, with no overlap, gets its full height) -
   `justify-content:center` plus this padding then guarantees at least
   20px clear space on both sides of the heading+body group, with any
   remaining room split evenly (true centering), not just centered in
   the full, sometimes-covered card. */
.dv-diffstack-card-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px clamp(1.75rem, 3vw, 2.75rem);
}
.dv-diffstack-card--1 { background: #10263e; color: #fff; }
.dv-diffstack-card--2 { background: #167b8c; color: #fff; }
.dv-diffstack-card--3 { background: #fff; color: #10263e; border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(16, 38, 62, .08); }
/* Prompt 4E, E5: deep teal, not blue - the fourth card was the only
   one still using #10263e, the blue the brief reserves for the
   Insights nav active row and the Business Outcomes chip only. */
.dv-diffstack-card--4 { background: #167b8c; color: #fff; }
.dv-diffstack-card-title {
  /* Prompt 4G, G2: trimmed slightly (was clamp(1.75rem,2.6vw,2.5rem))
     so the title+body group actually fits inside the visible strip
     with the required >=20px clear space on both sides - measured
     overflowing by about 9-10px per side before this. */
  font-size: clamp(1.1875rem, 1.4vw, 1.625rem);
  font-weight: 600;
  line-height: 1.05;
}
.dv-diffstack-card-body {
  margin-top: .25rem;
  /* Prompt 4E, E5: vh-aware floor so a short pinned viewport can
     shrink this below the old fixed 1.125rem minimum - never below
     1.0625rem. Prompt 4G, G2: ceiling trimmed from 1.375rem for the
     same reason as the title above. */
  font-size: clamp(1.0625rem, .4vw + .5vh, 1.125rem);
  line-height: 1.4;
}
.dv-diffstack-card--1 .dv-diffstack-card-body,
.dv-diffstack-card--2 .dv-diffstack-card-body,
.dv-diffstack-card--4 .dv-diffstack-card-body { color: rgba(255, 255, 255, .88); }
.dv-diffstack-card--3 .dv-diffstack-card-body { color: var(--text-muted); }

/* Narrow/reduced-motion: cards fade up once as they individually
   enter the viewport (plain scroll flow, not pinned). */
html.js .dv-motion .dv-diffstack-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s var(--m-ease-out), transform .5s var(--m-ease-out);
}
html.js .dv-motion .dv-diffstack-card.is-in-view {
  opacity: 1;
  transform: none;
}

/* Desktop pinned state - only applied once dv-4c-firm.js actually
   sets it up (adds this class), never by default. Prompt 4I, I5:
   100svh (falls back to 100vh for browsers that don't support it) so
   a mobile browser's address-bar chrome can't make this box taller
   than the actual visible viewport dv-4c-firm.js measured via
   window.innerHeight. */
.dv-diffstack-pin.is-pinned {
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
/* Prompt 4E, E5: .dv-diffstack-cards' margin-top is set live by
   dv-4c-firm.js's layout() to the heading's real rendered height plus
   the required >=36px gap - this used to have none at all, so the
   cards sat in the flow position the heading vacated (becoming
   position:absolute above) and actually started ABOVE where the
   heading's own text ended. */
.dv-diffstack-pin.is-pinned .dv-diffstack-head {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0;
}
.dv-diffstack-pin.is-pinned .dv-diffstack-cards {
  position: relative;
}
.dv-diffstack-pin.is-pinned .dv-diffstack-card {
  position: absolute;
  left: 0;
  right: 0;
  opacity: 0;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .dv-diffstack-card { transition: none !important; }
}

/* The static/mobile stack needs real content height, without absolute positioning. */
.dv-diffstack-pin:not(.is-pinned) .dv-diffstack-card-content {
  position: relative;
  inset: auto;
}

/* =========================================================
   FOUNDER UPDATE - photo reveal/parallax, staggered text reveal, quote
   accent-line draw, teal edge glow behind the cutout. Final-state-
   first: base rules below ARE the finished, fully-visible layout
   (same convention as D7/D8 above) - html.js .dv-motion adds the
   hidden starting point, dv-4c-firm.js's [data-dv-founder-reveal]
   .is-played flips it. Animates only opacity/transform. See
   dv_our_firm_founder_card() in inc/template-tags.php for the markup.
   ========================================================= */
.dv-founder-card-r3-glow {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 60%;
  max-width: 420px;
  height: 78%;
  background: radial-gradient(closest-side, rgba(127, 209, 222, .32), transparent 72%);
  pointer-events: none;
}

html.js .dv-motion .dv-founder-card-r3-figure {
  opacity: 0;
  transition: opacity .8s var(--m-ease-out, ease);
}
html.js .dv-motion [data-dv-founder-reveal].is-played .dv-founder-card-r3-figure {
  opacity: 1;
}

html.js .dv-motion .dv-founder-reveal-item {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s var(--m-ease-out, ease), transform .6s var(--m-ease-out, ease);
  transition-delay: calc(var(--dv-founder-i, 0) * 80ms);
}
html.js .dv-motion [data-dv-founder-reveal].is-played .dv-founder-reveal-item {
  opacity: 1;
  transform: none;
}

.dv-founder-quote-accent {
  display: block;
  width: 48px;
  height: 2px;
  margin-top: .65rem;
  /* --teal-light is aliased to white site-wide (tokens.css) for dark-
     surface TEXT, which would make this invisible on the card's own
     teal-to-navy gradient - a real bright teal instead, visible
     against both ends of that gradient. */
  background: #7fd1de;
  transform-origin: left center;
}
html.js .dv-motion .dv-founder-quote-accent {
  transform: scaleX(0);
  transition: transform .6s var(--m-ease-out, ease);
  transition-delay: calc(var(--dv-founder-i, 0) * 80ms);
}
html.js .dv-motion [data-dv-founder-reveal].is-played .dv-founder-quote-accent {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  .dv-founder-card-r3-figure,
  .dv-founder-reveal-item,
  .dv-founder-quote-accent {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
/* Pause motion: same final state, no transition - matches the site's
   "Pause motion" control (html.motion-paused), independent of the
   visitor's own OS-level reduced-motion preference. */
html.motion-paused .dv-founder-card-r3-figure,
html.motion-paused .dv-founder-reveal-item,
html.motion-paused .dv-founder-quote-accent {
  transition: none !important;
  opacity: 1 !important;
  transform: none !important;
}
