/* ========================================
   DARK THEME PROJECT CASE STUDY SYSTEM
   Case Study Pages - Quique, Project2, Project4
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

/* ========================================
   CSS VARIABLES - DARK THEME
   ======================================== */
:root {
    --color-bg: #0A0A0A;
    --color-surface: #111111;
    --color-border: #1E1E1E;
    --color-accent: #C8F135;
    --color-accent-dim: #A8CC1A;
    --color-text: #F0F0F0;
    --color-muted: #6B6B6B;

    --font-display: 'DM Serif Display', serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --ease-premium: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s var(--ease-smooth);
}

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   SCROLL PROGRESS BAR
   ======================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--color-accent);
    z-index: 9999;
    transition: width 0.1s linear;
}

/* ========================================
   BACK NAVIGATION
   ======================================== */
.cs-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    padding: 1.2rem 2rem;
    z-index: 990;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cs-nav__back {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cs-nav__back:hover {
    color: var(--color-accent);
    gap: 1.2rem;
}

.cs-nav__back-arrow {
    display: inline-block;
    font-size: 1.2rem;
}

.cs-nav__cta {
    padding: 0.625rem 1.5rem;
    background: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cs-nav__cta:hover {
    background: var(--color-accent);
    color: #000;
}

/* ========================================
   HERO SECTION
   ======================================== */
.cs-hero {
    min-height: 90vh;
    background: var(--color-bg);
    padding-top: 80px;
    padding-bottom: 4rem;
    padding-left: 2rem;
    padding-right: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cs-hero__label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
}

.cs-hero__title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6.5rem);
    font-weight: 400;
    line-height: 1.15;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    max-width: 900px;
}

.cs-hero__sub {
    font-size: 1.1rem;
    color: var(--color-muted);
    margin-bottom: 4rem;
    max-width: 700px;
    line-height: 1.8;
}

.cs-hero__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
    max-width: 800px;
}

.cs-hero__stat {
    border-top: 1px solid var(--color-accent);
    padding-top: 1.5rem;
}

.cs-hero__stat-num {
    font-family: var(--font-mono);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.cs-hero__stat-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-muted);
}

.cs-hero__visual {
    max-width: 900px;
    margin-top: 3rem;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    overflow: hidden;
    border-radius: 6px;
}

.cs-hero__visual img,
.cs-hero__visual video {
    width: 100%;
    height: auto;
    max-height: 540px;
    object-fit: contain;
    display: block;
    transition: transform 0.5s var(--ease-smooth);
}

.cs-hero__visual:hover img,
.cs-hero__visual:hover video {
    transform: scale(1.02);
}

/* ========================================
   SECTION BASE STYLES
   ======================================== */
.cs-section {
    padding: 5rem 2rem;
    max-width: 1280px;
    margin: 0 auto;
}

.cs-section__label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.cs-section__title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--color-text);
    margin-bottom: 2rem;
    max-width: 800px;
}

.cs-section-alt {
    background: var(--color-surface);
}

/* ========================================
   GRID & CARDS
   ======================================== */
.cs-grid {
    display: grid;
    gap: 1px;
    background: var(--color-border);
    padding: 1px;
}

.cs-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.cs-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.cs-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .cs-grid--2,
    .cs-grid--3,
    .cs-grid--4 {
        grid-template-columns: 1fr;
    }
}

.cs-card {
    background: var(--color-surface);
    padding: 2rem;
    transition: all 0.3s ease;
}

.cs-card:hover {
    background: #1a1a1a;
}

.cs-card__label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-muted);
    margin-bottom: 0.75rem;
}

.cs-card__value {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text);
    line-height: 1.6;
}

.cs-card--accent {
    border-left: 3px solid var(--color-accent);
}

/* ========================================
   TWO COLUMN SPLIT SECTION
   ======================================== */
.cs-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

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

/* ========================================
   CHALLENGE & SOLUTION BOXES
   ======================================== */
.cs-challenge,
.cs-solution {
    padding: 2.5rem;
    background: var(--color-surface);
    border-left: 3px solid;
}

.cs-challenge {
    border-left-color: #FF6B6B;
}

.cs-challenge h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: #FF6B6B;
    margin-bottom: 1.5rem;
}

.cs-challenge p {
    color: #9B9B9B;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.cs-solution {
    border-left-color: var(--color-accent);
}

.cs-solution h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
}

.cs-solution p {
    color: #9B9B9B;
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* ========================================
   GALLERY GRID
   ======================================== */
.cs-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1px;
    background: var(--color-border);
    padding: 1px;
}

.cs-gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: var(--color-surface);
    aspect-ratio: 4 / 3;
}

.cs-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 0.5rem;
    transition: transform 0.4s var(--ease-smooth);
}

.cs-gallery-item:hover img {
    transform: scale(1.04);
}

.cs-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-accent);
    color: #000;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cs-gallery-item:hover .cs-gallery-caption {
    transform: translateY(0);
}

/* ========================================
   TIMELINE
   ======================================== */
.cs-timeline {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.cs-timeline-item {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.cs-timeline-num {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
    flex-shrink: 0;
    width: 60px;
}

.cs-timeline-body h4 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.cs-timeline-body p {
    color: var(--color-muted);
    line-height: 1.8;
    margin-bottom: 0.75rem;
}

/* ========================================
   KEYWORDS / TAGS
   ======================================== */
.cs-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.cs-keyword {
    border: 1px solid var(--color-border);
    padding: 0.35rem 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-muted);
    transition: all 0.3s ease;
}

.cs-keyword:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ========================================
   ARQUETIPO BADGE
   ======================================== */
.cs-arquetipo {
    text-align: center;
    border: 1px solid var(--color-border);
    display: inline-block;
    padding: 3rem 4rem;
    position: relative;
    background: var(--color-surface);
    margin: 2rem auto;
}

.cs-arquetipo::before,
.cs-arquetipo::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--color-accent);
}

.cs-arquetipo::before {
    top: -6px;
    left: -6px;
}

.cs-arquetipo::after {
    bottom: -6px;
    right: -6px;
}

.cs-arquetipo__name {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 400;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.cs-arquetipo__sub {
    font-size: 0.95rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   IMPACT GRID
   ======================================== */
.cs-impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.cs-impact-item {
    border-left: 3px solid var(--color-accent);
    padding: 1.5rem;
    background: var(--color-surface);
}

.cs-impact-item p {
    color: var(--color-text);
    font-size: 1rem;
    line-height: 1.8;
}

/* ========================================
   CALL TO ACTION BLOCK
   ======================================== */
.cs-cta {
    background: var(--color-accent);
    color: #000;
    padding: 5rem 2rem;
    text-align: center;
}

.cs-cta__title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 400;
    color: #000;
    margin-bottom: 1rem;
}

.cs-cta__sub {
    font-size: 1.1rem;
    color: rgba(0, 0, 0, 0.7);
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cs-cta__btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cs-btn-dark {
    background: #000;
    color: var(--color-accent);
    padding: 0.875rem 2rem;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cs-btn-dark:hover {
    background: #111;
    outline: 1px solid #000;
}

.cs-btn-ghost {
    background: transparent;
    border: 1px solid #000;
    color: #000;
    padding: 0.875rem 2rem;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cs-btn-ghost:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* ========================================
   FOOTER
   ======================================== */
.cs-footer {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--color-muted);
    font-size: 0.9rem;
}

/* ========================================
   LIGHTBOX MODAL
   ======================================== */
.cs-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.cs-modal.active {
    display: flex;
}

.cs-modal__img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.cs-modal__close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: none;
    color: var(--color-accent);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cs-modal__close:hover {
    transform: rotate(90deg);
}

/* ========================================
   SCROLL REVEAL ANIMATION
   ======================================== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

/* ========================================
   GRAIN OVERLAY
   ======================================== */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    z-index: 1;
    background-image: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><filter id="grain"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" result="noise" seed="2"/><feColorMatrix in="noise" type="saturate" values="0"/></filter></defs><rect width="100" height="100" fill="rgba(255,255,255,1)" filter="url(%23grain)"/></svg>');
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    .cs-nav {
        padding: 1rem;
    }

    .cs-nav__cta {
        display: none;
    }

    .cs-hero {
        min-height: auto;
        padding-top: 100px;
        padding-bottom: 2rem;
    }

    .cs-hero__title {
        font-size: clamp(2rem, 6vw, 3.5rem);
    }

    .cs-hero__stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .cs-section {
        padding: 3rem 1.5rem;
    }

    .cs-section__title {
        font-size: 1.75rem;
    }

    .cs-challenge,
    .cs-solution {
        padding: 1.5rem;
    }

    .cs-cta {
        padding: 3rem 1.5rem;
    }

    .cs-cta__title {
        font-size: 2rem;
    }

    .cs-cta__btns {
        flex-direction: column;
    }

    .cs-btn-dark,
    .cs-btn-ghost {
        width: 100%;
    }

    .cs-arquetipo {
        padding: 2rem 1.5rem;
    }

    .cs-arquetipo__name {
        font-size: 2rem;
    }

    .cs-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .cs-hero__visual img,
    .cs-hero__visual video {
        max-height: 320px;
    }

    .cs-timeline-item {
        gap: 1rem;
    }
}

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

    .cs-gallery-item {
        aspect-ratio: 1;
    }
}
