/* ===================================================================
   DGF Vet Solutions — shared interaction layer
   Progressive enhancement only. Loaded by every page.
   Nothing here is required for the page to read correctly:
   if JS is off, .js-on is never added and everything stays visible.
   =================================================================== */

/* -------------------------------------------------------------------
   1. SCROLL PROGRESS BAR  (injected by JS into <body>)
   ------------------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 200;
  background: linear-gradient(90deg, var(--teal-600), var(--teal-300));
  box-shadow: 0 0 12px rgba(29,158,117,0.5);
  transition: width 0.08s linear;
  pointer-events: none;
}

/* -------------------------------------------------------------------
   2. SCROLL REVEAL
   Elements get [data-reveal] from JS; .js-on on <html> arms them.
   ------------------------------------------------------------------- */
html.js-on [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
html.js-on [data-reveal="left"]  { transform: translateX(-32px); }
html.js-on [data-reveal="right"] { transform: translateX(32px); }
html.js-on [data-reveal="zoom"]  { transform: scale(0.94); }

html.js-on [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* -------------------------------------------------------------------
   3. CONDENSING / SCROLL-AWARE HEADER
   ------------------------------------------------------------------- */
header {
  transition: box-shadow 0.3s ease, padding 0.3s ease, background 0.3s ease;
  backdrop-filter: saturate(180%) blur(8px);
}
header.condensed {
  box-shadow: 0 6px 24px rgba(4,52,44,0.07);
  background: rgba(255,255,255,0.92);
}
header.condensed .header-inner { padding-top: 10px; padding-bottom: 10px; }
header.condensed .logo-mark { transform: scale(0.9); }
.logo-mark { transition: transform 0.3s ease; }
.header-inner { transition: padding 0.3s ease; }

/* -------------------------------------------------------------------
   4. BOLD HERO — animated gradient mesh + floating parallax orbs
   Orbs are injected by JS so no per-page markup is needed.
   ------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; isolation: isolate; }

html.js-on .hero::before {
  content: '';
  position: absolute;
  inset: -20%;
  z-index: 0;
  background:
    radial-gradient(40% 40% at 18% 22%, rgba(29,158,117,0.18), transparent 60%),
    radial-gradient(38% 38% at 82% 14%, rgba(93,202,165,0.20), transparent 60%),
    radial-gradient(45% 45% at 70% 88%, rgba(15,110,86,0.14), transparent 62%),
    radial-gradient(35% 35% at 30% 80%, rgba(159,225,203,0.22), transparent 60%);
  background-size: 200% 200%;
  animation: meshDrift 22s ease-in-out infinite alternate;
  filter: blur(8px);
}
@keyframes meshDrift {
  0%   { background-position: 0% 0%,   100% 0%,  100% 100%, 0% 100%; }
  50%  { background-position: 40% 30%, 60% 40%,  50% 60%,  60% 40%; }
  100% { background-position: 100% 100%, 0% 100%, 0% 0%,   100% 0%; }
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  filter: blur(2px);
  opacity: 0.55;
  will-change: transform;
}
.hero-orb.o1 {
  width: 230px; height: 230px; top: -60px; right: 8%;
  background: radial-gradient(circle at 30% 30%, rgba(93,202,165,0.55), rgba(15,110,86,0.0) 70%);
}
.hero-orb.o2 {
  width: 150px; height: 150px; bottom: -30px; left: 6%;
  background: radial-gradient(circle at 40% 40%, rgba(159,225,203,0.6), rgba(15,110,86,0.0) 70%);
}
.hero-orb.o3 {
  width: 90px; height: 90px; top: 40%; right: 28%;
  background: radial-gradient(circle at 40% 40%, rgba(29,158,117,0.4), rgba(15,110,86,0.0) 70%);
}
/* keep hero content above the decoration */
.hero-inner, .hero > .hero-inner { position: relative; z-index: 2; }

/* -------------------------------------------------------------------
   5. MAGNETIC / SPRINGY BUTTONS
   ------------------------------------------------------------------- */
.btn-primary, .btn-white, .btn-outline {
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
              transform 0.25s cubic-bezier(0.22,1,0.36,1), box-shadow 0.25s ease;
  will-change: transform;
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(15,110,86,0.28); }
.btn-white:hover   { box-shadow: 0 10px 26px rgba(0,0,0,0.18); }
.btn-magnetic      { transform: translate(var(--mx,0), var(--my,0)); }

/* gleam sweep on the primary CTA */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: '';
  position: absolute; top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s ease;
}
.btn-primary:hover::after { left: 130%; }

/* -------------------------------------------------------------------
   6. TIMELINE — dots light up as they enter view (EU page)
   ------------------------------------------------------------------- */
html.js-on .timeline-dot {
  transition: background 0.5s ease, border-color 0.5s ease,
              color 0.5s ease, transform 0.5s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.5s ease;
}
html.js-on .timeline-step .timeline-dot.lit {
  background: var(--teal-600);
  border-color: var(--teal-600);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 0 0 6px rgba(29,158,117,0.12);
}
/* animated connector growing downward */
html.js-on .timeline-step:not(:last-child)::after {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.6s ease;
}
html.js-on .timeline-step.lit:not(:last-child)::after { transform: scaleY(1); }

/* -------------------------------------------------------------------
   7. PROGRESS / DEADLINE BARS — fill when scrolled into view
   ------------------------------------------------------------------- */
html.js-on .deadline-fill {
  width: 0 !important;
  transition: width 1.1s cubic-bezier(0.22,1,0.36,1);
}
html.js-on .deadline-fill.filled { width: var(--fill,40%) !important; }

/* -------------------------------------------------------------------
   8. CARD HOVER POLISH (layered on top of existing hover rules)
   ------------------------------------------------------------------- */
.service-card, .insight-card, .signal-card, .region-card {
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.region-card:hover { background: var(--slate-50); transform: translateY(-2px); }

/* count-up numbers shouldn't reflow layout while animating */
[data-count] { font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------------
   8b. LOAD ENTRANCE — hero + root landing
   CSS keyframes (with fill-mode backwards) so the start state applies
   from the very first paint => guaranteed staggered entrance, no flash.
   js-on is set by an inline <head> script before the body paints.
   ------------------------------------------------------------------- */
@keyframes dgfIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  html.js-on .hero .hero-label   { animation: dgfIn 0.7s cubic-bezier(0.22,1,0.36,1) both; }
  html.js-on .hero h1            { animation: dgfIn 0.8s 0.08s cubic-bezier(0.22,1,0.36,1) both; }
  html.js-on .hero .hero-desc    { animation: dgfIn 0.8s 0.18s cubic-bezier(0.22,1,0.36,1) both; }
  html.js-on .hero .hero-buttons { animation: dgfIn 0.8s 0.28s cubic-bezier(0.22,1,0.36,1) both; }
  html.js-on .hero .trust-row    { animation: dgfIn 0.8s 0.38s cubic-bezier(0.22,1,0.36,1) both; }

  /* root region-select landing */
  html.js-on .brand  { animation: dgfIn 0.7s cubic-bezier(0.22,1,0.36,1) both; }
  html.js-on .intro  { animation: dgfIn 0.8s 0.12s cubic-bezier(0.22,1,0.36,1) both; }
  html.js-on .cards  { animation: dgfIn 0.9s 0.24s cubic-bezier(0.22,1,0.36,1) both; }
}

/* -------------------------------------------------------------------
   10. EDITORIAL IMAGERY — brand-toned media + full-width photo bands
   ------------------------------------------------------------------- */
.section-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 56px;
}
.section-split .section-desc { margin-bottom: 0; }

.section-media {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  background: var(--teal-50);
  box-shadow: 0 18px 44px rgba(4,52,44,0.13);
}
.section-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  transition: transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
.section-media:hover img { transform: scale(1.04); }
/* soft teal wash so photos sit inside the brand palette */
.section-media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,110,86,0.04) 0%, transparent 35%, rgba(4,52,44,0.12) 100%);
  pointer-events: none;
}

/* full-width photo band — layered over the existing teal callout */
.reg-callout.reg-photo { position: relative; background-size: cover; background-position: center; }
.reg-callout.reg-photo::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(118deg, rgba(4,52,44,0.92) 0%, rgba(8,80,65,0.70) 46%, rgba(15,110,86,0.40) 100%);
}
.reg-callout.reg-photo .reg-inner { position: relative; z-index: 1; }

@media (max-width: 860px) {
  .section-split { grid-template-columns: 1fr; gap: 26px; }
  .section-media img { aspect-ratio: 16 / 9; }
}

/* -------------------------------------------------------------------
   11. BRAND REFRESH — typography, logo, navigation
   Centralised here so it applies to every page. Uses html:root
   (higher specificity than the inline :root) to win the font vars.
   ------------------------------------------------------------------- */
html:root {
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
}
body { font-optical-sizing: auto; text-rendering: optimizeLegibility; }

/* --- Logo: bolder brand "+" to match the real mark --- */
.logo .logo-mark::before, .brand .logo-mark::before {
  width: 21px; height: 5px; border-radius: 2.5px;
}
.logo .logo-mark::after, .brand .logo-mark::after {
  width: 5px; height: 21px; border-radius: 2.5px;
}
.logo .logo-mark, .brand .logo-mark {
  box-shadow: 0 4px 14px rgba(15,110,86,0.28);
}
.logo .logo-text-main, .brand .logo-text-main { font-weight: 700; letter-spacing: -0.6px; }
.logo .logo-text-sub,  .brand .logo-text-sub  { font-weight: 600; letter-spacing: 2.6px; }

/* --- Navigation: animated underline + active-section (scrollspy) --- */
header nav > a:not(.btn-primary):not(.region-pill):not(.region-crumb) {
  position: relative; padding-bottom: 3px;
}
header nav > a:not(.btn-primary):not(.region-pill):not(.region-crumb)::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px;
  background: var(--teal-400); border-radius: 2px;
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
}
header nav > a:not(.btn-primary):not(.region-pill):not(.region-crumb):hover::after,
header nav > a.nav-active::after { transform: scaleX(1); }
header nav > a.nav-active { color: var(--teal-600); }

/* -------------------------------------------------------------------
   12. RESOURCES feature card + FOOTER lockup + SECTION dividers
   ------------------------------------------------------------------- */

/* Featured resource card (sits on the Insights section) */
.resource-feature {
  display: block; text-decoration: none;
  background: linear-gradient(120deg, var(--teal-800) 0%, var(--teal-600) 100%);
  color: #fff; border-radius: 16px; padding: 38px 40px; margin-bottom: 36px;
  position: relative; overflow: hidden;
  box-shadow: 0 22px 50px rgba(4,52,44,0.20);
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s ease;
}
.resource-feature::after {
  content: ''; position: absolute; right: -60px; top: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.10), transparent 70%);
  pointer-events: none;
}
.resource-feature:hover { transform: translateY(-3px); box-shadow: 0 30px 64px rgba(4,52,44,0.26); }
.resource-feature .resource-badge {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; background: rgba(255,255,255,0.16); color: #fff;
  padding: 5px 13px; border-radius: 20px; margin-bottom: 16px;
}
.resource-feature h3 {
  font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.2;
  margin-bottom: 12px; color: #fff; max-width: 640px; letter-spacing: -0.3px;
}
.resource-feature p { font-size: 15px; color: var(--teal-100); line-height: 1.65; max-width: 620px; margin-bottom: 18px; }
.resource-feature .resource-go { font-size: 14px; font-weight: 600; color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.resource-feature .resource-go .arrow { transition: transform 0.2s ease; }
.resource-feature:hover .resource-go .arrow { transform: translateX(5px); }

/* Footer: gradient top accent + white logo lockup */
footer { border-top: 3px solid var(--teal-400); border-image: linear-gradient(90deg, var(--teal-600), var(--teal-300), var(--teal-600)) 1; }
.footer-logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; margin-bottom: 14px; }
.footer-logo .logo-mark { width: 38px; height: 38px; background: var(--teal-600); border-radius: 8px; position: relative; flex-shrink: 0; box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
.footer-logo .logo-mark::before { content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 19px; height: 4.5px; background: #fff; border-radius: 2.5px; }
.footer-logo .logo-mark::after  { content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 4.5px; height: 19px; background: #fff; border-radius: 2.5px; }
.footer-logo .lt-main { font-size: 19px; font-weight: 700; color: #fff; letter-spacing: -0.5px; line-height: 1; }
.footer-logo .lt-sub  { font-size: 9px; font-weight: 600; color: var(--teal-300); letter-spacing: 2.6px; }

/* Subtle section dividers — a faint centred hairline at the top of each band */
.services::before, .practice::before, .why::before, .faq::before,
.insights::before, .about::before, .contact::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(1180px, 88%); height: 1px; background: rgba(4,52,44,0.07);
}
.services, .practice, .why, .faq, .insights, .about, .contact { position: relative; }

/* -------------------------------------------------------------------
   9. ACCESSIBILITY — honour reduced-motion completely
   ------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html.js-on [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .scroll-progress { display: none; }
  html.js-on .hero::before { animation: none; }
  .hero-orb { display: none; }
  html.js-on .deadline-fill { transition: none; }
  html.js-on .deadline-fill.filled { width: var(--fill,40%) !important; }
  .btn-primary::after { display: none; }
  * { scroll-behavior: auto !important; }
}
