@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=IBM+Plex+Mono:wght@400;600&display=swap');

:root {
    --bg:       #0a0a0a;
    --surface:  #111;
    --accent:   #ff3e3e;
    --sprocket: #1c1c1c;
    --text:     #e8e8e8;
    --muted:    #666;

    /* Film-strip sprocket height — keep in sync between card and strip */
    --sprocket-h: 18px;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Mono', monospace;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ── HEADER ────────────────────────────────────────────────────────────────── */
header {
    text-align: center;
    padding: 2.5rem 1rem 2rem;
    border-bottom: 1px solid #1e1e1e;
    position: relative;
}

h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    letter-spacing: 0.15em;
    line-height: 1;
    margin-bottom: 1.5rem;
}

h1 span { color: var(--accent); }

.search-box {
    display: inline-flex;
    gap: 0;
    border: 1px solid #333;
    overflow: hidden;
}

input {
    background: #161616;
    border: none;
    padding: 0.7rem 1rem;
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    width: clamp(180px, 30vw, 320px);
    outline: none;
    letter-spacing: 0.05em;
}

input::placeholder { color: var(--muted); }

input:focus { background: #1a1a1a; }

button {
    background: var(--accent);
    border: none;
    padding: 0.7rem 1.4rem;
    cursor: pointer;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: #fff;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

button:hover  { background: #e03030; }
button:active { transform: scale(0.96); }

/* ── FILM STRIP ─────────────────────────────────────────────────────────────── */
.film-strip {
    display: flex;
    overflow-x: auto;
    overflow-y: visible;
    padding: 28px 32px;
    gap: 4px;           /* tight gap — cards butt up like real film */
    scroll-snap-type: x mandatory;
    scroll-padding: 32px;
    align-items: center;
    min-height: 58vh;

    /* Horizontal scrollbar styled to match */
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.film-strip::-webkit-scrollbar       { height: 4px; }
.film-strip::-webkit-scrollbar-track { background: transparent; }
.film-strip::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

/* ── VIDEO CARD ─────────────────────────────────────────────────────────────── */
.video-card {
    flex: 0 0 auto;
    width: clamp(260px, 28vw, 420px);
    scroll-snap-align: center;
    background: var(--sprocket);
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;

    /* Sprocket strips — use padding so the video frame sits inside them */
    padding-top: var(--sprocket-h);
    padding-bottom: var(--sprocket-h);
}

/* Sprocket holes rendered as repeating radial gradient on pseudo-elements */
.video-card::before,
.video-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: var(--sprocket-h);
    background-image: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 6px,
        var(--bg) 6px,
        var(--bg) 18px
    );
    background-size: 24px var(--sprocket-h);
    background-repeat: repeat-x;
    background-position: center;
}

.video-card::before { top: 0; }
.video-card::after  { bottom: 0; }

.video-card:hover {
    transform: scale(1.04) translateY(-4px);
    z-index: 10;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,62,62,0.2);
}

video {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #000;
}

/* ── META OVERLAY ───────────────────────────────────────────────────────────── */
/* Sits inside the video frame, above the bottom sprocket strip */
.meta {
    position: absolute;
    /* bottom of video frame = bottom padding (sprocket height) */
    bottom: var(--sprocket-h);
    left: 0;
    right: 0;
    padding: 8px 10px;
    font-size: 0.72rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.85) 40%);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;

    /* Hidden until hover */
    opacity: 0;
    transition: opacity 0.2s;
}

.video-card:hover .meta {
    opacity: 1;
    pointer-events: all; /* re-enable so links inside are clickable */
}

.meta strong {
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta span {
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── TYPE SWITCH ────────────────────────────────────────────────────────────── */
.type-switch {
    display: inline-flex;
    margin-top: 0.75rem;
    border: 1px solid #2a2a2a;
    overflow: hidden;
}

.type-btn {
    background: transparent;
    border: none;
    border-right: 1px solid #2a2a2a;
    padding: 0.4rem 1.1rem;
    color: var(--muted);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    transform: none;   /* override global button hover transform */
}

.type-btn:last-child { border-right: none; }

.type-btn:hover { color: #ccc; background: transparent; }

.type-btn.active {
    background: #1e1e1e;
    color: #fff;
}

/* ── IMAGE CARDS ────────────────────────────────────────────────────────────── */
.image-card img {
    width: 100%;
    display: block;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    background: #000;
}

/* Images don't play — dim slightly on hover instead */
.image-card:hover img { filter: brightness(0.85); transition: filter 0.2s; }

/* ── MORE BUTTON ────────────────────────────────────────────────────────────── */
.more-btn {
    flex: 0 0 auto;
    align-self: center;
    margin: 0 16px;
    padding: 0.6rem 1.4rem;
    background: transparent;
    border: 1px solid #333;
    color: var(--muted);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s, color 0.2s;
    transform: none;
}

.more-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
}

/* ── DOWNLOAD BUTTON ────────────────────────────────────────────────────────── */
.download-btn {
    position: absolute;
    top: calc(var(--sprocket-h) + 8px);
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #444;
    color: #ccc;
    font-size: 0.95rem;
    line-height: 28px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.15s, color 0.15s, border-color 0.15s;
    z-index: 5;
}

.video-card:hover .download-btn { opacity: 1; }

.download-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ── ATTRIBUTION LINKS ──────────────────────────────────────────────────────── */
.meta a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.15s;
}

.meta a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.creator-link {
    display: block;
    font-weight: 600;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.specs {
    color: var(--muted);
    font-size: 0.68rem;
}

.pexels-link {
    font-style: italic;
    margin-left: 4px;
}

/* ── ABOUT TRIGGER ──────────────────────────────────────────────────────────── */
.about-trigger {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid #444;
    color: var(--muted);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: border-color 0.2s, color 0.2s;
}

.about-trigger:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
    transform: none;
}

/* ── MODAL BACKDROP ─────────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;

    /* Hidden state */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-backdrop.is-open {
    opacity: 1;
    pointer-events: all;
}

/* ── MODAL BOX ──────────────────────────────────────────────────────────────── */
.modal {
    background: #111;
    border: 1px solid #2a2a2a;
    max-width: 500px;
    width: 100%;
    padding: 2rem;
    position: relative;

    /* Sprocket strip on top edge to stay on-theme */
    border-top: var(--sprocket-h) solid var(--sprocket);
    background-image: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 6px,
        var(--bg) 6px,
        var(--bg) 18px
    );
    background-size: 24px var(--sprocket-h);
    background-repeat: repeat-x;
    background-position: top left;

    /* Slide up on open */
    transform: translateY(12px);
    transition: transform 0.25s ease;
}

.modal-backdrop.is-open .modal {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: calc(var(--sprocket-h) + 0.75rem);
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    transition: color 0.15s;
    font-weight: 300;
}

.modal-close:hover {
    color: var(--accent);
    background: transparent;
    transform: none;
}

/* ── ABOUT SECTION (inside modal) ───────────────────────────────────────────── */
.about-section {
    color: #ddd;
    line-height: 1.7;
    padding-top: calc(var(--sprocket-h) * 0.25); /* nudge below sprocket */
}

.about-section h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6rem;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin: 0 0 0.75rem;
}

.about-section a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}

.about-section a:hover { color: var(--accent); }


    font-size: 0.85rem;
    color: #ccc;
    margin: 0;
}

kbd {
    display: inline-block;
    padding: 0.1em 0.45em;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8em;
    color: #ccc;
    background: #1e1e1e;
    border: 1px solid #3a3a3a;
    border-bottom-width: 2px;
    border-radius: 3px;
    line-height: 1.4;
}

.about-section hr {
    border: none;
    border-top: 1px solid #2a2a2a;
    margin: 1.25rem 0;
}

.disclaimer {
    font-size: 0.8rem;
    color: #888;
}

.disclaimer h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    color: #aaa;
    margin: 0 0 0.5rem;
}

.disclaimer p {
    margin: 0 0 0.75rem;
}

.disclaimer p:last-child { margin-bottom: 0; }

.disclaimer strong { color: #bbb; }

/* ── FOOTER ─────────────────────────────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 1.2rem;
    border-top: 1px solid #1e1e1e;
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.05em;
}

footer a {
    color: #888;
    text-decoration: none;
    transition: color 0.15s;
}

footer a:hover { color: var(--accent); }
.placeholder-text {
    color: var(--muted);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    margin: auto;
    text-align: center;
}

.placeholder-text.loading::after {
    content: '';
    display: inline-block;
    width: 0.6em;
    animation: blink 0.8s step-start infinite;
}

@keyframes blink {
    0%, 100% { content: ''; }
    33%       { content: '.'; }
    66%       { content: '..'; }
}
