/* ============================================================
   BASE — Reset, Tipografía Global, Utilidades
   ============================================================ */

/* Google Fonts import */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,900;1,400;1,700&family=Inter:wght@300;400;500;600;700&display=swap');

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition:
        background-color var(--transition-theme),
        color var(--transition-theme);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

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

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

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

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

/* ------- TIPOGRAFÍA ------- */
.h1 {
    font-size: clamp(2.5rem, 6vw, var(--text-6xl));
}

.h2 {
    font-size: clamp(2rem, 4vw, var(--text-4xl));
}

.h3 {
    font-size: clamp(1.5rem, 3vw, var(--text-3xl));
}

.h4 {
    font-size: var(--text-2xl);
}

.h5 {
    font-size: var(--text-xl);
}

.font-heading {
    font-family: var(--font-heading);
}

.font-body {
    font-family: var(--font-body);
}

.font-mono {
    font-family: var(--font-mono);
}

.text-xs {
    font-size: var(--text-xs);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-base {
    font-size: var(--text-base);
}

.text-lg {
    font-size: var(--text-lg);
}

.text-xl {
    font-size: var(--text-xl);
}

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

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.text-gold {
    color: var(--gold);
}

.text-electric {
    color: var(--electric);
}

.text-gradient-gold {
    background: var(--gradient-text-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.font-300 {
    font-weight: 300;
}

.font-400 {
    font-weight: 400;
}

.font-500 {
    font-weight: 500;
}

.font-600 {
    font-weight: 600;
}

.font-700 {
    font-weight: 700;
}

.font-900 {
    font-weight: 900;
}

.italic {
    font-style: italic;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wide {
    letter-spacing: 0.08em;
}

.tracking-wider {
    letter-spacing: 0.15em;
}

/* ------- LAYOUT ------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.container-narrow {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.section {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
}

.section-sm {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
}

/* Grid */
.grid {
    display: grid;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
}

/* Flex */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

/* ------- COLORES DE FONDO ------- */
.bg-primary {
    background: var(--bg-primary);
}

.bg-secondary {
    background: var(--bg-secondary);
}

.bg-card {
    background: var(--bg-card);
}

/* ------- BORDES ------- */
.border {
    border: 1px solid var(--border);
}

.border-gold {
    border: 1px solid var(--gold-border);
}

.border-electric {
    border: 1px solid var(--electric-border);
}

.border-radius-md {
    border-radius: var(--radius-md);
}

.border-radius-lg {
    border-radius: var(--radius-lg);
}

.border-radius-xl {
    border-radius: var(--radius-xl);
}

/* ------- SEPARADOR DECORATIVO ------- */
.divider {
    width: 60px;
    height: 3px;
    background: var(--gradient-gold);
    border-radius: var(--radius-full);
    display: block;
}

.divider-center {
    margin: 0 auto;
}

/* ------- BADGE / ETIQUETA ------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid;
}

.badge-gold {
    background: var(--gold-subtle);
    color: var(--gold);
    border-color: var(--gold-border);
}

.badge-electric {
    background: var(--electric-subtle);
    color: var(--electric);
    border-color: var(--electric-border);
}

.badge-neutral {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-color: var(--border);
}

/* ------- UTILIDADES VARIAS ------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.relative {
    position: relative;
}

.overflow-hidden {
    overflow: hidden;
}

/* Scroll custom */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--gold-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Selección de texto */
::selection {
    background: var(--gold-subtle);
    color: var(--gold-light);
}

/* Focus ring accesible */
:focus-visible {
    outline: 2px solid var(--electric);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* Transición de contenido al navegar */
#app {
    transition: opacity var(--transition-normal);
}

#app.fading {
    opacity: 0;
}

/* ------- RESPONSIVE BREAKPOINTS ------- */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .section {
        padding-top: var(--space-16);
        padding-bottom: var(--space-16);
    }
}