/*
 * Portafolio Williams Montes de oca
 * Diseño moderno - dark theme
 */

/* ===================== Tokens ===================== */
:root {
  --bg: #0b1120;
  --bg-soft: #111a2e;
  --surface: #151f36;
  --surface-2: #1b2742;
  --border: rgba(148, 163, 184, 0.14);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent-1: #8b5cf6;
  --accent-2: #22d3ee;
  --gradient: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  --radius: 16px;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

/* ===================== Base ===================== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-2);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #fff;
}

img {
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===================== Navbar ===================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(11, 17, 32, 0.75);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.navbar__brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navbar__link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.navbar__link:hover,
.navbar__link.is-active {
  color: #fff;
}

/* ===================== Hero ===================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  z-index: 0;
}

.hero::before {
  width: 480px;
  height: 480px;
  top: -160px;
  left: -160px;
  background: var(--accent-1);
}

.hero::after {
  width: 520px;
  height: 520px;
  bottom: -200px;
  right: -160px;
  background: var(--accent-2);
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__image {
  width: 170px;
  height: 170px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid transparent;
  background: var(--gradient);
  background-clip: padding-box;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.hero__hello {
  color: var(--accent-2);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

.hero__title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

.hero__title .gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 1.5rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}

/* ===================== Botones ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--gradient);
  color: #0b1120;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn--ghost:hover {
  border-color: var(--accent-2);
  color: #fff;
}

.btn--icon {
  padding: 0.7rem;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
}

.btn--icon:hover {
  background: var(--surface-2);
  color: #fff;
  border-color: var(--accent-2);
}

/* ===================== Secciones ===================== */
.section {
  padding: 5rem 0;
}

.section--alt {
  background: var(--bg-soft);
}

.section__title {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 700;
  text-align: center;
  margin: 0 0 0.5rem;
}

.section__subtitle {
  text-align: center;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 3rem;
}

.section__title .gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===================== Sobre mí ===================== */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: center;
}

.about__image {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.about__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.4rem;
  text-align: center;
  flex: 1 1 120px;
}

.stat__value {
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat__label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.about__text {
  color: var(--text-muted);
}

.about__text p {
  margin: 0 0 1rem;
}

/* ===================== Habilidades ===================== */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.5);
}

.skill-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--gradient);
  color: #0b1120;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.skill-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.skill-card__text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}

.chip--hot {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.45);
}

/* ===================== Experiencia ===================== */
.timeline {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline__item {
  position: relative;
  padding-left: 2.2rem;
  margin-bottom: 1.75rem;
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.8rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.timeline__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.timeline__card:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.5);
}

.timeline__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.timeline__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.timeline__role {
  color: var(--accent-2);
  font-size: 0.9rem;
  font-weight: 500;
}

.timeline__date {
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.timeline__desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0.5rem 0 0.75rem;
}

/* ===================== Proyecto destacado ===================== */
.featured {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid rgba(139, 92, 246, 0.45);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow);
}

.featured__media {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.featured__media img {
  width: 100%;
  display: block;
}

.featured__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #0b1120;
  background: var(--gradient);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.featured__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.featured__desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
}

.featured .chips {
  margin-bottom: 1.5rem;
}

/* ===================== Proyectos ===================== */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.6rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: var(--shadow);
}

.project-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
}

.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-card__media img {
  transform: scale(1.05);
}

.project-card__badge {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(11, 17, 32, 0.85);
  color: #fff;
  border: 1px solid rgba(34, 211, 238, 0.4);
}

.project-card__body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card__title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.project-card__desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 1rem;
  flex: 1;
}

.project-card__actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn--sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

/* ===================== Contacto ===================== */
.contact__card {
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.contact__card img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid transparent;
  background: var(--gradient);
  background-clip: padding-box;
  margin-bottom: 1rem;
}

.contact__title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.contact__sub {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.contact__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.contact__socials {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

/* ===================== Footer ===================== */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===================== Animaciones ===================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===================== Responsive ===================== */
@media (max-width: 820px) {
  .about__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .featured {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }

  .projects__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .navbar__links {
    gap: 0.9rem;
  }

  .navbar__link {
    font-size: 0.85rem;
  }

  .hero__image {
    width: 140px;
    height: 140px;
  }

  .section {
    padding: 3.5rem 0;
  }
}

/* ===================== Utilidades (páginas de detalle) ===================== */
.text-center {
  text-align: center;
}

.page {
  padding-top: 5rem;
}

.page h3 {
  font-size: 1.6rem;
  font-weight: 700;
}

.page p {
  color: var(--text-muted);
}

#capturasPantalla {
  list-style-type: none;
  padding: 0;
  margin: 1.5rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

#capturasPantalla img {
  width: 200px;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  cursor: zoom-in;
  border: 1px solid var(--border);
  transition: transform 0.2s ease;
}

#capturasPantalla img:hover {
  transform: scale(1.04);
}

/* ===================== Lightbox ===================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3.5rem 1rem 1.5rem;
  background: rgba(6, 10, 20, 0.96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.lightbox.is-open {
  display: flex;
}

.lightbox__stage {
  margin: 0;
  max-width: min(1100px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.lightbox__img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease;
}

.lightbox__img.is-loading {
  opacity: 0.35;
}

.lightbox__caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: left;
}

.lightbox__counter {
  color: var(--accent-2);
  font-weight: 600;
  white-space: nowrap;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: var(--surface-2);
  border-color: var(--accent-2);
  color: #fff;
}

.lightbox__close {
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 64px;
  border-radius: 10px;
  font-size: 1.3rem;
}

.lightbox__nav:hover {
  transform: translateY(-50%) scale(1.05);
}

.lightbox__nav--prev {
  left: 1rem;
}

.lightbox__nav--next {
  right: 1rem;
}

.lightbox__thumbs {
  display: flex;
  gap: 0.5rem;
  max-width: min(1100px, 92vw);
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-2) transparent;
}

.lightbox__thumb {
  flex: 0 0 auto;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.lightbox__thumb img {
  display: block;
  width: 84px;
  height: 56px;
  object-fit: cover;
  pointer-events: none;
}

.lightbox__thumb:hover {
  opacity: 0.85;
}

.lightbox__thumb.is-active {
  opacity: 1;
  border-color: var(--accent-2);
}

@media (max-width: 640px) {
  .lightbox {
    padding: 3.5rem 0.5rem 1rem;
  }

  .lightbox__nav {
    width: 38px;
    height: 52px;
    font-size: 1rem;
  }

  .lightbox__nav--prev {
    left: 0.35rem;
  }

  .lightbox__nav--next {
    right: 0.35rem;
  }

  .lightbox__img {
    max-height: 60vh;
  }

  .lightbox__caption {
    font-size: 0.8rem;
    padding: 0 0.5rem;
  }
}

#volver {
  margin: 2rem 0;
}

.lead {
  font-size: 1.05rem;
  color: var(--text) !important;
}