/* ============================================
   FAMILIAFIGARI.COM - Espacio familiar personal
   ============================================ */

:root {
    --accent-green: #84CC16;
    --accent-cyan: #06B6D4;
    --accent-pink: #F43F5E;
    --accent-purple: #8B5CF6;
}

/* Dark Mode (default) */
[data-theme="dark"] {
    --bg-color: #020203;
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --stroke-color: #555;
    --noise-opacity: 0.15;
    --highlight-color: #06B6D4;
    --highlight-glow: rgba(6, 182, 212, 0.5);
}

/* Light Mode */
[data-theme="light"] {
    --bg-color: #f5f5f7;
    --text-primary: rgba(0, 0, 0, 0.9);
    --text-secondary: rgba(0, 0, 0, 0.5);
    --stroke-color: #888;
    --noise-opacity: 0.05;
    --highlight-color: #0891b2;
    --highlight-glow: rgba(8, 145, 178, 0.4);
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border: 1px solid var(--text-secondary);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--highlight-color);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.theme-toggle.switching::before {
    animation: toggle-pulse 0.6s ease forwards;
}

@keyframes toggle-pulse {
    0% { transform: scale(0); opacity: 0.4; }
    50% { transform: scale(1.5); opacity: 0.2; }
    100% { transform: scale(2); opacity: 0; }
}

.theme-toggle:hover {
    border-color: var(--text-primary);
    transform: scale(1.1);
    background-color: rgba(128, 128, 128, 0.1);
}

.theme-toggle:active { transform: scale(0.9); }

.theme-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
    position: absolute;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.4s ease,
                color 0.3s ease;
}

.theme-toggle .icon-sun { opacity: 0; transform: rotate(-180deg) scale(0); }
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="light"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(180deg) scale(0); }

[data-theme="light"] .theme-toggle:hover .icon-sun {
    animation: sun-spin 3s linear infinite;
}

@keyframes sun-spin {
    from { transform: rotate(0deg) scale(1); }
    to { transform: rotate(360deg) scale(1); }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body,
html {
    width: 100%;
    height: 100%;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.4s ease, color 0.4s ease;
}


/* ============================================
   NOISE OVERLAY
   ============================================ */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: var(--noise-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' 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)'/%3E%3C/svg%3E");
    mix-blend-mode: soft-light;
    transition: opacity 0.4s ease;
}

/* ============================================
   PARTICLES CANVAS
   ============================================ */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    animation: fade-in 2s ease 0.5s forwards;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    z-index: 100;
    padding: 2rem;
}

/* ============================================
   LOGO WRAPPER
   ============================================ */
.logo-wrapper {
    position: relative;
    padding: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    width: 100%;
    height: 480px;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.logo-container {
    width: 280px;
    height: 474px;
    cursor: default;
    position: relative;
    perspective: 1200px;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: visible;
}

.logo-container:hover { transform: scale(1.02); }

#main-logo {
    width: 100%;
    height: auto;
    overflow: visible;
}

#main-logo * { overflow: visible; }

.logo-part {
    transform-origin: center;
    transition: filter 0.3s ease;
    will-change: transform, opacity;
}

.logo-container:hover .logo-part {
    filter: brightness(1.1) saturate(1.2);
}

.logo-stroke {
    opacity: 1;
    transition: opacity 0.4s ease, stroke 0.3s ease, filter 0.3s ease;
    pointer-events: none;
    position: relative;
    z-index: 1;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    will-change: stroke-dashoffset, opacity;
}

.logo-container:hover .logo-stroke {
    opacity: 0.6;
    filter: drop-shadow(0 0 3px currentColor);
}


/* ============================================
   CONTENT - Brand Name
   ============================================ */
.content {
    text-align: center;
    margin-top: 3rem;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.brand-name {
    font-weight: 200;
    font-size: 1.6rem;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
    cursor: pointer;
    transition: letter-spacing 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

@media (hover: hover) {
    .brand-name:hover {
        letter-spacing: 0.8em;
        transform: scale(1.05);
    }
}

.brand-name.active {
    letter-spacing: 0.8em;
    transform: scale(1.05);
}

.brand-name .highlight {
    font-weight: 600;
    color: var(--highlight-color);
    display: inline-block;
    transition: color 0.3s ease,
                text-shadow 0.3s ease,
                transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
    .brand-name:hover .highlight {
        color: var(--highlight-color);
        text-shadow: 0 0 12px var(--highlight-glow), 0 0 30px var(--highlight-glow);
        transform: scale(1.15) translateY(-2px);
        animation: bounce-highlight 0.6s ease;
    }
}

.brand-name.active .highlight {
    color: var(--highlight-color);
    text-shadow: 0 0 12px var(--highlight-glow), 0 0 30px var(--highlight-glow);
    transform: scale(1.15) translateY(-2px);
}

@keyframes bounce-highlight {
    0%, 100% { transform: scale(1.15) translateY(-2px); }
    50% { transform: scale(1.25) translateY(-5px); }
}

.brand-sub {
    margin-top: 0.9rem;
    font-size: 0.72rem;
    font-weight: 300;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--text-secondary);
}


/* ============================================
   UTILITY ANIMATIONS
   ============================================ */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   CLICK RADAR EFFECT
   ============================================ */
.radar-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid #fff;
    background: transparent;
    transform: scale(0);
    pointer-events: none;
    opacity: 0;
}

.radar-ring:nth-child(1) { animation: radar-expand-green 1s ease-out forwards; }
.radar-ring:nth-child(2) { animation: radar-expand-pink 1s ease-out 0.08s forwards; }
.radar-ring:nth-child(3) { animation: radar-expand-cyan 1s ease-out 0.16s forwards; }
.radar-ring:nth-child(4) { animation: radar-expand-orange 1s ease-out 0.24s forwards; }

@keyframes radar-expand-green {
    0% { transform: scale(0); opacity: 1; border-color: #fff; }
    40% { border-color: #fff; opacity: 0.8; }
    70% { border-color: #84CC16; opacity: 0.4; }
    100% { transform: scale(3); border-color: #84CC16; opacity: 0; }
}

@keyframes radar-expand-pink {
    0% { transform: scale(0); opacity: 1; border-color: #fff; }
    40% { border-color: #fff; opacity: 0.8; }
    70% { border-color: #F43F5E; opacity: 0.4; }
    100% { transform: scale(3); border-color: #F43F5E; opacity: 0; }
}

@keyframes radar-expand-cyan {
    0% { transform: scale(0); opacity: 1; border-color: #fff; }
    40% { border-color: #fff; opacity: 0.8; }
    70% { border-color: #06B6D4; opacity: 0.4; }
    100% { transform: scale(3); border-color: #06B6D4; opacity: 0; }
}

@keyframes radar-expand-orange {
    0% { transform: scale(0); opacity: 1; border-color: #fff; }
    40% { border-color: #fff; opacity: 0.8; }
    70% { border-color: #F97316; opacity: 0.4; }
    100% { transform: scale(3); border-color: #F97316; opacity: 0; }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .logo-wrapper { padding: 40px; min-height: 400px; }
    .logo-container { width: 220px; height: 372px; }
    .brand-name { font-size: 1.05rem; letter-spacing: 0.3em; }
    .brand-sub { font-size: 0.62rem; letter-spacing: 0.3em; }
    .content { margin-top: 1.5rem; }
}

@media (max-width: 480px) {
    .logo-wrapper { padding: 30px; min-height: 340px; }
    .logo-container { width: 180px; height: 304px; }
    .brand-name { font-size: 0.9rem; letter-spacing: 0.22em; }
    .brand-sub { font-size: 0.55rem; letter-spacing: 0.25em; }
    .content { margin-top: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   SITE FOOTER
   ============================================ */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 1rem 1.5rem;
    z-index: 200;
}

.footer-copy {
    font-size: 0.65rem;
    font-weight: 300;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.site-footer:hover .footer-copy { opacity: 0.85; }

.footer-copy a {
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.footer-copy a:hover {
    color: var(--highlight-color);
    border-bottom-color: var(--highlight-color);
}

/* ============================================
   LOADING STATE
   ============================================ */
body.loaded .logo-container {
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
