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

:root {
--bg: #ffffff;
--ink: #1a1a18;
--accent: #b82601;
--mid: #a8a8a8;
--light: #f4f4f4;
--cell: 260px;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'DM Mono', monospace;
    font-weight: 300;
    cursor: none;
    overflow-x: hidden;
}

/* ── CUSTOM CURSOR ── */
#cursor {
    position: fixed;
    width: 20px; height: 20px;
    /* border: 1.5px solid var(--ink); */
    border-radius: 50%;
    background: rgba(100, 100, 100, 0.4);
    /* background: rgba(255, 255, 255, 0.8); */
    border-color: transparent;
    backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.05s ease, height 0.05s ease, background 0.2s ease, border-color 0.2s ease;
    display: flex; align-items: center; justify-content: center;

}
#cursor.hover {
    width: 50px;
    height: 50px;
    background: rgba(100, 100, 100, 0.2);
    border-color: transparent;
    backdrop-filter: blur(4px);
}
#cursor-label {
    color: #fff;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
    text-transform: uppercase;
}
#cursor.hover #cursor-label { opacity: 1; }

/* ── HEADER ── */
header {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 40px;
    mix-blend-mode: multiply;
}

#name-logo {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    letter-spacing: 0.02em;
    color: var(--ink);
    display: none;
    transition: opacity 0.4s;
    text-decoration: none;
}
#name-logo.visible { display: block; }



nav { display: flex; gap: 32px; }
nav a {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
}
nav a::after {
content: '';
position: absolute; bottom: 0; left: 0;
width: 0; height: 1px;
background: var(--accent);
transition: width 0.3s ease;
}
nav a:hover::after, nav a.active::after { width: 100%; }
nav a.active { color: var(--accent); }

/* ── LOADING SCREEN ── */
#loader {
    position: fixed; inset: 0;
    background: #ffffff;
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}

#loader-name {
    font-family: 'Playfair Display', serif;
    font-size: clamp(48px, 8vw, 96px);
    letter-spacing: -0.02em;
    color: var(--ink);
    overflow: hidden;
    display: flex;
}

.name-char {
    display: inline-block;
    animation: charDrop 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.name-char.space { width: 0.3em; }

@keyframes charDrop {
    from { transform: translateY(110%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

#loader.done {
animation: loaderFade 0.6s 0.2s ease both;
}
@keyframes loaderFade {
to { opacity: 0; transform: scale(0.98); }
}

/* ── MAIN CONTENT ── */
main {
padding-top: 100px;
min-height: 100vh;
}

/* ── GRID VIEW ── */
#grid-view {
    padding: 40px;
}

.grid-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.grid-cell {
    min-height: var(--cell);
    position: relative;
    overflow: hidden;
}

.grid-cell.clickable { cursor: none; }

/* blank cells */
.cell-blank { background: var(--bg);}
.cell-blank-acc { background: var(--accent);}


/* image cells */
.cell-image {
    padding: 0;
    background: var(--ink);

}
.cell-image img {
    width: 100%; 
    height: 100%; 
    min-height: var(--cell);
    object-fit: cover;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.4s, transform 0.5s;
}
.cell-image.clickable:hover  img { 
    transform: scale(1.04); 
}

.cell-image:hover  img { 
    filter: grayscale(0%); 
}

.non-proj-img { 
    grid-column: span 2;
    max-height: 450px;

}


/* title cells */
.cell-title {
    grid-column: span 2;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: var(--bg);
    transition: background 0.3s;
}
.cell-title:hover { 
    background: #f7f7f7; 
}

.cell-title .proj-num {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.15em;
    color: var(--mid);
    margin-bottom: 10px;
    text-transform: uppercase;
}
.cell-title h2 {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--ink);
    margin-bottom: 8px;
}
.cell-title .sub {
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--mid);
    text-transform: uppercase;
}
.cell-title .tags {
    display: flex; 
    flex-wrap: wrap; 
    gap: 6px;
    margin-top: 16px;
}
.cell-title .tag {
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 3px 8px;
    border: 1px solid #e0e0e0;
    color: var(--mid);
    border-radius: 20px;
}

/* quote cells */
.cell-quote {
    padding: 32px 28px;
    display: flex; align-items: center;
    background: var(--ink);
    color: var(--bg);
}
.cell-quote blockquote {
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    font-style: italic;
    font-weight: 300;
    line-height: 1.5;
}
.cell-quote cite {
    display: block;
    margin-top: 12px;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--mid);
    font-style: normal;
    text-transform: uppercase;
}

/* about row */
.cell-about {
    grid-column: span 2;
    padding: 40px;
    display: flex; flex-direction: column; justify-content: center;
    background: var(--accent);
    color: var(--bg);
}
.cell-about .about-label {
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 16px;
}
.cell-about h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 20px;
}
.cell-about p {
    font-size: 14px;
    line-height: 1.8;
    opacity: 0.85;
    max-width: 500px;
}
.cell-about .links {
    display: flex; 
    gap: 20px;
    margin-top: 24px;
}
.cell-about .links a {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bg);
    text-decoration: none;
    border-bottom: 1px solid rgba(245,240,232,0.4);
    padding-bottom: 2px;
    transition: border-color 0.3s;
}
.cell-about .links a:hover { 
    border-color: var(--bg); 
}

.cell-portrait {
    /* background: var(--ink); */
    grid-column: span 2;
    overflow: hidden;
    /* height: 500px; */
}
.cell-portrait img {
    width: 100%; height: 100%; min-height: var(--cell);
    object-fit: cover;
    /* filter: grayscale(0%) contrast(1.1); */
    mix-blend-mode: luminosity;
}

.cell-stat {
    padding: 28px;
    display: flex; flex-direction: column; justify-content: center;
    background: var(--light);
}
.cell-stat .stat-num {
    font-family: 'Playfair Display', serif;
    font-size: 52px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
}
.cell-stat .stat-label {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mid);
    margin-top: 8px;
}

/* ── LIST VIEW ── */
#list-view {
    display: none;
    padding: 40px;
}

#list-view.active { display: block; }
#grid-view.hidden { display: none; }

.list-header {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--mid);
    padding: 12px 0;
    border-bottom: 1px solid #e8e8e8;
    display: grid;
    grid-template-columns: 60px 1fr 200px 80px;
    gap: 20px;
    margin-bottom: 0;
}

.list-row {
    display: grid;
    grid-template-columns: 60px 1fr 200px 80px;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    cursor: none;
    transition: background 0.2s;
    padding-left: 8px;
    padding-right: 8px;
    margin: 0 -8px;
}
.list-row:hover { background: var(--light); }

.list-row .lr-num {
    font-size: 11px;
    color: var(--mid);
    letter-spacing: 0.1em;
}
.list-row .lr-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 400;
}
.list-row .lr-type {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mid);
}
.list-row .lr-year {
    font-size: 11px;
    color: var(--mid);
    text-align: right;
}

/* ── MODAL ── */
#modal-overlay {
    position: fixed; inset: 0;
    z-index: 500;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.35s ease;
}
#modal-overlay.open { opacity: 1; pointer-events: all; }

#modal-blur-bg {
    position: absolute; inset: 0;
    backdrop-filter: blur(12px);
    background: rgba(26,26,24,0.4);
}

#modal-box {
position: relative;
z-index: 1;
background: var(--bg);
width: 75vw;
max-width: calc(100vw - 60px);
max-height: 80vh;
overflow-y: auto;
transform: translateY(24px) scale(0.97);
transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
}
#modal-overlay.open #modal-box { transform: translateY(0) scale(1); }

#modal-close {
    position: absolute; top: 40px; right: 40px;
    width: 36px; height: 36px;
    background: none; border: 1px solid var(--accent);
    cursor: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    color: var(--accent);
    z-index: 2;
    transition: background 0.2s, color 0.2s;
}
#modal-close:hover { background: var(--accent); color: var(--bg); }

.modal-hero {
    width: 100%; height: 240px;
    object-fit: cover;
    display: block;
    filter: grayscale(20%);
}
.modal-hero-placeholder {
    width: 100%; height: 240px;
    background: var(--ink);
    display: flex; align-items: center; justify-content: center;
}

.modal-body { padding: 36px 40px 48px; }

.modal-cat {
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}
.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 34px;
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 8px;
}
.modal-sub {
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--mid);
    margin-bottom: 24px;
    text-transform: uppercase;
}
.modal-desc {
    font-size: 13px;
    line-height: 1.9;
    color: var(--ink);
    margin-bottom: 28px;
}
.modal-tags {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 28px;
}
.modal-tag {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 12px;
    border: 1px solid #e0e0e0;
    color: var(--ink);
}
.modal-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    border-top: 1px solid #f0f0f0;
    padding-top: 24px;
}
.modal-meta-item label {
    display: block;
    font-size: 9px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--mid);
    margin-bottom: 4px;
}
.modal-meta-item span {
    font-size: 13px;
    color: var(--ink);
}

/* Scrollbar */
#modal-box::-webkit-scrollbar { width: 4px; }
#modal-box::-webkit-scrollbar-track { background: var(--light); }
#modal-box::-webkit-scrollbar-thumb { background: var(--mid); }

/* ── MODAL TABS ── */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
    padding: 0 40px;
    background: #fff;
    position: sticky; top: 0; z-index: 3;
}
.modal-tab {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mid);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 14px 0;
    margin-right: 28px;
    cursor: none;
    transition: color 0.2s, border-color 0.2s;
}
.modal-tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.modal-tab:hover { color: var(--ink); }

/* iframe panel */
.modal-iframe-panel { display: none; }
.modal-iframe-panel.active { display: block; }
.modal-detail-panel { display: none; }
.modal-detail-panel.active { display: block; }

.modal-iframe-wrap {
    position: relative;
    width: 100%;
    background: #111;
}
/* default 16:9, but taller for websites */
.modal-iframe-wrap.ratio-video { padding-bottom: 56.25%; }
.modal-iframe-wrap.ratio-site  { height: 520px; }

.modal-iframe-wrap iframe {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    border: none;
    display: block;
}
.modal-iframe-wrap.ratio-site iframe {
    position: static;
    width: 100%; height: 100%;
}
.modal-iframe-wrap.ratio-site {
    position: relative;
    overflow: hidden;
}

.modal-iframe-fallback {
    padding: 32px 40px;
    display: flex; align-items: center; gap: 14px;
    background: var(--light);
}
.modal-iframe-fallback p {
    font-size: 12px; color: var(--mid); flex: 1;
    line-height: 1.6;
}
.modal-open-ext {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--ink);
    padding-bottom: 2px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 800px) {
    #grid-view { padding: 20px; }
    .grid-wrapper {
        grid-template-columns: repeat(1, 1fr);
        gap: 4px;
    }

    .cell-blank,
    .cell-blank-acc,
    .cell-quote,
    /* .cell-portrait, */
    .cell-image,
    /* .cell-title, */
    .cell-stat { display: none; }

    .cell-image.non-proj-img {
        display: flex;
        filter: grayscale(0%); 
    }

    header { padding: 20px 24px; }
    nav { gap: 20px; }

    #list-view { padding: 20px; }
    .list-header, .list-row {
        grid-template-columns: 40px 1fr 100px;
    }
    .lr-year { display: none; }

    .cell-about, 
    .cell-portrait,
    .non-proj-img, 
    .cell-title{ grid-column: span 1;}
}

/* cell enter animation */
.grid-cell {
    animation: cellFadeIn 0.5s ease both;
}

@keyframes cellFadeIn {
from { opacity: 0; transform: translateY(10px); }
to   { opacity: 1; transform: translateY(0); }
}