/* Base styles and Design Tokens */
:root {
    --primary: #a34e33;
    /* Terracotta */
    --primary-light: #c06346;
    --accent: #d97706;
    /* Darker Golden Yellow for legibility */
    --accent-hover: #b45309;
    --secondary: #1a2e05;
    /* Deep Forest Green for max contrast */
    --secondary-light: #365314;
    --text-main: #3b3a30;
    /* Dark olive/charcoal */
    --text-heading: #2d1b14;
    /* Deep terracotta charcoal */
    --text-muted: #6b6a5a;
    --bg-white: #fcfaf2;
    /* Soft cream */
    --bg-light: #f4f1e1;
    /* Warmer cream */
    --white: #ffffff;
    --shadow-sm: 0 1px 3px 0 rgba(163, 78, 51, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(163, 78, 51, 0.1), 0 2px 4px -2px rgba(163, 78, 51, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(163, 78, 51, 0.1), 0 4px 6px -4px rgba(163, 78, 51, 0.1);
    --container-width: 1000px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    line-height: 1.7;
    background-color: var(--bg-white);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 150px 150px;
    background-attachment: fixed;
    opacity: 0.98;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-heading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

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

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

.section {
    padding: 7rem 0;
    /* More whitespace */
}

.section-title {
    font-size: 2.8rem;
    margin-bottom: 3.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 80px;
    height: 5px;
    background: linear-gradient(to right, var(--accent), transparent);
    /* Softer line */
    border-radius: 3px;
}

.bg-light {
    background-color: var(--bg-light);
    position: relative;
    overflow: hidden;
}

.bg-light::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.05;
    filter: blur(40px);
    z-index: 0;
}

/* Header & Nav */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

header.scrolled {
    padding: 0.5rem 0;
    box-shadow: var(--shadow-sm);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-links a {
    font-weight: 500;
    color: var(--text-heading);
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
}

.menu-toggle {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--primary);
    transition: var(--transition);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    border: none;
}

.btn.primary {
    background-color: var(--accent);
    color: var(--white);
}

.btn.primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.btn.secondary {
    background-color: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn.secondary:hover {
    background-color: rgba(14, 165, 233, 0.05);
    transform: translateY(-2px);
}

/* Hero & Landing Section */
.hero {
    display: flex;
    align-items: center;
    padding-top: 100px;
    padding-bottom: 100px;
    position: relative;
    overflow: hidden;
}

/* About Section Styles */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
    text-align: justify;
}

.about-text strong {
    color: var(--secondary);
    font-weight: 700;
}

/* Photo Gallery */
.about-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 4rem;
}

@media (max-width: 768px) {
    .about-gallery {
        grid-template-columns: 1fr;
    }
}

.gallery-item {
    aspect-ratio: 1/1;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    background: var(--bg-light);
    border: 1px solid rgba(163, 78, 51, 0.1);
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(26, 46, 5, 0.3);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.intro-header h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.hero-shape {
    position: absolute;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.12;
    /* Slightly more subtle */
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    filter: blur(40px);
    z-index: -1;
    animation: morphing 15s ease-in-out infinite;
}

@keyframes morphing {
    0% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
        transform: rotate(0deg);
    }

    34% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
    }

    67% {
        border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%;
    }

    100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
        transform: rotate(360deg);
    }
}

/* Profile Card removed for simpler layout */

/* Research Cards */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.research-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

.research-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(14, 165, 233, 0.2);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.research-card h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

/* News Section */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.news-item {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    background: var(--white);
    border-radius: 20px;
    border: 1px solid rgba(74, 55, 40, 0.05);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.news-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
}

.news-date {
    font-weight: 700;
    color: var(--accent);
    min-width: 60px;
    font-size: 1.1rem;
}

.news-content p {
    color: var(--text-main);
}

.news-content a {
    color: var(--primary);
    font-weight: 600;
    position: relative;
    padding-bottom: 2px;
    border-bottom: 2px solid rgba(163, 78, 51, 0.2);
    transition: var(--transition);
}

.news-content a:hover {
    color: var(--primary-light);
    border-bottom-color: var(--primary-light);
    background: rgba(163, 78, 51, 0.05);
    padding-left: 4px;
    padding-right: 4px;
    border-radius: 4px;
}

/* Projects */
.project-link {
    margin-top: 1rem;
    display: inline-block;
    color: var(--accent);
    font-weight: 600;
    transition: var(--transition);
}

.project-link:hover {
    text-decoration: underline;
    transform: translateX(5px);
}

/* Footer (Updated for padding) */
footer {
    padding: 3rem 0;
    background: var(--primary);
    color: var(--white);
    text-align: center;
}

/* Contact */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    max-width: 800px;
}

.contact-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.contact-item .icon {
    font-size: 1.5rem;
    color: var(--accent);
    background: rgba(14, 165, 233, 0.1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.contact-item .label {
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.2rem;
}

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

.social-icon {
    background: var(--primary);
    color: var(--white);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.social-icon:hover {
    background: var(--accent);
    transform: scale(1.05);
}

/* Footer */
footer {
    padding: 4rem 0;
    background: var(--text-heading);
    color: var(--bg-white);
    text-align: center;
}

footer p {
    opacity: 0.8;
    font-size: 0.95rem;
}

/* Navigation Active State */
.nav-links a.active {
    color: var(--accent);
}

/* Projects Page Detail */
.project-detail {
    background: var(--white);
    padding: 3rem;
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(74, 55, 40, 0.05);
}

.project-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.project-header h2 {
    margin-bottom: 0;
    font-size: 2rem;
}

.project-body p {
    font-size: 1.15rem;
    color: var(--text-main);
    line-height: 1.8;
}

/* Student Note */
.student-note {
    margin-top: 3rem;
    padding: 1.5rem 2rem;
    background: var(--bg-light);
    border-radius: 12px;
    border-left: 4px solid var(--accent);
    font-size: 1rem;
    color: var(--text-heading);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

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

/* Mobile Responsive */
@media (max-width: 968px) {
    .container {
        padding: 0 1.5rem;
    }

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

    .hero-text h1 {
        font-size: 3rem;
    }

    .hero-cta {
        justify-content: center;
    }

    .profile-card {
        max-width: 400px;
        margin: 0 auto;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        box-shadow: var(--shadow-md);
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

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

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 1rem 2rem;
        width: 100%;
    }

    .menu-toggle {
        display: block;
    }
}