/* ============================================
   ANIMATIONS — Med4You landing
   Dodany blok: scroll-reveal, hover micro,
   parallax, marquee, counters, floating, etc.
   ============================================ */

/* ---------- Reveal on scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity .9s cubic-bezier(.2,.7,.2,1),
    transform .9s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.hero[data-reveal], .split-hero[data-reveal] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
[data-reveal="left"]    { transform: translateX(-40px); }
[data-reveal="right"]   { transform: translateX(40px); }
[data-reveal="zoom"]    { transform: scale(.94); }
[data-reveal="blur"]    { filter: blur(8px); }
[data-reveal].in {
  opacity: 1;
  transform: translate(0,0) scale(1);
  filter: blur(0);
}

/* Stagger via inline --i */
[data-reveal] { transition-delay: calc(var(--i, 0) * 80ms); }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
}

/* ---------- Hero entrance ---------- */
@keyframes heroPillIn {
  from { opacity: 0; transform: translateY(-8px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes heroLineIn {
  from { opacity: 0; transform: translateY(40px); clip-path: inset(0 0 100% 0); }
  to   { opacity: 1; transform: translateY(0); clip-path: inset(0 0 0 0); }
}
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero .pill { animation: heroPillIn .7s .1s both cubic-bezier(.2,.7,.2,1); }
.hero h1 {
  animation: heroLineIn 1.1s .25s both cubic-bezier(.2,.7,.2,1);
}
.hero h1 em {
  display: inline-block;
  animation: heroFadeUp .9s .55s both cubic-bezier(.2,.7,.2,1);
}
.hero-sub  { animation: heroFadeUp .9s .65s both cubic-bezier(.2,.7,.2,1); }
.hero-ctas { animation: heroFadeUp .9s .8s both cubic-bezier(.2,.7,.2,1); }
.hero-meta { animation: heroFadeUp .9s .95s both cubic-bezier(.2,.7,.2,1); }

/* ---------- Phone float ---------- */
@keyframes phoneFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-12px) rotate(0.5deg); }
}
@keyframes phoneIn {
  from { opacity: 0; transform: translateY(40px) scale(.92) rotate(-3deg); }
  to   { opacity: 1; transform: translateY(0) scale(1) rotate(-1deg); }
}
.hero .phone {
  animation:
    phoneIn 1.2s .6s both cubic-bezier(.2,.7,.2,1),
    phoneFloat 7s 1.8s infinite ease-in-out;
}
.patient-row .phone, .mockups-band .phone {
  translate: 0 var(--parallax-y, 0);
}

/* ---------- Hero ambient orbs ---------- */
.hero { position: relative; }
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .55;
  pointer-events: none;
  z-index: -1;
  animation: orbDrift 14s ease-in-out infinite;
}
.hero::before {
  top: 8%; right: 30%;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(212,176,122,.5), transparent 70%);
}
.hero::after {
  bottom: 10%; left: 60%;
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(176,132,56,.35), transparent 70%);
  animation-delay: -7s;
}
@keyframes orbDrift {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(30px, -20px) scale(1.08); }
  66%      { transform: translate(-20px, 25px) scale(.95); }
}

/* ---------- Buttons hover & click ---------- */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.35), transparent 50%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.btn:hover::after { opacity: 1; }
.btn-primary { transition: transform .15s ease, background .25s ease, box-shadow .25s ease; }
.btn-primary:hover {
  box-shadow: 0 12px 30px -10px rgba(176,132,56,.6), 0 4px 10px -4px rgba(0,0,0,.15);
}
.btn-primary:active { transform: translateY(0) scale(.98); }
.btn .arr { transition: transform .25s ease; display: inline-flex; }
.btn:hover .arr { transform: translateX(4px); }

/* Arrow inside btn-primary, btn-lg specifically */
.btn-lg svg { transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.btn-lg:hover svg { transform: translateX(5px); }

/* ---------- Logo mark spin on hover ---------- */
.logo:hover .logo-mark {
  animation: logoBounce .5s ease;
}
@keyframes logoBounce {
  0%, 100% { transform: rotate(0); }
  50%      { transform: rotate(-8deg) scale(1.05); }
}

/* ---------- Module cards: enhanced hover ---------- */
.module {
  transition:
    transform .35s cubic-bezier(.2,.7,.2,1),
    border-color .25s ease,
    box-shadow .3s ease,
    background .3s ease;
}
.module::before {
  content: "";
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold), var(--gold-deep));
  border-radius: inherit;
  opacity: 0;
  z-index: -1;
  transition: opacity .35s ease;
}
.module::after {
  content: "→";
  position: absolute;
  top: 22px;
  right: 22px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gold-wash);
  color: var(--gold-deep);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 600;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .3s ease, transform .3s ease, background .3s ease;
}
.module:hover {
  transform: translateY(-6px) scale(1.01);
}
.module:hover::after {
  opacity: 1;
  transform: translateX(0);
}
.module:hover .module-icon {
  background: var(--gold);
  color: #fff;
  transform: rotate(-6deg) scale(1.08);
}
.module-icon {
  transition: background .3s ease, color .3s ease, transform .35s cubic-bezier(.2,.7,.2,1);
}

/* ---------- Pillar number flicker ---------- */
.pillar { transition: transform .35s ease, box-shadow .35s ease, border-color .25s ease; }
.pillar:hover {
  transform: translateY(-4px);
  border-color: var(--gold-soft);
  box-shadow: var(--shadow-md);
}
.pillar .pnum {
  transition: color .35s ease, transform .4s cubic-bezier(.2,.7,.2,1);
}
.pillar:hover .pnum {
  color: var(--gold);
  transform: translateX(6px);
}

/* ---------- Feat-grid: spotlight on hover ---------- */
.feat {
  transition: background .3s ease, transform .3s ease;
  overflow: hidden;
}
.feat::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(176,132,56,.18), transparent 70%);
  top: var(--my, 50%);
  left: var(--mx, 50%);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  transition: transform .5s ease, opacity .3s ease;
  opacity: 0;
}
.feat:hover::before {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
.feat-icon {
  transition: transform .35s cubic-bezier(.2,.7,.2,1), color .3s ease;
}
.feat:hover .feat-icon {
  transform: translateY(-3px) rotate(-4deg);
  color: var(--gold);
}

/* ---------- Problem cards animated borders ---------- */
.problem-card {
  transition: background .3s ease, transform .3s ease;
  position: relative;
}
.problem-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gold);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .4s cubic-bezier(.2,.7,.2,1);
}
.problem-card:hover {
  background: var(--surface);
}
.problem-card:hover::before { transform: scaleY(1); }
.problem-card .num {
  transition: transform .4s cubic-bezier(.2,.7,.2,1), color .3s ease;
}
.problem-card:hover .num {
  transform: translateX(4px) scale(1.05);
  color: var(--gold-deep);
}

/* ---------- Marquee strip ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  padding: 22px 0;
  position: relative;
}
.marquee::before, .marquee::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 120px;
  pointer-events: none;
  z-index: 2;
}
.marquee::before { left: 0;  background: linear-gradient(to right, var(--bg), transparent); }
.marquee::after  { right: 0; background: linear-gradient(to left,  var(--bg), transparent); }
.marquee-track {
  display: inline-flex;
  gap: 56px;
  align-items: center;
  white-space: nowrap;
  animation: marqueeRoll 35s linear infinite;
  padding-left: 56px;
}
.marquee-track:hover { animation-play-state: paused; }
@keyframes marqueeRoll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-style: italic;
  color: var(--ink-2);
  font-weight: 400;
}
.marquee-item .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

/* ---------- FAQ open animation ---------- */
.faq-q { transition: color .25s ease; }
.faq-item:hover .faq-q { color: var(--gold-deep); }
.faq-item .faq-q .plus {
  transition: transform .35s cubic-bezier(.2,.7,.2,1), background .3s ease, color .3s ease, border-color .3s ease;
}
.faq-a {
  transition: max-height .45s cubic-bezier(.2,.7,.2,1), margin .3s ease, opacity .35s ease;
  opacity: 0;
}
.faq-item.open .faq-a { opacity: 1; }

/* ---------- Comparison slider in mockup card ---------- */
@keyframes compareAuto {
  0%, 100% { left: 35%; }
  50%      { left: 65%; }
}
.compare-handle.auto {
  animation: compareAuto 5s ease-in-out infinite;
  transition: left .15s ease;
}
.compare-img-after-auto {
  animation: compareClipAuto 5s ease-in-out infinite;
}
@keyframes compareClipAuto {
  0%, 100% { clip-path: inset(0 0 0 35%); }
  50%      { clip-path: inset(0 0 0 65%); }
}

/* ---------- Counters / stats ---------- */
.stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(48px, 6vw, 84px);
  font-weight: 400;
  color: var(--gold-deep);
  line-height: 1;
  letter-spacing: -0.02em;
}

/* ---------- Section header eyebrow draw-in ---------- */
.eyebrow { position: relative; display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before {
  content: "";
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width .9s cubic-bezier(.2,.7,.2,1) .2s;
}
[data-reveal].in .eyebrow::before { width: 30px; }

/* ---------- Phone screen subtle hover ---------- */
.phone {
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.mockups-band .phone:hover {
  transform: translateY(-12px) scale(1.02) !important;
  z-index: 5;
}

/* ---------- Nav links underline ---------- */
.nav-links a {
  position: relative;
  transition: color .25s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- Bell shake ---------- */
@keyframes bellShake {
  0%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(-15deg); }
  20%, 40% { transform: rotate(15deg); }
  50% { transform: rotate(0); }
}
.bell-shake { animation: bellShake 1.4s ease infinite; transform-origin: top center; }

/* ---------- Pulse dot ---------- */
.pill .dot {
  position: relative;
}
.pill .dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: .35;
  animation: pulseRing 1.8s ease-out infinite;
}
@keyframes pulseRing {
  0% { transform: scale(.6); opacity: .6; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ---------- Typing cursor in app mock ---------- */
@keyframes blinkCaret {
  0%, 50%   { opacity: 1; }
  51%, 100% { opacity: 0; }
}
.caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--gold);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blinkCaret 1s steps(1) infinite;
}

/* ---------- Activity card slide-in (hero phone) ---------- */
@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.phone-content .app-card {
  animation: cardSlideUp .6s both cubic-bezier(.2,.7,.2,1);
}
.phone-content .app-card:nth-child(1) { animation-delay: 1.0s; }
.phone-content .app-card:nth-child(2) { animation-delay: 1.15s; }
.phone-content .app-card:nth-child(3) { animation-delay: 1.30s; }
.phone-content .app-card:nth-child(4) { animation-delay: 1.45s; }

/* ---------- Section curtain (split divider) ---------- */
.split-side {
  transition: background .35s ease;
}
.split-side.specialist:hover { background: var(--surface); }
.split-side.patient:hover    { background: var(--gold-pale); }
.split-side h2 .em-anim {
  background: linear-gradient(120deg, var(--gold-deep), var(--gold), var(--gold-deep));
  background-size: 200% 100%;
  background-position: 0% 0%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
  animation: gradientSlide 5s ease-in-out infinite;
}
@keyframes gradientSlide {
  0%, 100% { background-position: 0% 0%; }
  50%      { background-position: 100% 0%; }
}

/* ---------- Final CTA shimmer ---------- */
.cta-final h2 em {
  background: linear-gradient(120deg, var(--gold-deep) 0%, var(--gold) 50%, var(--gold-soft) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientSlide 6s ease-in-out infinite;
}

/* ---------- Phone screens crossfade in showcase ---------- */
.screen-stack {
  position: relative;
}
.screen-stack > .screen-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .8s cubic-bezier(.2,.7,.2,1);
}
.screen-stack > .screen-slide.active {
  opacity: 1;
  position: relative;
}

/* ---------- Showcase phone tilt ---------- */
.mockups-band .phone:nth-child(1) { transform: rotate(-3deg) translateY(0); }
.mockups-band .phone:nth-child(2) { transform: rotate(0deg) translateY(-30px); z-index: 3; }
.mockups-band .phone:nth-child(3) { transform: rotate(3deg) translateY(0); }
@media (max-width: 720px) {
  .mockups-band .phone:nth-child(1),
  .mockups-band .phone:nth-child(2),
  .mockups-band .phone:nth-child(3) { transform: none; }
}

/* ---------- Security ink section bg orbs ---------- */
.section-ink { position: relative; overflow: hidden; }
.section-ink::before {
  content: "";
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(212,176,122,.15), transparent 70%);
  filter: blur(60px);
  border-radius: 50%;
  animation: orbDrift 20s ease-in-out infinite;
  pointer-events: none;
}
.section-ink::after {
  content: "";
  position: absolute;
  bottom: -150px; left: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(176,132,56,.10), transparent 70%);
  filter: blur(80px);
  border-radius: 50%;
  animation: orbDrift 25s ease-in-out infinite reverse;
  pointer-events: none;
}
.section-ink .wrap { position: relative; z-index: 2; }
.sec-card {
  transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .3s ease, background .3s ease;
}
.sec-card:hover {
  transform: translateY(-4px);
  border-color: rgba(212,176,122,.4);
  background: rgba(255,255,255,.05);
}
.sec-card:hover .icon {
  transform: scale(1.1) rotate(-5deg);
}
.sec-card .icon { transition: transform .35s ease; }

/* ---------- Tag/pill hover lift ---------- */
.app-tag, .app-card { transition: transform .25s ease, box-shadow .25s ease; }

/* ---------- Hero patient bullet stagger ---------- */
.split-bullets li {
  opacity: 0;
  transform: translateX(-12px);
  animation: bulletIn .6s both cubic-bezier(.2,.7,.2,1);
}
.split-bullets li:nth-child(1) { animation-delay: .3s; }
.split-bullets li:nth-child(2) { animation-delay: .45s; }
.split-bullets li:nth-child(3) { animation-delay: .6s; }
@keyframes bulletIn {
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- Module icon variants pulse on view ---------- */
[data-reveal].in .module-icon {
  animation: iconPop .8s cubic-bezier(.2,.7,.2,1);
}
@keyframes iconPop {
  0%   { transform: scale(.7) rotate(-10deg); opacity: 0; }
  60%  { transform: scale(1.1) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* ---------- Counters strip ---------- */
.counters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 64px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 720px) {
  .counters { grid-template-columns: repeat(2, 1fr); }
}
.counter {
  padding: 36px 24px;
  text-align: center;
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.counter:last-child { border-right: none; }
@media (max-width: 720px) {
  .counter:nth-child(2) { border-right: none; }
  .counter:nth-child(1), .counter:nth-child(2) { border-bottom: 1px solid var(--border); }
}
.counter:hover { background: var(--surface); }
.counter .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  margin-top: 8px;
}

/* ---------- Smooth scroll ---------- */
html { scroll-behavior: smooth; }

/* ---------- Hero meta items hover ---------- */
.hero-meta-item {
  transition: color .25s ease, transform .25s ease;
}
.hero-meta-item:hover {
  color: var(--ink);
  transform: translateY(-2px);
}

/* ---------- Patient row image float ---------- */
.patient-row .phone {
  animation: phoneFloat 8s ease-in-out infinite;
}
.patient-row.reverse .phone {
  animation-delay: -4s;
}

/* ---------- Patient feat-grid icons spin ---------- */
#features-pat .feat:hover .feat-icon {
  animation: iconSpin .6s ease;
}
@keyframes iconSpin {
  0%, 100% { transform: translateY(-3px) rotate(-4deg); }
  50%      { transform: translateY(-3px) rotate(8deg) scale(1.1); }
}

/* ---------- Section headers em underline draw ---------- */
.section-head h2 em {
  position: relative;
  display: inline-block;
}
.section-head h2 em::after {
  content: "";
  position: absolute;
  left: 0; bottom: 2px;
  width: 100%;
  height: 6px;
  background: var(--gold-pale);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .9s cubic-bezier(.2,.7,.2,1) .3s;
}
[data-reveal].in .section-head h2 em::after { transform: scaleX(1); }

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  z-index: 100;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .1s linear;
  pointer-events: none;
}

/* ---------- Cursor follow accent for hero CTAs ---------- */
.btn-primary { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%); }

/* ---------- Hero phone glow ---------- */
.hero .phone::before {
  content: "";
  position: absolute;
  inset: -30px;
  background: conic-gradient(from 0deg, transparent, rgba(212,176,122,.3), transparent 30%);
  border-radius: 50%;
  filter: blur(40px);
  z-index: -1;
  animation: heroPhoneGlow 8s linear infinite;
  opacity: .6;
}
@keyframes heroPhoneGlow {
  to { transform: rotate(360deg); }
}
