/* 
   PORTFOLIO V2.0 - MIDNIGHT PRECISION 
   Product Design Aesthetic | Clean | Dark | Structured
*/

:root {
    /* Design Tokens */
    --bg-main: #050505;
    --bg-card: #0A0A0A;
    --bg-card-hover: #111111;

    --text-primary: #FFFFFF;
    --text-secondary: #888888;
    --text-accent: #E0E0E0;

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.15);

    --accent-color: #6366f1;
    /* Indigo */
    --accent-glow: rgba(99, 102, 241, 0.4);

    --glass-dock: rgba(10, 10, 10, 0.6);
    --blur-xl: 20px;

    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --u-container: 1200px;
    --u-spacing-section: 120px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

ul {
    list-style: none;
}

/* Typography System */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

h1.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to bottom, #fff, #888);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--text-secondary);
    max-width: 600px;
    font-weight: 400;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.section-title::after {
    content: '';
    height: 1px;
    flex-grow: 1;
    background: var(--border-subtle);
}

/* Layout Utilities */
.container {
    max-width: var(--u-container);
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: var(--u-spacing-section) 0;
}

/* --- COMPONENTS --- */

/* 0. Spotlight Overlay (V2.1) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(29, 78, 216, 0.08),
            transparent 40%);
    z-index: -1;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* 1. Floating Navigation (Dock) */
.floating-nav {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;

    background: var(--glass-dock);
    backdrop-filter: blur(var(--blur-xl));
    -webkit-backdrop-filter: blur(var(--blur-xl));
    border: 1px solid var(--border-subtle);

    padding: 0.8rem 1.5rem;
    border-radius: 100px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);

    display: flex;
    gap: 2rem;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-link {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease, transform 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
}

.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--text-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--text-primary);
}

/* 2. Hero Section */
.hero-section {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding-top: 100px;
    /* Offset for aesthetic balance */
}

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.avatar-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    max-width: 400px;
    margin-left: auto;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.avatar-frame {
    width: 100%;
    height: 100%;
    border-radius: 30px;
    /* Subtler curve */
    background: #111;
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.avatar-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.avatar-frame:hover img {
    opacity: 1;
    transform: scale(1.05);
}

/* Global Cosmos Background */
#global-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Behind everything */
    pointer-events: none;
}

/* Glassmorphism for Sections */
.sidebar,
.hero,
.projects,
.education-grid,
.footer-cosmos {
    background: rgba(5, 5, 5, 0.7) !important;
    /* Semi-transparent black */
    backdrop-filter: blur(10px);
    /* Blur the stars behind */
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtle border */
}

/* Specific Section Adjustments */
.hero,
.footer-cosmos {
    background: transparent !important;
    /* Let stars shine through clearly */
    backdrop-filter: none;
    border: none;
    /* Remove border for open space feel */
}

.project-card,
.edu-card {
    background: rgba(20, 20, 20, 0.6);
    /* Slightly more opaque cards */
    backdrop-filter: blur(5px);
}

/* 6. Contact Section (V8.0 Cosmic Gateway) */
.footer-cosmic {
    position: relative;
    padding: 120px 5vw 40px;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.contact-header {
    text-align: center;
    margin-bottom: 4rem;
    z-index: 5;
}

.contact-title {
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.nexus-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 4rem auto;
    z-index: 5;
    position: relative;
}

.nexus-card {
    position: relative;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s ease, background 0.3s ease;
    cursor: pointer;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

.nexus-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: radial-gradient(600px circle at var(--mouse-x, -500px) var(--mouse-y, -500px), rgba(255, 255, 255, 0.4), transparent 40%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nexus-grid:hover .nexus-card::before {
    opacity: 1;
}

.nexus-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(20, 20, 20, 0.8);
    transform: translateY(-5px);
}

.nexus-main {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    min-height: 250px;
}

.nexus-icon-wrapper {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s ease;
}

.nexus-main:hover .nexus-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
    background: rgba(255, 255, 255, 0.1);
}

.nexus-icon {
    font-size: 1.8rem;
    color: var(--text-primary);
}

.nexus-text-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nexus-label {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    text-transform: uppercase;
    display: block;
}

.nexus-value {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

.nexus-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.nexus-main:hover .nexus-glow {
    opacity: 1;
}

.nexus-socials {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.nexus-social {
    aspect-ratio: 1/1;
    font-size: 2rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.nexus-social:hover {
    color: var(--text-primary);
}

/* Magnetic Content Wrapper */
.magnetic-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nexus-main .magnetic-content {
    align-items: flex-start;
}

.orbital-tooltip {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: var(--accent-color);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.nexus-main:hover .orbital-tooltip {
    opacity: 0.8;
    transform: translateY(0);
}

.nexus-main.copied .orbital-tooltip {
    background: #10b981;
    opacity: 1;
}

/* Footer Bottom Bar */
.footer-bottom-bar {
    width: 100%;
    max-width: var(--u-container);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.local-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 900px) {
    .footer-bottom-bar {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .cosmic-system {
        transform: scale(0.65);
        margin-bottom: 0;
    }

    .contact-title {
        font-size: 2.2rem;
    }
}

/* Fluid Dock (Mac Style) */
.mac-dock {
    display: flex;
    align-items: flex-end;
    /* Align bottom for scaling up */
    gap: 10px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    margin-top: 2rem;
    height: 70px;
    /* Fixed height container */
    box-sizing: content-box;
}

.dock-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 1.5rem;
    transition: width 0.2s cubic-bezier(0.25, 1.5, 0.5, 1), height 0.2s cubic-bezier(0.25, 1.5, 0.5, 1), margin-bottom 0.2s;
    position: relative;
}

.dock-icon:hover {
    transform: scale(1.1);
}

/* Status Pill */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 50px;
    color: #10b981;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 24px;
    backdrop-filter: blur(5px);
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: currentColor;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hero Title Animation (V2.1) */
h1.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff 20%, #888 40%, #888 60%, #fff 80%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 5s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

p.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--text-secondary);
    max-width: 600px;
    font-weight: 400;
}

/* Scroll Reveal Classes (V2.1) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

/* Stagger Delays */
.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.section-title::after {
    content: '';
    height: 1px;
    flex-grow: 1;
    background: linear-gradient(to right, var(--border-subtle), transparent);
}

/* 3. Infinite Marquee (Tech Stack) */
.marquee-wrapper {
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
    padding: 2rem 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    margin: 4rem 0;
}

.marquee-content {
    display: flex;
    gap: 4rem;
    width: max-content;
    animation: scroll 30s linear infinite;
}

.tech-item {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tech-item i {
    color: var(--text-primary);
}

@keyframes scroll {
    to {
        transform: translateX(-50%);
    }
}

/* 4. Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 300px;
}

.project-card:hover {
    border-color: var(--border-highlight);
    background: var(--bg-card-hover);
    transform: translateY(-5px);
}

.project-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #222, #111);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.project-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.project-card span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--text-secondary);
}

/* 5. Education Section (V2.1 Redesign) */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.edu-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.edu-card:hover {
    border-color: var(--accent-color);
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.1);
}

.edu-icon-box {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.edu-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.edu-info .edu-institution {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.2rem;
}

.edu-info .edu-year {
    font-size: 0.8rem;
    color: var(--accent-color);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}


/* RESPONSIVE */
@media (max-width: 768px) {
    .floating-nav {
        width: 90%;
        justify-content: space-around;
        padding: 0.8rem 1rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-subtitle {
        margin: 0 auto;
    }

    .avatar-container {
        margin: 0 auto;
        max-width: 300px;
        order: -1;
        /* Avatar on top for mobile */
    }

    h1.hero-title {
        font-size: 2.8rem;
    }

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