/* ============================================
   Fabio Infante — Personal Brand
   Paleta: dark + acentos cálidos (Claude/IA)
   ============================================ */

:root {
  /* Surfaces */
  --bg: #0a0a0f;
  --bg-elev: #101018;
  --surface: #13131c;
  --surface-2: #1a1a26;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;

  /* Brand */
  --accent: #e07856;          /* coral cálido (familia Claude) */
  --accent-soft: #f1a285;
  --accent-2: #6366f1;        /* indigo IA */
  --accent-3: #22d3ee;        /* cyan tech */

  /* Effects */
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 0 1px rgba(224, 120, 86, 0.12), 0 18px 60px -20px rgba(224, 120, 86, 0.25);

  --container: 1140px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

::selection { background: var(--accent); color: #0a0a0f; }

/* ============================================
   Background layers
   ============================================ */

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at top, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at top, black 30%, transparent 80%);
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(600px circle at 15% 0%, rgba(224, 120, 86, 0.18), transparent 60%),
    radial-gradient(700px circle at 85% 10%, rgba(99, 102, 241, 0.14), transparent 60%),
    radial-gradient(500px circle at 50% 100%, rgba(34, 211, 238, 0.08), transparent 60%);
}

/* ============================================
   Layout helpers
   ============================================ */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
  position: relative;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  margin: 8px 0 48px;
  letter-spacing: -0.02em;
}

.section-lead {
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 40px;
  font-size: 1.05rem;
}

.eyebrow {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid rgba(224, 120, 86, 0.25);
  border-radius: 999px;
  background: rgba(224, 120, 86, 0.06);
}

.accent { color: var(--accent); }

/* ============================================
   Navigation
   ============================================ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 14px 0;
  transition: background 0.3s var(--ease), backdrop-filter 0.3s var(--ease), border-color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #b85a3e);
  color: #0a0a0f;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 22px -6px rgba(224, 120, 86, 0.55);
}

.brand-name { font-size: 1rem; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.92rem;
}

.nav-links a {
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
  position: relative;
}

.nav-links a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}

/* ============================================
   Hero
   ============================================ */

.hero {
  padding: 180px 0 100px;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.hero-title {
  font-size: clamp(2.3rem, 5.4vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 24px;
}

.hero-sub {
  display: inline-block;
  background: linear-gradient(120deg, #f4f4f5 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 600;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 0 36px;
}

.hero-desc strong { color: var(--text); font-weight: 600; }

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  max-width: 720px;
}

.hero-stats > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-stats strong {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-stats span {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
  font-weight: 600;
  box-shadow: 0 8px 24px -10px rgba(224, 120, 86, 0.6);
}
.btn-primary:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ============================================
   About — two cols
   ============================================ */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 60px;
  align-items: start;
}

.col-left h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
  margin: 12px 0 0;
  line-height: 1.2;
}

.col-right p {
  color: var(--text-muted);
  margin: 0 0 18px;
  font-size: 1.02rem;
}
.col-right strong { color: var(--text); font-weight: 600; }
.col-right em { color: var(--accent-soft); font-style: normal; }

.tags {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags li {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
}

/* ============================================
   Cards (services)
   ============================================ */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(224, 120, 86, 0.08), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.card:hover::before { opacity: 1; }

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(224, 120, 86, 0.15), rgba(224, 120, 86, 0.05));
  border: 1px solid rgba(224, 120, 86, 0.25);
  color: var(--accent);
  margin-bottom: 18px;
}
.card-icon svg { width: 22px; height: 22px; }

.card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.96rem;
}

/* ============================================
   Projects
   ============================================ */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.project:hover {
  transform: translateY(-3px);
  border-color: rgba(224, 120, 86, 0.35);
}

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.project-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding: 4px 10px;
  border: 1px solid rgba(224, 120, 86, 0.25);
  border-radius: 6px;
  background: rgba(224, 120, 86, 0.05);
}

.project-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.project h3 {
  margin: 0 0 10px;
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project p {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.project-stack {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project-stack li {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  padding: 4px 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
}

.project p code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.86rem;
  padding: 1px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--accent-soft);
}

.project-link {
  display: block;
  cursor: pointer;
  color: inherit;
}

.content-item-static {
  cursor: default;
}
.content-item-static:hover {
  transform: none;
  border-color: var(--border);
  background: var(--surface);
}
.content-item-static .content-arrow {
  color: var(--text-dim);
}

/* ============================================
   Content list
   ============================================ */

.content-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.content-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.content-item:hover {
  border-color: rgba(224, 120, 86, 0.35);
  background: var(--surface-2);
  transform: translateX(4px);
}
.content-item:hover .content-arrow { color: var(--accent); transform: translateX(4px); }

.content-type {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.content-item h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--text);
}

.content-arrow {
  color: var(--text-dim);
  font-size: 1.2rem;
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}

/* ============================================
   Contact
   ============================================ */

.section-contact { padding: 80px 0 120px; }

.contact-card {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  padding: 60px 40px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.contact-card::before {
  content: "";
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 200px;
  background: radial-gradient(circle, rgba(224, 120, 86, 0.18), transparent 70%);
  pointer-events: none;
}

.contact-card .eyebrow { margin-bottom: 16px; }

.contact-card h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

.contact-card p {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 32px;
}

.contact-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.socials {
  display: flex;
  gap: 22px;
}
.socials a {
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}
.socials a:hover { color: var(--accent); }

/* ============================================
   Reveal animations
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .nav.menu-open .nav-links {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 24px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    gap: 14px;
  }

  .two-col { grid-template-columns: 1fr; gap: 24px; }
  .cards { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }

  .hero { padding: 140px 0 80px; }
  .section { padding: 70px 0; }

  .hero-stats { grid-template-columns: 1fr; gap: 18px; }
  .hero-stats strong { font-size: 1.3rem; }

  .content-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .content-arrow { display: none; }

  .contact-card { padding: 44px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ============================================
   Cursos
   ============================================ */

.courses-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.course-card {
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}
.course-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), rgba(224, 120, 86, 0.07), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.course-card:hover {
  transform: translateY(-3px);
  border-color: rgba(224, 120, 86, 0.35);
  background: var(--surface-2);
}
.course-card:hover::before { opacity: 1; }

.course-card.unlocked {
  border-color: rgba(74, 222, 128, 0.35);
}
.course-card.unlocked .course-lock {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.3);
  background: rgba(74, 222, 128, 0.06);
}
.course-card.unlocked .course-lock svg path { d: path("M8 11V7a4 4 0 0 1 8 0"); }

.course-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.course-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding: 4px 10px;
  border: 1px solid rgba(224, 120, 86, 0.25);
  border-radius: 6px;
  background: rgba(224, 120, 86, 0.05);
}

.course-lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
}

.course-card h3 {
  margin: 0 0 10px;
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.course-card p {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.course-meta span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  padding: 4px 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
}

/* ============================================
   Modal
   ============================================ */

/* ============================================
   Modal helpers (reutilizables)
   ============================================ */

.shake { animation: shake 0.4s var(--ease); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}

.modal-error {
  min-height: 1.2em;
  font-size: 0.88rem;
  color: #f87171;
}

/* Contenido del curso desbloqueado */

.course-header { margin-bottom: 24px; }
.course-header h3 { font-size: 1.5rem; margin: 8px 0 10px; }
.course-header .course-meta { margin-top: 10px; }
.course-desc {
  color: var(--text-muted);
  margin: 14px 0 0;
  font-size: 0.98rem;
}

.course-modules {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 26px;
}

.course-module {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.course-module h4 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
}
.course-module p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.93rem;
}
.course-module ul {
  margin: 0 0 12px;
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.course-module ul li { margin-bottom: 4px; }

.course-prompt {
  margin: 12px 0 0;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--accent-soft);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}
.course-prompt code { color: inherit; background: none; padding: 0; border: 0; }

.course-resources {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 22px;
}
.course-resources h4 {
  margin: 0 0 10px;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}
.course-resources ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.93rem;
}
.course-resources a {
  color: var(--accent-soft);
  transition: color 0.2s var(--ease);
}
.course-resources a:hover { color: var(--accent); }

.course-next {
  margin: 0;
  padding: 16px 18px;
  background: rgba(224, 120, 86, 0.06);
  border: 1px solid rgba(224, 120, 86, 0.2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .courses-grid { grid-template-columns: 1fr; }
}


/* ============================================
   Nav dropdowns
   ============================================ */

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-trigger {
  /* button reset */
  appearance: none;
  background: transparent;
  border: 0;
  margin: 0;
  padding: 0;
  font: inherit;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
  transition: color 0.2s var(--ease);
}
.nav-dropdown-trigger:hover,
.nav-dropdown.open .nav-dropdown-trigger {
  color: var(--text);
}

.nav-caret {
  font-size: 0.7em;
  opacity: 0.7;
  transition: transform 0.2s var(--ease);
  display: inline-block;
}

.nav-dropdown.open .nav-caret {
  transform: rotate(180deg);
}

/* Apertura por hover/focus en desktop (cubierto por bridge invisible) */
@media (hover: hover) and (min-width: 901px) {
  .nav-dropdown:hover .nav-caret,
  .nav-dropdown:focus-within .nav-caret {
    transform: rotate(180deg);
  }
  .nav-dropdown:hover .nav-dropdown-trigger,
  .nav-dropdown:focus-within .nav-dropdown-trigger {
    color: var(--text);
  }
  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  min-width: 280px;
  background: rgba(16, 16, 24, 0.96);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 18px 50px -10px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
  z-index: 110;
}

/* Bridge invisible para que al cruzar del trigger al menú no se cierre */
.nav-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
}

.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 10px;
  transition: background 0.2s var(--ease);
  color: var(--text);
  text-decoration: none;
}
.nav-dropdown-menu a:hover {
  background: rgba(224, 120, 86, 0.08);
}

.nav-dropdown-menu a.dd-all {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  margin-bottom: 4px;
  padding-bottom: 12px;
}

.dd-title {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}
.dd-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

/* ============================================
   Página de curso (curso.html)
   ============================================ */

.page-course {
  padding-top: 0;
}

.nav-simple .nav-toggle { display: none; }

/* Body class para "estamos dentro de curso.html" */
body.page-course { padding-top: 0; }

.course-page {
  padding: 140px 0 100px;
  min-height: 80vh;
}

.course-back {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  transition: color 0.2s var(--ease);
}
.course-back:hover { color: var(--accent); }

.course-gate {
  max-width: 520px;
  margin: 0 auto;
  padding: 56px 36px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.5);
}

.gate-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(224, 120, 86, 0.18), rgba(224, 120, 86, 0.05));
  border: 1px solid rgba(224, 120, 86, 0.3);
  color: var(--accent);
}

.course-gate h1 {
  margin: 0 0 10px;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.course-gate > p {
  color: var(--text-muted);
  margin: 0 auto 26px;
  max-width: 420px;
}

#course-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

#course-password {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
#course-password:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
}

#course-form .btn { width: 100%; }

/* Artículo del curso desbloqueado */

.course-article {
  max-width: 760px;
  margin: 0 auto;
}

.course-article-header { margin-bottom: 36px; }
.course-article-header .course-tag { margin-bottom: 14px; display: inline-block; }
.course-article-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.025em;
  margin: 8px 0 14px;
  line-height: 1.15;
}
.course-article-header .course-meta { margin-bottom: 18px; }
.course-article-header .course-desc {
  color: var(--text-muted);
  margin: 0;
  font-size: 1.05rem;
  max-width: 640px;
}

.course-article .course-modules {
  margin-bottom: 36px;
}

.course-article .course-module {
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}
.course-article .course-module h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.course-article .course-module p {
  margin: 0 0 14px;
  color: var(--text-muted);
}
.course-article .course-module ul {
  margin: 0 0 14px;
  padding-left: 22px;
  color: var(--text-muted);
}
.course-article .course-module ul li { margin-bottom: 6px; }

.course-article .course-resources {
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
}
.course-article .course-resources h2 {
  margin: 0 0 14px;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}
.course-article .course-resources ul { margin: 0; padding-left: 20px; }
.course-article .course-resources a {
  color: var(--accent-soft);
  transition: color 0.2s var(--ease);
}
.course-article .course-resources a:hover { color: var(--accent); }

.course-article .course-next {
  padding: 28px 30px;
  background: linear-gradient(135deg, rgba(224, 120, 86, 0.1), rgba(224, 120, 86, 0.03));
  border: 1px solid rgba(224, 120, 86, 0.25);
  border-radius: var(--radius-lg);
  text-align: center;
}
.course-article .course-next h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.course-article .course-next p {
  margin: 0 0 18px;
  color: var(--text-muted);
}

/* Móvil: dropdowns aplanados */

@media (max-width: 900px) {
  .nav-dropdown {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .nav-dropdown-trigger {
    width: 100%;
    padding: 4px 0;
    color: var(--text);
    justify-content: space-between;
  }

  .nav-dropdown-menu {
    position: static;
    transform: none !important;
    left: auto;
    right: auto;
    top: auto;
    min-width: 0;
    width: 100%;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 0;
    box-shadow: none;
    padding: 4px 0 8px 14px;
    margin: 8px 0 0;
    border-left: 2px solid var(--border);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: none;
    transition: none;
  }
  .nav-dropdown-menu::before { display: none; }

  .nav-dropdown.open .nav-dropdown-menu {
    display: flex;
  }

  .nav-dropdown-menu a {
    padding: 8px 4px;
    border-radius: 0;
  }
  .nav-dropdown-menu a:hover { background: transparent; color: var(--accent); }
  .nav-dropdown-menu a.dd-all {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 8px;
  }

  .course-gate { padding: 36px 22px; }
  .course-page { padding: 120px 0 80px; }
}


/* ============================================
   Curso · CTA empezar
   ============================================ */

.course-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.course-cta-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.btn-lg {
  padding: 16px 28px;
  font-size: 1rem;
  font-weight: 600;
}

/* ============================================
   Modo presentación (slides)
   ============================================ */

body.mode-slides {
  overflow: hidden;
}

body.mode-slides .nav,
body.mode-slides .footer,
body.mode-slides .course-back,
body.mode-slides .bg-grid,
body.mode-slides .bg-glow {
  display: none !important;
}

body.mode-slides .course-page {
  padding: 0;
}

body.mode-slides .container {
  max-width: none;
  padding: 0;
}

body.mode-slides #course-content {
  height: 100vh;
  height: 100dvh;
}

.deck {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  outline: none;
  z-index: 50;
}

.deck-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 28px;
  background: linear-gradient(to bottom, rgba(10, 10, 15, 0.85), transparent);
}

.deck-exit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(16, 16, 24, 0.6);
  backdrop-filter: blur(8px);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.deck-exit:hover { color: var(--text); border-color: var(--border-strong); }

.deck-progress {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.deck-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.4s var(--ease);
}

.deck-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(16, 16, 24, 0.6);
  backdrop-filter: blur(8px);
  min-width: 64px;
  text-align: center;
}
.deck-current { color: var(--accent); font-weight: 600; }

.deck-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
}

.slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 60px;
  overflow-y: auto;
}

.slide-inner {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
}

.slide-eyebrow {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid rgba(224, 120, 86, 0.25);
  border-radius: 999px;
  background: rgba(224, 120, 86, 0.06);
  margin-bottom: 24px;
}

/* Cover */
.slide-cover h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 20px;
  background: linear-gradient(120deg, #f4f4f5 0%, var(--accent-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.slide-cover p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 0 32px;
  line-height: 1.6;
}
.slide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 48px;
}
.slide-meta span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
}
.slide-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0;
  letter-spacing: 0.04em;
}

/* Module */
.slide-module h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 18px;
}
.slide-summary {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 24px;
  max-width: 760px;
}
.slide-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.slide-bullets li {
  position: relative;
  padding: 14px 18px 14px 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
}
.slide-bullets li::before {
  content: "▸";
  position: absolute;
  left: 18px;
  top: 14px;
  color: var(--accent);
  font-size: 0.95rem;
}

.slide-prompt {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-top: 18px;
}
.slide-prompt-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.slide-prompt pre {
  margin: 0;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.86rem;
  color: var(--accent-soft);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  line-height: 1.5;
}
.slide-prompt code { color: inherit; background: none; padding: 0; border: 0; }

/* Resources */
.slide-resources h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}
.slide-resources ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.slide-resources li a {
  display: block;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--accent-soft);
  font-size: 1rem;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}
.slide-resources li a:hover {
  border-color: rgba(224, 120, 86, 0.4);
  color: var(--accent);
  background: var(--surface-2);
}

/* Closing */
.slide-closing h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
}
.slide-closing p {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 32px;
  max-width: 700px;
}
.slide-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Botones de navegación */
.deck-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(16, 16, 24, 0.7);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  z-index: 4;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.deck-nav:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
}
.deck-nav:active { transform: translateY(-50%) scale(0.95); }
.deck-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}
.deck-prev { left: 24px; }
.deck-next { right: 24px; }

/* Responsive slides */
@media (max-width: 720px) {
  .slide { padding: 100px 24px 80px; }
  .deck-header { padding: 14px 16px; gap: 12px; }
  .deck-exit { font-size: 0.74rem; padding: 6px 10px; }
  .deck-counter { font-size: 0.74rem; padding: 6px 10px; min-width: 50px; }
  .deck-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  .deck-prev { left: 10px; }
  .deck-next { right: 10px; }
  .slide-bullets li { padding: 12px 14px 12px 38px; font-size: 0.95rem; }
  .slide-bullets li::before { left: 14px; top: 12px; }
}
