/* ===== Base Styles (LIGHT) ===== */
:root {
    --primary-color: #0077b6;
    --primary-dark: #023e8a;
    --secondary-color: #457b9d;
    --secondary-light: #48cae4;

    --text-color: #1a1a2e;
    --text-light: #344056;

    --background: #f9fafb;
    --white: #ffffff;
    --off-white: #f8f9fa;
    --border-color: #e9ecef;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.07);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-accent: 'Amiri', serif;

    --transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    --container-max-width: 1200px;
    --section-spacing: 6rem;
}

/* Smooth theme transition for color-only props */
html,
body,
section,
.card,
.stat-item,
.project-card,
.testimonial,
.resource-category {
    transition: background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

body {
    font-family: var(--font-sans);
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---- Typography (use tokens; no hard-coded dark text) ---- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-color);
    /* was #1a1a2e */
    line-height: 1.3;
    letter-spacing: -0.02em;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    font-size: 1.05rem;
    font-weight: 500;
}

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

section {
    padding: var(--section-spacing) 0;
    position: relative;
    overflow: hidden;
}

section+section {
    margin-top: 0;
}

/* ===== Layout Components ===== */
.card {
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
    border: none;
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    position: relative;
    border-top: 5px solid var(--primary-color);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, .12);
    border-top-width: 6px;
}

.card::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at bottom right, rgba(0, 119, 182, .07), transparent 70%);
    border-radius: 0 0 var(--radius-md) 0;
    z-index: 0;
}

/* Decorated heading */
.decorated-heading {
    font-family: var(--font-heading);
    font-weight: 800;
    text-align: center;
    position: relative;
    margin-bottom: 4.5rem;
    letter-spacing: -0.03em;
    font-size: 2.5rem;
    color: var(--text-color);
    padding-bottom: 1.5rem;
}

.decorated-heading::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.decorated-heading::before {
    content: "";
    position: absolute;
    bottom: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 119, 182, .2), transparent);
}

/* ===== Header (unchanged visuals) ===== */
header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 7rem 0 6rem;
    text-align: center;
    position: relative;
    background-image: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    margin: 0;
    border-bottom: none;
}

header::after {
    content: none;
}

nav {
    margin-top: 3rem;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    padding: .75rem 1.25rem;
    position: relative;
    transition: var(--transition);
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, .1);
    backdrop-filter: blur(5px);
}

nav a:hover {
    background-color: rgba(255, 255, 255, .2);
    transform: translateY(-2px);
}

/* Small, non-invasive toggle */
.theme-toggle {
    position: absolute;
    top: 14px;
    right: 16px;
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border-radius: 999px;
    padding: .6rem .8rem;
    cursor: pointer;
    line-height: 0;
    backdrop-filter: blur(6px);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, .2);
    transform: translateY(-1px);
}

/* ===== About Section ===== */
.about-section {
    position: relative;
    z-index: 1;
    background-color: var(--white);
    border-radius: 0;
    box-shadow: none;
    margin-top: 0;
    border-top: none;
    padding-top: 5rem;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: start;
}

.profile-container {
    position: relative;
}

/* Mobile-proof image box (fixes bottom white) */
.profile-photo-wrapper {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 3/4;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 3px solid var(--white);
    box-shadow: var(--shadow-md);
    margin: 0 auto;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.profile-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 0;
    transition: transform .6s cubic-bezier(.33, 1, .68, 1);
}

@media (hover: hover) and (pointer: fine) {
    .profile-photo-wrapper:hover .profile-photo {
        transform: scale(1.03);
    }
}

@media (max-width: 1024px) {
    .profile-photo-wrapper {
        max-width: 92vw;
    }
}

.about-text {
    background-color: var(--white);
    padding: 3rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.75rem;
    margin-top: 3.5rem;
    grid-column: 1 / -1;
}

.stat-item {
    background: var(--white);
    padding: 2.5rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 119, 182, .1);
}

.stat-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
    transition: var(--transition);
}

.stat-item:hover::before {
    height: 6px;
}

.stat-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
}

.stat-number {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: .5rem;
    line-height: 1;
    letter-spacing: -.01em;
    font-family: var(--font-heading);
}

/* was #0077b6 */
.stat-label {
    font-size: .85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .08rem;
    font-weight: 600;
    margin-top: .25rem;
    white-space: nowrap;
}

/* ===== Achievements ===== */
.achievements-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
}

.achievements-list li {
    background-color: var(--white);
    border-radius: var(--radius-md);
    padding: 2.8rem;
    transition: var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 1.75rem;
    position: relative;
    border-top: 5px solid var(--primary-color);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .06);
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
}

.achievements-list i {
    font-size: 1.5rem;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 3.5rem;
    min-height: 3.5rem;
    box-shadow: 0 4px 12px rgba(0, 119, 182, .2);
}

.achievement-content h3 {
    margin-bottom: .75rem;
    font-size: 1.25rem;
    color: var(--text-color);
    letter-spacing: -0.01em;
}

.achievement-content p {
    color: var(--text-light);
    margin-bottom: 0;
    font-weight: 500;
}

/* ===== Projects ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
}

.project-card {
    padding: 2.8rem;
    background-color: var(--white);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border-top: 5px solid var(--secondary-color);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .06);
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
}

.project-card h3 {
    margin-bottom: 1.25rem;
    color: var(--text-color);
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.project-card p {
    color: var(--text-light);
    flex-grow: 1;
    margin-bottom: 0;
    font-weight: 500;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, .12);
}

/* ===== Testimonials ===== */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
}

.testimonial {
    background-color: var(--white);
    padding: 2.8rem;
    border-radius: var(--radius-md);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-top: 5px solid var(--primary-color);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .06);
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    overflow: visible;
}

.testimonial p {
    font-style: italic;
    position: relative;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    flex-grow: 1;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 2.5rem;
}

.testimonial cite {
    display: block;
    font-weight: 600;
    font-style: normal;
    color: var(--text-color);
    margin-top: 1rem;
    position: relative;
    padding-top: 1rem;
    z-index: 2;
}

.testimonial cite::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 2.5rem;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* ===== Footer ===== */
footer {
    background-image: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 5rem 0 2.5rem;
    margin: 0;
    position: relative;
    border-top: none;
}

footer::before {
    content: none;
}

.contact-info {
    margin-bottom: 2.5rem;
    text-align: center;
}

.contact-info p {
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 1.35rem;
    color: var(--white);
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
}

.contact-links a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: .75rem;
    opacity: .9;
    font-weight: 500;
    padding: .75rem 1.5rem;
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, .1);
    backdrop-filter: blur(5px);
}

.contact-links a:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, .2);
    transform: translateY(-2px);
}

.contact-links i {
    font-size: 1.35rem;
}

.copyright {
    text-align: center;
    margin-top: 3rem;
    font-size: .925rem;
    opacity: .8;
    color: var(--white);
}

/* ===== Section Backgrounds ===== */
.achievements-section {
    background-color: #f5f9fd;
    background-image: linear-gradient(to bottom, #f5f9fd, #edf5fa);
    padding-top: calc(var(--section-spacing) + 30px);
    padding-bottom: calc(var(--section-spacing) + 30px);
    margin: 0;
}

.projects-section {
    background-color: var(--white);
    padding-top: calc(var(--section-spacing) + 30px);
    padding-bottom: calc(var(--section-spacing) + 30px);
    border-top: 1px solid rgba(0, 119, 182, .1);
    border-bottom: 1px solid rgba(0, 119, 182, .1);
    margin: 0;
}

.testimonials-section {
    background-color: #f5f9fd;
    background-image: linear-gradient(to bottom, #f5f9fd, #edf5fa);
    padding-top: calc(var(--section-spacing) + 30px);
    padding-bottom: 5rem;
    margin: 0;
    border-bottom: none;
}

.resources-section {
    background-color: var(--white);
    padding-top: calc(var(--section-spacing) + 30px);
    padding-bottom: var(--section-spacing);
    margin: 0;
}

.resources-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.resource-category {
    background-color: var(--white);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .05);
    border-top: 4px solid var(--primary-color);
    transition: var(--transition);
}

.resource-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .08);
}

.resource-category h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: .75rem;
}

.resource-category h3 i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.resource-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.resource-list li a {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    background-color: var(--off-white);
}

.resource-list li a:hover {
    color: var(--primary-color);
    background-color: rgba(0, 119, 182, .08);
    transform: translateX(5px);
}

.resource-list li a i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* ===== Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s ease-out, transform .6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Media Queries ===== */
@media (max-width: 1024px) {
    .about-content {
        grid-template-columns: 1fr;
    }

    .profile-container {
        margin-bottom: 2.5rem;
    }

    .profile-photo-wrapper {
        max-width: 300px;
    }

    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {

    .projects-grid,
    .achievements-list,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    :root {
        --section-spacing: 5rem;
    }

    header {
        padding: 4rem 0 6rem;
    }

    header h1 {
        font-size: 2.75rem;
    }

    .decorated-heading {
        font-size: 2rem;
        margin-bottom: 3rem;
    }

    nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    :root {
        --section-spacing: 4rem;
    }

    header h1 {
        font-size: 2.25rem;
    }

    .quick-stats {
        grid-template-columns: 1fr;
    }

    .profile-photo-wrapper {
        max-width: 240px;
    }

    .about-text {
        padding: 2.25rem;
    }

    .achievements-list li,
    .project-card,
    .testimonial {
        padding: 2rem;
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .fade-in {
        transition: none;
    }

    .achievements-list li:hover,
    .project-card:hover,
    .stat-item:hover,
    .testimonial:hover,
    .profile-photo:hover {
        transform: none;
    }
}

.project-card h3,
.project-card p,
.testimonial p,
.testimonial cite,
.achievement-content,
.stat-item i,
.stat-item .stat-number,
.stat-item .stat-label {
    position: relative;
    z-index: 1;
}

/* =================================================================== */
/* ============================== DARK ================================ */
/* =================================================================== */
:root[data-theme="dark"] {
    --background: #0b1220;
    --white: #0f172a;
    /* surface */
    --off-white: #0d1424;
    /* subtle surface */
    --border-color: #1f2a44;

    --text-color: #e6eaf3;
    --text-light: #b7c1d6;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, .35);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, .45);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, .55);
}

/* Card-like surfaces in dark */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .about-text,
:root[data-theme="dark"] .stat-item,
:root[data-theme="dark"] .project-card,
:root[data-theme="dark"] .testimonial,
:root[data-theme="dark"] .resource-category,
:root[data-theme="dark"] .achievements-list li {
    background: linear-gradient(145deg, #0f172a 0%, #0b1220 100%);
    box-shadow: var(--shadow-sm);
    border-color: var(--border-color);
}

/* Section backgrounds */
:root[data-theme="dark"] .achievements-section,
:root[data-theme="dark"] .testimonials-section {
    background-color: #0c1426;
    background-image: linear-gradient(to bottom, #0c1426, #0b1220);
}

:root[data-theme="dark"] .projects-section,
:root[data-theme="dark"] .resources-section {
    background-color: #0b1220;
}

/* Links and list items inside resources */
:root[data-theme="dark"] .resource-list li a {
    background-color: #0f172a;
    color: var(--text-light);
}

:root[data-theme="dark"] .resource-list li a:hover {
    background-color: #0f1b33;
}

/* Header/Toggle tweaks */
:root[data-theme="dark"] .theme-toggle {
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .1);
}