@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Inter:wght@200;300;400;600&display=swap');

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

:root {
    --bg: #000;
    --text: #ccc;
    --accent: #ff2020;
    --dim: #444;
    --surface: #0a0a0a;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.75;
    overflow-x: hidden;
}

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

a { color: var(--accent); text-decoration: none; transition: opacity 0.3s; }
a:hover { opacity: 0.7; }

/* TOPBAR */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.92);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.topbar .back {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #999;
    padding: 8px 0;
    min-height: 44px;
    display: flex;
    align-items: center;
}
.topbar .back:hover { color: var(--accent); opacity: 1; }
.topbar .page-title {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #888;
}

/* PROJECT CONTAINER */
.project {
    max-width: 860px;
    margin: 0 auto;
    padding: 72px 24px 60px;
}

/* GALLERY */
.gallery {
    margin-bottom: 40px;
}

.gallery-main {
    width: 100%;
    overflow: hidden;
    background: var(--surface);
    border-radius: 2px;
    margin-bottom: 8px;
}

.gallery-main img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.4s;
}

.gallery-thumbs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.gallery-thumbs img {
    height: 64px;
    width: auto;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.3s;
    border-radius: 1px;
    flex-shrink: 0;
}
.gallery-thumbs img:hover,
.gallery-thumbs img.active {
    opacity: 1;
}

/* PROJECT INFO */
.project-info {
    margin-bottom: 40px;
}

.project-info h1 {
    font-family: 'Space Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
    text-transform: lowercase;
}

.materials {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #999;
    letter-spacing: 0.05em;
    line-height: 1.6;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.description {
    font-size: 14px;
    font-weight: 300;
    line-height: 1.85;
    color: var(--text);
}

.description a { color: var(--accent); }
.description a:hover { opacity: 0.7; }

.description i, .description em {
    font-style: italic;
}
.description b, .description strong {
    font-weight: 400;
    color: #ddd;
}

/* VIDEO EMBED */
.video-section {
    margin: 40px 0;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: var(--surface);
    border-radius: 2px;
    margin-bottom: 16px;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* YOUTUBE CLICK-TO-PLAY */
.yt-player {
    cursor: pointer;
}
.yt-player .yt-thumb {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    filter: brightness(0.8);
    transition: filter 0.3s;
}
.yt-player:hover .yt-thumb {
    filter: brightness(1);
}
.yt-player .play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: rgba(255,255,255,0.8);
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    transition: color 0.3s, transform 0.3s;
    pointer-events: none;
    z-index: 1;
}
.yt-player:hover .play-btn {
    color: #fff;
    transform: translate(-50%, -50%) scale(1.1);
}
.yt-player .yt-label {
    position: absolute;
    bottom: 12px;
    left: 12px;
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.6);
    pointer-events: none;
    z-index: 1;
}

.video-caption {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    color: var(--dim);
    letter-spacing: 0.05em;
    margin-top: 6px;
}
.video-caption a { color: var(--dim); }
.video-caption a:hover { color: var(--accent); opacity: 1; }

/* IMAGES INLINE */
.inline-images {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 20px 0;
}
.inline-images img {
    max-width: 240px;
    height: auto;
    border-radius: 2px;
    filter: brightness(0.85);
    transition: filter 0.3s;
}
.inline-images img:hover {
    filter: brightness(1);
}

/* AUDIO */
.audio-item {
    margin: 16px 0;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: 2px;
    border-left: 2px solid rgba(255,255,255,0.06);
}
.audio-item:hover {
    border-left-color: var(--accent);
}
.audio-item audio {
    width: 100%;
    height: 32px;
    margin-bottom: 6px;
    filter: invert(1) hue-rotate(180deg);
}
.audio-label {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--dim);
    letter-spacing: 0.05em;
}

/* EXTRA IMAGES (for engine errors, etc.) */
.extra-images {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 20px 0;
}
.extra-images img {
    max-width: 220px;
    height: auto;
    border-radius: 2px;
}

/* IMAGE GRID (for EQ page tables, etc.) */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin: 20px 0;
}
.image-grid img {
    width: 100%;
    height: auto;
    border-radius: 2px;
    filter: brightness(0.85);
    transition: filter 0.3s;
}
.image-grid img:hover { filter: brightness(1); }
.image-grid .caption {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    color: var(--dim);
    margin-top: 4px;
}

/* LINKS SECTION */
.project-links {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.project-links a {
    display: inline-block;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dim);
    margin-right: 16px;
    margin-bottom: 8px;
    transition: color 0.3s;
}
.project-links a:hover { color: var(--accent); opacity: 1; }

/* FOOTER */
.project-footer {
    text-align: center;
    padding: 40px 24px;
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .project { padding: 60px 16px 40px; }
    .project-info h1 { font-size: 20px; }
    .gallery-thumbs img { height: 48px; }
    .inline-images img { max-width: 160px; }
    .description { font-size: 13px; line-height: 1.75; }
    .audio-item { padding: 14px 16px; }
    .audio-item audio { height: 36px; }
}

@media (max-width: 480px) {
    .topbar { padding: 10px 16px; }
    .topbar .back { font-size: 11px; letter-spacing: 0.1em; }
    .topbar .page-title { font-size: 9px; max-width: 50%; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .project { padding: 56px 14px 32px; }
    .project-info h1 { font-size: 18px; }
    .materials { font-size: 10px; }
    .description { font-size: 13px; }
    .video-section { margin: 24px 0; }
    .video-wrapper { padding-bottom: 56.25%; border-radius: 0; }
    .gallery { margin-bottom: 24px; }
    .gallery-main { border-radius: 0; }
    .gallery-thumbs { gap: 3px; padding-bottom: 4px; }
    .gallery-thumbs img { height: 44px; }
    .image-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .extra-images img { max-width: 100%; }
    .inline-images img { max-width: 100%; }
    .project-footer { padding: 24px 14px; }
}
