/* =====================================================
   SHARED STYLES FOR EVERY PROJECT PAGE
   Page-specific tweaks live in a small <style> block on each page.
   ===================================================== */

:root {
    --void-bg: #070E15;        /* Page background (matches the <html> tag, so no seam on overscroll) */
    --desk-grey: #68717A;      /* Flat grey of the desk */
    --sketch-teal: #00A3C4;    /* Teal accent */
    --neon-green: #CCFF00;     /* Neon accent */
    --pure-black: #000000;     /* Cel-shaded outlines */
    --pure-white: #FFFFFF;     /* Cards */
    --fade-ms: 400ms;          /* Keep in sync with FADE_MS in project.js */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: var(--void-bg);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--void-bg);
    color: var(--pure-black);
    min-height: 100vh;
    overflow-x: clip;   /* 'hidden' would break the sticky back button */
    display: flex;
    flex-direction: column;
    align-items: center;

    /* Page transition: fades in from the void */
    opacity: 0;
    transition: opacity var(--fade-ms) ease-in-out;
}

body.fade-in { opacity: 1; }
body.fade-out { opacity: 0; }

/* --- BACK BUTTON --- */
.pin-container {
    width: 90%;
    max-width: 1400px;
    display: flex;
    justify-content: flex-start;
    position: sticky;      /* the back button stays reachable while you scroll */
    top: 0;
    z-index: 50;
    padding: 1.5rem 0;
    margin-bottom: 0.5rem;
    pointer-events: none;  /* only the button itself is clickable */
}

.pin-container .floating-pin {
    pointer-events: auto;
}

.floating-pin {
    text-decoration: none;
    color: var(--pure-black);
    font-weight: 900;
    font-size: 0.75rem;
    background: var(--pure-white);
    padding: 10px 24px;
    border: 3px solid var(--pure-black);
    border-radius: 50px;
    box-shadow: 0px 6px 0px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.1s ease;
    position: relative;
}

.floating-pin:hover,
.floating-pin:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0px 8px 0px rgba(0,0,0,0.3);
    background: var(--neon-green);
}

.floating-pin:active {
    transform: translateY(4px);
    box-shadow: 0px 2px 0px rgba(0,0,0,0.4);
}

:focus-visible {
    outline: 3px solid var(--neon-green);
    outline-offset: 3px;
}

/* --- HERO SECTION --- */
.project-board {
    width: 90%;
    max-width: 1400px;
    display: grid;
    grid-template-columns: 1fr 1.6fr; /* pages can override */
    gap: 2rem;
    margin-bottom: 3rem;
}

/* --- INFO CARD --- */
.info-card {
    background: var(--pure-white);
    border: 4px solid var(--pure-black);
    box-shadow: 12px 12px 0px var(--neon-green);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    border-radius: 4px;
    justify-content: space-between;
}

.info-card h1 {
    font-size: 4rem;
    font-weight: 900;
    line-height: 0.9;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: auto;
}

.brief-section {
    background: var(--desk-grey);
    padding: 1.5rem;
    border: 3px solid var(--pure-black);
    color: var(--pure-white);
}

.brief-section h3 {
    font-size: 1.2rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    color: var(--neon-green);
    text-transform: uppercase;
}

.brief-section p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--pure-white);
    font-weight: 400;
}

.tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    background: var(--pure-white);
    border: 3px solid var(--pure-black);
    padding: 6px 14px;
    font-weight: 900;
    font-size: 0.75rem;
    text-transform: uppercase;
    border-radius: 30px;
}

.tag.highlight {
    background: var(--neon-green);
}

/* --- VIEWER PANEL (video or 3D model) --- */
.viewer-card {
    background: var(--desk-grey);
    border: 4px solid var(--pure-black);
    box-shadow: 12px 12px 0px var(--neon-green);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.viewer-header {
    background: var(--pure-white);
    border-bottom: 4px solid var(--pure-black);
    padding: 10px 20px;
    font-weight: 900;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
}

/* --- PROCESS SECTIONS --- */
.process-container {
    width: 90%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-bottom: 3rem;
}

.process-section {
    background: var(--desk-grey);
    border: 4px solid var(--pure-black);
    box-shadow: 12px 12px 0px var(--neon-green);
    padding: 3rem;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    color: var(--pure-white);
}

.process-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-bottom: 4px solid var(--pure-black);
    padding-bottom: 1.5rem;
}

.process-header h2 {
    font-size: 2.2rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--pure-white);
}

.phase-badge {
    background: var(--neon-green);
    color: var(--pure-black);
    border: 3px solid var(--pure-black);
    padding: 6px 14px;
    font-weight: 900;
    font-size: 0.75rem;
    text-transform: uppercase;
    box-shadow: 4px 4px 0px var(--neon-green);
    white-space: nowrap;
}

/* Intro paragraph under a process header (replaces the old inline styles) */
.section-intro {
    font-size: 1rem;
    font-weight: 500;
    color: #f0f0f0;
    line-height: 1.5;
    max-width: 75ch;
}

/* --- VIEWER HEADER BUTTONS (auto-rotate, reset, sound...) --- */
.viewer-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.viewer-btn {
    background: var(--pure-white);
    color: var(--pure-black);
    border: 2px solid var(--pure-black);
    padding: 4px 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: 0.7rem;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 2px 2px 0px var(--pure-black);
    transition: all 0.1s ease;
}

.viewer-btn:hover {
    background: var(--neon-green);
    transform: translateY(-1px);
    box-shadow: 3px 3px 0px var(--pure-black);
}

.viewer-btn:active {
    transform: translateY(1px);
    box-shadow: 1px 1px 0px var(--pure-black);
}

.viewer-btn-status {
    background: var(--neon-green);
    padding: 1px 5px;
    border: 1px solid var(--pure-black);
}

.viewer-btn[aria-pressed="false"] .viewer-btn-status {
    background: #ddd;
}

/* --- IMAGES --- */
img[hidden] {
    display: none !important;
}

.zoomable {
    cursor: zoom-in;
}

.zoomable:focus-visible {
    outline: 4px solid var(--neon-green);
    outline-offset: -8px;
}

/* A box whose image failed to load: hatched panel instead of a blank white hole */
.is-missing {
    display: grid !important;
    place-items: center;
    background: repeating-linear-gradient(45deg, #F2F2F2 0 12px, #E4E4E4 12px 24px) !important;
}

.is-missing::after {
    content: attr(data-missing);
    background: var(--pure-white);
    border: 2px solid var(--pure-black);
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #555;
}

/* --- LIGHTBOX --- */
.lightbox {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border: 0;
    padding: clamp(1rem, 4vw, 3rem);
    background: rgba(7, 14, 21, 0.95);
    color: var(--pure-white);
    font-family: 'Inter', sans-serif;
}

.lightbox[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 1rem;
}

.lightbox::backdrop {
    background: transparent;
}

body:has(.lightbox[open]) {
    overflow: hidden;
}

.lightbox-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 900;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.lightbox-figure {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    justify-items: center;
    align-items: center;
    gap: 1rem;
}

.lightbox-figure img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: var(--pure-white);
    border: 4px solid var(--pure-black);
    box-shadow: 10px 10px 0px var(--neon-green);
}

.lightbox-figure figcaption {
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    max-width: 70ch;
}

.lb-btn {
    background: var(--pure-white);
    color: var(--pure-black);
    border: 3px solid var(--pure-black);
    padding: 8px 16px;
    font-family: inherit;
    font-weight: 900;
    font-size: 0.8rem;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 4px 4px 0px var(--neon-green);
}

.lb-btn:hover {
    background: var(--neon-green);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    padding: 0;
    font-size: 1.4rem;
    border-radius: 50%;
}

.lightbox-prev { left: clamp(0.5rem, 2vw, 1.5rem); }
.lightbox-next { right: clamp(0.5rem, 2vw, 1.5rem); }

.lightbox-nav[hidden] {
    display: none;
}

/* --- SCROLL PROGRESS BAR --- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--neon-green);
    transform-origin: 0 50%;
    transform: scaleX(0);
    z-index: 100;
    pointer-events: none;
}

/* --- NEXT / PREVIOUS PROJECT --- */
.project-nav {
    width: 90%;
    max-width: 1400px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    margin-bottom: 5rem;
}

.project-nav:empty {
    display: none;
}

.project-nav-link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    background: var(--pure-white);
    color: var(--pure-black);
    text-decoration: none;
    border: 4px solid var(--pure-black);
    box-shadow: 8px 8px 0px var(--neon-green);
    padding: 1.25rem 1.5rem;
    border-radius: 4px;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.project-nav-link:hover,
.project-nav-link:focus-visible {
    transform: translate(-3px, -3px);
    box-shadow: 11px 11px 0px var(--neon-green);
}

.project-nav-link.is-next {
    text-align: right;
}

.project-nav-link.is-all {
    background: var(--neon-green);
    box-shadow: 8px 8px 0px var(--pure-black);
    text-align: center;
}

.project-nav-link.is-all:hover,
.project-nav-link.is-all:focus-visible {
    box-shadow: 11px 11px 0px var(--pure-black);
}

.project-nav-kicker {
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #555;
}

.project-nav-title {
    font-size: 1.4rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1;
}

/* --- PAGE WIPE (same striped transition as the desk) --- */
.wipe {
    position: fixed;
    inset: 0;
    z-index: 450;
    display: flex;
    overflow: hidden;
    pointer-events: none;
}

.wipe i {
    flex: 1;
    height: calc(100% + 18px);
    margin-right: -1px;
    background: linear-gradient(to bottom, var(--void-bg) calc(100% - 18px), var(--neon-green) calc(100% - 18px));
    transform: translateY(-101%);
    transition: transform 0.42s cubic-bezier(0.7, 0, 0.3, 1);
}

.wipe.is-covering i { transform: translateY(0); }
.wipe i:nth-child(2) { transition-delay: 0.045s; }
.wipe i:nth-child(3) { transition-delay: 0.09s; }
.wipe i:nth-child(4) { transition-delay: 0.135s; }
.wipe i:nth-child(5) { transition-delay: 0.18s; }
.wipe i:nth-child(6) { transition-delay: 0.225s; }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .project-board {
        grid-template-columns: 1fr;
    }
    .process-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .project-nav {
        grid-template-columns: 1fr;
    }
    .project-nav-link.is-next,
    .project-nav-link.is-all {
        text-align: left;
    }
}

@media (max-width: 600px) {
    .info-card,
    .process-section {
        padding: 1.5rem;
    }
    .info-card h1 {
        font-size: 2.6rem;
    }
    .process-header h2 {
        font-size: 1.6rem;
    }
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
    body {
        transition: none;
    }
    .floating-pin,
    .viewer-btn,
    .project-nav-link,
    .wipe i {
        transition: none;
    }
}