@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #ffffff;
    color: #111;
    scroll-behavior: smooth;
}

/* HERO (SMALLER LOOP AREA) */
header {
    position: relative;
    min-height: 32vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    box-sizing: border-box;
    background: #fafafa;
}

.hero-content {
    position: relative;
    z-index: 2;
    background: #ffffff;
    color: #111;
    text-align: center;
    padding: 30px 40px;
    border-radius: 10px;
    max-width: 90%;
    box-sizing: border-box;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

h1 {
    font-size: 3rem;
    margin: 0;
}

h2 {
    font-weight: 300;
    color: #555;
    margin-bottom: 15px;
}

/* Header name + profession — thin geometric sans to match the reference site */
.hero-content h1 {
    font-family: 'Proxima Nova', 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-size: 3.2rem;
    font-weight: 400;
    letter-spacing: 1px;
    color: #2b2b2b;
}

.hero-content h2 {
    font-family: 'Proxima Nova', 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.6rem;
    font-weight: 400;
    letter-spacing: 1px;
    color: #2b2b2b;
    margin-top: 14px;
}

/* NAVIGATION */
.nav {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav a {
    font-family: 'Proxima Nova', 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-decoration: none;
    color: #666;
    background: none;
    padding: 10px 14px;
    border: none;
    border-radius: 0;
    transition: color 0.3s ease;
}

.nav a:hover {
    background: none;
    color: #111;
}

/* SECTIONS */
.section {
    padding: 80px 10%;
}

/* Lock the work grid to exactly 1100px centered — tiles never resize */
#work {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 20px;
    box-sizing: border-box;
    opacity: 1;
    transition: opacity 0.4s ease;
}

#info-page {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.section.js-fade-out {
    opacity: 0;
}

/* BUTTONS */
button {
    background: #f0f0f0;
    color: #111;
    border: 1px solid #ddd;
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    border-radius: 5px;
}

button:hover {
    background: #e0e0e0;
}

/* TETROMINO LAYOUT — reel tiles centered on top, 3 projects underneath */
.tetromino {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reel-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: nowrap;
    transition: opacity 0.3s ease;
    opacity: 1;
}

/* Tiles cap at 353px but never force overflow — they shrink proportionally */
.reel-row .home-tile {
    flex: 0 1 353px;
    max-width: 353px;
    min-width: 0;
}

.reel-row.no-reels {
    margin-bottom: -20px;
}

.project-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 353px));
    gap: 20px;
    justify-content: center;
}

/* 2 across on medium screens */
@media (max-width: 1140px) {
    .reel-row {
        flex-wrap: wrap;
    }
    .project-row {
        grid-template-columns: repeat(2, minmax(0, 353px));
    }
}

/* 1 across on phones */
@media (max-width: 760px) {
    .reel-row {
        flex-direction: column;
        align-items: center;
    }
    .reel-row .home-tile {
        width: 100%;
    }
    .project-row {
        grid-template-columns: minmax(0, 353px);
    }
}

.project-row .home-tile {
    cursor: pointer;
}

.reel-tile {
    cursor: pointer;
}

/* EXPANDED PROJECT DETAIL VIEW */
.project-detail {
    max-width: 1060px;
    width: 100%;
    margin: 0 auto 30px;
    text-align: center;
    opacity: 1;
    transition: opacity 0.4s ease;
    box-sizing: border-box;
}

.project-detail.js-fade-out {
    opacity: 0;
    pointer-events: none;
}

.detail-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f0f0;
    border: 1px solid #e5e5e5;
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-image iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    color: #111;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.detail-close:hover {
    background: #fff;
    transform: scale(1.08);
}

.reel-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9e9e9;
    transition: background 0.3s ease;
}

.reel-tile:hover .reel-thumb {
    background: #ddd;
}

.detail-video-slot {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9e9e9;
}

/* Optional cover image for a reel (set with data-thumb on the reel tile) */
.reel-thumb,
.reel-tile:hover .reel-thumb,
.detail-video-slot {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.play-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 0;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.play-button:hover {
    background: none;
    transform: scale(1.08);
}

.detail-info {
    margin-top: 18px;
}

.detail-info h3 {
    margin: 0 0 8px;
    font-size: 1.5rem;
}

.detail-info p {
    margin: 0;
    color: #555;
    line-height: 1.5;
}



.home-tile {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 4 / 3;
    background: #f0f0f0;
    border: 1px solid #e5e5e5;
    transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.45, 0, 0.2, 1);
    opacity: 1;
}

.home-tile.js-fade-out {
    opacity: 0;
    pointer-events: none;
}

.home-tile img,
.home-tile iframe {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border: none;
    transition: 0.4s;
}

.home-tile:hover img {
    transform: scale(1.08);
}

.home-tile .project-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 14px 16px;
    background: rgba(255,255,255,0.88);
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.home-tile:hover .project-overlay {
    opacity: 1;
}

.home-tile .project-overlay h3 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    color: #111;
}

.home-tile .project-overlay p {
    margin: 0;
    font-size: 0.85rem;
    color: #555;
}

/* Demo reel tile always sits at the top of the tetromino */
.reel-tile {
    border: 2px solid #ccc;
}

.reel-tile .reel-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255,255,255,0.88);
    color: #111;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ABOUT BUTTON */
.download {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 18px;
    background: #f0f0f0;
    color: #111;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.download:hover {
    background: #e0e0e0;
}

footer {
    text-align: center;
    padding: 40px;
    color: #888;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-bottom: 14px;
}

.social-links a {
    color: #555;
    transition: color 0.3s ease;
    display: inline-flex;
}

.social-links a:hover {
    color: #111;
}

/* FLOATING NAV — semi-transparent pill that follows the user once the header nav scrolls out of view.
   Same order as the header: Home, Animation, Effects, Misc., Info — spaced evenly. */
.floating-nav {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translate(-50%, -16px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 18px;
    max-width: calc(100% - 24px);
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.floating-nav.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.floating-nav a {
    font-family: 'Proxima Nova', 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-decoration: none;
    color: #555;
    padding: 14px 16px;
    border-radius: 999px;
    white-space: nowrap;
    transition: color 0.3s ease, background 0.3s ease;
}

.floating-nav a:hover {
    color: #111;
    background: rgba(0, 0, 0, 0.06);
}

@media (max-width: 600px) {
    .floating-nav {
        gap: 2px;
        padding: 5px 8px;
    }
    .floating-nav a {
        font-size: 0.66rem;
        letter-spacing: 0.3px;
        padding: 12px 8px;
    }
}

/* PLAY BUTTON — simple semi-transparent white circle with a dark triangle */
.play-icon {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.play-icon circle {
    fill: rgba(255, 255, 255, 0.65);
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 2;
}

.play-icon path {
    fill: #222;
}

/* SLIDESHOW controls (multi-image projects) */
.slide-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    background: rgba(255,255,255,0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.slide-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.08);
}

.slide-prev { left: 12px; }
.slide-next { right: 12px; }

.slide-counter {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    padding: 4px 12px;
    font-size: 0.8rem;
    color: #111;
    background: rgba(255,255,255,0.88);
    border-radius: 999px;
    pointer-events: none;
}

/* Horizontal swipes go to the slideshow; vertical scrolling still works */
.detail-image {
    touch-action: pan-y;
}

.detail-image img {
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

@media (max-width: 600px) {
    .slide-nav {
        width: 34px;
        height: 34px;
    }
}


/* EXPANDED VIEW — title, subtitle, then role/programs (left) + trailer (right) */
.detail-info h3 {
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
    font-size: 2.1rem;
    margin: 0 0 4px;
}

.detail-info p {
    font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    color: #111;
}

.detail-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
    margin-top: 44px;
    text-align: left;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    font-size: 1.2rem;
    color: #111;
}

.detail-columns.no-trailer {
    grid-template-columns: minmax(0, 1fr);
}

.detail-label {
    font-weight: 500;
    white-space: nowrap;
}

/* Role + programs are scaled up so the left column is as tall as the trailer */
.detail-left {
    font-size: clamp(1.1rem, 2.4vw, 1.6rem);
}

.detail-role {
    display: flex;
    gap: 0.6em;
    margin-top: 10px;
    line-height: 1.4;
}

.detail-programs {
    margin-top: 2em;
}

.programs-head {
    display: flex;
    align-items: baseline;
    gap: 0.6em;
    min-height: 1.5em;
}

.program-name {
    opacity: 0;
    transition: opacity 0.35s ease;
    white-space: nowrap;
    color: #333;
}

.program-name.is-visible {
    opacity: 1;
}

.program-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 1.3em;
    margin-top: 1.1em;
}

.program-icon {
    width: 4.2em;
    height: 4.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    outline: none;
    border-radius: 14px;
    transition: transform 0.25s ease;
}

.program-icon:hover,
.program-icon:focus-visible {
    transform: scale(1.08);
}

.program-icon:focus-visible {
    box-shadow: 0 0 0 2px #888;
}

.program-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    -webkit-user-drag: none;
}

/* Shown if an icon file is missing */
.program-icon .icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    border: 1px solid #ddd;
    border-radius: 14px;
    font-size: 0.7em;
    font-weight: 500;
    color: #555;
}

.detail-trailer {
    text-align: center;
}

.trailer-label {
    margin-bottom: 18px;
}

.trailer-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #6a6a6a;
    overflow: hidden;
}

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

@media (max-width: 700px) {
    .detail-columns {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
        margin-top: 30px;
        font-size: 1rem;
    }
    .detail-left {
        font-size: 1.15rem;
    }
    .detail-info h3 {
        font-size: 1.6rem;
    }
}

/* Trailer with no role/programs: show it centered on its own */
.detail-columns.trailer-only {
    grid-template-columns: minmax(0, 1fr);
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.detail-columns.trailer-only .detail-left {
    display: none;
}


/* LOCAL MP4 PLAYER + VIMEO BACKUP */
.detail-image video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    object-fit: contain;
}

.backup-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    margin: 0;
    padding: 6px 12px;
    font-size: 0.75rem;
    background: rgba(255,255,255,0.9);
    border: 1px solid #ddd;
    border-radius: 999px;
}

.backup-btn:hover {
    background: #fff;
}

.backup-note {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 11;
    padding: 6px 14px;
    font-size: 0.78rem;
    color: #111;
    background: rgba(255,255,255,0.92);
    border-radius: 999px;
    pointer-events: none;
    white-space: nowrap;
    max-width: calc(100% - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
}
