/* ==========================================================================
   PSYCHO — Sistema visual compartido (páginas públicas)
   Tokens, reset, cabecera, pie de página y botones.
   ========================================================================== */

:root {
    --bg: #0a0a0c;
    --surface: #131316;
    --surface-2: #1b1b20;
    --surface-3: #25252b;
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .16);

    --text: #f6f6f8;
    --muted: #a6a6b0;
    --subtle: #85858f;

    --accent: #b794ff;
    --accent-strong: #8b5cf6;
    --accent-soft: rgba(183, 148, 255, .12);
    --success: #5ee0a0;
    --success-soft: rgba(94, 224, 160, .12);
    --warning: #f5c56b;
    --warning-soft: rgba(245, 197, 107, .1);
    --danger: #ff7b7b;
    --danger-soft: rgba(255, 123, 123, .1);

    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --gutter: clamp(20px, 4vw, 40px);
    --page: 1240px;
    --header-h: 72px;

    --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --raise: inset 0 1px 0 rgba(255, 255, 255, .05), 0 24px 60px -36px rgba(0, 0, 0, .9);
    --brand: linear-gradient(96deg, #a3b4ff 0%, #e56cf1 54%, #a974ff 100%);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    background: var(--bg);
    color-scheme: dark;
    overflow-x: clip;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
strong, b { font-weight: 600; color: var(--text); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

::selection { background: rgba(139, 92, 246, .45); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border: 3px solid var(--bg);
    border-radius: 999px;
}

.eyebrow {
    display: inline-block;
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .01em;
}

/* --------------------------------------------------------------------------
   Cabecera
   -------------------------------------------------------------------------- */

.site-header {
    position: fixed;
    inset: 12px 0 auto;
    z-index: 50;
    padding: 0 var(--gutter);
    pointer-events: none;
}

.site-header-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: var(--page);
    height: calc(var(--header-h) - 12px);
    margin: 0 auto;
    padding: 0 10px 0 20px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(19, 19, 23, .58);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 14px 40px -18px rgba(0, 0, 0, .7);
    pointer-events: auto;
    -webkit-backdrop-filter: saturate(170%) blur(20px);
    backdrop-filter: saturate(170%) blur(20px);
    transition: background-color .3s var(--ease), border-color .3s var(--ease);
}

.site-header.scrolled .site-header-inner,
.site-header.solid .site-header-inner {
    background: rgba(19, 19, 23, .82);
    border-color: var(--line-strong);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-self: start;
}

.logo-mark {
    position: relative;
    flex: none;
    width: 26px;
    height: 34px;
    overflow: hidden;
}

.logo-mark img {
    position: absolute;
    top: 0;
    left: 50%;
    width: auto;
    max-width: none;
    height: 52px;
    transform: translateX(-50%);
}

.logo-word {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .18em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-nav button,
.site-nav a {
    padding: 7px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 450;
    transition: color .2s, background-color .2s;
}

.site-nav button:hover,
.site-nav a:hover { color: var(--text); }

.site-nav button.active,
.site-nav a.active {
    background: rgba(255, 255, 255, .07);
    color: var(--text);
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.header-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 15px;
    cursor: pointer;
    transition: color .2s, background-color .2s;
}

.header-icon:hover {
    background: rgba(255, 255, 255, .07);
    color: var(--text);
}

.nav-toggle { display: none; }

.header-cta {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--text);
    color: #0a0a0c;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color .2s;
}

.header-cta:hover { background: #fff; }

.mobile-menu { display: none; position: relative; }
.mobile-menu summary { list-style: none; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu .fa-xmark { display: none; }
.mobile-menu[open] .fa-bars { display: none; }
.mobile-menu[open] .fa-xmark { display: block; }

.mobile-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    display: grid;
    gap: 2px;
    width: 220px;
    padding: 8px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}

.mobile-menu-panel a {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 15px;
}

.mobile-menu-panel a:hover,
.mobile-menu-panel a.active {
    background: var(--surface-2);
    color: var(--text);
}

/* --------------------------------------------------------------------------
   Pie de página: comparte el fondo con la página para una unión continua
   -------------------------------------------------------------------------- */

.footer {
    position: relative;
    margin-top: auto;
    overflow: hidden;
    background: var(--bg);
}

/* Cierre de marca: las letras reales del logo se disuelven en el fondo */
.footer::after {
    content: "";
    display: block;
    width: min(calc(100% - var(--gutter) * 2), var(--page));
    aspect-ratio: 980 / 138;
    margin: 4px auto -2.2%;
    background: url(/assets/main/wordmark.svg) center / contain no-repeat;
    opacity: .9;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .13) 0%, rgba(0, 0, 0, .035) 62%, transparent 96%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, .13) 0%, rgba(0, 0, 0, .035) 62%, transparent 96%);
    pointer-events: none;
}

.footer-container {
    width: 100%;
    max-width: calc(var(--page) + var(--gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--gutter) 26px;
}

.footer-top {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr);
    gap: 48px;
    padding: 56px 0 48px;
    border-top: 1px solid var(--line);
}

.footer-brand .logo { margin-bottom: 14px; }

.footer-brand p {
    max-width: 300px;
    color: var(--muted);
    font-size: 14px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.footer-links h4 {
    margin-bottom: 14px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
}

.footer-links a {
    display: block;
    width: fit-content;
    padding: 4px 0;
    color: var(--muted);
    font-size: 14px;
    transition: color .2s;
}

.footer-links a:hover { color: var(--text); }

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    color: var(--subtle);
    font-size: 13px;
}

.footer-socials {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.footer-socials a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    transition: color .2s;
}

.footer-socials a:hover { color: var(--text); }
.footer-socials i { font-size: 14px; }

/* --------------------------------------------------------------------------
   Responsive y movimiento reducido
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
    :root { --header-h: 64px; }

    .site-header-inner { grid-template-columns: 1fr auto; padding: 0 6px 0 16px; }
    .nav-toggle { display: inline-flex; }
    .mobile-menu { display: block; }
    .header-cta { display: none; }

    .site-nav {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        width: 220px;
        padding: 8px;
        border: 1px solid var(--line-strong);
        border-radius: var(--radius);
        background: var(--surface);
        box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
    }

    .site-nav.open { display: flex; }

    .site-nav button,
    .site-nav a {
        padding: 10px 12px;
        border-radius: var(--radius-sm);
        font-size: 15px;
        text-align: left;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 36px;
        padding-top: 44px;
    }
}

@media (max-width: 480px) {
    .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@keyframes spin {
    to { rotate: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
