/* ==========================================================================
   SINGLE PROJECT PAGE
   Awwwards-level design with ASCII canvas, sophisticated animations
   ========================================================================== */

body {
    background: #000;
}

.single-project-page {
    --accent: #fff;
    --accent-dim: rgba(255, 255, 255, 0.6);
    --accent-muted: rgba(255, 255, 255, 0.4);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --crimson: rgb(180, 30, 50);
    --crimson-dim: rgba(180, 30, 50, 0.6);
    --transition-smooth: cubic-bezier(0.23, 1, 0.32, 1);
}

/* ==========================================================================
   Section Labels
   ========================================================================== */

.section-label {
    display: block;
    font-family: "Courier New", monospace;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-muted);
    margin-bottom: 16px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.project-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.project-hero__canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.project-hero__gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.9) 100%
    );
    z-index: 2;
    pointer-events: none;
}

.project-hero__content {
    position: relative;
    z-index: 3;
    padding-top: 160px;
    padding-bottom: 120px;
}

/* Project Type Tag */
.project-type-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.project-type-tag__bracket {
    font-family: "Courier New", monospace;
    font-size: 14px;
    color: var(--crimson);
}

.project-type-tag__text {
    font-family: "Courier New", monospace;
    font-size: 12px;
    letter-spacing: 3px;
    color: var(--accent-dim);
}

/* Project Title */
.project-title {
    font-family: "Lexend", sans-serif;
    font-size: clamp(48px, 10vw, 120px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.03em;
    color: var(--accent);
    margin: 0 0 32px 0;
    max-width: 1200px;
    overflow: hidden;
}

.project-title__word {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: wordReveal 0.8s var(--transition-smooth) forwards;
    animation-delay: calc(var(--word-index) * 0.1s + 0.3s);
    margin-right: 0.25em;
}

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

/* Project Client */
.project-client {
    display: flex;
    align-items: center;
    gap: 16px;
}

.project-client__label {
    font-family: "Courier New", monospace;
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--accent-muted);
}

.project-client__name {
    font-family: "Lexend", sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: var(--accent-dim);
}

/* ==========================================================================
   Media Section
   ========================================================================== */

.project-media {
    padding: 0 24px 80px 24px;
    margin-top: -80px;
    position: relative;
    z-index: 4;
}

@media (min-width: 768px) {
    .project-media {
        padding: 0 48px 80px 48px;
    }
}

/* Video Player */
.project-video {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
}

.project-video__glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        ellipse at center,
        rgba(180, 30, 50, 0.15) 0%,
        transparent 50%
    );
    pointer-events: none;
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.project-video__wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    background: #0a0a0a;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
}

.project-video__wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Featured Image */
.project-featured {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
}

.project-featured__image {
    display: block;
    width: 100%;
    height: auto;
}

/* ==========================================================================
   Project Details Section
   ========================================================================== */

.project-details {
    padding-top: 80px;
    padding-bottom: 80px;
    border-top: 1px solid var(--border-subtle);
}

/* Ensure content-gutters applies - reinforcement for edge cases */
.project-details.content-gutters {
    padding-left: max(150px, 8vw);
    padding-right: max(150px, 8vw);
}

@media (max-width: 976px) {
    .project-details.content-gutters {
        padding-left: 50px;
        padding-right: 50px;
    }
}

@media (max-width: 506px) {
    .project-details.content-gutters {
        padding-left: 24px;
        padding-right: 24px;
    }
}

.project-details__grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 80px;
    align-items: start;
}

/* Brief */
.project-brief__text {
    font-family: "Lexend", sans-serif;
    font-size: 18px;
    font-weight: 300;
    line-height: 1.8;
    color: var(--accent-dim);
    margin: 0;
    max-width: 680px;
}

/* Sidebar */
.project-details__sidebar {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Capabilities */
.project-capabilities__list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.capability-pill {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    font-family: "Lexend", sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--accent-dim);
    opacity: 0;
    transform: translateY(10px);
}

[data-stagger-children].is-revealed .capability-pill {
    opacity: 1;
    transform: translateY(0);
    animation: pillReveal 0.5s var(--transition-smooth) forwards;
    animation-delay: calc(var(--pill-index) * 0.05s);
}

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


/* Meta Items */
.project-meta-item__value {
    font-family: "Lexend", sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: var(--accent);
}

/* CTA Button */
.project-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 16px 28px;
    background: transparent;
    border: 1px solid var(--accent-muted);
    border-radius: 8px;
    text-decoration: none;
    overflow: hidden;
    transition: border-color 0.3s ease;
    margin-top: 16px;
}

.project-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--accent);
    transition: width 0.4s var(--transition-smooth);
    z-index: 0;
}

.project-cta:hover::before {
    width: 100%;
}

.project-cta:hover {
    border-color: var(--accent);
}

.project-cta__text {
    position: relative;
    z-index: 1;
    font-family: "Lexend", sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
    transition: color 0.3s ease;
}

.project-cta:hover .project-cta__text {
    color: #000;
}

.project-cta__arrow {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    width: 24px;
    height: 12px;
}

.project-cta__arrow-line {
    width: 16px;
    height: 1px;
    background: var(--accent);
    transition: all 0.3s ease;
}

.project-cta:hover .project-cta__arrow-line {
    width: 20px;
    background: #000;
}

.project-cta__arrow-head {
    width: 6px;
    height: 6px;
    border-top: 1px solid var(--accent);
    border-right: 1px solid var(--accent);
    transform: rotate(45deg);
    margin-left: -4px;
    transition: border-color 0.3s ease;
}

.project-cta:hover .project-cta__arrow-head {
    border-color: #000;
}

/* ==========================================================================
   Gallery Section
   ========================================================================== */

.project-gallery {
    padding: 80px 0;
    background: rgba(255, 255, 255, 0.015);
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.project-gallery__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 40px;
}

.project-gallery__count {
    font-family: "Courier New", monospace;
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--accent-muted);
}

.project-gallery__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Gallery Item */
.gallery-item {
    margin: 0;
}

.gallery-item__inner {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    perspective: 1000px;
}

.gallery-item__shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    z-index: 3;
    pointer-events: none;
    transition: left 0.6s ease;
}

.gallery-item__inner:hover .gallery-item__shine {
    left: 150%;
}

.gallery-item__image {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.6s var(--transition-smooth);
}

.gallery-item__inner:hover .gallery-item__image {
    transform: scale(1.05);
}

.gallery-item__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.gallery-item__inner:hover .gallery-item__overlay {
    opacity: 1;
}

.gallery-item__icon {
    font-family: "Lexend", sans-serif;
    font-size: 48px;
    font-weight: 200;
    color: var(--accent);
    transform: scale(0.8);
    transition: transform 0.3s var(--transition-smooth);
}

.gallery-item__inner:hover .gallery-item__icon {
    transform: scale(1);
}

.gallery-item__caption {
    font-family: "Courier New", monospace;
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--accent-muted);
    margin-top: 12px;
}

/* ==========================================================================
   Navigation Section
   ========================================================================== */

.project-nav {
    padding: 100px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
}

/* All Projects Button */
.nav-all-projects {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 16px 28px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-all-projects:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
}

.nav-all-projects__icon {
    display: grid;
    grid-template-columns: repeat(2, 6px);
    gap: 3px;
}

.nav-all-projects__icon span {
    width: 6px;
    height: 6px;
    background: var(--accent-dim);
    border-radius: 1px;
    transition: background 0.3s ease;
}

.nav-all-projects:hover .nav-all-projects__icon span {
    background: var(--accent);
}

.nav-all-projects__text {
    font-family: "Lexend", sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
}

/* Adjacent Navigation */
.nav-adjacent {
    display: flex;
    justify-content: center;
    gap: 80px;
    width: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    padding: 16px 0;
}

.nav-link--disabled {
    opacity: 0.3;
    pointer-events: none;
}

.nav-link .nav-link__content {
    transition: transform 0.3s ease;
}

.nav-link .nav-link__title {
    transition: color 0.3s ease;
}

.nav-link:hover .nav-link__title {
    color: var(--accent-dim);
}

.nav-link--prev:hover .nav-link__content {
    transform: translateX(-4px);
}

.nav-link--next:hover .nav-link__content {
    transform: translateX(4px);
}

.nav-link--prev {
    flex-direction: row;
}

.nav-link--next {
    flex-direction: row;
    text-align: right;
}

.nav-link__arrow {
    display: flex;
    align-items: center;
    width: 30px;
    height: 12px;
}

.nav-link--prev .nav-link__arrow {
    flex-direction: row-reverse;
}


.nav-link__arrow-line {
    width: 20px;
    height: 1px;
    background: var(--accent-muted);
    transition: width 0.3s ease;
}

.nav-link:hover .nav-link__arrow-line {
    width: 30px;
}

.nav-link__arrow-head {
    width: 8px;
    height: 8px;
    border-top: 1px solid var(--accent-muted);
    border-right: 1px solid var(--accent-muted);
}

.nav-link--prev .nav-link__arrow-head {
    transform: rotate(-135deg);
    margin-right: -5px;
}

.nav-link--next .nav-link__arrow-head {
    transform: rotate(45deg);
    margin-left: -5px;
}

.nav-link__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link--next .nav-link__content {
    align-items: flex-end;
}

.nav-link__label {
    font-family: "Courier New", monospace;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-muted);
}

.nav-link__title {
    font-family: "Lexend", sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--accent);
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-link__type {
    font-family: "Courier New", monospace;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent-muted);
    margin-top: 4px;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.lightbox__close {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 2;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: var(--accent);
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox__close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.lightbox__image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    transform: scale(0.9);
    transition: transform 0.4s var(--transition-smooth);
}

.lightbox.is-active .lightbox__image {
    transform: scale(1);
}

/* ==========================================================================
   Reveal Animations
   ========================================================================== */

[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.8s var(--transition-smooth),
        transform 0.8s var(--transition-smooth);
}

[data-reveal].is-revealed {
    opacity: 1;
    transform: translateY(0);
}

[data-reveal][data-reveal-delay="50"] { transition-delay: 50ms; }
[data-reveal][data-reveal-delay="100"] { transition-delay: 100ms; }
[data-reveal][data-reveal-delay="150"] { transition-delay: 150ms; }
[data-reveal][data-reveal-delay="200"] { transition-delay: 200ms; }
[data-reveal][data-reveal-delay="250"] { transition-delay: 250ms; }
[data-reveal][data-reveal-delay="300"] { transition-delay: 300ms; }

/* ==========================================================================
   Responsive - 1200px
   ========================================================================== */

@media (max-width: 1200px) {
    .project-details__grid {
        gap: 60px;
    }

    .project-gallery__grid {
        gap: 20px;
    }
}

/* ==========================================================================
   Responsive - 900px
   ========================================================================== */

@media (max-width: 900px) {
    .project-hero__content {
        padding-top: 140px;
        padding-bottom: 100px;
    }

    .project-media {
        margin-top: -40px;
    }

    .project-details__grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .project-details__sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 24px 40px;
        padding-top: 32px;
        border-top: 1px solid var(--border-subtle);
    }

    .project-capabilities {
        width: 100%;
    }

    .project-meta-item {
        min-width: 140px;
    }

    .project-cta {
        margin-top: 8px;
    }
}

/* ==========================================================================
   Responsive - 768px
   ========================================================================== */

@media (max-width: 768px) {
    .project-hero__content {
        padding-top: 120px;
        padding-bottom: 80px;
    }

    .project-title {
        font-size: clamp(36px, 10vw, 72px);
    }

    .project-client {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .project-video__wrapper,
    .project-featured {
        border-radius: 12px;
    }

    .project-details {
        padding: 60px 0;
    }

    .project-brief__text {
        font-size: 16px;
    }

    .project-gallery {
        padding: 60px 0;
    }

    .project-gallery__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .project-nav {
        padding: 80px 0;
        gap: 32px;
    }

    .nav-adjacent {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .nav-link--next .nav-link__content {
        align-items: flex-start;
    }

    .nav-link__title {
        font-size: 16px;
        max-width: none;
    }
}

/* ==========================================================================
   Responsive - 480px
   ========================================================================== */

@media (max-width: 480px) {
    .project-hero__content {
        padding-top: 100px;
        padding-bottom: 60px;
    }

    .project-type-tag {
        margin-bottom: 16px;
    }

    .project-type-tag__text {
        font-size: 11px;
        letter-spacing: 2px;
    }

    .project-title {
        font-size: clamp(32px, 12vw, 56px);
        margin-bottom: 24px;
    }

    .project-client__name {
        font-size: 16px;
    }

    .project-media {
        margin-top: -20px;
        padding-bottom: 48px;
    }

    .project-video__wrapper,
    .project-featured {
        border-radius: 8px;
    }

    .project-details {
        padding: 48px 0;
    }

    .project-details__sidebar {
        gap: 20px 32px;
    }

    .capability-pill {
        padding: 6px 12px;
        font-size: 12px;
    }

    .project-gallery {
        padding: 48px 0;
    }

    .project-gallery__header {
        margin-bottom: 32px;
    }

    .gallery-item__inner {
        border-radius: 8px;
    }

    .project-nav {
        padding: 60px 0;
        gap: 32px;
    }

    .nav-all-projects {
        padding: 14px 24px;
    }

    .nav-link__title {
        font-size: 16px;
    }

    .lightbox__close {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .project-title__word {
        opacity: 1;
        transform: none;
        animation: none;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .capability-pill {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .project-video__glow {
        animation: none;
        opacity: 0.5;
    }

    .gallery-item__shine {
        display: none;
    }

    .gallery-item__image {
        transition: none;
    }

    .lightbox__image {
        transform: scale(1);
        transition: none;
    }
}
