:root {
    --bg-color: #070809;
    --text-color: #f1f1ea;
    --accent-color: #c7ff36;
    --secondary-color: #72dcff;
    --detail-red: #ff6048;
    --detail-muted: #8f9697;
    --detail-panel: #111315;
    --detail-shell: min(1640px, calc(100vw - 64px));
    --detail-mono: "IBM Plex Mono", monospace;
    --detail-sans: "Space Grotesk", sans-serif;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scrollbar-color: var(--accent-color) var(--bg-color);
}

body {
    margin: 0;
    overflow-x: hidden;
    background: var(--bg-color) !important;
    color: var(--text-color);
    font-family: var(--detail-sans) !important;
}

::selection {
    background: var(--accent-color);
    color: var(--bg-color);
}

a { color: inherit; }

header,
header.scrolled {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0 !important;
    border: 0 !important;
    background: rgba(7, 8, 9, 0.78) !important;
    box-shadow: none !important;
    backdrop-filter: blur(16px);
}

header nav {
    width: var(--detail-shell) !important;
    min-height: 92px;
    margin: 0 auto;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: center;
    gap: 20px;
}

.logo {
    grid-column: 1 / span 4;
    width: max-content;
    color: var(--text-color) !important;
    font-family: var(--detail-sans) !important;
    font-size: clamp(1rem, 1.05vw, 1.18rem) !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    transition: color 0.24s ease;
}

.logo:hover,
.logo:focus-visible {
    color: var(--accent-color) !important;
}

.nav-links {
    grid-column: 6 / -1;
    display: flex !important;
    justify-content: flex-end;
    gap: clamp(18px, 2.2vw, 38px) !important;
    position: static !important;
    padding: 0 !important;
    background: none !important;
}

.nav-links li { list-style: none; }

.nav-links a {
    padding: 0 !important;
    color: #b8bcbc !important;
    font: 500 clamp(0.82rem, 0.78vw, 0.92rem) var(--detail-mono) !important;
    letter-spacing: 0 !important;
    text-transform: uppercase;
    transition: color 0.25s ease;
}

.nav-links a::after { display: none !important; }

.nav-links a:hover,
.nav-links a.active { color: var(--accent-color) !important; }

.hamburger {
    display: none;
    grid-column: 12;
    justify-self: end;
}

.hamburger .line {
    width: 26px !important;
    height: 1px !important;
    margin: 6px 0 !important;
    background: var(--text-color) !important;
}

.cursor,
.cursor-follower {
    position: fixed;
    z-index: 3000;
    top: 0;
    left: 0;
    pointer-events: none;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.cursor {
    width: 4px !important;
    height: 4px !important;
    background: var(--accent-color) !important;
    border: 0 !important;
}

.cursor-follower {
    width: 24px !important;
    height: 24px !important;
    border: 1px solid rgba(241, 241, 234, 0.65) !important;
    background: transparent !important;
}

.project-hero {
    min-height: 88svh !important;
    height: auto !important;
    padding: 150px max(32px, calc((100vw - 1640px) / 2)) 72px;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: flex-start !important;
    background: var(--bg-color);
}

.video-background-wrapper video,
.video-background-wrapper iframe {
    opacity: 0.66 !important;
    filter: saturate(0.82) contrast(1.08) brightness(0.78);
}

.hero-overlay {
    background: linear-gradient(180deg, rgba(7, 8, 9, 0.15), rgba(7, 8, 9, 0.88)) !important;
}

.hero-content {
    width: min(1640px, calc(100vw - 64px)) !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    text-align: left !important;
    opacity: 0;
    transform: translateY(32px);
    animation: detailHeroIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

.hero-content h1 {
    max-width: 1250px;
    margin: 0 0 28px !important;
    color: var(--text-color) !important;
    font-family: var(--detail-sans) !important;
    font-size: clamp(4rem, 9vw, 10rem) !important;
    line-height: 0.84 !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-transform: uppercase;
}

.hero-content h1 small {
    color: var(--accent-color);
    font-family: var(--detail-mono);
    font-size: 0.14em !important;
    letter-spacing: 0 !important;
}

.hero-content p {
    max-width: 700px;
    margin: 0 0 8px !important;
    color: #c1c5c3 !important;
    font-size: clamp(1rem, 1.35vw, 1.25rem) !important;
    line-height: 1.5;
}

.detail-content {
    width: var(--detail-shell) !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: clamp(90px, 10vw, 160px) 0 !important;
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    gap: 20px !important;
    align-items: start;
}

.main-col {
    grid-column: 1 / span 8;
    min-width: 0;
}

.sidebar {
    grid-column: 10 / -1;
    position: sticky !important;
    top: 120px !important;
    padding: 0 !important;
}

.main-col > p,
.main-col p {
    max-width: 850px;
    color: #b7bcba !important;
    font-size: clamp(1rem, 1.25vw, 1.18rem) !important;
    line-height: 1.7 !important;
}

.detail-video-wrapper,
.single-video-wrapper,
.main-col img,
.main-col > video,
.local-video,
.image-wrapper {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.detail-video-wrapper {
    margin: 0 0 clamp(36px, 5vw, 76px) !important;
    background: #0d0f10 !important;
}

.single-video-wrapper,
.image-wrapper,
.main-col > img {
    margin-block: clamp(34px, 5vw, 72px) !important;
    overflow: hidden;
}

.main-col img,
.main-col video,
.single-video-wrapper video,
.image-wrapper img {
    width: 100%;
    display: block;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

.main-col img:hover,
.single-video-wrapper:hover video,
.image-wrapper:hover img {
    transform: scale(1.015);
    filter: saturate(1.04) contrast(1.03);
}

.sidebar h3 {
    margin: 0 0 12px !important;
    padding: 0 !important;
    border: 0 !important;
    color: var(--detail-muted) !important;
    font: 500 0.68rem var(--detail-mono) !important;
    letter-spacing: 0 !important;
    text-transform: uppercase;
}

.info-block {
    margin-bottom: 36px !important;
    padding: 18px 20px;
    background: var(--detail-panel);
}

.info-block ul { margin: 0; }

.info-block li,
.info-block p,
.info-block a {
    color: var(--text-color) !important;
    font-family: var(--detail-sans) !important;
    font-size: 0.98rem !important;
    line-height: 1.45;
}

.back-link {
    min-height: 52px;
    margin-top: 24px !important;
    padding: 0 18px;
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    background: var(--text-color);
    color: var(--bg-color) !important;
    font: 500 0.74rem var(--detail-mono) !important;
    text-transform: uppercase;
    opacity: 1 !important;
    transition: background 0.25s ease, transform 0.3s ease !important;
}

.back-link:hover {
    background: var(--accent-color);
    transform: translateX(-6px);
}

.project-secondary-action {
    clear: both;
    margin: clamp(48px, 6vw, 84px) 0 clamp(72px, 8vw, 112px);
    display: flex;
    justify-content: flex-end;
}

.project-secondary-action a {
    min-height: 48px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    color: var(--accent-color) !important;
    font: 500 0.84rem var(--detail-mono);
    text-decoration: none;
    text-transform: uppercase;
    border-bottom: 1px solid currentColor;
    transition: color 0.25s ease, transform 0.3s ease;
}

.project-secondary-action a:hover,
.project-secondary-action a:focus-visible {
    color: var(--text-color) !important;
    transform: translateX(6px);
}

.selected-lyric-videos {
    margin-top: clamp(82px, 10vw, 150px);
}

.selected-lyric-videos > h2 {
    max-width: 780px;
    margin: 0 0 clamp(48px, 6vw, 82px);
    font-size: clamp(2.6rem, 5vw, 5.8rem);
    line-height: 0.92;
    font-weight: 500;
    text-transform: uppercase;
}

.lyric-video-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(48px, 6vw, 82px) 20px;
}

.lyric-video-card {
    min-width: 0;
    color: var(--text-color);
    text-decoration: none;
}

.lyric-video-poster {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0d0f10;
}

.lyric-video-poster img {
    width: 100%;
    height: 100%;
    margin: 0 !important;
    display: block;
    object-fit: cover;
    filter: saturate(0.88) brightness(0.82);
    transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.lyric-video-poster span {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: var(--accent-color);
    color: var(--bg-color);
    transition: transform 0.3s ease, background 0.25s ease;
}

.lyric-video-meta {
    padding-top: 16px;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.lyric-video-meta b {
    padding-top: 4px;
    color: var(--accent-color);
    font: 500 0.68rem var(--detail-mono);
}

.lyric-video-meta h3 {
    margin: 0;
    font-size: clamp(1.05rem, 1.7vw, 1.5rem);
    line-height: 1.15;
    font-weight: 500;
    transition: color 0.25s ease;
}

.lyric-video-card:hover .lyric-video-poster img,
.lyric-video-card:focus-visible .lyric-video-poster img {
    transform: scale(1.035);
    filter: saturate(1) brightness(0.92);
}

.lyric-video-card:hover .lyric-video-poster span,
.lyric-video-card:focus-visible .lyric-video-poster span {
    background: var(--text-color);
    transform: rotate(8deg);
}

.lyric-video-card:hover .lyric-video-meta h3,
.lyric-video-card:focus-visible .lyric-video-meta h3 {
    color: var(--accent-color);
}

.project-end-actions {
    clear: both;
    padding-top: clamp(54px, 7vw, 96px);
}

.project-end-actions .back-link {
    margin-top: 0 !important;
}

main > .section,
#graphic-design.section {
    width: var(--detail-shell) !important;
    margin: 0 auto;
    padding: 170px 0 100px !important;
}

.section-title {
    margin: 0 0 clamp(70px, 9vw, 130px) !important;
    color: var(--text-color) !important;
    font-family: var(--detail-sans) !important;
    font-size: clamp(4rem, 9vw, 10rem) !important;
    line-height: 0.84 !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-transform: uppercase;
}

.section-title::before,
.section-title::after { display: none !important; }

.projects-grid {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    gap: clamp(60px, 7vw, 110px) 20px !important;
}

.project-card,
.project-card:first-child {
    grid-column: span 6 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
}

.project-card .image-wrapper {
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    aspect-ratio: 16 / 10;
    display: block;
    overflow: hidden;
    background: var(--detail-panel);
}

.project-card .image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
}

.project-info { padding: 18px 0 0 !important; }

.project-meta {
    padding: 0 !important;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
}

.project-meta h3 {
    margin: 0;
    color: var(--text-color);
    font-size: clamp(1.5rem, 2.5vw, 2.8rem);
    font-weight: 500;
}

.show-more {
    color: var(--accent-color) !important;
    font: 500 0.7rem var(--detail-mono) !important;
    text-transform: uppercase;
}

.gallery-container,
.gallery-container.grid-2,
.gallery-container.grid-3,
.gallery-container.masonry {
    width: 100% !important;
    margin: 0 0 20px !important;
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    gap: 20px !important;
    columns: auto !important;
}

.gallery-item {
    grid-column: span 6;
    margin: 0 !important;
    overflow: hidden;
    background: var(--detail-panel) !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.grid-3 .gallery-item { grid-column: span 4; }

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0 !important;
    cursor: zoom-in !important;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.018);
    filter: saturate(1.04) contrast(1.02);
}

.gallery-caption {
    margin: 0 !important;
    padding: 14px 16px !important;
    color: #b8bdbc !important;
    font: 0.68rem/1.45 var(--detail-mono) !important;
    text-transform: uppercase;
}

footer {
    min-height: 110px;
    padding: 32px max(32px, calc((100vw - 1640px) / 2)) !important;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: var(--bg-color) !important;
    border: 0 !important;
}

.footer-socials {
    display: flex;
    gap: 22px;
}

.footer-socials a {
    color: var(--detail-muted) !important;
    font-size: 1rem;
}

.footer-socials a:hover { color: var(--accent-color) !important; }

.detail-reveal {
    opacity: 0;
    transform: translateY(42px);
    transition: opacity 0.75s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-reveal.detail-in {
    opacity: 1;
    transform: translateY(0);
}

.detail-scroll-meter {
    position: fixed;
    z-index: 2200;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    transform: scaleX(var(--detail-scroll, 0));
    transform-origin: left;
}

@keyframes detailHeroIn {
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    :root { --detail-shell: calc(100vw - 40px); }

    .detail-content {
        grid-template-columns: 1fr !important;
        gap: 70px !important;
    }

    .main-col,
    .sidebar { grid-column: auto; }

    .sidebar { position: relative !important; top: auto !important; }
}

@media (max-width: 760px) {
    :root { --detail-shell: calc(100vw - 32px); }

    header nav { min-height: 72px; }
    .logo { grid-column: 1 / span 8; font-size: 1rem !important; }
    .hamburger { display: block !important; }

    .nav-links {
        position: fixed !important;
        inset: 72px 0 auto !important;
        padding: 26px 16px 34px !important;
        display: grid !important;
        gap: 20px !important;
        background: rgba(7, 8, 9, 0.98) !important;
        transform: translateY(-130%);
        opacity: 0;
        transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
    }

    .project-hero {
        min-height: 78svh !important;
        padding: 120px 16px 48px;
    }

    .hero-content { width: 100% !important; }
    .hero-content h1 { font-size: clamp(3.2rem, 16vw, 5.8rem) !important; }

    main > .section,
    #graphic-design.section { padding-top: 130px !important; }

    .section-title { font-size: clamp(3.2rem, 15vw, 5.8rem) !important; }

    .project-card,
    .project-card:first-child,
    .gallery-item,
    .grid-3 .gallery-item { grid-column: 1 / -1 !important; }

    .projects-grid,
    .gallery-container,
    .gallery-container.grid-2,
    .gallery-container.grid-3,
    .gallery-container.masonry { grid-template-columns: 1fr !important; }

    .cursor,
    .cursor-follower { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .detail-reveal,
    .hero-content { opacity: 1; transform: none; }
}

/* Centered graphic-design composition */
main > .section .section-title,
#graphic-design .section-title {
    text-align: center;
}

main > .section .projects-grid,
main > .section .gallery-container,
#graphic-design .projects-grid {
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

#graphic-design .project-info,
#graphic-design .project-meta {
    text-align: center;
}

#graphic-design .project-meta {
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

main > .section .gallery-caption {
    text-align: center;
}

/* Balanced 9:16 galleries */
.graphic-portrait-gallery .gallery-item {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent !important;
}

.graphic-portrait-gallery .gallery-item img {
    width: auto !important;
    max-width: 100%;
    max-height: min(72vh, 760px);
    object-fit: contain;
    cursor: zoom-in !important;
}

.graphic-portrait-gallery .gallery-caption {
    width: 100%;
}

@media (max-width: 680px) {
    .graphic-portrait-gallery .gallery-item {
        padding: 0;
    }

    .graphic-portrait-gallery .gallery-item img {
        width: 100% !important;
        max-height: none;
    }
}

body.has-open-lightbox {
    overflow: hidden;
}

.image-lightbox {
    position: fixed;
    z-index: 5000;
    inset: 0;
    padding: clamp(20px, 4vw, 64px);
    display: grid;
    place-items: center;
    background: rgba(7, 8, 9, 0.96);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: zoom-out !important;
}

.image-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.image-lightbox img {
    width: auto !important;
    height: auto !important;
    max-width: min(92vw, 1800px) !important;
    max-height: 90svh !important;
    margin: 0 !important;
    display: block;
    object-fit: contain;
    transform: scale(0.96);
    transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default !important;
}

.image-lightbox.is-open img {
    transform: scale(1);
}

.image-lightbox-close {
    position: absolute;
    z-index: 2;
    top: max(20px, env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: var(--text-color);
    color: var(--bg-color);
    cursor: pointer !important;
    transition: background 0.25s ease, transform 0.3s ease;
}

.image-lightbox-close::before,
.image-lightbox-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 1px;
    background: currentColor;
    transform: translate(-50%, -50%) rotate(45deg);
}

.image-lightbox-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.image-lightbox-close:hover,
.image-lightbox-close:focus-visible {
    background: var(--accent-color);
    transform: rotate(90deg);
}

/* Final mobile grid safeguards */
@media (max-width: 760px) {
    header nav {
        gap: 12px;
    }

    .project-hero {
        padding-right: 16px !important;
        padding-left: 16px !important;
    }

    .hero-content,
    .detail-content,
    .main-col,
    .sidebar,
    .project-card,
    .gallery-item {
        min-width: 0 !important;
    }

    .hero-content h1 {
        max-width: 100%;
        font-size: clamp(2.85rem, 15vw, 5.2rem) !important;
        line-height: 0.9 !important;
        overflow-wrap: anywhere;
    }

    .detail-content {
        gap: 52px !important;
    }

    .main-col p,
    .info-block,
    .info-block a {
        overflow-wrap: anywhere;
    }

    .detail-video-wrapper,
    .single-video-wrapper,
    .image-wrapper,
    .main-col iframe,
    .main-col video,
    .main-col img {
        max-width: 100% !important;
    }

    main > .section,
    #graphic-design.section {
        padding-top: 112px !important;
        padding-bottom: 72px !important;
    }

    .section-title {
        font-size: clamp(2.8rem, 14vw, 5rem) !important;
        line-height: 0.9 !important;
        overflow-wrap: anywhere;
    }

    .project-meta {
        flex-wrap: wrap;
    }

    footer {
        padding-right: 16px !important;
        padding-left: 16px !important;
    }

    .project-secondary-action {
        margin: 40px 0 64px;
        justify-content: flex-start;
    }

    .project-secondary-action a {
        padding-left: 0;
    }

    .project-end-actions {
        padding-top: 48px;
    }

    .selected-lyric-videos {
        margin-top: 72px;
    }

    .selected-lyric-videos > h2 {
        margin-bottom: 42px;
        font-size: clamp(2.35rem, 11vw, 4rem);
    }

    .lyric-video-grid {
        grid-template-columns: 1fr;
        gap: 46px;
    }
}

@media (max-width: 360px) {
    .hero-content h1,
    .section-title {
        font-size: 2.55rem !important;
    }
}
