/* ==========================================================================
   Tempdrop Guide — premium motion & conversion layer
   Restrained, editorial motion inspired by modern animated component
   libraries: scroll reveals, blur-in headings, shine sweeps, cursor
   spotlights, subtle tilt, counters and an animated temperature curve.

   Rules observed:
   - Every effect is an ENHANCEMENT. Content is fully visible without JS
     (the .js-anim guard is only added by JavaScript).
   - Everything collapses to static under prefers-reduced-motion.
   ========================================================================== */

:root {
  --ease-out-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   1. Reveal on scroll
   ========================================================================== */
.js-anim [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity 0.7s var(--ease-out-soft),
    transform 0.7s var(--ease-out-soft);
  will-change: opacity, transform;
}
.js-anim [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Stagger children inside a group */
.js-anim [data-reveal-group] > * {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition:
    opacity 0.6s var(--ease-out-soft),
    transform 0.6s var(--ease-out-soft);
}
.js-anim [data-reveal-group].is-in > * { opacity: 1; transform: none; }
.js-anim [data-reveal-group].is-in > *:nth-child(1) { transition-delay: 0.04s; }
.js-anim [data-reveal-group].is-in > *:nth-child(2) { transition-delay: 0.10s; }
.js-anim [data-reveal-group].is-in > *:nth-child(3) { transition-delay: 0.16s; }
.js-anim [data-reveal-group].is-in > *:nth-child(4) { transition-delay: 0.22s; }
.js-anim [data-reveal-group].is-in > *:nth-child(5) { transition-delay: 0.28s; }
.js-anim [data-reveal-group].is-in > *:nth-child(6) { transition-delay: 0.34s; }

/* ==========================================================================
   2. Split-text blur-in for hero headings
   ========================================================================== */
.js-anim .split-word {
  display: inline-block;
  opacity: 0;
  filter: blur(8px);
  transform: translate3d(0, 0.4em, 0);
  transition:
    opacity 0.66s var(--ease-out-expo),
    filter 0.66s var(--ease-out-expo),
    transform 0.66s var(--ease-out-expo);
  will-change: opacity, filter, transform;
}
.js-anim .split-ready .split-word { opacity: 1; filter: blur(0); transform: none; }

/* ==========================================================================
   3. Shine sweep on primary CTAs
   ========================================================================== */
.btn-primary,
.btn--primary,
.header-cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.25s var(--ease-out-soft),
    box-shadow 0.25s var(--ease-out-soft),
    background-color 0.2s ease;
}

.btn-primary::after,
.btn--primary::after,
.header-cta::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 55%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.32) 50%,
    transparent 100%
  );
  transform: skewX(-18deg);
  pointer-events: none;
}

.btn-primary:hover::after,
.btn--primary:hover::after,
.header-cta:hover::after {
  animation: cta-shine 0.85s var(--ease-out-soft);
}

@keyframes cta-shine {
  to { left: 140%; }
}

.btn-primary:hover,
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(174, 27, 85, 0.32);
}
.btn-primary:active,
.btn--primary:active { transform: translateY(0); }

/* Gentle attention pulse on the single most important offer button */
.js-anim .offer-card .btn-primary.is-primed,
.js-anim .offer-card .btn--primary.is-primed {
  animation: offer-pulse 2.8s ease-in-out 3;
}
@keyframes offer-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(174, 27, 85, 0.25); }
  50%      { box-shadow: 0 6px 26px rgba(174, 27, 85, 0.5); }
}

/* ==========================================================================
   4. Cursor spotlight on grouped cards
   ========================================================================== */
.card,
.related-card,
.offer-card {
  position: relative;
  transition:
    transform 0.3s var(--ease-out-soft),
    box-shadow 0.3s var(--ease-out-soft),
    border-color 0.25s ease;
}

.js-anim [data-spotlight]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 0%),
    rgba(174, 27, 85, 0.10),
    transparent 62%
  );
}
.js-anim [data-spotlight]:hover::before { opacity: 1; }

/* Teal spotlight for research surfaces keeps the colour language intact */
.js-anim .card-research[data-spotlight]::before,
.js-anim .card--research[data-spotlight]::before {
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 0%),
    rgba(15, 96, 101, 0.12),
    transparent 62%
  );
}

/* ==========================================================================
   5. Related-guide lift + tilt
   ========================================================================== */
.related-card {
  transform-style: preserve-3d;
  will-change: transform;
}
.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(42, 16, 38, 0.14);
  border-color: var(--berry);
}
.related-card .related-title,
.related-card .rc-title {
  transition: color 0.2s ease;
}
.related-card:hover .related-title,
.related-card:hover .rc-title { color: var(--berry-ink); }

/* Arrow affordance */
.related-card .related-title::after,
.related-card .rc-title::after {
  content: " \2192";
  display: inline-block;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.22s ease, transform 0.22s var(--ease-out-soft);
}
.related-card:hover .related-title::after,
.related-card:hover .rc-title::after { opacity: 1; transform: translateX(2px); }

/* ==========================================================================
   6. Offer card — animated gradient edge
   ========================================================================== */
.js-anim .offer-card {
  position: relative;
}
.js-anim .offer-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    130deg,
    rgba(174, 27, 85, 0.55),
    rgba(15, 96, 101, 0.35),
    rgba(174, 27, 85, 0.55)
  );
  background-size: 220% 220%;
  animation: edge-drift 9s ease-in-out infinite;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
@keyframes edge-drift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ==========================================================================
   7. Stat / metric counters
   ========================================================================== */
.stat-strip li,
.metric {
  transition:
    transform 0.28s var(--ease-out-soft),
    box-shadow 0.28s var(--ease-out-soft);
}
.stat-strip li:hover,
.metric:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(42, 16, 38, 0.10);
}
.stat-num,
.metric-value {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   8. Reading progress bar
   ========================================================================== */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 100%;
  z-index: 140;
  background: transparent;
  pointer-events: none;
}
.read-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--berry), #FF7FB0);
  box-shadow: 0 0 10px rgba(174, 27, 85, 0.55);
  transition: width 0.12s linear;
}

/* ==========================================================================
   9. Animated hero temperature curve
   ========================================================================== */
.js-anim .hero-motif path,
.js-anim .page-head .hero-motif path {
  stroke-dasharray: 2600;
  stroke-dashoffset: 2600;
  animation: curve-draw 2.6s var(--ease-out-expo) forwards;
}
.js-anim .hero-motif path:nth-child(2) { animation-delay: 0.25s; }
@keyframes curve-draw {
  to { stroke-dashoffset: 0; }
}

/* Slow ambient drift on the hero background */
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 140%;
  background: radial-gradient(
    620px 300px at 20% 10%,
    rgba(255, 159, 194, 0.16),
    transparent 60%
  );
  pointer-events: none;
}
.js-anim .hero::before { animation: ambient-drift 16s ease-in-out infinite alternate; }
@keyframes ambient-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(4%, 2%, 0); }
}

/* ==========================================================================
   10. Publisher / methodology box
   Trust signals from transparent sourcing — no invented person, no portrait.
   ========================================================================== */
.pub-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-top: 3px solid var(--berry);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.4rem 1.4rem 1.25rem;
  margin: 2.5rem 0 0;
}

.pub-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Abstract, non-representational monogram — deliberately not a portrait. */
.pub-mark {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, var(--plum) 0%, var(--plum-deep) 100%);
  border: 1px solid var(--plum-line);
}
.pub-mark svg { width: 100%; height: 100%; display: block; }

.pub-identity-text { min-width: 0; }
.pub-name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--plum-deep);
  margin: 0;
  line-height: 1.3;
}
.pub-role {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate-faint);
  margin: 0.15rem 0 0;
}

.pub-body > :last-child { margin-bottom: 0; }
.pub-body p {
  font-size: 0.9375rem;
  color: var(--slate-soft);
  margin-bottom: 0.7rem;
}

.pub-points {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.pub-points li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.9375rem;
  color: var(--slate-soft);
  margin: 0;
}
.pub-points li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.55em;
  width: 0.6rem;
  height: 0.35rem;
  border-left: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  transform: rotate(-45deg);
}

.pub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin: 1.1rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--slate-faint);
}
.pub-meta strong { color: var(--plum-deep); font-weight: 600; }

@media (min-width: 760px) {
  .pub-box { grid-template-columns: 220px 1fr; gap: 1.6rem; align-items: start; }
  .pub-identity { flex-direction: column; align-items: flex-start; gap: 0.7rem; }
}

/* ==========================================================================
   11. Sticky mobile offer bar (conversion)
   ========================================================================== */
.sticky-offer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 130;
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  background: rgba(42, 16, 38, 0.97);
  border-top: 1px solid var(--plum-line);
  box-shadow: 0 -6px 20px rgba(20, 6, 18, 0.3);
  transform: translateY(110%);
  transition: transform 0.4s var(--ease-out-expo);
}
.sticky-offer.is-up { transform: none; }

.sticky-offer .so-text { min-width: 0; flex: 1 1 auto; }
.sticky-offer .so-label {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #D9BACD;
}
.sticky-offer .so-price {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.25;
}
.sticky-offer .so-price s { color: #C09BB2; font-weight: 500; }
.sticky-offer .btn {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0.55rem 0.95rem;
  font-size: 0.875rem;
}

@media (max-width: 860px) {
  .sticky-offer { display: flex; }
  /* Keep the final CTA clear of the bar */
  body.has-sticky-offer { padding-bottom: 4.25rem; }
}

/* ==========================================================================
   11b. Contrast fix — bold text on dark plum surfaces
   The global rule `strong { color: var(--plum-deep) }` is meant for the light
   article surface. On the dark hero/CTA panels it renders dark-on-dark and the
   emphasised price figures became almost unreadable. Emphasis must stay the
   MOST legible text in a sentence, not the least.
   ========================================================================== */
.hero strong,
.hero-lede strong,
.hero-verdict strong,
.cta-block strong,
.cta-band strong,
.card--decision strong,
.sticky-offer strong {
  color: #FFFFFF;
}

.hero-lede,
.hero-verdict { color: #EFDFE9; }

/* ==========================================================================
   12. Focus, links, table polish
   ========================================================================== */
.article-body a:not(.btn) {
  background-image: linear-gradient(var(--berry), var(--berry));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  text-decoration: none;
  transition: background-size 0.3s var(--ease-out-soft);
}
.article-body a:not(.btn):hover { background-size: 100% 1px; }

tbody tr { transition: background-color 0.18s ease; }
tbody tr:hover td { background: #FBF3F7; }

.faq details.faq-item { transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.faq details.faq-item:hover { border-color: var(--border-strong); }
.faq details.faq-item[open] { box-shadow: var(--shadow-sm); }

/* TOC active marker slide */
.toc a { transition: color 0.2s ease, border-left-color 0.25s ease, padding-left 0.2s ease; }
.toc a.is-active { padding-left: 0.8rem; }

/* ==========================================================================
   13. Reduced motion — everything becomes static and fully visible
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .js-anim [data-reveal],
  .js-anim [data-reveal-group] > *,
  .js-anim .split-word {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    transition: none !important;
  }
  .js-anim .hero-motif path,
  .js-anim .page-head .hero-motif path {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    animation: none;
  }
  .js-anim .hero::before,
  .js-anim .offer-card::after,
  .js-anim .offer-card .btn-primary.is-primed,
  .js-anim .offer-card .btn--primary.is-primed { animation: none; }
  .btn-primary:hover::after,
  .btn--primary:hover::after,
  .header-cta:hover::after { animation: none; }
  .btn-primary:hover,
  .btn--primary:hover,
  .related-card:hover,
  .stat-strip li:hover,
  .metric:hover { transform: none; }
  .read-progress span { transition: none; }
  .sticky-offer { transition: none; }
}

/* ==========================================================================
   14. Print
   ========================================================================== */
@media print {
  .read-progress,
  .sticky-offer { display: none !important; }
  .pub-box { box-shadow: none; border: 1px solid #CCC; }
}
