/* ============================================================================
   LOAMIST — polish layer
   Premium motion + micro-interactions, layered ON TOP of loamist-brand.css.
   Bank-serious restraint: every decorative loop is gated behind
   prefers-reduced-motion. Nothing here changes the palette or type — it only
   adds depth, life, and tactility. Linked AFTER loamist-brand.css.
   ============================================================================ */

/* ---- sticky-header offset so nav anchors don't hide under the bar ---- */
section[id] { scroll-margin-top: 88px; }

/* ============================================================ scroll progress */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2.5px; z-index: 200;
  transform: scaleX(0); transform-origin: 0 50%; pointer-events: none;
  background: linear-gradient(90deg, var(--gold-2), var(--gold) 60%, #e9c870);
  box-shadow: 0 0 14px color-mix(in srgb, var(--gold) 60%, transparent);
}

/* ============================================================ header refinement */
.header { transition: border-color .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease); }
.header--scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px -22px rgba(28,25,23,0.45);
}
.header--scrolled .header-inner { height: 60px; }
.header-inner { transition: height .3s var(--ease); }

/* nav scroll-spy active state (mirrors the hover underline) */
.nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after { right: 0; }

/* ============================================================ buttons — sheen + press */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn > * { position: relative; z-index: 1; }
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,0.38) 50%, transparent 68%);
  transform: translateX(-130%); transition: transform .6s var(--ease);
}
.btn:hover::after { transform: translateX(130%); }
.btn--ghost::after { background: linear-gradient(115deg, transparent 35%, color-mix(in srgb, var(--gold) 26%, transparent) 50%, transparent 65%); }
.btn:active { transform: translateY(0) scale(0.975); }
.btn--accent {
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--gold) 88%, #fff) , var(--gold));
}
[data-theme="dark"] .btn--accent { background-image: linear-gradient(180deg, var(--gold), var(--gold-2)); }

/* ============================================================ card spotlight + tactility */
.problem-card, .feature-card, .step-card, .roi-card { position: relative; overflow: hidden; }
.problem-card > *, .feature-card > *, .step-card > *, .roi-card > * { position: relative; z-index: 1; }
.problem-card::before, .feature-card::before, .step-card::before, .roi-card::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
              color-mix(in srgb, var(--gold) 15%, transparent), transparent 62%);
  transition: opacity .4s var(--ease);
}
.problem-card:hover::before, .feature-card:hover::before, .step-card:hover::before, .roi-card:hover::before { opacity: 1; }

/* feature/step accent bar drawn on hover */
.feature-card::after, .step-card::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; z-index: 2;
  background: linear-gradient(180deg, var(--gold), color-mix(in srgb, var(--gold) 30%, transparent));
  transform: scaleY(0); transform-origin: 50% 0; transition: transform .35s var(--ease);
}
.feature-card:hover::after, .step-card:hover::after { transform: scaleY(1); }

/* icon micro-motion on card hover */
.feature-icon, .problem-icon, .step-number { transition: transform .28s var(--ease), background .28s var(--ease), color .28s var(--ease); }
.feature-card:hover .feature-icon, .problem-card:hover .problem-icon, .step-card:hover .step-number { transform: translateY(-2px) scale(1.07); }
.feature-card:hover .feature-icon { background: var(--gold); color: #fff; }
[data-theme="dark"] .feature-card:hover .feature-icon { color: #1a1714; }

/* roi metric cards lift subtly too */
.roi-card { transition: transform .22s var(--ease), border-color .22s var(--ease); }
.roi-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); }

/* calculator inputs: gold focus ring */
.calc-field input[type="number"]:focus, .calc-input-prefix:focus-within {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 16%, transparent);
}

/* ============================================================ HERO backdrop depth */
.hero { perspective: 1400px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--gold) 7%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--gold) 7%, transparent) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 28% 38%, #000 0%, transparent 72%);
          mask-image: radial-gradient(ellipse 75% 70% at 28% 38%, #000 0%, transparent 72%);
}

/* hero badge — live pulse dot */
.hero-badge .live-dot {
  position: relative; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); flex: 0 0 auto;
}

/* ============================================================ HERO dashboard — make it feel real */
.hero-visual { perspective: 1400px; }
.hero-dashboard {
  transform-style: preserve-3d; will-change: transform;
  transition: box-shadow .4s var(--ease);
  border-color: color-mix(in srgb, var(--gold) 16%, var(--line));
}
.hero-dashboard.tilting { transition: box-shadow .2s var(--ease); }

/* AI scan sweep over the LC card */
.dash-lc-card { position: relative; overflow: hidden; }
.dash-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 46%; z-index: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--gold) 14%, transparent) 65%, color-mix(in srgb, var(--gold) 22%, transparent));
  border-bottom: 1.5px solid color-mix(in srgb, var(--gold) 55%, transparent);
}
.dash-lc-card > *:not(.dash-scan) { position: relative; z-index: 1; }

/* live dot on the Clean badge */
.dash-badge--success::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: 0 0 auto;
}

/* ============================================================ MOTION (gated) */
@media (prefers-reduced-motion: no-preference) {

  /* hero ambient glow breathes + drifts (very slow, subtle) */
  .hero::after { animation: heroGlow 18s ease-in-out infinite alternate; }
  @keyframes heroGlow {
    from { opacity: .65; transform: translate3d(0, 0, 0) scale(1); }
    to   { opacity: 1;   transform: translate3d(-2.2%, 1.4%, 0) scale(1.05); }
  }

  /* headline gold sweep — one elegant pass on load */
  .hero h1 .highlight {
    background: linear-gradient(100deg, var(--gold-2) 0%, var(--gold) 26%, #f2d889 48%, var(--gold) 70%, var(--gold-2) 100%);
    background-size: 230% 100%; background-position: 100% 0;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: heroSheen 2.2s var(--ease) .85s 1 both;
  }
  @keyframes heroSheen { from { background-position: 100% 0; } to { background-position: 22% 0; } }

  /* live pulse ring on hero badge dot */
  .hero-badge .live-dot::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--gold);
    animation: pulseRing 2.4s ease-out infinite;
  }
  @keyframes pulseRing { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(3.2); opacity: 0; } }

  /* floating proof badges gently bob */
  .hero-float--top    { animation: floatA 6.5s ease-in-out infinite; }
  .hero-float--bottom { animation: floatB 7.5s ease-in-out infinite; }
  @keyframes floatA { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
  @keyframes floatB { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

  /* dashboard comes alive when it scrolls into view (JS adds .dash-live) */
  .hero-dashboard.dash-live .dash-scan { animation: scanSweep 2.8s var(--ease) .3s 2; }
  @keyframes scanSweep {
    0% { transform: translateY(-110%); opacity: 0; }
    8% { opacity: 1; } 92% { opacity: 1; }
    100% { transform: translateY(240%); opacity: 0; }
  }
  .hero-dashboard.dash-live .dash-check { opacity: 0; transform: translateX(-7px); animation: checkIn .5s var(--ease) forwards; }
  .hero-dashboard.dash-live .dash-check:nth-child(1) { animation-delay: .35s; }
  .hero-dashboard.dash-live .dash-check:nth-child(2) { animation-delay: .55s; }
  .hero-dashboard.dash-live .dash-check:nth-child(3) { animation-delay: .75s; }
  .hero-dashboard.dash-live .dash-check:nth-child(4) { animation-delay: .95s; }
  @keyframes checkIn { to { opacity: 1; transform: none; } }

  /* the check icons "tick" on arrival */
  .hero-dashboard.dash-live .dash-check .check-icon { animation: tickPop .45s var(--ease) backwards; }
  .hero-dashboard.dash-live .dash-check:nth-child(1) .check-icon { animation-delay: .5s; }
  .hero-dashboard.dash-live .dash-check:nth-child(2) .check-icon { animation-delay: .7s; }
  .hero-dashboard.dash-live .dash-check:nth-child(3) .check-icon { animation-delay: .9s; }
  .hero-dashboard.dash-live .dash-check:nth-child(4) .check-icon { animation-delay: 1.1s; }
  @keyframes tickPop { 0% { transform: scale(0.3); opacity: 0; } 60% { transform: scale(1.18); } 100% { transform: scale(1); opacity: 1; } }

  /* live dot on Clean badge gently pulses */
  .dash-badge--success::before { animation: dotPulse 2.2s ease-in-out infinite; }
  @keyframes dotPulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 55%, transparent); } 50% { opacity: .7; box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 0%, transparent); } }
}

/* ============================================================ SOC 2 seal (recreated, no 404) */
.trust-soc2-featured .soc-seal { width: 120px; height: 120px; }
.footer-soc-badge { background: #fff; border-radius: 9px; padding: 5px; line-height: 0; display: inline-flex; }
.footer-soc-badge svg { width: 34px; height: 34px; display: block; }

/* ============================================================ a couple of safe global niceties */
::selection { background: color-mix(in srgb, var(--gold) 28%, transparent); color: var(--ink); }
.feature-list li svg, .roi-list li svg, .dash-check .check-icon { transition: transform .2s var(--ease); }

@media (max-width: 720px) {
  /* tilt + bob can crowd small screens — keep them calm */
  .hero-float--top, .hero-float--bottom { animation: none !important; }
}
