/* ==========================================================================
   Victoria Law Firm — shared styles
   Dark, cinematic, premium. Pairs Cormorant Garamond (display) with Inter.
   ========================================================================== */

:root {
  --ink: #080B12;
  --gold: #C9A961;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  background-color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Selection + scrollbar -------------------------------------------------- */
::selection { background: rgba(201,169,97,0.30); color: #fff; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #06080d; }
::-webkit-scrollbar-thumb { background: #2a3140; border-radius: 999px; border: 3px solid #06080d; }
::-webkit-scrollbar-thumb:hover { background: #3a4252; }

/* Typographic helpers --------------------------------------------------- */
.text-balance { text-wrap: balance; }
.font-display { font-family: 'Cormorant Garamond', Georgia, serif; }

.eyebrow {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}

.gold-rule {
  height: 1px;
  width: 56px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* Gold gradient text */
.text-gold-grad {
  background: linear-gradient(100deg, #E6CF95 0%, #C9A961 45%, #9F7C39 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==========================================================================
   Cinematic hero background — abstract, dependency-free.
   Layers: base navy gradient + warm lens-flare glow + soft streak + grain + vignette
   ========================================================================== */
.hero-bg { position: relative; isolation: isolate; background: #080B12; overflow: hidden; }
.hero-bg::before {
  content: "";
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 90% at 70% 18%, rgba(201,169,97,0.16) 0%, rgba(201,169,97,0.04) 28%, transparent 55%),
    radial-gradient(90% 70% at 82% 8%, rgba(120,150,210,0.14) 0%, transparent 50%),
    radial-gradient(140% 120% at 50% 120%, rgba(14,26,43,0.9) 0%, transparent 60%),
    linear-gradient(160deg, #0A0E18 0%, #080B12 45%, #06080E 100%);
}
/* soft diagonal light streak, echoing the reference lens-flare */
.hero-bg::after {
  content: "";
  position: absolute; z-index: -1;
  top: -10%; left: 35%; width: 60%; height: 60%;
  background: radial-gradient(closest-side, rgba(230,207,149,0.22), transparent 70%);
  transform: rotate(-18deg);
  filter: blur(6px);
  opacity: 0.9;
  pointer-events: none;
}
/* fine film grain via inline SVG noise */
.grain::after {
  content: "";
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.05;
  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='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Subtle hairline grid for section backgrounds */
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}

/* ==========================================================================
   Navbar behaviour
   ========================================================================== */
#site-nav {
  transition: background-color .4s ease, backdrop-filter .4s ease,
              border-color .4s ease, box-shadow .4s ease;
}
#site-nav.scrolled {
  background-color: rgba(8,11,18,0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 12px 40px -24px rgba(0,0,0,0.9);
}

/* Animated underline for nav links */
.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  height: 1px; width: 0; background: var(--gold);
  transition: width .3s cubic-bezier(.16,1,.3,1);
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after { width: 100%; }
.nav-link[aria-current="page"] { color: #F4F1EA; }

/* ==========================================================================
   Cards & interactive bits
   ========================================================================== */
.card-hover {
  transition: transform .35s cubic-bezier(.16,1,.3,1),
              border-color .35s ease, box-shadow .35s ease, background-color .35s ease;
}
.card-hover:hover {
  transform: translateY(-4px);
  border-color: rgba(201,169,97,0.45);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.8);
}

.btn-gold {
  background: linear-gradient(180deg, #E6CF95, #C9A961);
  color: #1a1407;
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}
.btn-gold:hover { box-shadow: 0 14px 36px -12px rgba(201,169,97,0.6); filter: brightness(1.04); }
.btn-gold:active { transform: translateY(1px); }

.btn-ghost {
  border: 1px solid rgba(255,255,255,0.18);
  color: #F4F1EA;
  transition: border-color .25s ease, background-color .25s ease, color .25s ease;
}
.btn-ghost:hover { border-color: rgba(201,169,97,0.6); background: rgba(201,169,97,0.06); }

.link-arrow svg { transition: transform .25s ease; }
.link-arrow:hover svg { transform: translateX(4px); }

/* Focus visibility (accessibility) */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==========================================================================
   Scroll reveal
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s cubic-bezier(.16,1,.3,1), transform .9s cubic-bezier(.16,1,.3,1);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }
.reveal[data-delay="5"] { transition-delay: .40s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* Mobile menu */
#mobile-menu { transition: opacity .3s ease, visibility .3s ease; }
#mobile-menu.hidden-menu { opacity: 0; visibility: hidden; pointer-events: none; }

/* ==========================================================================
   Handcrafted micro-interactions — restrained, "expensive"
   ========================================================================== */

/* (1) Cursor-follow spotlight on cards. Pointer position fed via --mx/--my (JS).
   A soft gold light that tracks the cursor — the signature premium-card feel. */
.card-hover { position: relative; }
.card-hover::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
              rgba(201, 169, 97, 0.13), transparent 60%);
  opacity: 0;
  transition: opacity .45s ease;
  pointer-events: none;
  z-index: 0;
}
.card-hover:hover::before { opacity: 1; }
/* keep card content above the spotlight */
.card-hover > * { position: relative; z-index: 1; }

/* (2) Hairline gold top-edge that draws in on hover — subtle, architectural */
.card-hover::after {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  width: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: translateX(-50%);
  transition: width .5s cubic-bezier(.16, 1, .3, 1);
  pointer-events: none;
  z-index: 2;
}
.card-hover:hover::after { width: 70%; }

/* (1b) Card icons lift + warm glow on hover — quiet, hand-finished */
.card-hover .text-gold svg {
  transition: transform .45s cubic-bezier(.16, 1, .3, 1), filter .45s ease;
}
.card-hover:hover .text-gold svg {
  transform: translateY(-3px) scale(1.06);
  filter: drop-shadow(0 6px 14px rgba(201, 169, 97, 0.35));
}

/* (3) Light sweep across gold buttons on hover */
.btn-gold { position: relative; overflow: hidden; }
.btn-gold::after {
  content: "";
  position: absolute;
  top: 0; left: -160%;
  width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  transition: left .65s cubic-bezier(.16, 1, .3, 1);
  pointer-events: none;
}
.btn-gold:hover::after { left: 160%; }

/* (4) Magnetic buttons rely on a transform set inline by JS; smooth the return */
[data-magnetic] { transition: transform .35s cubic-bezier(.16, 1, .3, 1), box-shadow .25s ease, filter .25s ease; }

/* (5) Slim reading-progress bar */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px; width: 0;
  background: linear-gradient(90deg, var(--gold), #E6CF95);
  box-shadow: 0 0 12px rgba(201, 169, 97, 0.6);
  z-index: 60;
  pointer-events: none;
  transition: width .12s linear;
}

/* (6) Animated count-up numerals stay aligned while ticking */
[data-count] { font-variant-numeric: tabular-nums; }

/* (7) Footer links: refined underline that draws from the left */
footer a:not(.btn-gold):not([aria-label]) {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size .4s cubic-bezier(.16, 1, .3, 1), color .2s ease;
}
footer a:not(.btn-gold):not([aria-label]):hover { background-size: 100% 1px; }

@media (prefers-reduced-motion: reduce) {
  .card-hover::before, .card-hover::after, .btn-gold::after { display: none; }
  #scroll-progress { display: none; }
}
@media (hover: none) {
  /* no spotlight/sweep on touch — avoids stuck hover states */
  .card-hover::before, .card-hover::after { display: none; }
}
