:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-alt: #eef1f7;
    --ink: #0b1220;
    --muted: #556070;
    --line: #e2e6ef;
    --accent: #2f5bff;
    --accent-2: #12c6d9;
    --accent-ink: #ffffff;
    --grad: linear-gradient(120deg, var(--accent) 0%, #7a5cff 50%, var(--accent-2) 100%);
    --shadow: 0 1px 2px rgb(11 18 32 / .04), 0 8px 24px rgb(11 18 32 / .06);

    /* Bloques oscuros (hero, contacto) en ambos modos */
    --dark: #070b18;
    --dark-ink: #eef2ff;
    --dark-muted: #a3adc2;
    --dark-line: rgb(255 255 255 / .1);

    --sans: "Segoe UI Variable Display", "Segoe UI Variable", "SF Pro Display", -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius: 18px;
    --header-h: 68px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0f1c;
        --surface: #111827;
        --surface-alt: #0d1322;
        --ink: #e9edf6;
        --muted: #9aa5b8;
        --line: #1f2a3d;
        --accent: #6f8dff;
        --accent-2: #3fe0f0;
        --accent-ink: #070b18;
        --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
    }
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: -0.025em; }
p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }

.grad-text {
    background: var(--grad);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
}

.skip {
    position: absolute; left: 16px; top: -48px; z-index: 100;
    background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

/* Header: siempre oscuro y translúcido */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgb(7 11 24 / .72);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid var(--dark-line);
    color: var(--dark-ink);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.mono, .avatar {
    display: inline-grid; place-items: center; flex-shrink: 0;
    background: var(--grad); color: #fff; font-weight: 750; letter-spacing: -0.02em;
}
.mono { width: 36px; height: 36px; border-radius: 10px; font-size: 0.9rem; }
.brand-name { font-weight: 650; letter-spacing: -0.01em; }

.nav { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a { display: block; padding: 8px 14px; border-radius: 999px; color: var(--dark-muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; transition: color .15s, background .15s; }
.nav a:hover { color: #fff; background: rgb(255 255 255 / .08); }
.nav .nav-cta { color: var(--dark); background: #fff; font-weight: 600; }
.nav .nav-cta:hover { color: var(--dark); background: #fff; box-shadow: 0 0 0 4px rgb(255 255 255 / .15); }
.brand-name { white-space: nowrap; }
@media (max-width: 860px) { .nav-optional { display: none; } }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 50px; padding: 12px 24px; border-radius: 999px;
    font-weight: 600; text-decoration: none; border: 1px solid transparent;
    transition: transform .15s ease, box-shadow .2s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(120deg, #2f5bff 0%, #6a4cf0 55%, #0e8fae 100%); color: #fff; box-shadow: 0 8px 24px -8px rgb(47 91 255 / .7); }
.btn-primary:hover { box-shadow: 0 12px 32px -8px rgb(47 91 255 / .9); }
.btn-ghost { color: var(--dark-ink); border-color: rgb(255 255 255 / .2); background: rgb(255 255 255 / .04); }
.btn-ghost:hover { background: rgb(255 255 255 / .1); }
.btn-lg { min-height: 56px; padding: 14px 30px; font-size: 1.05rem; }
.btn svg { width: 18px; height: 18px; }

/* Hero */
.hero {
    position: relative; overflow: hidden; isolation: isolate;
    padding: 96px 0 112px; background: var(--dark); color: var(--dark-ink);
}
.hero::before {
    /* rejilla tenue */
    content: ""; position: absolute; inset: 0; z-index: -1;
    background-image:
        linear-gradient(rgb(255 255 255 / .05) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / .05) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%);
}
.hero::after {
    /* halos de color */
    content: ""; position: absolute; inset: -20% -10% auto; height: 120%; z-index: -2;
    background:
        radial-gradient(40% 50% at 15% 20%, rgb(47 91 255 / .45), transparent 70%),
        radial-gradient(35% 45% at 85% 35%, rgb(18 198 217 / .3), transparent 70%),
        radial-gradient(30% 40% at 55% 90%, rgb(122 92 255 / .3), transparent 70%);
    filter: blur(20px);
}
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; align-items: center; }
.pill {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 14px 6px 10px; border-radius: 999px;
    background: rgb(255 255 255 / .06); border: 1px solid var(--dark-line);
    font-size: 0.82rem; font-weight: 500; color: var(--dark-muted);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 rgb(18 198 217 / .6); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgb(18 198 217 / 0); } 100% { box-shadow: 0 0 0 0 rgb(18 198 217 / 0); } }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); margin: 22px 0 22px; letter-spacing: -0.035em; }
.hero .grad-text { background: linear-gradient(120deg, #8fa8ff 0%, #b39cff 45%, #5fe9f5 100%); -webkit-background-clip: text; background-clip: text; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 38em; }
.hero .lead { color: var(--dark-muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-copy, .dossier { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.dossier { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* Dossier (tarjeta de cristal) */
.dossier {
    position: relative; padding: 28px; border-radius: 22px;
    background: linear-gradient(160deg, rgb(255 255 255 / .1), rgb(255 255 255 / .03));
    border: 1px solid rgb(255 255 255 / .14);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 30px 60px -20px rgb(0 0 0 / .5);
}
.dossier-head { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--dark-line); }
.avatar { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 0 0 2px rgb(255 255 255 / .15); font-size: 1.3rem; object-fit: cover; }
.dossier-name { font-weight: 700; font-size: 1.2rem; letter-spacing: -0.015em; }
.dossier-role { color: var(--dark-muted); font-size: 0.92rem; }
.facts { margin: 0; display: grid; }
.facts > div { padding: 14px 0; border-bottom: 1px solid var(--dark-line); }
.facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dark-muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.facts .big { font-size: 1.6rem; font-weight: 750; letter-spacing: -0.03em; }

/* Sections */
.section { padding: 104px 0; }
.section-alt { background: var(--surface-alt); }
.section-head { margin-bottom: 48px; }
h1, h2 { text-wrap: balance; }
.section-head h2, .contact h2 { font-size: clamp(2rem, 4vw, 2.9rem); margin-top: 14px; letter-spacing: -0.03em; }
.kicker {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
}
.kicker span {
    display: inline-grid; place-items: center; min-width: 28px; height: 22px; padding: 0 6px; border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 12%, transparent); font-variant-numeric: tabular-nums; letter-spacing: 0;
}

.split { display: grid; grid-template-columns: 1fr 1.35fr; gap: 64px; }
.split .section-head { margin-bottom: 0; position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
.prose p + p { margin-top: 1.1em; }
.prose p { color: var(--muted); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose h3 { font-size: 1.1rem; margin: 1.6em 0 0.4em; }
.prose h3:first-child { margin-top: 0; }
.creds-title { font-size: 0.8rem !important; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 2em !important; }
.creds { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.creds li {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line); font-size: 0.92rem; font-weight: 600; box-shadow: var(--shadow);
}
.creds li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--grad); }

/* Cards */
.card {
    position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 30px; box-shadow: var(--shadow);
}
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.cards .card { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.cards .card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 20px 40px -16px rgb(47 91 255 / .35); }
.cards h3 { font-size: 1.5rem; margin: 8px 0 12px; }
.cards p:not(.tag) { color: var(--muted); }
.tag { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.icon {
    display: inline-grid; place-items: center; width: 48px; height: 48px; margin-bottom: 20px;
    border-radius: 14px; color: #fff; background: var(--grad);
    box-shadow: 0 8px 20px -8px rgb(47 91 255 / .7);
}
.icon svg { width: 24px; height: 24px; }
.card-accent { border: 1px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; }
.badge {
    position: absolute; top: 24px; right: 24px; padding: 3px 10px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.activity { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: act; }
.activity li { counter-increment: act; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.activity li::before {
    content: "0" counter(act); display: block; margin-bottom: 18px;
    font-size: 2.4rem; font-weight: 750; letter-spacing: -0.04em; line-height: 1;
    background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.activity h3 { font-size: 1.3rem; margin-bottom: 10px; }
.activity p { color: var(--muted); }

.principles { margin-top: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.principles > div { display: flex; gap: 16px; align-items: flex-start; padding: 24px; border-radius: var(--radius); background: var(--surface-alt); border: 1px solid var(--line); }
.principles .icon { width: 40px; height: 40px; margin: 0; border-radius: 12px; flex-shrink: 0; }
.principles .icon svg { width: 20px; height: 20px; }
.principles h3 { font-size: 1.02rem; margin-bottom: 4px; letter-spacing: -0.01em; }
.principles p { color: var(--muted); font-size: 0.95rem; }

/* Publicaciones */
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.more { font-weight: 600; text-decoration: none; white-space: nowrap; }
.more:hover { text-decoration: underline; }
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.post {
    display: flex; flex-direction: column; gap: 14px; padding: 28px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    color: var(--ink); text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.post:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 20px 40px -16px rgb(47 91 255 / .35); }
.post-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 0.85rem; color: var(--muted); }
.post-meta .tag { font-size: 0.7rem; text-align: right; }
.post h3 { font-size: 1.2rem; line-height: 1.3; letter-spacing: -0.015em; }
.post-excerpt { color: var(--muted); font-size: 0.97rem; flex: 1; }
.post-link { font-weight: 600; color: var(--accent); font-size: 0.95rem; }
.post:hover .post-link { text-decoration: underline; }

/* Contact */
.contact-inner {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; align-items: center; justify-content: space-between; gap: 40px;
    padding: 56px; border-radius: 28px; background: var(--dark); color: var(--dark-ink);
}
.contact-inner::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(50% 80% at 0% 0%, rgb(47 91 255 / .5), transparent 70%),
        radial-gradient(40% 70% at 100% 100%, rgb(18 198 217 / .35), transparent 70%);
}
.contact .kicker { color: #9fb6ff; }
.contact .kicker span { background: rgb(255 255 255 / .1); }
.contact .lead { color: var(--dark-muted); margin-top: 14px; }
.contact .btn-primary { background: #fff; color: var(--dark); box-shadow: 0 8px 24px -8px rgb(0 0 0 / .5); flex-shrink: 0; }

/* Footer */
.site-footer { padding: 32px 0 40px; font-size: 0.9rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* Dialog */
dialog {
    width: min(680px, calc(100% - 32px)); max-height: min(85vh, 820px);
    padding: 0; border: 1px solid var(--line); border-radius: 22px;
    background: var(--surface); color: var(--ink); box-shadow: 0 40px 80px -20px rgb(0 0 0 / .5);
}
dialog::backdrop { background: rgb(7 11 24 / .6); backdrop-filter: blur(4px); }
.dialog-head {
    position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 20px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.dialog-head h2 { font-size: 1.3rem; }
.dialog-body { padding: 24px; }
.muted { font-size: 0.88rem; margin-top: 1.6em; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-alt); color: var(--ink); }

/* Responsive */
@media (max-width: 900px) {
    .hero-grid, .split { grid-template-columns: 1fr; gap: 40px; }
    .split .section-head { position: static; }
    .cards, .activity, .principles, .posts { grid-template-columns: 1fr; }
    .contact-inner { flex-direction: column; align-items: flex-start; padding: 40px 28px; }
}
@media (max-width: 640px) {
    .hero { padding: 56px 0 72px; }
    .section { padding: 72px 0; }
    .actions .btn, .contact .btn { width: 100%; }
}
