/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --surface: #ffffff;
  --border: #e4e8f0;
  --text: #171b28;
  --text-muted: #5b6474;
  --accent: #2946c9;
  --accent-dark: #1d3399;
  --accent-soft: #eaeefc;
  --shadow: 0 10px 30px -12px rgba(23, 27, 40, 0.12);
  --radius: 16px;
  --max-width: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10131c;
    --bg-alt: #161a26;
    --surface: #1a1f2e;
    --border: #2a3040;
    --text: #eef0f6;
    --text-muted: #9aa2b4;
    --accent: #6c8bff;
    --accent-dark: #8ba0ff;
    --accent-soft: #1e2540;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5);
  }
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { padding: 0; margin: 0; list-style: none; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px -6px rgba(41, 70, 201, 0.5);
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  margin-top: 20px;
}
.btn-outline:hover { background: var(--accent-soft); }

.btn-small { padding: 10px 20px; font-size: 0.88rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 40px;
  width: auto;
  border-radius: 8px;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav a:not(.btn) { color: var(--text-muted); transition: color 0.15s ease; }
.nav a:not(.btn):hover { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 22px;
  background: var(--text);
  margin: 0 auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 100px 0 90px;
  background: #0a0c12;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(700px 400px at 85% -10%, rgba(108, 139, 255, 0.18), transparent),
    linear-gradient(180deg, rgba(10, 12, 18, 0.72), rgba(10, 12, 18, 0.6) 45%, rgba(10, 12, 18, 0.88));
}

@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 56px;
}

.hero-content { max-width: 600px; flex-shrink: 0; }

.eyebrow {
  color: #8fa5ff;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: #ffffff;
}

.hero-lead {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.72);
  max-width: 560px;
  margin-bottom: 36px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero .btn-ghost {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
}
.hero .btn-ghost:hover {
  border-color: #ffffff;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.hero-photo {
  flex-shrink: 0;
  position: relative;
  width: 280px;
  height: 280px;
}

.hero-photo::before {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), rgba(108, 139, 255, 0.05));
  opacity: 0.6;
  z-index: 0;
}

.hero-photo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
}

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }

.section-eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  max-width: 640px;
}

.section-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin-bottom: 48px;
}

/* ---------- Quién soy ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 56px;
  align-items: start;
  margin-top: 32px;
}

.about-text p { color: var(--text-muted); margin-bottom: 18px; font-size: 1.02rem; }
.about-text p:last-child { margin-bottom: 0; }

.about-cards { display: flex; flex-direction: column; gap: 16px; }

.mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-card-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-weight: 700;
}

.mini-card-value { font-weight: 600; font-size: 0.98rem; }

/* ---------- Servicios ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
  align-items: stretch;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.service-card-featured {
  border-color: var(--accent);
  box-shadow: 0 16px 40px -14px rgba(41, 70, 201, 0.35);
}

.service-number {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.service-card h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 10px; }

.service-tagline { font-weight: 600; margin-bottom: 14px; }

.service-card > p { color: var(--text-muted); font-size: 0.96rem; margin-bottom: 16px; }

.service-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.service-note { font-weight: 600; font-size: 0.9rem; margin-bottom: 12px; }

.service-topics {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  flex-grow: 1;
}

.service-topics li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-left: 20px;
  position: relative;
}

.service-topics li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.service-card .btn { margin-top: auto; align-self: flex-start; }

/* ---------- Cómo trabajo ---------- */
.problems-block { margin-bottom: 56px; }

.problems-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 24px;
  max-width: 560px;
}

.problems-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 40px;
  margin-bottom: 28px;
}

.problem-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.problem-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.problem-item p { color: var(--text-muted); font-size: 0.98rem; margin-top: 3px; }

.problems-lead { font-weight: 700; font-size: 1.15rem; }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 16px;
}

.step-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.step-card p { color: var(--text-muted); font-size: 0.92rem; }

/* ---------- Links grid (Portfolio) & Contact ---------- */
.links-grid, .contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.contact-grid { grid-template-columns: repeat(3, 1fr); }

.link-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.link-card:hover, .contact-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

/* Portfolio preview banners */
.link-preview {
  position: relative;
  height: 110px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.preview-watermark {
  position: absolute;
  right: -10px;
  bottom: -14px;
  width: 78px;
  height: 78px;
  color: #fff;
  opacity: 0.16;
}

.link-card:hover .preview-watermark { transform: scale(1.08); }

.link-body {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
}

/* LinkedIn */
.preview-linkedin { background: linear-gradient(135deg, #0a66c2, #0e4b8f); }
.preview-mock { display: flex; align-items: center; gap: 12px; padding: 0 22px; width: 100%; }
.preview-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.9); flex-shrink: 0;
}
.preview-lines { display: flex; flex-direction: column; gap: 7px; flex-grow: 1; }
.preview-lines span { display: block; height: 6px; border-radius: 4px; background: rgba(255,255,255,0.55); }
.preview-lines span:nth-child(1) { width: 70%; }
.preview-lines span:nth-child(2) { width: 90%; }
.preview-lines span:nth-child(3) { width: 50%; background: rgba(255,255,255,0.35); }

/* Instagram */
.preview-instagram { background: linear-gradient(135deg, #f9ce34, #ee2a7b 55%, #6228d7); justify-content: center; }
.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 26px);
  grid-template-rows: repeat(2, 26px);
  gap: 6px;
}
.preview-grid span { border-radius: 7px; background: rgba(255,255,255,0.85); }
.preview-grid span:nth-child(2) { background: rgba(255,255,255,0.55); }
.preview-grid span:nth-child(3) { background: rgba(255,255,255,0.4); }

/* YouTube */
.preview-youtube { background: linear-gradient(135deg, #2a0a0a, #1a1a1a); justify-content: center; }
.preview-play {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.preview-play-triangle {
  width: 0; height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid #fff;
  margin-left: 4px;
}
.preview-play-triangle.small {
  border-top-width: 6px; border-bottom-width: 6px; border-left-width: 9px; margin-left: 2px;
}

/* Udemy */
.preview-udemy { background: linear-gradient(135deg, #1c1d1f, #6a2fc7); }
.preview-course-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.preview-udemy .preview-mock { align-items: center; }
.preview-progress { flex-grow: 1; height: 6px; border-radius: 4px; background: rgba(255,255,255,0.25); overflow: hidden; }
.preview-progress span { display: block; width: 65%; height: 100%; background: #fff; border-radius: 4px; }

/* ---------- Projects grid (Portfolio) ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.preview-linkedin-alt { background: linear-gradient(135deg, #0e4b8f, #082444); }

.project-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px 24px;
}

.project-tag {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.project-title { font-weight: 700; font-size: 1.05rem; }
.project-desc { color: var(--text-muted); font-size: 0.92rem; }

.contact-card-featured {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.contact-card-featured .link-sub { color: rgba(255,255,255,0.8); }
.contact-card-featured .link-icon { background: rgba(255,255,255,0.15); color: #fff; }

.link-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.link-icon svg { width: 22px; height: 22px; }

.link-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.link-title { font-weight: 700; font-size: 0.98rem; }
.link-sub { font-size: 0.85rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-top { font-weight: 600; color: var(--text); }
.footer-top:hover { color: var(--accent); }

.footer-social { display: flex; align-items: center; gap: 12px; }

.footer-social-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.footer-social-link svg { width: 17px; height: 17px; }
.footer-social-link:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .services-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .problems-grid { grid-template-columns: 1fr; }
  .links-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 760px) {
  .nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px 28px;
    gap: 18px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav .btn { width: 100%; text-align: center; }
  .nav-toggle { display: flex; }

  .hero { padding: 70px 0 50px; }
  .hero-inner { flex-direction: column-reverse; text-align: center; gap: 32px; }
  .hero-content { max-width: 100%; }
  .hero-lead { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-photo { width: 200px; height: 200px; }
  .section { padding: 64px 0; }
  .steps-grid { grid-template-columns: 1fr; }
  .links-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .footer-inner { justify-content: center; text-align: center; }
  .whatsapp-float { width: 52px; height: 52px; right: 18px; bottom: 18px; }
  .whatsapp-float svg { width: 26px; height: 26px; }
}

/* ---------- Instagram preview ---------- */
.instagram-preview { margin-top: 56px; }

.instagram-preview-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.instagram-preview-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.instagram-preview-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}
.instagram-preview-link:hover { color: var(--accent-dark); }

.instagram-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  align-items: start;
}

.instagram-grid .instagram-media {
  margin: 0 !important;
  width: 100% !important;
  min-width: 0 !important;
}

/* ---------- WhatsApp floating button ---------- */
.whatsapp-float {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 200;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25d366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.whatsapp-float svg {
  width: 30px;
  height: 30px;
}

.whatsapp-float:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.5);
}
