:root {
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --accent: #0066ff;
    --accent-light: #e6f0ff;
    --border: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-tertiary: #707070;
    --accent: #3b82f6;
    --accent-light: #1e293b;
    --border: #2a2a2a;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

img {
    max-width: 100%;
    height: auto;
}

/* Prevent zoom on input focus (iOS) */
@media screen and (max-width: 768px) {
    input,
    textarea,
    select {
        font-size: 16px !important;
    }
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: var(--transition);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 70px;
    background-color: var(--bg-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 9999;
    transition: var(--transition);
}

[data-theme="dark"] .navbar {
    background-color: rgba(10, 10, 10, 0.8);
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

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

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.theme-icon {
    font-size: 1.2rem;
}

/* Container */
.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 70px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    max-width: 100%;
    position: relative;
    z-index: 1;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

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

.hero-description.typing {
    overflow: hidden;
}

.hero-description.typing::after {
    content: '|';
    color: var(--accent);
    animation: blink 0.7s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hero-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: var(--transition);
}

.hero-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--accent-light);
}

.hero-link svg {
    width: 18px;
    height: 18px;
}

/* Section */
.section {
    padding: 6rem 0;
    position: relative;
    z-index: 2;
    background-color: var(--bg-primary);
}

.section-alt {
    background-color: var(--bg-secondary);
}

.section-title {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Updates Section */
.section-updates {
    background-color: var(--bg-secondary);
}

.updates-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.update-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.update-item .update-image {
    grid-column: 2 / 3;
}

.update-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.update-item:hover {
    opacity: 0.8;
}

.update-date {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-weight: 500;
    text-align: right;
    padding-top: 0.15rem;
}

.update-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.update-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    margin-top: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.update-image:hover {
    border-color: var(--accent);
    transform: scale(1.01);
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.about-profile {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.profile-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--border);
    transition: var(--transition);
}

.profile-image:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

.about-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.inline-link {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.inline-link:hover {
    border-bottom-color: var(--accent);
}

.about-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-card {
    padding: 1.5rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.info-title {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.info-list {
    list-style: none;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.info-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.info-list li:last-child {
    border-bottom: none;
}

.info-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.info-text-small {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}



/* Publications */
.pub-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background-color: var(--bg-secondary);
    border-radius: 12px;
}

.pub-stat {
    text-align: center;
}

.pub-stat-num {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.pub-stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.publications-compact {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.pub-item {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.pub-item:last-child {
    border-bottom: none;
}

.pub-year {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    font-weight: 600;
    text-align: right;
}

.pub-title {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.pub-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.pub-link:hover {
    color: var(--accent);
}

.pub-authors {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.pub-authors strong {
    color: var(--text-primary);
}

.pub-venue {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
}

.view-more {
    text-align: center;
    margin-top: 3rem;
}

.view-more-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.view-more-link:hover {
    opacity: 0.7;
}

/* Contact */
.contact-simple {
    max-width: 700px;
    margin: 0 auto;
}

.contact-lead {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 3rem;
    line-height: 1.7;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.contact-method {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: var(--transition);
}

.contact-method:hover {
    border-color: var(--accent);
}

.contact-method svg {
    color: var(--accent);
    flex-shrink: 0;
}

.contact-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
}

.contact-value:hover {
    color: var(--accent);
}

.contact-email-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background-color: var(--bg-secondary);
    border-color: var(--accent);
    color: var(--accent);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn.copied {
    background-color: var(--accent);
    border-color: var(--accent);
    color: white;
}


/* Footer */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    background-color: var(--bg-secondary);
}

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

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

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

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
    line-height: 1;
    transform-origin: center;
}

.mobile-menu-toggle:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.mobile-menu-toggle.active {
    color: var(--accent);
    transform: rotate(90deg);
}

/* Mobile menu overlay */
body.menu-open::before {
    content: '';
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    animation: fadeIn 0.4s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        position: relative;
        z-index: 9999;
    }
    
    .nav-menu {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: calc(100vh - 70px);
        background-color: var(--bg-primary);
        border-top: 1px solid var(--border);
        flex-direction: column;
        padding: 0;
        margin: 0;
        gap: 0;
        box-shadow: 0 8px 32px var(--shadow);
        overflow-y: auto;
        z-index: 10000;
        -webkit-overflow-scrolling: touch;
        transform: translateY(-20px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
    }

    .nav-menu.active {
        display: flex !important;
        visibility: visible !important;
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0s;
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid var(--border);
        margin: 0;
        padding: 0;
        opacity: 0;
        transform: translateX(-20px);
        animation: none;
    }
    
    .nav-menu.active li {
        animation: slideInLeft 0.4s ease forwards;
    }
    
    .nav-menu.active li:nth-child(1) { animation-delay: 0.05s; }
    .nav-menu.active li:nth-child(2) { animation-delay: 0.1s; }
    .nav-menu.active li:nth-child(3) { animation-delay: 0.15s; }
    .nav-menu.active li:nth-child(4) { animation-delay: 0.2s; }
    .nav-menu.active li:nth-child(5) { animation-delay: 0.25s; }
    .nav-menu.active li:nth-child(6) { animation-delay: 0.3s; }

    .nav-link {
        display: block;
        padding: 1.25rem 2rem;
        width: 100%;
        text-align: left;
        color: var(--text-primary);
        transition: all 0.2s ease;
        background-color: var(--bg-primary);
    }

    .nav-link:hover,
    .nav-link:active {
        background-color: var(--bg-secondary);
        color: var(--accent);
        transform: translateX(10px);
        padding-left: 2.5rem;
    }

    .mobile-menu-toggle {
        display: block;
        z-index: 10001;
        position: relative;
    }
    
    .theme-toggle {
        position: relative;
        z-index: 10001;
    }

    .hero {
        min-height: auto;
        padding: 70px 1rem 3rem;
        position: relative;
        z-index: 1;
    }
    
    .hero-content {
        padding-bottom: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
        letter-spacing: -1px;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-description {
        font-size: 1rem;
        max-width: 100%;
    }

    .hero-links {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        margin-bottom: 2rem;
    }

    .hero-link {
        width: 100%;
        justify-content: center;
        position: relative;
        z-index: 1;
    }

    .status-indicator {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .section {
        padding: 4rem 0;
        position: relative;
        z-index: 2;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    .update-item {
        grid-template-columns: 80px 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .update-date {
        text-align: left;
        font-size: 0.8rem;
    }

    .update-text {
        font-size: 0.9rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-profile {
        justify-content: center;
        margin-bottom: 1.5rem;
    }

    .profile-image {
        width: 150px;
        height: 150px;
    }

    .about-text {
        font-size: 1rem;
    }

    .info-card {
        padding: 1.25rem;
    }

    .pub-item {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding-bottom: 1.5rem;
    }

    .pub-year {
        text-align: left;
    }

    .pub-title {
        font-size: 0.95rem;
    }

    .pub-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

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

    .contact-method {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .container-narrow {
        padding: 0 1rem;
    }

    .nav-container {
        padding: 0 1rem;
        height: 70px;
    }

    .nav-brand {
        font-size: 1.2rem;
    }

    .hero {
        min-height: auto;
        padding: 70px 1rem 3rem;
    }
    
    .hero-content {
        padding-bottom: 2rem;
    }

    .hero-title {
        font-size: 2rem;
        letter-spacing: -0.5px;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-description {
        font-size: 0.95rem;
        min-height: 4rem;
        line-height: 1.6;
    }
    
    .typing-cursor {
        height: 1em;
    }

    .hero-tags {
        gap: 0.5rem;
    }

    .tag {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .update-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .update-item .update-image {
        grid-column: 1 / -1;
        max-width: 100%;
    }

    .update-date {
        text-align: left;
        font-size: 0.75rem;
    }

    .profile-image {
        width: 120px;
        height: 120px;
    }

    .pub-stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 1rem;
        gap: 0.75rem;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    .pub-stat {
        padding: 1rem;
    }

    .contact-method {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .contact-method svg {
        margin: 0 auto;
    }

    .contact-email-wrapper {
        justify-content: center;
        flex-wrap: wrap;
    }

    .copy-btn {
        padding: 0.5rem;
    }
}

/* Extra small devices (iPhone SE, etc.) */
@media (max-width: 375px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.35rem;
    }
    
    .nav-brand {
        font-size: 1.1rem;
    }
    
    .pub-stats {
        grid-template-columns: 1fr;
    }
    
    .update-date {
        font-size: 0.7rem;
    }
    
    .update-text {
        font-size: 0.85rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Increase tap targets for touch devices */
    .nav-link,
    .hero-link,
    .contact-link,
    .view-more-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .theme-toggle {
        min-width: 44px;
        min-height: 44px;
    }

    .sidebar-link {
        min-height: 44px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

