:root {
    --primary-color: #1c2833;
    --secondary-color: #2c3e50;
    --accent-color: #3498db;
    --bg-light: #f8f9fa;
    --text-main: #333333;
    --text-muted: #666666;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Lato', sans-serif;
}

html {
    overflow-x: hidden;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100%;
}

h1, h2, h3, .logo {
    font-family: 'Playfair Display', serif;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Nav */
.header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    transition: color 0.3s;
}

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

/* Hero Section */
.hero {
    padding: 6rem 0;
    background-color: #ffffff;
}

.hero-container {
    display: flex;
    gap: 4rem;
    align-items: center;
}

.hero-image {
    flex: 1;
    max-width: 400px;
}

.hero-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.hero-content {
    flex: 2;
}

.hero h1 {
    font-size: clamp(2.1rem, 6vw, 3.5rem);
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.subtitle {
    font-size: clamp(0.95rem, 2.6vw, 1.2rem);
    color: var(--accent-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2rem;
}

.divider {
    height: 4px;
    width: 60px;
    background-color: var(--accent-color);
    margin-bottom: 2rem;
}

.bio {
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

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

.social-btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.social-btn:hover {
    background-color: var(--accent-color);
}

.social-btn.outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.social-btn.outline:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* Sections Common */
.section-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    color: var(--primary-color);
    margin-bottom: 3rem;
    text-align: center;
}

/* Experience */
.experience {
    padding: 6rem 0;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 2px;
    background-color: #e0e0e0;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 60px;
}

.timeline-dot {
    position: absolute;
    left: 12px;
    top: 5px;
    width: 18px;
    height: 18px;
    background-color: var(--accent-color);
    border-radius: 50%;
    border: 4px solid var(--bg-light);
}

.timeline-content {
    background: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.timeline-content h3 {
    font-size: 1.4rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.timeline-date {
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Education */
.education {
    padding: 6rem 0;
    background-color: #ffffff;
}

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

.edu-card {
    background-color: var(--bg-light);
    padding: clamp(1.5rem, 5vw, 2.5rem);
    border-radius: 8px;
    text-align: center;
    border-top: 4px solid var(--accent-color);
    min-width: 0;
    overflow-wrap: break-word;
}

.edu-card h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.edu-card .institution {
    color: var(--text-muted);
    font-weight: 700;
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 3rem 0;
    text-align: center;
}

.footer a {
    color: #ffffff;
    text-decoration: underline;
    opacity: 0.8;
}

.footer a:hover {
    opacity: 1;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-links a {
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Contact */
.contact {
    padding: 6rem 0;
    background-color: var(--bg-light);
}

.contact-container {
    max-width: 700px;
    margin: 0 auto;
    background: #ffffff;
    padding: clamp(1.5rem, 4vw, 3rem);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.contact-intro {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
    font-size: clamp(0.95rem, 2vw, 1.1rem);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #d5dbe0;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #9aa5ad;
}

.contact-form .social-btn {
    align-self: flex-start;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}

.cf-turnstile {
    min-height: 65px;
}

.form-status {
    font-size: 0.95rem;
    min-height: 1.2em;
    margin: 0;
}

.form-status.success { color: #1e8449; }
.form-status.error { color: #c0392b; }

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .contact {
        padding: 3.5rem 0;
    }

    .contact-form .social-btn {
        width: 100%;
        text-align: center;
        align-self: stretch;
    }
}

/* ============================================================
   Responsive — ultra-wide monitors down to smartwatch browsers
   ============================================================ */

/* Ultra-wide: use more of the screen on large displays */
@media (min-width: 1600px) {
    .container {
        max-width: 1320px;
    }
}

/* Tablet: stack the hero */
@media (max-width: 900px) {
    .hero {
        padding: 4rem 0;
    }

    .hero-container {
        flex-direction: column;
        gap: 2.5rem;
        text-align: center;
    }

    .hero-image {
        max-width: min(360px, 80%);
        margin: 0 auto;
    }

    .divider {
        margin-left: auto;
        margin-right: auto;
    }

    .social-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-links {
        display: none;
    }
}

/* Phones */
@media (max-width: 600px) {
    .container {
        padding: 0 1.25rem;
    }

    .experience,
    .education,
    .hero {
        padding: 3.5rem 0;
    }

    .timeline-item {
        padding-left: 48px;
    }

    .timeline-content {
        padding: 1.5rem;
    }

    .edu-card {
        padding: 2rem 1.5rem;
    }

    .publications > .container > div {
        padding: 1.5rem !important;
    }
}

/* Smartwatch / ultra-small browsers */
@media (max-width: 340px) {
    .container {
        padding: 0 0.85rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    .education-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .edu-card {
        padding: 1.5rem 1rem;
    }

    .social-btn {
        width: 100%;
        text-align: center;
    }

    .timeline-item {
        padding-left: 38px;
    }

    .timeline::before {
        left: 14px;
    }

    .timeline-dot {
        left: 6px;
    }
}
