/* ===========================
   Root Variables
   =========================== */

:root {
    --background: #0F0F0F;
    --white: #FFFFFF;
    --gray-light: #CCCCCC;
    --gray-medium: #999999;
    --gray-dark: #666666;
    --card-bg: #1A1A1A;
    --border-color: #2A2A2A;
    --font-main: 'Inter', sans-serif;
}

/* ===========================
   Reset & General Styling
   =========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--background);
    color: var(--gray-light);
    line-height: 1.6;
    overflow-x: hidden;
}

h1 {
    font-size: clamp(3.5rem, 8vw, 6rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--white);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--gray-light);
}

h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-light);
}

h4 {
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--gray-medium);
}

p {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.7;
    color: var(--gray-medium);
}

a {
    color: var(--gray-light);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.7;
}

/* ===========================
   Vanta Background
   =========================== */

#vanta-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    transition: opacity 0.5s ease;
}

#vanta-bg.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ===========================
   Header & Navigation
   =========================== */

header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-name {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--gray-medium);
    font-weight: 500;
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--gray-light);
    opacity: 1;
}

/* ===========================
   Main & Section Layout
   =========================== */

main {
    position: relative;
    z-index: 1;
}

section {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(3rem, 8vw, 6rem) 2rem;
    min-height: auto;
}

/* ===========================
   Hero Section with Large Background Image
   =========================== */

#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-top: 8rem;
    gap: 0;
    position: relative;
}

.hero-text {
    flex: 1;
    max-width: 650px;
    position: relative;
    z-index: 2;
}

.hero-image-container {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    pointer-events: none;
}

.hero-image {
    width: 420px;
    height: 550px;
    max-width: 90%;
    object-fit: cover;
    opacity: 1;
    filter: grayscale(100%);
    border-radius: 16px;
}

.bio {
    margin-bottom: 2rem;
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--gray-medium);
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
}

.hero-links a {
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    color: var(--gray-dark);
}

.hero-links a:hover {
    color: var(--gray-light);
}

/* ===========================
   Grid & Card Layout
   =========================== */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-color: var(--gray-dark);
}

.card h3 {
    margin-bottom: 0.5rem;
}

.card h4 {
    margin-bottom: 1rem;
    font-weight: 500;
}

.card p {
    margin-top: 1rem;
}

/* ===========================
   Horizontal Scrolling Section
   =========================== */

.scrolling-wrapper {
    overflow: hidden;
    width: 100%;
    padding: 20px 0;
    -webkit-mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
    mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
}

.scrolling-grid {
    display: flex;
    animation: marquee 40s linear infinite;
}

#experience .scrolling-grid {
    width: calc(380px * 7);
}

#projects .scrolling-grid {
    width: calc(380px * 4);
}

.scrolling-wrapper .card {
    flex: 0 0 350px;
    margin-right: 30px;
}

@keyframes marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

.scrolling-wrapper:hover .scrolling-grid {
    animation-play-state: paused;
}

/* ===========================
   Honors Grid with Hover Details
   =========================== */

.honors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 2rem;
}

.honors-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.honor-item {
    position: relative;
    padding: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--gray-light);
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 1;
}

.honor-title {
    display: block;
    position: relative;
    z-index: 1;
}

.honor-details {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: rgba(26, 26, 26, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gray-dark);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.4s ease;
    z-index: 100;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.honor-item:hover {
    z-index: 50;
}

.honor-item:hover .honor-details {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.honor-item:hover {
    border-color: var(--gray-dark);
}

.honor-details h4 {
    font-size: 1.1rem;
    color: var(--gray-light);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.honor-issuer {
    font-size: 0.85rem;
    color: var(--gray-dark);
    margin-bottom: 1rem;
}

.honor-description {
    font-size: 0.95rem;
    color: var(--gray-medium);
    line-height: 1.6;
}

/* ===========================
   About Section
   =========================== */

#about {
    text-align: center;
}

#about p {
    max-width: 800px;
    margin: 0 auto;
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    line-height: 1.8;
}

/* ===========================
   Footer/Contact Section
   =========================== */

footer {
    text-align: center;
    padding: clamp(3rem, 8vw, 6rem) 2rem;
    border-top: 1px solid var(--border-color);
    max-width: 1200px;
    margin: 0 auto;
}

footer h2 {
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.contact-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--gray-light);
    transition: all 0.3s ease;
    font-weight: 500;
}

.contact-links a:hover {
    border-color: var(--gray-dark);
    background: rgba(102, 102, 102, 0.1);
    transform: translateY(-3px);
    opacity: 1;
}

.contact-links svg {
    width: 24px;
    height: 24px;
}

/* ===========================
   Animation Classes
   =========================== */

.hidden-anim {
    opacity: 0;
    transform: translateY(20px);
}

.show-anim {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .nav-name {
        font-size: 1.25rem;
    }
    
    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .nav-links a {
        font-size: 0.9rem;
    }
    
    h1 {
        font-size: clamp(2.5rem, 6vw, 4rem);
    }
    
    /* Hero Section Mobile */
    #hero {
        flex-direction: column;
        gap: 30px;
        padding-top: 6rem;
    }
    
    .hero-text {
        flex: 1;
        max-width: 100%;
    }
    
    .hero-image-container {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: 100%;
        height: auto;
        justify-content: center;
        order: -1;
    }
    
    .hero-image {
        width: 300px;
        height: 400px;
        opacity: 1;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .honors-grid {
        grid-template-columns: 1fr;
    }
    
    section {
        padding: 3rem 1.5rem;
    }
    
    /* Scrolling Wrapper Mobile */
    .scrolling-wrapper .card {
        flex: 0 0 300px;
    }
    
    #experience .scrolling-grid {
        width: calc(330px * 7);
    }
    
    #projects .scrolling-grid {
        width: calc(330px * 4);
    }
    
    /* Honor Details Mobile */
    .honor-details {
        position: relative;
        display: none;
        margin-top: 1rem;
    }
    
    .honor-item:hover .honor-details {
        display: block;
        position: relative;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .nav-name {
        font-size: 1.1rem;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    h1 {
        font-size: clamp(2rem, 5vw, 3rem);
    }
    
    .hero-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .contact-links {
        flex-direction: column;
        align-items: center;
    }
    
    .contact-links a {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .hero-image {
        width: 250px;
        height: 350px;
    }
}
