/* Radiant Map – scroll & load animations
   Place in: static/css/rm-animations.css
   Hidden states only apply once JS has tagged an element with .rm-anim,
   so the page stays fully visible if JS fails. */

:root {
  --rm-ease: cubic-bezier(.22, .8, .24, 1);
  --rm-dur: .75s;
}

/* ---------- Scroll reveal ---------- */
.rm-anim:not(.is-in) { opacity: 0; }

.rm-anim.is-in {
  animation: rm-up var(--rm-dur) var(--rm-ease) var(--rm-delay, 0s) backwards;
}
.rm-anim[data-rm-anim="left"].is-in  { animation-name: rm-left; }
.rm-anim[data-rm-anim="right"].is-in { animation-name: rm-right; }
.rm-anim[data-rm-anim="pop"].is-in   { animation-name: rm-pop; }
.rm-anim[data-rm-anim="fade"].is-in  { animation-name: rm-fade; }

@keyframes rm-up    { from { opacity: 0; transform: translateY(40px); } }
@keyframes rm-left  { from { opacity: 0; transform: translateX(-50px); } }
@keyframes rm-right { from { opacity: 0; transform: translateX(50px); } }
@keyframes rm-pop   { from { opacity: 0; transform: scale(.8); } }
@keyframes rm-fade  { from { opacity: 0; } }

/* ---------- Hero: one orchestrated entrance ---------- */
.rm-hero .rm-hero-inner > *,
.rm-hero .rm-hero-tag {
  animation: rm-up .9s var(--rm-ease) backwards;
}
.rm-hero .rm-hero-inner > :nth-child(1) { animation-delay: .10s; }
.rm-hero .rm-hero-inner > :nth-child(2) { animation-delay: .25s; }
.rm-hero .rm-hero-inner > :nth-child(3) { animation-delay: .40s; }
.rm-hero .rm-hero-inner > :nth-child(4) { animation-delay: .55s; }

.rm-hero .rm-hero-tag:nth-child(1) { animation-delay: .70s; }
.rm-hero .rm-hero-tag:nth-child(2) { animation-delay: .80s; }
.rm-hero .rm-hero-tag:nth-child(3) { animation-delay: .90s; }
.rm-hero .rm-hero-tag:nth-child(4) { animation-delay: 1.00s; }

/* Hero tags float gently after they appear */
.rm-hero .rm-hero-tag {
  animation:
    rm-up .9s var(--rm-ease) backwards,
    rm-float 5s ease-in-out 1.6s infinite;
}
.rm-hero .rm-hero-tag:nth-child(even) {
  animation:
    rm-up .9s var(--rm-ease) backwards,
    rm-float 6s ease-in-out 2s infinite reverse;
}
@keyframes rm-float {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -8px; }
}

/* ---------- Buttons: arrow slides on hover ---------- */
.rm-hero-btn svg,
.rm-services-btn svg,
.rm-cloud-chose__button svg,
.rm-btn svg {
  transition: transform .3s var(--rm-ease);
}
.rm-hero-btn:hover svg,
.rm-services-btn:hover svg,
.rm-cloud-chose__button:hover svg,
.rm-btn:hover svg {
  transform: translateX(6px);
}
.rm-featured-button span,
.rm-cta-btn span {
  display: inline-block;
  transition: transform .3s var(--rm-ease);
}
.rm-featured-button:hover span,
.rm-cta-btn:hover span {
  transform: translateX(6px);
}

/* ---------- Cards: lift on hover ---------- */
.rm-services-card,
.rm-case-card {
  transition: transform .35s var(--rm-ease), box-shadow .35s var(--rm-ease);
}
.rm-services-card:hover,
.rm-case-card:hover {
  transform: translateY(-8px);
}
.rm-services-card-icon,
.rm-case-card__box {
  transition: transform .45s var(--rm-ease);
}
.rm-services-card:hover .rm-services-card-icon,
.rm-case-card:hover .rm-case-card__box {
  transform: scale(1.12) rotate(-4deg);
}

/* ---------- Checklist ticks pop in ---------- */
.rm-cloud-chose__list li.is-in .rm-cloud-chose__check {
  animation: rm-tick .5s var(--rm-ease) calc(var(--rm-delay, 0s) + .2s) backwards;
}
@keyframes rm-tick { from { transform: scale(0) rotate(-90deg); } }

/* ---------- Process: connector lines draw themselves ---------- */
.rm-step-link path {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.rm-step.is-in .rm-step-link path {
  animation: rm-draw 1s ease-out calc(var(--rm-delay, 0s) + .35s) backwards;
}
@keyframes rm-draw { from { stroke-dashoffset: 1; } }

.rm-step.is-in .rm-step-icon {
  animation: rm-pop .6s var(--rm-ease) calc(var(--rm-delay, 0s) + .15s) backwards;
}

/* ---------- Pulse ring on step icons ---------- */
.rm-step-icon { position: relative; }

/* ---------- Reduced motion: switch everything off ---------- */
@media (prefers-reduced-motion: reduce) {
  .rm-anim:not(.is-in) { opacity: 1; }
  .rm-anim, .rm-anim.is-in,
  .rm-hero .rm-hero-inner > *,
  .rm-hero .rm-hero-tag,
  .rm-step.is-in .rm-step-link path,
  .rm-step.is-in .rm-step-icon,
  .rm-cloud-chose__list li.is-in .rm-cloud-chose__check {
    animation: none !important;
  }
}

/* =====================================================
   About / Contact / Portfolio additions
   ===================================================== */

/* Arrows in span-style buttons (Portfolio hero + links) */
.rm-hero-btn span,
.rm-r-portfolio-project-link span {
  display: inline-block;
  transition: transform .3s var(--rm-ease);
}
.rm-hero-btn:hover span,
.rm-r-portfolio-project-link:hover span {
  transform: translateX(6px);
}

/* Portfolio cards: lift + image zoom */
.rm-r-portfolio-card {
  transition: transform .35s var(--rm-ease), box-shadow .35s var(--rm-ease);
}
.rm-r-portfolio-card:hover { transform: translateY(-8px); }
.rm-r-portfolio-media { overflow: hidden; display: block; }
.rm-r-portfolio-image { transition: transform .8s var(--rm-ease); }
.rm-r-portfolio-card:hover .rm-r-portfolio-image { transform: scale(1.06); }

/* About + Contact cards: lift, icon tilt */
.service-card,
.mv-card,
.rm-c-card,
.rm-ux-service-card {
  transition: transform .35s var(--rm-ease), box-shadow .35s var(--rm-ease);
}
.service-card:hover,
.mv-card:hover,
.rm-c-card:hover,
.rm-ux-service-card:hover {
  transform: translateY(-6px);
}
.card-icon,
.mv-icon-box,
.rm-c-icon-box,
.rm-ux-service-icon {
  transition: transform .45s var(--rm-ease);
}
.service-card:hover .card-icon,
.mv-card:hover .mv-icon-box,
.rm-c-card:hover .rm-c-icon-box,
.rm-ux-service-card:hover .rm-ux-service-icon {
  transform: scale(1.12) rotate(-6deg);
}

/* About: "10+ years" badge floats once it has appeared */
.experience-badge.is-in {
  animation:
    rm-pop .7s var(--rm-ease) .3s backwards,
    rm-float 5s ease-in-out 1.2s infinite;
}

/* About: story image zooms slowly on hover */
.image-wrapper { overflow: visible; }
.hero-img { transition: transform .8s var(--rm-ease); }
.image-wrapper:hover .hero-img { transform: scale(1.03); }

/* Contact form: focus ring that grows in */
.contact-form input,
.contact-form select,
.contact-form textarea {
  transition: border-color .25s ease, box-shadow .25s ease;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  box-shadow: 0 0 0 4px rgba(164, 29, 232, .14);
}
.contact-btn { transition: transform .3s var(--rm-ease), box-shadow .3s var(--rm-ease); }
.contact-btn:hover { transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
  .experience-badge.is-in { animation: none !important; }
}

/* =====================================================
   Services page additions
   ===================================================== */
.rm-s-card {
  transition: transform .4s var(--rm-ease), box-shadow .4s var(--rm-ease);
}
.rm-s-card:hover { transform: translateY(-8px); }

/* "Learn More →" arrow slides on hover */
.rm-s-link span {
  display: inline-block;
  transition: transform .3s var(--rm-ease);
}
.rm-s-link:hover span,
.rm-s-card:hover .rm-s-link span {
  transform: translateX(6px);
}

/* Card text rises slightly on hover */
.rm-s-card-content { transition: transform .4s var(--rm-ease); }
.rm-s-card:hover .rm-s-card-content { transform: translateY(-4px); }


/* Radiant Map – fixed header
   Load AFTER your main stylesheet (e.g. after new-style.css)
   so these rules override the existing .rm-header styles. */

:root {
  /* Height of the header. Adjust to match your real header
     (desktop ≈ 76px, mobile ≈ 68px), or let the JS snippet set it. */
  --rm-header-h: 76px;
}

/* ---------- Pin the header ---------- */
header.rm-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .3s ease, border-color .3s ease, background .3s ease;
}

/* Shadow appears once the page has scrolled (your JS adds .rm-scrolled) */
header.rm-header.rm-scrolled {
  background: rgba(255, 255, 255, .97);
  border-bottom-color: rgba(20, 20, 40, .06);
  box-shadow: 0 6px 24px rgba(20, 20, 40, .08);
}

/* ---------- Stop page content hiding behind the header ---------- */
body {
  padding-top: var(--rm-header-h);
}

/* Anchor links (#contact, #rmProcess) stop below the header */
html {
  scroll-padding-top: calc(var(--rm-header-h) + 12px);
}

/* ---------- Mega menu: stays inside the viewport ---------- */
header.rm-header .rm-mega-menu {
  max-height: calc(100vh - var(--rm-header-h) - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ---------- Mobile / tablet menu: scrolls if it is taller than the screen ---------- */
@media (max-width: 1024px) {
  :root { --rm-header-h: 68px; }

  header.rm-header .rm-nav-links.is-open {
    max-height: calc(100vh - var(--rm-header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* ---------- Layering: popup above the header ---------- */
.consultation-popup {
  z-index: 1100;
}

/* ---------- Gentle slide-down on first load ---------- */
@media (prefers-reduced-motion: no-preference) {
  header.rm-header {
    animation: rm-header-in .6s cubic-bezier(.22, .8, .24, 1) backwards;
  }
  @keyframes rm-header-in {
    from { transform: translateY(-100%); opacity: 0; }
  }
}