/* ============================================================
   RFC SHOWCASE STANDARD v1 — shared interaction/animation layer
   Loaded AFTER each site's styles.css. Themed per-site via
   <html data-site="scotts"> or <html data-site="realdeal">.
   Adds: animated heroes, before/after compare slider, count-up
   stat strip + gloss meter, magnetic buttons, spotlight cursor,
   reveal blur-up/stagger, app-like mobile. Vanilla, GPU-only.
   ============================================================ */

/* ---- per-site token mapping (sc-* = showcase neutral tokens) ---- */
html[data-site="scotts"] {
  --sc-bg: var(--paper, #F6F3EB);
  --sc-surface: var(--paper-2, #EFEBDF);
  --sc-ink: var(--ink, #1E2A22);
  --sc-ink-soft: var(--ink-soft, #54625A);
  --sc-accent: var(--forest, #1C3A2C);
  --sc-accent-bright: var(--forest-600, #2E5C45);
  --sc-brass: var(--brass, #C0974A);
  --sc-on-accent: #F4F1E8;
  --sc-line: var(--line, rgba(30,42,34,0.14));
  --sc-glow: 255, 178, 84;       /* warm landscape uplight */
}
html[data-site="realdeal"] {
  --sc-bg: var(--bg, #141009);
  --sc-surface: var(--surface, #221B12);
  --sc-ink: var(--ink, #F4EEE2);
  --sc-ink-soft: var(--ink-soft, #B4AA97);
  --sc-accent: var(--red, #CE2027);
  --sc-accent-bright: var(--red-bright, #E23B3F);
  --sc-brass: var(--brass, #C2A878);
  --sc-on-accent: #fff;
  --sc-line: var(--line-mid, rgba(194,168,120,0.24));
  --sc-glow: 230, 180, 120;
}
:root {
  --sc-e1: cubic-bezier(0.32,0.72,0,1);
  --sc-e2: cubic-bezier(0.34,1.56,0.64,1);
  --sc-e-hero: cubic-bezier(0.16,1,0.3,1);
}

/* ============================================================
   ANIMATED HERO — shared shell (both sites use .sc-hero)
   ============================================================ */
.sc-hero { position: relative; min-height: 100svh; display: flex; align-items: center; isolation: isolate; overflow: hidden; }
.sc-hero__layer { position: absolute; inset: 0; z-index: -3; overflow: hidden; }
.sc-hero__img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.sc-hero__canvas { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; pointer-events: none; }
.sc-hero__canvas--interactive { pointer-events: auto; touch-action: pan-y; }
.sc-hero__scrim { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.sc-hero__layer { pointer-events: none; }
/* video hero: always fully cover the box (no letterbox, no gap), framed to keep the house */
.sc-hero__video { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 100%; min-height: 100%; object-fit: cover; object-position: center 45%; background: #0c160e; }
@media (min-width: 1024px) {
  .sc-hero { height: 100svh; }
  .sc-hero__video { object-position: center 40%; }
}

/* hero mount: copy fades up, staggered */
.sc-hero__copy > * { opacity: 0; animation: scRise 0.95s var(--sc-e-hero) both; }
.sc-hero__copy > *:nth-child(1) { animation-delay: 0.15s; }
.sc-hero__copy > *:nth-child(2) { animation-delay: 0.32s; }
.sc-hero__copy > *:nth-child(3) { animation-delay: 0.49s; }
.sc-hero__copy > *:nth-child(4) { animation-delay: 0.66s; }
.sc-hero__copy > *:nth-child(5) { animation-delay: 0.83s; }
@keyframes scRise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* hero hint chip (e.g. "Touch the paint") */
.sc-hint { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sc-brass); border: 1px solid var(--sc-line); border-radius: 999px; padding: 7px 14px; background: rgba(0,0,0,0.18); backdrop-filter: blur(6px); }
.sc-hint .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--sc-brass); box-shadow: 0 0 0 0 rgba(var(--sc-glow),0.7); animation: scPulse 2s infinite; }
@keyframes scPulse { 0% { box-shadow: 0 0 0 0 rgba(var(--sc-glow),0.6); } 70% { box-shadow: 0 0 0 10px rgba(var(--sc-glow),0); } 100% { box-shadow: 0 0 0 0 rgba(var(--sc-glow),0); } }

/* SCOTT'S dusk hero: warm glow nodes over the real fixtures */
.sc-glow-node { position: absolute; z-index: -2; width: var(--r, 26%); aspect-ratio: 1; left: var(--x, 50%); top: var(--y, 60%); translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(var(--sc-glow), 0.55) 0%, rgba(var(--sc-glow), 0.16) 38%, transparent 68%);
  mix-blend-mode: screen; opacity: 0; animation: scGlowOn 1.1s var(--sc-e-hero) both var(--delay, 0s), scFlicker 6s ease-in-out infinite calc(var(--delay,0s) + 1.4s); }
@keyframes scGlowOn { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }
@keyframes scFlicker { 0%,100% { opacity: 0.82; } 45% { opacity: 1; } 70% { opacity: 0.9; } }
/* dusk grade that eases away on load ("night lifts") */
.sc-dusk { position: absolute; inset: 0; z-index: -2; pointer-events: none; mix-blend-mode: multiply;
  background: linear-gradient(180deg, rgba(10,18,30,0.85), rgba(8,14,22,0.5) 60%, rgba(8,12,18,0.7));
  animation: scDuskLift 2.2s var(--sc-e-hero) both; }
@keyframes scDuskLift { from { opacity: 1; } to { opacity: 0.32; } }

/* REAL DEAL: slow specular "light raking the finish" sweep */
.sc-sweep { position: absolute; inset: 0; z-index: -2; pointer-events: none; mix-blend-mode: overlay;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,0.08) 47%, rgba(255,238,205,0.20) 50%, rgba(255,255,255,0.08) 53%, transparent 62%);
  background-size: 250% 100%; animation: scSweep 7s linear infinite; }
@keyframes scSweep { from { background-position: 135% 0; } to { background-position: -35% 0; } }
@media (prefers-reduced-motion: reduce) { .sc-sweep { animation: none; opacity: 0.4; } }

/* ============================================================
   BEFORE/AFTER COMPARE SLIDER
   ============================================================ */
.sc-compare-section { padding: clamp(80px, 11vw, 170px) 0; }
.sc-compare { position: relative; width: 100%; max-width: 1040px; margin: 0 auto; aspect-ratio: 16/10; border-radius: var(--r-lg, 18px); overflow: hidden; border: 1px solid var(--sc-line); box-shadow: 0 40px 90px -40px rgba(0,0,0,0.7); user-select: none; touch-action: pan-y; cursor: ew-resize; background: var(--sc-surface); }
.sc-compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.sc-compare__after { z-index: 1; }
.sc-compare__before { z-index: 2; clip-path: inset(0 calc(100% - var(--sc-pos, 50%)) 0 0); }
.sc-compare__label { position: absolute; bottom: 16px; z-index: 3; font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; background: rgba(8,8,8,0.62); border: 1px solid rgba(255,255,255,0.16); border-radius: 999px; padding: 7px 13px; }
.sc-compare__label--before { left: 16px; }
.sc-compare__label--after { right: 16px; }
.sc-compare__handle { position: absolute; top: 0; bottom: 0; left: var(--sc-pos, 50%); z-index: 4; width: 2px; background: var(--sc-brass); transform: translateX(-1px); box-shadow: 0 0 18px rgba(var(--sc-glow),0.5); }
.sc-compare__grip { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 50px; height: 50px; border-radius: 50%; background: var(--sc-brass); color: #1a1206; display: grid; place-items: center; box-shadow: 0 8px 24px -6px rgba(0,0,0,0.6); }
.sc-compare__grip svg { width: 22px; height: 22px; }
.sc-compare__cap { display: block; text-align: center; margin-top: 20px; font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sc-ink-soft); }

/* ============================================================
   COUNT-UP STAT STRIP + GLOSS METER
   ============================================================ */
.sc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.sc-stat { position: relative; padding-top: 18px; border-top: 1px solid var(--sc-line); }
.sc-stat__num { font-family: var(--font-display, Fraunces, Georgia, serif); font-weight: 600; font-size: clamp(2.4rem, 5vw, 3.7rem); line-height: 1; color: var(--sc-ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; }
.sc-stat__num .suf { font-size: 0.5em; color: var(--sc-brass); margin-left: 2px; font-style: italic; }
.sc-stat__label { margin-top: 12px; font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--sc-ink-soft); }
.sc-stat::after { content: ""; position: absolute; top: -1px; left: 0; height: 2px; width: 0; background: var(--sc-brass); transition: width 1s var(--sc-e1) 0.2s; }
.sc-stat.in::after { width: 44px; }

.sc-meter { margin-top: 44px; max-width: 720px; }
.sc-meter__row { display: flex; justify-content: space-between; font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--sc-ink-soft); margin-bottom: 12px; }
.sc-meter__row b { color: var(--sc-ink); }
.sc-meter__track { height: 12px; border-radius: 999px; background: var(--sc-surface); border: 1px solid var(--sc-line); overflow: hidden; }
.sc-meter__fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--sc-brass), var(--sc-accent-bright)); transform-origin: left; transition: width 1.5s var(--sc-e1); box-shadow: 0 0 18px rgba(var(--sc-glow),0.4); }

/* ============================================================
   MAGNETIC BUTTONS + SPOTLIGHT CURSOR (desktop only)
   ============================================================ */
.sc-cursor { position: fixed; top: 0; left: 0; z-index: 9; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--sc-brass); pointer-events: none; transform: translate(-50%, -50%); transition: width 0.3s var(--sc-e1), height 0.3s var(--sc-e1), background 0.3s var(--sc-e1), opacity 0.3s; opacity: 0; mix-blend-mode: difference; }
.sc-cursor.on { opacity: 0.9; }
.sc-cursor.hot { width: 54px; height: 54px; background: rgba(255,255,255,0.08); }
@media (pointer: coarse) { .sc-cursor { display: none; } }

/* ============================================================
   REVEAL polish (data-delay stagger) — works with each site's .reveal
   ============================================================ */
.reveal[data-delay] { transition-delay: calc(var(--d, 0) * 1ms); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 760px) {
  .sc-stats { grid-template-columns: repeat(2, 1fr); gap: 22px 18px; }
  .sc-compare { aspect-ratio: 4/5; cursor: default; }
  .sc-compare__grip { width: 56px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .sc-hero__copy > *, .sc-glow-node, .sc-dusk { animation: none !important; opacity: 1 !important; }
  .sc-hint .pulse { animation: none; }
  .sc-hero__img { transform: none !important; }
}

/* ============================================================
   TRUST-STRIP count-up pop (Scott's) — non-numeric tiles scale in
   ============================================================ */
.trust-num--pop { display: inline-block; animation: scPop 0.7s var(--sc-e2) both 0.25s; }
@keyframes scPop { from { opacity: 0; transform: scale(0.6) translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .trust-num--pop { animation: none; } }

/* ============================================================
   PREMIUM BUTTONS — upgrade Scott's flat fills to glossy + arrow.
   (Real Deal buttons already gradient/arrow/glow — left intact.)
   ============================================================ */
html[data-site="scotts"] .btn { position: relative; overflow: hidden; }
html[data-site="scotts"] .btn-primary {
  box-shadow: 0 1px 0 rgba(255,255,255,0.16) inset, 0 12px 30px -12px rgba(20,44,32,0.55);
  padding-right: 8px;
}
html[data-site="scotts"] .btn-primary::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.20), rgba(255,255,255,0) 48%);
}
html[data-site="scotts"] .btn-primary::after {
  content: "→"; position: relative; z-index: 1; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.20); display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.92rem; transition: transform 0.5s var(--sc-e2), background 0.4s var(--sc-e1);
}
html[data-site="scotts"] .btn-primary > * { position: relative; z-index: 1; }
html[data-site="scotts"] .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,0.24) inset, 0 20px 46px -14px rgba(20,44,32,0.72); }
html[data-site="scotts"] .btn-primary:hover::after { transform: translate(3px,-1px) scale(1.08); background: rgba(255,255,255,0.34); }
html[data-site="scotts"] .btn-sm.btn-primary { padding-right: 6px; }
html[data-site="scotts"] .btn-sm.btn-primary::after { width: 25px; height: 25px; font-size: 0.78rem; }
/* ghost button: accent fill sweeps in on hover */
html[data-site="scotts"] .btn-ghost::before {
  content: ""; position: absolute; inset: 0; z-index: 0; background: rgba(255,255,255,0.18);
  transform: translateX(-101%); transition: transform 0.55s var(--sc-e1);
}
html[data-site="scotts"] .btn-ghost:hover::before { transform: translateX(0); }
html[data-site="scotts"] .btn-ghost { z-index: 0; }
html[data-site="scotts"] .btn-ghost > *, html[data-site="scotts"] .btn-ghost { position: relative; }

/* ============================================================
   CARDSWAP — 3D rotating package carousel (elite-demo inspired)
   ============================================================ */
.sc-cardswap { position: relative; height: clamp(430px, 64vw, 500px); max-width: 470px; margin: 0 auto; perspective: 1600px; }
.sc-card {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: clamp(26px, 3.4vw, 38px); border-radius: var(--r-lg, 20px);
  border: 1px solid var(--sc-line); background: linear-gradient(180deg, var(--sc-surface), color-mix(in srgb, var(--sc-surface) 82%, #000));
  box-shadow: 0 40px 84px -42px rgba(0,0,0,0.85); transform-style: preserve-3d; cursor: pointer; will-change: transform, opacity;
  transition: transform 0.85s var(--sc-e1), opacity 0.85s var(--sc-e1), border-color 0.5s var(--sc-e1), box-shadow 0.5s var(--sc-e1);
}
.sc-card.is-front { border-color: color-mix(in srgb, var(--sc-accent) 55%, var(--sc-line)); box-shadow: 0 54px 110px -42px rgba(0,0,0,0.9), 0 0 0 1px rgba(var(--sc-glow),0.14); }
.sc-card__tier { font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sc-brass); display: flex; align-items: center; gap: 8px; }
.sc-card__name { font-family: var(--font-display, Fraunces, serif); font-weight: 600; font-size: clamp(1.5rem, 2.4vw, 1.95rem); color: var(--sc-ink); margin: 16px 0 0; letter-spacing: -0.01em; }
.sc-card__price { font-family: var(--font-display, Fraunces, serif); font-weight: 600; font-size: clamp(2.3rem, 4.2vw, 3rem); color: var(--sc-ink); line-height: 1; margin: 14px 0 0; letter-spacing: -0.02em; }
.sc-card__price .cur { color: var(--sc-brass); font-size: 0.5em; vertical-align: super; margin-right: 1px; }
.sc-card__price .per { display: block; font-family: var(--font-mono, monospace); font-size: 0.74rem; font-weight: 400; letter-spacing: 0.06em; color: var(--sc-ink-soft); text-transform: uppercase; margin-top: 8px; }
.sc-card__list { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 11px; }
.sc-card__list li { display: flex; gap: 10px; align-items: flex-start; color: var(--sc-ink-soft); font-size: 0.95rem; line-height: 1.42; }
.sc-card__list li::before { content: "✓"; color: var(--sc-brass); font-weight: 700; flex: 0 0 auto; }
.sc-card__cta { margin-top: auto; padding-top: 24px; }
.sc-card__cta .btn { width: 100%; justify-content: center; }
.sc-card__badge { position: absolute; top: 20px; right: 20px; font-family: var(--font-mono, monospace); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sc-on-accent); background: var(--sc-accent); padding: 5px 11px; border-radius: 999px; }
.sc-cardswap__dots { display: flex; gap: 9px; justify-content: center; margin-top: 30px; }
.sc-cardswap__dot { width: 9px; height: 9px; border-radius: 50%; border: 0; background: var(--sc-line); cursor: pointer; padding: 0; transition: background 0.3s, transform 0.3s; }
.sc-cardswap__dot.on { background: var(--sc-brass); transform: scale(1.3); }
.sc-cardswap__dot:hover { background: var(--sc-ink-soft); }
.sc-cardswap__hint { text-align: center; margin-top: 14px; font-family: var(--font-mono, monospace); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sc-ink-soft); }

/* geometric eyebrow marker + live "slot" chip (elite-demo flavor) */
.sc-mark { color: var(--sc-brass); margin-right: 7px; }
.sc-live { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono, monospace); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sc-ink-soft); }
.sc-live .dot { width: 8px; height: 8px; border-radius: 50%; background: #36c46b; box-shadow: 0 0 0 0 rgba(54,196,107,0.6); animation: scPulseGreen 2.2s infinite; }
@keyframes scPulseGreen { 0% { box-shadow: 0 0 0 0 rgba(54,196,107,0.55); } 70% { box-shadow: 0 0 0 9px rgba(54,196,107,0); } 100% { box-shadow: 0 0 0 0 rgba(54,196,107,0); } }

/* hover-reveal on service cards (slide a detail line up on hover) */
.sc-reveal-more { max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.5s var(--sc-e1), opacity 0.45s var(--sc-e1), margin-top 0.5s var(--sc-e1); margin-top: 0; }
.service-card:hover .sc-reveal-more, .sc-hovercard:hover .sc-reveal-more, .sc-hovercard:focus-within .sc-reveal-more { max-height: 90px; opacity: 1; margin-top: 12px; }

@media (max-width: 760px) {
  .sc-cardswap { height: clamp(450px, 118vw, 520px); max-width: 420px; }
  .sc-reveal-more { max-height: 90px; opacity: 1; margin-top: 12px; } /* always shown on touch */
}
@media (prefers-reduced-motion: reduce) {
  .sc-card { transition: opacity 0.4s linear; }
}
