/* ---------- Base ---------- */
html {
    scroll-behavior: smooth;
}

:root {
    --g: clamp(1rem, 4vw, 4rem);
    --barH: 48px;
    --nav-shift: -100%;
}

body {
    margin: 0;
    padding-top: var(--barH);
    font-family: system-ui, sans-serif;
    color: #111;
}

section {
    margin-bottom: 10vh;
}

.tags {
    color: #29292973;
}
 

/* Make the full left/right sections clickable without looking like links */
.left a,
.right a {
    color: inherit;
    text-decoration: none;
    display: block;
}

.left a:hover,
.right a:hover {
    opacity: .85;
}

/* ---------- Mini header (top) ---------- */
.mini-header {
    position: fixed;
    top: 0;
    left: 34vw;
    height: var(--barH);
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 0 1rem;
    z-index: 10;
}

.mini-header a {
    text-decoration: none;
    color: inherit;
    opacity: .8;
}

.mini-header a:hover {
    opacity: 1;
}

.mini-header b {
    font-size: 1.5rem;
    font-weight: 800;
}

/* Index link*/
.mini-header a.index-link {
    position: relative;
    font-weight: 600;
    transition:
        transform 0.18s ease,
        font-weight 0.18s ease,
        letter-spacing 0.18s ease,
        opacity 0.18s ease;
}

/* hover pop – only when NOT on the index page */
body:not(.home) .mini-header a.index-link:hover {
    transform: scale(1.15);
    font-weight: 900;
    letter-spacing: 0.04em;
    opacity: 1;
    /* makes sure it's fully visible on hover */
}


/* ---------- Page grid + mid-rail ---------- */
.page-grid {
    display: grid;
    grid-template-columns: 2fr minmax(12rem, max-content) 3fr;
    gap: var(--g);
    padding-inline: var(--g);
    padding-bottom: var(--g);
}

.midrail {
    grid-column: 2;
    position: sticky;
    top: 58svh;
    transform: translateY(-50%);
    align-self: start;
    z-index: 5;
}

.midnav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.midnav li {
    position: relative;
    line-height: 1.3;
}

.midnav li+li {
    margin-top: .35rem;
}

.midnav a {
    opacity: .45;
    color: inherit;
    text-decoration: none;
    transition: opacity .2s;
}

.midnav a:hover {
    opacity: 1;
}

/* active arrow + emphasis */
.midnav li.is-active a {
    opacity: 1;
    font-weight: 700;
}

.midnav li.is-active::after {
    content: "<";
    position: absolute;
    right: -1.1rem;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    opacity: .9;
}

/* Content spans full page grid */
.content {
    grid-column: 1 / 4;
}

/* ---------- Sections (hero) ---------- */
.hero {
    min-height: 60svh;
    display: grid;
    grid-template-columns: 2fr minmax(12rem, max-content) 3fr;
    align-items: center;
    gap: var(--g);
}

#index.hero {
    align-items: start;
}

/* Pull the "My Work" heading higher on the page */
#mywork.hero {
    align-items: flex-start;   /* top-align instead of centering */
    min-height: 40svh;         /* a bit shorter so there's less empty space */
}

/* Optional: tiny tweak if you want it even closer to the top */
#mywork .left {
    margin-top: 4vh;           /* adjust up/down by changing this value */
}


.left {
    grid-column: 1;
}

.right {
    grid-column: 3;
}

/* ---------- Type ---------- */
.title {
    font-size: clamp(2.8rem, 8vw, 6rem);
    line-height: .95;
    margin: 0 0 .5rem;
}

.title1 {
    font-size: clamp(2.8rem, 4vw, 6rem);
    line-height: .95;
    margin: 0 0 .5rem;
}

.lead {
    line-height: 1.45;
    opacity: .85;
}

/* ---------- Footer ---------- */
.mini-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(calc(-50% + var(--nav-shift)));
    font-size: .75rem;
    opacity: .6;
    pointer-events: none;
}

/* ---------- Media grid (#media .right .parent) ---------- */
.parent {
    --gap: clamp(8px, 1.2vw, 16px);
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(1, 1fr);
    gap: var(--gap);
    width: 100%;
}

/* layout: three tiles on top (2×2) + one full-width strip below */
.div1 {
    grid-area: 2 / 1 / 4 / 3;
}

.div2 {
    grid-area: 2 / 3 / 4 / 5;
}

.div3 {
    grid-area: 2 / 5 / 4 / 7;
}

.div4 {
    grid-area: 4 / 1 / 5 / 7;
}

.parent>div {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.parent img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Optional spacing for the text strip if you use it */
.div4 {
    border-radius: 0;
    padding: .75rem 0;
}

/* ---------- “My work” grid (#work .right .parent2) ---------- */
.parent2 {
    --gap: clamp(8px, 1.2vw, 16px);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(10rem, 1fr);
    gap: var(--gap);
    align-content: start;
}

/* three equal tall tiles */
.div5 {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.div6 {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.div7 {
    grid-column: 3;
    grid-row: 1 / span 2;
}

/* bring back if needed: full-width text row under images */
/* .div8{ grid-column: 1 / -1; grid-row: 3; } */

.parent2>div {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.parent2 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---------- Timeline image (right column) ---------- */
.right.timeline {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.right.timeline img {
    display: block;
    width: clamp(420px, 52vw, 840px);
    max-width: 100%;
    height: auto;
    aspect-ratio: 840 / 330;
    object-fit: contain;
}

/* ---------- Responsive ---------- */
/* ---------- Mobile layout ---------- */
@media (max-width: 700px) {

    /* collapse to single-column layout */
    .page-grid {
        grid-template-columns: 1fr;
        padding-inline: clamp(12px, 4vw, 24px);
    }

    .midrail {
        display: none;
    }

    .hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .left,
    .right {
        grid-column: 1;
    }

    /* reset desktop grid-area positions */
    .parent .div1,
    .parent .div2,
    .parent .div3,
    .parent .div4,
    .parent2 .div5,
    .parent2 .div6,
    .parent2 .div7,
    .parent2 .div8 {
        grid-area: auto;
    }

    /* keep 3-up image layout for media & work sections */
    .parent,
    .parent2 {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: auto;
        gap: clamp(6px, 2vw, 12px);
    }

    /* portrait-ish image tiles */
    .parent>div:not(.div4),
    .parent2>div:not(.div8) {
        aspect-ratio: 3 / 4;
        border-radius: 6px;
        overflow: hidden;
    }

    /* text spans full width below */
    .div4,
    .div8 {
        grid-column: 1 / -1;
        padding-top: .6rem;
        font-size: .95rem;
        line-height: 1.4;
    }

    /* make images fill tiles */
    .parent img,
    .parent2 img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* center timeline image */
    .right.timeline {
        justify-content: center;
    }

    .right.timeline img {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 840 / 330;
    }
}