/* ── Custom properties & one-off effects that Tailwind can't express ──────── */
:root {
    --gradient-1: linear-gradient(145deg, #00d4ff, #9b59b6);
    --gradient-2: linear-gradient(145deg, #c5ff4d, #27ae60);
    --gradient-3: linear-gradient(145deg, #ff006e, #f39c12);
    --gradient-4: linear-gradient(145deg, #8422ff, #2965f1);
}

body {
    font-family: 'Lexend', sans-serif;
}

/* ── Gradient text utility ──────────────────────────────────────────────── */
.grad-text-1 {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.grad-text-2 {
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.grad-text-3 {
    background: var(--gradient-3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Gradient background utility ────────────────────────────────────────── */
.grad-bg-1 {
    background: var(--gradient-1);
}

.grad-bg-2 {
    background: var(--gradient-2);
}

.grad-bg-3 {
    background: var(--gradient-3);
}

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes floatHero {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes gridMove {
    0% {
        transform: rotateX(60deg) translateZ(-200px) translateY(0);
    }

    100% {
        transform: rotateX(60deg) translateZ(-200px) translateY(100px);
    }
}

@keyframes scrollWheel {

    0%,
    100% {
        top: 8px;
        opacity: 1;
    }

    50% {
        top: 20px;
        opacity: .3;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .5;
        transform: scale(1.2);
    }
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(50px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-50px, 50px) scale(.9);
    }
}

@keyframes gridScroll {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

@keyframes wave {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes floatUp {
    0% {
        transform: translateY(100%) scale(0);
        opacity: 0;
    }

    50% {
        opacity: .3;
    }

    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

@keyframes glitch-1 {

    0%,
    100% {
        clip-path: inset(40% 0 61% 0);
        transform: translate(0);
    }

    20% {
        clip-path: inset(92% 0 1% 0);
        transform: translate(-2px, 2px);
    }

    40% {
        clip-path: inset(43% 0 1% 0);
        transform: translate(-2px, -2px);
    }

    60% {
        clip-path: inset(25% 0 58% 0);
        transform: translate(2px, 2px);
    }

    80% {
        clip-path: inset(54% 0 7% 0);
        transform: translate(2px, -2px);
    }
}

@keyframes glitch-2 {

    0%,
    100% {
        clip-path: inset(1% 0 96% 0);
        transform: translate(0);
    }

    20% {
        clip-path: inset(78% 0 21% 0);
        transform: translate(2px, -2px);
    }

    40% {
        clip-path: inset(15% 0 16% 0);
        transform: translate(2px, 2px);
    }

    60% {
        clip-path: inset(85% 0 11% 0);
        transform: translate(-2px, -2px);
    }

    80% {
        clip-path: inset(46% 0 24% 0);
        transform: translate(-2px, 2px);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out both;
}

.animate-fadeIn {
    animation: fadeIn 1s ease-out both;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-float-hero {
    animation: floatHero 3s ease-in-out infinite;
}

.animate-shimmer {
    animation: shimmer 2s infinite;
}

.animate-pulse-dot {
    animation: pulse-dot 2s ease-in-out infinite;
}

/* ── 3-D Grid hero background ────────────────────────────────────────────── */
.grid-scene {
    perspective: 1000px;
}

.hero-grid {
    position: absolute;
    width: 200%;
    height: 200%;
    left: -50%;
    top: 50%;
    background-image:
        linear-gradient(0deg, transparent 24%, rgba(0, 212, 255, .1) 25%, rgba(0, 212, 255, .1) 26%, transparent 27%, transparent 74%, rgba(0, 212, 255, .1) 75%, rgba(0, 212, 255, .1) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(0, 212, 255, .1) 25%, rgba(0, 212, 255, .1) 26%, transparent 27%, transparent 74%, rgba(0, 212, 255, .1) 75%, rgba(0, 212, 255, .1) 76%, transparent 77%, transparent);
    background-size: 100px 100px;
    animation: gridMove 20s linear infinite;
}

/* ── Section BG grid lines ───────────────────────────────────────────────── */
.bg-grid-lines {
    background-image: linear-gradient(rgba(0, 212, 255, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 212, 255, .03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridScroll 20s linear infinite;
}

/* ── Progress bar shimmer overlay ────────────────────────────────────────── */
.progress-shimmer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent);
    animation: shimmer 2s infinite;
}

/* ── Slider dots ─────────────────────────────────────────────────────────── */
.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    cursor: pointer;
    transition: all .3s ease;
}

.slider-dot.active {
    background: #00d4ff;
    width: 32px;
    border-radius: 6px;
}

.slider-dot:hover {
    background: #00d4ff;
    transform: scale(1.2);
}

/* ── Nav active underline ────────────────────────────────────────────────── */
.nav-link {
    position: relative;
    padding-bottom: 4px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: width .3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: #00d4ff;
}

/* ── Skill card top-border on hover ─────────────────────────────────────── */
.skill-card {
    position: relative;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0;
    transition: opacity .4s ease;
}

.skill-card:nth-child(1)::before {
    background: linear-gradient(90deg, #e34c26, #f06529);
}

.skill-card:nth-child(2)::before {
    background: linear-gradient(90deg, #264de4, #2965f1);
}

.skill-card:nth-child(3)::before {
    background: linear-gradient(90deg, #f0db4f, #f7df1e);
}

.skill-card:nth-child(4)::before {
    background: linear-gradient(90deg, #306998, #ffd43b);
}

.skill-card:nth-child(5)::before {
    background: linear-gradient(90deg, #336791, #0a3b64);
}

.skill-card:nth-child(6)::before {
    background: linear-gradient(90deg, #1abcfe, #a259ff);
}

.skill-card:hover::before {
    opacity: 1;
}

/* ── Skill progress fill colours ─────────────────────────────────────────── */
.skill-card:nth-child(1) .progress-fill {
    background: linear-gradient(90deg, #e34c26, #f06529);
}

.skill-card:nth-child(2) .progress-fill {
    background: linear-gradient(90deg, #264de4, #2965f1);
}

.skill-card:nth-child(3) .progress-fill {
    background: linear-gradient(90deg, #f0db4f, #f7df1e);
}

.skill-card:nth-child(4) .progress-fill {
    background: linear-gradient(90deg, #306998, #ffd43b);
}

.skill-card:nth-child(5) .progress-fill {
    background: linear-gradient(90deg, #336791, #0a3b64);
}

.skill-card:nth-child(6) .progress-fill {
    background: linear-gradient(90deg, #47A248, #6CC24A);
}

.skill-card:nth-child(7) .progress-fill {
    background: linear-gradient(90deg, #1abcfe, #a259ff);
}

.skill-card:nth-child(8) .progress-fill {
    background: linear-gradient(90deg, #ff6d5a, #ff9a8f);
}

/* ── Timeline layout ─────────────────────────────────────────────────────── */
.timeline-item {
    display: grid;
    grid-template-columns: 1fr 80px 1fr;
    gap: 40px;
    margin-bottom: 60px;
    position: relative;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item:nth-child(even) .timeline-content {
    grid-column: 3;
}

.timeline-item:nth-child(odd) .timeline-content {
    grid-column: 1;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 32px;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0a0e1a;
    border: 4px solid #00d4ff;
    z-index: 2;
    transition: all .4s ease;
}

.timeline-item:nth-child(2) .timeline-dot {
    border-color: #c5ff4d;
}

.timeline-item:nth-child(3) .timeline-dot {
    border-color: #ff006e;
}

.timeline-item:nth-child(4) .timeline-dot {
    border-color: #9b59b6;
}

.timeline-item:hover .timeline-dot {
    transform: translateX(-50%) scale(1.3);
}

.timeline-period {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0, 212, 255, .1);
    color: #00d4ff;
}

.timeline-item:nth-child(2) .timeline-period {
    background: rgba(197, 255, 77, .1);
    color: #c5ff4d;
}

.timeline-item:nth-child(3) .timeline-period {
    background: rgba(255, 0, 110, .1);
    color: #ff006e;
}

.timeline-item:nth-child(4) .timeline-period {
    background: rgba(155, 89, 182, .1);
    color: #9b59b6;
}

/* ── Project card per-child gradients ────────────────────────────────────── */
.project-card {
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .6s ease;
    z-index: 0;
}

.project-card:nth-child(1)::before {
    background: var(--gradient-1);
}

.project-card:nth-child(2)::before {
    background: var(--gradient-2);
}

.project-card:nth-child(3)::before {
    background: var(--gradient-3);
}

.project-card:nth-child(4)::before {
    background: var(--gradient-4);
}

.project-card:hover::before {
    opacity: .05;
}

.project-card:nth-child(2) .project-category {
    color: #c5ff4d;
}

.project-card:nth-child(3) .project-category {
    color: #ff006e;
}

.project-card:nth-child(4) .project-category {
    color: #9b59b6;
}

/* ── Interest card top-bar per-child ─────────────────────────────────────── */
.interest-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transition: transform .4s ease;
}

.interest-card:nth-child(2)::before {
    background: var(--gradient-2);
}

.interest-card:nth-child(3)::before {
    background: var(--gradient-3);
}

.interest-card:nth-child(4)::before {
    background: var(--gradient-4);
}

.interest-card:hover::before {
    transform: scaleX(1);
}

/* ── Stat number per-child gradient ──────────────────────────────────────── */
.stat-item:nth-child(1) .stat-number {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-item:nth-child(2) .stat-number {
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-item:nth-child(3) .stat-number {
    background: var(--gradient-3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Mobile menu ─────────────────────────────────────────────────────────── */
.mobile-menu {
    position: fixed;
    top: 81px;
    left: -100%;
    width: 260px;
    height: calc(100vh - 81px);
    background: #0a0e1a;
    transition: left .6s ease;
    overflow-y: auto;
    z-index: 999;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-item {
    opacity: 0;
    transform: translateX(-20px);
    transition: all .3s ease;
}

.mobile-menu.active .mobile-menu-item {
    opacity: 1;
    transform: translateX(0);
}

.mobile-menu.active .mobile-menu-item:nth-child(1) {
    transition-delay: .1s;
}

.mobile-menu.active .mobile-menu-item:nth-child(2) {
    transition-delay: .15s;
}

.mobile-menu.active .mobile-menu-item:nth-child(3) {
    transition-delay: .2s;
}

.mobile-menu.active .mobile-menu-item:nth-child(4) {
    transition-delay: .25s;
}

/* ── Footer link arrow ───────────────────────────────────────────────────── */
.footer-link {
    position: relative;
    padding-left: 0;
    display: inline-block;
    transition: all .3s ease;
}

.footer-link::before {
    content: '→';
    position: absolute;
    left: -20px;
    opacity: 0;
    transition: all .3s ease;
    color: #00d4ff;
}

.footer-link:hover::before {
    left: -16px;
    opacity: 1;
}

.footer-link:hover {
    color: #00d4ff;
    transform: translateX(8px);
}

/* ── Footer section title underline ─────────────────────────────────────── */
.footer-section-title {
    position: relative;
    display: inline-block;
}

.footer-section-title::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--gradient-1);
}

/* ── Footer bottom link underline ────────────────────────────────────────── */
.footer-bottom-link {
    position: relative;
}

.footer-bottom-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #00d4ff;
    transition: width .3s ease;
}

.footer-bottom-link:hover::after {
    width: 100%;
}

.footer-bottom-link:hover {
    color: #00d4ff;
}

/* ── Social link gradient on hover ──────────────────────────────────────── */
.social-link {
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .4s ease;
}

.social-link:nth-child(1)::before {
    background: var(--gradient-1);
}

.social-link:nth-child(2)::before {
    background: var(--gradient-2);
}

.social-link:nth-child(3)::before {
    background: var(--gradient-3);
}

.social-link:nth-child(4)::before {
    background: var(--gradient-4);
}

.social-link:hover::before {
    opacity: 1;
}

.social-link span {
    position: relative;
    z-index: 1;
}

.social-link:hover span {
    color: white;
}

/* ── Footer logo hover underline ─────────────────────────────────────────── */
.footer-logo {
    position: relative;
    display: inline-block;
    cursor: pointer;
    transition: all .3s ease;
}

.footer-logo::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-1);
    transition: width .3s ease;
}

.footer-logo:hover::after {
    width: 100%;
}

.footer-logo:hover {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, .5));
}

/* ── Newsletter shine ────────────────────────────────────────────────────── */
.newsletter-card {
    position: relative;
    overflow: hidden;
}

.newsletter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, .1), transparent);
    animation: shine 3s infinite;
}

/* ── Wave animation ──────────────────────────────────────────────────────── */
.wave-path {
    animation: wave 15s linear infinite;
}

.wave-path:nth-child(2) {
    animation-delay: -5s;
    opacity: .7;
}

.wave-path:nth-child(3) {
    animation-delay: -10s;
    opacity: .5;
}

/* ── Back to top button ──────────────────────────────────────────────────── */
.back-to-top {
    opacity: 0;
    transform: translateY(100px);
    transition: all .4s cubic-bezier(.4, 0, .2, 1);
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-1);
    border-radius: 50%;
    z-index: -1;
    filter: blur(10px);
    opacity: 0;
    transition: opacity .3s ease;
}

.back-to-top:hover::before {
    opacity: 1;
}

/* ── Ripple on buttons ───────────────────────────────────────────────────── */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .3);
    transform: translate(-50%, -50%);
    transition: width .6s ease, height .6s ease;
}

.btn-ripple:hover::before {
    width: 300px;
    height: 300px;
}

/* ── View-all arrow ──────────────────────────────────────────────────────── */
.view-all-btn::after {
    content: '→';
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    opacity: 0;
    transition: all .4s ease;
}

.view-all-btn:hover::after {
    right: 20px;
    opacity: 1;
}

.view-all-btn:hover {
    padding-right: 80px;
}

/* ── Profile image hover ─────────────────────────────────────────────────── */
.profile-wrapper {
    position: relative;
    overflow: hidden;
    border: 3px solid transparent;
    background-clip: padding-box;
    transition: all .5s ease;
}

.profile-wrapper::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: var(--gradient-1);
    border-radius: 24px;
    z-index: -1;
    opacity: 0;
    transition: opacity .5s ease;
}

.profile-wrapper:hover::before {
    opacity: 1;
}

.profile-wrapper:hover .profile-img {
    filter: grayscale(0%);
}

/* ── Contact form focus glow ─────────────────────────────────────────────── */
.form-field:focus {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, .05);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, .1);
    outline: none;
}

/* ── Section subtitle decorative lines ───────────────────────────────────── */
.section-subtitle {
    position: relative;
    display: inline-block;
}

.section-subtitle::before,
.section-subtitle::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40px;
    height: 2px;
    background: var(--gradient-1);
}

.section-subtitle::before {
    left: -50px;
}

.section-subtitle::after {
    right: -50px;
}

/* ── Title glow (projects featured heading) ──────────────────────────────── */
.title-glow {
    position: relative;
    display: inline-block;
}

.title-glow::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    z-index: -1;
    filter: blur(20px);
    opacity: .5;
}

/* ── Project overlay animation ───────────────────────────────────────────── */
.overlay-title,
.overlay-desc,
.overlay-tags {
    transform: translateY(20px);
    transition: transform .6s cubic-bezier(.4, 0, .2, 1);
}

.overlay-desc {
    transition-delay: .1s;
}

.overlay-tags {
    transition-delay: .2s;
}

.project-card:hover .overlay-title,
.project-card:hover .overlay-desc,
.project-card:hover .overlay-tags {
    transform: translateY(0);
}

/* ── Orb animations ──────────────────────────────────────────────────────── */
.orb {
    animation: orbFloat 25s ease-in-out infinite;
}

.orb-2 {
    animation-delay: 8s;
}

.orb-3 {
    animation-delay: 16s;
}

.footer-orb {
    animation: orbFloat 20s ease-in-out infinite;
}

.footer-orb-2 {
    animation-delay: 5s;
}

.footer-orb-3 {
    animation-delay: 10s;
}

/* ── Responsive overrides ────────────────────────────────────────────────── */
@media (max-width:968px) {
    .timeline-item {
        grid-template-columns: 80px 1fr;
        gap: 20px;
    }

    .timeline-item:nth-child(even) .timeline-content,
    .timeline-item:nth-child(odd) .timeline-content {
        grid-column: 2;
    }

    .timeline-dot {
        left: 40px;
    }
}

@media (max-width:640px) {
    .timeline-item {
        grid-template-columns: 60px 1fr;
        gap: 16px;
    }

    .timeline-dot {
        left: 30px;
        width: 16px;
        height: 16px;
    }

    .section-subtitle::before,
    .section-subtitle::after {
        display: none;
    }
}

@media (max-width:480px) {

    .section-subtitle::before,
    .section-subtitle::after {
        display: none;
    }
}

.link_projects {
    position: relative;
    padding-left: 0;
    display: inline-block;
    transition: all .3s ease;
}

.link_projects:hover {
    text-decoration: underline;
}

.link_projects::before {
    content: '→';
    position: absolute;
    left: -20px;
    opacity: 0;
    transition: all .3s ease;
    color: #00d4ff;
}

.link_projects:hover::before {
    left: -16px;
    opacity: 1;
}