/* ============================================================
   ORDA motion layer
   Subtle 3D tilt, living hero, count-ups, map and page motion.
   All content stays visible if animations are unavailable.
   ============================================================ */

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  z-index: 500;
  pointer-events: none;
  background: transparent;
}
.scroll-progress > span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #b58a34, #e2c98f 45%, #2f6b4f);
  box-shadow: 0 0 12px rgba(181, 138, 52, 0.55);
}
body.is-presenting .scroll-progress,
body.motion-reduced .scroll-progress {
  display: none;
}

/* --------------------------------------------------------------- 3D tilt */

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  [data-tilt] {
    transform-style: preserve-3d;
    transition:
      transform 0.2s cubic-bezier(0.22, 0.61, 0.36, 1),
      box-shadow 0.25s ease,
      border-color 0.25s ease;
    will-change: transform;
  }
  [data-tilt].is-tilting {
    transform: perspective(950px) rotateX(var(--tilt-rx, 0deg)) rotateY(var(--tilt-ry, 0deg));
  }
  .orbit-card.is-tilting {
    box-shadow:
      0 2px 0 rgba(255, 255, 255, 0.7) inset,
      0 36px 70px -34px rgba(22, 58, 50, 0.45),
      0 18px 30px -22px rgba(24, 20, 14, 0.32);
  }
  .landing-case.is-tilting {
    box-shadow: 0 30px 55px -38px rgba(24, 20, 14, 0.5);
  }
}

/* ------------------------------------------------------- page transitions */

@keyframes page-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.page-enter {
  animation: page-fade 0.32s ease backwards;
}

/* ------------------------------------------------------------- hero + orbit */

@keyframes hero-line {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0) rotateX(-6deg);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateX(0);
  }
}
@keyframes visual-in {
  from {
    opacity: 0;
    transform: translate3d(0, 22px, 0) rotateY(-5deg) scale(0.965);
  }
  to {
    opacity: 1;
    transform: translate3d(0, var(--scroll-y, 0), 0) rotateY(0) scale(1);
  }
}
@keyframes orbit-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes node-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -4px, 0);
  }
}
@keyframes halo-breathe {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(181, 138, 52, 0.08);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(181, 138, 52, 0.02);
  }
}
@keyframes live-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.14);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(47, 107, 79, 0.04);
  }
}
@keyframes aurora-drift {
  0%,
  100% {
    transform: translate3d(-3%, -2%, 0) scale(1);
  }
  50% {
    transform: translate3d(3%, 2%, 0) scale(1.06);
  }
}

.hero {
  position: relative;
  isolation: isolate;
  perspective: 1200px;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 18%;
  top: -12%;
  width: 72%;
  height: 92%;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 35% 40%, rgba(201, 162, 39, 0.1), transparent 55%),
    radial-gradient(circle at 68% 62%, rgba(47, 107, 79, 0.09), transparent 56%);
  filter: blur(18px);
}
.hero__visual {
  transform: translate3d(0, var(--scroll-y, 0), 0);
  transform-style: preserve-3d;
}
.hero__title-line {
  display: block;
}
.orbit-card {
  transform-style: preserve-3d;
}
.orbit__ring--outer {
  border-top-color: rgba(181, 138, 52, 0.55);
  border-right-color: rgba(181, 138, 52, 0.26);
}
.orbit__ring--inner {
  border-top-color: rgba(181, 138, 52, 0.22);
}
.orbit__node {
  backface-visibility: hidden;
}
.orbit__center {
  backface-visibility: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .hero::before {
    animation: aurora-drift 14s ease-in-out infinite;
  }
  .hero__title > span {
    display: block;
    animation: hero-line 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
  }
  .hero__title > span:nth-child(2) {
    animation-delay: 0.08s;
  }
  .hero__title > span:nth-child(3) {
    animation-delay: 0.16s;
  }
  .hero__eyebrow,
  .hero__lead,
  .hero__actions,
  .hero__proof {
    animation: rise-in 0.65s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
  }
  .hero__lead {
    animation-delay: 0.08s;
  }
  .hero__actions {
    animation-delay: 0.16s;
  }
  .hero__proof {
    animation-delay: 0.24s;
  }
  .hero__visual {
    animation: visual-in 0.95s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
  }
  .orbit__ring--outer {
    animation: orbit-spin 44s linear infinite;
  }
  .orbit__ring--inner {
    animation: orbit-spin 30s linear infinite reverse;
  }
  .orbit__node {
    animation: node-float 6.2s ease-in-out infinite;
  }
  .orbit__node--2 {
    animation-delay: -1.6s;
  }
  .orbit__node--3 {
    animation-delay: -3.1s;
  }
  .orbit__node--4 {
    animation-delay: -4.4s;
  }
  .orbit__center {
    animation: halo-breathe 5.5s ease-in-out infinite;
  }
  .orbit-card__live span {
    animation: live-pulse 2.2s ease-in-out infinite;
  }
  .orbit__person {
    animation: node-float 5.4s ease-in-out infinite;
  }
  .orbit__person--2 {
    animation-delay: -1.4s;
  }
  .orbit__person--3 {
    animation-delay: -2.6s;
  }
  .orbit__person--4 {
    animation-delay: -3.8s;
  }
  .orbit__person--5 {
    animation-delay: -4.7s;
  }
}

/* ------------------------------------------------------------ mission band */

@keyframes mission-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}
@keyframes mission-glow {
  0%,
  100% {
    transform: translate3d(-5%, 0, 0) scale(1);
    opacity: 0.55;
  }
  50% {
    transform: translate3d(5%, -3%, 0) scale(1.08);
    opacity: 0.85;
  }
}
.mission-band {
  position: relative;
  overflow: hidden;
  background-size: 180% 180%;
}
.mission-band::before {
  content: "";
  position: absolute;
  inset: -35%;
  pointer-events: none;
  background: radial-gradient(circle at 55% 45%, rgba(201, 162, 39, 0.14), transparent 45%);
}
.mission-band__inner {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .mission-band {
    animation: mission-shift 18s ease-in-out infinite alternate;
  }
  .mission-band::before {
    animation: mission-glow 13s ease-in-out infinite;
  }
  .mission-band__pillars span {
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  }
  .mission-band__pillars span:hover {
    transform: translateY(-2px);
    border-color: rgba(226, 201, 143, 0.4);
    background: rgba(242, 236, 221, 0.08);
  }
}

/* -------------------------------------------------------- cards / listings */

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}
@keyframes bar-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .landing-person,
  .landing-case,
  .philosophy-card,
  .stat-tile,
  .case-card,
  .people-card,
  .meeting-card,
  .knowledge-card,
  .idea-card,
  .project-card,
  .home-mission,
  .ai-match-card,
  .join-card,
  .gallery-tile,
  .event-card {
    animation: card-rise 0.52s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
  }

  .philosophy-card:nth-child(2),
  .landing-case:nth-child(2),
  .landing-person:nth-child(2),
  .stat-tile:nth-child(2),
  .people-card:nth-child(2),
  .case-card:nth-child(2) {
    animation-delay: 0.06s;
  }
  .philosophy-card:nth-child(3),
  .landing-case:nth-child(3),
  .landing-person:nth-child(3),
  .stat-tile:nth-child(3),
  .people-card:nth-child(3),
  .case-card:nth-child(3) {
    animation-delay: 0.12s;
  }
  .philosophy-card:nth-child(4),
  .landing-person:nth-child(4),
  .stat-tile:nth-child(4),
  .people-card:nth-child(4) {
    animation-delay: 0.18s;
  }
  .stat-tile:nth-child(5),
  .people-card:nth-child(5) {
    animation-delay: 0.24s;
  }

  .philosophy-card {
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  }
  .philosophy-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 40px -34px rgba(24, 20, 14, 0.35);
  }
  .philosophy-card__arrow {
    transition: transform 0.22s ease;
  }
  .philosophy-card:hover .philosophy-card__arrow {
    transform: translateX(3px);
  }

  .landing-case__cta .icon,
  .landing-person__arrow,
  .mini-idea__reactions .icon {
    transition: transform 0.2s ease;
  }
  .landing-case:hover .landing-case__cta .icon,
  .landing-person:hover .landing-person__arrow {
    transform: translateX(3px);
  }

  .landing-stat__value [data-count] {
    display: inline-block;
  }
  .landing-stat__value {
    transition: color 0.25s ease;
  }
  .landing-stat:hover .landing-stat__value {
    color: #e2c98f;
  }
}

/* --------------------------------------------------------------- AI match */

@keyframes ai-orb {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-3px) rotate(3deg);
  }
}
@keyframes ai-intent {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .ai-match-hero__orb {
    animation: ai-orb 5s ease-in-out infinite;
  }
  .ai-match-intent {
    animation: ai-intent 0.35s ease backwards;
  }
  .ai-match-card {
    animation-delay: calc(var(--i, 0) * 65ms);
  }
  .ai-match-score__bar i {
    transform-origin: left center;
    animation: bar-grow 0.8s 0.18s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }
  .ai-draft {
    animation: card-rise 0.32s ease backwards;
  }
  .ai-match-loading__orb {
    animation: ai-orb 3.4s ease-in-out infinite;
  }
  .ai-match-input:focus-within {
    box-shadow: 0 0 0 4px rgba(23, 59, 50, 0.08), 0 8px 22px -18px rgba(29, 41, 35, 0.4);
  }
}

/* ------------------------------------------------------------------ map */

@keyframes map-dash {
  to {
    stroke-dashoffset: -220;
  }
}
@keyframes map-halo {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.06);
  }
}
@keyframes map-center {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(181, 138, 52, 0.1);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(181, 138, 52, 0.02);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .map-orbit {
    stroke-dasharray: 3 9;
    animation: map-dash 34s linear infinite;
  }
  .map-orbit--faint {
    animation-duration: 46s;
  }
  .map-node__halo {
    transform-box: fill-box;
    transform-origin: center;
    animation: map-halo 4.4s ease-in-out infinite;
  }
  .map-node:nth-child(2) .map-node__halo {
    animation-delay: -1.2s;
  }
  .map-node:nth-child(3) .map-node__halo {
    animation-delay: -2.2s;
  }
  .map-node:nth-child(4) .map-node__halo {
    animation-delay: -3.1s;
  }
  .map-center {
    animation: map-center 5s ease-in-out infinite;
  }
  .map-node,
  .map-top-row {
    transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease;
  }
  .map-node:hover {
    transform: translateY(-3px);
    filter: drop-shadow(0 10px 16px rgba(10, 31, 25, 0.18));
  }
  .map-top-row__bar span {
    transform-origin: left center;
    animation: bar-grow 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
  }
}

/* --------------------------------------------------------------- modals */

@keyframes modal-3d-in {
  from {
    opacity: 0;
    transform: translateY(14px) rotateX(2.2deg) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0) scale(1);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .modal__panel {
    transform-style: preserve-3d;
    animation: modal-3d-in 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }
}

/* --------------------------------------------------------- join / profile */

@media (prefers-reduced-motion: no-preference) {
  .join-hero > * {
    animation: rise-in 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
  }
  .join-hero__text {
    animation-delay: 0.06s;
  }
  .join-card {
    animation: card-rise 0.75s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
  }
  .join-mission__grid > div {
    animation: card-rise 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
  }
  .join-mission__grid > div:nth-child(2) {
    animation-delay: 0.08s;
  }
  .join-mission__grid > div:nth-child(3) {
    animation-delay: 0.16s;
  }
  .profile-hero {
    animation: card-rise 0.4s ease backwards;
  }
}

/* ------------------------------------------------------------ presentation */

@keyframes present-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .present-stage {
    animation: present-in 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
  }
  .present-option,
  .present-stat {
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  }
  .present-option:hover {
    transform: translateY(-2px);
  }
}

/* --------------------------------------------------------------- reduced */

@media (prefers-reduced-motion: reduce) {
  .scroll-progress {
    display: none;
  }
  .hero::before,
  .hero__visual,
  .orbit__ring,
  .orbit__node,
  .orbit__person,
  .orbit__center,
  .mission-band,
  .mission-band::before,
  .ai-match-hero__orb,
  .ai-match-score__bar i,
  .map-orbit,
  .map-node__halo,
  .map-center {
    animation: none !important;
    transform: none !important;
  }
}
