/* ============================================================
   css/global.css – Design tokens, reset, shared utilities
   ============================================================ */

/* ── Fonts: Erica One, Clash Display, Gowun Batang ── */
@import url('https://fonts.googleapis.com/css2?family=Erica+One&family=Gowun+Batang:wght@400;700&display=swap');
@import url('https://api.fontshare.com/v2/css?f[]=clash-display@500,600&display=swap');

/* ── Design Tokens (Estilo Único) ── */
:root {
    /* Colors */
    --navy: #FDF5E8;
    --navy-mid: #ffffff;
    --navy-light: #FFB6CA;
    /* RGB para transparencias de Navy */
    --navy-rgb: 253, 245, 232;
    --navy-mid-rgb: 255, 255, 255;

    --gold: #EFA916;
    --gold-light: #EC6C01;
    --gold-dim: rgba(239, 169, 22, .15);
    --teal: #20AB5D;
    --teal-light: #4081FD;
    --cream: #FDF5E8;
    --text: #411F14;
    --text-dim: rgba(65, 31, 20, 0.7);
    --white: #ffffff;
    --dialog-bg: rgba(253, 245, 232, 0.96);
    --card-border: rgba(65, 31, 20, .12);
    --card-bg: rgba(255, 255, 255, .85);

    /* Degradados Hero de Landing */
    --hero-grad-1: #FDF5E8;
    --hero-grad-2: #FDF5E8;
    --hero-grad-3: #ffffff;

    /* Layout */
    --radius: 16px;
    --radius-sm: 8px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow: 0 20px 60px rgba(65, 31, 20, .08);
    --shadow-card: 0 8px 32px rgba(65, 31, 20, .04);
    --shadow-gold: 0 8px 28px rgba(239, 169, 22, .15);

    /* Animation */
    --ease: cubic-bezier(.25, 1, .5, 1);
    --transition: .4s var(--ease);

    /* Typography */
    --font: 'Gowun Batang', serif;
    --font-title: 'Erica One', sans-serif;
    --font-sub: 'Clash Display', sans-serif;
}

/* ── Mismo tema para evitar discrepancias ── */
:root[data-theme="light"] {
    --navy: #FDF5E8;
    --navy-mid: #ffffff;
    --navy-light: #FFB6CA;
    --navy-rgb: 253, 245, 232;
    --navy-mid-rgb: 255, 255, 255;

    --gold: #EFA916;
    --gold-light: #EC6C01;
    --gold-dim: rgba(239, 169, 22, .15);
    --teal: #20AB5D;
    --teal-light: #4081FD;
    --cream: #FDF5E8;
    --text: #411F14;
    --text-dim: rgba(65, 31, 20, 0.7);
    --white: #ffffff;
    --dialog-bg: rgba(253, 245, 232, 0.96);
    --card-border: rgba(65, 31, 20, .12);
    --card-bg: rgba(255, 255, 255, .85);

    --hero-grad-1: #FDF5E8;
    --hero-grad-2: #FDF5E8;
    --hero-grad-3: #ffffff;

    --shadow: 0 20px 60px rgba(65, 31, 20, .08);
    --shadow-card: 0 8px 32px rgba(65, 31, 20, .04);
}

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

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

body {
    font-family: var(--font);
    background: var(--navy);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ── Typography Roles ── */
h1,
.erica-title {
    font-family: var(--font-title);
    font-weight: 400;
}

h2,
h3,
h4,
h5,
h6,
.clash-title {
    font-family: var(--font-sub);
    font-weight: 600;
}

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

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

ul {
    list-style: none;
}

input,
select,
textarea,
button {
    font-family: var(--font);
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* ── Layout Utilities ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-header {
    text-align: center;
    margin-bottom: 56px;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--text-dim);
    font-size: 1.1rem;
    max-width: 560px;
    margin: 0 auto;
}

.section-eyebrow {
    display: inline-block;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .1em;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 12px;
}

/* ── Button Utilities ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--navy);
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 32px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(239, 169, 22, .3);
}

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

.btn-primary.full-width {
    width: 100%;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 500;
    font-size: 1rem;
    padding: 14px 28px;
    border-radius: 50px;
    border: 1.5px solid var(--card-border);
    transition: var(--transition);
}

.btn-ghost:hover {
    background: var(--card-bg);
    border-color: var(--text-dim);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gold);
    font-weight: 600;
    font-size: .95rem;
    padding: 10px 24px;
    border-radius: 50px;
    border: 1.5px solid var(--gold);
    transition: var(--transition);
}

.btn-outline:hover {
    background: rgba(239, 169, 22, .1);
}

.btn-teal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--teal), var(--teal-light));
    color: #ffffff;
    font-weight: 700;
    font-size: .95rem;
    padding: 12px 28px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-teal:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(20, 184, 184, .3);
}

/* ── Fade Animations ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(28px)
    }

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

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-20px)
    }

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(.92)
    }

    to {
        opacity: 1;
        transform: scale(1)
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: rotate(45deg) translateY(0)
    }

    50% {
        transform: rotate(45deg) translateY(6px)
    }
}

.anim-fade-up {
    animation: fadeUp .7s var(--ease) both;
}

.anim-fade-in {
    animation: fadeIn .5s var(--ease) both;
}

.anim-scale-in {
    animation: scaleIn .5s var(--ease) both;
}

/* ── Toast ── */
#toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, var(--navy-light), var(--navy-mid));
    border: 1px solid rgba(212, 168, 67, .4);
    border-radius: 12px;
    padding: 14px 24px;
    color: var(--text);
    font-size: .9rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s, transform .4s;
    z-index: 9999;
    white-space: nowrap;
}

#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Leaflet dark overrides ── */
.leaflet-container {
    background: var(--navy-mid) !important;
}

.leaflet-popup-content-wrapper {
    background: var(--navy-mid);
    border: 1px solid rgba(212, 168, 67, .3);
    color: var(--text);
    border-radius: 10px !important;
}

.leaflet-popup-tip {
    background: var(--navy-mid);
}

.leaflet-popup-content {
    font-family: var(--font);
    font-size: .88rem;
}

.leaflet-control-zoom a {
    background: var(--navy-mid) !important;
    color: var(--gold) !important;
    border-color: rgba(212, 168, 67, .3) !important;
}

/* ── Responsive Global ── */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 0 16px;
    }

    .section-header {
        margin-bottom: 40px;
    }
}

/* ── Brand Utilities ── */
.text-gradient {
    background: linear-gradient(135deg, var(--text) 0%, #000000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(65, 31, 20, 0.1);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 40px 0;
}

.bento-card {
    position: relative;
    border-radius: var(--radius-xl);
    padding: 30px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(65, 31, 20, 0.1);
    border-color: rgba(65, 31, 20, 0.2);
}

@media (max-width: 900px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Section spacing to match landing page top alignment under floating navbar ── */
#page-content .about-section,
#page-content .events-section,
#page-content .cartas-section,
#page-content .historia-section,
#page-content .invest-section,
#page-content .buy-section,
#page-content .contacto-section {
    padding-top: 120px;
}

@media (max-width: 900px) {
    #page-content .about-section,
    #page-content .events-section,
    #page-content .cartas-section,
    #page-content .historia-section,
    #page-content .invest-section,
    #page-content .buy-section,
    #page-content .contacto-section {
        padding-top: 100px;
    }
}