/*
Theme Name: Sergio
Theme URI: https://sergio.com
Author: Sergio Cuellar Biso
Author URI: https://www.instagram.com/hipsterifique/
Description: Portfolio theme for Sergio Cuellar Biso — bold, animated, and immersive.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sergio
Tags: portfolio, animation, creative, one-page, custom-cursor
*/

/* ============================================
   CSS VARIABLES & RESET
   ============================================ */
:root {
    --color-primary:   #2C2828;
    --color-secondary: #F3D9BD;
    --color-accent:    #F37139;
    --font-main: 'Montserrat', sans-serif;
    --cursor-size: 20px;
}

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

html {
    scroll-behavior: smooth;
    cursor: none;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-primary);
    color: var(--color-secondary);
    overflow-x: hidden;
    cursor: none;
}

a, button {
    cursor: none;
    text-decoration: none;
    color: inherit;
}

::selection {
    background: var(--color-accent);
    color: var(--color-primary);
}

/* ============================================
   CUSTOM CURSOR — Black Triangle
   ============================================ */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--cursor-size);
    height: var(--cursor-size);
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out, width 0.2s, height 0.2s;
}

.custom-cursor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 17.32px solid #B8B8B8;
    transform: translateX(-50%);
}

.custom-cursor.hover {
    transform: translate(-50%, -50%) scale(1.5);
}

.custom-cursor.hover::before {
    border-bottom-color: #F37139;
}

/* ============================================
   PAGE LOADER
   ============================================ */
.page-loader {
    position: fixed;
    inset: 0;
    background: var(--color-primary);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 30px;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-text {
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--color-secondary);
    animation: pulse 1.5s ease-in-out infinite;
}

.loader-bar {
    width: 120px;
    height: 2px;
    background: rgba(243, 217, 189, 0.2);
    position: relative;
    overflow: hidden;
}

.loader-bar::after {
    content: '';
    position: absolute;
    left: -100%;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--color-accent);
    animation: loadSlide 1.5s ease-in-out infinite;
}

@keyframes loadSlide {
    0% { left: -100%; }
    50% { left: 0; }
    100% { left: 100%; }
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ============================================
   HEADER / NAV
   ============================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    mix-blend-mode: difference;
}

.site-logo {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    text-transform: uppercase;
}

.site-logo span {
    font-weight: 300;
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    position: relative;
    padding-bottom: 4px;
}

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

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

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
    position: relative;
    overflow: hidden;
}

.hero-headline {
    font-size: clamp(32px, 6vw, 72px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    max-width: 900px;
    color: var(--color-secondary);
    opacity: 0;
    transform: translateY(40px);
    animation: fadeUp 1s ease forwards 0.5s;
}

.hero-headline span {
    color: var(--color-accent);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-secondary);
    opacity: 0;
    animation: fadeIn 1s ease forwards 1.2s;
}

.scroll-indicator::after {
    content: '';
    display: block;
    width: 1px;
    height: 40px;
    background: var(--color-secondary);
    margin: 12px auto 0;
    animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
    0%, 100% { transform: scaleY(1); transform-origin: top; }
    50% { transform: scaleY(0.3); transform-origin: top; }
}

/* ============================================
   LOGO CAROUSEL
   ============================================ */
.logo-carousel-section {
    padding: 80px 0;
    overflow: hidden;
    background: var(--color-primary);
    border-top: 1px solid rgba(243, 217, 189, 0.1);
    border-bottom: 1px solid rgba(243, 217, 189, 0.1);
}

.logo-carousel {
    display: flex;
    gap: 80px;
    animation: carouselScroll 30s linear infinite;
    width: max-content;
}

.logo-carousel:hover {
    animation-play-state: paused;
}

.logo-item {
    flex-shrink: 0;
    font-size: clamp(24px, 3vw, 40px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-secondary);
    opacity: 0.6;
    transition: opacity 0.3s, color 0.3s;
    white-space: nowrap;
}

.logo-item:hover {
    opacity: 1;
    color: var(--color-accent);
}

@keyframes carouselScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================
   STATS SECTION
   ============================================ */
.stats-section {
    padding: 120px 40px;
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
}

.stats-text {
    font-size: clamp(20px, 3vw, 36px);
    font-weight: 300;
    line-height: 1.4;
    color: var(--color-secondary);
    opacity: 0;
    transform: translateY(30px);
}

.stats-text strong {
    font-weight: 700;
    color: var(--color-accent);
}

.stats-link {
    display: inline-block;
    margin-top: 40px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    border-bottom: 1px solid var(--color-accent);
    padding-bottom: 4px;
    transition: color 0.3s, border-color 0.3s;
}

.stats-link:hover {
    color: var(--color-secondary);
    border-color: var(--color-secondary);
}

/* ============================================
   PROJECTS SECTION
   ============================================ */
.projects-section {
    padding: 100px 0;
}

.section-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 60px;
    padding: 0 40px;
}

.project-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    min-height: 500px;
    border-top: 1px solid rgba(243, 217, 189, 0.15);
    overflow: hidden;
    position: relative;
    opacity: 0;
    transform: translateY(60px);
}

.project-card:nth-child(even) {
    direction: rtl;
}

.project-card:nth-child(even) > * {
    direction: ltr;
}

.project-image-wrap {
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 500px;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

.project-info {
    padding: 60px 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-title {
    font-size: clamp(28px, 4vw, 52px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--color-secondary);
    margin-bottom: 16px;
    transition: color 0.3s;
}

.project-card:hover .project-title {
    color: var(--color-accent);
}

.project-tags {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(243, 217, 189, 0.6);
}

/* ============================================
   THIN HORIZONTAL RECTANGLES (replacing stickers)
   ============================================ */
.rectangle-divider {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 60px 0;
}

.rectangle-divider span {
    display: block;
    width: 80px;
    height: 2px;
    background: var(--color-accent);
    opacity: 0.4;
}

/* ============================================
   SERVICES MARQUEE
   ============================================ */
.services-marquee-section {
    padding: 80px 0;
    overflow: hidden;
    background: var(--color-secondary);
}

.services-marquee {
    display: flex;
    gap: 60px;
    animation: marqueeScroll 20s linear infinite;
    width: max-content;
}

.service-tag {
    flex-shrink: 0;
    font-size: clamp(40px, 6vw, 100px);
    font-weight: 900;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    color: var(--color-primary);
    opacity: 0.15;
    white-space: nowrap;
    transition: opacity 0.3s, color 0.3s;
}

.service-tag:hover {
    opacity: 1;
    color: var(--color-accent);
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================
   CTA / SOCIAL SECTION
   ============================================ */
.cta-section {
    padding: 120px 40px;
    text-align: center;
}

.cta-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 24px;
}

.cta-socials {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
}

.cta-socials a {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-secondary);
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s;
}

.cta-socials a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

.cta-socials a:hover {
    color: var(--color-accent);
}

.cta-socials a:hover::after {
    width: 100%;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    padding: 40px;
    border-top: 1px solid rgba(243, 217, 189, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-copy {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: rgba(243, 217, 189, 0.5);
}

.footer-back {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-secondary);
    transition: color 0.3s;
}

.footer-back:hover {
    color: var(--color-accent);
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .site-header {
        padding: 16px 20px;
    }

    .nav-links {
        gap: 16px;
    }

    .project-card {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .project-card:nth-child(even) {
        direction: ltr;
    }

    .project-image-wrap {
        min-height: 300px;
    }

    .project-info {
        padding: 40px 24px;
    }

    .stats-section {
        padding: 80px 24px;
    }

    .site-footer {
        flex-direction: column;
        text-align: center;
    }

    .custom-cursor {
        display: none;
    }

    html, body, a, button {
        cursor: auto;
    }
}
