:root {
    /* Colors */
    --background: #0b0e14;
    --foreground: #e9e6e0;

    --gold: #f0c425;
    --gold-light: #f7db7d;
    --gold-dark: #b89214;

    --secondary: #1e232e;
    --muted: #181c25;
    --muted-foreground: #737880;

    --accent: #1a8cff;
    --border: #242936;
    --card: #131720;

    --font-display: 'Cinzel', serif;
    --font-body: 'Cormorant Garamond', serif;
    --font-sans: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    font-size: 1.1rem;
    position: relative;
}

/* Typography */
h1,
h2,
h3,
.logo,
.overline {
    font-family: var(--font-display);
    text-transform: uppercase;
}

.btn,
.tag,
.social-link,
.nav-link,
.card-subtitle {
    font-family: var(--font-sans);
}

h1 {
    font-size: 5.5rem;
    /* Massive size */
    margin-top: 2rem;
    /* SPACE FROM LOGO */
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    font-weight: 400;
    /* Regular weight */
    text-transform: uppercase;
    line-height: 1.1;

    /* SOLID GOLD TEXT */
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    color: var(--gold);

    /* Strong shadow for legibility over background */
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.9);
    filter: none;
}

h2 {
    font-size: 2.2rem;
    color: var(--gold);
    margin-bottom: 1.5rem;
    font-weight: 400;
    /* Regular weight */
}

h3 {
    font-size: 0.9rem;
    color: var(--muted-foreground);
    margin-top: 0.5rem;
    font-weight: 400;
    /* Regular weight */
}

/* Color Themes for Preview Cards */
.theme-red-glow {
    border: 2px solid #a83232;
    box-shadow: 0 0 25px rgba(168, 50, 50, 0.3);
}

.theme-red-text {
    color: #a83232;
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.theme-green-glow {
    border: 2px solid #32a852;
    box-shadow: 0 0 25px rgba(50, 168, 82, 0.3);
}

.theme-green-text {
    color: #32a852;
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.theme-blue-glow {
    border: 2px solid #3264c8;
    box-shadow: 0 0 25px rgba(50, 100, 200, 0.3);
}

.theme-blue-text {
    color: #3264c8;
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.subtitle {
    font-family: var(--font-body);
    font-size: 1.3rem;
    font-style: italic;
    color: var(--gold-light);
    margin-bottom: 2rem;
    font-weight: 300;
}

.overline {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--gold);
    margin-bottom: 1rem;
    display: block;
    font-weight: 600;
    opacity: 0.9;
}

.description {
    max-width: 650px;
    margin: 0 auto 2.5rem;
    font-weight: 400;
    font-size: 1.15rem;
    color: var(--muted-foreground);
    line-height: 1.8;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}


.text-center {
    text-align: center;
}

/* Gallery Header Specific Styles */
.gallery-header {
    padding-top: 10rem !important;
    /* More space from logo */
}

.gallery-header h1 {
    font-size: 3rem;
    /* Smaller than main hero */
}

@media (max-width: 900px) {
    .gallery-header {
        padding-top: 8rem !important;
    }

    .gallery-header h1 {
        font-size: 2rem;
    }
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;

    /* BACKGROUND IMAGE: Extremely Subtle + Bottom Fade to Black */
    background-image:
        /* Bottom fade to seamlessly blend with next section */
        linear-gradient(to bottom, transparent 80%, var(--background) 100%),
        /* Very Strong dark overlay for maximum readability */
        linear-gradient(to bottom, rgba(11, 14, 20, 0.85), rgba(11, 14, 20, 0.95)),
        /* The image itself */
        url('../assets/img/fondo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    padding: 12rem 2rem 6rem;
    /* Increased top padding significantly to avoid logo overlap */
    position: relative;
}

.section-preview,
.section-author,
.section-cta {
    padding: 6rem 2rem;
    text-align: center;
    position: relative;
}

/* Cards Grid */
.cards-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 columns on desktop */
    gap: 2rem;
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        /* 1 column on mobile as requested */
        gap: 2rem;
        padding: 2rem 1rem;
    }
}

.card-preview-item,
.card-item {
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    transition: transform 0.4s ease;
    cursor: pointer;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: visible;
}

/* GOLDEN BACKLIGHT - Very Subtle & Transparent */
.card-preview-item::before,
.card-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    /* Very subtle gradient, mostly transparent */
    background: radial-gradient(circle at center, rgba(240, 196, 37, 0.4) 0%, rgba(240, 196, 37, 0.1) 40%, transparent 70%);
    filter: blur(40px);
    z-index: -1;
    opacity: 0.6;
    transition: opacity 0.4s ease, transform 0.4s ease;
    mix-blend-mode: screen;
}

.card-preview-item:hover,
.card-item:hover {
    transform: translateY(-10px);
}

.card-preview-item:hover::before,
.card-item:hover::before {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Card Image with Subtle Glow */
.card-img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: var(--muted);
    border: none;

    /* Very Subtle golden glow (Transparent look) */
    box-shadow:
        0 10px 30px -10px rgba(0, 0, 0, 0.8),
        0 0 50px rgba(240, 196, 37, 0.15),
        0 0 20px rgba(240, 196, 37, 0.25);

    transition: all 0.5s ease;
}

.card-preview-item:hover .card-img,
.card-item:hover .card-img {
    transform: translateY(-8px);
    box-shadow:
        0 20px 40px -10px rgba(0, 0, 0, 0.9),
        0 0 70px rgba(240, 196, 37, 0.3),
        0 0 30px rgba(240, 196, 37, 0.4);
}

.card-title {
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 1.1rem;
}

.card-subtitle {
    color: var(--muted-foreground);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Author Section */
.section-author {
    background: var(--muted);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.author-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
}

.author-img-wrapper {
    flex: 0 0 350px;
}

.author-img {
    width: 100%;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.author-text {
    flex: 1;
    min-width: 300px;
}

.author-bio {
    font-size: 1.2rem;
    color: var(--foreground);
    margin-bottom: 1.5rem;
}

.tags {
    margin: 2rem 0;
}

.tag {
    display: inline-block;
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.75rem;
    margin-right: 8px;
    margin-bottom: 8px;
    color: var(--gold);
    background: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.link-arrow {
    font-family: var(--font-sans);
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}

.link-arrow:hover {
    color: var(--gold-light);
}

/* CTA Section */
.section-cta {
    background: linear-gradient(to top, var(--background), var(--muted));
}

.section-cta h2 {
    font-weight: 400;
}

.divider-icon {
    display: block;
    font-size: 2rem;
    color: var(--gold);
    margin: 2rem 0;
    opacity: 0.8;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--border);
    color: var(--muted-foreground);
    background: var(--background);
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 32px;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    font-weight: 600;
    border-radius: 2px;
    transition: all 0.3s ease;
    margin: 0 10px;
    cursor: pointer;
}

.btn-primary {
    background: var(--gold);
    color: var(--background);
    border: 1px solid var(--gold);
}

.btn-primary:hover {
    background: var(--gold-light);
    border-color: var(--gold-light);
    box-shadow: 0 0 15px rgba(240, 196, 37, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
}

.btn-outline:hover {
    background: rgba(240, 196, 37, 0.1);
}

/* Social Links */
.social-links {
    margin-bottom: 1.5rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--muted-foreground);
    border-radius: 50%;
    color: var(--muted-foreground);
    text-decoration: none;
    margin: 0 8px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    color: var(--background);
    background: var(--gold);
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(240, 196, 37, 0.4);
}

.btn-text {
    color: var(--gold);
    text-decoration: none;
    font-family: var(--font-sans);
    letter-spacing: 0.05em;
    transition: color 0.3s;
}

.btn-text:hover {
    color: var(--gold-light);
    text-decoration: underline;
}

/* Navigation */
.main-nav {
    padding: 2rem;
    text-align: center;
    position: absolute;
    width: 100%;
    top: 0;
    z-index: 10;
}

.main-nav .logo img {
    height: 120px;
}

/* =========================================
   INTERACTIVE GALLERY - 3D FLIP CARDS
   ========================================= */

/* 3D Flip Card Container */
.flip-card {
    background-color: transparent;
    width: 100%;
    aspect-ratio: 2 / 3;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

/* === BOTH FACES: absolute, fill parent, hidden backface === */
.flip-card-front,
.flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: var(--radius);
    overflow: hidden;
}

/* === FRONT FACE === */
.flip-card-front {
    z-index: 2;
    transform: rotateY(0deg);
    background-color: #111;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem 1rem;
    color: white;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Overlay for text readability */
.flip-card-front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 0;
}

.flip-card-front>* {
    position: relative;
    z-index: 1;
}

/* Theme backgrounds */
.flip-card-front.theme-red {
    background-image: url('../assets/img/rojo.jpg');
    border: 2px solid #a83232;
}

.flip-card-front.theme-green {
    background-image: url('../assets/img/verde.jpg');
    border: 2px solid #32a852;
}

.flip-card-front.theme-blue {
    background-image: url('../assets/img/azul.jpg');
    border: 2px solid #3264c8;
}

/* Card number */
.card-number {
    font-family: var(--font-display);
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Card title */
.flip-card-front h3 {
    font-size: 1.15rem;
    margin: 0.5rem 0 0.25rem;
    color: var(--foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

/* Subtitle */
.author-name {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.subtitle {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--gold);
    margin-top: 0.25rem;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* === BACK FACE === */
.flip-card-back {
    z-index: 1;
    transform: rotateY(180deg);
    background: #000;
    padding: 0;
    box-shadow: 0 0 15px rgba(218, 165, 32, 0.25),
        0 0 30px rgba(218, 165, 32, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.5);
}

/* Golden glow pulse */
@keyframes goldenPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(218, 165, 32, 0.3),
            0 0 40px rgba(218, 165, 32, 0.2),
            0 8px 16px rgba(0, 0, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.5),
            0 0 60px rgba(218, 165, 32, 0.3),
            0 8px 20px rgba(0, 0, 0, 0.6);
    }
}

.flip-card:hover .flip-card-back {
    animation: goldenPulse 2s ease-in-out infinite;
}

/* Back image - fills entire card */
.flip-card-back a {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.flip-card-back a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.flip-card-back a:hover img {
    transform: scale(1.05);
}

/* =========================================
   PARTICLE BACKGROUND EFFECT
   ========================================= */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 196, 37, 1) 0%, rgba(240, 196, 37, 0.6) 30%, transparent 70%);
    box-shadow: 0 0 20px rgba(240, 196, 37, 0.8);
    opacity: 0;
    animation: floatParticle linear infinite;
}

@keyframes floatParticle {
    0% {
        transform: translateY(110vh) translateX(0) scale(0);
        opacity: 0;
    }

    15% {
        opacity: 0.6;
    }

    50% {
        transform: translateY(50vh) translateX(var(--drift, 0)) scale(1.2);
        opacity: 0.5;
    }

    85% {
        opacity: 0.4;
    }

    100% {
        transform: translateY(-10vh) translateX(calc(var(--drift, 0) * 1.5)) scale(1.5);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 900px) {
    h1 {
        font-size: 2.5rem;
    }

    .author-container {
        flex-direction: column;
        text-align: center;
    }

    .author-img-wrapper {
        flex: auto;
        max-width: 100%;
    }

    .hero {
        padding-top: 6rem;
    }

    .main-nav .logo img {
        height: 90px;
    }
}

/* =========================================
   Fixed Social Sidebar
   ========================================= */
.social-sidebar {
    position: fixed;
    left: 25px;
    /* Moved more inside (was 10px) */
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    /* Vertical Layout */
    gap: 15px;
    /* Increased gap for cleaner look without background */
    z-index: 100;
    padding: 0;
    background: transparent;
    /* No background */
    border-radius: 0;
    backdrop-filter: none;
}

.social-sidebar .sidebar-link {
    color: rgba(255, 255, 255, 0.7);
    /* Slightly transparent by default */
    font-size: 1.2rem;
    /* Smaller icons */
    text-decoration: none;
    /* Remove underline */
    transition: transform 0.3s, color 0.3s;
    display: flex;
    /* Center icon */
    justify-content: center;
}

.social-sidebar .sidebar-link:hover {
    color: var(--gold);
    transform: scale(1.2);
    opacity: 1;
}

/* Hide Sidebar on Mobile */
@media (max-width: 768px) {
    .social-sidebar {
        display: none;
    }
}