/* ===== PROJECT PAGE ===== */

/* ── Lightbox ─────────────────────────────────── */
#lightbox {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 8, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
}

#lightbox.is-open {
    opacity: 1;
    pointer-events: all;
}

#lightbox-img {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    display: block;
    transform: scale(0.96);
    transition: transform 0.3s ease;
    cursor: default !important;
}

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

#lightbox-close {
    position: fixed;
    top: 32px;
    right: 40px;
    font-size: 20px;
    color: var(--muted);
    cursor: pointer !important;
    transition: color 0.2s ease;
    line-height: 1;
}

#lightbox-close:hover {
    color: var(--text);
}

/* ── Hero ─────────────────────────────────────── */
.project-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 140px 60px 100px;
    border-bottom: 1px solid var(--muted);
    position: relative;
    overflow: hidden;
    text-align: center;
    gap: 32px;
}

.project-hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-label {
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--accent);
    text-transform: uppercase;
}

.project-label-cat {
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--muted);
    text-transform: uppercase;
}

.project-hero-dot {
    color: var(--muted);
    font-size: 12px;
}

.project-hero-row {
    view-transition-name: project-title;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-title-part {
    font-family: var(--font-display);
    font-size: clamp(56px, 9vw, 150px);
    font-weight: 400;
    line-height: 1;
    color: var(--text);
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.project-sphere {
    width: 380px;
    height: 380px;
    flex-shrink: 0;
    pointer-events: none;
}

.project-sphere canvas {
    width: 100% !important;
    height: 100% !important;
}

.project-tagline {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--muted);
    font-style: italic;
    line-height: 1.45;
    max-width: 560px;
}

/* ── Body ─────────────────────────────────────── */
.project-body {
    padding: 0 60px 100px;
    display: flex;
    flex-direction: column;
}

/* ── Two-column Problem / Solution ────────────── */
.project-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--muted);
}

.project-col {
    padding: 80px 60px;
    position: relative;
}

.project-col:first-child {
    border-right: 1px solid var(--muted);
}

.project-col-num {
    display: block;
    font-family: var(--font-display);
    font-size: 72px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.04);
    line-height: 1;
    margin-bottom: -16px;
    letter-spacing: -0.04em;
}

.project-block-title {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

.project-block-text {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 300;
    line-height: 1.95;
    color: var(--muted);
}

/* ── Visuals ──────────────────────────────────── */
.project-visuals {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--muted);
}

.project-visual-main {
    margin: 0;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--muted);
}

.project-visual-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    filter: brightness(0.85);
    transition: filter 0.5s ease, transform 0.6s ease;
}

.project-visual-main .project-visual-img {
    aspect-ratio: 16 / 7;
}

.project-visual-main:hover .project-visual-img {
    filter: brightness(1);
    transform: scale(1.01);
}

.project-visual-caption {
    position: absolute;
    bottom: 24px;
    left: 32px;
    font-size: 12px;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

.project-visuals-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.project-visual-placeholder {
    margin: 0;
    position: relative;
    overflow: hidden;
    border-top: 1px solid var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 560px;
}

.project-visual-placeholder:first-child {
    border-right: 1px solid var(--muted);
}

.project-visual-placeholder .project-visual-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: unset;
    filter: brightness(0.85);
    transition: filter 0.5s ease, transform 0.6s ease;
}

.project-visual-placeholder:hover .project-visual-img {
    filter: brightness(1);
    transform: scale(1.02);
}

.project-visual-placeholder .project-visual-img--contain {
    object-fit: contain;
    background: #0d0d0d;
}

.project-visual-placeholder .project-visual-img--dezoom {
    transform: scale(0.82);
    transition: filter 0.5s ease, transform 0.5s ease;
}

.project-visual-placeholder:hover .project-visual-img--dezoom {
    transform: scale(0.86);
}

.project-visual-placeholder--bg-match {
    background: #080d1a;
}

.project-visual-main .project-visual-img--ecoia {
    object-fit: contain;
    background: #080d1f;
}

.project-visual-main .project-visual-img--coachflow {
    object-fit: contain;
    background: #0d0d0d;
}

.placeholder-label {
    position: relative;
    z-index: 1;
    font-size: 13px;
    letter-spacing: 0.15em;
    color: var(--muted);
    text-transform: uppercase;
}

.placeholder-sub {
    position: relative;
    z-index: 1;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: rgba(68, 68, 68, 0.5);
    font-style: italic;
}

/* ── Flow (pipeline with a travelling pulse) ──── */
.project-flow-section {
    padding: 80px 60px;
    border-bottom: 1px solid var(--muted);
}

.project-flow {
    display: grid;
    grid-template-columns: repeat(var(--steps, 5), 1fr);
    position: relative;
    border-top: 1px solid var(--muted);
}

.project-flow::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 90px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent));
    box-shadow: 0 0 14px var(--accent);
    animation: flowPulse 4.5s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes flowPulse {
    0%   { left: 0;                 opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { left: calc(100% - 90px); opacity: 0; }
}

.flow-step {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 36px 28px 0 0;
}

.flow-step::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--accent);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
    transition: background 0.3s ease, transform 0.3s ease;
}

.flow-step:hover::before {
    background: var(--accent);
    transform: scale(1.4);
}

.flow-num {
    font-size: 12px;
    font-style: italic;
    color: var(--muted);
}

.flow-name {
    font-family: var(--font-display);
    font-size: 27px;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text);
    transition: color 0.3s ease;
}

.flow-step:hover .flow-name { color: var(--accent); }

.flow-desc {
    font-size: 14px;
    font-weight: 300;
    line-height: 1.7;
    color: var(--muted);
}

/* ── Stats ────────────────────────────────────── */
.project-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--muted);
}

.project-stat {
    padding: 70px 60px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-right: 1px solid var(--muted);
}

.project-stat:last-child {
    border-right: none;
}

.project-stat .stat-number {
    font-size: 88px;
    font-weight: 400;
    color: var(--accent);
    line-height: 1;
}

.project-stat .stat-label {
    font-size: 13px;
    letter-spacing: 0.2em;
    color: var(--text);
    text-transform: uppercase;
}

.project-stat .stat-sub {
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-style: italic;
    text-transform: uppercase;
}

/* ── Stack ────────────────────────────────────── */
.project-stack-section {
    padding: 80px 60px 0;
    border-bottom: 1px solid var(--muted);
    padding-bottom: 80px;
}

.project-stack-label {
    display: block;
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 40px;
}

.project-stack {
    display: flex;
    flex-direction: column;
}

.stack-item {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    align-items: center;
    gap: 40px;
    padding: 28px 0;
    border-bottom: 1px solid var(--muted);
    cursor: default;
    transition: color 0.3s ease;
}

.stack-item:first-child {
    border-top: 1px solid var(--muted);
}

.stack-num {
    font-size: 13px;
    color: var(--muted);
    font-style: italic;
}

.stack-name {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 400;
    color: var(--text);
    transition: color 0.3s ease;
    letter-spacing: -0.01em;
}

.stack-role {
    font-size: 14px;
    color: var(--muted);
    font-style: italic;
    transition: color 0.3s ease;
}

.stack-item:hover .stack-name {
    color: var(--accent);
}

.stack-item:hover .stack-role {
    color: var(--accent);
}

/* ── Bottom nav ───────────────────────────────── */
.project-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 60px;
    border-top: 1px solid var(--muted);
}

.project-nav-back {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.project-nav-back:hover {
    color: var(--text);
}

.project-nav-view {
    padding: 14px 36px;
    border: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: background 0.3s ease, color 0.3s ease;
}

.project-nav-view:hover {
    background: var(--accent);
    color: var(--bg);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    /* Restore cursor on touch */
    *, *::before, *::after { cursor: auto !important; }
    .cursor-dot { display: none; }

    /* Hero */
    .project-hero { padding: 100px 24px 60px; gap: 20px; }
    .project-hero-meta { flex-wrap: wrap; justify-content: center; gap: 8px; }
    .project-sphere { width: 200px; height: 200px; }
    .project-tagline { font-size: 15px; }

    /* Body */
    .project-body { padding: 0 0 60px; }

    /* Columns */
    .project-columns { grid-template-columns: 1fr; }
    .project-col { padding: 48px 24px; }
    .project-col:first-child { border-right: none; border-bottom: 1px solid var(--muted); }

    /* Visuals */
    .project-visuals-grid { grid-template-columns: 1fr; }
    .project-visual-placeholder { min-height: 340px; }
    .project-visual-placeholder:first-child { border-right: none; }

    /* Stats */
    .project-stats { grid-template-columns: 1fr; border-bottom: none; }
    .project-stat { padding: 40px 24px; border-right: none; border-bottom: 1px solid var(--muted); }
    .project-stat:last-child { border-bottom: 1px solid var(--muted); }

    /* Flow */
    .project-flow-section { padding: 48px 24px; }
    .project-flow { grid-template-columns: 1fr; border-top: none; border-left: 1px solid var(--muted); }
    .project-flow::after { display: none; }
    .flow-step { padding: 0 0 32px 24px; }
    .flow-step::before { top: 6px; left: -5px; }

    /* Stack */
    .project-stack-section { padding: 48px 24px; }
    .stack-item { grid-template-columns: 40px 1fr; gap: 16px; padding: 20px 0; }
    .stack-role { grid-column: 2; font-size: 12px; }
    .stack-name { font-size: 22px; }

    /* Nav */
    .project-nav { padding: 24px; }

    /* Relics — cachées sur mobile */
    .relic { display: none; }
}

@media (max-width: 480px) {
    /* Hero title row — vertical stack */
    .project-hero-row { flex-direction: column; gap: 8px; }
    .project-title-part { font-size: clamp(52px, 14vw, 72px); line-height: 0.9; }
    .project-sphere { width: 100px; height: 100px; }

    /* Stats */
    .project-stat .stat-number { font-size: 60px; }

    /* Stack */
    .stack-item { grid-template-columns: 1fr; gap: 6px; }
    .stack-num { display: none; }
    .stack-name { font-size: 20px; }

    /* Nav */
    .project-nav { flex-direction: column; gap: 16px; align-items: flex-start; }
}
