/* ============================================
   Portafolio · Juan R. Castillero
   Sistema de diseño moderno
   ============================================ */
@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Inter:wght@400;500;600&display=swap");

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef0f8;
  --text: #10132b;
  --muted: #5b6178;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --cyan: #22d3ee;
  --border: #e5e8f2;
  --hero: #0b1030;
  --shadow-sm: 0 1px 2px rgba(16, 19, 43, 0.06);
  --shadow: 0 10px 30px -12px rgba(16, 19, 43, 0.18);
  --shadow-lg: 0 24px 50px -20px rgba(16, 19, 43, 0.3);
  --radius: 16px;
  --radius-lg: 24px;
  --font-head: "Sora", sans-serif;
  --font-body: "Inter", sans-serif;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container { width: min(1080px, 92%); margin: 0 auto; }

/* ---------- Navegación ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease;
}
.nav.scrolled { box-shadow: var(--shadow-sm); }

.nav__inner {
  width: min(1080px, 92%);
  margin: 0 auto;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.nav__logo span { color: var(--accent); }

.nav__list {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--muted);
  transition: color 0.2s;
  position: relative;
}
.nav__link:hover, .nav__link.active { color: var(--text); }
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  border-radius: 2px;
  background: var(--grad);
  transition: width 0.25s ease;
}
.nav__link:hover::after, .nav__link.active::after { width: 100%; }

.nav__cta {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 6px 18px -6px rgba(99, 102, 241, 0.6);
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav__cta:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -6px rgba(99, 102, 241, 0.7); }

.nav__toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  width: 40px; height: 40px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 160px 0 100px;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(79, 70, 229, 0.35), transparent 60%),
    radial-gradient(800px 400px at 0% 110%, rgba(34, 211, 238, 0.18), transparent 60%),
    var(--hero);
  color: #fff;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%);
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 3rem;
}

.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.85rem;
  font-weight: 500;
  color: #c7d2fe;
  margin-bottom: 1.5rem;
}
.hero__tag i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.25);
}

.hero__title {
  font-family: var(--font-head);
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}
.hero__title span {
  background: linear-gradient(90deg, #a5b4fc, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__subtitle {
  font-size: 1.15rem;
  color: #aeb4d6;
  margin-bottom: 2rem;
  max-width: 34rem;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 2.2rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -8px rgba(99, 102, 241, 0.7); }
.btn--primary:hover { transform: translateY(-2px); }
.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-2px); }

.hero__social { display: flex; gap: 1rem; }
.social-link {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #d7dbf4;
  transition: background 0.2s, transform 0.2s, color 0.2s;
}
.social-link:hover { background: var(--grad); color: #fff; transform: translateY(-3px); }

.hero__media { position: relative; display: flex; justify-content: center; }
.hero__blob { width: 100%; max-width: 400px; border-radius: 38% 62% 60% 40% / 45% 42% 58% 55%; overflow: hidden; }
.hero__blob img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Secciones ---------- */
.section { padding: 96px 0; }
.section--alt { background: var(--surface); }

.section__head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section__kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.section__title {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}
.section__lead { color: var(--muted); font-size: 1.02rem; }

/* ---------- Acerca de ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 4rem;
  align-items: center;
}
.about__media { position: relative; }
.about__media::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: var(--radius-lg);
  background: var(--grad);
  opacity: 0.12;
  z-index: -1;
}
.about__media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.about__name {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.about__text { color: var(--muted); text-align: justify; }
.about__text b { color: var(--text); font-weight: 600; }
.about__chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem; }
.chip {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
}

/* ---------- Formación (timeline) ---------- */
.timeline { max-width: 760px; margin: 0 auto; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 14px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--cyan));
}
.tl-item { position: relative; padding-left: 56px; padding-bottom: 40px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: 4px; top: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 5px solid var(--accent);
  box-shadow: 0 0 0 5px rgba(79, 70, 229, 0.15);
}
.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.tl-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tl-title { font-family: var(--font-head); font-weight: 700; font-size: 1.08rem; }
.tl-sub { font-size: 0.88rem; color: var(--accent); font-weight: 600; margin: 0.3rem 0 0.55rem; }
.tl-body { font-size: 0.95rem; color: var(--muted); }
.tl-body a { color: var(--accent); font-weight: 600; }
.tl-body a:hover { text-decoration: underline; }
.tl-status {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}
.tl-status--ok { background: #dcfce7; color: #15803d; }
.tl-status--soon { background: #fef9c3; color: #a16207; }

/* ---------- Grid de tarjetas (proyectos/cursos) ---------- */
.grid { display: grid; gap: 1.8rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.card:hover .card__media img { transform: scale(1.06); }

.card__body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.card__title { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; margin-bottom: 0.45rem; }
.card__desc { color: var(--muted); font-size: 0.92rem; flex: 1; }
.card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.1rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
}
.card__link:hover { text-decoration: underline; }

/* ---------- Cursos ---------- */
.course {
  text-align: center;
  padding: 2rem 1.4rem 1.6rem;
}
.course .course__icon {
  width: 64px; height: 64px;
  margin: 0 auto 1.1rem;
  border-radius: 18px;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 26px -10px rgba(99, 102, 241, 0.6);
}
.course__title { font-family: var(--font-head); font-weight: 700; font-size: 1rem; margin-bottom: 0.4rem; }
.course__meta { font-size: 0.85rem; color: var(--muted); }
.course__cert {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
}
.course__cert:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.footer {
  background: var(--hero);
  color: #c7cbe8;
  padding: 60px 0 40px;
  text-align: center;
}
.footer__name { font-family: var(--font-head); font-size: 1.6rem; font-weight: 800; color: #fff; margin-bottom: 0.4rem; }
.footer__role { font-size: 0.95rem; color: #8b90b8; margin-bottom: 1.6rem; }
.footer__social { display: flex; justify-content: center; gap: 1rem; margin-bottom: 2rem; }
.footer__social .social-link { background: rgba(255, 255, 255, 0.06); }
.footer__copy { font-size: 0.85rem; color: #6f749c; }
.footer__copy a { color: #a5b4fc; font-weight: 500; }

/* ---------- Animaciones de aparición ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .hero { padding: 130px 0 70px; }
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__actions, .hero__social { justify-content: center; }
  .hero__subtitle { margin-inline: auto; }
  .hero__media { order: -1; }
  .hero__blob { max-width: 260px; }
  .about__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about__media { max-width: 380px; margin: 0 auto; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .section { padding: 70px 0; }

  .nav__list {
    position: fixed;
    top: 70px; right: -100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: min(300px, 80%);
    height: calc(100vh - 70px);
    background: var(--surface);
    border-left: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: -20px 0 50px -20px rgba(16, 19, 43, 0.3);
    transition: right 0.35s ease;
  }
  .nav__list.open { right: 0; }
  .nav__item { width: 100%; }
  .nav__link { display: block; padding: 0.9rem 0.4rem; border-bottom: 1px solid var(--border); }
  .nav__cta { margin-top: 1.2rem; text-align: center; }
  .nav__toggle { display: flex; }
}
