:root{
    --ink: #C5C5C5;
    --paper: #000000;
    --pad: 1.5rem;
    --gap: 10px;
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    list-style: none;
    font-family: 'neue-haas-grotesk-display', sans-serif;
    font-weight: 400;
    font-style: normal;
}

body{
    min-height: 100vh;
    line-height: 1.2;
    color: var(--ink);
    background: var(--paper);
}

a{ color: inherit; text-decoration: none; }
a:focus-visible{ outline: 2px solid var(--ink); outline-offset: 3px; }

/* ------ Header (same on every page) ------ */
.top{
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 0;
    padding: var(--pad);
    font-size: clamp(1.1rem, 2.1vw, 1.8rem);
    background: var(--paper);
    z-index: 20;
}

.top{ align-items: center; }
.top-name{ grid-column: 1 / 9; justify-self: start; display: block; }
.top-name img{ display: block; width: clamp(10rem, 21vw, 19rem); height: auto; }
.top-work{ grid-column: 9 / 11; }
.top-about{ grid-column: 11 / 13; }

.top-work, .top-about{ justify-self: start; }
.top a[aria-current="page"],
.top-work:hover, .top-about:hover{
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .2em;
}

/* ------ Footer ------ */
.foot{
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
    padding: var(--pad);
    font-size: 1rem;
}

.foot-icon{ font-weight: 700; display: inline-flex; align-items: center; }
.foot > .foot-icon:first-child{ grid-column: 1 / 2; }
.foot-ig{ grid-column: 2 / 3; }
.foot-copy{ grid-column: 5 / 10; }

.page-home .foot,
.page-about .foot{
    position: fixed;
    left: 0; bottom: 0;
    width: 100%;
    background: var(--paper);
}

/* ------ Home ------ */
.statement{
    padding: 7.5rem var(--pad) 6rem;
}

.statement h1{
    max-width: 72%;
    font-size: clamp(2rem, 4.7vw, 6rem);
    line-height: 1.12;
    letter-spacing: -0.015em;
}

.statement a{ transition: opacity .15s; }
.statement a[data-img]{ text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .1em; }
.statement h1:has(a:hover) a:not(:hover){ opacity: .25; }

.preview{
    position: fixed;
    top: 0; left: 0;
    width: min(24vw, 360px);
    height: auto;
    pointer-events: none;
    opacity: 0;
    z-index: 30;
    transition: opacity .15s;
}
.preview.on{ opacity: 1; }

/* ------ Work ------ */
.grid{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
    padding: 6.5rem var(--pad) var(--gap);
}

.grid a{ position: relative; display: block; overflow: hidden; background: #111; }

.grid img{
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* hover: translucent white veil with the project name */
.grid .name{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    font-size: clamp(1.2rem, 2.4vw, 2.2rem);
    line-height: 1.15;
    color: #000;
    background: rgba(255, 255, 255, .8);
    opacity: 0;
    transition: opacity .2s;
}

.grid a:hover .name,
.grid a:focus-visible .name{ opacity: 1; }

/* ------ About ------ */
.about{
    width: calc(100% / 12 * 8);
    padding: 10rem var(--pad) 8rem;
}

.about h1{
    max-width: 28ch;
    margin-bottom: 2.5rem;
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    line-height: 1.2;
}

.about p{
    max-width: 62ch;
    margin-bottom: 1.5rem;
    font-size: clamp(1rem, 1.3vw, 1.25rem);
    line-height: 1.55;
}

.about .contact{ margin-top: 3.5rem; }
.about .contact a{ text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }

/* animated character on the About page, aligned with the "Work" column */
/* About page: light grey background, black text */
.page-about{
    --ink: #000000;
    --paper: #C5C5C5;
    position: relative;
}

.about-art{
    position: absolute;
    top: 10rem;
    left: calc(var(--pad) + (100% - 2 * var(--pad)) * 8 / 12);
    width: calc((100% - 2 * var(--pad)) * 3 / 12);
}

.about-art svg{ display: block; width: 100%; height: auto; overflow: visible; }

/* ------ Small screens / touch ------ */
@media (max-width: 820px){
    .top{ display: flex; justify-content: space-between; gap: 1.25rem; }
    .top-name{ margin-right: auto; }
    .top-name img{ width: 11rem; }
    .statement h1{ max-width: 100%; }
    /* About page on small screens: illustration first, then the text */
    .page-about{ display: flex; flex-direction: column; }
    .about{ width: 100%; padding-top: 0; padding-bottom: 6rem; }
    .about-art{ order: -1; position: static; width: min(55%, 14rem); margin: 8rem var(--pad) 2rem; }
    .grid{ grid-template-columns: 1fr; }
    .foot-copy{ grid-column: 3 / 13; text-align: right; }
}

@media (hover: none){ .preview{ display: none; } }

/* touch screens: name shown below each image, no veil */
@media (hover: none), (max-width: 820px){
    .grid a{ overflow: visible; background: none; }
    .grid .name{
        position: static;
        display: block;
        padding: .5rem 0 1.25rem;
        text-align: left;
        font-size: 1.1rem;
        color: var(--ink);
        background: none;
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce){
    .preview, .statement a, .grid .name{ transition: none; }
}
