/* --- RESET & VARIABLES --- */
:root {
    --bg-color: #050505;
    --text-main: #e0e0e0;
    --text-dim: #666;
    --accent: #ff0000; /* The "Red" in RedHoodedGuy */
    --accent-dim: #5c0000;
    --font-head: 'Oswald', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-mono);
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- FX --- */
.noise {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 999;
    opacity: 0.03;
    background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAAGFBMVEUAAAA5OTkAAABMTExERERmZmYzMzPMzMxmo8wsAAAACHRSTlMAM8zMzMzMzMxpc4UAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAA6SURBVDjLY2AYBaNgWIQjDCkM2gwMDEwM2gwMDEwM2gwMDEwM2gwMDEwM2gwMDEwM2gwMAwCtHgvjG+w8EwAAAABJRU5ErkJggg==');
}

.scanline {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 5px;
    background: rgba(255, 255, 255, 0.05);
    opacity: 0.4;
    animation: scan 6s linear infinite;
    pointer-events: none;
    z-index: 998;
}

@keyframes scan {
    0% { top: -10%; }
    100% { top: 110%; }
}

/* --- LAYOUT --- */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* --- NAV --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    font-family: var(--font-head);
    font-size: 1.5rem;
    letter-spacing: 2px;
    font-weight: 700;
}

.dot { color: var(--accent); }

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    margin-left: 2rem;
    font-size: 0.8rem;
    transition: color 0.3s;
}

.nav-links a:hover { color: white; }

.contact-btn {
    border: 1px solid var(--text-dim);
    padding: 0.5rem 1rem;
}

.contact-btn:hover {
    border-color: var(--accent);
    color: var(--accent) !important;
}

/* --- HERO --- */
#hero {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 1rem; /* Ensure padding on small screens */
}

.overline {
    color: var(--accent);
    /* Fluid scale: Starts at 0.7rem on mobile, grows to 0.9rem on desktop */
    font-size: clamp(0.7rem, 2vw, 0.9rem); 
    /* Tighter letter spacing on mobile to fit, wider on desktop */
    letter-spacing: clamp(2px, 1vw, 4px); 
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 {
    font-family: var(--font-head);
    /* CRITICAL FIX: 
       2rem = Minimum size (very small phones)
       13vw = 13% of screen width (scales dynamically)
       8rem = Maximum size (desktop)
    */
    font-size: clamp(2rem, 13vw, 8rem);
    line-height: 1.1;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    position: relative;
    
    /* Safety: If screen is tiny, break the word to prevent scrollbar */
    word-wrap: break-word; 
    hyphens: auto;
}

.subtitle {
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto;
    /* Scales between 0.8rem and 1.1rem */
    font-size: clamp(0.8rem, 3vw, 1.1rem);
    line-height: 1.5;
    padding: 0 10px; /* Prevent text touching edges on mobile */
}

/* --- MOBILE SPECIFIC OVERRIDES --- */
@media (max-width: 480px) {
    #hero {
        height: 70vh; /* Shorter hero on mobile */
    }
    
    h1 {
        /* Force title to take up exactly 12% of viewport width per char approx */
        font-size: 11vw; 
        margin-bottom: 1rem;
    }

    .overline {
        margin-bottom: 0.5rem;
    }
}

/* --- SECTIONS --- */
section {
    padding: 6rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.section-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
    letter-spacing: 1px;
}

/* --- VENTURES (MYSTHOOD) --- */
.project-card {
    position: relative;
    padding: 1px; /* For border gradient */
    background: linear-gradient(45deg, #333, #000);
}

.card-content {
    background: #0a0a0a;
    padding: 3rem;
    border: 1px solid #222;
    transition: border-color 0.3s;
}

.card-content:hover {
    border-color: var(--accent-dim);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.project-card h2 {
    font-family: var(--font-head);
    font-size: 3rem;
    line-height: 1;
}

.status-badge {
    background: rgba(0, 255, 0, 0.1);
    color: #00ff00;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid #00ff00;
}

.project-card p {
    max-width: 600px;
    color: var(--text-dim);
    margin-bottom: 2rem;
}

.project-link {
    display: inline-block;
    color: white;
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 5px;
    transition: all 0.3s;
}

.project-link:hover {
    padding-right: 10px;
    color: var(--accent);
}

/* --- FOUNDER --- */
.founder-block {
    border-left: 2px solid var(--accent);
    padding-left: 2rem;
    display: flex;
    align-items: center; /* Aligns image and text vertically */
    gap: 2rem;
}

.founder-img {
    width: 150px;
    height: 150px;
    flex-shrink: 0; /* Prevents squishing */
    border: 1px solid #333;
    overflow: hidden;
    position: relative;
}

.founder-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.2); /* Black & White look */
    transition: filter 0.3s ease;
}

/* Hover Effect: Reveals color */
.founder-block:hover .founder-img img {
    filter: grayscale(0%) contrast(1);
}

.founder-block h3 {
    font-family: var(--font-head);
    font-size: 2rem;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 0.5rem;
}

/* RESPONSIVE UPDATE */
@media (max-width: 600px) {
    .founder-block {
        flex-direction: column; /* Stack on mobile */
        align-items: flex-start;
    }
    
    .founder-img {
        width: 100px;
        height: 100px;
    }
}

/* --- FOOTER --- */
footer {
    display: flex;
    justify-content: space-between;
    padding: 4rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.7rem;
    color: #444;
}

/* --- GLITCH ANIMATION --- */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch::before {
    color: #0ff;
    z-index: -1;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch::after {
    color: #f0f;
    z-index: -2;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(20% 0 80% 0); transform: translate(-2px, 1px); }
    20% { clip-path: inset(60% 0 10% 0); transform: translate(2px, -1px); }
    40% { clip-path: inset(40% 0 50% 0); transform: translate(-2px, 2px); }
    60% { clip-path: inset(80% 0 5% 0); transform: translate(2px, -2px); }
    80% { clip-path: inset(10% 0 60% 0); transform: translate(-1px, 1px); }
    100% { clip-path: inset(30% 0 30% 0); transform: translate(1px, -1px); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(10% 0 60% 0); transform: translate(2px, -1px); }
    20% { clip-path: inset(80% 0 5% 0); transform: translate(-2px, 2px); }
    40% { clip-path: inset(30% 0 20% 0); transform: translate(1px, -2px); }
    60% { clip-path: inset(15% 0 80% 0); transform: translate(-1px, 1px); }
    80% { clip-path: inset(55% 0 10% 0); transform: translate(2px, 2px); }
    100% { clip-path: inset(40% 0 30% 0); transform: translate(-2px, -1px); }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    nav { flex-direction: column; gap: 1rem; }
    .nav-links a { margin: 0 1rem; }
    .project-card h2 { font-size: 2rem; }
    #hero { height: 60vh; }
}

/* --- PROJECT CARD BANNER --- */
.card-banner {
    width: 100%;
    height: 250px; /* Adjust height as needed */
    margin-bottom: 2rem;
    overflow: hidden;
    position: relative;
    border: 1px solid #333;
}

.card-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.2) brightness(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover Effect: Reveals color and zooms slightly */
.project-card:hover .card-banner img {
    filter: grayscale(0%) contrast(1.1) brightness(1);
    transform: scale(1.05);
}

/* Optional: Scanline overlay on the image specifically */
.scan-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    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: 2;
    opacity: 0.6;
}

/* --- UNIFIED MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    /* 1. Layout & Padding */
    .content-wrapper {
        padding: 0 1.5rem;
    }
    
    section {
        padding: 4rem 0;
    }

    /* 2. VENTURES: Fix Card Sizing */
    .card-content {
        padding: 1.5rem;
    }

    .card-banner {
        height: 180px;
        margin-bottom: 1.5rem;
    }

    .project-card h2 {
        font-size: 2rem;
    }

    /* 3. FOUNDER: Fix Stacking */
    .founder-block {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        border-left: 0;
        border-top: 2px solid var(--accent);
        padding-left: 0;
        padding-top: 2rem;
    }

    .founder-img {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        max-height: 250px;
        border: 1px solid #333;
    }

    .founder-img img {
        object-position: center top; 
    }

    .founder-info h3 {
        font-size: 1.8rem;
    }

    /* 4. FOOTER: Fix Overlap & Line Break (NEW) */
    footer {
        flex-direction: column; /* Stack vertically */
        align-items: flex-start; /* Align to left */
        gap: 1.5rem; /* Space between copyright and location */
        padding-bottom: 3rem;
    }

    .rights-text {
        display: block; /* Forces "All rights reserved" to new line */
        margin-top: 0.25rem;
        color: #666; /* Optional: make it slightly dimmer */
    }
}

/* --- SECTION 39: THE MANIFESTO GRID --- */
.grid-39 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.node-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #222;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.node-card:hover {
    background: rgba(255, 0, 0, 0.05);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.node-num {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.node-card h4 {
    font-family: var(--font-head);
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.node-card p {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.4;
}

/* RESPONSIVE TWEAKS FOR GRID */
@media (max-width: 600px) {
    .grid-39 {
        grid-template-columns: 1fr; /* Single column on mobile */
    }
}