/* =====================================================
   FONTS
===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@1,400&display=swap');

/* =====================================================
   ROOT VARIABLES
===================================================== */
:root {
  /* Brand Colors */
  --color-primary: #ff243e;
  --color-primary-dark: #d61e32;
  --color-yellow: #ffe991;
  --color-black: #000000;
  --color-dark: #0b0b10;
  --color-gray: #6b7280;

  /* UI */
  --radius-card: 32px;
  --radius-pill: 999px;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

/* =====================================================
   BASE RESET / GLOBAL
===================================================== */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  background-color: #ffffff;
  color: #000000;
}

::selection {
  background: var(--color-primary);
  color: #ffffff;
}

/* =====================================================
   HEADER (SCROLL STATE)
===================================================== */
.site-header {
  transition: all 0.4s var(--ease-spring);
  background: transparent;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 25px -8px rgba(0, 0, 0, 0.08);
  height: 80px;
}

/* =====================================================
   CARD & SURFACE SYSTEM
===================================================== */
.card-hover {
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s ease;
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.12);
}

/* Premium white surface */
.surface-premium {
  background: linear-gradient(145deg, #ffffff 0%, #f9fafb 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 10px 30px -12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(243, 244, 246, 0.9);
}

/* =====================================================
   SERVICE CARDS
===================================================== */
.service-card-red {
  background: linear-gradient(145deg, #ffffff 0%, #fff5f6 100%);
  border: 1px solid rgba(255, 36, 62, 0.12);
}

.service-card-yellow {
  background: linear-gradient(145deg, #ffffff 0%, #fffcf0 100%);
  border: 1px solid rgba(255, 233, 145, 0.45);
}

.service-card-dark {
  background: linear-gradient(145deg, #1a1a20 0%, #0b0b10 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* =====================================================
   SECTION ALTERNATE BG
===================================================== */
.section-alt {
  background-color: #f8fafc;
  border-top: 1px solid rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

/* =====================================================
   ANIMATIONS
===================================================== */
@keyframes float-tilted {

  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }

  50% {
    transform: translateY(-15px) rotate(-3deg);
  }
}

@keyframes float-straight {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

@keyframes pulse-slow {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.7;
  }
}

.animate-float-1 {
  animation: float-tilted 6s ease-in-out infinite;
}

.animate-float-2 {
  animation: float-straight 7s ease-in-out infinite;
  animation-delay: 1s;
}

.animate-float-3 {
  animation: float-straight 5.5s ease-in-out infinite;
  animation-delay: 0.5s;
}

.animate-pulse-slow {
  animation: pulse-slow 8s ease-in-out infinite;
}

.animate-float-1:hover,
.animate-float-2:hover,
.animate-float-3:hover {
  animation-play-state: paused;
}

/* =====================================================
   INTERACTION UTILS
===================================================== */
.tap-card:active {
  transform: scale(0.97);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* =====================================================
   CTA STRIP
===================================================== */
.cta-strip-bg {
  background: linear-gradient(135deg, var(--color-primary) 0%, #b31428 100%);
  position: relative;
  overflow: hidden;
}

.cta-sheen {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.25),
      transparent);
  transform: skewX(-20deg);
  animation: sheen 3.5s infinite;
  pointer-events: none;
}

@keyframes sheen {
  0% {
    left: -100%;
  }

  20% {
    left: 200%;
  }

  100% {
    left: 200%;
  }
}

/* =====================================================
   SCROLL REVEAL
===================================================== */
.reveal-group {
  opacity: 0;
  transform: translateY(20px);
  transition: 0.8s var(--ease-spring);
}

.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-100 {
  transition-delay: 100ms;
}

.delay-200 {
  transition-delay: 200ms;
}

.delay-300 {
  transition-delay: 300ms;
}

/* =====================================================
   FAQ ACCORDION
===================================================== */
.accordion-item {
  transition: border-color 0.3s ease;
}

.accordion-header {
  cursor: pointer;
}

.accordion-icon {
  transition: transform 0.3s ease;
}

/* =====================================================
   FOOTER (CUSTOM REDESIGN)
===================================================== */
footer {
  -webkit-font-smoothing: antialiased;
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 60%;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(to right,
      transparent,
      rgba(255, 36, 62, 0.45),
      transparent);
}

footer h4 {
  letter-spacing: 0.04em;
}

footer a {
  transition: color 0.25s ease;
}

footer a:hover {
  color: #ffffff;
}

/* =====================================================
   MOBILE ADJUSTMENTS
===================================================== */
@media (max-width: 768px) {
  footer {
    padding-top: 5rem;
  }

  footer .grid {
    row-gap: 3rem;
  }
}

/* =====================================================
   Footer CTA Glow
===================================================== */
@keyframes ctaGlowFloat {

  0%,
  100% {
    transform: translate(50%, -50%) scale(1);
    opacity: 0.6;
  }

  50% {
    transform: translate(45%, -55%) scale(1.05);
    opacity: 0.9;
  }
}

.cta-glow {
  animation: ctaGlowFloat 10s ease-in-out infinite;
}

@keyframes textPulse {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

.cta-emphasis {
  animation: textPulse 3.5s ease-in-out infinite;
}

@keyframes arrowCue {

  0%,
  80%,
  100% {
    transform: rotate(-45deg) translate(0, 0);
    opacity: 0.9;
  }

  85% {
    transform: rotate(-45deg) translate(6px, -2px);
    opacity: 1;
  }

  90% {
    transform: rotate(-45deg) translate(0, 0);
  }

  95% {
    transform: rotate(-45deg) translate(6px, -2px);
  }
}

.cta-arrow {
  animation: arrowCue 3.8s ease-in-out infinite;
}

/* Container handles the layout transition */
.card-deck-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  /* Stacked for mobile */
  gap: 1.5rem;
  position: relative;
  transition: all 0.8s var(--ease-spring);
}

@media (min-width: 640px) {
  .card-deck-grid {
    grid-template-columns: repeat(2, 1fr);
    /* 2x2 for Desktop */
  }
}

/* Individual Card Styling */
.value-card {
  padding: 1.5rem;
  border-radius: 24px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: #ffffff;
  opacity: 0;
  transform: translateY(30px) scale(0.9);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
  will-change: transform;
  /* Performance optimization for fast motion */
}

/* Base state when visible */
.is-visible .value-card {
  opacity: 1;
  transform: translateY(0) scale(1) rotate(0deg);
}

.value-card svg {
  overflow: visible !important;
  display: block;
  /* Ensures proper alignment */
}

/* Ensure the icon container doesn't clip its children */
.value-card div.w-12.h-12 {
  overflow: visible !important;
}

/* The Fast Jolt Class (Triggered by JS) */
.jolt-active .value-card {
  animation: fastJolt 1.2s cubic-bezier(0.68, -0.6, 0.32, 1.6) both;
}

/* Individual delays so they don't move at the exact same millisecond */
.jolt-active .value-card:nth-child(1) {
  animation-delay: 0.0s;
}

.jolt-active .value-card:nth-child(2) {
  animation-delay: 0.1s;
}

.jolt-active .value-card:nth-child(3) {
  animation-delay: 0.2s;
}

.jolt-active .value-card:nth-child(4) {
  animation-delay: 0.3s;
}

@keyframes fastJolt {
  0% {
    transform: scale(1) rotate(0deg);
  }

  30% {
    transform: scale(1.1) rotate(3deg);
  }

  /* Expand and twist */
  50% {
    transform: scale(1.1) rotate(-2deg);
  }

  /* Slight counter-twist */
  100% {
    transform: scale(1) rotate(0deg);
  }

  /* Snap back */
}

/* Home Process Animation Cycle */

/* Step 2: Border turns red when dot "arrives" at 1.5s - 3.5s */
@keyframes borderTrigger {

  0%,
  25% {
    border-color: #f3f4f6;
    box-shadow: none;
  }

  /* Gray */
  30%,
  55% {
    border-color: #ff243e;
    box-shadow: 0 20px 40px -12px rgba(255, 36, 62, 0.2);
  }

  /* Red Active */
  70%,
  100% {
    border-color: #f3f4f6;
    box-shadow: none;
  }
}

/* Step 3: Card glows when dot "finishes" at 4s - 5s */
@keyframes successGlow {

  0%,
  65% {
    border-color: #f3f4f6;
    box-shadow: none;
    transform: scale(1);
  }

  85% {
    border-color: #ff243e;
    box-shadow: 0 20px 40px -12px rgba(255, 36, 62, 0.2);
    transform: scale(1.02);
  }

  100% {
    border-color: #f3f4f6;
    box-shadow: none;
    transform: scale(1);
  }
}

#pipeline-step-2 {
  animation: borderTrigger 5s infinite;
}

#pipeline-step-3 {
  animation: successGlow 5s infinite;
}

/* Dot Shadow */
#pipeline-dot {
  filter: drop-shadow(0 0 4px rgba(255, 36, 62, 0.8));
}

.pipeline-container svg {
  overflow: visible !important;
}

/* Base hidden states */
.dilemma-card-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.8s var(--ease-spring);
}

.solution-card-main {
  opacity: 0;
  transform: scale(0.9);
  transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animation trigger (When the parent div gets .is-visible from main.js) */
.is-visible .dilemma-card-left {
  opacity: 1;
  transform: translateX(0);
}

.is-visible .solution-card-main {
  opacity: 1;
  transform: scale(1);
}

/* Continuous Shimmer on the Yellow Headline */
.solution-card-main h3 {
  background: linear-gradient(90deg, #ffe991, #fff, #ffe991);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShine 4s linear infinite;
}

@keyframes textShine {
  to {
    background-position: 200% center;
  }
}

/* Fallback: ensure visibility if intersection observer doesn't fire */
@media (prefers-reduced-motion: reduce) {

  .dilemma-card-left,
  .solution-card-main {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Works page mockup */
/* Container provides the canvas */
.square-mockup-container {
  aspect-ratio: 1 / 1;
  background: linear-gradient(145deg, #f8fafc 0%, #eff6ff 100%);
  /* Subtle blue-slate tint */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  /* Increased padding to create the 'blank space' look you want */
  position: relative;
  overflow: hidden;
}

/* The Mockup Asset */
.square-mockup-container img {
  width: 100%;
  height: auto;
  object-fit: contain;
  /* This shadow creates the 'floating' depth that removes the square harshness */
  filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.12));
  transition: all 0.6s var(--ease-spring);
  border-radius: 20px 20px 0 0;
  /* Micro-radius for the 'screen' look */
}

#ai-ads video {
  /* Ensures the portrait video doesn't distort */
  aspect-ratio: 9 / 16;
  background-color: #000;
  will-change: transform;
  /* Smooth scaling on hover */
  transition: transform 0.6s var(--ease-spring);
}

#ai-ads .group:hover video {
  transform: scale(1.05);
}

/* The 'Spec Canvas' - Unique to Wellspecced */
.brand-canvas {
    background: #ffffff;
    border-radius: 48px;
    border: 1px solid #f1f5f9;
    padding: 24px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1); /* Professional ease-out */
    position: relative;
    overflow: hidden;
}

/* Internal Logo Container */
.brand-canvas .logo-vault {
    aspect-ratio: 1 / 1;
    background: #f8fafc; /* Subtle contrast */
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px; /* High padding for 'Luxury Fill' */
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); /* Spring effect */
}

.brand-canvas .logo-vault img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 20px;
}

/* Hover States */
.brand-canvas:hover {
    border-color: #ff243e33; /* Soft brand red tint */
    box-shadow: 0 40px 80px -20px rgba(11, 11, 16, 0.08);
    transform: translateY(-4px);
}

.brand-canvas:hover .logo-vault {
    background: #ffffff;
    transform: scale(1.02);
}