/* Modern Academic Website CSS - 2025 Design */

/* Import modern fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* CSS Variables for consistent theming */
:root {
    --primary-color: #1e1f22;
    --primary-dark: #1d4ed8;
    --secondary-color: #4b4e52;
    --accent-color: #06b6d4;
    --text-primary: #0f172a;
    --text-secondary: #253346;
    --text-muted: #94a3b8;
    --background: #ffffff;
    --background-secondary: #f8fafc;
    --background-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --border-subtle: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* Base styles */
* {
    box-sizing: border-box;
}

body {
    background: var(--background);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

#contents {
    max-width: 1200px;
    width: 90%;
    margin: 0 auto;
    padding: 0;
    position: relative;
}

/* Typography */
h1#topname {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h1 {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
    letter-spacing: -0.01em;
}

h2.subproject {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.5rem 0 0.75rem 0;
}

/* Full-width sections with background distinctions */
.box {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 3rem calc(50vw - 600px);
    position: relative;
    box-sizing: border-box;
}

/* Responsive padding for smaller screens */
@media (max-width: 1200px) {
    .box {
        padding: 3rem 2rem;
        margin-left: calc(-50vw + 50%);
        width: 100vw;
    }
}

/* Alternating background colors */
.box:nth-child(odd) {
    background: var(--background);
}

.box:nth-child(even) {
    background: var(--background-secondary);
}

/* Header section with profile */
div#name.box {
    background: var(--background);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: start;
}

.right {
    width: 220px;
    text-align: right;
    justify-self: end;
}

.right img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}


/* Professional info styling */
div#name.box p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0.5rem 0;
}

div#name.box p:first-of-type {
    font-weight: 500;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* News section */
div#news.box {
    /* padding: 3rem calc(50vw - 50%); */
    background: var(--background-tertiary);
    /* margin: 0; */
}

div#news .boxtitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

div#news .boxtitle::before {
    content: '📰';
    font-size: 1.2rem;
}

/* Project cards */
.project {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 2rem calc(50vw - 600px);
    position: relative;
    box-sizing: border-box;
}

@media (max-width: 1200px) {
    .project {
        padding: 2rem 2rem;
        margin-left: calc(-50vw + 50%);
        width: 100vw;
    }
}

/* Individual project background colors */
.project:nth-child(1) {
    background: #f8fafc;
}

.project:nth-child(2) {
    background: #f1f5f9;
}

.project:nth-child(3) {
    background: #ecfdf5;
}

.project:nth-child(4) {
    background: #fef3c7;
}

.project:nth-child(5) {
    background: #fce7f3;
}

.project:nth-child(6) {
    background: #e0f2fe;
}

.project:nth-child(7) {
    background: #f3e8ff;
}

.project:nth-child(8) {
    background: #fff7ed;
}

/* Continue pattern for more projects */
.project:nth-child(n+9) {
    background: var(--background-secondary);
}

.projecttitle {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: right;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-subtle);
}

.projectdesc {
    text-align: justify;
    color: var(--text-secondary);
    line-height: 1.7;
}

div#research.box {
    padding-bottom: 0rem; /* Match your top padding */
}

/* Responsive design */
@media (max-width: 768px) {
    .box {
        padding: 2rem 1rem;
    }
    
    .project {
        padding: 2rem 1rem;
    }
    
    div#name.box {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 2rem 1rem;
    }
    
    .right {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .projecttitle {
        text-align: center;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    h1#topname {
        font-size: 2rem;
        text-align: center;
    }
    
    .box {
        padding: 1.5rem 0.5rem;
    }
    
    .project {
        padding: 1.5rem 0.5rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
a:focus, button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .box {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    div#sidebar {
        display: none;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}

/* Link styling */
a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-color);
}

a:visited {
    color: var(--secondary-color);
}