/* =========================================================
   Realidad Aumentada Ecuador · styles.css
   Camaleón Diseño Visual · Fondo oscuro + amarillo
   Compatible con index.html y curso.html
   ========================================================= */

/* ---------- 1. Variables ---------- */
:root {
  --yellow: #FFD60A;
  --yellow-soft: #FFE66D;
  --yellow-deep: #F5B700;
  --yellow-rgb: 255, 214, 10;
  --bg: #0A0A0D;
  --bg2: #121216;
  --card: #17171D;
  --ink: #FFFFFF;
  --muted: #B8B8C2;
  --on-yellow: #1A1500;
  --line: rgba(255, 255, 255, .1);
  --r: 20px;
  --head: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --header-h: 76px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}

img, video, svg, iframe { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul, ol { margin: 0; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: .5rem 1rem;
  background: var(--yellow);
  color: var(--on-yellow);
  font-weight: 700;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- 3. Utilidades y tipografía ---------- */
.container { width: min(1180px, 92%); margin-inline: auto; }
.narrow { width: min(820px, 92%); margin-inline: auto; }
.section { position: relative; padding: clamp(4.5rem, 9vw, 7.5rem) 0; }
.section.alt { background: var(--bg2); }

h1, h2, h3 {
  font-family: var(--head);
  line-height: 1.12;
  letter-spacing: -.01em;
  margin: 0 0 .6rem;
  color: var(--ink);
}
h1 { font-size: clamp(2.5rem, 6vw, 4.6rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }

p { margin: 0 0 1rem; color: var(--muted); }

.lead {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  color: var(--ink);
  max-width: 620px;
}

.grad {
  background: linear-gradient(90deg, var(--yellow-soft), var(--yellow), var(--yellow-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--yellow);
}

.head { max-width: 720px; margin-bottom: 3rem; }

/* ---------- 4. Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .9rem 1.6rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--yellow);
  color: var(--on-yellow);
  box-shadow: 0 12px 30px -12px rgba(var(--yellow-rgb), .65);
}
.btn-primary:hover { background: var(--yellow-soft); }

.btn-ghost {
  border-color: rgba(255, 255, 255, .35);
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--yellow); color: var(--yellow); }

.btn-small {
  min-height: 40px;
  padding: .55rem 1.1rem;
  background: var(--yellow);
  color: var(--on-yellow);
}

.btn-block { width: 100%; margin: 1.2rem 0 2rem; }

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.8rem;
}

/* ---------- 5. Encabezado fijo ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 1rem 4%;
  background: rgba(10, 10, 13, .6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header.is-scrolled {
  border-color: var(--line);
  background: rgba(10, 10, 13, .92);
}

.logo { display: inline-flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.logo-img { height: 44px; width: auto; max-width: 200px; }

.main-nav { display: flex; align-items: center; gap: 1.4rem; }
.main-nav a:not(.btn) { font-size: .95rem; text-decoration: none; }
.main-nav a:not(.btn):hover,
.main-nav a[aria-current="page"]:not(.btn) { color: var(--yellow); }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 6px auto;
  background: var(--ink);
}

/* ---------- 6. Hero (página de inicio) ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 7rem 0 4rem;
  overflow: hidden;
  background: var(--bg);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% center;
}

/* Capa oscura de izquierda a derecha para el titular */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(10, 10, 13, .95) 0%,
    rgba(10, 10, 13, .75) 38%,
    rgba(10, 10, 13, .1) 70%,
    rgba(10, 10, 13, 0) 100%
  );
}

.hero-inner { position: relative; z-index: 2; }
.hero-copy { max-width: 620px; }
.hero h1 { text-shadow: 0 2px 20px rgba(0, 0, 0, .5); }

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.3rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: .95rem;
}
.trust li::before { content: "✓ "; color: var(--yellow); font-weight: 700; }

/* ---------- 7. Página del curso (curso.html) ---------- */
.page-hero {
  padding: 9rem 0 4rem;
  background:
    radial-gradient(60% 50% at 80% 0%, rgba(var(--yellow-rgb), .12), transparent 70%),
    var(--bg);
}
.page-hero h1 { max-width: 16ch; }

/* ---------- 8. Sectores ---------- */
.sectors { padding: 1.4rem 0; border-block: 1px solid var(--line); }
.sectors ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .8rem 2.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ---------- 9. Layouts ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; }

/* Tres columnas por fila (Beneficios, Servicios y Proyectos) */
.grid.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.callout {
  margin-top: 2.5rem;
  padding: 1.2rem 1.6rem;
  border-left: 4px solid var(--yellow);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}

/* ---------- 10. Tarjetas ---------- */
.card {
  padding: 1.8rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  transition: transform .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-6px); border-color: rgba(var(--yellow-rgb), .55); }
.card h3 { color: var(--ink); }

.num {
  margin-bottom: .6rem;
  font-family: var(--head);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--yellow);
}

/* ---------- 11. VPS ---------- */
.steps { display: grid; gap: 1.2rem; margin: 2rem 0; padding: 0; list-style: none; }
.steps li { display: flex; align-items: flex-start; gap: 1rem; }
.step-n {
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--on-yellow);
  font-weight: 800;
}
.steps h3 { margin-bottom: .2rem; }
.steps p { margin: 0; }

.use-cases { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.use-cases li {
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.use-cases h3 { margin-bottom: .4rem; color: var(--yellow); font-size: 1.1rem; }
.use-cases p { margin: 0; }

/* ---------- 12. Listas con check ---------- */
.checks { display: grid; gap: .6rem; margin: 1.2rem 0 2rem; padding: 0; list-style: none; }
.checks li { position: relative; padding-left: 1.8rem; color: var(--ink); }
.checks li::before { content: "✦"; position: absolute; left: 0; color: var(--yellow); }

/* ---------- 13. Videos (miniatura real de YouTube; carga al hacer clic) ---------- */
.video {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background:
    radial-gradient(circle at 30% 30%, rgba(var(--yellow-rgb), .22), transparent 60%),
    linear-gradient(135deg, #1a1a20, #0A0A0D);
}

/* Miniatura del video original de YouTube, recortada para llenar el recuadro 16:9 */
.video-thumb {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Oscurece un poco la miniatura para que el botón y el texto se lean */
.video.has-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(rgba(0, 0, 0, .10), rgba(0, 0, 0, .55));
  pointer-events: none;
}

.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 3; }

.video-play {
  position: relative;
  z-index: 2;
  width: 76px;
  height: 76px;
  border: 0;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--on-yellow);
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 0 0 12px rgba(var(--yellow-rgb), .15);
  transition: transform .2s ease;
}
.video-play:hover { transform: scale(1.06); }

.video-note {
  position: absolute;
  bottom: .8rem;
  left: 0;
  right: 0;
  z-index: 2;
  margin: 0;
  text-align: center;
  font-size: .85rem;
  color: var(--muted);
}
.video.has-thumb .video-note { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }

.video.is-placeholder .video-play { opacity: .4; }

/* ---------- 14. Proyectos ---------- */
.case { margin: 0; }
.case figcaption { margin-top: .8rem; color: var(--muted); font-size: .95rem; }
.case figcaption strong { color: var(--ink); }

/* ---------- 15. Datos del curso ---------- */
.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .8rem 1.4rem;
  margin: 0;
  padding: 1.8rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.facts dt { color: var(--yellow); font-weight: 700; }
.facts dd { margin: 0; color: var(--ink); }

/* Variante en fila (curso.html): cada dato es un bloque */
.facts.facts-row {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-top: 2.5rem;
}
.facts-row > div { display: grid; gap: .2rem; }

.instructor { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.instructor h3 { color: var(--ink); }

.callout-box {
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.callout-box p { margin-bottom: 0; }

/* ---------- 16. Preguntas frecuentes ---------- */
details { padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
summary {
  position: relative;
  padding-right: 2.2rem;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  top: -.15rem;
  right: 0;
  color: var(--yellow);
  font-size: 1.6rem;
}
details[open] summary::after { content: "−"; }
details p { margin: .9rem 0 0; }

/* ---------- 17. Contacto y mapa ---------- */
address {
  display: grid;
  gap: .5rem;
  margin: 1.5rem 0 2rem;
  font-style: normal;
  color: var(--muted);
}
address p { margin: 0; }
address a { color: var(--ink); }
address a:hover { color: var(--yellow); }

.map-wrap {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.map-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- 18. Pie de página ---------- */
.site-footer { padding: 2rem 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer-inner p { margin: 0; font-size: .95rem; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.footer-inner a { font-size: .95rem; text-decoration: none; }
.footer-inner a:hover { color: var(--yellow); }

/* ---------- 19. WhatsApp flotante ---------- */
.wa-float {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 60;
  padding: .8rem 1.2rem;
  border-radius: 999px;
  background: #25d366;
  color: #04130d;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 30px -8px rgba(37, 211, 102, .7);
}

/* ---------- 20. Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 21. Responsive ---------- */
@media (max-width: 1024px) {
  .main-nav { gap: 1rem; }
  .main-nav a:not(.btn) { font-size: .9rem; }
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 2.5rem; }
  .grid.grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .menu-toggle { display: block; }

  /* Acepta "is-open" (este CSS) y "open" (main.js) */
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1.5rem 4%;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .main-nav.is-open,
  .main-nav.open { display: flex; }
  .main-nav a:not(.btn) { font-size: 1.05rem; }

  .hero { min-height: 92vh; align-items: flex-end; padding-bottom: 3rem; }
  .hero-bg { object-position: 75% center; }
  .hero::after {
    background: linear-gradient(
      180deg,
      rgba(10, 10, 13, .35) 0%,
      rgba(10, 10, 13, .85) 55%,
      rgba(10, 10, 13, .97) 100%
    );
  }
  .hero-copy { max-width: none; }
}

@media (max-width: 600px) {
  .grid.grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .site-header { padding-inline: 5%; }
  .logo-img { height: 36px; max-width: 170px; }
  .cta-group .btn { width: 100%; }
  .facts { grid-template-columns: 1fr; gap: .2rem; }
  .facts dt { margin-top: .8rem; }
  .facts dt:first-child { margin-top: 0; }
  .facts.facts-row { grid-template-columns: 1fr; }
  .callout-box { padding: 1.4rem; }
  .page-hero { padding-top: 7.5rem; }
  .wa-float { right: .8rem; bottom: .8rem; }
}
