/* ========================================
   DESIGN TOKENS
   ======================================== */
:root {
    /* Colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-border: rgba(255, 255, 255, 0.08);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-purple: #7c3aed;
    --accent-blue: #2563eb;
    --accent-cyan: #22d3ee;
    --accent-gradient: linear-gradient(135deg, #7c3aed, #2563eb);
    --accent-gradient-text: linear-gradient(135deg, #a78bfa, #60a5fa);
    --accent-glow: rgba(124, 58, 237, 0.4);
    --accent-glow-blue: rgba(37, 99, 235, 0.3);

    --border-subtle: rgba(148, 163, 184, 0.1);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;

    /* Spacing */
    --section-padding: 120px 0;
    --container-max: 1200px;
    --container-padding: 0 24px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

/* ========================================
   LIGHT THEME
   ======================================== */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(241, 245, 249, 0.95);
    --bg-glass: rgba(0, 0, 0, 0.03);
    --bg-glass-border: rgba(0, 0, 0, 0.08);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --accent-purple: #7c3aed;
    --accent-blue: #2563eb;
    --accent-cyan: #0891b2;
    --accent-gradient: linear-gradient(135deg, #7c3aed, #2563eb);
    --accent-gradient-text: linear-gradient(135deg, #6d28d9, #1d4ed8);
    --accent-glow: rgba(124, 58, 237, 0.15);
    --accent-glow-blue: rgba(37, 99, 235, 0.1);

    --border-subtle: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .navbar.scrolled {
    background: rgba(248, 250, 252, 0.88);
}

[data-theme="light"] .project-card__overlay {
    background: rgba(248, 250, 252, 0.75);
}

[data-theme="light"] .hero-bg-grid {
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.08) 1px, transparent 1px);
}



[data-theme="light"] .tag {
    background: rgba(124, 58, 237, 0.08);
    color: #6d28d9;
}

[data-theme="light"] .btn--ghost {
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .btn--ghost:hover {
    border-color: rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.04);
}

/* ========================================
   RESET & BASE
   ======================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--container-padding);
}

.section {
    padding: var(--section-padding);
    position: relative;
}

/* ========================================
   SECTION TITLES
   ======================================== */
.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-title__accent {
    background: var(--accent-gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-mono);
    margin-right: 8px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 48px;
}

/* ========================================
   NAVBAR
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: var(--transition-base);
    backdrop-filter: blur(0px);
}

.navbar.scrolled {
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 0;
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--container-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.logo-bracket {
    background: var(--accent-gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-link {
    padding: 8px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition-base);
}

/* Nav Actions (Theme + Lang toggles) */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--bg-glass-border);
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-base);
    padding: 0;
    font-family: var(--font-heading);
}

.nav-icon-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.1);
    transform: scale(1.1);
}

/* Theme toggle icon visibility */
.icon-sun {
    display: none;
}

.icon-moon {
    display: block;
}

[data-theme="light"] .icon-sun {
    display: block;
}

[data-theme="light"] .icon-moon {
    display: none;
}

/* Lang button */
.lang-btn {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.lang-label {
    pointer-events: none;
}

/* ========================================
   HERO
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 100%);
}

.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
}

.hero-glow--1 {
    width: 600px;
    height: 600px;
    background: var(--accent-glow);
    top: -200px;
    right: -100px;
    opacity: 0.3;
    animation: float 8s ease-in-out infinite;
}

.hero-glow--2 {
    width: 500px;
    height: 500px;
    background: var(--accent-glow-blue);
    bottom: -100px;
    left: -100px;
    opacity: 0.25;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, -30px);
    }
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
    padding: 0 24px;
}

.hero-greeting {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 400;
}

.hero-name {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    background: var(--accent-gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
}

.hero-typing-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    color: var(--accent-cyan);
    margin-bottom: 28px;
    min-height: 36px;
}

.hero-typing-prefix {
    color: var(--text-muted);
}

.hero-cursor {
    animation: blink 1s step-end infinite;
    font-weight: 100;
    color: var(--accent-cyan);
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: var(--radius-xl);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
}

.btn--primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 24px var(--accent-glow);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.btn--ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--bg-glass-border);
    backdrop-filter: blur(8px);
}

.btn--ghost:hover {
    background: var(--bg-glass);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Scroll indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    animation: scrollBounce 2s ease-in-out infinite;
}

.scroll-mouse {
    width: 24px;
    height: 38px;
    border: 2px solid var(--text-muted);
    border-radius: 12px;
    position: relative;
}

.scroll-wheel {
    width: 3px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollBounce {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(8px);
    }
}

@keyframes scrollWheel {

    0%,
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    50% {
        opacity: 0.3;
        transform: translateX(-50%) translateY(8px);
    }
}

/* ========================================
   ABOUT
   ======================================== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.about-intro {
    font-size: 1.25rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 1.05rem;
}

.highlight {
    background: var(--accent-gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.skills-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    padding: 8px 18px;
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-xl);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-base);
    cursor: default;
}

.skill-tag:hover {
    border-color: var(--accent-purple);
    color: var(--text-primary);
    background: rgba(124, 58, 237, 0.08);
    transform: translateY(-2px);
}

/* ========================================
   TIMELINE
   ======================================== */
.timeline-section {
    background:
        radial-gradient(ellipse 80% 40% at 50% 0%, rgba(124, 58, 237, 0.06), transparent),
        var(--bg-primary);
}

.timeline {
    position: relative;
    padding-left: 60px;
    max-width: 800px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-purple), var(--accent-blue), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 48px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -48px;
    top: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-gradient);
    box-shadow: 0 0 20px var(--accent-glow);
    border: 3px solid var(--bg-primary);
}

.timeline-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
    padding: 28px 32px;
    transition: var(--transition-base);
    backdrop-filter: blur(8px);
}

.timeline-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(124, 58, 237, 0.2);
    transform: translateX(8px);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-cyan);
    font-weight: 500;
}

.timeline-role {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 8px 0 12px;
}

.timeline-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ========================================
   PROJECTS
   ======================================== */
.projects {
    background:
        radial-gradient(ellipse 60% 50% at 80% 20%, rgba(37, 99, 235, 0.06), transparent),
        var(--bg-primary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-slow);
    position: relative;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(124, 58, 237, 0.1);
}

.project-card__image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.project-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: var(--transition-slow);
}

.project-card:hover .project-card__image {
    transform: scale(1.05);
}

.project-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 26, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-base);
    backdrop-filter: blur(4px);
}

.project-card:hover .project-card__overlay {
    opacity: 1;
}

.project-card__link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--accent-gradient);
    color: #fff;
    border-radius: var(--radius-xl);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-base);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.project-card__link-btn:hover {
    transform: scale(1.05);
}

.project-card__body {
    padding: 24px;
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.tag {
    padding: 4px 12px;
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-xl);
    font-size: 0.78rem;
    font-weight: 500;
    color: #a78bfa;
}

.project-card__title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.project-card__desc {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
}

/* ========================================
   CONTACT / SNS
   ======================================== */
.contact {
    background:
        radial-gradient(ellipse 60% 40% at 20% 80%, rgba(124, 58, 237, 0.05), transparent),
        var(--bg-primary);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.sns-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 36px 24px;
    background: var(--bg-card);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition-base);
    cursor: pointer;
}

.sns-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(124, 58, 237, 0.3);
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.sns-card__icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: 50%;
    color: var(--accent-cyan);
    transition: var(--transition-base);
}

.sns-card:hover .sns-card__icon {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 24px var(--accent-glow);
}

.sns-card__label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
}

.sns-card__handle {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    padding: 48px 0;
    border-top: 1px solid var(--border-subtle);
}

.footer-content {
    text-align: center;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ========================================
   ANIMATIONS (Scroll reveal)
   ======================================== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.15s;
}

.delay-2 {
    transition-delay: 0.3s;
}

.delay-3 {
    transition-delay: 0.45s;
}

.delay-4 {
    transition-delay: 0.6s;
}

/* Hero fade-up on load */
.animate-fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-up.delay-1 {
    animation-delay: 0.2s;
}

.animate-fade-up.delay-2 {
    animation-delay: 0.4s;
}

.animate-fade-up.delay-3 {
    animation-delay: 0.6s;
}

.animate-fade-up.delay-4 {
    animation-delay: 0.8s;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 80px 0;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 14, 26, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border-subtle);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .hero-name {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }

    .timeline {
        padding-left: 48px;
    }

    .timeline::before {
        left: 16px;
    }

    .timeline-dot {
        left: -40px;
    }

    .timeline-card {
        padding: 20px 24px;
    }
}

@media (max-width: 480px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
        max-width: 280px;
    }
}

/* ========================================
   PARTICLE CANVAS (Mouse-following confetti particles)
   ======================================== */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ========================================
   PARTICLE / AMBIENT EFFECTS
   ======================================== */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, var(--bg-primary), transparent);
    pointer-events: none;
    z-index: 1;
}

/* ========================================
   SCROLL PROGRESS BAR
   ======================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--accent-gradient);
    z-index: 9999;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* ========================================
   BACK TO TOP BUTTON
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--accent-glow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px var(--accent-glow);
}

/* ========================================
   SECTION-SPECIFIC REVEAL ANIMATIONS
   ======================================== */
/* About: slide from right */
.about .reveal {
    opacity: 0;
    transform: translateX(40px);
}

.about .reveal.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Timeline: slide from left */
.timeline-section .reveal {
    opacity: 0;
    transform: translateX(-40px);
}

.timeline-section .reveal.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Projects: scale up */
.projects .project-card.reveal {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
}

.projects .project-card.reveal.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Contact: fade in with slight zoom */
.contact .reveal {
    opacity: 0;
    transform: scale(0.95);
}

.contact .reveal.visible {
    opacity: 1;
    transform: scale(1);
}

/* Skill tags stagger animation */
.skills-grid .skill-tag {
    opacity: 0;
    transform: translateY(12px);
    animation: skillFadeIn 0.4s ease forwards;
}

.skills-grid .skill-tag:nth-child(1) {
    animation-delay: 0.1s;
}

.skills-grid .skill-tag:nth-child(2) {
    animation-delay: 0.15s;
}

.skills-grid .skill-tag:nth-child(3) {
    animation-delay: 0.2s;
}

.skills-grid .skill-tag:nth-child(4) {
    animation-delay: 0.25s;
}

.skills-grid .skill-tag:nth-child(5) {
    animation-delay: 0.3s;
}

.skills-grid .skill-tag:nth-child(6) {
    animation-delay: 0.35s;
}

.skills-grid .skill-tag:nth-child(7) {
    animation-delay: 0.4s;
}

.skills-grid .skill-tag:nth-child(8) {
    animation-delay: 0.45s;
}

.skills-grid .skill-tag:nth-child(9) {
    animation-delay: 0.5s;
}

.skills-grid .skill-tag:nth-child(10) {
    animation-delay: 0.55s;
}

.skills-grid .skill-tag:nth-child(11) {
    animation-delay: 0.6s;
}

.skills-grid .skill-tag:nth-child(12) {
    animation-delay: 0.65s;
}

@keyframes skillFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   SKIP NAVIGATION (Accessibility)
   ======================================== */
.skip-nav {
    position: fixed;
    top: -100%;
    left: 16px;
    padding: 12px 24px;
    background: var(--accent-gradient);
    color: #fff;
    border-radius: var(--radius-md);
    font-weight: 600;
    z-index: 10000;
    transition: top 0.3s ease;
    text-decoration: none;
}

.skip-nav:focus {
    top: 16px;
}

/* ========================================
   FOCUS VISIBLE (Keyboard Accessibility)
   ======================================== */
:focus-visible {
    outline: 2px solid #a78bfa;
    outline-offset: 3px;
    border-radius: 4px;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid #a78bfa;
    outline-offset: 3px;
}

/* ========================================
   PROJECT FILTERS
   ======================================== */
.project-filters {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
}

.filter-btn:hover {
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 12px var(--accent-glow);
}

/* Project card filter transitions */
.project-card {
    transition: var(--transition-slow), opacity 0.4s ease, max-height 0.4s ease;
}

.project-card.hidden {
    opacity: 0;
    transform: scale(0.8);
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: none;
    pointer-events: none;
}

/* ========================================
   PERFORMANCE — GPU hints
   ======================================== */
#particleCanvas {
    will-change: contents;
}

.hero-glow {
    will-change: transform;
}

/* ========================================
   ACCESSIBILITY — Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    .animate-fade-up {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    .hero-glow {
        animation: none !important;
    }

    .scroll-progress {
        transition: none;
    }

    #particleCanvas {
        display: none;
    }
}