/*
 * PENGE. Signal CSS
 *
 * This stylesheet organizes the core visual language and layout
 * for the Studiopenge.com website, following minimalist, editorial,
 * high-contrast principles.
 *
 * Table of Contents:
 * 1.  CSS Variables (Design Tokens)
 * 2.  Base & Reset Styles
 * 3.  Typography
 * 4.  Main Navigation
 * 5.  Hero Section
 * 6.  Manifesto Section
 * 7.  Archive Section (Editorial Grid)
 * 8.  Gravity Bridge (Footer)
 * 9.  Utility & Animation (Reveal Up)
 * 10. Responsive Overrides
 */

/* =========================================================================
 * 1. CSS Variables (Design Tokens)
 * ========================================================================= */
:root {
    --forge-black: #0D0D0D;
    --forge-black-rgb: 13, 13, 13;
    --sailcloth-white: #F5F2E8;
    --sage-green: #8A9F8D;
    --text-color-dark: #1a1a1a;
    --text-color-light: #fff;
    --font-sans: 'Montserrat', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --gap-default: 20px;
    --max-content-width: 1200px;
}

/* =========================================================================
 * 2. Base & Reset Styles
 * ========================================================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--forge-black);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--sailcloth-white);
    color: var(--text-color-dark);
    font-family: var(--font-serif);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

/* =========================================================================
 * 3. Typography
 * ========================================================================= */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0;
    line-height: 1.2;
    color: var(--text-color-dark);
}

p {
    margin-top: 0;
    margin-bottom: 1em;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--sage-green);
}

/* =========================================================================
 * 4. Main Navigation
 * ========================================================================= */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-sizing: border-box;
    background-color: transparent;
    transition: transform 0.3s ease-in-out, background-color 0.3s ease, box-shadow 0.3s ease;
}

.main-nav.hidden {
    transform: translateY(-100%);
}

.main-nav.scrolled {
    background-color: rgba(var(--forge-black-rgb), 0.95);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.nav-logo {
    display: block;
    max-width: 120px;
    z-index: 101;
}

.nav-logo img {
    width: 100%;
    height: auto;
    filter: invert(100%);
}

.hamburger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 101;
    position: relative;
}

.hamburger-menu .line {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-color-light);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    color: var(--text-color-light);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    padding-bottom: 5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    background-color: var(--text-color-light);
    bottom: 0;
    left: 0;
    transition: width 0.3s ease-in-out;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Mobile Navigation Overrides */
@media (max-width: 767px) {
    .main-nav {
        padding: 15px 20px;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(var(--forge-black-rgb), 0.95);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
        z-index: 99;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links li {
        margin: 20px 0;
    }

    .nav-links a {
        font-size: 1.8em;
        font-weight: 700;
    }

    .hamburger-menu {
        display: block;
    }

    .hamburger-menu.active .line:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    
    .hamburger-menu.active .line:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger-menu.active .line:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}

@media (min-width: 1024px) {
    .main-nav {
        padding: 30px 60px;
    }
}

/* =========================================================================
 * 5. Hero Section
 * ========================================================================= */
.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) brightness(0.5);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(var(--forge-black-rgb), 0.5);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: 0 40px;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin-top: 5vh;
    text-align: center;
}

.hero-content h1 {
    font-family: 'Avenir', 'Manrope', sans-serif;
    font-weight: 600;
    font-size: clamp(2.5rem, 7vw, 5rem);
    letter-spacing: -0.02em;
    line-height: 0.95;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
    color: var(--text-color-light);
}
.hero-content h2 {
    font-family: 'Avenir', 'Manrope', sans-serif;
    font-weight: 300;
    font-size: clamp(2.5rem, 7vw, 5rem);
    letter-spacing: -0.02em;
    line-height: 0.95;
    text-transform: inherit;
    margin-bottom: 0.8rem;
    color: var(--text-color-light);
}
h6.hero-thesis {
    font-family: 'Avenir', 'Manrope', sans-serif;
    font-weight: 300 !important; /* Forces the browser to ignore default bold */
    font-size: clamp(0.9rem, 2.5vw, 1.1rem); /* Slight adjustment for h6 sizing */
    text-transform: uppercase;
    letter-spacing: 0.15em; /* Increased spacing helps readability on thin fonts */
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 3.5rem;
    opacity: 0.9;
    color: var(--text-color-light);
}

.ghost-link {
    font-family: var(--font-sans);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 15px 40px;
    color: var(--text-color-light);
    border: 1px solid var(--text-color-light);
    padding: 15px 35px;
    border-radius: 2px;
    font-size: 0.9em;
    letter-spacing: 1.5px;
    transition: all 0.4s ease;
    display: inline-block;
}

.ghost-link:hover {
    background-color: var(--text-color-light);
    color: var(--forge-black);
    border-color: var(--text-color-light);
}

/* Responsive adjustments for hero section */
@media (max-width: 767px) {
    .hero-content {
        padding: 0 20px;
        margin-top: 10vh;
    }
    
    .hero-content h1 {
        font-size: clamp(2rem, 9vw, 3rem);
    }
    
    .hero-thesis {
        font-size: 0.9em;
        margin-bottom: 2.5rem;
    }
    
    .ghost-link {
        padding: 12px 30px;
        font-size: 0.8em;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hero-content {
        max-width: 700px;
        margin-top: 8vh;
    }
    
    .hero-content h1 {
        font-size: clamp(3rem, 7vw, 4rem);
    }
}

/* =========================================================================
 * 6. Manifesto Section
 * ========================================================================= */
/* Section Container */
/* --- LAYOUT CONTAINER --- */
.manifesto-split-section {
    display: flex;
    flex-direction: row;
    height: 90vh; /* Adjust height as needed */
    width: 100%;
    background-color: #F5F5F0;
    overflow: hidden;
}

/* --- LEFT SIDE --- */
.manifesto-text-side {
    width: 50%;
    padding: 5rem 6rem; /* Generous padding */
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}

/* Quote Styling */
.manifesto-header blockquote {
    font-family: 'Avenir', serif;
    font-size: clamp(1.5rem, 2vw, 2rem);
    font-weight: 400;
    font-style: italic;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 2rem;
    max-width: 600px;
}
.sage-highlight { color: #556B2F; font-style: normal; }

/* Signal Line Styling */
.manifesto-signal-line {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #1a1a1a;
    border-left: 3px solid #1a1a1a;
    padding-left: 1.5rem;
    margin-bottom: 4rem;
}

/* --- SLIDER AREA --- */
.text-slider-wrapper {
    position: relative;
    height: 200px; /* Fixed height to prevent jumping */
    max-width: 500px;
}

.text-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.8s ease-out;
    pointer-events: none; /* Allows click-through */
}

.text-slide.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Slide Typography */
.p-number {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 2.5rem;
    color: #e0e0e0; /* Subtle grey number */
    margin-bottom: 0.5rem;
    line-height: 1;
}

.text-slide h3 {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.text-slide p {
    font-family: 'Manrope', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
}

/* Progress Bar */
.progress-track {
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 100%;
    height: 1px;
    background: #e0e0e0;
}
.progress-fill {
    height: 3px;
    background: #1a1a1a;
    width: 0%;
    /* Transition set via JS */
}

/* --- RIGHT SIDE (IMAGES) --- */
.manifesto-image-side {
    width: 50%;
    position: relative;
    background-color: #ddd; /* Placeholder color if image fails */
}

.img-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    filter: grayscale(20%); /* Adds to the PENGE mood */
}

.img-slide.active {
    opacity: 1;
}

/* Mobile Fix */
@media (max-width: 900px) {
    .manifesto-split-section { flex-direction: column; height: auto; }
    .manifesto-text-side { width: 100%; padding: 4rem 2rem; }
    .manifesto-image-side { width: 100%; height: 500px; }
}
/* --- MARQUEE SECTION CONTAINER --- */
.design-marquee-section {
    background-color: #F5F5F0; /* Matches Manifesto Cream */
    padding-top: 4rem;
    padding-bottom: 8rem;
    overflow: hidden; /* Hides scrollbars */
}

/* --- THE SCROLLING TRACK --- */
.marquee-wrapper {
    width: 100%;
    overflow: hidden;
    white-space: nowrap; /* Forces images into a horizontal line */
    position: relative;
    padding-bottom: 4rem; /* Space between images and CTA */
}

.marquee-track {
    display: flex;
    gap: 2rem; /* Space between images */
    width: max-content; /* Allows track to be wider than screen */
    /* The Animation Engine */
    animation: scroll-left 25s linear infinite;
}

/* Pause animation when user hovers over the strip */
.marquee-wrapper:hover .marquee-track {
    animation-play-state: paused;
}

.marquee-item {
    flex: 0 0 auto; /* Prevents squishing */
    width: 350px;   /* Fixed width for uniformity */
    height: 450px;  /* Portrait ratio */
    overflow: hidden;
    position: relative;
    background-color: #e0e0e0;
}

.marquee-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: grayscale(100%); /* Optional: Starts B&W */
}

/* On hover, bring color back and zoom slightly */
.marquee-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* --- THE ANIMATION KEYFRAMES --- */
@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        /* Move exactly 50% left because we duplicated the items */
        transform: translateX(-50%);
    }
}

/* --- THE CTA SECTION --- */
.marquee-cta-container {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 2rem;
}

.cta-heading {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    color: #1a1a1a;
}

.cta-sub {
    font-family: 'Avenir', serif;
    font-style: italic;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2.5rem;
}

/* SOLID BLACK BUTTON */
.btn-solid-black {
    display: inline-block;
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 1rem 2.5rem;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #1a1a1a;
}

.btn-solid-black:hover {
    background-color: transparent;
    color: #1a1a1a;
    transform: translateY(-2px);
}

/* --- MOBILE ADJUSTMENTS --- */
@media (max-width: 768px) {
    .marquee-item {
        width: 250px; /* Smaller images on mobile */
        height: 320px;
    }
    
    .marquee-track {
        gap: 1rem;
        animation-duration: 15s; /* Faster scroll on mobile */
    }
}
/* =========================================================================
 * 7. Archive Section (Editorial Grid)
 * ========================================================================= */
.archive-content-wrapper {
    display: grid;
    padding: 0 var(--gap-default);
}

.editorial-grid {
    display: grid;
    gap: var(--gap-default);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    padding: 0;
}

.grid-item {
    height: 350px;
}

.large-portrait {
    height: 600px;
}

.square {
    height: 350px;
}

.small-landscape {
    height: 350px;
}

/* =========================================================================
 * 8. Gravity Bridge (Footer)
 * ========================================================================= */
.gravity-bridge {
    background: var(--forge-black);
    color: var(--sailcloth-white);
    padding: 100px var(--gap-default);
}

.bridge-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    max-width: var(--max-content-width);
    margin: 0 auto;
}

.bridge-statement {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-style: italic;
    margin-bottom: 20px;
}

.bridge-cta {
    color: var(--sailcloth-white);
    text-decoration: none;
    border-bottom: 1px solid var(--sage-green);
    padding-bottom: 5px;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.bridge-cta:hover {
    color: var(--sage-green);
}

.bridge-signature {
    text-align: right;
}

.maker-mark {
    width: 100px;
    margin-bottom: 40px;
    filter: none;
}

.copyright {
    font-family: var(--font-sans);
    font-size: 0.6rem;
    opacity: 0.4;
    letter-spacing: 0.1em;
    margin: 0;
}

/* =========================================================================
 * 9. Utility & Animation (Reveal Up & Bottom Home Button)
 * ========================================================================= */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.reveal-up.active {
    opacity: 1;
    transform: translateY(0);
}

.bottom-home-button {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    z-index: 90;
    max-width: 80px;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
    display: block;
	filter: invert (100%);
}

.bottom-home-button.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.bottom-home-button img {
    width: 100%;
    height: auto;
    filter: invert(100%);
}

@media (max-width: 767px) {
    .bottom-home-button {
        bottom: 15px;
        max-width: 60px;
    }
}

/* =========================================================================
 * 10. Responsive Overrides
 * ========================================================================= */

/* --- Mobile / Tablet (up to 767px) --- */
@media (max-width: 767px) {
    .hero-content {
        padding-top: 15vh;
    }
    
    .archive-content-wrapper {
        padding: 40px var(--gap-default);
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "volume"
            "grid";
        gap: 30px;
    }

    .editorial-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .large-portrait,
    .square,
    .small-landscape {
        grid-column: auto;
        grid-row: auto;
        min-height: auto;
        height: 350px;
    }

    .bridge-container {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .bridge-statement {
        font-size: 1.4rem;
        margin-bottom: 30px;
    }
    
    .bridge-signature {
        margin-top: 40px;
        text-align: center;
    }
    
    .maker-mark {
        margin-bottom: 10px;
    }
}

/* --- Tablet (768px and up) --- */
@media (min-width: 768px) {
    .archive-content-wrapper {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "header header"
            "grid grid"
            "volume volume";
        gap: 30px;
        padding: 60px var(--gap-default);
    }

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

    .large-portrait {
        grid-column: span 2;
        grid-row: span 2;
        height: 600px;
    }
    
    .square,
    .small-landscape {
        grid-column: span 1;
        grid-row: span 1;
        height: 350px;
    }
}

/* --- Desktop (1024px and up) --- */
@media (min-width: 1024px) {
    .main-nav {
        padding: 30px 50px;
    }
    
    .nav-logo {
        max-width: 150px;
    }
    
    .hero-content {
        padding-top: 0;
    }

    .archive-content-wrapper {
        grid-template-columns: 1.5fr 1fr 1fr;
        grid-template-areas:
            "header header header"
            "large-item item2 item3"
            "volume   item4 item5";
        gap: 30px;
        padding: 80px var(--gap-default);
    }
    
    .editorial-grid {
        display: contents;
    }

    .grid-item:nth-child(1) {
        grid-area: large-item;
    }
    
    .grid-item:nth-child(2) {
        grid-area: item2;
    }
    
    .grid-item:nth-child(3) {
        grid-area: item3;
    }
    
    .grid-item:nth-child(4) {
        grid-area: item4;
    }
    
    .grid-item:nth-child(5) {
        grid-area: item5;
    }

    .large-portrait {
        height: 700px;
    }
    
    .square {
        height: 400px;
    }
    
    .small-landscape {
        height: 400px;
    }
}

/* --- Larger Desktop (1440px and up) --- */
@media (min-width: 1440px) {
    .archive-content-wrapper {
        gap: 40px;
        padding: 100px var(--gap-default);
    }
    
    .large-portrait {
        height: 800px;
    }
    
    .square,
    .small-landscape {
        height: 450px;
    }
}
/* =========================================
   MOBILE RESCUE PATCH (Paste at bottom of CSS)
   ========================================= */

/* 1. HERO FIXES */
/* Force the button to be Solid White */
.hero-content a, button {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: none !important;
    font-weight: 700 !important;
}

/* Force the Sub-text to be Sans-Serif and Thin */
h6.hero-thesis {
    font-family: 'Manrope', Helvetica, sans-serif !important;
    font-style: normal !important;
    font-weight: 300 !important;
    letter-spacing: 0.15em !important;
}

/* 2. MANIFESTO LAYOUT FIXES (Mobile Only) */
@media (max-width: 900px) {
    
    /* Force the Split Section to Stack */
    .manifesto-split-section {
        flex-direction: column !important;
        height: auto !important;
        display: flex !important;
    }

    /* Fix the Text Area */
    .manifesto-text-side {
        width: 100% !important;
        padding: 3rem 1.5rem !important;
        height: auto !important;
        min-height: 400px; /* Give room for text slider */
    }

    /* FIX TYPOGRAPHY: The Signal Line */
    .manifesto-signal-line {
        font-family: 'Manrope', Helvetica, sans-serif !important;
        font-style: normal !important; /* Removes Italics */
        font-weight: 700 !important;
        font-size: 0.7rem !important;
        border-left: 2px solid #000 !important;
        margin-top: 1rem !important;
    }

    /* 3. CRITICAL IMAGE FIX: Stop the Stacking! */
    .manifesto-image-side {
        width: 100% !important;
        height: 50vh !important; /* Fixed height is mandatory */
        position: relative !important; /* Anchors the absolute images */
        display: block !important;
        overflow: hidden !important; /* Hides images waiting off-stage */
    }

    /* Force Images to overlap */
    .img-slide {
        position: absolute !important;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
}