/* Troy Roscoe - portfolio site
   Design language: blend of amaraabbas.com (restrained typography, serif/sans pairing,
   quiet contact block) and maceofrost.com (full-bleed visual work grid, minimal nav,
   credentials overlaid on thumbnails). Neutral, monochrome palette per brief. */

:root {
    --bg: #0a0a0a;
    --bg-raise: #121212;
    --ink: #f4f4f2;
    --muted: #9a9a95;
    --line: #262624;
    --serif: "Iceberg", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

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

/* ---------- Header / nav ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px clamp(20px, 4vw, 48px);
    background: linear-gradient(to bottom, rgba(10,10,10,0.92), rgba(10,10,10,0));
}

/* Blur lives on a pseudo-element rather than directly on .site-header.
   backdrop-filter on an ancestor creates a new containing block for any
   position:fixed descendant (like the mobile nav panel below), which was
   pinning the mobile menu to the header's own (short) box instead of the
   full viewport and pushing "Work" off-screen. Keeping the blur on ::before
   preserves the look without affecting how nav.primary-nav is positioned. */
.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.wordmark {
    font-family: var(--sans);
    font-weight: 800;
    font-style: italic;
    font-size: 20px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.wordmark span { color: var(--muted); }

.logo {
    height: 36px;
    width: auto;
    display: block;
}

nav.primary-nav {
    display: flex;
    gap: clamp(16px, 2.5vw, 32px);
}

nav.primary-nav a {
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 6px 2px;
    border-bottom: 1px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}

nav.primary-nav a:hover,
nav.primary-nav a[aria-current="page"] {
    color: var(--ink);
    border-color: var(--ink);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--ink);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

/* ---------- Homepage grid ---------- */

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

.work-tile {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-raise);
    display: block;
}

.work-tile img,
.work-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.01);
    transition: transform .5s ease, filter .5s ease;
    filter: grayscale(35%) brightness(0.82);
}

.work-tile:hover img,
.work-tile:hover video {
    transform: scale(1.05);
    filter: grayscale(0%) brightness(0.95);
}

@media (hover: hover) and (pointer: fine) {
    .watch-pill {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.92);
        background: rgba(10,10,10,0.78);
        border: 1px solid rgba(244,244,242,0.5);
        color: var(--ink);
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        padding: 13px 24px;
        border-radius: 999px;
        opacity: 0;
        transition: opacity .25s ease, transform .25s ease, background .15s ease, border-color .15s ease, color .15s ease;
        pointer-events: auto;
        white-space: nowrap;
        z-index: 5;
        display: inline-block;
    }
    .work-tile:hover .watch-pill {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    /* Highlight and invert the pill itself when the cursor is directly over it */
    .watch-pill:hover {
        transform: translate(-50%, -50%) scale(1.08);
        background: var(--ink);
        border-color: var(--ink);
        color: var(--bg);
    }
}

.work-tile .tile-info {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 18px clamp(16px, 2.5vw, 28px) 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0));
}

.tile-info .kicker {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.tile-info h2 {
    font-family: var(--serif);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: clamp(14px, 1.6vw, 19px);
    margin: 0;
}

.tile-badges {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tile-badges span {
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink);
    border: 1px solid rgba(244,244,242,0.4);
    border-radius: 999px;
    padding: 3px 9px;
    background: rgba(10,10,10,0.5);
}

/* ---------- Project page ---------- */

.project-header {
    padding: 48px clamp(20px, 5vw, 64px) 28px;
    max-width: 900px;
}

.project-header .kicker {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

.project-header h1 {
    font-family: var(--serif);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: clamp(28px, 4.4vw, 48px);
    margin: 0 0 8px;
    line-height: 1.05;
}

.project-header .subtitle {
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 0;
}

.credits {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 10px;
}

.credits strong { color: var(--ink); font-weight: 600; }

.awards {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.awards span {
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 12px;
    color: var(--muted);
}

.video-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

@media (min-width: 721px) {
    .video-embed {
        width: calc(100% - clamp(30px, 6vw, 90px));
        max-width: 1280px;
        margin: 0 auto;
    }
}

.video-embed iframe,
.video-embed video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.back-link {
    display: inline-block;
    margin: clamp(28px, 4vw, 40px) clamp(20px, 5vw, 64px) 80px;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    padding-bottom: 2px;
}
.back-link:hover { color: var(--ink); border-color: var(--ink); }

.back-top {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px;
    padding: 9px 16px 9px 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink);
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: 999px;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.back-top:hover,
.back-top:focus-visible {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
    transform: translateX(-2px);
}

.back-top-row {
    display: none;
}

@media (min-width: 721px) {
    .back-top-mobile {
        display: none;
    }
    .back-top-row {
        display: flex;
        justify-content: flex-end;
        width: calc(100% - clamp(30px, 6vw, 90px));
        max-width: 1280px;
        margin: 0 auto 14px;
    }
    .back-top-row .back-top {
        margin: 0;
        box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    }
}

/* ---------- Showcase gallery ---------- */

.showcase-gallery {
    columns: 4 240px;
    column-gap: 10px;
    width: 100%;
    margin: clamp(28px, 4vw, 40px) 0 0;
    padding: 0 clamp(20px, 5vw, 64px);
}

.showcase-gallery .showcase-img {
    display: block;
    width: 100%;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin: 0 0 10px;
    position: relative;
    overflow: hidden;
    background: var(--bg-raise);
}

.showcase-gallery img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(30%) brightness(0.85);
    cursor: zoom-in;
}

.showcase-gallery .showcase-placeholder {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 12px;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    background: repeating-linear-gradient(45deg, #141412, #141412 10px, #171715 10px, #171715 20px);
}

@media (max-width: 720px) {
    .showcase-gallery {
        columns: 2 140px;
        column-gap: 8px;
    }
    .showcase-gallery .showcase-img {
        margin: 0 0 8px;
    }
}

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

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: #050505;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease;
    padding: clamp(20px, 6vw, 60px);
    -webkit-tap-highlight-color: transparent;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay .lightbox-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    filter: none;
    cursor: default;
}

.lightbox-close {
    position: fixed;
    top: clamp(14px, 3vw, 28px);
    right: clamp(14px, 3vw, 28px);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(244,244,242,0.4);
    background: rgba(10,10,10,0.7);
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
    z-index: 1001;
}

.lightbox-close:hover {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
    transform: scale(1.06);
}

body.lightbox-open {
    overflow: hidden;
}

/* ---------- About page ---------- */

.about-wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 140px clamp(20px, 5vw, 64px) 100px;
}

.about-grid {
    display: flex;
    gap: clamp(28px, 5vw, 56px);
    align-items: flex-start;
}

.about-photo {
    flex: 0 0 300px;
}

.about-photo img {
    width: 100%;
    display: block;
    border-radius: 3px;
    filter: grayscale(15%);
}

.about-copy {
    flex: 1;
    min-width: 0;
    max-width: 620px;
}

@media (max-width: 720px) {
    .about-grid { flex-direction: column; }
    .about-photo { flex: 0 0 auto; max-width: 260px; }
}

.about-wrap .kicker {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
}

.about-wrap h1 {
    font-family: var(--serif);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: clamp(26px, 4.4vw, 40px);
    margin: 0 0 32px;
    line-height: 1.1;
}

.about-wrap p {
    font-size: 17px;
    color: #d9d9d6;
    margin: 0 0 20px;
}

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

.contact-wrap {
    min-height: 70vh;
    display: flex;
    align-items: center;
    padding: 140px clamp(20px, 5vw, 64px) 100px;
}

.contact-section {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px clamp(20px, 5vw, 64px) 100px;
    border-top: 1px solid var(--line);
    padding-top: 48px;
}

.contact-section h2.section-kicker {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 28px;
    font-weight: 600;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    width: 100%;
    max-width: 980px;
}

.contact-wrap h1 {
    font-family: var(--serif);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: clamp(26px, 4.4vw, 40px);
    margin: 0 0 28px;
}

.contact-block {
    margin-bottom: 28px;
}

.contact-block h2 {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
    margin: 0 0 10px;
    font-weight: 600;
}

.contact-block a,
.contact-block p {
    font-size: 15px;
    margin: 0 0 4px;
    color: var(--ink);
}

.socials {
    display: flex;
    gap: 14px;
    margin-top: 8px;
}

.socials a {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--muted);
    transition: color .15s ease, border-color .15s ease;
}
.socials a:hover { color: var(--ink); border-color: var(--ink); }

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

footer.site-footer {
    padding: 28px clamp(20px, 5vw, 64px) 40px;
    color: var(--muted);
    font-size: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--line);
}

.footer-socials {
    display: flex;
    gap: 10px;
    order: 2;
}

.footer-socials a {
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    letter-spacing: 0.02em;
    color: var(--muted);
    transition: color .15s ease, border-color .15s ease;
}

.footer-socials a:hover { color: var(--ink); border-color: var(--ink); }

footer.site-footer span:last-of-type { order: 3; }

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

@media (max-width: 720px) {
    .work-grid { grid-template-columns: 1fr; }
    .work-tile { aspect-ratio: 4 / 3; }

  nav.primary-nav {
        position: fixed;
        inset: 0;
        top: 0;
        z-index: 100;
        background: #0a0a0a;
        opacity: 1;
        flex-direction: column;
        justify-content: center;
        padding: 24px;
        gap: 26px;
        transform: translateX(100%);
        transition: transform .25s ease;
        box-shadow: -8px 0 24px rgba(0,0,0,0.6);
  }
    nav.primary-nav.open { transform: translateX(0); }
    nav.primary-nav a {
        font-size: 20px;
        padding: 10px 2px;
    }

  .nav-toggle {
        display: block;
        position: relative;
        z-index: 101;
  }

  body.nav-open { overflow: hidden; }

  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
    .project-header { padding-top: 28px; }
    .about-wrap { padding-top: 110px; }
    .contact-wrap { padding-top: 110px; }
}
