/* ============================================================
   ABOUT SECTION — FLIP CARD VERSION
   ============================================================ */

#about {
    position: relative;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    overflow: visible;
    padding: 60px 20px;
    box-sizing: border-box;
    z-index: 0;
    border-radius: 40px 40px 0 0;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
}

#about .parallax-bg {
    position: absolute;
    inset: 0;
    background-image: url('../../assets/background/GGF_Race5.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(0.25) saturate(0.8);
    z-index: 0;
    overflow: hidden;
    border-radius: 40px 40px 0 0;
}

#about .parallax-content {
    position: relative;
    z-index: 2;
    transform: none !important;
    overflow: visible;
    width: 100%;
}

#about::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: 40px 40px 0 0;
}

.about-top-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0, 248, 248, 0.15);
    border-radius: 40px 40px 0 0;
    z-index: 3;
}

#about .gridbox-content-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    box-sizing: border-box;
    overflow: visible;
}

.about-section-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    overflow: visible;
}

/* ── SECTION HEADER ───────────────────────────────────────── */
.about-section-header {
    text-align: center;
    margin-bottom: 25px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    transition-delay: 0.2s;
}

.about-section-header::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon, #00f8f8), transparent);
    margin: 12px auto 0;
    transition: width 0.9s ease;
    transition-delay: 0.8s;
}

#about.is-visible .about-section-header        { opacity: 1; transform: translateY(0); }
#about.is-visible .about-section-header::after { width: 200px; }

/* ── CARDS ROW ────────────────────────────────────────────── */
.cards-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    width: 100%;
    overflow: visible;
}

/* ── FLIP CARD WRAPPER ────────────────────────────────────── */
.card-wrapper {
    flex: 1 1 0;
    min-width: 0;
    max-width: 340px;
    height: 280px;
    perspective: 1000px;
    cursor: pointer;
    overflow: visible;
}

/* ── FLIP INNER — rotates the whole card ─────────────────── */
.flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 560ms cubic-bezier(0.4, 0.2, 0.2, 1);
    opacity: 0;
    transform: translateY(24px);
}

/* flip on wrapper hover */
.card-wrapper:hover .flip-inner {
    transform: rotateY(180deg);
}

/* IS-VISIBLE entrance */
#about.is-visible .flip-inner                                { opacity: 1; transform: translateY(0); }
#about.is-visible .card-wrapper:nth-child(1) .flip-inner    { transition-delay: 0.3s; }
#about.is-visible .card-wrapper:nth-child(2) .flip-inner    { transition-delay: 0.45s; }
#about.is-visible .card-wrapper:nth-child(3) .flip-inner    { transition-delay: 0.6s; }

/* when hovered override entrance transform */
#about.is-visible .card-wrapper:hover .flip-inner {
    transform: rotateY(180deg) !important;
}

/* ── FRONT & BACK FACES ───────────────────────────────────── */
.flip-front,
.flip-back {
    position: absolute;
    inset: 0;
    border-radius: 15px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.4rem;
    box-sizing: border-box;
    overflow: hidden;
}

/* FRONT */
.flip-front {
    background: linear-gradient(
        135deg,
        rgba(10, 18, 22, 0.95),
        rgba(6, 12, 15, 0.88)
    );
    border: 1px solid rgba(0, 248, 248, 0.14);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* BACK — flipped, faces the other way */
.flip-back {
    background: linear-gradient(
        135deg,
        rgba(6, 14, 18, 0.98),
        rgba(4, 10, 13, 0.96)
    );
    border: 1px solid rgba(0, 248, 248, 0.22);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transform: rotateY(180deg);
    justify-content: flex-start;
    overflow-y: auto;
}

/* ── CARD COLOUR VARIANTS ─────────────────────────────────── */
.card-wrapper:nth-child(1) .flip-front { border-color: rgba(0,   248, 248, 0.14); }
.card-wrapper:nth-child(1) .flip-back  { border-color: rgba(0,   248, 248, 0.28); }

.card-wrapper:nth-child(2) .flip-front { border-color: rgba(251, 191,  36, 0.14); }
.card-wrapper:nth-child(2) .flip-back  { border-color: rgba(251, 191,  36, 0.28); }

.card-wrapper:nth-child(3) .flip-front { border-color: rgba(251, 191,  36, 0.14); }
.card-wrapper:nth-child(3) .flip-back  { border-color: rgba(251, 191,  36, 0.28); }

/* hover glow per card */
.card-wrapper:nth-child(1):hover .flip-front {
    border-color: rgba(0, 248, 248, 0.4);
    box-shadow: 0 0 28px rgba(0, 248, 248, 0.12), 0 16px 48px rgba(0,0,0,0.4);
}
.card-wrapper:nth-child(2):hover .flip-front,
.card-wrapper:nth-child(3):hover .flip-front {
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 0 28px rgba(251, 191, 36, 0.12), 0 16px 48px rgba(0,0,0,0.4);
}

/* ── FRONT CONTENT ────────────────────────────────────────── */
.flip-front { text-align: center; }

.front-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 0.75rem;
    background: rgba(0, 248, 248, 0.08);
    border: 2px solid rgba(0, 248, 248, 0.22);
    transition: transform 360ms ease, box-shadow 360ms ease;
}

.front-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--neon, #00f8f8);
}

.card-wrapper:nth-child(2) .front-icon,
.card-wrapper:nth-child(3) .front-icon {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.22);
}
.card-wrapper:nth-child(2) .front-icon svg,
.card-wrapper:nth-child(3) .front-icon svg { stroke: #fbbf24; }

/* icon spins a little on hover */
.card-wrapper:hover .front-icon {
    transform: rotate(15deg) scale(1.1);
    box-shadow: 0 0 18px rgba(0, 248, 248, 0.3);
}
.card-wrapper:nth-child(2):hover .front-icon,
.card-wrapper:nth-child(3):hover .front-icon {
    box-shadow: 0 0 18px rgba(251, 191, 36, 0.3);
}

.front-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    margin: 0 0 0.35rem;
    display: block;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

#about.is-visible .front-title { opacity: 1; transform: translateY(0); }
.card-wrapper:nth-child(1) .front-title { color: var(--neon, #00f8f8); text-shadow: 0 0 10px rgba(0,248,248,0.2);   transition-delay: 0.55s; }
.card-wrapper:nth-child(2) .front-title { color: #fbbf24;              text-shadow: 0 0 10px rgba(251,191,36,0.2);  transition-delay: 0.7s;  }
.card-wrapper:nth-child(3) .front-title { color: #fbbf24;              text-shadow: 0 0 10px rgba(251,191,36,0.2);  transition-delay: 0.85s; }

.front-divider {
    height: 2px;
    margin: 0.3rem auto 0.65rem;
    border-radius: 2px;
    width: 0;
    transition: width 0.8s ease;
}
.card-wrapper:nth-child(1) .front-divider { background: linear-gradient(90deg, var(--neon,#00f8f8), #007c7c); transition-delay: 0.65s; }
.card-wrapper:nth-child(2) .front-divider,
.card-wrapper:nth-child(3) .front-divider { background: linear-gradient(90deg, #fbbf24, #d97706);            transition-delay: 0.8s;  }

#about.is-visible .front-divider { width: 40px; }

.front-description {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--muted, #8a9ba8);
    margin: 0;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
#about.is-visible .front-description { opacity: 1; transform: translateY(0); }
.card-wrapper:nth-child(1) .front-description { transition-delay: 0.72s; }
.card-wrapper:nth-child(2) .front-description { transition-delay: 0.87s; }
.card-wrapper:nth-child(3) .front-description { transition-delay: 1.02s; }

/* Flip hint */
.front-hint {
    position: absolute;
    bottom: 0.7rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.6rem;
    color: var(--muted, #8a9ba8);
    opacity: 0.5;
    white-space: nowrap;
    transition: opacity 200ms ease;
}
.front-hint svg {
    width: 11px;
    height: 11px;
    stroke: var(--muted, #8a9ba8);
    animation: flipHintBounce 1.6s ease-in-out infinite;
}
.card-wrapper:hover .front-hint { opacity: 0; }

@keyframes flipHintBounce {
    0%, 100% { transform: rotateY(0); }
    50%       { transform: rotateY(25deg); }
}

/* ── BACK CONTENT ─────────────────────────────────────────── */
.back-divider-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 0.7rem;
    flex-shrink: 0;
}

.back-divider-line {
    flex: 1;
    height: 1px;
}
.card-wrapper:nth-child(1) .back-divider-line {
    background: linear-gradient(90deg, transparent, var(--neon,#00f8f8), transparent);
}
.card-wrapper:nth-child(2) .back-divider-line,
.card-wrapper:nth-child(3) .back-divider-line {
    background: linear-gradient(90deg, transparent, #fbbf24, transparent);
}

.back-divider-text {
    font-family: 'Orbitron', monospace;
    font-size: 0.46rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    white-space: nowrap;
}
.card-wrapper:nth-child(1) .back-divider-text { color: var(--neon, #00f8f8); }
.card-wrapper:nth-child(2) .back-divider-text,
.card-wrapper:nth-child(3) .back-divider-text { color: #fbbf24; }

/* ── INFO LIST ────────────────────────────────────────────── */
.back-info-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
    width: 100%;
}

.back-info-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.35rem 0.55rem;
    background: rgba(0, 248, 248, 0.04);
    border-left: 2px solid rgba(0, 248, 248, 0.22);
    border-radius: 0 5px 5px 0;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.back-info-item:hover {
    background: rgba(0, 248, 248, 0.09);
    border-left-color: var(--neon, #00f8f8);
    transform: translateX(3px);
}

.card-wrapper:nth-child(2) .back-info-item,
.card-wrapper:nth-child(3) .back-info-item {
    background: rgba(251, 191, 36, 0.04);
    border-left-color: rgba(251, 191, 36, 0.22);
}
.card-wrapper:nth-child(2) .back-info-item:hover,
.card-wrapper:nth-child(3) .back-info-item:hover {
    background: rgba(251, 191, 36, 0.09);
    border-left-color: #fbbf24;
    transform: translateX(3px);
}

.back-info-label {
    font-family: 'Orbitron', monospace;
    font-size: 0.54rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    min-width: 5rem;
    flex-shrink: 0;
    padding-top: 2px;
    color: var(--neon, #00f8f8);
}
.card-wrapper:nth-child(2) .back-info-label,
.card-wrapper:nth-child(3) .back-info-label { color: #fbbf24; }

.back-info-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.76rem;
    line-height: 1.35;
    color: var(--muted, #8a9ba8);
}

/* ── AMBIENT GLOW ─────────────────────────────────────────── */
@keyframes subtleGlowCyan {
    0%, 100% { box-shadow: 0 10px 30px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.05); }
    50%       { box-shadow: 0 10px 30px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.05), 0 0 24px rgba(0,248,248,0.12); }
}
@keyframes subtleGlowGold {
    0%, 100% { box-shadow: 0 10px 30px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.05); }
    50%       { box-shadow: 0 10px 30px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.05), 0 0 24px rgba(251,191,36,0.12); }
}

#about.is-visible .card-wrapper:nth-child(1) .flip-front { animation: subtleGlowCyan 4s ease-in-out infinite; animation-delay: 0.8s; }
#about.is-visible .card-wrapper:nth-child(2) .flip-front { animation: subtleGlowGold 4s ease-in-out infinite; animation-delay: 1.2s; }
#about.is-visible .card-wrapper:nth-child(3) .flip-front { animation: subtleGlowGold 4s ease-in-out infinite; animation-delay: 1.6s; }
.card-wrapper:hover .flip-front { animation: none !important; }

/* ── LIGHT THEME ──────────────────────────────────────────── */
[data-theme="light"] #about { background: #f4f6f8; }
[data-theme="light"] .flip-front {
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(255,255,255,0.92));
    box-shadow: 0 10px 30px rgba(0,0,0,0.07);
}
[data-theme="light"] .flip-back {
    background: linear-gradient(135deg, rgba(255,255,255,0.99), rgba(248,250,252,0.97));
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}
[data-theme="light"] .card-wrapper:nth-child(1) .flip-front { border-color: rgba(0,124,124,0.15); }
[data-theme="light"] .card-wrapper:nth-child(1) .flip-back  { border-color: rgba(0,124,124,0.25); }
[data-theme="light"] .card-wrapper:nth-child(2) .flip-front,
[data-theme="light"] .card-wrapper:nth-child(3) .flip-front { border-color: rgba(217,119,6,0.15); }
[data-theme="light"] .card-wrapper:nth-child(2) .flip-back,
[data-theme="light"] .card-wrapper:nth-child(3) .flip-back  { border-color: rgba(217,119,6,0.25); }

[data-theme="light"] .card-wrapper:nth-child(1) .front-title  { color: var(--accent,#007c7c); text-shadow: none; }
[data-theme="light"] .card-wrapper:nth-child(2) .front-title,
[data-theme="light"] .card-wrapper:nth-child(3) .front-title  { color: #d97706; text-shadow: none; }
[data-theme="light"] .front-description,
[data-theme="light"] .back-info-value                          { color: #5a6a7a; }
[data-theme="light"] .card-wrapper:nth-child(1) .back-info-label { color: var(--accent,#007c7c); }
[data-theme="light"] .card-wrapper:nth-child(2) .back-info-label,
[data-theme="light"] .card-wrapper:nth-child(3) .back-info-label { color: #d97706; }

/* ── RESPONSIVE — TABLET 900px ───────────────────────────── */
@media (max-width: 900px) {
    #about {
        padding: 50px 16px;
        border-radius: 30px 30px 0 0;
    }
    #about .parallax-bg {
        border-radius: 30px 30px 0 0;
    }
    .cards-row {
        gap: 14px;
    }
    .card-wrapper {
        max-width: none;
        height: 260px;
    }
}

/* ── RESPONSIVE — MOBILE 640px ───────────────────────────── */
@media (max-width: 640px) {
    #about {
        padding: 40px 14px;
        border-radius: 24px 24px 0 0;
        /* allow section to grow with stacked cards */
        min-height: unset;
    }

    #about .parallax-bg {
        border-radius: 24px 24px 0 0;
    }

    .about-section-container {
        gap: 16px;
    }

    /* ── Stack cards vertically ── */
    .cards-row {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        width: 100%;
    }

    /* ── Each card: full width, taller so content breathes ── */
    .card-wrapper {
        max-width: 100%;
        width: 100%;
        height: 300px;
        flex: none;
        perspective: 1000px;
    }

    /* ── Flip inner fills wrapper ── */
    .flip-inner {
        width: 100%;
        height: 100%;
    }

    /* ── Front face ── */
    .flip-front {
        padding: 1.6rem 1.4rem 2.4rem;
        justify-content: center;
    }

    .front-icon {
        width: 46px;
        height: 46px;
        margin-bottom: 0.65rem;
        flex-shrink: 0;
    }

    .front-title {
        font-size: 0.95rem;
        margin-bottom: 0.3rem;
    }

    .front-description {
        font-size: 0.76rem;
        line-height: 1.55;
    }

    /* ── Back face: scrollable if content overflows ── */
    .flip-back {
        padding: 1rem 1rem;
        overflow-y: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }

    .back-divider-row {
        margin-bottom: 0.5rem;
    }

    .back-info-list {
        gap: 0.28rem;
    }

    .back-info-item {
        padding: 0.4rem 0.6rem;
        gap: 0.35rem;
    }

    .back-info-label {
        font-size: 0.52rem;
        min-width: 4.5rem;
    }

    .back-info-value {
        font-size: 0.74rem;
        line-height: 1.4;
    }

    /* ── Disable CSS hover-flip on touch — JS .flipped handles it ── */
    .card-wrapper:hover .flip-inner {
        transform: translateY(0) !important;
    }

    /* ── Tapped / flipped state via JS ── */
    .card-wrapper.flipped .flip-inner {
        transform: rotateY(180deg) !important;
    }

    /* ── Keep is-visible entrance working ── */
    #about.is-visible .card-wrapper:not(.flipped):not(:hover) .flip-inner {
        transform: translateY(0) !important;
    }

    /* ── Faster entrance stagger on mobile ── */
    #about.is-visible .card-wrapper:nth-child(1) .flip-inner { transition-delay: 0.1s; }
    #about.is-visible .card-wrapper:nth-child(2) .flip-inner { transition-delay: 0.2s; }
    #about.is-visible .card-wrapper:nth-child(3) .flip-inner { transition-delay: 0.3s; }

    /* Update hint text for touch */
    .front-hint::after {
        content: 'Tap to flip';
    }
}

/* ── RESPONSIVE — SMALL MOBILE 400px ─────────────────────── */
@media (max-width: 400px) {
    #about {
        padding: 30px 10px;
        border-radius: 18px 18px 0 0;
    }

    #about .parallax-bg {
        border-radius: 18px 18px 0 0;
    }

    .card-wrapper {
        height: 280px;
    }

    .flip-front {
        padding: 1.4rem 1rem 2.2rem;
    }

    .front-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 0.55rem;
    }

    .front-icon svg {
        width: 18px;
        height: 18px;
    }

    .front-title {
        font-size: 0.86rem;
    }

    .front-description {
        font-size: 0.72rem;
    }

    .back-info-label {
        font-size: 0.5rem;
        min-width: 4rem;
    }

    .back-info-value {
        font-size: 0.7rem;
    }

    .flip-back {
        padding: 0.85rem 0.85rem;
    }
}

/* ── REDUCED MOTION ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .flip-inner { transition: none !important; animation: none !important; }

    .card-wrapper { height: auto; }
    .flip-inner   { transform-style: flat; }
    .flip-front   { position: relative; transform: none; backface-visibility: visible; }
    .flip-back    {
        position: relative;
        transform: none;
        backface-visibility: visible;
        display: block;
        margin-top: 0.8rem;
        border-radius: 12px;
    }

    .front-title, .front-description { opacity: 1; transform: none; }
    .front-divider { width: 40px; }
    .front-hint { display: none; }
}


/* ============================================================
   ABOUT — ENHANCED SCROLL ANIMATIONS
   ============================================================ */

/* ── 1. SECTION ENTRANCE SWEEP ─────────────────────────────
   Full section slides up from below on scroll enter
   ---------------------------------------------------------- */
#about {
  transform: translateY(30px);
  opacity: 0;
  transition:
    transform 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity   0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#about.is-visible {
  transform: translateY(0);
  opacity: 1;
}

/* ── 2. TOP BORDER DRAW ─────────────────────────────────────
   The .about-top-border line draws left → right on enter
   ---------------------------------------------------------- */
.about-top-border {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transition-delay: 0.3s;
}

#about.is-visible .about-top-border {
  transform: scaleX(1);
}

/* ── 3. SECTION HEADER — UPGRADED ──────────────────────────
   Replaces your plain translateY with a more dramatic
   clip-path reveal + glow pulse on the title
   ---------------------------------------------------------- */
.about-section-header {
  /* override your existing opacity/transform */
  opacity: 0;
  transform: translateY(30px);
  clip-path: inset(0 0 100% 0);
  transition:
    opacity    0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.35s,
    transform  0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.35s,
    clip-path  0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.35s;
}

#about.is-visible .about-section-header {
  opacity: 1;
  transform: translateY(0);
  clip-path: inset(0 0 0% 0);
}

/* Header title glow pulse after reveal */
#about.is-visible .about-section-header h2,
#about.is-visible .about-section-header .section-title {
  animation: headerGlowPulse 3s ease-in-out infinite;
  animation-delay: 1.2s;
}

@keyframes headerGlowPulse {
  0%, 100% { text-shadow: 0 0 20px rgba(0, 248, 248, 0.15); }
  50%       { text-shadow: 0 0 40px rgba(0, 248, 248, 0.45),
                            0 0 80px rgba(0, 248, 248, 0.15); }
}

/* Underline draw — your existing ::after, extended */
.about-section-header::after {
  transition-delay: 1s;
}

/* ── 4. CARDS ROW STAGGER ENTRANCE ──────────────────────────
   Each card sweeps up with scale + opacity staggered
   Works on top of your existing flip-inner transitions
   ---------------------------------------------------------- */
.card-wrapper {
  opacity: 0;
  transform: translateY(50px) scale(0.94);
  transition:
    opacity   0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.65s cubic-bezier(0.68, -0.25, 0.265, 1.25);
}

#about.is-visible .card-wrapper:nth-child(1) {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0.35s;
}
#about.is-visible .card-wrapper:nth-child(2) {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0.52s;
}
#about.is-visible .card-wrapper:nth-child(3) {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0.69s;
}

/* ── 5. CARD HOVER — TILT + LIFT ────────────────────────────
   3D tilt on hover using CSS variables set by JS below
   ---------------------------------------------------------- */
.card-wrapper {
  --rx: 0deg;
  --ry: 0deg;
  transform-style: preserve-3d;
  will-change: transform;
}

/* apply tilt only on non-touch, non-flipped cards */
.card-wrapper.tilt-active {
  transform: rotateX(var(--rx)) rotateY(var(--ry)) translateY(-6px);
  transition:
    transform 0.1s linear,
    box-shadow 0.3s ease;
}

.card-wrapper.tilt-active .flip-front {
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(0, 248, 248, 0.08);
}

.card-wrapper:nth-child(2).tilt-active .flip-front,
.card-wrapper:nth-child(3).tilt-active .flip-front {
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(251, 191, 36, 0.08);
}

/* Reset tilt on mouse leave */
.card-wrapper.tilt-reset {
  transform: rotateX(0deg) rotateY(0deg) translateY(0px);
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── 6. FLIP CARD FACE — SHIMMER ON ENTER ───────────────────
   Gold/teal shimmer sweeps across each card face after appear
   ---------------------------------------------------------- */
.flip-front::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 15px;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 80%
  );
  transform: translateX(-100%);
  pointer-events: none;
  z-index: 3;
}

#about.is-visible .card-wrapper:nth-child(1) .flip-front::before {
  animation: cardShimmer 0.8s ease forwards;
  animation-delay: 0.7s;
}
#about.is-visible .card-wrapper:nth-child(2) .flip-front::before {
  animation: cardShimmer 0.8s ease forwards;
  animation-delay: 0.9s;
}
#about.is-visible .card-wrapper:nth-child(3) .flip-front::before {
  animation: cardShimmer 0.8s ease forwards;
  animation-delay: 1.1s;
}

@keyframes cardShimmer {
  0%   { transform: translateX(-100%); opacity: 1; }
  100% { transform: translateX(100%);  opacity: 1; }
}

/* ── 7. ICON — SPIN IN ON ENTER ─────────────────────────────
   Front icons do a quick spin-scale on section enter
   ---------------------------------------------------------- */
.front-icon {
  transform: scale(0) rotate(-120deg);
  opacity: 0;
  transition:
    transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55),
    opacity   0.4s ease;
}

#about.is-visible .card-wrapper:nth-child(1) .front-icon {
  transform: scale(1) rotate(0deg);
  opacity: 1;
  transition-delay: 0.65s;
}
#about.is-visible .card-wrapper:nth-child(2) .front-icon {
  transform: scale(1) rotate(0deg);
  opacity: 1;
  transition-delay: 0.80s;
}
#about.is-visible .card-wrapper:nth-child(3) .front-icon {
  transform: scale(1) rotate(0deg);
  opacity: 1;
  transition-delay: 0.95s;
}

/* ── 8. BACK INFO LIST — ROW STAGGER ────────────────────────
   Back face list items slide in one by one when flipped
   ---------------------------------------------------------- */
.back-info-item {
  opacity: 0;
  transform: translateX(-12px);
  transition:
    opacity   0.3s ease,
    transform 0.3s ease;
}

/* Trigger when card is hovered/flipped */
.card-wrapper:hover .back-info-item:nth-child(1),
.card-wrapper.flipped .back-info-item:nth-child(1) {
  opacity: 1; transform: translateX(0); transition-delay: 0.22s;
}
.card-wrapper:hover .back-info-item:nth-child(2),
.card-wrapper.flipped .back-info-item:nth-child(2) {
  opacity: 1; transform: translateX(0); transition-delay: 0.30s;
}
.card-wrapper:hover .back-info-item:nth-child(3),
.card-wrapper.flipped .back-info-item:nth-child(3) {
  opacity: 1; transform: translateX(0); transition-delay: 0.38s;
}
.card-wrapper:hover .back-info-item:nth-child(4),
.card-wrapper.flipped .back-info-item:nth-child(4) {
  opacity: 1; transform: translateX(0); transition-delay: 0.46s;
}
.card-wrapper:hover .back-info-item:nth-child(5),
.card-wrapper.flipped .back-info-item:nth-child(5) {
  opacity: 1; transform: translateX(0); transition-delay: 0.54s;
}

/* ── 9. PARALLAX BG — FADE IN ───────────────────────────────
   Background image fades in slowly on section enter
   ---------------------------------------------------------- */
#about .parallax-bg {
  opacity: 0;
  transition: opacity 1.4s ease 0.1s;
}

#about.is-visible .parallax-bg {
  opacity: 1;
}

/* ── 10. SECTION EXIT — FADE BACK ───────────────────────────
   Section dims slightly when scrolled past
   ---------------------------------------------------------- */
#about.section-exit .flip-front {
  opacity: 0.6;
  transition: opacity 0.5s ease;
}

#about.section-exit .about-section-header {
  opacity: 0.4;
  transition: opacity 0.5s ease;
}

/* ── 11. SCROLL-TRIGGERED COUNTER GLOW ─────────────────────
   If you add stat numbers inside cards, they count up with
   a glow effect — hook: [data-count] on any element
   ---------------------------------------------------------- */
[data-count] {
  display: inline-block;
  color: inherit;
  transition: text-shadow 0.4s ease;
}

[data-count].counting {
  text-shadow:
    0 0 20px rgba(0, 248, 248, 0.6),
    0 0 40px rgba(0, 248, 248, 0.3);
}

/* ── 12. REDUCED MOTION — SAFETY OVERRIDE ───────────────────
   All new animations respect prefers-reduced-motion
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  #about,
  .about-top-border,
  .about-section-header,
  .card-wrapper,
  .flip-front::before,
  .front-icon,
  .back-info-item {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
    clip-path: none !important;
  }

  #about.is-visible .about-section-header h2 {
    animation: none !important;
  }
}

/* ============================================================
   CARD SCROLL ENTRANCE ANIMATIONS
   ============================================================ */

/* ── BASE STATE — cards hidden before section enters ─────── */
.card-wrapper {
    opacity: 0;
    transform: translateY(80px) scale(0.85);
    transition:
        opacity   0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, opacity;
}

/* ── CARD 1 — slides up from bottom ─────────────────────── */
#about.is-visible .card-wrapper:nth-child(1) {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.15s;
}

/* ── CARD 2 — slides up slightly later ──────────────────── */
#about.is-visible .card-wrapper:nth-child(2) {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.32s;
}

/* ── CARD 3 — slides up last ────────────────────────────── */
#about.is-visible .card-wrapper:nth-child(3) {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.49s;
}

/* ── CARD GLOW FLASH — fires once after entrance ────────── */
@keyframes cardEntranceGlowCyan {
    0%   { box-shadow: 0 0 0px rgba(0, 248, 248, 0);   }
    40%  { box-shadow: 0 0 40px rgba(0, 248, 248, 0.5),
                       0 0 80px rgba(0, 248, 248, 0.2); }
    100% { box-shadow: 0 0 0px rgba(0, 248, 248, 0);   }
}

@keyframes cardEntranceGlowGold {
    0%   { box-shadow: 0 0 0px rgba(251, 191, 36, 0);   }
    40%  { box-shadow: 0 0 40px rgba(251, 191, 36, 0.5),
                       0 0 80px rgba(251, 191, 36, 0.2); }
    100% { box-shadow: 0 0 0px rgba(251, 191, 36, 0);   }
}

#about.is-visible .card-wrapper:nth-child(1) .flip-front {
    animation: cardEntranceGlowCyan 1s ease forwards;
    animation-delay: 0.75s;
}

#about.is-visible .card-wrapper:nth-child(2) .flip-front {
    animation: cardEntranceGlowGold 1s ease forwards;
    animation-delay: 0.92s;
}

#about.is-visible .card-wrapper:nth-child(3) .flip-front {
    animation: cardEntranceGlowGold 1s ease forwards;
    animation-delay: 1.09s;
}

/* stop glow on hover — let hover styles take over */
.card-wrapper:hover .flip-front {
    animation: none !important;
}

/* ── BORDER TRACE — draws around each card on enter ─────── */
@keyframes borderTraceCyan {
    0%   { border-color: rgba(0, 248, 248, 0);    }
    30%  { border-color: rgba(0, 248, 248, 0.6);  }
    100% { border-color: rgba(0, 248, 248, 0.14); }
}

@keyframes borderTraceGold {
    0%   { border-color: rgba(251, 191, 36, 0);    }
    30%  { border-color: rgba(251, 191, 36, 0.6);  }
    100% { border-color: rgba(251, 191, 36, 0.14); }
}

#about.is-visible .card-wrapper:nth-child(1) .flip-front {
    animation:
        cardEntranceGlowCyan 1s ease forwards 0.75s,
        borderTraceCyan      1.2s ease forwards 0.65s;
}

#about.is-visible .card-wrapper:nth-child(2) .flip-front {
    animation:
        cardEntranceGlowGold 1s ease forwards 0.92s,
        borderTraceGold      1.2s ease forwards 0.82s;
}

#about.is-visible .card-wrapper:nth-child(3) .flip-front {
    animation:
        cardEntranceGlowGold 1s ease forwards 1.09s,
        borderTraceGold      1.2s ease forwards 0.99s;
}

/* ── SHIMMER SWEEP — light sweeps across card face ──────── */
.flip-front::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 15px;
    background: linear-gradient(
        105deg,
        transparent 20%,
        rgba(255, 255, 255, 0.07) 50%,
        transparent 80%
    );
    transform: translateX(-120%);
    pointer-events: none;
    z-index: 3;
}

#about.is-visible .card-wrapper:nth-child(1) .flip-front::before {
    animation: shimmerSweep 0.9s ease forwards;
    animation-delay: 0.8s;
}
#about.is-visible .card-wrapper:nth-child(2) .flip-front::before {
    animation: shimmerSweep 0.9s ease forwards;
    animation-delay: 0.97s;
}
#about.is-visible .card-wrapper:nth-child(3) .flip-front::before {
    animation: shimmerSweep 0.9s ease forwards;
    animation-delay: 1.14s;
}

@keyframes shimmerSweep {
    0%   { transform: translateX(-120%); opacity: 1; }
    100% { transform: translateX(120%);  opacity: 1; }
}

/* ── ICON SPIN-IN ───────────────────────────────────────── */
.front-icon {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
    transition:
        opacity   0.5s ease,
        transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#about.is-visible .card-wrapper:nth-child(1) .front-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition-delay: 0.7s;
}
#about.is-visible .card-wrapper:nth-child(2) .front-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition-delay: 0.87s;
}
#about.is-visible .card-wrapper:nth-child(3) .front-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition-delay: 1.04s;
}

/* ── TITLE SLIDE UP ─────────────────────────────────────── */
.front-title {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#about.is-visible .card-wrapper:nth-child(1) .front-title {
    opacity: 1; transform: translateY(0); transition-delay: 0.82s;
}
#about.is-visible .card-wrapper:nth-child(2) .front-title {
    opacity: 1; transform: translateY(0); transition-delay: 0.99s;
}
#about.is-visible .card-wrapper:nth-child(3) .front-title {
    opacity: 1; transform: translateY(0); transition-delay: 1.16s;
}

/* ── DIVIDER DRAW ───────────────────────────────────────── */
.front-divider {
    width: 0;
    transition: width 0.7s ease;
}

#about.is-visible .card-wrapper:nth-child(1) .front-divider {
    width: 40px; transition-delay: 0.95s;
}
#about.is-visible .card-wrapper:nth-child(2) .front-divider {
    width: 40px; transition-delay: 1.12s;
}
#about.is-visible .card-wrapper:nth-child(3) .front-divider {
    width: 40px; transition-delay: 1.29s;
}

/* ── DESCRIPTION FADE ───────────────────────────────────── */
.front-description {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#about.is-visible .card-wrapper:nth-child(1) .front-description {
    opacity: 1; transform: translateY(0); transition-delay: 1.0s;
}
#about.is-visible .card-wrapper:nth-child(2) .front-description {
    opacity: 1; transform: translateY(0); transition-delay: 1.17s;
}
#about.is-visible .card-wrapper:nth-child(3) .front-description {
    opacity: 1; transform: translateY(0); transition-delay: 1.34s;
}

/* ── BACK INFO ITEMS — slide in when flipped ────────────── */
.back-info-item {
    opacity: 0;
    transform: translateX(-14px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.card-wrapper:hover    .back-info-item:nth-child(1),
.card-wrapper.flipped  .back-info-item:nth-child(1) {
    opacity: 1; transform: translateX(0); transition-delay: 0.22s;
}
.card-wrapper:hover    .back-info-item:nth-child(2),
.card-wrapper.flipped  .back-info-item:nth-child(2) {
    opacity: 1; transform: translateX(0); transition-delay: 0.30s;
}
.card-wrapper:hover    .back-info-item:nth-child(3),
.card-wrapper.flipped  .back-info-item:nth-child(3) {
    opacity: 1; transform: translateX(0); transition-delay: 0.38s;
}
.card-wrapper:hover    .back-info-item:nth-child(4),
.card-wrapper.flipped  .back-info-item:nth-child(4) {
    opacity: 1; transform: translateX(0); transition-delay: 0.46s;
}
.card-wrapper:hover    .back-info-item:nth-child(5),
.card-wrapper.flipped  .back-info-item:nth-child(5) {
    opacity: 1; transform: translateX(0); transition-delay: 0.54s;
}

/* ── CARDS ROW — subtle stagger container ───────────────── */
.cards-row {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.1s, transform 0.6s ease 0.1s;
}

#about.is-visible .cards-row {
    opacity: 1;
    transform: translateY(0);
}

/* ── REDUCED MOTION ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .card-wrapper,
    .front-icon,
    .front-title,
    .front-divider,
    .front-description,
    .back-info-item,
    .cards-row {
        transition: none !important;
        animation:  none !important;
        opacity:    1   !important;
        transform:  none !important;
    }

    .flip-front::before {
        display: none;
    }
}