/* ═══════════════════════════════════════════════════════════
   PORTFOLIO ANIMATION CSS — Kid Portals + Cinematic Zoom
   ═══════════════════════════════════════════════════════════ */

/* ════════════════════════
   PRELOADER
════════════════════════ */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #080808;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: min(480px, 90vw);
}

.loader-counter {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(5rem, 16vw, 12rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #f5f5f0;
    font-variant-numeric: tabular-nums;
    min-width: 3ch;
    text-align: center;
}

.loader-line {
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
    border-radius: 1px;
}

#loader-line-fill {
    height: 100%;
    width: 0%;
    background: #f5f5f0;
    border-radius: 1px;
}

.loader-name { display: flex; overflow: hidden; }

.loader-char {
    display: inline-block;
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(0.65rem, 1.6vw, 0.9rem);
    font-weight: 600;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: #f5f5f0;
    opacity: 0;
    transform: translateY(14px);
    will-change: opacity, transform;
}



/* ════════════════════════
   NAV HOVER
════════════════════════ */
.nav-links a {
    position: relative;
    color: #7a7570;
    transition: color 0.25s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0; bottom: -3px;
    width: 100%; height: 1px;
    background: #1a1815;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
}

.nav-links a.active { color: #7c5cfa; }
.nav-links a.active::after { background: #7c5cfa; transform: scaleX(1); }

@media (hover: hover) {
    .nav-links a:hover { color: #1a1815; }
    .nav-links a:hover::after { transform: scaleX(1); }
}

/* ════════════════════════
   PILL — LIQUID FILL
════════════════════════ */
.pill {
    position: relative;
    overflow: hidden;
    color: #504c47;
    border-color: rgba(0,0,0,0.12);
    transition: color 0.35s ease, border-color 0.35s ease;
}

.pill::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 0%;
    background: #1a1815;
    transition: height 0.42s cubic-bezier(0.16,1,0.3,1);
    z-index: 0;
    border-radius: inherit;
}

@media (hover: hover) {
    .pill:hover::before { height: 100%; }
    .pill:hover { color: #f0ede8; border-color: #1a1815; }
}

.pill-label, .pill-arrow {
    position: relative;
    z-index: 1;
    transition: color 0.35s ease;
}

/* ════════════════════════
   SCROLL WORD REVEAL
════════════════════════ */
.word-wrap {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    margin-right: 0.25em;
}

.word {
    display: inline-block;
    transform: translateY(105%);
    opacity: 0;
    will-change: transform, opacity;
}

/* ════════════════════════
   REVEAL (generic fade-up)
════════════════════════ */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    will-change: opacity, transform;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.9s cubic-bezier(0.16,1,0.3,1),
                transform 0.9s cubic-bezier(0.16,1,0.3,1);
}

/* ════════════════════════
   SCROLL PROGRESS
════════════════════════ */
#scroll-progress {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 140px;
    background: rgba(0,0,0,0.07);   /* was rgba(255,255,255,0.07) — invisible */
    z-index: 100;
    pointer-events: none;
    border-radius: 1px;
}

#scroll-progress-fill {
    width: 100%;
    height: 0%;
    background: linear-gradient(to bottom, #7c5cfa, rgba(124,92,250,0.25));
    border-radius: 1px;
    transition: height 0.15s linear;
}

/* ════════════════════════
   CUSTOM CURSOR
/* ════════════════════════
   CUSTOM CURSOR (Global Sync)
════════════════════════ */
.custom-cursor {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(102, 126, 234, 0.5);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99998;
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
    transform: translate(-50%, -50%);
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: #667eea;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
}

.mouse-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease, background 0.5s ease;
}

@media (pointer: coarse) { .cursor-dot, .custom-cursor, .mouse-glow { display: none !important; } }

/* ════════════════════════
   SKILL BARS
════════════════════════ */
.skill-bar span {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.4s cubic-bezier(0.16,1,0.3,1);
}
.skill-list li:nth-child(1) .skill-bar span { transition-delay: 0ms; }
.skill-list li:nth-child(2) .skill-bar span { transition-delay: 100ms; }
.skill-list li:nth-child(3) .skill-bar span { transition-delay: 200ms; }
.skill-list li:nth-child(4) .skill-bar span { transition-delay: 300ms; }
.skill-bar.animate span { transform: scaleX(1); }

/* ════════════════════════
   EXP ITEMS
════════════════════════ */
.exp-item {
    position: relative;
    transition: opacity 0.3s ease;
}

.exp-item::before {
    content: '';
    position: absolute;
    left: -1px; top: 0; bottom: 0;
    width: 2px;
    background: #7c5cfa;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
}

.exp-item:hover::before { transform: scaleY(1); }
/* Removed dim-all-on-hover from exp-list — hurts keyboard accessibility */

/* ════════════════════════
   ABOUT TAGS
════════════════════════ */
.about-tag {
    transition: color 0.22s, border-color 0.22s, background 0.22s, transform 0.2s;
}
@media (hover: hover) {
    .about-tag:hover {
        color: #f0ede8;
        background: #1a1815;
        border-color: #1a1815;
        transform: translateY(-2px);
    }
}

/* ════════════════════════
   EDU CARDS
════════════════════════ */
.edu-card {
    transition: transform 0.5s cubic-bezier(0.16,1,0.3,1),
                border-color 0.35s, box-shadow 0.35s;
}
@media (hover: hover) {
    .edu-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 24px 64px rgba(0,0,0,0.45);
    }
}

/* ════════════════════════
   CONTACT LINKS
════════════════════════ */
@media (hover: hover) {
    .contact-links-wrap:hover .contact-link { opacity: 0.4; }
    .contact-links-wrap:hover .contact-link:hover { opacity: 1; }
}

/* ════════════════════════
   REDUCED MOTION
   (respects OS/browser setting)
════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .word  {
        opacity: 1;
        transform: none;
    }

    .ambient-orb { display: none; }
    .mouse-glow  { display: none; }
}

/* ════════════════════════
   SECTION LABEL
════════════════════════ */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}
.section-label::before {
    content: '';
    display: inline-block;
    width: 40px; height: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

/* ════════════════════════
   SKILLS MARQUEE
════════════════════════ */
#skills-marquee {
    overflow: hidden;
    white-space: nowrap;
    border-top: 1px solid rgba(0,0,0,0.06);     /* was rgba(255,255,255,0.05) — invisible */
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 1.1rem 0;
    margin-bottom: 4rem;
    position: relative;
    z-index: 2;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.marquee-track {
    display: inline-flex;
    gap: 2.5rem;
    animation: marqueeScroll 24s linear infinite;
    will-change: transform;
}

.marquee-item {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(0,0,0,0.28);    /* was rgba(245,245,240,0.22) — invisible on white */
    flex-shrink: 0;
    user-select: none;
    transition: color 0.2s;
}
.marquee-item:hover { color: rgba(0,0,0,0.65); }

.marquee-sep {
    color: rgba(124,92,250,0.55);
    flex-shrink: 0;
}

@keyframes marqueeScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* Mobile */
@media (max-width: 768px) {
    #scroll-progress { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   KID PORTALS — Hero foreground cards
   ═══════════════════════════════════════════════════════════ */

.kid-portals {
    display: flex;
    gap: 1.5rem;
    padding: 0 clamp(1.5rem, 5vw, 5rem);
    align-items: flex-end;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    margin-top: auto; /* pushes it down if flex column */
    margin-bottom: 4rem;
}

.kid-portal {
    flex: 1;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    opacity: 0;
    transform: translateY(24px);
    transition: flex 0.6s cubic-bezier(0.16,1,0.3,1),
                opacity 0.7s ease,
                transform 0.7s cubic-bezier(0.16,1,0.3,1);
}

.kid-portal.entrance-done {
    opacity: 1;
    transform: translateY(0);
}

/* Expand slightly on hover, shrink other two */
@media (hover: hover) {
    .kid-portals:hover .kid-portal { flex: 0.8; }
    .kid-portals:hover .kid-portal:hover { flex: 1.4; }
}

/* Image container */
.kid-portal-img {
    position: relative;
    width: 100%;
    height: clamp(160px, 24vh, 280px);
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    background: #0B0B0C;
}

.kid-portal-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.8s cubic-bezier(0.16,1,0.3,1),
                filter 0.6s ease;
    filter: brightness(0.75);
}

.kid-portal:hover .kid-portal-img img {
    transform: scale(1.06);
    filter: brightness(1);
}

/* Glow overlays */
.portal-glow {
    position: absolute;
    inset: 0;
    border-radius: 12px 12px 0 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.kid-portal:hover .portal-glow { opacity: 1; }

.glow-violet {
    background: radial-gradient(circle at 35% 60%,
        rgba(100,80,255,0.22) 0%,
        transparent 65%);
}
.glow-amber {
    background: radial-gradient(circle at 50% 55%,
        rgba(255,180,60,0.18) 0%,
        transparent 65%);
}
.glow-teal {
    background: radial-gradient(circle at 50% 55%,
        rgba(40,210,180,0.20) 0%,
        transparent 65%);
}

/* Bottom label strip */
.kid-portal-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: rgba(18,18,18,0.85);
    backdrop-filter: blur(8px);
    border-radius: 0 0 12px 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.portal-num {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: rgba(245,245,240,0.28);
    font-family: 'DM Sans', sans-serif;
}

.portal-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(245,245,240,0.85);
    font-family: 'DM Sans', sans-serif;
    transition: color 0.3s ease;
}

.kid-portal:hover .portal-name { color: #f5f5f0; }

.portal-arrow {
    font-size: 1rem;
    color: rgba(245,245,240,0.25);
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1),
                color 0.3s ease;
}

.kid-portal:hover .portal-arrow {
    transform: translate(3px, -3px);
    color: #f5f5f0;
}

/* Accent bottom line per portal */
.portal-hover-line {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    border-radius: 0 0 12px 12px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
}

.kid-portal:nth-child(1) .portal-hover-line { background: #7c5cfa; }
.kid-portal:nth-child(2) .portal-hover-line { background: #f5a623; }
.kid-portal:nth-child(3) .portal-hover-line { background: #28d2b4; }

.kid-portal:hover .portal-hover-line { transform: scaleX(1); }

/* Zoom-out state when another portal is being zoomed into */
.kid-portal.zoom-out {
    transform: scale(0.92) translateY(8px);
    opacity: 0.2;
    pointer-events: none;
    transition: all 0.55s cubic-bezier(0.16,1,0.3,1);
}

/* ═══════════════════════════════════════════════════════════
   PORTAL ZOOM-IN TRANSITION OVERLAY
   ═══════════════════════════════════════════════════════════ */

/* Fade body children natively during zoom transition */
body.page-transitioning > *:not(.zoom-clone):not(#zoom-fade) {
    opacity: 0 !important;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

/* Hero adjust — push content up so portals have room */
#hero {
    position: relative;
    min-height: 100vh;
}

.hero-inner {
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
}

/* Footer pushed down in hero to not overlap portals */
.hero-footer {
    position: relative;
    z-index: 5;
    padding-bottom: 2rem;
}

/* Responsive */
@media (max-width: 900px) {
    .kid-portals {
        flex-direction: column;
        position: relative;
        bottom: auto;
        padding: 1rem clamp(1rem, 4vw, 2rem);
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .kid-portal { opacity: 1 !important; transform: none !important; }
    .kid-portals:hover .kid-portal,
    .kid-portals:hover .kid-portal:hover { flex: 1; }

    .kid-portal-img { height: clamp(140px, 30vw, 220px); }
}

@media (max-width: 480px) {
    .kid-portals { padding: 0.75rem; gap: 0.75rem; }
    .kid-portal-img { height: clamp(120px, 40vw, 180px); }
}
