/* ═══════════════════════════════════════════════════════════════
   FUNGIVERSE 2.0 — Design System Global
   ═══════════════════════════════════════════════════════════════
   Variables, reset, y utilidades base.
   Este archivo se carga en todas las páginas del sitio.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Custom Properties (Design Tokens) ─── */
:root {
    /* Palette — Fungiverse Organic */
    --fv-primary: #2D5A3D;
    --fv-primary-light: #4A8B5C;
    --fv-primary-dark: #1A3D28;
    --fv-primary-rgb: 45, 90, 61;

    --fv-accent: #C4A962;
    --fv-accent-light: #E8D5A0;
    --fv-accent-dark: #A08940;
    --fv-accent-rgb: 196, 169, 98;

    --fv-bg: #FAFAF5;
    --fv-bg-alt: #F0EDE4;
    --fv-bg-dark: #1A1A1A;

    --fv-text: #1A1A1A;
    --fv-text-light: #FAFAF5;
    --fv-text-muted: #6B6B6B;
    --fv-text-subtle: #9B9B9B;

    --fv-white: #FFFFFF;
    --fv-black: #0A0A0A;
    --fv-danger: #D94F4F;
    --fv-success: #2D8B5A;
    --fv-warning: #E8A840;
    --fv-info: #4A7BC4;

    --fv-border: #E0DDD4;
    --fv-border-light: #F0EDE4;

    /* Typography */
    --fv-font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --fv-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --fv-text-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.75rem);
    --fv-text-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.875rem);
    --fv-text-base: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);
    --fv-text-lg: clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem);
    --fv-text-xl: clamp(1.2rem, 1rem + 1vw, 1.5rem);
    --fv-text-2xl: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
    --fv-text-3xl: clamp(1.8rem, 1.4rem + 2vw, 2.75rem);
    --fv-text-4xl: clamp(2.2rem, 1.6rem + 3vw, 3.75rem);
    --fv-text-5xl: clamp(2.8rem, 2rem + 4vw, 5rem);

    --fv-leading-tight: 1.15;
    --fv-leading-normal: 1.5;
    --fv-leading-relaxed: 1.75;

    --fv-tracking-tight: -0.02em;
    --fv-tracking-normal: 0;
    --fv-tracking-wide: 0.05em;
    --fv-tracking-wider: 0.1em;

    /* Spacing Scale */
    --fv-space-2xs: 0.125rem;
    --fv-space-xs: 0.25rem;
    --fv-space-sm: 0.5rem;
    --fv-space-md: 1rem;
    --fv-space-lg: 1.5rem;
    --fv-space-xl: 2rem;
    --fv-space-2xl: 3rem;
    --fv-space-3xl: 4rem;
    --fv-space-4xl: 6rem;
    --fv-space-5xl: 8rem;

    /* Container */
    --fv-container-sm: 640px;
    --fv-container-md: 768px;
    --fv-container-lg: 1024px;
    --fv-container-xl: 1200px;
    --fv-container-2xl: 1400px;
    --fv-gutter: clamp(1rem, 3vw, 2rem);

    /* Border Radius */
    --fv-radius-sm: 6px;
    --fv-radius-md: 10px;
    --fv-radius-lg: 16px;
    --fv-radius-xl: 24px;
    --fv-radius-2xl: 32px;
    --fv-radius-full: 9999px;

    /* Shadows */
    --fv-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --fv-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --fv-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --fv-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10);
    --fv-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.14);

    /* Transitions */
    --fv-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --fv-ease-in: cubic-bezier(0.55, 0, 1, 0.45);
    --fv-ease-out: cubic-bezier(0, 0.55, 0.45, 1);
    --fv-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --fv-duration-fast: 150ms;
    --fv-duration-base: 300ms;
    --fv-duration-slow: 500ms;

    --fv-transition: all var(--fv-duration-base) var(--fv-ease);
    --fv-transition-fast: all var(--fv-duration-fast) var(--fv-ease);
    --fv-transition-slow: all var(--fv-duration-slow) var(--fv-ease);

    /* Z-index scale */
    --fv-z-below: -1;
    --fv-z-base: 0;
    --fv-z-above: 10;
    --fv-z-header: 100;
    --fv-z-dropdown: 200;
    --fv-z-overlay: 500;
    --fv-z-modal: 1000;
    --fv-z-toast: 2000;
}

/* ─── CSS Reset (Minimal) ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    font-family: var(--fv-font-body);
    font-size: var(--fv-text-base);
    line-height: var(--fv-leading-normal);
    color: var(--fv-text);
    background-color: var(--fv-bg);
    overflow-x: hidden;
}

img,
video,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
}

input,
textarea,
select {
    font: inherit;
    color: inherit;
}

/* ─── Tipografía Base ─── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--fv-font-heading);
    font-weight: 700;
    line-height: var(--fv-leading-tight);
    letter-spacing: var(--fv-tracking-tight);
    color: var(--fv-text);
}

h1 {
    font-size: var(--fv-text-4xl);
}

h2 {
    font-size: var(--fv-text-3xl);
}

h3 {
    font-size: var(--fv-text-2xl);
}

h4 {
    font-size: var(--fv-text-xl);
}

h5 {
    font-size: var(--fv-text-lg);
}

h6 {
    font-size: var(--fv-text-base);
}

p {
    font-size: var(--fv-text-base);
    line-height: var(--fv-leading-relaxed);
    color: var(--fv-text-muted);
}

strong {
    font-weight: 600;
}

/* ─── Utilidades ─── */
.fv-container {
    width: 100%;
    max-width: var(--fv-container-xl);
    margin-inline: auto;
    padding-inline: var(--fv-gutter);
}

.fv-container--narrow {
    max-width: var(--fv-container-md);
}

.fv-container--wide {
    max-width: var(--fv-container-2xl);
}

.fv-section {
    padding-block: var(--fv-space-4xl);
}

.fv-section--sm {
    padding-block: var(--fv-space-2xl);
}

.fv-section--lg {
    padding-block: var(--fv-space-5xl);
}

/* Flexbox helpers */
.fv-flex {
    display: flex;
}

.fv-flex-col {
    flex-direction: column;
}

.fv-flex-wrap {
    flex-wrap: wrap;
}

.fv-items-center {
    align-items: center;
}

.fv-items-start {
    align-items: flex-start;
}

.fv-justify-center {
    justify-content: center;
}

.fv-justify-between {
    justify-content: space-between;
}

.fv-gap-sm {
    gap: var(--fv-space-sm);
}

.fv-gap-md {
    gap: var(--fv-space-md);
}

.fv-gap-lg {
    gap: var(--fv-space-lg);
}

.fv-gap-xl {
    gap: var(--fv-space-xl);
}

.fv-gap-2xl {
    gap: var(--fv-space-2xl);
}

/* Grid helpers */
.fv-grid {
    display: grid;
    gap: var(--fv-space-lg);
}

.fv-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.fv-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.fv-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {

    .fv-grid-2,
    .fv-grid-3,
    .fv-grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {

    .fv-grid-3,
    .fv-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Text utilities */
.fv-text-center {
    text-align: center;
}

.fv-text-left {
    text-align: left;
}

.fv-text-right {
    text-align: right;
}

.fv-text-uppercase {
    text-transform: uppercase;
    letter-spacing: var(--fv-tracking-wider);
}

.fv-text-gradient {
    background: linear-gradient(135deg, var(--fv-primary), var(--fv-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Visibility helpers */
.fv-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 768px) {
    .fv-hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .fv-hide-desktop {
        display: none !important;
    }
}

/* ─── Scrollbar Personalizado ─── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--fv-bg-alt);
}

::-webkit-scrollbar-thumb {
    background: var(--fv-primary-light);
    border-radius: var(--fv-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fv-primary);
}

/* ─── Selection ─── */
::selection {
    background: rgba(var(--fv-primary-rgb), 0.15);
    color: var(--fv-primary-dark);
}

/* ─── Animations Base ─── */
@keyframes fv-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fv-fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fv-scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fv-slide-in-right {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fv-animate-fade-in {
    animation: fv-fade-in var(--fv-duration-slow) var(--fv-ease) forwards;
}

.fv-animate-fade-up {
    animation: fv-fade-up var(--fv-duration-slow) var(--fv-ease) forwards;
}

.fv-animate-scale-in {
    animation: fv-scale-in var(--fv-duration-base) var(--fv-ease-spring) forwards;
}

/* Intersection Observer — Reveal on Scroll */
.fv-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--fv-duration-slow) var(--fv-ease),
        transform var(--fv-duration-slow) var(--fv-ease);
}

.fv-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children — usado con JS */
.fv-stagger>.fv-reveal:nth-child(1) {
    transition-delay: 0ms;
}

.fv-stagger>.fv-reveal:nth-child(2) {
    transition-delay: 100ms;
}

.fv-stagger>.fv-reveal:nth-child(3) {
    transition-delay: 200ms;
}

.fv-stagger>.fv-reveal:nth-child(4) {
    transition-delay: 300ms;
}

.fv-stagger>.fv-reveal:nth-child(5) {
    transition-delay: 400ms;
}

.fv-stagger>.fv-reveal:nth-child(6) {
    transition-delay: 500ms;
}

.fv-stagger>.fv-reveal:nth-child(7) {
    transition-delay: 600ms;
}

.fv-stagger>.fv-reveal:nth-child(8) {
    transition-delay: 700ms;
}

/* ─── Elementor Overrides ─── */
/* Resetear los estilos que Elementor mete por default que chocan */
.elementor-section {
    padding: 0 !important;
}

.elementor-widget-html .elementor-widget-container {
    /* Asegurar que nuestro código se renderice limpio */
    font-family: var(--fv-font-body);
    color: var(--fv-text);
}