/* ==========================================================================
   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; }
}

/* ==========================================================================
   Cause-list dashboard
   ========================================================================== */
.cause-sync-panel,
.cause-stat,
.cause-panel,
.cause-card,
.cause-empty {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(17,22,31,0.82);
  box-shadow: 0 24px 60px -36px rgba(0,0,0,0.95);
}

.cause-sync-panel {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-radius: 1rem;
  padding: 1.1rem;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.cause-pulse {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  background: #E6CF95;
  box-shadow: 0 0 0 0 rgba(201,169,97,0.6);
  flex: 0 0 auto;
  animation: causePulse 2s infinite;
}

.cause-cloud-active .cause-pulse {
  background: #7DD3A8;
  box-shadow: 0 0 0 0 rgba(125,211,168,0.45);
}

.cause-cloud-error .cause-pulse {
  background: #F87171;
  box-shadow: 0 0 0 0 rgba(248,113,113,0.45);
}

@keyframes causePulse {
  0% { box-shadow: 0 0 0 0 rgba(201,169,97,0.45); }
  70% { box-shadow: 0 0 0 14px rgba(201,169,97,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,169,97,0); }
}

.cause-auth-panel[hidden],
#sign-out[hidden] {
  display: none !important;
}

.cause-auth-required [data-private-shell] {
  display: none !important;
}

.cause-auth-form {
  display: grid;
  gap: 1rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1rem;
  background: rgba(17,22,31,0.82);
  padding: 1rem;
  box-shadow: 0 24px 60px -36px rgba(0,0,0,0.95);
}

.cause-stat {
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  min-height: 6.25rem;
}

.cause-stat span {
  display: block;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.67rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #99A2B2;
}

.cause-stat strong {
  display: block;
  margin-top: 0.75rem;
  color: #F4F1EA;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.5rem, 2.2vw, 2.25rem);
  font-weight: 600;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.cause-panel {
  border-radius: 1rem;
  padding: clamp(1.2rem, 2vw, 1.6rem);
}

.cause-field {
  display: block;
}

.cause-field span {
  display: block;
  margin-bottom: 0.55rem;
  color: #99A2B2;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.cause-field input,
.cause-field select,
.cause-field textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 0.85rem;
  background: rgba(8,11,18,0.74);
  color: #F4F1EA;
  padding: 0.9rem 1rem;
  font-size: 0.95rem;
  line-height: 1.35;
  outline: none;
  transition: border-color .25s ease, background-color .25s ease, box-shadow .25s ease;
}

.cause-field textarea {
  min-height: 8rem;
  resize: vertical;
}

.cause-field input::placeholder,
.cause-field textarea::placeholder {
  color: rgba(153,162,178,0.58);
}

.cause-field input:focus,
.cause-field select:focus,
.cause-field textarea:focus {
  border-color: rgba(201,169,97,0.65);
  background: rgba(8,11,18,0.95);
  box-shadow: 0 0 0 4px rgba(201,169,97,0.08);
}

.cause-file-button,
.cause-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  color: #F4F1EA;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: border-color .25s ease, background-color .25s ease, color .25s ease;
}

.cause-file-button {
  padding: 0.72rem 1rem;
  font-size: 0.88rem;
}

.cause-file-button input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cause-icon-button {
  width: 2.75rem;
  height: 2.75rem;
}

.cause-file-button:hover,
.cause-icon-button:hover {
  border-color: rgba(201,169,97,0.58);
  background: rgba(201,169,97,0.08);
  color: #E6CF95;
}

.cause-results {
  display: grid;
  gap: 0.85rem;
}

.cause-date-row {
  position: sticky;
  top: 5.2rem;
  z-index: 10;
  border: 1px solid rgba(201,169,97,0.18);
  border-radius: 999px;
  background: rgba(8,11,18,0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #E6CF95;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  margin: 0.9rem 0 0.15rem;
}

.cause-card {
  display: grid;
  grid-template-columns: minmax(5.4rem, 7rem) minmax(0, 1fr) auto;
  gap: 1rem;
  border-radius: 1rem;
  padding: 1rem;
  transition: border-color .25s ease, transform .25s ease, background-color .25s ease;
}

.cause-card:hover {
  border-color: rgba(201,169,97,0.36);
  background: rgba(19,25,36,0.95);
  transform: translateY(-2px);
}

.cause-card-time {
  border-right: 1px solid rgba(255,255,255,0.08);
  padding-right: 1rem;
}

.cause-card-time span {
  display: block;
  color: #F4F1EA;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.95rem;
  white-space: nowrap;
}

.cause-card-time small {
  display: block;
  margin-top: 0.55rem;
  color: #99A2B2;
  font-size: 0.8rem;
  line-height: 1.35;
}

.cause-card-main {
  min-width: 0;
}

.cause-card-topline,
.cause-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cause-card-topline span,
.cause-meta span {
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 999px;
  color: #99A2B2;
  background: rgba(255,255,255,0.03);
  font-size: 0.72rem;
  line-height: 1.2;
  padding: 0.38rem 0.55rem;
}

.cause-card h3 {
  margin-top: 0.75rem;
  color: #F4F1EA;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: clamp(1rem, 1.45vw, 1.22rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.cause-related,
.cause-notes {
  margin-top: 0.45rem;
  color: #E6CF95;
  font-size: 0.86rem;
}

.cause-parties {
  margin-top: 0.72rem;
  color: rgba(244,241,234,0.88);
  font-size: 0.94rem;
  line-height: 1.6;
}

.cause-meta {
  margin-top: 0.9rem;
}

.cause-delete {
  align-self: start;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  color: #99A2B2;
  background: transparent;
  font-size: 0.74rem;
  padding: 0.5rem 0.7rem;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.cause-delete:hover {
  color: #F4F1EA;
  border-color: rgba(201,169,97,0.45);
  background: rgba(201,169,97,0.07);
}

.cause-empty {
  border-radius: 1rem;
  color: #99A2B2;
  padding: 2rem;
  text-align: center;
}

.cause-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: 80;
  max-width: min(90vw, 32rem);
  transform: translate(-50%, 1rem);
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(201,169,97,0.35);
  border-radius: 999px;
  background: rgba(8,11,18,0.95);
  color: #F4F1EA;
  box-shadow: 0 20px 50px -24px rgba(0,0,0,0.9);
  padding: 0.8rem 1rem;
  text-align: center;
  transition: opacity .25s ease, transform .25s ease;
}

.cause-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.cause-toast.is-error {
  border-color: rgba(248,113,113,0.55);
  color: #fecaca;
}

@media (max-width: 760px) {
  .cause-card {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .cause-card-time {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-right: 0;
    padding-bottom: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .cause-delete {
    width: 100%;
  }

  .cause-date-row {
    top: 4.8rem;
  }
}
