/* ===== VARIABLES ===== */
:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --border: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: rgba(59, 130, 246, 0.1);
  --font: 'Inter', system-ui, sans-serif;
  --radius: 10px;
  --transition: 0.25s ease;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --nav-height: 64px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  /* scroll-behavior smooth se maneja vía JS para no pelear con snap */
}

body {
  font-family: var(--font);
  background-color: var(--bg-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cpath d='M10 10 h20 v10 h10 v20 h-10 v10 h-20 v-10 h-10 v-20 h10 z' fill='none' stroke='%233b82f6' stroke-width='0.4' opacity='0.18'/%3E%3Ccircle cx='10' cy='10' r='2' fill='%233b82f6' opacity='0.22'/%3E%3Ccircle cx='50' cy='10' r='1.5' fill='%233b82f6' opacity='0.18'/%3E%3Ccircle cx='90' cy='50' r='2' fill='%233b82f6' opacity='0.22'/%3E%3Ccircle cx='50' cy='90' r='1.5' fill='%238b5cf6' opacity='0.18'/%3E%3Ccircle cx='10' cy='90' r='2' fill='%233b82f6' opacity='0.2'/%3E%3Cpath d='M50 10 h30' fill='none' stroke='%233b82f6' stroke-width='0.4' opacity='0.15'/%3E%3Cpath d='M80 10 v30' fill='none' stroke='%233b82f6' stroke-width='0.4' opacity='0.15'/%3E%3Cpath d='M10 50 h20' fill='none' stroke='%238b5cf6' stroke-width='0.4' opacity='0.13'/%3E%3Cpath d='M10 90 v-30' fill='none' stroke='%233b82f6' stroke-width='0.4' opacity='0.15'/%3E%3Cpath d='M50 90 h30' fill='none' stroke='%238b5cf6' stroke-width='0.4' opacity='0.13'/%3E%3Crect x='44' y='44' width='12' height='12' rx='2' fill='none' stroke='%233b82f6' stroke-width='0.5' opacity='0.2'/%3E%3C/svg%3E");
  background-size: 100px 100px;
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;

  /* Scroll snap en el body */
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ===== LAYOUT ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Cada sección ocupa exactamente la pantalla y hace snap */
.section,
.hero {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.section::-webkit-scrollbar { display: none; }

/* La sección contacto agrupa el footer dentro — juntos ocupan 100vh */
#contact {
  height: auto;
  min-height: unset;
  flex: 1;
  justify-content: center;
  overflow-y: visible;
}
.contact-snap-wrapper {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
}
.contact-snap-wrapper::-webkit-scrollbar { display: none; }

.section { padding: 96px 0; }
.section-alt {
  background-color: var(--bg-secondary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cpath d='M10 10 h20 v10 h10 v20 h-10 v10 h-20 v-10 h-10 v-20 h10 z' fill='none' stroke='%233b82f6' stroke-width='0.4' opacity='0.12'/%3E%3Ccircle cx='10' cy='10' r='2' fill='%233b82f6' opacity='0.16'/%3E%3Ccircle cx='50' cy='10' r='1.5' fill='%233b82f6' opacity='0.12'/%3E%3Ccircle cx='90' cy='50' r='2' fill='%233b82f6' opacity='0.16'/%3E%3Ccircle cx='50' cy='90' r='1.5' fill='%238b5cf6' opacity='0.12'/%3E%3Ccircle cx='10' cy='90' r='2' fill='%233b82f6' opacity='0.14'/%3E%3Cpath d='M50 10 h30' fill='none' stroke='%233b82f6' stroke-width='0.4' opacity='0.1'/%3E%3Cpath d='M80 10 v30' fill='none' stroke='%233b82f6' stroke-width='0.4' opacity='0.1'/%3E%3Cpath d='M10 50 h20' fill='none' stroke='%238b5cf6' stroke-width='0.4' opacity='0.09'/%3E%3Cpath d='M10 90 v-30' fill='none' stroke='%233b82f6' stroke-width='0.4' opacity='0.1'/%3E%3Cpath d='M50 90 h30' fill='none' stroke='%238b5cf6' stroke-width='0.4' opacity='0.09'/%3E%3Crect x='44' y='44' width='12' height='12' rx='2' fill='none' stroke='%233b82f6' stroke-width='0.5' opacity='0.14'/%3E%3C/svg%3E");
  background-size: 100px 100px;
}

/* ===== TYPOGRAPHY ===== */
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  margin-top: 10px;
  border-radius: 2px;
}
.section-subtitle {
  color: var(--text-secondary);
  margin-bottom: 52px;
  font-size: 1.05rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-2px); }
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-full { width: 100%; justify-content: center; }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 100;
  transition: background var(--transition), box-shadow var(--transition);
}
.navbar.scrolled {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}
.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.accent { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 36px;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--text-primary); }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ===== HERO ===== */
.hero {
  /* height:100vh + snap vienen de la regla global */
  padding: 0;
  position: relative;
  justify-content: center;   /* centrado vertical (flex-direction:column de la regla global) */
}

.hero-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--nav-height) 24px 0;
  display: flex;
  align-items: center;
  gap: 48px;
  flex: 1;
}

/* Glow radial de fondo */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -10%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero-content { flex: 1; min-width: 0; }
.hero-greeting {
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero-name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.hero-title {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 2em;
}
.typed-prefix { color: var(--text-secondary); }
.typed-text { color: var(--accent); font-weight: 600; }
.typed-cursor {
  color: var(--accent);
  font-weight: 300;
  animation: blink 0.85s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
.hero-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 480px;
  margin-bottom: 36px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Hero decoration */
.hero-decoration { flex: 1; min-width: 0; display: flex; justify-content: center; align-items: center; }

.code-window {
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(59,130,246,0.08);
}
.code-titlebar {
  background: #2d3748;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }
.code-filename {
  margin-left: auto;
  font-size: 0.75rem;
  color: #64748b;
  font-family: 'Courier New', monospace;
}
.code-block {
  background: #0d1117;
  padding: 24px 28px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 2.1;
  display: flex;
  flex-direction: column;
}
.code-line {
  display: block;
  opacity: 0;
  transform: translateX(-8px);
  animation: codeFadeIn 0.4s ease forwards;
}
.cl-delay-1 { animation-delay: 0.3s; }
.cl-delay-2 { animation-delay: 0.7s; }
.cl-delay-3 { animation-delay: 1.1s; }
.cl-delay-4 { animation-delay: 1.5s; }
.cl-delay-5 { animation-delay: 1.9s; }
.cl-delay-6 { animation-delay: 2.3s; }
.cl-delay-7 { animation-delay: 2.7s; }

@keyframes codeFadeIn {
  to { opacity: 1; transform: translateX(0); }
}

.kw { color: #c792ea; }
.str { color: #c3e88d; }
.code-comment { color: #546e7a; font-style: italic; }

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 64px;
  align-items: start;
}
.about-text { margin-bottom: 32px; }
.about-text p { color: var(--text-secondary); margin-bottom: 16px; }
.about-text strong { color: var(--text-primary); }

/* Foto */
.about-photo-col { display: flex; justify-content: center; }
.about-photo-wrap {
  position: relative;
  width: 200px;
  height: 200px;
}
.about-photo-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.5;
  animation: photoRingPulse 3s ease-in-out infinite;
}
@keyframes photoRingPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50%       { transform: scale(1.04); opacity: 0.9; }
}
.about-photo-placeholder {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.about-photo-placeholder svg { width: 100px; height: 100px; }
.about-photo-img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  display: block;
}

/* Value cards */
.value-cards { display: flex; flex-direction: column; gap: 12px; }
.value-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color var(--transition), transform var(--transition);
}
.value-card:hover { border-color: var(--accent); transform: translateX(4px); }
.value-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.value-card strong { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.value-card p { color: var(--text-secondary); font-size: 0.85rem; margin: 0; }

/* ===== SERVICES ===== */
#services.section { padding: calc(var(--nav-height) + 24px) 0 24px; }
#services .section-subtitle { margin-bottom: 24px; }

.services-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.service-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.service-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.service-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-light);
  border: 1px solid rgba(59,130,246,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.service-icon-wrap svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}
.service-title {
  font-size: 1rem;
  font-weight: 700;
}
.service-desc {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.5;
}
.service-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.service-list li {
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding-left: 14px;
  position: relative;
}
.service-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
}

/* ===== PROJECTS ===== */

/* Padding reducido para que todo entre en 100vh */
#projects.section { padding: calc(var(--nav-height) + 24px) 0 24px; }
#projects .section-subtitle { margin-bottom: 20px; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);   /* siempre 2 columnas → 2×2 */
  gap: 16px;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;                            /* layout horizontal dentro de la card */
  flex-direction: row;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.project-img {
  position: relative;
  width: 110px;
  flex-shrink: 0;
  overflow: hidden;
}
.project-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.placeholder-green  { background: linear-gradient(135deg, #14532d 0%, #1e293b 100%); }
.placeholder-pink   { background: linear-gradient(135deg, #4a1942 0%, #1e293b 100%); }
.placeholder-blue   { background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%); }
.placeholder-purple { background: linear-gradient(135deg, #2e1a5e 0%, #1e293b 100%); }
.placeholder-orange { background: linear-gradient(135deg, #7c2d12 0%, #1e293b 100%); }
.project-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.project-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.project-desc { color: var(--text-secondary); font-size: 0.8rem; margin-bottom: 10px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ===== SKILLS ===== */
.skills-categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: start;
}
.skill-group {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition);
}
.skill-group:hover { border-color: var(--accent); }
.skill-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skill-item {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color var(--transition), transform var(--transition);
}
.skill-item:hover { border-color: var(--accent); transform: translateX(3px); }
.skill-icon { font-size: 1rem; flex-shrink: 0; }
.skill-item i {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}
/* Next.js icon es blanco por defecto — forzar color visible */
.devicon-nextjs-plain { color: var(--text-primary); }

/* ===== CONTACT ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  align-items: start;
}
.contact-info { display: flex; flex-direction: column; gap: 20px; }
.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.contact-card strong { display: block; font-size: 0.875rem; margin-bottom: 2px; }
.contact-card span   { font-size: 0.82rem; color: var(--text-secondary); }
.contact-icon { font-size: 1.5rem; flex-shrink: 0; }
.contact-available {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: #4ade80;
  font-weight: 500;
}
.available-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
  animation: availablePulse 2s ease-in-out infinite;
}
@keyframes availablePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2); }
  50%       { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0.08); }
}
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); }
.form-group input,
.form-group textarea {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color var(--transition);
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-secondary); opacity: 0.6; }
.form-feedback { font-size: 0.875rem; margin-top: 8px; min-height: 1.2em; }
.feedback-ok  { color: #4ade80; }
.feedback-err { color: #f87171; }

/* ===== PROCESO ===== */
#process.section { padding: calc(var(--nav-height) + 24px) 0 32px; }
.process-grid {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.process-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), transform var(--transition);
}
.process-step:hover { border-color: var(--accent); transform: translateY(-4px); }
.process-number {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 12px;
}
.process-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-light);
  border: 1px solid rgba(59,130,246,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.process-icon svg {
  width: 26px;
  height: 26px;
  color: var(--accent);
}
.process-title { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.process-desc { color: var(--text-secondary); font-size: 0.82rem; line-height: 1.6; }
.process-arrow {
  font-size: 1.5rem;
  color: var(--accent);
  opacity: 0.4;
  padding: 0 8px;
  flex-shrink: 0;
  align-self: center;
}

/* ===== FAQ ===== */
#faq.section { padding: calc(var(--nav-height) + 24px) 0 32px; }
.faq-grid { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}
.faq-item:hover { border-color: var(--accent); }
.faq-question {
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background var(--transition);
}
.faq-question:hover { background: var(--bg-card); }
.faq-icon {
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform var(--transition);
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 20px;
  background: var(--bg-secondary);
}
.faq-item.open .faq-answer {
  max-height: 200px;
  padding: 0 20px 16px;
}
.faq-answer p { color: var(--text-secondary); font-size: 0.875rem; line-height: 1.7; }

/* ===== WHATSAPP FLOTANTE ===== */
.whatsapp-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  background: #25d366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  z-index: 300;
  transition: transform var(--transition), box-shadow var(--transition);
}
.whatsapp-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37,211,102,0.6);
}

/* ===== FORM MEJORADO ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group select {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  width: 100%;
  cursor: pointer;
  transition: border-color var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.form-group select:focus { outline: none; border-color: var(--accent); }
.form-group select option { background: var(--bg-secondary); }

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* ===== SCROLL DOTS (navegación lateral) ===== */
.scroll-dots {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}
.scroll-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.scroll-dot:hover   { background: var(--text-secondary); }
.scroll-dot.active  { background: var(--accent); transform: scale(1.4); }

/* ===== ANIMATIONS ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */

/* ── Tablet (≤900px) ── */
@media (max-width: 900px) {
  .services-grid     { grid-template-columns: repeat(2, 1fr); }
  .skills-categories { grid-template-columns: repeat(2, 1fr); }
  .about-grid     { grid-template-columns: 1fr; gap: 32px; }
  .about-photo-col { justify-content: center; }
  .contact-grid   { grid-template-columns: 1fr; gap: 32px; }

  .hero-inner {
    flex-direction: column;
    text-align: center;
    padding-top: calc(var(--nav-height) + 32px);
    padding-bottom: 32px;
    gap: 24px;
    overflow-y: auto;
  }
  .hero-desc    { margin: 0 auto 28px; }
  .hero-actions { justify-content: center; }
  .hero-decoration { width: 100%; max-width: 420px; margin: 0 auto; }
  .code-block   { font-size: 0.8rem; }
}

/* ── Mobile (≤640px) ── */
@media (max-width: 640px) {

  /* Desactivar scroll-snap en mobile — el snap fijo rompe en iOS Safari */
  body {
    height: auto;
    overflow-y: auto;
    scroll-snap-type: none;
  }
  .section,
  .hero,
  .contact-snap-wrapper {
    height: auto;
    min-height: 100svh;          /* svh = small viewport height, respeta barra del navegador */
    scroll-snap-align: none;
    scroll-snap-stop: unset;
    overflow-y: visible;
    justify-content: flex-start;
  }
  #contact { min-height: auto; }

  /* Padding general de secciones */
  .section          { padding: 80px 0 48px; }
  #services.section,
  #projects.section { padding: calc(var(--nav-height) + 16px) 0 32px; }
  #services .section-subtitle,
  #projects .section-subtitle { margin-bottom: 16px; }

  /* Navbar */
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--bg-secondary);
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    z-index: 99;
  }
  .nav-links.open a { font-size: 1.05rem; color: var(--text-primary); }
  .nav-toggle { display: flex; }

  /* Dots — ocultar en mobile */
  .scroll-dots { display: none; }

  /* Hero */
  .hero { justify-content: center; }
  .hero-inner {
    padding-top: calc(var(--nav-height) + 24px);
    padding-bottom: 40px;
    gap: 32px;
  }
  .hero-name  { font-size: 2.4rem; }
  .hero-title { font-size: 1rem; }
  .hero-desc  { font-size: 0.95rem; }
  .hero-decoration { display: none; }   /* ocultar código en mobile — libera espacio */

  /* Sobre mí */
  .about-photo-wrap { width: 140px; height: 140px; }
  .about-photo-placeholder,
  .about-photo-img  { width: 140px; height: 140px; }
  .about-text p { font-size: 0.9rem; }
  .value-card   { padding: 12px 14px; }

  /* Servicios */
  .services-grid { grid-template-columns: 1fr; gap: 12px; }
  .service-card  { padding: 18px 16px; gap: 10px; }
  .service-list  { display: none; }     /* en mobile solo título + descripción */

  /* Proyectos */
  .projects-grid { grid-template-columns: 1fr; gap: 12px; }
  .project-card  { flex-direction: row; }
  .project-img   { width: 90px; flex-shrink: 0; }

  /* Skills */
  .skills-categories { grid-template-columns: 1fr; }
  .skills-grid { flex-direction: row; flex-wrap: wrap; }

  /* Proceso */
  .process-grid { flex-direction: column; }
  .process-arrow { transform: rotate(90deg); align-self: center; }
  /* FAQ */
  .faq-grid { gap: 8px; }
  /* Formulario */
  .form-row { grid-template-columns: 1fr; }
  /* WhatsApp */
  .whatsapp-btn { bottom: 16px; right: 16px; width: 48px; height: 48px; }
  /* Contacto */
  .contact-grid { gap: 24px; }
  .contact-form .form-group textarea { rows: 3; }

  /* Tipografía general */
  .section-title { font-size: 1.6rem; }
  .section-subtitle { font-size: 0.9rem; margin-bottom: 20px; }
}
