/* FONTS */
@font-face {
    font-family: 'Geogrotesque';
    src: url('./style-guide/geo-bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

:root {
    /* COLORS */
    --rogue-red: #cc0000;
    --rogue-red-light: #ff3030;
    --rogue-red-accent: #ff1a1a;
    --rogue-black: #050505;
    --rogue-dark-1: #070707;
    --rogue-dark-2: #0a0303;
    --rogue-dark-3: #0c0505;
}

body {
    background-color: var(--rogue-black);
    color: #ffffff;
    font-family: 'IBM Plex Mono', monospace;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* CRT EFFECTS */
@keyframes crt-scanlines {
    from { background-position: 0 0; }
    to { background-position: 0 8px; }
}

@keyframes crt-flicker {
    0% { opacity: 0.98; }
    5% { opacity: 0.85; }
    10% { opacity: 0.95; }
    15% { opacity: 1; }
    50% { opacity: 0.99; }
    55% { opacity: 0.88; }
    60% { opacity: 1; }
    100% { opacity: 1; }
}

@keyframes scan-bar {
    0% { transform: translateY(-100vh); }
    100% { transform: translateY(100vh); }
}

@keyframes crt-noise {
    0% { transform: translate(0,0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(-15%, 5%); }
    30% { transform: translate(7%, -25%); }
    40% { transform: translate(20%, 25%); }
    50% { transform: translate(-25%, 10%); }
    60% { transform: translate(15%, 5%); }
    70% { transform: translate(0%, 15%); }
    80% { transform: translate(25%, 35%); }
    90% { transform: translate(-10%, 10%); }
    100% { transform: translate(0,0); }
}

.crt-container {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 9000;
}

.crt-scanlines {
    position: absolute; inset: 0;
    background: linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,0.35) 50%);
    background-size: 100% 4px;
    animation: crt-scanlines 0.2s linear infinite;
}

.crt-rgb-mask {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(255,0,0,0.035) 33.3%, rgba(0,255,0,0.015) 33.3%, rgba(0,255,0,0.015) 66.6%, rgba(0,0,255,0.035) 66.6%);
    background-size: 3px 100%;
    mix-blend-mode: overlay;
}

.crt-scan-bar {
    position: absolute; top: 0; left: 0; width: 100%; height: 15vh;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.04) 50%, rgba(255,255,255,0) 100%);
    animation: scan-bar 4s linear infinite;
}

.crt-noise {
    position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    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)' opacity='1'/%3E%3C/svg%3E");
    background-size: 150px 150px;
    opacity: 0.08;
    animation: crt-noise 0.5s steps(2) infinite;
    mix-blend-mode: color-dodge;
}

.crt-flicker-wrapper {
    animation: crt-flicker 4s infinite;
    filter: url(#crt-screen);
    min-height: 100vh;
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes modal-bloom {
    0% { filter: drop-shadow(0 0 8px var(--rogue-red-accent)); }
    100% { filter: drop-shadow(0 0 20px var(--rogue-red-accent)) drop-shadow(0 0 40px var(--rogue-red)); }
}

/* TYPOGRAPHY */
h1, h2, h3 {
    font-family: 'Geogrotesque', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0;
}

.font-geo {
    font-family: 'Geogrotesque', sans-serif;
    font-weight: bold;
}

.font-serif {
    font-family: 'Playfair Display', serif;
}

.font-mono {
    font-family: 'IBM Plex Mono', monospace;
}

.glow-text {
    text-shadow: 0 0 2px rgba(255,255,255,0.8), 0 0 10px rgba(255,255,255,0.6), 0 0 20px rgba(100,100,255,0.4);
}

.glow-highlight {
    color: var(--rogue-red);
    text-shadow: 0 0 2px rgba(204,0,0,0.8), 0 0 10px rgba(204,0,0,0.6), 0 0 20px rgba(204,0,0,0.4);
}

/* SECTION BASE */
.section {
    background: var(--rogue-dark-1);
    border: 1px solid rgba(204,0,0,0.2);
    padding: 30px;
    margin-bottom: 40px;
    position: relative;
}

.section::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px; right: -1px; bottom: -1px;
    background: linear-gradient(45deg, var(--rogue-red) 0%, transparent 40%, transparent 60%, var(--rogue-red) 100%);
    z-index: -1;
    opacity: 0.3;
}

/* HERO SECTION */
.hero {
    text-align: right;
    max-width: 800px;
    margin-bottom: 60px;
    align-self: flex-end;
    padding-right: 20px;
}

.logo-fixed {
    position: fixed;
    top: 40px;
    left: 40px;
    max-width: 250px;
    z-index: 9500; /* above wrappers but below CRT overlays */
    filter: drop-shadow(0 0 20px rgba(204,0,0,0.6));
    transition: transform 0.1s ease-out; /* Smooth transition for 3D effect */
    transform-style: preserve-3d;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.8);
    margin-top: 20px;
}

/* PORTFOLIO GRID */
.portfolio-container {
    width: 100%;
    max-width: 100%;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

.portfolio-card {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid rgba(204,0,0,0.2);
    background: var(--rogue-dark-2);
    aspect-ratio: 16/9;
}

.portfolio-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.5s ease;
    filter: grayscale(80%) contrast(120%);
}

.portfolio-card:hover img {
    transform: scale(1.05);
    filter: grayscale(0%) contrast(100%);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(to top, rgba(5,5,5,0.9) 0%, rgba(5,5,5,0) 100%);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    box-sizing: border-box;
    pointer-events: none;
}

.portfolio-card:hover .card-overlay {
    transform: translateY(0);
    opacity: 1;
}

.card-overlay h2 {
    margin: 0;
    font-size: 2.8rem;
    color: #fff;
    text-shadow: 0 4px 10px rgba(0,0,0,0.9), 0 0 20px rgba(0,0,0,0.5);
    letter-spacing: 1px;
}

.card-overlay .subtitle {
    margin: 8px 0 0 0;
    font-size: 1.2rem;
    color: var(--rogue-red-light);
    font-style: normal;
    font-weight: 500;
    letter-spacing: 1px;
}

/* MODAL */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.modal-glow-wrapper {
    width: 95%;
    max-width: 95%;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    justify-content: center;
}

.modal-backdrop.active .modal-glow-wrapper {
    transform: translateY(0);
}

.modal-border-container {
    width: 100%;
    clip-path: polygon(
        30px 0, 
        calc(100% - 30px) 0, 
        100% 30px, 
        100% calc(100% - 30px), 
        calc(100% - 30px) 100%, 
        30px 100%, 
        0 calc(100% - 30px), 
        0 30px
    );
}

.modal-content {
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: #000000;
    position: relative;
    padding: 30px;
    clip-path: polygon(
        29px 0, 
        calc(100% - 29px) 0, 
        100% 29px, 
        100% calc(100% - 29px), 
        calc(100% - 29px) 100%, 
        29px 100%, 
        0 calc(100% - 29px), 
        0 29px
    );
}

.modal-backdrop.active .modal-content {
    /* Kept for backward compatibility but transition handled by wrapper now */
}

.modal-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 30px;
}

.modal-header #modal-category {
    justify-self: start;
    margin: 0;
    color: var(--rogue-red-light);
}

.modal-header #modal-title {
    justify-self: center;
    margin: 0;
    color: #ffffff;
}

.close-btn {
    position: absolute;
    top: 40px;
    right: 5%;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    transition: color 0.2s, filter 0.2s;
    padding: 10px; /* larger hit area */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.close-btn:hover {
    color: var(--rogue-red-light);
    filter: drop-shadow(0 0 10px var(--rogue-red));
}

.modal-body {
    margin-top: 20px;
}

.modal-body > img {
    width: 100%;
    height: auto;
    border: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.modal-body p {
    line-height: 1.8;
    color: rgba(255,255,255,0.9);
}

.editorial-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

@media (max-width: 768px) {
    .editorial-gallery {
        grid-template-columns: 1fr;
    }
}

.editorial-gallery img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
    display: block;
}

.gallery-full {
    grid-column: 1 / -1;
}
