/* =============================
   VARIABLES Y BASE
   ============================= */
:root {
  --rojo: #D62828;
  --rojo-oscuro: #8C1A1A;
  --amarillo: #FFC300;
  --amarillo-suave: #FFE08A;
  --negro: #121212;
  --panel: #1B1B1B;
  --panel-alt: #202020;
  --azul: #1E3A8A;
  --azul-claro: #3B82F6;
  --texto: #EDEDED;
  --texto-tenue: #B3B3B3;

  --fuente-titulo: 'Algerian', 'Oswald', 'Impact', fantasy;
  --fuente-cuerpo: 'Rajdhani', 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--negro);
  color: var(--texto);
  font-family: var(--fuente-cuerpo);
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

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

section { padding: 110px 0; position: relative; }
section:nth-of-type(even) { background: var(--panel); }

h1, h2, h3 {
  font-family: var(--fuente-titulo);
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* =============================
   ICONOS CUADRADOS (negro / borde azul)
   ============================= */
.icon-box {
  width: 56px;
  height: 56px;
  min-width: 56px;
  background: var(--negro);
  border: 3px solid var(--azul);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amarillo);
  font-family: var(--fuente-cuerpo);
  font-weight: 700;
  font-size: 14px;
  transition: border-color .3s ease, transform .3s ease, box-shadow .3s ease;
}
.icon-box svg { width: 26px; height: 26px; stroke: currentColor; }
.icon-box:hover {
  border-color: var(--azul-claro);
  transform: translateY(-3px) rotate(-2deg);
  box-shadow: 0 6px 16px rgba(30, 58, 138, .45);
}
.icon-box--sm { width: 40px; height: 40px; min-width: 40px; border-width: 2px; }
.icon-box--sm svg { width: 18px; height: 18px; }

/* =============================
   BOTONES
   ============================= */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-family: var(--fuente-cuerpo);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
}
.btn--primary {
  background: var(--rojo);
  color: #fff;
  box-shadow: 0 6px 18px rgba(214, 40, 40, .35);
}
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(214, 40, 40, .5); }
.btn--outline {
  border-color: var(--amarillo);
  color: var(--amarillo);
  background: transparent;
}
.btn--outline:hover { background: var(--amarillo); color: var(--negro); transform: translateY(-3px); }

/* =============================
   HEADER
   ============================= */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(18, 18, 18, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(214, 40, 40, .25);
  transition: background .3s ease, border-color .3s ease;
}
.header.scrolled {
  background: rgba(18, 18, 18, .97);
  border-bottom-color: var(--rojo);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo__text {
  font-family: var(--fuente-titulo);
  font-size: 20px;
  color: var(--amarillo);
}
.nav__list { display: flex; gap: 30px; }
.nav__link {
  position: relative;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .5px;
  padding: 6px 2px;
  color: var(--texto);
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--rojo), var(--amarillo));
  transition: width .3s ease;
}
.nav__link:hover::after, .nav__link.active::after { width: 100%; }
.nav__link.active { color: var(--amarillo); }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav__toggle span {
  width: 26px; height: 3px;
  background: var(--amarillo);
  transition: transform .3s ease, opacity .3s ease;
}
.nav__toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* =============================
   HERO
   ============================= */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 76px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(214,40,40,.18), transparent 55%),
    radial-gradient(circle at 50% 60%, rgba(255,195,0,.08), transparent 60%),
    var(--negro);
}
.hero__waves {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}
.wave {
  position: absolute;
  width: 220px; height: 220px;
  border: 2px solid var(--amarillo);
  border-radius: 50%;
  opacity: 0;
  animation: radarPulse 4.5s ease-out infinite;
}
.wave:nth-child(2) { border-color: var(--rojo); animation-delay: 1.5s; }
.wave:nth-child(3) { border-color: var(--azul-claro); animation-delay: 3s; }

@keyframes radarPulse {
  0%   { transform: scale(.25); opacity: .9; }
  100% { transform: scale(3.4); opacity: 0; }
}

.hero__content { position: relative; z-index: 1; animation: fadeInUp 1s ease both; }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--amarillo-suave);
  border: 1px solid rgba(255,195,0,.4);
  padding: 6px 16px;
  margin-bottom: 26px;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rojo);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.hero__name {
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.15;
  color: var(--amarillo);
  text-shadow: 0 0 24px rgba(214,40,40,.5);
  margin-bottom: 18px;
}
.hero__rank {
  font-family: var(--fuente-cuerpo);
  font-weight: 600;
  font-size: clamp(15px, 2.2vw, 19px);
  color: var(--texto-tenue);
  max-width: 620px;
  margin: 0 auto 22px;
}
.hero__typed {
  font-size: 18px;
  font-weight: 600;
  color: var(--rojo);
  min-height: 26px;
  margin-bottom: 40px;
}
.cursor { animation: blink 0.9s step-start infinite; color: var(--amarillo); }
.hero__cta { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }

.hero__scroll {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}
.hero__scroll span {
  display: block;
  width: 22px; height: 22px;
  border-right: 3px solid var(--amarillo);
  border-bottom: 3px solid var(--amarillo);
  transform: rotate(45deg);
  animation: bounce 1.8s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: rotate(45deg) translate(0,0); }
  50% { transform: rotate(45deg) translate(6px, 6px); }
}

/* =============================
   TITULOS DE SECCIÓN
   ============================= */
.section-title { text-align: center; margin-bottom: 60px; }
.section-title .icon-box { margin: 0 auto 18px; }
.section-title h2 {
  font-size: clamp(24px, 4vw, 34px);
  color: var(--amarillo);
}
.section-line {
  width: 70px; height: 4px;
  margin: 16px auto 0;
  background: linear-gradient(90deg, var(--rojo), var(--amarillo));
}

/* =============================
   SOBRE MI
   ============================= */
.about__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: start;
}
.about__text p { color: var(--texto-tenue); margin-bottom: 18px; }
.about__text strong { color: var(--amarillo); }

.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.stat-card {
  background: var(--panel-alt);
  border: 1px solid rgba(255,255,255,.06);
  border-top: 3px solid var(--rojo);
  padding: 26px 18px;
  text-align: center;
  transition: transform .3s ease, border-color .3s ease;
}
.stat-card:hover { transform: translateY(-6px); border-top-color: var(--amarillo); }
.stat-card .icon-box { margin: 0 auto 14px; }
.stat-number {
  font-family: var(--fuente-titulo);
  font-size: 30px;
  color: var(--amarillo);
}
.stat-label {
  font-size: 13px;
  color: var(--texto-tenue);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 6px;
}

/* =============================
   EXPERIENCIA (TIMELINE)
   ============================= */
.timeline { position: relative; max-width: 820px; margin: 0 auto; }
.timeline::before {
  content: '';
  position: absolute;
  left: 27px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(var(--rojo), var(--amarillo));
}
.timeline__item {
  display: flex;
  gap: 26px;
  position: relative;
  margin-bottom: 46px;
}
.timeline__item:last-child { margin-bottom: 0; }
.timeline__icon { position: relative; z-index: 1; }
.timeline__content {
  background: var(--panel-alt);
  border: 1px solid rgba(255,255,255,.06);
  padding: 22px 24px;
  flex: 1;
}
.timeline__date {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--negro);
  background: var(--amarillo);
  padding: 3px 10px;
  margin-bottom: 10px;
}
.timeline__content h3 { font-size: 19px; color: var(--texto); margin-bottom: 4px; }
.timeline__unit { color: var(--rojo); font-weight: 600; margin-bottom: 10px; }
.timeline__content p:last-child { color: var(--texto-tenue); font-size: 15px; }

/* =============================
   FORMACIÓN
   ============================= */
.education__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}
.edu-card {
  background: var(--panel-alt);
  border: 1px solid rgba(255,255,255,.06);
  padding: 30px 24px;
  text-align: center;
  transition: transform .3s ease, box-shadow .3s ease;
}
.edu-card:hover { transform: translateY(-6px); box-shadow: 0 14px 28px rgba(0,0,0,.35); }
.edu-card .icon-box { margin: 0 auto 16px; }
.edu-card h3 { font-size: 17px; color: var(--amarillo); margin-bottom: 8px; font-family: var(--fuente-cuerpo); font-weight: 700; }
.edu-card__inst { color: var(--texto-tenue); font-size: 14px; margin-bottom: 10px; }
.edu-card__year { color: var(--rojo); font-weight: 700; font-size: 13px; letter-spacing: 1px; }

.courses { max-width: 720px; margin: 0 auto; }
.courses__title { text-align: center; color: var(--amarillo); font-size: 18px; margin-bottom: 22px; font-family: var(--fuente-cuerpo); font-weight: 700; }
.courses__list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: var(--texto-tenue);
}
.courses__list em { color: var(--rojo); font-style: normal; margin-left: auto; font-size: 13px; }

/* =============================
   HABILIDADES
   ============================= */
.skills__list { max-width: 760px; margin: 0 auto; }
.skill { margin-bottom: 26px; }
.skill__label {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 15px;
}
.skill__label span:last-child { color: var(--amarillo); }
.skill__track {
  width: 100%;
  height: 12px;
  background: var(--panel-alt);
  border: 1px solid rgba(255,255,255,.08);
}
.skill__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--rojo), var(--amarillo));
  transition: width 1.4s ease;
}

/* =============================
   LOGROS
   ============================= */
.achievements__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
  max-width: 820px;
  margin: 0 auto;
}
.medal-card {
  position: relative;
  overflow: hidden;
  background: var(--panel-alt);
  border: 1px solid rgba(255,255,255,.06);
  border-left: 4px solid var(--rojo);
  padding: 32px 26px;
  text-align: center;
  transition: transform .3s ease;
}
.medal-card:hover { transform: translateY(-6px); }
.medal-card::before {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,195,0,.18), transparent);
  transform: skewX(-20deg);
  transition: left .7s ease;
}
.medal-card:hover::before { left: 130%; }
.medal-card .icon-box { margin: 0 auto 18px; }
.medal-card h3 { font-size: 17px; color: var(--amarillo); margin-bottom: 10px; font-family: var(--fuente-cuerpo); font-weight: 700; }
.medal-card p { color: var(--texto-tenue); font-size: 14px; margin-bottom: 14px; }
.medal-card__year { color: var(--rojo); font-weight: 700; font-size: 13px; letter-spacing: 1px; }

/* =============================
   CONTACTO
   ============================= */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
}
.contact__intro { color: var(--texto-tenue); margin-bottom: 30px; }
.contact__item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-weight: 600;
  transition: color .25s ease;
}
.contact__item:hover { color: var(--amarillo); }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--amarillo-suave);
  margin-bottom: 8px;
}
.form-group input, .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--panel-alt);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--texto);
  font-family: var(--fuente-cuerpo);
  font-size: 15px;
  resize: vertical;
  transition: border-color .25s ease;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--rojo);
}
.form-status { margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--amarillo); min-height: 20px; }

/* =============================
   FOOTER
   ============================= */
.footer {
  background: var(--panel);
  border-top: 1px solid rgba(214,40,40,.25);
  padding: 34px 0;
  text-align: center;
}
.footer__inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.footer p { color: var(--texto-tenue); font-size: 14px; }
.footer__social { display: flex; gap: 14px; }

.back-to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 48px; height: 48px;
  background: var(--rojo);
  color: #fff;
  border: 2px solid var(--amarillo);
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s ease;
  z-index: 900;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--amarillo); color: var(--negro); }

/* =============================
   SCROLL REVEAL
   ============================= */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================
   RESPONSIVE
   ============================= */
@media (max-width: 900px) {
  .about__grid, .contact__grid { grid-template-columns: 1fr; }
  .education__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  section { padding: 80px 0; }
  .nav {
    position: fixed;
    top: 76px; left: 0; right: 0;
    background: rgba(18,18,18,.98);
    border-bottom: 1px solid var(--rojo);
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
  }
  .nav.open { max-height: 420px; }
  .nav__list { flex-direction: column; gap: 0; padding: 10px 24px 20px; }
  .nav__list li { border-bottom: 1px solid rgba(255,255,255,.08); }
  .nav__link { display: block; padding: 14px 0; }
  .nav__toggle { display: flex; }
  .about__stats { grid-template-columns: 1fr 1fr; }
  .education__grid { grid-template-columns: 1fr; }
  .achievements__grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero__cta { flex-direction: column; align-items: stretch; }
  .about__stats { grid-template-columns: 1fr; }
  .courses__list li { flex-wrap: wrap; }
  .courses__list em { margin-left: 56px; }
}
