/* ============================================================
   LIQUID AURORA — Sistema de diseño neumórfico líquido / biomórfico
   Marcos Castro · Docente de IA & Marketing Digital
   ============================================================ */

:root {
    /* Base */
    --bg:        #08090e;
    --bg-2:      #0b0d14;
    --surface:   #11131c;
    --ink:       #eef1f7;
    --muted:     #9aa2b4;
    --faint:     #5d6478;

    /* Acentos aurora (periwinkle → violeta → teal de la camisa) */
    --a1: #7c8bff;   /* periwinkle indigo */
    --a2: #57e0c9;   /* teal / cyan (camisa) */
    --a3: #b388ff;   /* violeta */
    --a4: #ff8fb1;   /* rosa suave (chispa) */

    --ring: rgba(124,139,255,0.5);

    /* Tipografía */
    --display: 'Bricolage Grotesque', system-ui, sans-serif;
    --body:    'Hanken Grotesk', system-ui, sans-serif;
    --mono:    'Space Grotesk', ui-monospace, monospace;

    /* Radios orgánicos */
    --r-sm: 16px;
    --r:    24px;
    --r-lg: 34px;
    --r-xl: 44px;

    /* Sombra neumórfica líquida (raised) sobre oscuro */
    --raise:
        inset 1.2px 1.2px 0 rgba(255,255,255,0.10),
        inset -1px -1px 1px rgba(0,0,0,0.55),
        0 26px 60px -26px rgba(0,0,0,0.85),
        0 2px 8px rgba(0,0,0,0.4);
    --inset:
        inset 2px 2px 6px rgba(0,0,0,0.6),
        inset -1px -1px 2px rgba(255,255,255,0.05);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--body);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.55;
}

/* Selección */
::selection { background: var(--a1); color: #07080c; }

/* Tipografía base */
.font-display { font-family: var(--display); }
.font-mono    { font-family: var(--mono); }

h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.04; }

.eyebrow {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--a2);
    font-weight: 500;
}

.text-muted { color: var(--muted); }
.text-faint { color: var(--faint); }

/* ============================================================
   FONDO BIOMÓRFICO — aurora + blobs que derivan
   ============================================================ */
.aurora-field {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(1200px 800px at 80% -10%, rgba(124,139,255,0.10), transparent 60%),
        radial-gradient(1000px 700px at 0% 30%, rgba(87,224,201,0.07), transparent 55%),
        var(--bg);
}
.blob {
    position: absolute;
    border-radius: 45% 55% 52% 48% / 55% 45% 55% 45%;
    filter: blur(60px);
    opacity: 0.55;
    mix-blend-mode: screen;
    will-change: transform, border-radius;
}
.blob.b1 { width: 46vw; height: 46vw; left: -8vw;  top: 4vh;
    background: radial-gradient(circle at 30% 30%, var(--a1), transparent 70%);
    animation: morph 22s ease-in-out infinite, drift1 34s ease-in-out infinite; }
.blob.b2 { width: 40vw; height: 40vw; right: -10vw; top: 18vh;
    background: radial-gradient(circle at 60% 40%, var(--a2), transparent 70%);
    animation: morph 26s ease-in-out infinite reverse, drift2 40s ease-in-out infinite; }
.blob.b3 { width: 38vw; height: 38vw; left: 30vw; top: 120vh;
    background: radial-gradient(circle at 50% 50%, var(--a3), transparent 70%);
    animation: morph 30s ease-in-out infinite, drift3 46s ease-in-out infinite; }
.blob.b4 { width: 30vw; height: 30vw; right: 8vw; top: 210vh;
    background: radial-gradient(circle at 40% 60%, var(--a2), transparent 70%);
    animation: morph 24s ease-in-out infinite reverse, drift1 38s ease-in-out infinite; }

/* grano sutil para quitar el aspecto plástico */
.aurora-field::after {
    content: '';
    position: absolute; inset: 0;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes morph {
    0%,100% { border-radius: 45% 55% 52% 48% / 55% 45% 55% 45%; }
    33%     { border-radius: 60% 40% 35% 65% / 40% 60% 45% 60%; }
    66%     { border-radius: 38% 62% 60% 40% / 62% 38% 50% 50%; }
}
@keyframes drift1 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(6vw,5vh) scale(1.12)} }
@keyframes drift2 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-5vw,7vh) scale(0.9)} }
@keyframes drift3 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(4vw,-6vh) scale(1.1)} }

/* Blob que sigue el cursor */
#cursor-glow {
    position: fixed;
    width: 460px; height: 460px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124,139,255,0.18), transparent 65%);
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    transition: opacity .4s ease;
    mix-blend-mode: screen;
    will-change: left, top;
}

/* ============================================================
   SUPERFICIES LÍQUIDAS (liquid glass + neumorfismo)
   ============================================================ */
.liquid {
    position: relative;
    background: linear-gradient(155deg, rgba(255,255,255,0.075), rgba(255,255,255,0.018) 45%, rgba(255,255,255,0.04));
    backdrop-filter: blur(22px) saturate(1.5);
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
    border-radius: var(--r-lg);
    box-shadow: var(--raise);
    border: 1px solid rgba(255,255,255,0.07);
    overflow: hidden;
}
/* brillo especular superior (liquid sheen) */
.liquid::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(120% 70% at 20% -10%, rgba(255,255,255,0.18), transparent 45%);
    pointer-events: none;
    opacity: 0.8;
}
.liquid > * { position: relative; z-index: 1; }

.liquid-soft {
    background: linear-gradient(155deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
    backdrop-filter: blur(14px) saturate(1.3);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    border-radius: var(--r);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.06), 0 14px 34px -20px rgba(0,0,0,0.8);
}

/* Tarjeta interactiva con tilt 3D */
.tilt {
    transform-style: preserve-3d;
    transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease;
    will-change: transform;
}
.tilt:hover { box-shadow: var(--raise), 0 0 0 1px var(--ring), 0 30px 70px -30px rgba(124,139,255,0.4); }
.tilt .tilt-layer { transform: translateZ(36px); }

/* ============================================================
   PÍLDORAS / BADGES / BOTONES
   ============================================================ */
.pill {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .42rem .95rem;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: .76rem; letter-spacing: .02em;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
}

.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--a2);
    box-shadow: 0 0 0 0 rgba(87,224,201,0.6); animation: ping 1.8s ease-out infinite; }
@keyframes ping { 0%{box-shadow:0 0 0 0 rgba(87,224,201,0.55)} 70%,100%{box-shadow:0 0 0 9px rgba(87,224,201,0)} }

/* Botón líquido primario */
.btn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    padding: 1rem 1.7rem;
    border-radius: 999px;
    font-family: var(--body); font-weight: 600; font-size: .95rem;
    cursor: pointer; border: none;
    color: var(--ink);
    transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease;
    will-change: transform;
    overflow: hidden;
    text-decoration: none;
}
.btn-primary {
    color: #07080c;
    background: linear-gradient(135deg, var(--a1), var(--a3) 55%, var(--a2));
    background-size: 180% 180%;
    box-shadow: 0 12px 30px -10px rgba(124,139,255,0.6), inset 0 1px 0 rgba(255,255,255,0.5);
    animation: hue 8s ease infinite;
}
@keyframes hue { 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }
.btn-primary:hover { box-shadow: 0 18px 44px -10px rgba(124,139,255,0.8), inset 0 1px 0 rgba(255,255,255,0.6); }
.btn-ghost {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: var(--raise);
    backdrop-filter: blur(12px);
}
.btn-ghost:hover { background: rgba(255,255,255,0.09); }
/* brillo barrido */
.btn::after {
    content:''; position:absolute; top:0; left:-120%;
    width:60%; height:100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-18deg);
    transition: left .7s cubic-bezier(.19,1,.22,1);
}
.btn:hover::after { left: 140%; }

/* ============================================================
   FOTO BIOMÓRFICA
   ============================================================ */
.morph-frame {
    position: relative;
    aspect-ratio: 1/1;
    animation: morphPhoto 16s ease-in-out infinite;
    background: linear-gradient(155deg, rgba(124,139,255,0.6), rgba(87,224,201,0.5));
    padding: 6px;
    box-shadow: 0 40px 90px -30px rgba(124,139,255,0.45);
}
.morph-frame img { width: 100%; height: 100%; object-fit: cover; display: block;
    border-radius: inherit; filter: saturate(1.06) contrast(1.04); }
@keyframes morphPhoto {
    0%,100% { border-radius: 56% 44% 47% 53% / 50% 56% 44% 50%; }
    25%     { border-radius: 44% 56% 60% 40% / 58% 44% 56% 42%; }
    50%     { border-radius: 50% 50% 40% 60% / 44% 60% 40% 56%; }
    75%     { border-radius: 60% 40% 54% 46% / 52% 42% 58% 48%; }
}

/* anillo orbital */
.orbit { position: absolute; inset: -22px; border: 1px dashed rgba(255,255,255,0.12);
    border-radius: 50%; animation: spin 38s linear infinite; }
.orbit.r { inset: -42px; border-color: rgba(124,139,255,0.16); animation-duration: 54s; animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

/* badge flotante líquido */
.float-badge {
    position: absolute; z-index: 5;
    display: flex; align-items: center; gap: .65rem;
    padding: .7rem .95rem;
    border-radius: 18px;
    background: linear-gradient(155deg, rgba(20,22,32,0.85), rgba(20,22,32,0.6));
    backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 18px 40px -18px rgba(0,0,0,0.9), inset 1px 1px 0 rgba(255,255,255,0.1);
    animation: bob 6s ease-in-out infinite;
}
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
.badge-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: .95rem; flex-shrink: 0; }

/* ============================================================
   REVEAL al hacer scroll
   ============================================================ */
.reveal { opacity: 1; transform: none; }
.reveal.pending { opacity: 0; transform: translateY(38px); transition: opacity .9s cubic-bezier(.2,.8,.2,1), transform .9s cubic-bezier(.2,.8,.2,1); }
.reveal.pending.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .08s; }
.reveal[data-d="2"] { transition-delay: .16s; }
.reveal[data-d="3"] { transition-delay: .24s; }
.reveal[data-d="4"] { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
    .blob, .orbit, .float-badge, .btn-primary, .morph-frame, #cursor-glow { animation: none !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   TEXTO GRADIENTE / DETALLES
   ============================================================ */
.aurora-text {
    background: linear-gradient(110deg, var(--a1), var(--a3) 40%, var(--a2) 80%);
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    animation: hue 9s ease infinite;
}
.caret::after { content:'|'; color: var(--a2); animation: blink 1s steps(1) infinite; -webkit-text-fill-color: var(--a2); }
@keyframes blink { 50% { opacity: 0; } }

/* divisor línea aurora */
.hr-aurora { height:1px; border:0; background: linear-gradient(90deg, transparent, rgba(124,139,255,0.4), rgba(87,224,201,0.4), transparent); }

/* Timeline */
.tl-line { background: linear-gradient(180deg, transparent, rgba(124,139,255,0.5) 12%, rgba(87,224,201,0.4) 88%, transparent); }
.tl-node { box-shadow: 0 0 0 5px rgba(124,139,255,0.14), 0 0 18px rgba(124,139,255,0.5); }

/* Marquee de skills */
.marquee { display: flex; gap: 1rem; width: max-content; animation: scrollx 38s linear infinite; }
.marquee:hover { animation-play-state: paused; }
@keyframes scrollx { to { transform: translateX(-50%); } }
.chip { white-space: nowrap; padding: .55rem 1.1rem; border-radius: 999px; font-family: var(--mono); font-size:.85rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: var(--muted); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #232838; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #313850; }

/* Nav flotante */
#navbar { transition: transform .4s ease, background .4s ease, box-shadow .4s ease; }
.nav-link { position: relative; color: var(--muted); font-size: .9rem; font-weight: 500; text-decoration: none; transition: color .25s; }
.nav-link:hover { color: var(--ink); }
.nav-link::after { content:''; position:absolute; left:0; bottom:-6px; height:2px; width:0; border-radius:2px;
    background: linear-gradient(90deg, var(--a1), var(--a2)); transition: width .3s ease; }
.nav-link:hover::after { width: 100%; }

#navbar.scrolled .liquid-soft { box-shadow: inset 1px 1px 0 rgba(255,255,255,0.08), 0 18px 44px -22px rgba(0,0,0,0.9); }
#video-modal.show { opacity: 1 !important; }

/* Stat number */
.stat-num { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
