:root {
  --bg: #050816;
  --bg-alt: #0b1020;
  --card-bg: #111827;
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --accent-strong: rgba(129, 140, 248, 0.5);
  --text: #e5e7eb;
  --text-soft: #9ca3af;
  --border-subtle: rgba(148, 163, 184, 0.3);
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-soft: 0 22px 45px rgba(15, 23, 42, 0.65);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #0b1120 0, #020617 40%, #020617 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(2, 6, 23, 0.9), transparent);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.header__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  width: 34px;
  height: 34px;
  border-radius: 1rem;
  background: radial-gradient(circle at 30% 30%, #fbbf24, #6366f1 55%, #0ea5e9 100%);
  border: 1px solid rgba(248, 250, 252, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #020617;
  box-shadow: 0 12px 30px rgba(30, 64, 175, 0.65);
}

.nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.nav a {
  position: relative;
  color: var(--text-soft);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.25rem;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, #6366f1, #22d3ee);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.nav a:hover {
  color: var(--text);
}

.nav a:hover::after {
  width: 100%;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr);
  gap: 2.5rem;
  padding: 3.5rem 1.75rem 3rem;
  margin: 1rem 0 2rem;
  border-radius: 1.75rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(circle at 20% 120%, rgba(129, 140, 248, 0.22), transparent 60%),
    linear-gradient(to bottom right, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.98));
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 0 0, rgba(248, 250, 252, 0.12), transparent 55%);
  opacity: 0.4;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.8rem;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.55);
  color: var(--text-soft);
  font-size: 0.75rem;
  margin-bottom: 0.9rem;
}

.hero__tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #bbf7d0, #22c55e);
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.8);
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 2.7rem);
  margin: 0 0 0.4rem;
}

.hero__subtitle {
  margin: 0;
  color: var(--text-soft);
  max-width: 36rem;
  line-height: 1.7;
}

.hero__tech-stack {
  margin: 1rem 0 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #818cf8;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  max-width: fit-content;
}

.hero__contact-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.hero__contact-info span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn--primary {
  background: linear-gradient(to right, #6366f1, #22d3ee);
  color: #0f172a;
  box-shadow: 0 15px 35px rgba(56, 189, 248, 0.4);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(56, 189, 248, 0.55);
}

.btn--ghost {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.7);
  color: var(--text-soft);
}

.btn--ghost:hover {
  border-color: rgba(248, 250, 252, 0.9);
  color: var(--text);
}

.section {
  margin: 2.5rem 0;
  padding: 2.3rem 1.75rem;
  border-radius: 1.6rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.12), transparent 55%),
    linear-gradient(to bottom right, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.98));
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.7);
}

.section--alt {
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.16), transparent 60%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 1));
}

.section__header {
  margin-bottom: 1.6rem;
}

.section__header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.section__header p {
  margin: 0.35rem 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: flex-start;
}

.section__info-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.7), transparent 55%),
    rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.55);
  font-size: 0.9rem;
  color: var(--text-soft);
}

.cv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem;
}

.cv__column h3 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--border-subtle);
}

.timeline li {
  position: relative;
  padding: 0.5rem 0 0.9rem 1.2rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.75rem;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #e5e7eb, #6366f1);
  box-shadow: 0 0 12px rgba(129, 140, 248, 0.9);
}

.timeline h4 {
  margin: 0;
  font-size: 0.95rem;
}

.timeline__date {
  display: inline-block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.timeline p {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  color: var(--text-soft);
}

/* Nuevos estilos para sección CV expandida */
.cv-section {
  margin-bottom: 2.5rem;
}

.cv-section:last-child {
  margin-bottom: 0;
}

.cv-section__title {
  margin: 0 0 1.2rem;
  font-size: 1.3rem;
  color: var(--text);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(99, 102, 241, 0.3);
}

.timeline-item {
  position: relative;
  padding: 0.8rem 0 1.2rem 1.5rem;
  border-left: 2px solid var(--border-subtle);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 1rem;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #e5e7eb, #6366f1);
  box-shadow: 0 0 12px rgba(129, 140, 248, 0.9);
}

.timeline-item__header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.timeline-item__header h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.timeline-item__company {
  font-size: 0.9rem;
  color: #818cf8;
  font-weight: 500;
}

.timeline-item__date {
  display: block;
  margin: 0.3rem 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-soft);
  font-style: italic;
}

.timeline-item__description {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.6;
}

.timeline-item__list {
  margin: 0.7rem 0;
  padding-left: 1.2rem;
  color: var(--text-soft);
}

.timeline-item__list li {
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

.timeline-item__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.timeline-item__skills span {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  font-size: 0.75rem;
  color: #a5b4fc;
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.skill-category {
  padding: 1rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.skill-category h4 {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  color: var(--text);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tags span {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  font-size: 0.8rem;
  color: #c4b5fd;
}

/* Teaching Grid */
.teaching-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.teaching-item {
  padding: 1rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.teaching-item h4 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  color: #818cf8;
}

.teaching-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.5;
}

/* Certifications */
.certifications-category {
  margin-bottom: 1.5rem;
}

.certifications-category:last-child {
  margin-bottom: 0;
}

.certifications-category h4 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.certifications-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cert-item {
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.3);
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
}

.cert-name {
  color: var(--text);
}

.cert-org {
  color: #818cf8;
  font-size: 0.8rem;
}

.cert-date {
  color: var(--text-soft);
  font-size: 0.75rem;
  text-align: right;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
}

.card {
  border-radius: 1.2rem;
  padding: 1.1rem 1.1rem 1rem;
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.23), transparent 60%),
    rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.55);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.9);
  position: relative;
  overflow: hidden;
}

.card--featured {
  border: 2px solid rgba(129, 140, 248, 0.6);
  background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.3), transparent 60%),
    rgba(15, 23, 42, 0.98);
}

.card__badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.6);
  color: #86efac;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 2;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.22), transparent 55%);
  opacity: 0.75;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  position: relative;
  z-index: 1;
}

.card p {
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  position: relative;
  z-index: 1;
}

.card__status {
  margin: 0.8rem 0 0;
  font-size: 0.8rem;
  color: var(--text-soft);
  font-style: italic;
  position: relative;
  z-index: 1;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.card__tags span {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.75rem;
  color: var(--text-soft);
}

.card__link {
  position: relative;
  font-size: 0.86rem;
  color: #a5b4fc;
}

.card__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.15rem;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.2s ease;
}

.card__link:hover::after {
  width: 100%;
}

/* Grid de 3 columnas para otros datos */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.info-card {
  padding: 1.5rem;
  border-radius: 1rem;
  background: radial-gradient(circle at top, rgba(99, 102, 241, 0.15), transparent 60%),
    rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.4);
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.info-card:hover {
  transform: translateY(-4px);
  border-color: rgba(129, 140, 248, 0.6);
}

.info-card__icon {
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
}

.info-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: var(--text);
}

.info-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.6;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.9rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.form-field label {
  color: var(--text-soft);
}

.form-field input,
.form-field textarea {
  background: rgba(15, 23, 42, 0.85);
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 0.55rem 0.7rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.6);
}

.form-field textarea {
  resize: vertical;
}

.contact-form .btn {
  align-self: flex-start;
  opacity: 0.7;
  cursor: not-allowed;
}

.form-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.footer {
  border-top: 1px solid rgba(15, 23, 42, 1);
  margin-top: 1.5rem;
  padding: 1.2rem 1.25rem 1.6rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-soft);
}

@media (max-width: 768px) {
  .header__inner {
    padding-inline: 1rem;
  }

  .nav {
    gap: 0.7rem;
    font-size: 0.8rem;
  }

  main {
    padding-inline: 1rem;
  }

  .hero {
    padding: 2.2rem 1.45rem 2.1rem;
    margin-top: 1.2rem;
  }

  .hero__tech-stack {
    font-size: 0.8rem;
  }

  .hero__contact-info {
    flex-direction: column;
    gap: 0.5rem;
  }

  .section {
    padding-inline: 1.45rem;
  }

  .grid-2,
  .grid-3,
  .cv,
  .projects-grid,
  .form-row,
  .skills-grid,
  .teaching-grid {
    grid-template-columns: minmax(0, 1fr);
    display: grid;
  }

  .form-row {
    gap: 0.75rem;
  }

  .cert-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .cert-org,
  .cert-date {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .section__header h2 {
    font-size: 1.1rem;
  }

  .cv-section__title {
    font-size: 1.1rem;
  }
}
