/* ==========================================================================
   portfolio.css — ref: tomkellyslack.com
   ========================================================================== */

:root {
    --page:      #fff;
    --ink:       #000;
    --ink-soft:  #666;
    --ink-faint: #aaa;
    --rule:      rgba(0,0,0,0.08);
}

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

html { scroll-behavior: smooth; background: var(--page); }

body {
    background: var(--page);
    color: var(--ink);
    font-family: 'Lora', serif;
    font-size: 10px;
    line-height: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ---- Nav ------------------------------------------------------------------ */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--page);
}

.nav__name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.01em;
    text-transform: none;
}

.nav__links {
    display: flex;
    gap: 28px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.nav__links a:hover { color: var(--ink); }

/* ---- Page body ------------------------------------------------------------ */

.site {
    padding-top: 60px;
    padding-left: 20px;
    padding-right: 20px;
}

/* ---- Sections ------------------------------------------------------------- */

section {
    padding-top: 60px;
}

.section-label {
    display: block;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 28px;
}

/* ---- Work — masonry stills ------------------------------------------------ */

.work-grid {
    columns: 5;
    column-gap: 6px;
}

.work-grid figure {
    break-inside: avoid;
    margin: 0 0 6px;
    cursor: zoom-in;
    overflow: hidden;
    position: relative;
    background: #f2f2f2; /* skeleton while lazy images load */
}

.work-grid img {
    width: 100%;
    display: block;
    transition: opacity 0.4s ease;
}

/* lazy images start invisible, fade in on load */
img.lazy { opacity: 0; }
img.img-loaded { opacity: 1; }

.work-grid figure:hover img.img-loaded,
.work-grid figure:hover img:not(.lazy) { opacity: 0.82; }

/* ---- Video grid ----------------------------------------------------------- */


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

.video-card { display: block; cursor: pointer; }

.video-card__thumb {
    overflow: hidden;
    aspect-ratio: 16/9;
    background: #000;
    position: relative;
}

.video-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.video-card:hover .video-card__thumb img { opacity: 0.8; }

.video-card__thumb iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.video-card__cap {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-top: 6px;
    line-height: 1.4;
}

/* ---- Film grid ------------------------------------------------------------ */


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

.film-card img {
    width: 100%;
    display: block;
}

.film-card figcaption {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-top: 8px;
    line-height: 1.6;
}

.film-card figcaption em {
    display: block;
    font-style: normal;
    color: var(--ink-faint);
    text-transform: none;
    margin-top: 2px;
    letter-spacing: 0;
}

/* below-fold sections: skip rendering until near viewport */
#video, #film, #contact {
    content-visibility: auto;
    contain-intrinsic-size: 0 600px;
}

/* ---- Contact -------------------------------------------------------------- */

#contact {
    padding-bottom: 80px;
}

.contact-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 8vw, 120px);
    max-width: 760px;
}

.methodology p {
    margin-bottom: 15px;
    font-size: 10px;
    line-height: 16px;
    color: var(--ink);
    max-width: 340px;
}

.methodology p:last-child { margin-bottom: 0; }

.contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    line-height: 15px;
}

.contact-list dt {
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 2px;
}

.contact-list dd { color: var(--ink); }

.contact-list a:hover { color: var(--ink-soft); }

/* ---- Footer --------------------------------------------------------------- */

footer {
    padding: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--rule);
    margin-top: 60px;
}

/* ---- Lightbox ------------------------------------------------------------- */

.lb {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.lb.lb--open {
    opacity: 1;
    pointer-events: all;
}

.lb__img {
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 50px);
    object-fit: contain;
    display: block;
    cursor: default;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate3d(-50%, -50%, 0);
}

.lb__btn {
    position: fixed;
    background: none;
    border: none;
    color: var(--ink-soft);
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 20px;
    transition: color 0.15s;
    line-height: 1;
    z-index: 10001;
}

.lb__btn:hover { color: var(--ink); }

.lb__prev { left: 0; top: 50%; transform: translateY(-50%); }
.lb__next { right: 0; top: 50%; transform: translateY(-50%); }
.lb__close { top: 0; right: 0; }

/* ---- Responsive ----------------------------------------------------------- */

@media (max-width: 1000px) {
    .video-grid { grid-template-columns: repeat(2, 1fr); }
    .work-grid { columns: 4; }
}

@media (max-width: 700px) {
    .nav__links { gap: 16px; }
    .work-grid { columns: 2; }
    .film-grid { grid-template-columns: 1fr; }
    .contact-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .video-grid { grid-template-columns: repeat(2, 1fr); }
    .work-grid { columns: 2; column-gap: 4px; }
    .work-grid figure { margin-bottom: 4px; }
}
