/* ==========================================================================
   Design tokens
   Gate: an editing-suite "private screening room" terminal — amber CRT
   phosphor on near-black, monospace only, nothing else on screen.
   Portfolio: quiet editorial catalog — warm paper tone, serif display,
   restrained sans body, same amber accent carried through as the thread
   that ties the gate to the work behind it.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=IBM+Plex+Mono:wght@400;500&family=Inter:wght@400;500;600&display=swap');

:root {
    --ink-black: #07070a;
    --ink-black-2: #101014;
    --paper: #f3efe6;
    --paper-dim: #e6e0d2;
    --amber: #ffb000;
    --amber-dim: #7a5200;
    --text-dark: #1c1a16;
    --text-muted: #6b6558;

    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
    --font-serif: 'Fraunces', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
}

/* ---------------------------------------------------------------------
   Gate page
   --------------------------------------------------------------------- */

.gate-body {
    background: var(--ink-black);
    color: var(--amber);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
}

.gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    width: 100%;
    max-width: 480px;
    padding: 1.5rem;
}

.gate__eye {
    margin: 0;
    color: var(--amber);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    line-height: 1.15;
    text-shadow: 0 0 6px rgba(255, 176, 0, 0.55), 0 0 18px rgba(255, 176, 0, 0.18);
    white-space: pre;
    user-select: none;
}

@media (min-width: 520px) {
    .gate__eye {
        font-size: 0.78rem;
    }
}

.gate__form {
    width: 100%;
    display: flex;
    justify-content: center;
}

.gate__input {
    width: 100%;
    max-width: 280px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--amber-dim);
    color: var(--amber);
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.3em;
    text-align: center;
    padding: 0.6rem 0.2rem;
    outline: none;
    caret-color: var(--amber);
    transition: border-color 0.2s ease;
}

.gate__input:focus {
    border-bottom-color: var(--amber);
}

.gate__hint {
    color: var(--amber-dim);
    font-size: 0.9rem;
    height: 1rem;
    margin: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gate__hint--visible {
    opacity: 1;
    color: var(--amber);
}

.gate-body--shake .gate__input {
    animation: gate-shake 0.4s ease;
}

@keyframes gate-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ---------------------------------------------------------------------
   Portfolio page
   --------------------------------------------------------------------- */

.portfolio-body {
    background: var(--paper);
    color: var(--text-dark);
    font-family: var(--font-sans);
    min-height: 100vh;
    margin: 0;
}

.portfolio-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 2.5rem clamp(1.25rem, 5vw, 4rem) 1.5rem;
    border-bottom: 1px solid rgba(28, 26, 22, 0.12);
}

.portfolio-title {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin: 0;
    letter-spacing: -0.01em;
}

.portfolio-title a {
    color: inherit;
    text-decoration: none;
}

.portfolio-sort {
    display: flex;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.portfolio-sort a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.3rem 0.7rem;
    border: 1px solid rgba(28, 26, 22, 0.18);
    border-radius: 999px;
    transition: all 0.15s ease;
}

.portfolio-sort a.is-active,
.portfolio-sort a:hover {
    color: var(--text-dark);
    border-color: var(--amber);
    background: rgba(255, 176, 0, 0.14);
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1.25rem clamp(1.25rem, 5vw, 4rem);
}

.portfolio-tags a {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.3rem 0.65rem;
    border: 1px solid rgba(28, 26, 22, 0.15);
    border-radius: 4px;
    transition: all 0.15s ease;
}

.portfolio-tags a.is-active,
.portfolio-tags a:hover {
    color: var(--ink-black);
    border-color: var(--amber);
    background: var(--amber);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.75rem;
    padding: 1rem clamp(1.25rem, 5vw, 4rem) 4rem;
}

.video-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.video-card__thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--paper-dim);
    overflow: hidden;
    border-radius: 3px;
    display: block;
}

.video-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.video-card__thumb:hover img {
    transform: scale(1.04);
}

.video-card__thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    display: flex;
    background: rgba(7, 7, 10, 0.0);
    transition: background 0.2s ease;
}

.video-card__year {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    background: rgba(7, 7, 10, 0.72);
    color: var(--amber);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    z-index: 1;
}

.video-card__title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 500;
    margin: 0;
}

.video-card__desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.video-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.15rem;
}

.video-card__tags span {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    border: 1px solid rgba(28, 26, 22, 0.15);
    border-radius: 3px;
    padding: 0.1rem 0.4rem;
}

.portfolio-empty {
    padding: 4rem clamp(1.25rem, 5vw, 4rem);
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ---------------------------------------------------------------------
   Lightbox (video modal)
   --------------------------------------------------------------------- */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(7, 7, 10, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1.5rem;
}

.lightbox.is-open {
    display: flex;
}

.lightbox__inner {
    width: 100%;
    max-width: 960px;
}

.lightbox__frame-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.lightbox__frame-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.lightbox__meta {
    color: var(--paper);
    padding-top: 1rem;
    font-family: var(--font-sans);
}

.lightbox__meta h2 {
    font-family: var(--font-serif);
    font-weight: 500;
    margin: 0 0 0.4rem;
}

.lightbox__close {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}
