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

:root {
    --bg: #f7f9fc;
    --surface: #ffffff;
    --surface2: #f1f5f9;
    --border: #d4dbe6;
    --text: #1e293b;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-dark: #1e4db7;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

/* === HEADER === */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.3px;
}

nav {
    display: flex;
    gap: 4px;
    align-items: center;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: color 0.2s, background 0.2s;
}

nav a:hover {
    color: var(--text);
    background: var(--surface2);
}

/* === HERO === */
.hero {
    padding: 72px 0 64px;
    border-bottom: 1px solid var(--border);
}

.hero-inner {
    display: flex;
    align-items: center;
    gap: 44px;
}

.headshot {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    flex-shrink: 0;
}

.hero-text h1 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.2;
}

.hero-text h2 {
    font-size: 1.05rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 16px;
}

.hero-text p {
    color: var(--text-muted);
    max-width: 560px;
    margin-bottom: 26px;
    font-size: 0.95rem;
    line-height: 1.7;
}

.hero-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* === BUTTONS === */
.btn {
    display: inline-block;
    padding: 10px 22px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 7px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: background 0.2s, transform 0.15s;
}

.btn:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

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

.btn-outline:hover {
    background: rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

/* === PROJECTS === */
.section {
    padding: 64px 0 80px;
}

.section > h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 32px;
    color: var(--text);
}

.projects-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
}

/* === CARD === */
.card {
    flex: 1 1 calc(33.333% - 22px);
    min-width: 260px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.12);
}

.card-thumb {
    width: 100%;
    height: 190px;
    overflow: hidden;
    background: var(--surface2);
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
    display: block;
}

.card:hover .card-thumb img {
    transform: scale(1.05);
}

.card-body {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 7px;
}

.card-body p {
    color: var(--text-muted);
    font-size: 0.83rem;
    line-height: 1.55;
    flex: 1;
    margin-bottom: 14px;
}

/* === TAGS === */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tags span {
    background: var(--surface2);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 3px 9px;
    border-radius: 4px;
    border: 1px solid var(--border);
    white-space: nowrap;
}

.card-link {
    color: var(--accent);
    font-size: 0.82rem;
    text-decoration: none;
    font-weight: 500;
    margin-top: auto;
}

.card-link:hover {
    text-decoration: underline;
}

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: 100%;
    max-width: 780px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 34px;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.close-btn {
    position: absolute;
    top: 18px;
    right: 22px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.close-btn:hover {
    color: var(--text);
    background: var(--surface2);
}

.modal-header {
    margin-bottom: 22px;
    padding-right: 30px;
}

.modal-header h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.modal-header .tags {
    margin-bottom: 10px;
}

/* === CAROUSEL === */
.carousel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    overflow: hidden;
}

.carousel-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
}

.carousel-btn:first-of-type {
    left: 10px;
}

.carousel-btn:last-of-type {
    right: 10px;
}

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

#carousel-image {
    flex: 1;
    max-height: 360px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    background: var(--surface2);
    display: block;
}

.carousel-counter {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-bottom: 22px;
    min-height: 18px;
}

/* === MODAL DESCRIPTION === */
.modal-description {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.75;
}

.modal-description p {
    margin-bottom: 14px;
}

.modal-description h4 {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 600;
    margin-top: 18px;
    margin-bottom: 8px;
}

.modal-description ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 14px;
}

.modal-description ul li {
    margin-bottom: 5px;
}

.modal-description strong {
    color: var(--text);
    font-weight: 600;
}

/* === FOOTER === */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 28px 0;
    text-align: center;
}

footer p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .card {
        flex: 1 1 calc(50% - 22px);
    }
}

@media (max-width: 700px) {
    .hero-inner {
        flex-direction: column;
        text-align: center;
    }

    .hero-text p {
        max-width: 100%;
    }

    .hero-links {
        justify-content: center;
    }

    .card {
        flex: 1 1 100%;
    }

    .modal-content {
        padding: 24px 20px;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 1.9rem;
    }

    .nav-bar {
        flex-direction: column;
        gap: 10px;
        padding: 14px 0;
    }
}
