/* ══════════════════════════════════════════════════════════════════════
   main.css — Estilos compartidos CoreProject.cl
   ══════════════════════════════════════════════════════════════════════ */

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

/* ── Variables — Tema oscuro (default) ─────────────────────────────── */
:root {
    --bg:        #0c0e14;
    --bg-2:      #11141c;
    --bg-3:      #181c27;
    --border:    rgba(255,255,255,0.07);
    --border-md: rgba(255,255,255,0.12);
    --text:      #e8eaf0;
    --muted:     #7a8099;
    --muted-2:   #4a5068;
    --accent:    #ffffff;
    --accent-dk: #d8dbe8;
    --white:     #ffffff;
}

/* ── Variables — Tema claro ────────────────────────────────────────── */
[data-theme="light"] {
    --bg:        #f5f6fa;
    --bg-2:      #ffffff;
    --bg-3:      #eceef5;
    --border:    rgba(0,0,0,0.09);
    --border-md: rgba(0,0,0,0.15);
    --text:      #1a1d2e;
    --muted:     #5a6280;
    --muted-2:   #9099b8;
    --accent:    #1a1d2e;
    --accent-dk: #2d3150;
    --white:     #1a1d2e;
}

/* ── Overrides generales — Tema claro ──────────────────────────────── */
[data-theme="light"] body { background: var(--bg); color: var(--text); }
[data-theme="light"] #navbar {
    background: rgba(245,246,250,0.98);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
[data-theme="light"] #navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    border-bottom-color: rgba(0,0,0,0.15);
}
[data-theme="light"] #mobile-nav { background: var(--bg-2); }
[data-theme="light"] .nav-links a { color: #3a4060; }
[data-theme="light"] .nav-links a:hover { color: var(--accent); }
[data-theme="light"] .btn-outline { border-color: rgba(0,0,0,0.2); color: var(--accent); }
[data-theme="light"] .btn-outline:hover { background: rgba(0,0,0,0.06); }
[data-theme="light"] .btn-primary { background: #1a1d2e; color: #fff; }
[data-theme="light"] .btn-primary:hover { background: #2d3150; }
[data-theme="light"] .eyebrow { color: var(--muted); }
[data-theme="light"] footer { background: var(--bg-3); }
[data-theme="light"] .footer-links a { color: var(--muted); }
[data-theme="light"] .social-link { background: rgba(0,0,0,0.06); }
[data-theme="light"] .social-link:hover { background: rgba(0,0,0,0.12); }

/* ── Base ───────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Layout ─────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 28px; }
.section    { padding: 80px 0; border-bottom: 1px solid var(--border); }

/* ── Tipografía ─────────────────────────────────────────────────────── */
.eyebrow {
    display: inline-block;
    font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--muted); margin-bottom: 20px;
}
h1, h2, h3, h4 { color: var(--white); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.025em; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { color: var(--muted); line-height: 1.75; }

/* ── Botones ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 600; padding: 13px 24px;
    border-radius: 2px; cursor: pointer;
    transition: opacity .2s, background .2s; border: none;
    font-family: inherit;
}
.btn-primary       { background: #ffffff; color: #0c0e14; }
.btn-primary:hover { background: #d8dbe8; }
.btn-outline       { background: transparent; color: var(--text); border: 1px solid var(--border-md); }
.btn-outline:hover { border-color: rgba(255,255,255,0.25); color: #fff; }

/* ── Toggle de tema ─────────────────────────────────────────────────── */
#theme-toggle {
    width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border-md);
    background: transparent; cursor: pointer; display: flex; align-items: center;
    justify-content: center; font-size: 17px; transition: background .2s, border-color .2s;
    color: var(--muted); flex-shrink: 0;
}
#theme-toggle:hover { background: var(--bg-2); border-color: var(--border-md); }

/* ── Navbar ─────────────────────────────────────────────────────────── */
#navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: 68px;
    background: rgba(12,14,20,0.94);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    transition: box-shadow .3s;
}
#navbar .container { width: 100%; }
.nav-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; }
.nav-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 16px; font-weight: 700; color: var(--white);
    letter-spacing: -0.02em; flex-shrink: 0; white-space: nowrap; justify-self: start;
}
.nav-logo img { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.nav-logo .logo-text { white-space: nowrap; }
.nav-logo .logo-text span { color: var(--white); }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; justify-self: center; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--muted); transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--white); }
.nav-cta { justify-self: end; }
#hamburger { display: none; background: none; border: none; cursor: pointer; color: var(--muted); font-size: 26px; line-height: 1; }
#mobile-nav {
    display: none; position: fixed; top: 68px; left: 0; right: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: 24px 28px 32px; z-index: 99;
}
#mobile-nav.open { display: block; }
#mobile-nav a {
    display: block; padding: 12px 0; font-size: 15px; font-weight: 500;
    color: var(--text); border-bottom: 1px solid var(--border);
}
#mobile-nav a:last-child { border-bottom: none; }
#navbar.scrolled { border-bottom-color: var(--border-md); box-shadow: 0 4px 32px rgba(0,0,0,0.4); }

/* ── Barra de scroll ────────────────────────────────────────────────── */
#scroll-bar {
    position: fixed; top: 0; left: 0; height: 2px;
    background: rgba(255,255,255,0.45); z-index: 300;
    width: 0%; transition: width 0.08s linear;
}

/* ── Footer ─────────────────────────────────────────────────────────── */
footer { background: var(--bg); border-top: 1px solid var(--border); padding: 36px 0; }
.footer-inner {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 20px;
}
.footer-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 15px; font-weight: 700; color: var(--white);
}
.footer-logo img { width: 26px; height: 26px; object-fit: contain; }
.footer-links { display: flex; gap: 24px; list-style: none; }
.footer-links a { font-size: 13px; color: var(--muted); transition: color .2s; }
.footer-links a:hover { color: var(--white); }
.footer-socials { display: flex; gap: 10px; }
.footer-copy { font-size: 12px; color: var(--muted-2); }

/* ── Social links ───────────────────────────────────────────────────── */
.social-link {
    width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); transition: color .25s, border-color .25s,
    transform .3s cubic-bezier(.22,.68,0,1.2), box-shadow .25s, background .25s;
}
.social-link svg { width: 14px; height: 14px; fill: currentColor; }
.social-wa { color: #4ade80; background: rgba(74,222,128,0.07);  border-color: rgba(74,222,128,0.18); }
.social-fb { color: #60a5fa; background: rgba(96,165,250,0.07);  border-color: rgba(96,165,250,0.18); }
.social-ig { color: #f472b6; background: rgba(244,114,182,0.07); border-color: rgba(244,114,182,0.18); }
.social-wa:hover { color: #fff; background: #25d366; border-color: #25d366; transform: translateY(-3px) scale(1.1); box-shadow: 0 8px 20px rgba(37,211,102,0.35); }
.social-fb:hover { color: #fff; background: #1877f2; border-color: #1877f2; transform: translateY(-3px) scale(1.1); box-shadow: 0 8px 20px rgba(24,119,242,0.35); }
.social-ig:hover { color: #fff; background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); border-color: #e1306c; transform: translateY(-3px) scale(1.1); box-shadow: 0 8px 20px rgba(225,48,108,0.35); }

/* ── Reveal on scroll ───────────────────────────────────────────────── */
.reveal {
    opacity: 0; transform: translateY(24px);
    transition: opacity .6s cubic-bezier(.22,.68,0,1.2), transform .6s cubic-bezier(.22,.68,0,1.2);
}
.reveal.from-left  { transform: translateX(-28px); }
.reveal.from-right { transform: translateX(28px); }
.reveal.scale-in   { transform: scale(0.85); opacity: 0; }
.reveal.visible    { opacity: 1; transform: translate(0,0) scale(1); }

/* ── Animaciones compartidas ────────────────────────────────────────── */
@keyframes shimmer    { 0%{background-position:-200% center} 100%{background-position:200% center} }
@keyframes glowPulse  { 0%,100%{box-shadow:0 0 0 0 rgba(255,255,255,0.04)} 50%{box-shadow:0 0 28px 6px rgba(255,255,255,0.07)} }
@keyframes wa-pulse   { 0%{transform:scale(1);opacity:0.4} 100%{transform:scale(1.7);opacity:0} }
@keyframes countPop   { 0%{transform:scale(0.5);opacity:0} 60%{transform:scale(1.15)} 100%{transform:scale(1);opacity:1} }

/* ── Responsive ─────────────────────────────────────────────────────── */

/* Tablet grande (1024px) */
@media (max-width: 1024px) {
    .container { padding: 0 24px; }
    .nav-links { gap: 20px; }
}

/* Tablet (900px) */
@media (max-width: 900px) {
    .nav-links, .nav-cta { display: none; }
    #hamburger { display: block; }
    .nav-inner { grid-template-columns: 1fr auto; }
    .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
    .footer-links { flex-wrap: wrap; gap: 14px; }
}

/* Mobile (600px) */
@media (max-width: 600px) {
    .container  { padding: 0 16px; }
    .section    { padding: 56px 0; }
    .btn        { padding: 12px 20px; font-size: 13px; }
    .footer-socials { gap: 8px; }
}

/* Mobile pequeño (400px) */
@media (max-width: 400px) {
    .container { padding: 0 14px; }
    h1 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
    h2 { font-size: clamp(1.3rem, 5vw, 1.8rem); }
}

/* iOS momentum scroll */
@supports (-webkit-overflow-scrolling: touch) {
    body { -webkit-overflow-scrolling: touch; }
}

/* ── Accesibilidad: sin animaciones ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal, .reveal.from-left, .reveal.from-right, .reveal.scale-in {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    #hero-canvas { display: none !important; }
    #scroll-bar  { display: none !important; }
}
