/* =============================================
   JORGE CUELLAR - Official Website
   Global Design System
   ============================================= */

/* ----- CSS Custom Properties ----- */
:root {
    /* Colors */
    --color-bg-primary: #040914;
    --color-bg-secondary: #0a1128;
    --color-bg-tertiary: #111d40;
    --color-bg-card: rgba(255, 255, 255, 0.03);
    --color-bg-card-hover: rgba(255, 255, 255, 0.08);
    --color-bg-glass: rgba(4, 9, 20, 0.85);

    --color-accent-primary: #3b82f6; /* Blue tint */
    --color-accent-secondary: #60a5fa; /* Lighter blue */
    --color-accent-glow: rgba(59, 130, 246, 0.3);
    --color-accent-purple: #8b5cf6;
    --color-accent-magenta: #e84a8a;

    --color-text-primary: #ffffff;
    --color-text-secondary: rgba(255, 255, 255, 0.65);
    --color-text-muted: rgba(255, 255, 255, 0.4);

    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-hover: rgba(255, 255, 255, 0.15);

    /* Typography */
    --font-display: Georgia, 'Times New Roman', serif;
    --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--color-accent-glow);

    /* Z-index */
    --z-nav: 1000;
    --z-overlay: 900;
    --z-modal: 1100;
    --z-player: 950;
}

/* ----- Reset ----- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

ul,
ol {
    list-style: none;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* ----- Custom Scrollbar ----- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* ----- Typography ----- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.2;
}

h1 { font-size: clamp(2.5rem, 8vw, 6rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: clamp(1.1rem, 2vw, 1.3rem); }

p {
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* ----- Navigation ----- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-nav);
    padding: var(--space-lg) var(--space-2xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background var(--transition-normal),
                padding var(--transition-normal),
                border-color var(--transition-normal);
    border-bottom: 1px solid transparent;
}

.nav.scrolled {
    background: var(--color-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--space-md) var(--space-2xl);
    border-bottom-color: var(--color-border);
}

.nav__logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    color: var(--color-accent-primary);
}

.nav__logo span {
    color: var(--color-text-primary);
}

.nav__links {
    display: flex;
    gap: var(--space-xl);
    align-items: center;
}

.nav__link {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text-secondary);
    position: relative;
    padding: var(--space-xs) 0;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-accent-primary);
    transition: width var(--transition-normal);
}

.nav__link:hover,
.nav__link.active {
    color: var(--color-accent-primary);
}

.nav__link:hover::after,
.nav__link.active::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: var(--z-modal);
}

.nav__toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--color-text-primary);
    transition: transform var(--transition-normal), opacity var(--transition-fast);
}

.nav__toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav__toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav__toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.btn--primary {
    background: linear-gradient(135deg, var(--color-accent-primary), #1e3a8a);
    color: #ffffff;
    font-weight: 600;
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn--outline {
    border: 1px solid var(--color-accent-primary);
    color: var(--color-accent-primary);
}

.btn--outline:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.btn--ghost {
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn--ghost:hover {
    border-color: var(--color-border-hover);
    color: var(--color-text-primary);
}

.btn--sm {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.75rem;
}

/* ----- Glass Card ----- */
.glass-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.glass-card:hover {
    background: var(--color-bg-card-hover);
    border-color: var(--color-border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ----- Section Layout ----- */
.section {
    padding: var(--space-4xl) var(--space-2xl);
    max-width: 1400px;
    margin: 0 auto;
}

.section__header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section__subtitle {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-accent-primary);
    margin-bottom: var(--space-md);
    display: block;
    font-family: var(--font-body);
}

.section__title {
    margin-bottom: var(--space-md);
}

.section__description {
    max-width: 600px;
    margin: 0 auto;
}

/* ----- Divider ----- */
.divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-accent-primary), transparent);
    margin: var(--space-lg) auto;
}

/* ----- Badge ----- */
.badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.badge--official {
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-accent-secondary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge--fan {
    background: rgba(139, 92, 246, 0.15);
    color: var(--color-accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge--active {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge--completed {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

/* ----- Footer ----- */
.footer {
    border-top: 1px solid var(--color-border);
    padding: var(--space-3xl) var(--space-2xl);
    background: var(--color-bg-secondary);
}

.footer__content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
}

.footer__brand {
    font-family: var(--font-display);
}

.footer__brand h3 {
    color: var(--color-accent-primary);
    margin-bottom: var(--space-md);
    font-size: 1.5rem;
}

.footer__brand p {
    font-size: 0.9rem;
    max-width: 300px;
}

.footer__section h4 {
    font-family: var(--font-body);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text-primary);
    margin-bottom: var(--space-lg);
}

.footer__section a {
    display: block;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
    transition: color var(--transition-fast);
}

.footer__section a:hover {
    color: var(--color-accent-primary);
}

/* Footer Social */
.footer__social {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.footer__social-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    transition: all var(--transition-normal);
}

.footer__social-link:hover {
    color: #1DB954;
    border-color: rgba(29, 185, 84, 0.4);
    background: rgba(29, 185, 84, 0.1);
    transform: translateY(-2px);
}

/* Spotify Button (Global) */
.btn--spotify {
    background: #1DB954;
    color: #fff;
    font-weight: 600;
    border: none;
    gap: var(--space-sm);
}

.btn--spotify:hover {
    background: #1ed760;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(29, 185, 84, 0.3);
}

.footer__bottom {
    max-width: 1400px;
    margin: var(--space-2xl) auto 0;
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ----- Animations ----- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    30% { transform: translate(3%, -15%); }
    50% { transform: translate(12%, 9%); }
    70% { transform: translate(9%, 4%); }
    90% { transform: translate(-1%, 7%); }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays */
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }

/* ----- Page Transition ----- */
.page-transition {
    position: fixed;
    inset: 0;
    background: var(--color-bg-primary);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
}

.page-transition::after {
    content: 'JC';
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--color-accent-primary);
    opacity: 0;
}

.page-transition.entering {
    opacity: 1;
    animation: transitionIn 0.5s ease forwards;
}

.page-transition.entering::after {
    animation: fadeIn 0.3s ease 0.2s forwards;
}

.page-transition.exiting {
    opacity: 1;
    animation: transitionOut 0.5s ease forwards;
}

@keyframes transitionIn {
    from { clip-path: circle(0% at 50% 50%); }
    to { clip-path: circle(150% at 50% 50%); }
}

@keyframes transitionOut {
    from {
        clip-path: circle(150% at 50% 50%);
        opacity: 1;
    }
    to {
        clip-path: circle(150% at 50% 50%);
        opacity: 0;
    }
}

/* ----- Film Grain Overlay ----- */
.grain-overlay {
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9998;
    opacity: 0.4;
    animation: grain 8s steps(10) infinite;
}

/* ----- Visually Hidden (Accessibility) ----- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ----- Loading Skeleton ----- */
.skeleton {
    background: linear-gradient(90deg, var(--color-bg-card) 25%, var(--color-bg-card-hover) 50%, var(--color-bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .nav {
        padding: var(--space-md) var(--space-lg);
    }

    .nav.scrolled {
        padding: var(--space-sm) var(--space-lg);
    }

    .nav__links {
        position: fixed;
        inset: 0;
        background: var(--color-bg-primary);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--space-xl);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition-normal);
    }

    .nav__links.open {
        opacity: 1;
        pointer-events: all;
    }

    .nav__toggle {
        display: flex;
    }

    .nav__link {
        font-size: 1.2rem;
    }

    .footer__content {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .footer__bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .section {
        padding: var(--space-3xl) var(--space-lg);
    }
}

@media (max-width: 480px) {
    :root {
        font-size: 14px;
    }

    .nav {
        padding: var(--space-md);
    }

    .section {
        padding: var(--space-2xl) var(--space-md);
    }
}
