:root {
    --bg: #030303;
    --card-bg: rgba(10, 10, 10, 0.4);
    --text: #e0e0e0;
    --accent: #ff003c;
    /* Cyber Red */
    --accent-2: #00f3ff;
    /* Cyber Cyan */
    --border: rgba(255, 255, 255, 0.1);
    --font-display: 'Syncopate', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-display);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    cursor: crosshair;
}

/* --- SEO HEADER (visually hidden, accessible to crawlers) --- */
.seo-header {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- POST PROCESSING & OVERLAYS --- */
.scanlines {
    position: fixed;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.2) 50%,
            rgba(0, 0, 0, 0.2));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
}

.vignette {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, transparent 40%, #000 120%);
    z-index: 11;
    pointer-events: none;
}

.noise {
    position: fixed;
    inset: 0;
    z-index: 12;
    opacity: 0.07;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- HUD --- */
.hud {
    position: fixed;
    inset: 2rem;
    z-index: 20;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: var(--font-code);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.hud-top,
.hud-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hud strong {
    color: var(--accent-2);
}

.hud-line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 1rem;
    position: relative;
}

.hud-line::after {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    width: 5px;
    height: 5px;
    background: var(--accent);
}

/* --- 3D SCENE --- */
.viewport {
    position: fixed;
    inset: 0;
    perspective: 1000px;
    overflow: hidden;
    z-index: 1;
}

.world {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    will-change: transform;
}

.item {
    position: absolute;
    left: 0;
    top: 0;
    backface-visibility: hidden;
    transform-origin: center center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================ */
/* IMAGE PLACEHOLDERS — replaces the original "cards"           */
/* Each .photo-frame holds a single <img>.                      */
/* When an env variable IMG_n is empty, a styled fallback shows.*/
/* ============================================================ */
/* Default frame: image dictates the size, frame just decorates it. */
.photo-frame {
    /* Width & height are auto so the frame hugs the image's natural ratio. */
    background: var(--card-bg);
    border: 1px solid var(--border);
    position: relative;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translate(-50%, -50%);
    overflow: hidden;
    display: inline-block;
    line-height: 0; /* kill inline-block whitespace */
}

/* Empty placeholder still needs an explicit size to be visible. */
.photo-frame.is-empty {
    width: 480px;
    height: 680px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
}

/* ----- MODE A: fixed HEIGHT, width adapts to ratio (no crop) ----- */
body.mode-height .photo-frame img {
    height: 600px;
    width: auto;
    max-width: none;
    min-height: 600px;
}

/* ----- MODE B: fixed WIDTH, height adapts to ratio (no crop) ----- */
body.mode-width .photo-frame img {
    width: 680px;
    height: auto;
    max-height: none;
    min-width: 680px;
}

@media (hover: hover) {
    .photo-frame:hover {
        border-color: var(--accent);
        box-shadow: 0 0 30px rgba(255, 0, 60, 0.2);
        z-index: 100;
    }
}

.photo-frame::before,
.photo-frame::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1px solid transparent;
    transition: 0.3s;
    z-index: 3;
    pointer-events: none;
}

.photo-frame::before {
    top: -1px;
    left: -1px;
    border-top-color: var(--text);
    border-left-color: var(--text);
}

.photo-frame::after {
    bottom: -1px;
    right: -1px;
    border-bottom-color: var(--text);
    border-right-color: var(--text);
}

.photo-frame:hover::before,
.photo-frame:hover::after {
    width: 100%;
    height: 100%;
    border-color: var(--accent);
}

.photo-frame img {
    /* No object-fit — the image is shown at its natural ratio.
       Width or height is locked by the body mode class above. */
    display: block;
    background: transparent;
}

/* ID badge on top of each frame */
.photo-frame .frame-id {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-family: var(--font-code);
    color: var(--accent);
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 6px;
    border: 1px solid var(--border);
    z-index: 2;
    letter-spacing: 0.1em;
}

/* Fallback when no image URL is provided */
.photo-frame.is-empty {
    background: repeating-linear-gradient(45deg,
            rgba(255, 255, 255, 0.02) 0 12px,
            rgba(255, 255, 255, 0.05) 12px 24px);
}

.photo-frame.is-empty .placeholder-label {
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.photo-frame.is-empty .placeholder-label small {
    display: block;
    margin-top: 0.5rem;
    color: var(--accent-2);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
}

/* --- BIG TEXT --- */
.big-text {
    font-size: 15vw;
    font-weight: 800;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.15);
    text-transform: uppercase;
    white-space: nowrap;
    transform: translate(-50%, -50%);
    pointer-events: none;
    letter-spacing: -0.5rem;
    mix-blend-mode: overlay;
}

/* --- PARTICLES --- */
.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    transform: translate(-50%, -50%);
}

/* --- SCROLL PROXY --- */
.scroll-proxy {
    height: 10000vh;
    position: absolute;
    width: 100%;
    z-index: -1;
}


/* ============================================================ */
/* MODE SWITCHER (top-right pill linking to the other layout)   */
/* ============================================================ */
.mode-switch {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    gap: 0;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: var(--font-code);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.mode-switch a {
    padding: 0.55rem 0.9rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.mode-switch a:hover { color: var(--accent); }
.mode-switch a.is-active {
    background: var(--accent);
    color: #000;
    font-weight: 700;
}
.mode-switch .label {
    padding: 0.55rem 0.9rem;
    color: var(--text-dim, #888);
    border-right: 1px solid var(--border);
}
