/* Fuentes alojadas en el propio sitio (variables, subconjunto latino): sin peticiones a terceros */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../assets/fonts/geist.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("../assets/fonts/jetbrains-mono.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  /* Acento turquesa + violeta azulado (--grad). Para tu marca cambia --accent, --a1 y --accent-ink (texto sobre el acento). */
  --bg: #08090c;
  --surface: #0f1116;
  --surface-2: #151821;
  --text: #eceef3;
  --muted: #9aa1b2;
  --line: rgba(255,255,255,.1);
  --accent: #00e0ff;
  --a1: #7c5cff;
  --grad: linear-gradient(120deg, var(--a1), var(--accent));
  --accent-ink: #05060a;
  --font: "Geist", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-color: #2b303c var(--bg); scrollbar-width: thin; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--accent);
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; }
.progress span { display: block; height: 100%; width: 100%; background: var(--grad); transform: scaleX(0); transform-origin: left; }

main, .footer, .nav { position: relative; z-index: 2; }
.wrap { width: min(1120px, 100% - 48px); margin-inline: auto; }
.mono { font-size: .85rem; color: var(--muted); }

/* NAV */
.nav {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  width: min(1120px, 100% - 32px); z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 10px 20px; border-radius: 999px;
  background: rgba(8,9,12,.88);
}
.nav nav { display: flex; align-items: center; gap: 26px; font-size: .92rem; color: var(--muted); }
.nav nav a { transition: color .2s; }
.nav nav a:hover { color: var(--text); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.logo-img { height: 100px; width: 100px; object-fit: contain; display: block; }
@media (max-width: 640px) { .logo-img { height: 75px; width: 75px; } }
.logo-mark { font-family: var(--mono); color: var(--accent); font-size: .95rem; }

/* BOTONES */
.btn {
  display: inline-block; padding: 14px 28px; border-radius: 999px; border: 0; cursor: pointer;
  font: 600 1rem var(--font); color: var(--accent-ink); background: var(--grad);
  transition: transform .25s var(--ease), background-color .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.1); box-shadow: 0 10px 30px -10px var(--a1); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-sm { padding: 9px 20px; font-size: .9rem; color: var(--accent-ink) !important; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,.22); box-shadow: none; font-weight: 500; }
.btn-ghost:hover { background: rgba(255,255,255,.05); border-color: var(--accent); box-shadow: none; }

/* TIPOGRAFÍA */
.status { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 22px; padding: 7px 14px 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(8,9,12,.7); font-size: .88rem; color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
h1 { font-size: clamp(2.6rem, 7vw, 5.6rem); line-height: 1.02; letter-spacing: -.03em; font-weight: 700; }
h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.08; letter-spacing: -.025em; font-weight: 700; max-width: 18ch; }
h3 { font-size: 1.3rem; margin-bottom: 8px; }
/* El énfasis va en color sólido, no en degradado */
em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 1.15rem; max-width: 56ch; margin-top: 22px; }

/* HERO */
.hero { min-height: 100vh; display: flex; align-items: center; padding-top: 90px; position: relative; }
@media (min-width: 641px) { .hero { padding-top: 160px; } }
.lead, .checks li {
  color: #fff; font-weight: 500;
  text-shadow: 0 0 6px rgba(8,9,12,.95), 0 2px 24px rgba(8,9,12,.9), 0 0 48px rgba(8,9,12,.8);
}
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 36px; }
.split .ch { display: inline-block; will-change: transform; }
.scroll-hint { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scroll-hint span { width: 1px; height: 46px; background: linear-gradient(var(--accent), transparent); animation: drip 2s infinite; }
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* CINTA DE TECNOLOGÍAS */
.marquee { overflow: hidden; border-block: 1px solid var(--line); background: rgba(8,9,12,.92); padding: 18px 0; }
.marquee-track { display: flex; gap: 56px; width: max-content; animation: slide 32s linear infinite; font-size: .95rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.marquee-track span::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-right: 56px; vertical-align: middle; }
@keyframes slide { to { transform: translateX(-50%); } }

/* SECCIONES */
.section { padding: clamp(80px, 14vw, 170px) 0; }
.two { display: grid; grid-template-columns: 1fr 1.1fr; gap: 60px; align-items: center; }

/* SERVICIOS: lista tipográfica con filetes, no tarjetas iguales */
.services { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service { display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: border-color .3s, transform .3s var(--ease); }
.service:hover { border-color: rgba(0,224,255,.5); transform: translateY(-3px); }
.service-head { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.service-head h3 { font-size: 1.35rem; letter-spacing: -.01em; margin: 0; line-height: 1.15; }
.ico { flex: none; box-sizing: content-box; width: 26px; height: 26px; padding: 13px; border-radius: 14px; color: var(--accent); background: rgba(0,224,255,.08); border: 1px solid rgba(0,224,255,.22); }
.service-body p { color: var(--muted); font-size: .96rem; }
.service-body ul { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: .9rem; color: var(--text); }
.service-body li { position: relative; padding-left: 18px; }
.service-body li::before { content: ""; position: absolute; left: 0; top: .72em; width: 10px; height: 1.5px; background: var(--accent); }

/* TARJETAS (portafolio y blog) */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 56px; }
.card {
  position: relative; padding: 28px; border-radius: 16px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .3s, transform .3s var(--ease);
}
a.card:hover { border-color: rgba(0,224,255,.5); transform: translateY(-3px); }
.card p { color: var(--muted); font-size: .96rem; }

/* PORTAFOLIO */
.work { display: flex; flex-direction: column; }
.work-logo {
  display: grid; place-items: center; height: 150px; margin-bottom: 24px; padding: 24px; border-radius: 12px;
  background: #0b0d12; border: 1px solid var(--line);
}
.work-logo.light { background: #f4f6fb; }
.work-logo img { max-width: 100%; max-height: 74px; object-fit: contain; transition: transform .4s var(--ease); }
.work-logo img.small { max-height: 96px; }
.work:hover .work-logo img { transform: scale(1.05); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tags span { font-size: .78rem; padding: 4px 11px; border-radius: 999px; color: var(--muted); border: 1px solid var(--line); }
.visit { margin-top: auto; padding-top: 22px; font-size: .92rem; font-weight: 500; color: var(--text); transition: color .25s; }
a.work:hover .visit { color: var(--accent); }

/* CÓDIGO */
.checks { margin-top: 28px; display: grid; gap: 12px; }
.checks li { padding-left: 32px; position: relative; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .3em; width: 20px; height: 20px; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.terminal { border-radius: 16px; border: 1px solid var(--line); background: #0a0c10; box-shadow: 0 30px 60px -24px rgba(0,0,0,.7); overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2c313d; }
.term-bar span { margin-left: 10px; font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.terminal pre { padding: 24px; min-height: 340px; font-family: var(--mono); font-size: .88rem; line-height: 1.75; white-space: pre-wrap; }
.tk-k { color: #f2f4f8; font-weight: 600; } .tk-s { color: var(--accent); } .tk-f { color: #c9d1e0; } .tk-c { color: #6b7284; } .tk-n { color: #e6c07b; }
.caret { display: inline-block; width: 8px; height: 1.1em; vertical-align: -.2em; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* PROCESO: línea de tiempo, no cuatro cajas */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 56px; }
.steps li { padding: 28px 24px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); position: relative; }
.steps b { display: block; font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.steps h3 { margin-top: 14px; }
.steps p { color: var(--muted); font-size: .95rem; }

/* RESULTADOS: una franja, no cuatro cajas centradas */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 56px; }
.stat { padding: 34px 24px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: center; }
.stat strong { display: block; font-size: clamp(2.4rem, 5vw, 3.8rem); line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: .95rem; }
.note { margin-top: 20px; font-size: .82rem; color: var(--muted); }

/* CONTACTO */
.contact .wrap { max-width: 760px; text-align: center; }
.contact h2, .contact .lead { margin-inline: auto; }
.form { margin-top: 44px; display: grid; gap: 14px; text-align: left; }
.form input, .form select, .form textarea {
  width: 100%; padding: 16px 18px; border-radius: 12px; border: 1px solid rgba(255,255,255,.16);
  background: var(--surface); color: var(--text); font: inherit; transition: border-color .25s, background-color .25s;
}
.form input:hover, .form select:hover, .form textarea:hover { border-color: rgba(255,255,255,.3); }
.form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.form input::placeholder, .form textarea::placeholder { color: #aab0bf; opacity: 1; }
.form select option { background: #0f1116; color: #fff; }
.form .btn { justify-self: center; margin-top: 8px; }

.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; align-items: center; padding: 26.5px clamp(20px, 5vw, 60px); border-top: 1px solid var(--line); background: rgba(8,9,12,.88); color: var(--muted); font-size: .88rem; }

/* CONSENTIMIENTO Y ENLACES LEGALES */
.consent { display: flex; align-items: flex-start; gap: 12px; font-size: .88rem; color: var(--text); line-height: 1.5; cursor: pointer; }
.consent input { width: 20px; height: 20px; flex: none; margin-top: 2px; padding: 0; accent-color: var(--accent); cursor: pointer; }
.consent a, .footer-legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.footer-legal { display: flex; gap: 18px; margin-top: 6px; flex-wrap: wrap; font-size: .85rem; }
.footer-legal a { color: var(--muted); text-decoration: none; }
.footer-legal a:hover { color: var(--text); }

/* PÁGINAS LEGALES Y ARTÍCULOS */
.legal-page { background: var(--bg); }
.legal-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px clamp(20px, 5vw, 60px); border-bottom: 1px solid var(--line); font-size: .92rem; color: var(--muted); position: sticky; top: 0; background: rgba(8,9,12,.94); z-index: 5; }
.legal-bar a:hover { color: var(--text); }
.legal-bar .back { color: var(--accent); }
.legal { width: min(780px, 100% - 40px); margin: 0 auto; padding: 70px 0 90px; }
.legal h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 8px; }
.legal .meta { font-size: .86rem; color: var(--muted); margin-bottom: 36px; }
.legal h2 { font-size: 1.6rem; max-width: none; margin: 38px 0 12px; letter-spacing: 0; color: #fff; }
.legal p, .legal li { color: #d2d5e0; font-size: 1rem; margin-bottom: 12px; max-width: 72ch; }
.legal ul { list-style: disc; padding-left: 22px; margin-bottom: 12px; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.todo { background: rgba(182,255,60,.16); color: var(--accent); padding: 1px 6px; border-radius: 6px; font-size: .95em; }
.legal-foot { text-align: center; padding: 28px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }

.social { display: flex; gap: 12px; }
.social a {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  color: var(--text); border: 1px solid var(--line); background: rgba(255,255,255,.03);
  transition: transform .25s var(--ease), color .25s, border-color .25s;
}
.social a svg { width: 20px; height: 20px; }
.social a:hover { transform: translateY(-3px); color: var(--accent); border-color: var(--accent); }

/* RESPONSIVO */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two { grid-template-columns: 1fr; }
  .services { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .nav nav a:not(.btn) { display: none; }
  .grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .status { margin-top: 25px; }
  .nav { top: 8px; }
}

/* BLOG (inicio) */
.blog-card { padding: 0; display: flex; flex-direction: column; color: inherit; }
.blog-card img { display: block; width: calc(100% - 52px); aspect-ratio: 1 / 1; height: auto; object-fit: cover; margin: 26px 26px 0; border-radius: 10px; border: 1px solid var(--line); transition: transform .5s var(--ease); }
.blog-card:hover img { transform: scale(1.03); }
.blog-card { overflow: hidden; }
.blog-body { padding: 20px 26px 26px; display: flex; flex-direction: column; flex: 1; position: relative; }
.blog-body h3 { font-size: 1.12rem; line-height: 1.3; }
.blog-tag { font-size: .8rem; font-weight: 500; color: var(--muted); margin-bottom: 10px; }
.blog-card:hover .visit { color: var(--accent); }

/* ARTÍCULOS */
.post { width: min(760px, 100% - 40px); }
.post .crumbs { font-size: .82rem; color: var(--muted); margin-bottom: 22px; }
.post .crumbs a:hover { color: var(--text); }
.post h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.12; }
.post .cover { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); margin: 6px 0 28px; display: block; }
.post .intro p { font-size: 1.08rem; color: #e6e8f0; }
.post section { scroll-margin-top: 90px; }
.post ol { padding-left: 22px; margin-bottom: 12px; }
.post ol li { list-style: decimal; }
.post strong { color: #fff; }
.toc { margin: 28px 0 10px; padding: 22px 26px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.toc strong { display: block; font-size: .95rem; margin-bottom: 10px; }
.toc ol { margin: 0; }
.toc li { margin-bottom: 6px; font-size: .96rem; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; text-underline-offset: 3px; }
.faq-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.faq-item h3 { font-size: 1.05rem; margin-bottom: 6px; color: #fff; }
.faq-item p { margin-bottom: 0; }
.post-cta { margin: 46px 0; padding: 32px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); text-align: center; }
.post-cta h2 { margin: 0 auto 10px; text-align: center; }
.post-cta p { max-width: 52ch; margin: 0 auto 20px; }
.post-cta .btn { color: var(--accent-ink); text-decoration: none; }
.related h2 { margin-top: 10px; }
.rel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rel { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-decoration: none !important; transition: border-color .25s, transform .25s var(--ease); }
.rel:hover { border-color: rgba(0,224,255,.5); transform: translateY(-3px); }
.rel span { font-size: .78rem; font-weight: 500; color: var(--muted); }
.rel strong { font-size: .92rem; line-height: 1.35; font-weight: 500; color: var(--text); }
.legal-foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 720px) { .rel-grid { grid-template-columns: 1fr; } }
.post em { font-style: italic; color: inherit; }
.toc ol { list-style: none; padding-left: 0; }
.toc li { list-style: none; }

/* SLIDERS SOLO EN MÓVIL (servicios, proceso, portafolio y blog) */
.slider-dots { display: none; }
@media (max-width: 640px) {
  .portfolio, .blog-grid, .services, .steps {
    display: flex; gap: 14px; grid-template-columns: none;
    overflow-x: auto; overflow-y: hidden;
    margin-inline: -24px; padding: 4px 24px 14px; scroll-padding-inline: 24px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain; scrollbar-width: none;
  }
  .portfolio::-webkit-scrollbar, .blog-grid::-webkit-scrollbar, .services::-webkit-scrollbar, .steps::-webkit-scrollbar { display: none; }
  .portfolio > .card, .blog-grid > .card, .services > .service, .steps > li { flex: 0 0 82%; max-width: 340px; scroll-snap-align: start; }
  .blog-grid > .card.blog-card img { margin-top: 13px; }
  .blog-grid > .card.blog-card .blog-body { padding-bottom: 14px; }
  .slider-dots { display: flex; justify-content: center; gap: 8px; margin-top: 6px; }
  .slider-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; background: rgba(255,255,255,.28); cursor: pointer; transition: background .3s; }
  .slider-dots button.on { width: 24px; background: var(--accent); }
}

/* ACCESIBILIDAD: enlace para saltar al contenido */
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 18px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; transition: top .2s; }
.skip:focus { top: 14px; }

/* HERO: entrada con CSS puro para que el texto pinte sin esperar a JavaScript */
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
@keyframes slide-up { from { transform: translateY(22px); } }
.hero .status, .hero .cta { animation: rise .6s var(--ease) both; }
/* h1 y párrafo: solo se mueven (sin opacidad) para que cuenten como pintados desde el primer cuadro (LCP) */
.hero h1, .hero .lead { animation: slide-up .6s var(--ease) both; }
.hero .cta { animation-delay: .15s; }

/* Respaldo del fondo cuando no hay GPU: un solo resplandor suave del acento, casi sin costo */
body.no3d #scene { display: none; }
body.no3d { background:
  radial-gradient(55% 45% at 78% 22%, rgba(124,92,255,.12), transparent 70%),
  var(--bg);
  background-attachment: fixed; }

/* Menos movimiento si el sistema lo pide (las animaciones de CSS; las de scroll las gobierna js/config.js) */
@media (prefers-reduced-motion: reduce) {
  .marquee-track, .caret, .scroll-hint span { animation: none; }
  .hero .status, .hero .cta, .hero h1, .hero .lead { animation: none; }
  html { scroll-behavior: auto; }
}

/* Puntos de la consola y tarjetas semitransparentes */
.term-bar i:nth-child(1) { background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.card, .service, .steps li, .stat { background: rgba(15,17,22,.82); }
