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

:root {
    /* Dark palette */
    --color-bg: #0f0f1a;
    --color-bg-alt: #1a1a2e;
    --color-surface: #16213e;
    --color-text: #e0e0e0;
    --color-text-muted: #a0a0b8;
    --color-heading: #f0f0f0;
    --color-accent: #4fc3f7;
    --color-accent-hover: #81d4fa;
    --color-border: #2a2a4a;
    --color-card-bg: #1e1e36;
    --color-footer-bg: #0a0a14;
    --max-width: 1080px;
    --nav-height: 56px;
    --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-stack);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    font-size: 1rem;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s;
}

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

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

h1,
h2,
h3,
h4 {
    color: var(--color-heading);
    line-height: 1.3;
}

/* ===== Layout ===== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== Navigation ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    min-height: var(--nav-height);
    padding: 0.5rem 1.5rem;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.navbar__brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-heading);
}

.navbar__links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    list-style: none;
}

.navbar__links a {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    transition: color 0.2s;
}

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

.btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, color 0.2s;
}

.btn--primary {
    background: var(--color-accent);
    color: #0f0f1a;
    font-weight: 600;
}

.btn--primary:hover {
    background: var(--color-accent-hover);
    color: #0f0f1a;
}

.btn--outline {
    background: transparent;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
}

.btn--outline:hover {
    background: var(--color-accent);
    color: #0f0f1a;
}

/* ===== Hero Section ===== */
.hero {
    background: var(--color-bg-alt);
    padding: 5rem 0 4rem;
    text-align: center;
}

.hero__title {
    font-size: 2.75rem;
    margin-bottom: 0.5rem;
    color: var(--color-heading);
}

.hero__subtitle {
    font-size: 1.2rem;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.hero__value {
    font-size: 1rem;
    color: var(--color-text-muted);
    max-width: 640px;
    margin: 0 auto 2rem;
}

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

/* ===== Section (generic) ===== */
.section {
    padding: 4rem 0;
}

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

.section__title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--color-heading);
}

.section__title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--color-accent);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

/* ===== Core Pillars Section ===== */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.pillar-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 2rem 1.5rem;
    transition: border-color 0.2s;
}

.pillar-card:hover {
    border-color: var(--color-accent);
}

.pillar-card__number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

.pillar-card__title {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--color-heading);
}

.pillar-card__desc {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* ===== Case Studies Section ===== */
.case-studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.case-study-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.75rem 1.5rem;
    transition: border-color 0.2s;
}

.case-study-card:hover {
    border-color: var(--color-accent);
}

.case-study-card__title {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    color: var(--color-heading);
}

.case-study-card__label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    margin-bottom: 0.25rem;
}

.case-study-card__text {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.case-study-card__link {
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===== Tech Stack Section ===== */
.tech-stack-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
}

.tech-stack-table th,
.tech-stack-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.tech-stack-table th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    background: var(--color-surface);
}

.tech-stack-table td {
    font-size: 0.95rem;
    color: var(--color-text);
}

.tech-stack-table td:first-child {
    font-weight: 600;
    color: var(--color-heading);
    white-space: nowrap;
}

.tech-stack-table tr:hover td {
    background: var(--color-card-bg);
}

/* ===== Brief Bio Section ===== */
.section--bio {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.bio__text {
    max-width: 780px;
    margin: 0 auto 1.25rem;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-text);
}

.bio__text:last-child {
    margin-bottom: 0;
}

/* ===== Education List ===== */
.education-list {
    list-style: none;
    max-width: 800px;
    margin: 0 auto 2rem;
}

.education-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

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

.section__subtitle {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--color-heading);
}

/* ===== Academic Section ===== */
.academic-list {
    list-style: none;
    max-width: 800px;
    margin: 0 auto;
}

.academic-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

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

.academic-list a {
    color: var(--color-accent);
}

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

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

.footer__cta {
    font-size: 1.1rem;
    color: var(--color-heading);
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.footer__links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.footer__links a {
    color: var(--color-accent);
    font-size: 0.95rem;
}

.footer__location {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.footer__copyright {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ===== Back Link (detail pages) ===== */
.back-link {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--color-accent);
}

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

/* ===== Project Hero Variant ===== */
.hero--project {
    padding: 3rem 0 2rem;
}

/* ===== Placeholder Images ===== */
.placeholder-image {
    background: var(--color-surface);
    border: 1px dashed var(--color-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    min-height: 180px;
}

/* ===== Responsive: Tablet (max 768px) ===== */
@media (max-width: 768px) {
    .hero {
        padding: 3.5rem 0 2.5rem;
    }

    .hero__title {
        font-size: 2rem;
    }

    .hero__subtitle {
        font-size: 1.05rem;
    }

    .section {
        padding: 3rem 0;
    }

    .section__title {
        font-size: 1.4rem;
    }

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

    .case-studies-grid {
        grid-template-columns: 1fr;
    }

    .tech-stack-table th,
    .tech-stack-table td {
        padding: 0.65rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* ===== Responsive: Phone (max 480px) ===== */
@media (max-width: 480px) {
    .navbar {
        padding: 0.5rem 1rem;
    }

    .navbar__links {
        gap: 0.75rem;
        font-size: 0.85rem;
    }

    .hero {
        padding: 2.5rem 0 2rem;
    }

    .hero__title {
        font-size: 1.6rem;
    }

    .hero__subtitle {
        font-size: 0.95rem;
    }

    .hero__ctas {
        flex-direction: column;
        align-items: center;
    }

    .section {
        padding: 2rem 0;
    }

    .section__title {
        font-size: 1.25rem;
    }

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

    .case-study-card {
        padding: 1.25rem 1rem;
    }

    .footer {
        padding: 2rem 0 1.5rem;
    }

    .footer__cta {
        font-size: 1rem;
    }
}