/* Parl Motion System — visual effects live separately from the core layout. */
:root {
  --ease-parl: cubic-bezier(.22, 1, .36, 1);
}

.scroll-progress {
  position: fixed;
  z-index: 1100;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #7962fb, #d4b8ff 60%, #aafbe4);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
  box-shadow: 0 0 16px rgba(183, 156, 255, .65);
}

@media (prefers-reduced-motion: no-preference) {
  /* Choreographed first impression; invisible elements never depend on JS alone. */
  .motion-ready .hero > h1,
  .motion-ready .hero > .hero-copy,
  .motion-ready .hero > .hero-actions,
  .motion-ready .hero > .hero-meta,
  .motion-ready .hero > .hero-visual {
    animation: parl-enter .95s var(--ease-parl) both;
  }
  .motion-ready .hero > h1 { animation-delay: .08s; }
  .motion-ready .hero > .hero-copy { animation-delay: .20s; }
  .motion-ready .hero > .hero-actions { animation-delay: .32s; }
  .motion-ready .hero > .hero-meta { animation-delay: .42s; }
  .motion-ready .hero > .hero-visual { animation-delay: .54s; animation-duration: 1.3s; }

  @keyframes parl-enter {
    from { opacity: 0; transform: translate3d(0, 34px, 0); filter: blur(6px); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
  }

  /* In-view reveals use the independent translate property so hover 3D tilt still works. */
  .motion-ready .motion-reveal {
    opacity: 0;
    translate: 0 40px;
    transition: opacity .9s var(--ease-parl), translate 1s var(--ease-parl);
    transition-delay: var(--reveal-delay, 0ms);
  }
  .motion-ready .motion-reveal.is-visible {
    opacity: 1;
    translate: 0 0;
  }

  .text-gradient {
    background-size: 250% 100%;
    animation: parl-gradient 11s ease-in-out infinite alternate;
  }
  @keyframes parl-gradient {
    0%   { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
  }

  .announcement-spark {
    animation: parl-signal 2.5s ease-in-out infinite;
  }
  @keyframes parl-signal {
    0%, 100% { box-shadow: 0 0 8px rgba(151,246,198,.8), 0 0 0 0 rgba(151,246,198,.3); }
    55% { box-shadow: 0 0 13px rgba(151,246,198,1), 0 0 0 9px rgba(151,246,198,0); }
  }
  .visual-top-glow {
    animation: parl-glow 7s ease-in-out infinite alternate;
  }
  @keyframes parl-glow {
    from { opacity: .6; transform: scale(.9); }
    to   { opacity: 1; transform: scale(1.1); }
  }

  .floating-label-left { animation: parl-float-left 6s ease-in-out infinite; }
  .floating-label-right { animation: parl-float-right 5.4s ease-in-out -2.7s infinite; }
  @keyframes parl-float-left {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -12px, 0); }
  }
  @keyframes parl-float-right {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, 10px, 0); }
  }

  .orbit-one { animation: parl-orbit-one 21s linear infinite; }
  .orbit-two { animation: parl-orbit-two 28s linear infinite reverse; }
  .orbit-three { animation: parl-orbit-three 36s linear infinite; }
  @keyframes parl-orbit-one {
    to { transform: rotateX(61deg) rotate(340deg); }
  }
  @keyframes parl-orbit-two {
    to { transform: rotateX(61deg) rotate(340deg); }
  }
  @keyframes parl-orbit-three {
    to { transform: rotateX(61deg) rotate(340deg); }
  }
  .orb-core { animation: parl-orb 6.5s ease-in-out infinite; }
  @keyframes parl-orb {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-12deg); }
    50%      { transform: translate3d(0, -12px, 0) rotate(-6deg); }
  }
  .download-ring.ring-one { animation: parl-ring 8s linear infinite; }
  .download-ring.ring-two { animation: parl-ring 13s linear infinite reverse; }
  .download-ring.ring-three { animation: parl-ring 19s linear infinite; }
  @keyframes parl-ring {
    50% { transform: rotate(180deg) scale(1.045); border-color: rgba(205,190,255,.36); }
    100% { transform: rotate(360deg) scale(1); }
  }
  .download-p { animation: parl-download-float 6.5s ease-in-out infinite; }
  @keyframes parl-download-float {
    0%, 100% { transform: translateY(0) rotate(-13deg); }
    50% { transform: translateY(-12px) rotate(-9deg); }
  }

  .faq-list details[open] > p { animation: parl-faq-in .45s var(--ease-parl) both; }
  @keyframes parl-faq-in {
    from { opacity: 0; transform: translateY(-9px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .faq-plus { transition: transform .36s var(--ease-parl), color .25s; }
  .faq-list details[open] .faq-plus { transform: rotate(45deg); color: #e8d7ff; }

  .nav-links a { position: relative; }
  .nav-links a::after {
    content: "";
    position: absolute;
    height: 1px;
    bottom: -9px;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #9484ff, #e2c6ff);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .45s var(--ease-parl);
  }
  .nav-links a:hover::after,
  .nav-links a:focus-visible::after { transform: scaleX(1); }

  .gallery-card .gallery-media > .uploaded-preview,
  .gallery-card .gallery-media > .gallery-placeholder {
    transition: transform .85s var(--ease-parl);
  }
  .gallery-card:hover .gallery-media > .uploaded-preview,
  .gallery-card:hover .gallery-media > .gallery-placeholder {
    transform: scale(1.048);
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .preview-frame {
    transform: perspective(1400px) rotateX(var(--hero-tilt-x, 0deg)) rotateY(var(--hero-tilt-y, 0deg));
    transition: transform .32s ease-out;
    will-change: transform;
  }
  .preview-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    background: radial-gradient(350px circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(205,180,255,.15), transparent 70%);
    opacity: .65;
  }

  .feature-card,
  .gallery-card {
    --tilt-x: 0deg;
    --tilt-y: 0deg;
    transform: perspective(1250px) translateY(var(--hover-lift, 0px))
      rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
    transition: transform .3s ease-out, border-color .3s ease-out, box-shadow .3s ease-out;
    transform-style: preserve-3d;
  }
  .feature-card:hover,
  .gallery-card:hover {
    --hover-lift: -5px;
    border-color: rgba(185, 163, 255, .45);
    box-shadow: 0 26px 65px rgba(22, 13, 65, .22);
  }
  .feature-card::after,
  .gallery-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(320px circle at var(--spot-x, 50%) var(--spot-y, 50%),
      rgba(188, 164, 255, .13), transparent 75%);
    opacity: 0;
    transition: opacity .3s ease;
    z-index: 3;
  }
  .feature-card:hover::after,
  .gallery-card:hover::after { opacity: 1; }
  .feature-card .feature-card-content,
  .gallery-card .gallery-info { position: relative; z-index: 4; }

  .button, .nav-cta, .announcement {
    --magnet-x: 0px;
    --magnet-y: 0px;
    --hover-rise: 0px;
    transform: translate3d(var(--magnet-x), calc(var(--magnet-y) + var(--hover-rise)), 0);
    transition: transform .32s var(--ease-parl), background .25s, filter .25s;
  }
  .button:hover, .nav-cta:hover, .announcement:hover { --hover-rise: -3px; }

  /* The native cursor is hidden ONLY after the replacement receives a mouse event. */
  html.has-parl-cursor,
  html.has-parl-cursor body,
  html.has-parl-cursor body * { cursor: none !important; }
  /* The fullscreen gallery dialog is in the browser's top layer; use native
     cursor there so it cannot disappear underneath the modal. */
  html.has-parl-cursor body.dialog-open,
  html.has-parl-cursor body.dialog-open * { cursor: auto !important; }
  html.has-parl-cursor body.dialog-open button { cursor: pointer !important; }

  .parl-cursor-layer {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s ease;
    /* No layout containment: keep the pointer origin fixed to the viewport. */
  }
  .parl-cursor-layer.is-active { opacity: 1; }
  body.dialog-open .parl-cursor-layer { opacity: 0 !important; }

  .parl-cursor-dot,
  .parl-cursor-ring,
  .parl-cursor-trail,
  .parl-cursor-burst {
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
    pointer-events: none;
    border-radius: 50%;
    /* left/top are viewport pixels; translation only centers the shape. */
    transform: translate(-50%, -50%);
  }
  .parl-cursor-dot {
    width: 7px;
    height: 7px;

    z-index: 3;
    background: #f9f6ff;
    box-shadow: 0 0 8px #d5b8ff, 0 0 25px rgba(165, 131, 255, .85);
    transform: translate(-50%, -50%) scale(1);
    transition: transform .18s var(--ease-parl), background .18s ease;
  }
  .parl-cursor-ring {
    width: 36px;
    height: 36px;

    z-index: 2;
    border: 1px solid rgba(194, 172, 255, .63);
    background: rgba(152, 113, 247, .025);
    box-shadow: inset 0 0 18px rgba(158, 119, 255, .06), 0 0 28px rgba(146, 104, 243, .2);
    transform: translate(-50%, -50%) scale(.8);
    transition: transform .28s var(--ease-parl), border-color .22s, background .22s;
  }
  .parl-cursor-trail {
    width: var(--trail-size, 4px);
    height: var(--trail-size, 4px);

    z-index: 1;
    background: #b59aff;
    box-shadow: 0 0 12px #9d79ff;
    opacity: var(--trail-opacity, .2);
  }
  .parl-cursor-layer.is-hovering .parl-cursor-ring {
    transform: translate(-50%, -50%) scale(1.65);
    border-color: rgba(206, 180, 255, .92);
    background: rgba(154, 117, 252, .11);
  }
  .parl-cursor-layer.is-hovering .parl-cursor-dot {
    transform: translate(-50%, -50%) scale(.75);
    background: #fff;
  }
  .parl-cursor-layer.is-pressed .parl-cursor-ring { transform: translate(-50%, -50%) scale(.53); }
  .parl-cursor-layer.is-pressed .parl-cursor-dot { transform: translate(-50%, -50%) scale(1.55); }
  .parl-cursor-burst {
    width: 5px;
    height: 5px;

    background: #d6b7ff;
    box-shadow: 0 0 11px rgba(185, 145, 255, .9);
  }
}

@media (prefers-reduced-motion: reduce), (hover: none), (pointer: coarse) {
  .motion-ready .motion-reveal { opacity: 1 !important; translate: none !important; transition: none !important; }
  .parl-cursor-layer { display: none !important; }
  .scroll-progress { box-shadow: none; }
}

@media (max-width: 760px) {
  .nav-links a::after { display: none; }
}
