@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --background: #f7f7f5;
    --white: #ffffff;
    --text: #17181b;
    --muted: #777a80;
    --accent: #456b9a;
    --line: #dedfdf;
    --sans: 'Space Grotesk', sans-serif;
    --mono: 'DM Mono', monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    width: 100%;
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.5;
    overflow-x: hidden;
    zoom: 150%;
}

a {
    color: inherit;
    text-decoration: none;
}

main {
    overflow: clip;
}

.topbar,
.hero,
.section,
footer {
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    padding: 10px 16px;
    background: var(--white);
    border: 1px solid rgba(17, 18, 23, 0.08);
    border-radius: 999px;
}

.topbar a {
    color: rgba(23, 24, 27, 0.8);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .02em;
    transition: color .15s ease;
}

.topbar a:hover {
    color: #111217;
}

.nav-badge {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(17, 18, 23, 0.06);
    color: rgba(23, 24, 27, 0.9);
    font-size: 11px;
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    gap: 70px;
    min-height: 640px;
    padding: 40px 0 90px;
}

.profile-photo {
    position: relative;
    width: min(100%, 430px);
    aspect-ratio: 1 / 1;
    margin-left: auto;
    overflow: hidden;
    background: #f0f0f0;
    border: 1px solid rgba(17, 18, 23, 0.08);
    border-radius: 28px;
    filter: none;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-copy {
    max-width: 600px;
}

.hero-profile {
    width: min(100%, 430px);
    margin-left: auto;
}

.hero-profile .profile-photo {
    width: 100%;
}

.hero-skills {
    margin-top: 28px;
}

.hero-skills h2 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
    letter-spacing: -.05em;
    line-height: 1;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 12px;
    margin-top: 18px;
}

.skill-item {
    display: inline-block;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: rgba(23, 24, 27, 0.8);
    font-family: var(--mono);
    font-size: 12px;
    transition: border-color .15s ease, color .15s ease;
}

.skill-item:hover {
    border-color: var(--text);
    color: var(--text);
}

.hero-label {
    margin: 0 0 18px;
    color: rgba(23, 24, 27, 0.8);
    font-family: var(--mono);
    font-size: 14px;
    letter-spacing: .01em;
}

.hero-label span {
    font-size: 1.1em;
}

h1 {
    margin: 0;
    font-size: clamp(3.2rem, 5vw, 6.3rem);
    font-weight: 700;
    letter-spacing: -.07em;
    line-height: .95;
    color: #17181b;
}

.intro {
    max-width: 500px;
    margin: 24px 0 0;
    color: rgba(23, 24, 27, 0.74);
    font-size: 18px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 12px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .04em;
    transition: all .2s ease;
}

.primary-btn {
    background: #101114;
    color: #ffffff;
}

.secondary-btn {
    background: transparent;
    border: 1px solid rgba(17, 17, 20, 0.18);
    color: rgba(17, 17, 20, 0.9);
}

.primary-btn:hover,
.secondary-btn:hover {
    transform: translateY(-1px);
}

.section {
    padding: 72px 0;
    border-top: 1px solid var(--line);
}

.section-head {
    margin-bottom: 35px;
}

.section-kicker {
    margin: 0 0 18px;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h2 {
    margin: 0;
    font-size: clamp(2.8rem, 6vw, 5rem);
    letter-spacing: -.07em;
    line-height: .9;
}

.project-list {
    border-top: 1px solid var(--text);
}

.project {
    display: grid;
    grid-template-columns: 60px 1fr 1fr 30px;
    gap: 20px;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--line);
}

.project-number,
.project-type {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
}

.project-title {
    font-size: clamp(1.3rem, 2.5vw, 2.1rem);
    letter-spacing: -.04em;
}

.project-arrow {
    font-size: 22px;
    text-align: right;
}

.project:hover .project-title {
    color: var(--accent);
}

.iot-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 45px 30px;
}

.iot-card {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--text);
    padding-top: 14px;
}

.iot-photo {
    aspect-ratio: 16 / 10;
    margin-bottom: 20px;
    overflow: hidden;
    background: #e7e8e8;
    border: 1px solid var(--line);
}

.iot-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.iot-card h3 {
    margin: 0 0 8px;
    font-size: 24px;
    letter-spacing: -.05em;
}

.iot-card p {
    min-height: 52px;
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 14px;
}

.project-buttons{
    display: flex;
    flex-direction: row;
    gap: 5%;
}

.project-button {
    width: 50%;
    margin-bottom: 24px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 11px;
    background: transparent;
    border: 1px solid rgba(17, 17, 20, 0.18);
    color: rgba(17, 17, 20, 0.9);
    border-radius: 10px;
    text-align: center;
}

.project-button span {
    color: var(--accent);
}

.project-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.iot-meta {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 11px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
}

.contact {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: end;
    padding-bottom: 110px;
}

.contact h2 {
    max-width: 650px;
}

.contact-links {
    display: grid;
    min-width: 310px;
    gap: 8px;
}

.contact-link {
    display: flex;
    justify-content: space-between;
    padding: 15px 16px;
    border: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 11px;
}

.github contact-link {
    color: grey;
}

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

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
}

.filter-bar {
    display: flex;
    gap: 8px;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--line);
    padding: 6px 14px;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: #17181b;
    color: var(--white);
    border-color: #17181b;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
}

.card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #e7e8e8;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(23, 24, 27, 0.75);
    backdrop-filter: blur(4px);
    color: var(--white);
    font-family: var(--mono);
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 6px;
}

.card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 24px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.card-tags span {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--muted);
    background: var(--background);
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.card-content h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    letter-spacing: -0.03em;
}

.card-content p {
    margin: 0 0 24px 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    flex-grow: 1;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-card {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: #17181b;
    color: var(--white);
    border: 1px solid #17181b;
    border-radius: 8px;
    font-family: var(--mono);
    font-size: 11px;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-card.secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--line);
}

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

.projects-footer {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

.project-detail {
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
    padding: 40px 0 100px;
}

.back-link {
    display: inline-block;
    margin-bottom: 56px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    transition: color .2s ease;
}

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

.project-detail-hero {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    align-items: center;
    column-gap: 70px;
    row-gap: 8px;
    padding-bottom: 100px;
}

.project-detail-copy .card-tags {
    margin-bottom: 28px;
}

.project-detail-copy h1 {
    max-width: 700px;
}

.project-detail-intro {
    max-width: 560px;
    margin: 28px 0 0;
    color: rgba(23, 24, 27, 0.74);
    font-size: 18px;
    line-height: 1.6;
}

.project-detail-actions {
    margin-top: 32px;
}

.project-detail-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e7e8e8;
    border: 1px solid var(--line);
    border-radius: 16px;
}

.project-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-detail-image-link {
    display: block;
    height: 100%;
    cursor: zoom-in;
}

.project-detail-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    grid-column: 2;
    width: 75%;
    justify-self: right;
}

.project-detail-gallery-link {
    display: block;
    cursor: zoom-in;
}

.project-detail-gallery img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.project-lightbox {
    display: none;
}

.project-lightbox:target {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.project-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 24, 27, 0.88);
}

.project-lightbox-content {
    position: relative;
    display: flex;
    width: min(1100px, calc(100vw - 48px));
    height: calc(100vh - 48px);
    align-items: center;
    justify-content: center;
}

.project-lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 0;
    border-radius: 0;
}

.project-lightbox-close {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: var(--white);
    color: var(--text);
    font-size: 24px;
    line-height: 1;
    text-decoration: none;
}

.project-detail-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    padding-top: 70px;
    border-top: 1px solid var(--line);
}

.project-detail-info h2 {
    max-width: 420px;
    font-size: clamp(2.4rem, 5vw, 4.5rem);
}

.project-detail-text {
    max-width: 560px;
    color: var(--muted);
    font-size: 16px;
}

.project-detail-text p {
    margin: 0 0 20px;
}

footer {
    display: flex;
    justify-content: space-between;
    padding: 18px 0 28px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
}

@media (max-width: 700px) {
    .topbar,
    .hero,
    .section,
    footer,
    .project-detail {
        width: calc(100% - 32px);
    }

    .topbar {
        min-height: 65px;
        gap: 15px;
    }

    .nav-pill {
        max-width: 100%;
        gap: 12px;
        padding: 9px 12px;
    }

    .topbar a {
        font-size: 10px;
    }

    .hero {
        display: block;
        min-height: auto;
        padding: 52px 0 70px;
    }

    .profile-photo {
        width: min(100%, 280px);
        height: auto;
        aspect-ratio: 1 / 1;
        margin-bottom: 35px;
        margin-top: 35px;
    }

    h1 {
        font-size: clamp(3rem, 15vw, 5rem);
        overflow-wrap: anywhere;
    }

    .intro {
        margin-top: 30px;
        font-size: 16px;
    }

    .section {
        padding: 65px 0;
    }

    .project {
        grid-template-columns: 34px 1fr 25px;
        gap: 10px;
    }

    .project-type {
        display: none;
    }

    .projects-grid,
    .iot-grid {
        grid-template-columns: 1fr;
        gap: 45px;
    }

    .section-head {
        align-items: flex-start;
    }

    .filter-bar {
        width: 100%;
        flex-wrap: wrap;
    }

    .filter-btn {
        flex: 1 1 auto;
    }

    .iot-photo {
        min-height: 220px;
    }

    .contact {
        display: block;
    }

    .contact-links {
        min-width: 0;
        margin-top: 35px;
    }

    .project-buttons,
    .card-actions {
        flex-direction: column;
    }

    .project-button,
    .btn-card {
        width: 100%;
    }

    .project-detail {
        padding: 28px 0 70px;
    }

    .back-link {
        margin-bottom: 40px;
    }

    .project-detail-hero,
    .project-detail-info {
        display: block;
    }

    .project-detail-hero {
        padding-bottom: 70px;
    }

    .project-detail-image {
        margin-top: 42px;
    }

    .project-detail-gallery {
        grid-column: auto;
        margin-top: 8px;
    }

    .project-detail-info {
        padding-top: 52px;
    }

    .project-detail-text {
        margin-top: 30px;
    }

    footer {
        gap: 15px;
        flex-wrap: wrap;
    }
}