/* AHVIE — ENHANCEMENT LAYER v1 (loads after ahvie.css) */

/* Smooth cross-page transitions (Chrome/Edge/Safari 18+) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: ahv-out .35s var(--ease) both; }
::view-transition-new(root) { animation: ahv-in .5s var(--ease) both; }
@keyframes ahv-out { to { opacity: 0; transform: translateY(-12px); filter: blur(4px); } }
@keyframes ahv-in { from { opacity: 0; transform: translateY(16px); filter: blur(4px); } }

html { scroll-behavior: smooth; }
::selection { background: var(--gold); color: var(--g-950); }

/* Scroll progress bar */
#ahv-prog {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 10001;
  transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
  background: linear-gradient(90deg, var(--g-400), var(--gold), var(--g-200));
  box-shadow: 0 0 12px rgba(201,168,76,.6);
}

/* Glassy nav once scrolled */
#nav { transition: background .4s var(--ease), box-shadow .4s var(--ease), backdrop-filter .4s; }
body.ahv-scrolled #nav {
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  box-shadow: 0 8px 30px rgba(4,14,7,.12);
}

/* Subtle film grain for a premium texture */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 9998; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Images fade/blur in as they load */
img.ahv-img { opacity: 0; filter: blur(10px); transform: scale(1.02);
  transition: opacity .7s var(--ease), filter .9s var(--ease), transform 1.2s var(--ease); }
img.ahv-img.ahv-loaded { opacity: 1; filter: none; transform: none; }

/* Card tilt + light sheen */
.ahv-tilt { transform-style: preserve-3d; will-change: transform;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease); position: relative; }
.ahv-tilt:hover { box-shadow: var(--sh-xl); }
.ahv-tilt::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  background: radial-gradient(420px circle at var(--mx,50%) var(--my,50%), rgba(255,255,255,.18), transparent 45%);
  opacity: 0; transition: opacity .4s;
}
.ahv-tilt:hover::before { opacity: 1; }
.ahv-tilt img { transition: transform 1s var(--ease); }
.ahv-tilt:hover img { transform: scale(1.06); }

/* Buttons: shine sweep + ripple */
.btn, .nav-cta, .submit-btn, .pg-btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after, .nav-cta::after, .submit-btn::after {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%; z-index: -1;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); transition: left .8s var(--ease);
}
.btn:hover::after, .nav-cta:hover::after, .submit-btn:hover::after { left: 140%; }
.ahv-ripple { position: absolute; border-radius: 50%; pointer-events: none; transform: scale(0);
  background: rgba(255,255,255,.45); animation: ahv-rip .7s var(--ease) forwards; }
@keyframes ahv-rip { to { transform: scale(4); opacity: 0; } }

/* Section titles: gold underline draws in when revealed */
.s-title { position: relative; }
.s-title.rv::after {
  content: ""; display: block; height: 2px; width: 64px; margin-top: .5em;
  background: linear-gradient(90deg, var(--gold), transparent);
  transform: scaleX(0); transform-origin: left; transition: transform 1.1s .3s var(--ease);
}
[style*="text-align:center"] > .s-title.rv::after, .s-title.rv[style*="center"]::after { margin-inline: auto; transform-origin: center; }
.s-title.rv.in::after, .s-title.rv.visible::after, .s-title.rv.on::after, .s-title.rv.show::after { transform: scaleX(1); }

/* Shimmering gold for italic accents in headings */
h1 em, h2 em, .s-title em {
  background: linear-gradient(100deg, var(--gold) 20%, #f3dc94 40%, var(--gold) 60%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; animation: ahv-shimmer 5s linear infinite;
}
@keyframes ahv-shimmer { to { background-position: -250% 0; } }

/* Back-to-top with progress ring */
#ahv-top {
  position: fixed; left: 22px; bottom: 22px; width: 48px; height: 48px; border-radius: 50%;
  border: 0; cursor: pointer; z-index: 900; display: grid; place-items: center;
  background: var(--g-900); color: var(--gold); box-shadow: var(--sh-lg);
  opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none;
  transition: opacity .4s var(--ease), transform .5s var(--ease-2);
}
#ahv-top.on { opacity: 1; transform: none; pointer-events: auto; }
#ahv-top:hover { transform: translateY(-4px); }
#ahv-top svg.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
#ahv-top circle { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-dasharray: 138; stroke-dashoffset: 138; }

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

/* Nicer scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--cream-2); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--g-500), var(--g-700)); border-radius: 10px; border: 2px solid var(--cream-2); }

@media (hover: none) { .ahv-tilt { transform: none !important; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  img.ahv-img { opacity: 1; filter: none; transform: none; }
}
