/* Base styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #0f172a;
    background-color: #f8fafc;
    line-height: 1.6;
}

/* Layout helpers */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Header and navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e5e7eb;
    font-weight: 600;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f766e, #2563eb);
    color: #f9fafb;
    font-size: 0.8rem;
}

.logo-text {
    font-size: 0.95rem;
}

.site-nav {
    display: flex;
    gap: 1.25rem;
}

.nav-link {
    color: #cbd5f5;
    font-size: 0.95rem;
    text-decoration: none;
    position: relative;
    padding-bottom: 0.2rem;
}

.nav-link:hover {
    color: #ffffff;
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 14px;
    height: 2px;
    border-radius: 999px;
    background: #38bdf8;
}

/* Hero */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    color: #e5e7eb;
    background-image:
        linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.7)),
        url("hero.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.25), transparent 55%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    padding: 3.5rem 0 3.25rem;
    flex-wrap: wrap;
}

.hero-text {
    max-width: 620px;
}

.hero-kicker {
    text-transform: uppercase;
    letter-spacing: 0.17em;
    font-size: 0.75rem;
    color: #a5f3fc;
    margin-bottom: 0.5rem;
}

.hero h1 {
    font-size: clamp(2.2rem, 3vw, 2.8rem);
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
}

.hero-subtitle {
    font-size: 1.05rem;
    font-weight: 500;
    color: #e0f2fe;
    margin-bottom: 1rem;
}

.hero-body {
    font-size: 0.98rem;
    color: #dbeafe;
    max-width: 34rem;
    margin-bottom: 1.5rem;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #cbd5f5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.25rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease,
        transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #0ea5e9, #22c55e);
    color: #0f172a;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.7);
}

.btn-secondary {
    background: transparent;
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.9);
}

.btn-secondary:hover {
    background: rgba(15, 23, 42, 0.75);
}

/* Text links */
.text-link {
    color: #bae6fd;
    text-decoration: none;
    border-bottom: 1px dashed rgba(186, 230, 253, 0.5);
    padding-bottom: 1px;
}

.text-link:hover {
    color: #f9fafb;
    border-bottom-style: solid;
}

/* Hero profile image */
.hero-photo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-profile {
    width: 170px;
    height: 170px;
    border-radius: 999px;
    border: 3px solid rgba(248, 250, 252, 0.95);
    object-fit: cover;
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.9);
    background-color: #020617;
}

/* Sections */
.section {
    padding: 3rem 0;
}

.section-alt {
    background-color: #0f172a;
    color: #e5e7eb;
}

.section-title {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.section-intro {
    font-size: 0.95rem;
    max-width: 32rem;
    margin-bottom: 1.75rem;
    color: #cbd5f5;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
}

.card {
    background-color: #ffffff;
    border-radius: 0.9rem;
    padding: 1.2rem 1.25rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.04);
    font-size: 0.93rem;
}

.section-alt .card {
    background-color: #020617;
    border-color: rgba(148, 163, 184, 0.6);
}

.card h3 {
    font-size: 1.02rem;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.section-alt .card h3 {
    color: #e5e7eb;
}

.section-cta {
    margin-top: 1.75rem;
}

/* About page specific */
.about-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 2.5rem;
}

.about-section-title {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.about-paragraph {
    font-size: 0.96rem;
    margin-bottom: 0.9rem;
}

.about-list {
    list-style-type: disc;
    margin-left: 1.2rem;
    font-size: 0.94rem;
}

.timeline {
    border-left: 2px solid #e5e7eb;
    padding-left: 1.1rem;
    margin-top: 0.75rem;
}

.timeline-item {
    margin-bottom: 1rem;
    position: relative;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -1.2rem;
    top: 0.3rem;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #22c55e;
}

.timeline-role {
    font-weight: 600;
    font-size: 0.95rem;
}

.timeline-org {
    font-size: 0.9rem;
    color: #4b5563;
}

.timeline-meta {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Footer */
.site-footer {
    border-top: 1px solid #e2e8f0;
    padding: 1.4rem 0;
    background-color: #ffffff;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #6b7280;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }

    .hero {
        min-height: 75vh;
    }

    .site-nav {
        gap: 0.9rem;
        font-size: 0.9rem;
    }

    .about-layout {
        grid-template-columns: 1fr;
    }
}

/* ==== LINK STYLING (GLOBAL) ==== */

a,
.text-link {
    color: #1e6bb8;               /* strong academic blue */
    text-decoration: none;
    font-weight: 500;
}

a:hover,
.text-link:hover {
    color: #004a99;               /* darker on hover */
    text-decoration: underline;
}

/* Email button */

.btn-email {
    display: inline-block;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    border: 1px solid #1e6bb8;
    color: #1e6bb8;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    background: transparent;
}

.btn-email:hover {
    background: #1e6bb8;
    color: #ffffff;
}

/* ==== IMPROVE TEXT VISIBILITY ==== */

/* Darker, high-contrast default text colour */
body {
    color: #1f2933; /* deep grey/near-black, very readable */
}

/* Main paragraph styles */
.section-intro,
.about-paragraph,
.about-list li {
    color: #1f2933;
}

/* Meta text (dates, locations) still slightly softer but readable */
.timeline-meta,
.project-meta {
    color: #6b7280;
}

/* ==== PROJECTS PAGE LAYOUT ==== */

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    margin-top: 1.5rem;
}

.project-item {
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.project-title-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-title-row h3 {
    margin: 0;
    font-size: 1.05rem;
}

.project-meta {
    font-size: 0.9rem;
    font-weight: 500;
}

.project-desc {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ==== FIX: intro text on dark sections (Selected projects) ==== */
.section-alt .section-intro {
    color: #e5e7eb;  /* light text so it’s clearly visible on the dark background */
}
