/* =========================================================
   Raymelz — About page motion
   Hero illustration and the 3D depth-scroll team gallery.
   Loaded only on the About page.
   ========================================================= */

/* ---------- Hero: copy + animated illustration ---------- */
.about-hero { padding: 72px 0 64px; }
.ah-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.ah-visual { width: 100%; max-width: 520px; margin-left: auto; }
.ah-ill { width: 100%; height: auto; overflow: visible; }
.ah-ill * { transform-box: fill-box; }

.js .ah-copy > * { opacity: 0; animation: ahUp .8s cubic-bezier(.2,.7,.2,1) forwards; }
.js .ah-copy > :nth-child(2) { animation-delay: .1s; }
.js .ah-copy > :nth-child(3) { animation-delay: .2s; }
.js .ah-copy > :nth-child(4) { animation-delay: .32s; }
.ah-visual { opacity: 0; animation: ahPop 1s .25s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes ahUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes ahPop { from { opacity: 0; transform: translateY(30px) scale(.95); } to { opacity: 1; transform: none; } }

.ah-glow { transform-origin: center; animation: ahGlow 6s ease-in-out infinite; }
@keyframes ahGlow { 50% { transform: scale(1.08); opacity: .7; } }

.ah-bar { transform-origin: 50% 100%; transform: scaleY(0); animation: ahGrow .8s cubic-bezier(.2,.7,.2,1) forwards; }
.ah-bar:nth-of-type(1) { animation-delay: .7s; } .ah-bar:nth-of-type(2) { animation-delay: .78s; }
.ah-bar:nth-of-type(3) { animation-delay: .86s; } .ah-bar:nth-of-type(4) { animation-delay: .94s; }
.ah-bar:nth-of-type(5) { animation-delay: 1.02s; } .ah-bar:nth-of-type(6) { animation-delay: 1.1s; }
@keyframes ahGrow { to { transform: scaleY(1); } }
.ah-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ahDraw 1.4s 1.2s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes ahDraw { to { stroke-dashoffset: 0; } }
.ah-dot { transform-origin: center; opacity: 0; animation: ahFade .3s 2.5s forwards, ahPulse 2s 2.8s ease-in-out infinite; }
@keyframes ahFade { to { opacity: 1; } }
@keyframes ahPulse { 50% { transform: scale(1.5); } }

.ah-p1 { animation: ahBob 6s ease-in-out infinite; }
.ah-p2 { animation: ahBob 6s 1.5s ease-in-out infinite reverse; }
@keyframes ahBob { 50% { transform: translateY(-6px); } }
.ah-wave { transform-origin: 0% 100%; animation: ahWave 2.4s ease-in-out infinite; }
@keyframes ahWave { 0%, 60%, 100% { transform: rotate(0); } 15%, 45% { transform: rotate(-14deg); } 30% { transform: rotate(8deg); } }
.ah-point { transform-origin: 100% 100%; animation: ahPoint 3s ease-in-out infinite; }
@keyframes ahPoint { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-10deg); } }

.ah-badge { opacity: 0; animation: ahUp .7s cubic-bezier(.2,.7,.2,1) forwards, ahFloat 5s ease-in-out infinite; }
.ah-b1 { animation-delay: 1.4s, 2.1s; }
.ah-b2 { animation-delay: 1.7s, 2.4s; }
.ah-b3 { animation-delay: 2s, 2.7s; }
@keyframes ahFloat { 50% { translate: 0 -8px; } }
.ah-flame { transform-origin: 50% 0; animation: ahFlame .25s ease-in-out infinite alternate; }
@keyframes ahFlame { to { transform: scaleY(1.5); } }
.ah-spark { transform-origin: center; animation: ahTwinkle 2.4s ease-in-out infinite; }
.ah-spark.s2 { animation-delay: 1.2s; }
@keyframes ahTwinkle { 0%, 100% { transform: scale(.4) rotate(0); opacity: .3; } 50% { transform: scale(1.1) rotate(45deg); opacity: 1; } }

/* ---------- "Hand-picked. Battle-tested." team gallery ---------- */
.team-depth { position: relative; color: #fff; padding-top: 90px; overflow: clip;
  background:
    radial-gradient(ellipse 60% 50% at 15% 10%, rgba(0,163,224,.35), transparent 62%),
    radial-gradient(ellipse 55% 50% at 85% 90%, rgba(10,79,214,.5), transparent 60%),
    linear-gradient(160deg, #031538 0%, var(--primary-deep) 55%, #031538 100%); }
.td-head { position: relative; z-index: 5; display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.td-head .eyebrow { color: #a8e4ff; }
.td-tag { margin: 0; font-size: clamp(1.2rem, 2.2vw, 1.9rem); color: #fff; line-height: 1.2; }
.td-title { margin: 0; font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.08; letter-spacing: -.03em; color: #fff; max-width: 640px; }
.td-desc { flex: 0 1 420px; margin: 0; text-align: right; color: #fff; font-size: 1.08rem; }

/* Static layout (default, mobile fallback and reduced motion) */
.td-inner { display: flex; flex-wrap: wrap; justify-content: center; gap: 36px; padding: 48px 16px 96px; }
.td-bg { display: none; }
.td-slide { margin: 0; width: min(320px, 100%); }
.td-cap { padding-bottom: 14px; }
.td-cap strong { display: block; font-size: clamp(1.15rem, 1.7vw, 1.45rem); color: #fff; line-height: 1.25; }
.td-cap span { display: block; margin-top: 4px; font-size: .92rem; font-weight: 600; color: #7fd8ff; }
.td-photo { height: clamp(300px, 34vw, 430px); border-radius: 18px; overflow: hidden; background: #0a2a6e;
  box-shadow: 0 30px 70px rgba(1,10,32,.55), inset 0 0 0 1.5px rgba(255,255,255,.1); }
.td-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }

/* 3D mode: about.js adds .is-3d and sets the outer height */
.is-3d .td-outer { position: relative; }
.is-3d .td-inner { position: sticky; top: 0; display: block; height: 100vh; padding: 0; overflow: hidden; perspective: 750px; }
.is-3d .td-bg { display: block; position: absolute; inset: 0; opacity: .22; pointer-events: none; mix-blend-mode: luminosity;
  -webkit-mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent); mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent); }
.is-3d .td-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(50px); transform: scale(1.15); opacity: 0; transition: opacity 1.2s ease; }
.is-3d .td-bg img.on { opacity: 1; }
.is-3d .td-slide { position: absolute; top: 55%; left: 68%; width: clamp(240px, 26vw, 340px); opacity: 0; will-change: transform, opacity; }
.is-3d .td-slide:nth-of-type(even) { left: 32%; }
.is-3d .td-slide:nth-of-type(odd) .td-cap { text-align: right; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .ah-grid { grid-template-columns: 1fr; gap: 28px; }
  .ah-visual { max-width: 460px; margin: 0 auto; }
  .is-3d .td-slide { left: 62%; }
  .is-3d .td-slide:nth-of-type(even) { left: 38%; }
}
@media (max-width: 640px) {
  .about-hero { padding: 56px 0 48px; }
  .team-depth { padding-top: 64px; }
  .td-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .td-desc { text-align: left; flex-basis: auto; }
  .is-3d .td-slide { left: 58%; width: clamp(200px, 66vw, 300px); }
  .is-3d .td-slide:nth-of-type(even) { left: 42%; }
  .is-3d .td-photo { height: clamp(240px, 78vw, 360px); }
}

@media (prefers-reduced-motion: reduce) {
  .js .ah-copy > *, .ah-visual, .ah-badge, .ah-dot { opacity: 1 !important; transform: none !important; }
  .ah-bar { transform: none !important; }
  .ah-line { stroke-dashoffset: 0 !important; }
}

/* Phones: the two team photos side by side, no 3D scroll */
@media (max-width: 640px) {
  .td-inner { gap: 12px; padding: 28px 16px 56px; flex-wrap: nowrap; align-items: flex-start; }
  .td-slide { width: calc(50% - 7px); }
  .td-photo { height: 230px; border-radius: 14px; }
  .td-cap { padding-bottom: 10px; min-height: 80px; }
  .td-cap strong { font-size: 1rem; }
  .td-cap span { font-size: .78rem; }
}
