/* ============================================
   soyjuli.com — CSS base del sitio publico
   Estilo: oscuro, minimalista, tipografia fina
   tipo SpaceX / Google / Apple (Inter).
   Este archivo NO lleva el fondo animado del
   home (esta en fondo-animado.css).
   Los design tokens viven en tokens.css (compartido
   con el admin): cargar tokens.css antes que este.
   ============================================ */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: var(--font);
  background: #000;
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-weight: 300;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; color: inherit; background: none; border: none; }

/* --- Progress bar --- */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #fff, #666);
  z-index: 40;
  transition: width 0.1s linear;
}

/* --- Nav (SpaceX-like, fina y espaciada) --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 26px 40px;
  transition: background 0.4s, backdrop-filter 0.4s, padding 0.4s;
}
.nav.scrolled {
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-line-soft);
  padding: 14px 40px;
}
.nav .brand {
  display: flex;
  justify-self: start;
  align-items: center;
  gap: 10px;
  font-size: .95rem;
  font-weight: 300;
  letter-spacing: .35em;
  text-transform: uppercase;
}
.nav .brand img { width: 28px; height: 28px; }
.nav .links { display: flex; justify-self: center; gap: 34px; }
.nav .links a {
  font-size: .74rem;
  font-weight: 300;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--color-soft);
  padding: 4px 0;
  position: relative;
  transition: color .3s;
}
.nav .links a::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 1px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s;
}
.nav .links a:hover,
.nav .links a.active { color: #fff; }
.nav .links a:hover::after,
.nav .links a.active::after { transform: scaleX(1); transform-origin: left; }
.nav .clock-wrap {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 8px;
  color: #777;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}
.nav .live-dot {
  width: 6px; height: 6px;
  background: #00e68a;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.nav .clock { letter-spacing: .25em; }

/* --- Burger (mobile) --- */
.burger {
  display: none;
  position: fixed;
  top: 18px; right: 20px;
  z-index: 35;
  width: 44px; height: 44px;
}
.burger span {
  display: block;
  width: 26px; height: 2px;
  background: #fff;
  margin: 6px auto;
  transition: transform .35s, opacity .35s;
}
.burger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* --- Menu movil --- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0,0,0,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s;
}
.menu.open { opacity: 1; pointer-events: auto; }
.menu a {
  font-size: 1.4rem;
  font-weight: 200;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: #fff;
}
.menu a:active { color: #999; }
body.menu-open { overflow: hidden; }

/* --- Layout --- */
.section {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px;
  position: relative;
  z-index: 2;
  text-align: center;
}
.content { width: 100%; max-width: 1100px; margin: 0 auto; }
.wide { width: 100%; max-width: 1100px; margin: 0 auto; }

/* --- Hero (home) --- */
.hero-inner { position: relative; z-index: 1; width: 100%; max-width: 1100px; margin: 0 auto; }
.kicker {
  font-size: .74rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 28px;
  font-weight: 300;
}
.kicker b { font-weight: 300; color: #fff; }
.hero-logo-wrap {
  position: relative;
  display: inline-block;
  width: min(380px, 70vw);
}
.hero-logo-wrap .hero-logo {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}

/* --- Glitch del logo (RGB split + cortes, estilo hacker) --- */
.hero-logo-wrap::before,
.hero-logo-wrap::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: url("/logos/logo-blanco.png") center / contain no-repeat;
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  will-change: transform, opacity, clip-path;
}
.hero-logo-wrap::before {
  filter: brightness(0) invert(1) sepia(1) saturate(10000%) hue-rotate(320deg);
  animation: glitch-r 3.8s infinite;
}
.hero-logo-wrap::after {
  filter: brightness(0) invert(1) sepia(1) saturate(10000%) hue-rotate(160deg);
  animation: glitch-c 3.8s infinite;
}

@keyframes glitch-r {
  0%, 24%, 41%, 58%, 89%, 100% { opacity: 0; transform: none; clip-path: none; }
  25%  { opacity: .65; transform: translate(-7px, 1px); }
  27%  { opacity: .7;  transform: translate(-4px, -2px); clip-path: polygon(0 12%, 100% 12%, 100% 26%, 0 26%); }
  29%  { opacity: 0; transform: translate(-7px, 1px); clip-path: none; }
  90%  { opacity: .65; transform: translate(-7px, 2px); }
  92%  { opacity: .75; transform: translate(-5px, -1px); clip-path: polygon(0 58%, 100% 58%, 100% 72%, 0 72%); }
  94%  { opacity: .7;  transform: translate(-8px, 2px); clip-path: polygon(0 34%, 100% 34%, 100% 41%, 0 41%); }
  96%  { opacity: 0; transform: none; clip-path: none; }
}

@keyframes glitch-c {
  0%, 24%, 41%, 58%, 89%, 100% { opacity: 0; transform: none; clip-path: none; }
  25%  { opacity: .65; transform: translate(7px, -1px); }
  27%  { opacity: .7;  transform: translate(4px, 2px); clip-path: polygon(0 46%, 100% 46%, 100% 60%, 0 60%); }
  29%  { opacity: 0; transform: translate(7px, -1px); clip-path: none; }
  90%  { opacity: .65; transform: translate(7px, -2px); }
  92%  { opacity: .75; transform: translate(5px, 1px); clip-path: polygon(0 6%, 100% 6%, 100% 18%, 0 18%); }
  94%  { opacity: .7;  transform: translate(8px, -1px); clip-path: polygon(0 70%, 100% 70%, 100% 84%, 0 84%); }
  96%  { opacity: 0; transform: none; clip-path: none; }
}
.hero-sub {
  color: #e5e5e5;
  font-size: clamp(.95rem, 2vw, 1.2rem);
  font-weight: 200;
  letter-spacing: .08em;
  margin-top: 26px;
}

/* --- Efecto Hacker en texto del hero (kicker y sub) --- */
.hx-char {
  display: inline;
}
.hx-live .hx-glitch {
  color: #6dff9c;
  text-shadow: 0 0 10px rgba(109,255,156,.7);
}
.hx-char.hx-on {
  color: #fff;
  opacity: 1;
  text-shadow: 0 0 8px rgba(109,255,156,.3);
}

/* --- Scroll hint --- */
.scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: .62rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.scroll-hint .wheel {
  width: 1px; height: 46px;
  background: linear-gradient(#999, transparent);
  animation: drop 2s cubic-bezier(.22,1,.36,1) infinite;
  transform-origin: top;
}
@keyframes drop {
  0% { transform: scaleY(0); }
  55% { transform: scaleY(1); }
  56% { transform-origin: bottom; }
  100% { transform: scaleY(0); }
}

/* --- Tipografia general --- */
.num {
  font-size: .72rem;
  font-weight: 300;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 18px;
}
.big-title {
  font-size: clamp(1.8rem, 5.5vw, 3.4rem);
  font-weight: 200;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.1;
  color: #fff;
}
.desc {
  color: #ddd;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 200;
  line-height: 1.7;
  margin-top: 24px;
}
.desc a { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.line {
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  margin: 40px auto 0;
}
.narrow .line { margin: 32px 0; }

/* --- Stats --- */
.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 60px;
  margin-top: 60px;
}
.stat { min-width: 130px; }
.stat .value {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 200;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.stat .cap {
  font-size: .68rem;
  font-weight: 300;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-top: 10px;
}

/* --- CTA --- */
.cta {
  display: inline-block;
  margin-top: 40px;
  padding: 16px 42px;
  font-size: .78rem;
  font-weight: 300;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: #fff;
  border: 1px solid #fff;
  transition: background .3s, color .3s;
}
.cta:hover { background: #fff; color: #000; }

/* fila de CTAs (hero): wrappea sin saltar el margin default */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}
.cta-row .cta { margin-top: 0; }
.cta-solid { background: #fff; color: #000; }
.cta-solid:hover { background: #000; color: #fff; }

/* --- Tags (etiquetas de post) --- */
.tag {
  display: inline-block;
  font-size: .62rem;
  font-weight: 300;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #999;
  border: 1px solid var(--color-line);
  padding: 6px 14px;
}

/* --- Catálogo (proyectos y blog comparten el mismo componente) --- */
.post-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 60px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 32px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: rgba(17,17,19,0.9);
  transition: border-color .3s, transform .3s, box-shadow .3s;
  position: relative;
  overflow: hidden;
  text-align: left;
  font-weight: 300;
}
.card:hover {
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px -8px rgba(0,0,0,0.6);
}
.card .feature-heading { margin-bottom: 16px; }
.card .feature-title {
  font-size: 1.125rem;
  font-weight: 300;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #fff;
  overflow-wrap: break-word;
  line-height: 1.3;
}
.card .feature-meta {
  font-size: .62rem;
  font-weight: 300;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 6px;
}
.card .feature-desc {
  font-size: .9375rem;
  font-weight: 200;
  color: var(--color-soft);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .feature-image-container {
  aspect-ratio: 16/9;
  border: 1px solid var(--color-line-soft);
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0b;
  margin-top: auto;
}
.card .feature-image {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .85;
  transition: opacity .3s, transform .3s;
}
.card:hover .feature-image { opacity: 1; transform: scale(1.02); }
.card-cta {
  margin-top: 4px;
  font-size: .7rem;
  font-weight: 300;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.card .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
}

/* --- Search --- */
.search-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 480px;
  margin: 48px auto 0;
}
.search-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: .875rem;
  font-family: var(--font);
  color: #fff;
  font-weight: 300;
  letter-spacing: .04em;
  outline: none;
  transition: border-color .3s, background .3s;
}
.search-input::placeholder { color: #555; }
.search-input:focus { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.25); }

/* Dropdown nativo del <select> en tema oscuro (por si aparece alguno) */
select option {
  background: #121216;
  color: #e5e5e5;
}
select option:checked { background: #1a1a20; color: #00e68a; }
.search-count {
  font-size: .65rem;
  font-weight: 300;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--color-muted);
  white-space: nowrap;
}
.empty {
  color: #555;
  font-weight: 200;
  text-align: center;
  padding: 70px 20px;
  letter-spacing: .1em;
}

/* --- Detalle de post/proyecto (plantilla moderna) --- */
.narrow { width: 100%; max-width: 1100px; margin: 0 auto; text-align: left; }
.label {
  font-size: .68rem; font-weight: 300; letter-spacing: .3em;
  text-transform: uppercase; color: var(--color-muted); margin-bottom: 14px;
}
.title {
  font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 200;
  letter-spacing: .04em; text-transform: uppercase; line-height: 1.15; color: #fff;
}
.subtitle { color: var(--color-soft); font-weight: 200; margin-top: 18px; font-size: 1.05rem; line-height: 1.7; }

/* --- Portada del post (detalle) --- */
.post-cover {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border: 1px solid var(--color-line-soft);
  border-radius: var(--radius);
  background: #0a0a0b;
  margin: 0 0 36px;
}
.post-cover .post-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Entry (contenido de posts) --- */
.entry {
  text-align: left;
  color: #ddd;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  font-weight: 200;
  line-height: 1.8;
}
.entry h2 {
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  margin: 48px 0 14px;
}
.entry h3 {
  font-size: 1.2rem;
  font-weight: 300;
  color: #fff;
  margin: 36px 0 12px;
}
.entry p { margin: 14px 0; }
.entry ul, .entry ol { margin: 14px 0; padding-left: 1.4em; }
.entry li { margin-bottom: 6px; }
.entry code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .9em;
  background: rgba(255,255,255,0.07);
  padding: 2px 6px;
  border-radius: 4px;
}
.entry pre {
  border: 1px solid var(--color-line);
  background: #0a0a0a;
  border-radius: 8px;
  padding: 18px;
  overflow-x: auto;
  margin: 20px 0;
  font-size: .85rem;
  line-height: 1.6;
}
.entry pre code { background: none; padding: 0; }
.entry a { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.entry strong { color: #fff; font-weight: 400; }
.entry img:not(.post-cover-img) { border-radius: 8px; margin: 24px 0; }
.entry hr { border: none; border-top: 1px solid var(--color-line-soft); margin: 32px 0; }
.entry blockquote {
  border-left: 2px solid rgba(255,255,255,0.15);
  padding-left: 20px;
  margin: 24px 0;
  color: #888;
}

/* --- Footer --- */
footer {
  z-index: 2;
  text-align: center;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: #888;
  padding: 40px 16px;
  font-size: .65rem;
  font-weight: 300;
  position: relative;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.footer-inner span { color: #666; }

/* --- Loader global de pagina --- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .5s ease, visibility .5s ease;
}
#loader .loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}
#loader .loader-logo {
  width: 84px;
  height: 84px;
  opacity: .92;
  animation: loader-breathe 2.2s ease-in-out infinite;
}
#loader .loader-bar {
  width: 180px;
  height: 1px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
  position: relative;
}
#loader .loader-bar i {
  position: absolute;
  top: 0; left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  animation: loader-scan 1.3s cubic-bezier(.22,1,.36,1) infinite;
}
#loader.loader-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
@keyframes loader-breathe {
  0%, 100% { opacity: .55; transform: scale(1); }
  50% { opacity: .95; transform: scale(1.05); }
}
@keyframes loader-scan {
  0% { left: -40%; }
  100% { left: 100%; }
}
html.pg-loading { overflow: hidden; }
html.pg-loading [data-reveal] { transition: none !important; }

/* --- Reveal on scroll --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .9s cubic-bezier(.22,1,.36,1), transform .9s cubic-bezier(.22,1,.36,1);
}
[data-reveal].on { opacity: 1; transform: none; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .post-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .post-list { grid-template-columns: 1fr; }
  .nav { padding: 22px 20px; }
  .nav.scrolled { padding: 14px 20px; }
  .nav .links, .nav .clock { display: none; }
  .burger { display: block; }
  .section { padding: 84px 20px; }
  .kicker { font-size: .6rem; letter-spacing: .28em; line-height: 1.9; }
  .hero-sub { font-size: .95rem; margin-top: 20px; line-height: 1.7; }
  .num { letter-spacing: .2em; }
  .big-title { font-size: clamp(1.6rem, 8vw, 2.4rem); letter-spacing: .03em; }
  .desc { font-size: 1rem; line-height: 1.65; }
  .cta { width: 100%; max-width: 340px; padding: 16px 24px; display: block; margin: 40px auto 0; }
  .menu a { font-size: clamp(1.1rem, 5.5vw, 1.4rem); letter-spacing: .18em; }
  .stat .cap { letter-spacing: .22em; }
  .stats { gap: 36px; margin-top: 48px; }
  .stat { min-width: 100px; }
  [data-reveal] { opacity: 1; transform: none; }
}

@media (max-height: 560px) { .scroll-hint { display: none; } }

@media (max-width: 420px) { .stats { flex-direction: column; gap: 34px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
