/* ==== VARIABLES GLOBALES Y ESTILOS BASE ==== */
:root {
  --bg: #0b0e14;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --surface: #111827;
  --border: #1f2937;
  --primary: #00e5ff;
  --accent: #22c55e;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* ==== CONTAINERS ==== */
.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}
.narrow {
  width: min(840px, 92%);
  margin-inline: auto;
}

/* ==== ACCESIBILIDAD (SKIP LINK) ==== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  background: #000;
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 999;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ==== HEADER Y NAVEGACIÓN ==== */
.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: saturate(180%) blur(10px);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}
.brand img {
  border-radius: 6px;
}

.nav__toggle {
  display: none;
  color: var(--text);
}
.nav__list {
  display: flex;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
  align-items: center;
}
.nav__list a,
.btn--ghost {
  color: var(--text);
  text-decoration: none;
}
.btn--ghost {
  border: 1px solid var(--border);
  background: transparent;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
}
@media (max-width: 768px) {
  .nav__toggle {
    display: inline-flex;
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
  }
  .nav__list {
    position: absolute;
    right: 1rem;
    top: 64px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1rem;
    border-radius: 12px;
    flex-direction: column;
    align-items: flex-start;
    display: none;
  }
  .nav__list.open {
    display: flex;
  }
}

/* ==== SCROLL INDICATOR ==== */
.scroll-indicator {
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0;
}

/* ==== SECCIONES GENERALES ==== */
.section {
  padding: 72px 0;
}
.section--alt {
  background: color-mix(in srgb, var(--surface) 85%, transparent);
}
.section h2 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  margin: 0 0 1rem;
}

/* ==== HERO (PRESENTACIÓN) ==== */
.hero__title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.2;
  margin: 0 0 1rem;
}
.hero__subtitle {
  color: var(--muted);
  max-width: 60ch;
}
.accent {
  color: var(--primary);
}
.hero__ctas {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0 0;
  justify-content: center;
}
.hero__links {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}
.linklike {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  cursor: pointer;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
}
@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .hero__content  {
    margin: 0 0 1rem 0;
  }
}
.avatar {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--surface);
}
.hero__image {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__content  {
  text-align: center;
}

/* ==== HABILIDADES (SKILLS) ==== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.skill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}
.skill__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.bar {
  height: 10px;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--primary);
}

/* ==== TRAITS / LISTADO DE CUALIDADES ==== */
.traits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-left: 1rem;
}
.traits li {
  color: var(--muted);
}
@media (max-width: 768px) {
  .traits {
    grid-template-columns: 1fr;
  }
}

/* ==== ENCABEZADOS DE SECCIONES ==== */
.section__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.section__head h2 {
  margin: 0;
}

/* ==== FILTROS ==== */
.filters {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
#search {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  min-width: 220px;
  color: var(--text);
}
.tag-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tag {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}
.tag.active {
  outline: 2px solid color-mix(in srgb, var(--primary) 50%, transparent);
}

/* ==== PROYECTOS ==== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  background: #11182710;
}
.card__body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.card__title {
  font-weight: 700;
  margin: 0;
}
.card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.card__tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.card__tags .chip {
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
}
.card__actions {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  padding-top: 0;
  margin-top: auto;
}

/* ==== FORMULARIOS ==== */
.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.btn {
  background: var(--primary);
  color: #0b0e14;
  border: none;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent);
}
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==== BOTÓN BACK TO TOP ==== */
.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: none;
  padding: 0.6rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
}
.back-to-top.show {
  display: inline-flex;
}

/* ==== FOOTER ==== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* ==== MODAL ==== */
.modal[aria-hidden="true"] {
  display: none;
}
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 200;
}
.modal__overlay {
  position: absolute;
  inset: 0;
  background: #0006;
}
.modal__content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 16px;
  width: min(720px, 92%);
  max-height: 85vh;
  overflow: auto;
  padding: 1rem;
}
.modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
}

/* ==== EFECTOS REVEAL ==== */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ==== CÓMO TRABAJO (PROCESS) ==== */
.process {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 1rem;
}
@media (max-width: 1400px) {
  .process {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 740px) {
  .process {
    grid-template-columns: 1fr;
  }
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
}
.step__num {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary);
  color: #0b0e14;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.principles {
  margin-top: 1rem;
  color: var(--muted);
}
.principles li {
  margin: 0.25rem 0;
}

/* ==== FOOTER PERSONALIZADO ==== */
#contact {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  text-align: center;
}

#contact p {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Enlaces sociales */
.social-links {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
}

.social-links a {
  color: var(--text);
  font-size: 1.5rem;
  transition: color 0.3s ease, transform 0.2s ease;
}

.social-links a:hover {
  color: var(--primary);
  transform: translateY(-3px);
}

.social-links svg {
  width: 28px;
  height: 28px;
}
