/* ============================================
   WHO WE ARE — ADVANCED MOTION
   Turns the lone spinning cube into an orbital scene: a labelled
   core, tilted orbit rings with travelling dots, orbiting stack
   chips, aurora sweep, perspective floor and drifting sparks.

   assets/js/about-cinematic.js supplies --tilt-x / --tilt-y (pointer)
   and --scrub (scroll position).
   ============================================ */

/* ---------- Stage ---------- */

#about { overflow-x: clip; }

.about-stage {
    position: relative;
    width: min(420px, 88vw);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    perspective: 1000px;
    perspective-origin: 50% 50%;
    transform-style: preserve-3d;
}

/* Whole scene leans toward the pointer. */
.about-stage > * {
    grid-area: 1 / 1;
}

.about-stage .about-animation-box,
.about-stage .about-orbit,
.about-stage .about-chip {
    transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform .5s cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Aurora + glow ---------- */

.about-aurora {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
    background: conic-gradient(
        from 0deg,
        rgba(255, 122, 24, .00),
        rgba(255, 122, 24, .16),
        rgba(255, 200, 55, .22),
        rgba(255, 122, 24, .10),
        rgba(255, 122, 24, .00)
    );
    filter: blur(34px);
    opacity: .8;
    animation: abAurora 14s linear infinite;
}

@keyframes abAurora {
    to { transform: rotate(360deg); }
}

.about-stage .about-glow {
    position: static;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(255, 122, 24, .26), rgba(255, 200, 55, .08) 45%, transparent 72%);
    animation: abPulse 4.5s ease-in-out infinite alternate;
}

@keyframes abPulse {
    0%   { transform: scale(.9);  opacity: .45; }
    100% { transform: scale(1.35); opacity: .95; }
}

/* ---------- Perspective floor ---------- */

.about-floor {
    width: 300px;
    height: 300px;
    pointer-events: none;
    align-self: end;
    transform: rotateX(74deg) translateZ(-70px);
    background-image:
        linear-gradient(rgba(255, 122, 24, .16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 122, 24, .16) 1px, transparent 1px);
    background-size: 30px 30px;
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 12%, transparent 68%);
    mask-image: radial-gradient(circle at 50% 50%, #000 12%, transparent 68%);
    animation: abFloor 7s linear infinite;
    opacity: .75;
}

@keyframes abFloor {
    to { background-position: 0 30px, 30px 0; }
}

/* ---------- Orbit rings ---------- */

.about-orbit {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(255, 122, 24, .18);
    pointer-events: none;
    transform-style: preserve-3d;
}

.about-orbit::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1px solid transparent;
    border-top-color: rgba(255, 200, 55, .5);
    border-right-color: rgba(255, 122, 24, .28);
}

.orbit-1 { width: 96%; height: 96%; animation: abSpin 16s linear infinite; }
.orbit-2 { width: 74%; height: 74%; animation: abSpin 11s linear infinite reverse; }
.orbit-3 { width: 52%; height: 52%; animation: abSpin 8s  linear infinite; }

@keyframes abSpin {
    to { transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) rotate(360deg); }
}

/* Dot riding each ring. */
.orbit-dot {
    position: absolute;
    top: -4px;
    left: 50%;
    width: 8px;
    height: 8px;
    margin-left: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF7A18, #FFC837);
    box-shadow: 0 0 14px rgba(255, 122, 24, .9), 0 0 30px rgba(255, 200, 55, .5);
}

.orbit-2 .orbit-dot { width: 6px; height: 6px; margin-left: -3px; top: -3px; }
.orbit-3 .orbit-dot { width: 10px; height: 10px; margin-left: -5px; top: -5px; }

/* ---------- The core cube ---------- */

.about-stage .about-animation-box {
    position: relative;
    width: 150px;
    height: 150px;
    perspective: 900px;
    z-index: 2;
}

.about-stage .floating-cube {
    width: 150px;
    height: 150px;
    /* Continuous drift plus a scroll-driven offset from JS. */
    animation: abCube 18s linear infinite;
    transform: rotateX(calc(var(--scrub, 0) * 1deg)) rotateY(calc(var(--scrub, 0) * 1.4deg));
}

@keyframes abCube {
    0%   { transform: rotateX(calc(var(--scrub, 0) * 1deg)) rotateY(calc(var(--scrub, 0) * 1.4deg)) rotateZ(0deg); }
    100% { transform: rotateX(calc(var(--scrub, 0) * 1deg + 360deg)) rotateY(calc(var(--scrub, 0) * 1.4deg + 360deg)) rotateZ(360deg); }
}

.about-stage .cube-face {
    width: 150px;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1.5px solid rgba(255, 122, 24, .5);
    border-radius: 14px;
    background:
        linear-gradient(145deg, rgba(255, 122, 24, .16), rgba(255, 200, 55, .05) 55%, rgba(255, 122, 24, .10));
    box-shadow:
        inset 0 0 30px rgba(255, 122, 24, .16),
        0 0 26px rgba(255, 122, 24, .12);
    backdrop-filter: blur(6px);
    transition: border-color .4s ease, box-shadow .4s ease;
}

/* Faces sit 75px out to match the 150px cube. */
.about-stage .cube-face:nth-child(1) { transform: rotateY(0deg)    translateZ(75px); }
.about-stage .cube-face:nth-child(2) { transform: rotateY(90deg)   translateZ(75px); }
.about-stage .cube-face:nth-child(3) { transform: rotateY(180deg)  translateZ(75px); }
.about-stage .cube-face:nth-child(4) { transform: rotateY(-90deg)  translateZ(75px); }
.about-stage .cube-face:nth-child(5) { transform: rotateX(90deg)   translateZ(75px); }
.about-stage .cube-face:nth-child(6) { transform: rotateX(-90deg)  translateZ(75px); }

/* Only the label content hides on far faces, so nothing reads mirrored
   while the translucent panels still form a cube. */
.about-stage .cube-face i,
.about-stage .cube-face span {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.about-stage .cube-face i {
    font-size: 26px;
    background: linear-gradient(135deg, #FF7A18, #FFC837);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(255, 122, 24, .45));
}

.about-stage .cube-face span {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .62);
}

/* Hover: the cube blows apart, then settles back. */
.about-stage:hover .cube-face { box-shadow: inset 0 0 44px rgba(255, 122, 24, .3), 0 0 46px rgba(255, 122, 24, .26); border-color: rgba(255, 200, 55, .8); }
.about-stage.is-open .cube-face:nth-child(1) { transform: rotateY(0deg)   translateZ(128px); }
.about-stage.is-open .cube-face:nth-child(2) { transform: rotateY(90deg)  translateZ(128px); }
.about-stage.is-open .cube-face:nth-child(3) { transform: rotateY(180deg) translateZ(128px); }
.about-stage.is-open .cube-face:nth-child(4) { transform: rotateY(-90deg) translateZ(128px); }
.about-stage.is-open .cube-face:nth-child(5) { transform: rotateX(90deg)  translateZ(128px); }
.about-stage.is-open .cube-face:nth-child(6) { transform: rotateX(-90deg) translateZ(128px); }

.about-stage .cube-face {
    transition:
        transform .75s cubic-bezier(.34, 1.3, .64, 1),
        border-color .4s ease,
        box-shadow .4s ease;
}

/* ---------- Orbiting stack chips ---------- */

.about-chip {
    position: absolute;
    padding: 5px 13px;
    border-radius: 40px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    color: rgba(255, 255, 255, .82);
    background: rgba(18, 18, 26, .82);
    border: 1px solid rgba(255, 122, 24, .3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
    backdrop-filter: blur(6px);
    z-index: 3;
    /* Placed on a circle by index, then counter-spun so text stays level. */
    animation: abChipOrbit 26s linear infinite;
    animation-delay: calc(var(--a) * -4.33s);
    opacity: 0;
}

.about-stage.is-ready .about-chip { opacity: 1; transition: opacity .6s ease calc(var(--a) * .12s); }

@keyframes abChipOrbit {
    from { transform: rotate(0deg) translateX(158px) rotate(0deg); }
    to   { transform: rotate(360deg) translateX(158px) rotate(-360deg); }
}

.about-stage:hover .about-chip {
    border-color: rgba(255, 200, 55, .6);
    color: #fff;
}

/* ---------- Sparks ---------- */

.about-spark {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #FFC837;
    box-shadow: 0 0 10px rgba(255, 200, 55, .9);
    opacity: 0;
    animation: abSpark 6s ease-in-out infinite;
    animation-delay: calc(var(--s) * -.75s);
    transform: translate(calc(var(--sx, 0) * 1px), calc(var(--sy, 0) * 1px));
}

@keyframes abSpark {
    0%, 100% { opacity: 0; transform: translate(calc(var(--sx, 0) * 1px), calc(var(--sy, 0) * 1px)) scale(.4); }
    35%      { opacity: .95; }
    60%      { opacity: .5; }
    80%      { opacity: 0; transform: translate(calc(var(--sx, 0) * 1px), calc(var(--sy, 0) * 1px - 40px)) scale(1.2); }
}

/* ---------- Text side ---------- */

.about-text h2 .ab-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(110%) rotate(4deg);
}

.about-text h2 .ab-mask {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    padding-bottom: .08em;
}

.about-text.ab-in h2 .ab-word {
    opacity: 1;
    transform: translateY(0) rotate(0);
    transition:
        opacity .6s ease var(--w-delay, 0ms),
        transform .85s cubic-bezier(.16, 1, .3, 1) var(--w-delay, 0ms);
}

/* Gradient sweep across the highlighted words. */
.about-text .highlight {
    background: linear-gradient(100deg, #FF7A18, #FFC837 45%, #FF7A18);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: abSweep 6s ease-in-out infinite;
}

@keyframes abSweep {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* Stats get a filling progress rule. */
.about-stats .stat {
    position: relative;
    padding-bottom: 12px;
}

.about-stats .stat::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0;
    border-radius: 2px;
    background: linear-gradient(90deg, #FF7A18, #FFC837);
    box-shadow: 0 0 12px rgba(255, 122, 24, .5);
    transition: width 1.1s cubic-bezier(.16, 1, .3, 1) var(--bar-delay, 0ms);
}

.about-stats .stat.visible::after { width: 100%; }

.about-stats .stat:hover .stat-number { filter: brightness(1.15); }
.about-stats .stat .stat-number { transition: filter .3s ease; }

/* ---------- Responsive ---------- */

@media (max-width: 992px) {
    .about-stage { width: min(340px, 84vw); }
    .about-stage .about-animation-box,
    .about-stage .floating-cube { width: 120px; height: 120px; }
    .about-stage .cube-face { width: 120px; height: 120px; }
    .about-stage .cube-face:nth-child(1) { transform: rotateY(0deg)   translateZ(60px); }
    .about-stage .cube-face:nth-child(2) { transform: rotateY(90deg)  translateZ(60px); }
    .about-stage .cube-face:nth-child(3) { transform: rotateY(180deg) translateZ(60px); }
    .about-stage .cube-face:nth-child(4) { transform: rotateY(-90deg) translateZ(60px); }
    .about-stage .cube-face:nth-child(5) { transform: rotateX(90deg)  translateZ(60px); }
    .about-stage .cube-face:nth-child(6) { transform: rotateX(-90deg) translateZ(60px); }
    @keyframes abChipOrbit {
        from { transform: rotate(0deg) translateX(98px) rotate(0deg); }
        to   { transform: rotate(360deg) translateX(98px) rotate(-360deg); }
    }
}

@media (max-width: 560px) {
    .about-stage { width: min(290px, 80vw); }
    .about-chip { font-size: 10px; padding: 4px 10px; }
    @keyframes abChipOrbit {
        from { transform: rotate(0deg) translateX(98px) rotate(0deg); }
        to   { transform: rotate(360deg) translateX(98px) rotate(-360deg); }
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .about-aurora,
    .about-stage .about-glow,
    .about-floor,
    .about-orbit,
    .about-stage .floating-cube,
    .about-chip,
    .about-spark,
    .about-text .highlight {
        animation: none !important;
    }

    .about-stage .about-animation-box,
    .about-stage .about-orbit,
    .about-stage .about-chip { transform: none; }

    .about-stage .floating-cube { transform: rotateX(-18deg) rotateY(28deg); }

    .about-stage.is-open .cube-face { transform: none; }
    .about-stage .cube-face:nth-child(1) { transform: rotateY(0deg)   translateZ(75px); }
    .about-stage .cube-face:nth-child(2) { transform: rotateY(90deg)  translateZ(75px); }
    .about-stage .cube-face:nth-child(3) { transform: rotateY(180deg) translateZ(75px); }
    .about-stage .cube-face:nth-child(4) { transform: rotateY(-90deg) translateZ(75px); }
    .about-stage .cube-face:nth-child(5) { transform: rotateX(90deg)  translateZ(75px); }
    .about-stage .cube-face:nth-child(6) { transform: rotateX(-90deg) translateZ(75px); }

    .about-chip { opacity: 1; }
    .about-spark { display: none; }

    .about-text h2 .ab-word { opacity: 1; transform: none; }
    .about-stats .stat::after { transition: none; }
}
