:root {
  --bg: #050816;
  --bg-alt: #0b1020;
  --card: #111827;
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.15);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #1f2937;
  --radius: 10px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.35);
  --transition: 0.25s ease;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background: radial-gradient(circle at top, #111827 0, #020617 45%, #000 100%);
  color: var(--text);
  line-height: 1.6;
}

/* Layout base */

.container {
  width: min(1100px, 100% - 2.5rem);
  margin: 0 auto;
}

/* Header / Nav */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.6));
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}

.logo {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: var(--muted);
}

.nav a {
  margin-left: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  position: relative;
  transition: color var(--transition);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #22c55e, #6366f1);
  border-radius: 999px;
  transition: width var(--transition);
}

.nav a:hover {
  color: #e5e7eb;
}

.nav a:hover::after {
  width: 100%;
}

/* Hero */

.hero {
  padding: 4.5rem 0 3.5rem;
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.2fr);
  gap: 3rem;
  align-items: center;
}

.hero-tag {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 4vw, 3.1rem);
  margin: 0 0 0.6rem;
}

.hero h1 span {
  background: linear-gradient(120deg, #22c55e, #6366f1, #ec4899);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-subtitle {
  max-width: 32rem;
  color: var(--muted);
  margin-bottom: 1.6rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.btn.primary {
  background: linear-gradient(120deg, #22c55e, #6366f1);
  color: #0b1020;
  font-weight: 600;
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.45);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 50px rgba(79, 70, 229, 0.6);
}

.btn.cv {
  background: linear-gradient(120deg, #a7c522, #f1636f);
  color: #0b1020;
  font-weight: 600;
  box-shadow: 0 18px 40px rgba(70, 229, 142, 0.45);
}
.btn.cv:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 50px rgba(70, 229, 142, 0.6);
}

.btn.secondary {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.35);
}

.btn.secondary:hover {
  background: rgba(15, 23, 42, 1);
  border-color: #6366f1;
  box-shadow: 0 10px 15px rgba(73, 70, 229, 0.6);
}

.hero-photo {
  display: flex;
  justify-content: center;
}
.hero-img {
  width: 220px;
  height: 220px;
  border-radius: 28px;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-soft);
}

.photo-placeholder {
  width: 220px;
  height: 220px;
  border-radius: 28px;
  background: radial-gradient(circle at 20% 0, #22c55e 0, transparent 55%), radial-gradient(circle at 80% 100%, #6366f1 0, transparent 55%), #020617;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

/* Secciones generales */

.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 55%), #020617;
}

.section h2 {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
}

.section p {
  color: var(--muted);
}

/* Habilidades */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.4rem;
}

.skill-card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 1.2rem 1.1rem;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.7);
}

.skill-card h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: 1rem;
}

.skill-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.skill-card li {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

/* Proyectos */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 1.3rem 1.2rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(96, 165, 250, 0.18), transparent 55%);
  opacity: 0;
  transition: opacity var(--transition);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.project-card p {
  margin: 0.2rem 0;
}

.project-tech {
  font-size: 0.8rem;
  color: #a5b4fc;
  margin-top: 0.4rem;
}

.project-links {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.9rem;
}

.project-links a {
  font-size: 0.85rem;
  color: #93c5fd;
  text-decoration: none;
  position: relative;
}

.project-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 0;
  height: 1px;
  background: #93c5fd;
  transition: width var(--transition);
}

.project-links a:hover::after {
  width: 100%;
}

.project-logo {
  width: 48px;
  height: 48px;
  margin-bottom: 0.8rem;
}

.project-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  padding: 4px;
  border: 1px solid rgba(148,163,184,0.25);
}


/* Experiencia */

.timeline {
  border-left: 1px solid rgba(148, 163, 184, 0.35);
  margin-left: 0.6rem;
  padding-left: 1.4rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.4rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.05rem;
  top: 0.25rem;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(120deg, #22c55e, #6366f1);
  box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.25);
}

.timeline h3 {
  margin: 0;
  font-size: 1rem;
}

.timeline-date {
  display: inline-block;
  margin-top: 0.15rem;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Contacto */

.contact-info {
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.4rem;
  background: rgba(15, 23, 42, 0.95);
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 1.4rem 1.3rem;
}

.contact-form .form-group:nth-child(3) {
  grid-column: 1 / -1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

label {
  font-size: 0.85rem;
  color: var(--muted);
}

input,
textarea {
  background: #020617;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 0.55rem 0.7rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input:focus,
textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4);
  background: #020617;
}

/* Footer */

.footer {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding: 1.4rem 0 1.6rem;
  background: #020617;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color var(--transition);
}

.social-links a:hover {
  color: #e5e7eb;
}

/* Responsivo */

@media (max-width: 800px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hero-photo {
    order: -1;
    margin-bottom: 1.5rem;
  }

  .nav {
    display: none; /* Para algo simple; podrías luego hacer un menú hamburguesa */
  }

  .contact-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .hero {
    padding-top: 3.2rem;
  }

  .section {
    padding: 2.8rem 0;
  }
}