/* =========================================================
   Ricardo Morales Avilés - Estilo 2026
   Diseño moderno, creativo, profesional y responsive
   ========================================================= */

/* --------------------
   1) Variables globales
   -------------------- */
:root {
  --bg-1: #070b1a;
  --bg-2: #0e1630;
  --bg-3: #131f42;

  --primary: #5b8cff;
  --secondary: #00d4ff;
  --tertiary: #7a5cff;
  --accent: #ff6b9f;
  --success: #38f8d8;

  --text-main: #eaf1ff;
  --text-soft: #b7c4e4;
  --text-strong: #ffffff;

  --glass: rgba(255, 255, 255, 0.09);
  --glass-strong: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.2);

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;

  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.28);
  --shadow-hover: 0 18px 42px rgba(5, 10, 30, 0.45);

  --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------
   2) Reset + Base
   -------------------- */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  line-height: 1.7;
  letter-spacing: 0.01em;
  background:
    radial-gradient(circle at 12% 12%, rgba(0, 212, 255, 0.2), transparent 30%),
    radial-gradient(circle at 88% 20%, rgba(122, 92, 255, 0.22), transparent 32%),
    radial-gradient(circle at 50% 100%, rgba(255, 107, 159, 0.18), transparent 35%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2) 48%, var(--bg-3));
  background-attachment: fixed;
}

/* Efecto de entrada suave al cargar */
body {
  animation: fadeInPage 0.75s ease-out both;
}

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

/* --------------------
   3) Topbar / Menú moderno
   -------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 0.85rem 1rem;

  background: linear-gradient(120deg, rgba(6, 9, 22, 0.94), rgba(9, 14, 34, 0.92));
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.topbar a {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-decoration: none;
  color: #eff6ff;
  font-weight: 800;
  font-size: 0.96rem;
  letter-spacing: 0.01em;
  padding: 0.62rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(130, 212, 255, 0.42);
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.2), rgba(122, 92, 255, 0.18));
  box-shadow: 0 8px 22px rgba(19, 30, 72, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform var(--transition), color var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition), filter var(--transition);
}

/* Capa glow degradada */
.topbar a::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(91, 140, 255, 0.95), rgba(0, 212, 255, 0.86), rgba(255, 107, 159, 0.9));
  opacity: 0;
  transition: opacity var(--transition);
  z-index: -1;
}

/* Sheen animado para botones */
.topbar a::after {
  content: "";
  position: absolute;
  top: -120%;
  left: -32%;
  width: 30%;
  height: 340%;
  transform: rotate(24deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  opacity: 0;
  transition: left 0.55s ease, opacity 0.45s ease;
}

.topbar a:hover,
.topbar a.active {
  color: #03111e;
  border-color: transparent;
  background: linear-gradient(115deg, #8fb0ff, #79f0ff, #ff9fc2);
  box-shadow: 0 14px 30px rgba(0, 212, 255, 0.25), 0 0 22px rgba(122, 92, 255, 0.2);
  transform: translateY(-3px) scale(1.025);
  filter: saturate(1.08);
}

.topbar a:hover::before,
.topbar a.active::before {
  opacity: 1;
}

.topbar a:hover::after,
.topbar a.active::after {
  left: 118%;
  opacity: 1;
}

/* --------------------
   4) Header Hero
   -------------------- */
header {
  position: relative;
  overflow: hidden;
  text-align: center;
  margin: 1.1rem auto 0;
  width: min(1200px, calc(100% - 2rem));
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  padding: clamp(2.1rem, 5vw, 4.1rem) 1.2rem 2.3rem;

  background:
    linear-gradient(140deg, rgba(91, 140, 255, 0.3), rgba(122, 92, 255, 0.25) 40%, rgba(0, 212, 255, 0.2) 75%),
    rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: var(--shadow-soft);
}

header::before,
header::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

header::before {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(56, 248, 216, 0.55), rgba(56, 248, 216, 0));
  top: -90px;
  left: -60px;
}

header::after {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 107, 159, 0.45), rgba(255, 107, 159, 0));
  right: -80px;
  bottom: -140px;
}

header h1 {
  margin: 0;
  color: var(--text-strong);
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  line-height: 1.15;
  text-wrap: balance;
}

header p {
  max-width: 950px;
  margin: 1rem auto 0;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.4vw, 1.16rem);
}

/* --------------------
   5) Layout principal
   -------------------- */
main {
  max-width: 1180px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
}

/* --------------------
   6) Cards / Secciones (apartados mejorados)
   -------------------- */
.section {
  position: relative;
  isolation: isolate;
  margin-bottom: 1.35rem;
  padding: clamp(1.05rem, 1.9vw, 1.65rem);
  border-radius: calc(var(--radius-lg) + 2px);
  border: 1px solid rgba(255, 255, 255, 0.22);

  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05) 45%, rgba(255, 255, 255, 0.03) 100%),
    var(--glass);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow-soft);

  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition),
    background var(--transition);
}

/* Halo superior para destacar cada apartado */
.section::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.9), rgba(0, 212, 255, 0.9), rgba(255, 107, 159, 0.85));
  opacity: 0.75;
  z-index: 1;
}

/* Glow ambiental interno */
.section::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 85% 12%, rgba(91, 140, 255, 0.2), transparent 35%);
  pointer-events: none;
  z-index: -1;
}

/* Animación cards al pasar mouse */
.section:hover {
  transform: translateY(-7px) scale(1.005);
  box-shadow: var(--shadow-hover);
  border-color: rgba(0, 212, 255, 0.52);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.06) 45%, rgba(255, 255, 255, 0.03) 100%),
    var(--glass);
}

.section h2 {
  position: relative;
  display: inline-block;
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #e6f4ff;
  font-size: clamp(1.35rem, 2.4vw, 1.95rem);
  line-height: 1.25;
  text-wrap: balance;
}

/* Subrayado degradado del título del apartado */
.section h2::after {
  content: "";
  display: block;
  margin-top: 0.36rem;
  width: 78%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--secondary), var(--primary), transparent);
}

.section p {
  margin: 0.45rem 0;
  color: var(--text-soft);
}

/* --------------------
   7) Grid de imágenes
   -------------------- */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

figure {
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--glass-strong);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

figure:hover {
  transform: translateY(-7px) scale(1.01);
  border-color: rgba(91, 140, 255, 0.7);
  box-shadow: 0 20px 40px rgba(3, 8, 26, 0.5);
}

figure img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
  filter: saturate(1.05) contrast(1.02);
}

figcaption {
  padding: 0.8rem;
  color: #d2e2ff;
  font-size: 0.94rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.09));
}

/* --------------------
   8) Bloques destacados y listas
   -------------------- */
.highlight {
  margin-top: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-left: 5px solid var(--secondary);
  border-radius: 12px;
  padding: 0.95rem 1rem;
  font-weight: 600;
  color: #f3fbff;
  background:
    linear-gradient(110deg, rgba(0, 212, 255, 0.2), rgba(122, 92, 255, 0.18) 55%, rgba(255, 107, 159, 0.18));
}

ul {
  margin: 0.35rem 0;
  padding-left: 1.2rem;
}

li + li {
  margin-top: 0.5rem;
}

/* --------------------
   9) Footer
   -------------------- */
footer {
  text-align: center;
  color: #9bb2df;
  padding: 1.4rem 1rem 2rem;
  font-size: 0.95rem;
}

/* --------------------
   10) Responsive (tablet/móvil)
   -------------------- */
@media (max-width: 980px) {
  header {
    width: calc(100% - 1.4rem);
  }

  .section {
    padding: 1rem;
  }
}

@media (max-width: 720px) {
  .topbar {
    justify-content: flex-start;
    padding: 0.7rem 0.8rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
  }

  .topbar a {
    white-space: nowrap;
    font-size: 0.9rem;
    padding: 0.5rem 0.9rem;
  }

  header {
    margin-top: 0.85rem;
    border-radius: 18px;
    padding-bottom: 1.8rem;
  }

  figure img {
    height: 205px;
  }
}
