/* ─────────────────────────────────────────
   Theming tokens
───────────────────────────────────────── */

[data-theme="dark"] {
    --accent: #0066ff;
    --muted: #031a34;
    --text-primary: #fefefe;
    --text-secondary: #afafaf;
    --text-inverse: #0f0f0f;
    --background: #0f0f0f;
}

[data-theme="light"] {
    --accent: #0033ff;
    --muted: #f2f4ff;
    --text-primary: #031a34;
    --text-secondary: #58617a;
    --text-inverse: #ffffff;
    --background: #ffffff;
}


/* ─────────────────────────────────────────
   Reset & base
───────────────────────────────────────── */

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

:root {
    --font: 'IBM Plex Sans', sans-serif;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
}

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

body {
    font-family: var(--font);
    font-weight: var(--font-weight-light);
    line-height: 1.5;
    color: var(--text-secondary);
    transition: background 0.3s, color 0.3s;
    --padding: 0px 1rem;
    --gap-s: 2rem;
    --gap-m: 5rem;
}

img,
video {
    display: block;
    max-width: 100%;
}

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


/* ─────────────────────────────────────────
   Background grid
───────────────────────────────────────── */

.grid-container {
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    background-color: var(--background);
    overflow: hidden;
    display: flex;
    pointer-events: none;
    padding: var(--padding);
}

.grid {
    display: grid;
    grid-template-columns: auto auto auto auto auto auto;
    background-color: var(--muted);
    height: 100%;
    width: 100%;
    column-gap: 1px;
    padding: 0px 1px;
    pointer-events: none;
}

.grid>div {
    background-color: var(--background);
}


/* ─────────────────────────────────────────
   Layout wrapper
───────────────────────────────────────── */

.nav,
.main,
.footer {
    padding: var(--padding);
}


/* ─────────────────────────────────────────
   NAV
───────────────────────────────────────── */

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
    flex-wrap: wrap;
}

.nav__name {
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

.nav__fullname {
    font-weight: 500;
    color: var(--accent);
    font-size: 1rem;
    margin: 0;
}

.nav__title {
    font-weight: 300;
    color: var(--text-primary);
    font-size: 1rem;
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav__links {
    display: flex;
    gap: 1rem;
}

.nav__link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--accent);
    font-weight: 400;
    transition: opacity 0.2s;
}

.nav__link:hover {
    text-decoration: underline;
    text-underline-offset: 0.4rem;
    text-decoration-thickness: 1px;
}


/* ─────────────────────────────────────────
   Theme toggle
───────────────────────────────────────── */

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--muted, #f2f4ff);
    border-radius: 50px;
    padding: 4px;
    transition: background 0.3s;
}

.theme-toggle__btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.theme-toggle__btn img {
    width: 24px;
    height: 24px;
}

.theme-toggle__btn--active {
    background: var(--accent);
}


/* ─────────────────────────────────────────
   MAIN
───────────────────────────────────────── */

.main {
    display: flex;
    flex-direction: column;
    gap: var(--gap-m);
    padding-top: var(--gap-m);
    padding-bottom: var(--gap-m);
}


/* ─────────────────────────────────────────
   HERO
───────────────────────────────────────── */

.hero {
    display: grid;
    grid-template-columns: 1fr;
    padding-top: var(--gap-s);
    padding-bottom: var(--gap-s);
}

.hero__location {
    font-size: 1rem;
    line-height: 1.5;
    padding: var(--padding);
}

.hero__text {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: var(--padding);
}

.hero__headline {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
}

.hero__subheadline {
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 300;
    line-height: 1.5;
    max-width: 700px;
}


/* ─────────────────────────────────────────
   SECTION (shared)
───────────────────────────────────────── */

.section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-top: var(--gap-m);
    padding-bottom: var(--gap-m);
}

.section__title {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 2;
    padding: var(--padding);
}


/* ─────────────────────────────────────────
   PROJECTS
───────────────────────────────────────── */

.projects {
    display: flex;
    flex-direction: column;
    gap: clamp(80px, 12vw, 180px);
}

.project {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0;
    align-items: start;
}


/* Visual panel */

.project__visual {
    position: relative;
    padding: var(--padding);
}

.project__bg {
    width: 100%;
    padding-top: 63%;
    background: var(--muted);
    border-radius: 4px;
}


/* Stacked screenshots (project 1) */

.project__visual--stacked {
    position: relative;
}

.project__visual--stacked .project__bg {
    position: relative;
}

.project__img {
    border-radius: 4px;
    object-fit: cover;
}

.project__img--main {
    position: absolute;
    top: 4.5%;
    left: 5%;
    width: 88%;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.project__img--secondary {
    position: absolute;
    top: 16%;
    left: 38%;
    width: 62%;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.project__img--logo {
    position: absolute;
    bottom: 14%;
    left: 26%;
    width: 16%;
}


/* Video project (project 2) */

.project__visual--dark .project__bg {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.project__video-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    width: 80%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 16px 51px rgba(0, 0, 0, 0.16);
}

.project__video-wrap video {
    width: 100%;
    border-radius: 8px;
    display: block;
}


/* Screenshot card (project 4) */

.project__visual--screenshot .project__bg {
    position: relative;
    overflow: hidden;
}

.project__img--card {
    position: absolute;
    top: 4.5%;
    left: 8%;
    width: 83%;
    border-radius: 12px;
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.2);
}


/* Project info panel */

.project__info {
    padding: var(--padding);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project__year {
    font-size: 16px;
    font-weight: 300;
}

.project__name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.012em;
    line-height: 1.5;
}

.project__desc {
    font-size: 16px;
    font-weight: 300;
    line-height: 1.5;
    letter-spacing: 0.012em;
}


/* ─────────────────────────────────────────
   WORK EXPERIENCE
───────────────────────────────────────── */

.experience {
    display: flex;
    flex-direction: column;
}

.experience__row {
    display: grid;
    grid-template-columns: 1fr 5fr;
    padding-top: var(--gap-s);
}

.experience__meta,
.experience__detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--padding);
}

.experience__period,
.experience__role {
    font-weight: 700;
    color: var(--text-primary);
}

.experience__location,
.experience__company {
    font-weight: 400;
}


/* ─────────────────────────────────────────
   ABOUT ME
───────────────────────────────────────── */

.about {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.about__bio {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.about__text {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.5;
}

.about__links {
    display: flex;
    gap: 16px;
}

.about__photos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 8px;
    padding: 16px;
}

.about__photo {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.about__photo img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 4px;
}

.about__photo figcaption {
    font-size: 14px;
    line-height: 1.5;
}


/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */

.footer {
    padding: 2rem 2rem 4rem 2rem;
    color: var(--text-primary);
}


/* ─────────────────────────────────────────
   RESPONSIVE – Tablet (≤ 900px)
───────────────────────────────────────── */

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
    }
    .hero__location {
        line-height: 1.5;
    }
    .project {
        grid-template-columns: 1fr;
    }
    .project__visual {
        order: -1;
    }
    .project__info {
        padding-top: 24px;
    }
    .experience__row {
        grid-template-columns: 160px 1fr;
        gap: 16px;
    }
    .about {
        grid-template-columns: 1fr;
    }
    .about__photos {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ─────────────────────────────────────────
   RESPONSIVE – Mobile (≤ 600px)
───────────────────────────────────────── */

@media (max-width: 600px) {
     :root {
        --padding: 20px;
        --gap: 64px;
    }
    .nav {
        flex-direction: column;
        align-items: flex-start;
    }
    .hero__headline {
        font-size: 20px;
    }
    .hero__subheadline {
        font-size: 18px;
    }
    .section__title {
        font-size: 20px;
    }
    .project__img--main {
        width: 90%;
        top: 3%;
        left: 5%;
    }
    .project__img--secondary {
        display: none;
    }
    .project__img--logo {
        display: none;
    }
    .project__video-wrap {
        width: 85%;
        transform: translate(-45%, -50%);
    }
    .experience__row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 20px 16px;
    }
    .about {
        grid-template-columns: 1fr;
    }
    .about__photos {
        grid-template-columns: repeat(2, 1fr);
    }
    .about__photo:last-child {
        display: none;
    }
}


/* ─────────────────────────────────────────
   RESPONSIVE – Large desktop (≥ 1280px)
───────────────────────────────────────── */

@media (min-width: 1280px) {
    .hero {
        grid-template-columns: 1fr 2fr;
        align-items: start;
    }
    .hero__location {
        padding-top: 8px;
    }
}