/* ============================================
   AI99 Serie — Hoja de estilos principal
   Paleta: #070A0F (negro), #00FF41 (verde terminal),
           #1A2A4A (azul acero), #C8832A (ámbar), #F0F4F8 (blanco)
   ============================================ */

/* --- Reset básico --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* --- Variables --- */
:root {
  --negro:   #070A0F;
  --verde:   #00FF41;
  --azul:    #1A2A4A;
  --ambar:   #C8832A;
  --blanco:  #F0F4F8;
  --gris:    #A8B4C0;
  --gris2:   #1E2530;
  --fuente-mono: 'Courier New', Courier, monospace;
  --fuente-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --max-w: 900px;
  --radius: 4px;
}

/* --- Base --- */
body {
  background: var(--negro);
  color: var(--blanco);
  font-family: var(--fuente-sans);
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100vh;
}

/* --- Tipografía --- */
h1, h2, h3, h4 {
  font-family: var(--fuente-mono);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.2rem, 6vw, 3.5rem); color: var(--blanco); }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); color: var(--verde); margin-bottom: 1rem; }
h3 { font-size: 1.1rem; color: var(--gris); margin-bottom: .5rem; }
p  { margin-bottom: 1rem; color: var(--gris); }
strong { color: var(--blanco); }

/* --- Layout --- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
section { padding: 4rem 0; }
section + section { border-top: 1px solid var(--gris2); }

/* --- Navegación --- */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7, 10, 15, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gris2);
  padding: .9rem 0;
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-logo {
  font-family: var(--fuente-mono);
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--verde);
  letter-spacing: .1em;
}
.nav-logo span { color: var(--gris); font-size: .75rem; display: block; line-height: 1; }
.nav-links { display: flex; gap: 1.5rem; list-style: none; flex-wrap: wrap; }
.nav-links a {
  font-family: var(--fuente-mono);
  font-size: .8rem;
  color: var(--gris);
  letter-spacing: .05em;
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--verde); }

/* --- Hero serie --- */
.hero-serie {
  padding: 5rem 0 4rem;
  text-align: center;
}
.hero-tag {
  font-family: var(--fuente-mono);
  font-size: .75rem;
  color: var(--verde);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}
.hero-sub {
  font-family: var(--fuente-mono);
  font-size: 1rem;
  color: var(--gris);
  margin-top: .75rem;
  margin-bottom: 2rem;
  font-style: italic;
}

/* --- Grid de libros --- */
.libros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.libro-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.libro-card img {
  border: 2px solid var(--gris2);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  box-shadow: 0 0 30px rgba(0,255,65,.06);
  transition: box-shadow .3s;
}
.libro-card:hover img { box-shadow: 0 0 40px rgba(0,255,65,.15); }
.libro-card .libro-num {
  font-family: var(--fuente-mono);
  font-size: .7rem;
  color: var(--verde);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.libro-card h3 { font-size: 1.05rem; color: var(--blanco); }
.libro-card .libro-estado {
  font-size: .8rem;
  color: var(--gris);
  font-family: var(--fuente-mono);
}
.libro-card.proximamente img { opacity: .3; filter: grayscale(1); }
.libro-card.proximamente h3 { color: var(--gris); }

/* --- Botones CTA --- */
.btn-group { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.btn {
  font-family: var(--fuente-mono);
  font-size: .85rem;
  font-weight: bold;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .05em;
  display: inline-flex; align-items: center; gap: .4rem;
}
.btn-primary {
  background: var(--verde);
  color: var(--negro);
  border: 2px solid var(--verde);
}
.btn-primary:hover { background: transparent; color: var(--verde); }
.btn-secondary {
  background: transparent;
  color: var(--blanco);
  border: 2px solid var(--gris2);
}
.btn-secondary:hover { border-color: var(--gris); }
.btn-sm { padding: .4rem .9rem; font-size: .78rem; }

/* --- Terminal --- */
.terminal {
  background: #0B0F14;
  border: 1px solid var(--gris2);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.terminal::before {
  content: '● ● ●';
  font-size: .6rem;
  color: var(--gris2);
  letter-spacing: .3em;
  display: block;
  margin-bottom: 1rem;
}
.terminal-line {
  font-family: var(--fuente-mono);
  font-size: .9rem;
  color: var(--verde);
  line-height: 1.8;
  white-space: pre-wrap;
}
.terminal-line.human { color: var(--blanco); }
.terminal-line.dim { color: var(--gris); }
.cursor::after {
  content: '█';
  animation: blink 1s step-end infinite;
  color: var(--verde);
}
@keyframes blink { 50% { opacity: 0; } }

/* --- Badge --- */
.badge {
  font-family: var(--fuente-mono);
  font-size: .7rem;
  background: var(--gris2);
  color: var(--gris);
  padding: .25rem .65rem;
  border-radius: 2px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.badge.accent { background: rgba(0,255,65,.1); color: var(--verde); border: 1px solid rgba(0,255,65,.3); }

/* --- Sobre la serie --- */
.sobre-serie p { font-size: 1.05rem; max-width: 65ch; }

/* --- Cronología / timeline --- */
.timeline { margin-top: 2rem; display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--gris2);
  align-items: start;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-year {
  font-family: var(--fuente-mono);
  font-size: .75rem;
  color: var(--verde);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding-top: .15rem;
}
.timeline-content h3 { color: var(--blanco); font-size: .95rem; margin-bottom: .25rem; }
.timeline-content p { font-size: .88rem; margin-bottom: 0; }

/* --- Formulario email --- */
.email-form {
  background: var(--gris2);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--azul);
  margin-top: 1.5rem;
  max-width: 480px;
}
.email-form p { font-size: .95rem; margin-bottom: 1rem; }
.form-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.form-row input[type="email"] {
  flex: 1;
  min-width: 200px;
  background: var(--negro);
  border: 1px solid var(--gris2);
  border-radius: var(--radius);
  color: var(--blanco);
  font-family: var(--fuente-mono);
  font-size: .85rem;
  padding: .65rem 1rem;
  outline: none;
  transition: border-color .2s;
}
.form-row input[type="email"]:focus { border-color: var(--verde); }
.form-row button {
  font-family: var(--fuente-mono);
  font-size: .8rem;
  font-weight: bold;
  background: var(--verde);
  color: var(--negro);
  border: none;
  border-radius: var(--radius);
  padding: .65rem 1.25rem;
  cursor: pointer;
  transition: opacity .2s;
  letter-spacing: .05em;
}
.form-row button:hover { opacity: .85; }
.form-note { font-size: .75rem; color: var(--gris); margin-top: .5rem; margin-bottom: 0; }

/* --- Footer --- */
.site-footer {
  background: #050709;
  border-top: 1px solid var(--gris2);
  padding: 2.5rem 0;
  margin-top: 4rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: center;
}
.footer-brand {
  font-family: var(--fuente-mono);
  font-size: 1rem;
  color: var(--verde);
  font-weight: bold;
}
.footer-brand span { display: block; font-size: .75rem; color: var(--gris); font-weight: normal; }
.footer-links { display: flex; gap: 1.25rem; list-style: none; flex-wrap: wrap; }
.footer-links a { font-size: .8rem; color: var(--gris); transition: color .2s; }
.footer-links a:hover { color: var(--verde); }
.footer-copy { font-size: .75rem; color: var(--gris2); width: 100%; }

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid var(--gris2);
  border-radius: 999px;
  color: var(--gris);
  background: rgba(255, 255, 255, 0.02);
  transition: color .2s, border-color .2s, transform .2s, background .2s;
}
.social-link svg {
  width: .95rem;
  height: .95rem;
  fill: currentColor;
}
.social-link:hover {
  color: var(--verde);
  border-color: var(--verde);
  background: rgba(0, 255, 65, 0.08);
  transform: translateY(-1px);
}

/* --- Utilidades --- */
.text-verde { color: var(--verde); }
.text-gris  { color: var(--gris); }
.text-ambar { color: var(--ambar); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mono { font-family: var(--fuente-mono); }
.text-center { text-align: center; }

/* --- Responsive --- */
@media (max-width: 600px) {
  .nav-links { gap: 1rem; }
  section { padding: 2.5rem 0; }
  .libros-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1.25rem; }
  .timeline-item { grid-template-columns: 1fr; gap: .25rem; }
  .hero-serie { padding: 3rem 0 2.5rem; }
  .btn-group { justify-content: flex-start; }
}