/* =============================================
   PCM motion, blends & socials
   ============================================= */

/* Entrance animation (hero) */
.hero-in {
    opacity: 0;
    transform: translateY(24px);
    animation: heroIn 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
    animation-delay: var(--d, 0ms);
}
@keyframes heroIn { to { opacity: 1; transform: none; } }

.hero-title { text-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }

/* Scroll reveal (JS adds .is-visible; without JS everything stays visible) */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.3s ease, box-shadow 0.35s ease;
    transition-delay: var(--reveal-delay, 0ms);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Parallax media: oversized so movement never shows edges */
.parallax-media {
    transform: translate3d(0, 0, 0) scale(1.15);
    will-change: transform;
}

/* Animated gradient text */
.text-gradient-animated {
    background: linear-gradient(90deg, #34D399, #A7F3D0, #10B981, #34D399);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 6s ease-in-out infinite;
}
@keyframes gradientShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* Aurora light blobs blended over imagery */
.aurora {
    position: absolute;
    width: 55vmax;
    height: 55vmax;
    border-radius: 50%;
    filter: blur(80px);
    mix-blend-mode: screen;
    opacity: 0.35;
    pointer-events: none;
    animation: auroraFloat 18s ease-in-out infinite alternate;
}
.aurora-1 { background: radial-gradient(circle, #10B981 0%, transparent 65%); top: -20vmax; right: -15vmax; }
.aurora-2 { background: radial-gradient(circle, #0EA5E9 0%, transparent 65%); bottom: -25vmax; left: -20vmax; opacity: 0.18; animation-duration: 24s; }
@keyframes auroraFloat {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-6vmax, 4vmax, 0) scale(1.15); }
}

/* Film grain overlay */
.grain {
    position: absolute;
    inset: 0;
    opacity: 0.07;
    mix-blend-mode: overlay;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Marquee band */
.marquee { position: relative; z-index: 5; }
.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 38s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding-right: 2rem;
    white-space: nowrap;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* Lift on hover for cards */
.lift-card { transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease, border-color 0.3s ease, opacity 0.8s ease; }
.lift-card:hover,
.js [data-reveal].lift-card.is-visible:hover { transform: translateY(-6px); box-shadow: 0 24px 50px -12px rgba(16, 185, 129, 0.3); }

/* Brand colours */
.social-youtube   { --brand: #FF0000; }
.social-tiktok    { --brand: #25F4EE; }
.social-instagram { --brand: #E1306C; }
.social-twitter   { --brand: #FFFFFF; }
.social-facebook  { --brand: #1877F2; }
.social-linkedin  { --brand: #0A66C2; }
.social-github    { --brand: #FFFFFF; }

/* Hero social chips */
.social-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    padding: 0 0.9rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(6px);
    color: #E5E7EB;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.25s ease;
}
.social-chip i { font-size: 1.05rem; }
.social-chip:hover {
    color: #000;
    background: var(--brand, #10B981);
    border-color: var(--brand, #10B981);
    transform: translateY(-3px);
}
.social-youtube.social-chip:hover, .social-facebook.social-chip:hover,
.social-linkedin.social-chip:hover, .social-instagram.social-chip:hover { color: #fff; }

/* Social cards */
.social-card {
    position: relative;
    display: block;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.3s ease, opacity 0.8s ease;
}
.social-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 0%, var(--brand, #10B981), transparent 70%);
    opacity: 0;
    mix-blend-mode: screen;
    transition: opacity 0.4s ease;
}
.social-card:hover,
.js [data-reveal].social-card.is-visible:hover { transform: translateY(-6px); border-color: var(--brand, #10B981); }
.social-card:hover::before { opacity: 0.22; }
.social-card-icon {
    position: relative;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--brand, #10B981);
    transition: transform 0.4s ease;
}
.social-card:hover .social-card-icon { transform: rotate(-8deg) scale(1.1); }
.social-card-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #34D399;
}
@media (min-width: 640px) { .social-card { padding: 1.75rem; } }

/* Floating social rail */
.social-rail {
    position: fixed;
    left: 1.5rem;
    bottom: 0;
    z-index: 40;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.social-rail.visible { opacity: 1; transform: none; pointer-events: auto; }
.social-rail a {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    color: #111827;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.25s ease;
}
.social-rail a:hover { transform: translateX(4px) scale(1.1); background: #111827; color: var(--brand); }
.social-rail-line { width: 1px; height: 4rem; background: linear-gradient(to bottom, #9CA3AF, transparent); }

/* Detail dialog entrance */
.project-dialog:not(.hidden) { animation: fadeIn 0.25s ease; }
.project-dialog:not(.hidden) .project-dialog-panel { animation: panelIn 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes panelIn { from { opacity: 0; transform: translateY(24px) scale(0.98); } }

/* ---------- Mobile polish ---------- */
section[id] { scroll-margin-top: 80px; }

@media (max-width: 639px) {
    .hero-title { font-size: clamp(2.6rem, 13vw, 3.5rem); letter-spacing: 0.04em; }
    .project-dialog { padding: 0; }
    .project-dialog-panel { margin: 0; min-height: 100%; }
    .project-dialog-close { position: fixed; top: 0.75rem; right: 0.75rem; }
    .marquee-group { gap: 1.25rem; padding-right: 1.25rem; }
    .timeline { padding-left: 1.5rem; }
    .timeline-entry::before { left: calc(-1.5rem - 7px); }
    .aurora { filter: blur(60px); }
    .footer-logo-large { font-size: clamp(2.25rem, 11vw, 3rem); }
    .back-to-top { bottom: 1rem; right: 1rem; width: 44px; height: 44px; }
}

/* Tap targets on touch devices */
@media (hover: none) {
    .lift-card:hover, .social-card:hover { transform: none; }
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
    .hero-in, .js [data-reveal] { opacity: 1 !important; transform: none !important; animation: none !important; }
    .marquee-track, .aurora, .text-gradient-animated { animation: none !important; }
    .parallax-media { transform: scale(1.05) !important; }
}

/* Per-item social links */
.item-socials {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
}
.item-social-btn {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    color: #fff;
    transition: all 0.25s ease;
}
.item-social-btn:hover { background: #10B981; color: #000; transform: translateY(-2px); }
.dialog-social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: 1px solid #374151;
    background: rgba(255, 255, 255, 0.03);
    color: #F3F4F6;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
}
.dialog-social-link:hover { border-color: #10B981; background: rgba(16, 185, 129, 0.12); transform: translateY(-2px); }

/* Fallback: never leave content hidden if animations are paused or unsupported */
.motion-done .hero-in { opacity: 1 !important; transform: none !important; }

/* Contact cards */
.contact-tile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #1f2937;
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease, opacity 0.8s ease;
}
.contact-tile:hover,
.js [data-reveal].contact-tile.is-visible:hover { border-color: var(--brand, #10B981); transform: translateY(-3px); background: rgba(16, 185, 129, 0.06); }
.contact-tile .contact-icon { color: var(--brand, #34D399); }
.contact-tile:hover .contact-icon { border-color: var(--brand, #10B981); }

/* =============================================
   Parallax & depth effects
   ============================================= */

/* Full-width parallax bands */
.parallax-band { isolation: isolate; }
.band-text {
    font-size: clamp(2.75rem, 8vw, 7.5rem);
    text-shadow: 0 10px 50px rgba(0, 0, 0, 0.35);
}

/* Giant outline text that slides with scroll */
.giant-text {
    position: absolute;
    top: 50%;
    left: 0;
    white-space: nowrap;
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: clamp(8rem, 22vw, 22rem);
    line-height: 1;
    letter-spacing: 0.02em;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    transform: translate3d(0, -50%, 0);
    will-change: transform;
}
.giant-text-light { color: transparent; -webkit-text-stroke: 1.5px rgba(16, 185, 129, 0.16); }
.giant-text-dark  { color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.07); mix-blend-mode: screen; }
#journey > .max-w-7xl, #events > .max-w-7xl { position: relative; z-index: 1; }

/* Floating hero shapes */
.float-shape { position: absolute; display: block; will-change: transform; }
.float-ring {
    width: 140px; height: 140px; border-radius: 50%;
    border: 2px solid rgba(52, 211, 153, 0.45);
    mix-blend-mode: screen;
    animation: spin 30s linear infinite;
}
.float-ring::after {
    content: ''; position: absolute; top: -6px; left: 50%;
    width: 12px; height: 12px; border-radius: 50%; background: #34D399;
    box-shadow: 0 0 20px #34D399;
}
.float-ring-sm { width: 60px; height: 60px; border-color: rgba(255, 255, 255, 0.25); }
.float-dots {
    width: 120px; height: 120px;
    background-image: radial-gradient(rgba(255, 255, 255, 0.35) 1.5px, transparent 1.5px);
    background-size: 16px 16px;
    mix-blend-mode: overlay;
}
.float-plus { color: #34D399; font-size: 3rem; font-weight: 200; line-height: 1; text-shadow: 0 0 20px rgba(52, 211, 153, 0.6); }
.float-line { width: 180px; height: 2px; background: linear-gradient(90deg, transparent, #34D399, transparent); }
@keyframes spin { to { rotate: 360deg; } }

/* Word-by-word heading reveal */
.is-split .split-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.is-split .split-inner {
    display: inline-block;
    transform: translateY(110%) rotate(4deg);
    opacity: 0;
    transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.9s ease;
}
.is-split.split-visible .split-inner { transform: none; opacity: 1; }
.motion-done .is-split.split-visible .split-inner { transform: none; opacity: 1; }

/* Image curtain reveal (About photo). A sliding overlay, never a clip, so the photo is always
   really on screen: clipping it would stop lazy-loading and the reveal trigger from firing. */
.js .clip-reveal[data-reveal] { opacity: 1; transform: none; }
.clip-reveal::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(90deg, #10B981, #047857);
    transform-origin: right center;
    transform: scaleX(0);
    pointer-events: none;
}
.js .clip-reveal[data-reveal]:not(.is-visible)::after { transform: scaleX(1); }
.js .clip-reveal[data-reveal].is-visible::after { transform: scaleX(0); transition: transform 1.2s cubic-bezier(0.7, 0, 0.2, 1) 0.15s; }
.motion-done .clip-reveal::after { transition-duration: 1.2s; }

/* 3D tilt + moving glare */
.has-tilt { transform-style: preserve-3d; transition: transform 0.2s ease-out, box-shadow 0.35s ease, border-color 0.3s ease, opacity 0.8s ease; }
.has-tilt::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), rgba(255, 255, 255, 0.18), transparent 55%);
    mix-blend-mode: overlay;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}
.has-tilt:hover::after { opacity: 1; }
[data-tilt] { position: relative; }

/* Magnetic buttons */
.magnetic { transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s ease, color 0.2s ease; will-change: transform; }

/* Cursor spotlight on dark sections */
.spotlight { position: relative; }
.spotlight::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(16, 185, 129, 0.16), transparent 45%);
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.spotlight.spotlight-on::before { opacity: 1; }
.spotlight > * { position: relative; z-index: 1; }
.spotlight > .giant-text, .spotlight > .aurora { position: absolute; z-index: 0; }

@media (max-width: 767px) {
    .giant-text { font-size: 7rem; }
    .parallax-band { height: 60vh; min-height: 360px; }
}

@media (prefers-reduced-motion: reduce) {
    .is-split .split-inner { transform: none !important; opacity: 1 !important; }
    .clip-reveal::after { display: none !important; }
    .float-ring { animation: none !important; }
    .giant-text { transform: translate3d(-10%, -50%, 0) !important; }
}
