/* ========================================
   PREMIUM MOTION — Planity-inspired premium visual language
   --------------------------------------------
   Usage : premium section headers + animated stat grids + hover glow.
   Compatible with all accents (coral, teal, purple, gold, custom) via var(--accent).
   Constraint : NO scale/zoom on cards/lists/sections (glow/shadow/border-tint only).
   Small icons MAY animate.
   ======================================== */

/* -------------------------------------------
   Section wrapper
   ------------------------------------------- */
.premium-section {
  padding-block: clamp(4rem, 8vw, 8rem);
}

/* -------------------------------------------
   Section header (eyebrow + rule + title)
   ------------------------------------------- */
.premium-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  max-width: 56rem;
}

.premium-header--center {
  margin-inline: auto;
  align-items: center;
  text-align: center;
}

.premium-eyebrow-row {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.premium-header--center .premium-eyebrow-row {
  justify-content: center;
}

.premium-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.premium-rule {
  display: inline-block;
  height: 1px;
  width: 0;
  background: currentColor;
  color: color-mix(in srgb, var(--accent) 60%, transparent);
  transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: width;
}

.premium-rule.is-visible {
  width: 72px;
}

@media (prefers-reduced-motion: reduce) {
  .premium-rule { width: 72px; transition: none; }
}

.premium-title {
  font-family: var(--font-heading, "Poppins", system-ui, sans-serif);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin: 0;
}

.premium-subtitle {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 42rem;
  margin: 0;
}

.premium-header--center .premium-subtitle { margin-inline: auto; }

/* -------------------------------------------
   Stat grid layout
   ------------------------------------------- */
.premium-grid-wrap {
  position: relative;
}

.premium-grid {
  display: grid;
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .premium-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* CTA principal mobile (visible above grid) — Planity pattern */
.premium-lead-cta {
  display: block;
  margin-block: 1rem 1.5rem;
}
@media (min-width: 768px) {
  .premium-lead-cta { display: none; }
}

/* -------------------------------------------
   Stat card
   ------------------------------------------- */
.premium-stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  min-height: clamp(180px, 22vw, 260px);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  transition:
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  /* NO transform transition — strictly no scale on cards */
}

.premium-stat-card:hover,
.premium-stat-card.is-active {
  border-color: color-mix(in srgb, var(--border-default) 50%, var(--accent) 50%);
  background: color-mix(in srgb, var(--bg-surface) 96%, var(--accent) 4%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent),
    0 18px 44px color-mix(in srgb, var(--accent) 16%, transparent);
}

/* Faint decorative corner glow on active */
.premium-stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 85% 15%,
    color-mix(in srgb, var(--accent) 12%, transparent) 0%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.premium-stat-card:hover::after,
.premium-stat-card.is-active::after {
  opacity: 1;
}

.premium-stat-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.premium-stat-number {
  font-family: var(--font-heading, "Poppins", system-ui, sans-serif);
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-stat-card:hover .premium-stat-number,
.premium-stat-card.is-active .premium-stat-number {
  color: var(--accent);
}

.premium-stat-label {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

/* -------------------------------------------
   CTA reveal (hidden → revealed on hover / active)
   ------------------------------------------- */
.premium-reveal-cta {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  align-self: flex-start;
}

.premium-stat-card:hover .premium-reveal-cta,
.premium-stat-card.is-active .premium-reveal-cta,
.premium-stat-card:focus-within .premium-reveal-cta {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .premium-reveal-cta {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

/* On mobile (no hover capability) : always visible on active card */
@media (hover: none) {
  .premium-stat-card.is-active .premium-reveal-cta {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

/* -------------------------------------------
   Nav arrows with SVG progress ring
   ------------------------------------------- */
.premium-nav {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: clamp(1rem, 2vw, 1.5rem);
}

.premium-nav-arrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 9999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.premium-nav-arrow:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.premium-nav-arrow:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.premium-nav-arrow__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.premium-nav-arrow__ring-track {
  fill: none;
  stroke: color-mix(in srgb, var(--border-default) 80%, transparent);
  stroke-width: 1.5;
}

.premium-nav-arrow__ring-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.2s linear;
}

.premium-nav-arrow.is-active .premium-nav-arrow__ring-progress {
  stroke-dashoffset: var(--progress-offset, 0);
}

.premium-nav-arrow__icon {
  width: 24px;
  height: 24px;
  position: relative;
  z-index: 1;
  transition: transform 0.2s ease;
}

.premium-nav-arrow:hover .premium-nav-arrow__icon {
  transform: translateX(2px);
}

.premium-nav-arrow--prev .premium-nav-arrow__icon {
  transform: scaleX(-1);
}
.premium-nav-arrow--prev:hover .premium-nav-arrow__icon {
  transform: scaleX(-1) translateX(2px);
}

@media (prefers-reduced-motion: reduce) {
  .premium-nav-arrow__ring-progress { display: none; }
  .premium-nav-arrow__icon,
  .premium-nav-arrow:hover .premium-nav-arrow__icon { transition: none; }
}

/* -------------------------------------------
   Utility : premium-hover-glow
   Can be added to any .card-like element app-wide
   ------------------------------------------- */
.premium-hover-glow {
  transition:
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-hover-glow:hover {
  border-color: color-mix(in srgb, var(--border-default) 55%, var(--accent) 45%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent),
    0 14px 32px color-mix(in srgb, var(--accent) 12%, transparent);
}

/* -------------------------------------------
   Scroll reveal defaults (paired with animations_controller targets)
   ------------------------------------------- */
.premium-reveal-item {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-reveal-item.is-visible,
.premium-reveal-item.animate-fade-in {
  opacity: 1;
  transform: none;
}

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