/* ============ Tokens ============ */
:root {
  --bg: #19151f;
  --bg-alt: #100d14;
  --surface: #241d2c;
  --text: #fdfaff;
  --text-muted: rgba(246, 236, 255, 0.68);
  --border: rgba(220, 207, 255, 0.15);

  --accent: #b897ff;
  --accent-2: #dccfff;
  --accent-contrast: #16101e;

  --font-body: 'Inter', system-ui, sans-serif;
  --font-display: 'Manrope', 'Inter', system-ui, sans-serif;
  --font-accent: 'Manrope', 'Inter', system-ui, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --container: 1220px;
}

/* ============ Reset ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* En % y no en px, para respetar el tamaño de letra que configuró el usuario */
html { scroll-behavior: smooth; font-size: 115%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible,
.nav a:focus-visible,
.logo:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast);
  box-shadow: 0 8px 24px -8px rgba(184, 151, 255, 0.48);
}
.btn-primary:hover { box-shadow: 0 12px 30px -8px rgba(184, 151, 255, 0.62); }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent-2); }

.btn-sm { padding: 10px 18px; font-size: 0.85rem; }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  min-width: 9.4em;
}
.logo span { color: var(--accent); }
.logo .logo-pre { color: var(--text); }
.logo-cursor { animation: logo-blink 1s step-end infinite; }
@keyframes logo-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .logo-cursor { animation: none; }
}

.nav {
  display: flex;
  gap: 32px;
}
.nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.nav a:hover { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ============ Hero ============ */
.hero {
  position: relative;
  --particle-x: 0px;
  --particle-y: 0px;
  padding: 110px 0 90px;
  overflow: hidden;
  background-image:
    linear-gradient(180deg, rgba(14, 15, 15, 0.88) 0%, rgba(14, 15, 15, 0.7) 45%, var(--bg) 100%),
    url("../assets/img/hero-bg.webp");
  background-size: cover;
  background-position: center 30%;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.46;
  background-image:
    radial-gradient(circle at 12% 28%, rgba(184, 151, 255, 0.7) 0 1px, transparent 1.8px),
    radial-gradient(circle at 25% 72%, rgba(220, 207, 255, 0.48) 0 1px, transparent 1.7px),
    radial-gradient(circle at 78% 24%, rgba(117, 216, 231, 0.58) 0 1px, transparent 1.8px),
    radial-gradient(circle at 90% 68%, rgba(184, 151, 255, 0.6) 0 1px, transparent 1.8px),
    radial-gradient(circle at 63% 82%, rgba(220, 207, 255, 0.42) 0 1px, transparent 1.6px),
    radial-gradient(circle at 38% 18%, rgba(117, 216, 231, 0.42) 0 0.9px, transparent 1.6px),
    radial-gradient(circle at 54% 56%, rgba(184, 151, 255, 0.38) 0 0.9px, transparent 1.6px),
    radial-gradient(circle at 6% 88%, rgba(220, 207, 255, 0.34) 0 0.9px, transparent 1.5px);
  background-size: 420px 360px, 520px 440px, 460px 390px, 560px 480px, 500px 420px, 390px 340px, 610px 510px, 450px 390px;
  -webkit-mask-image: radial-gradient(ellipse 88% 82% at 50% 48%, transparent 0%, transparent 18%, #000 48%, #000 100%);
  mask-image: radial-gradient(ellipse 88% 82% at 50% 48%, transparent 0%, transparent 18%, #000 48%, #000 100%);
  transform: translate3d(var(--particle-x), var(--particle-y), 0);
  will-change: transform, opacity;
  transition: transform 1.15s cubic-bezier(0.2, 0.72, 0.2, 1);
  animation: hero-particles-drift 17s ease-in-out infinite alternate, hero-particles-twinkle 6.5s ease-in-out infinite;
}
@keyframes hero-particles-drift {
  to { background-position: 76px -58px, -64px 54px, 52px -46px, -70px 48px, 58px -52px; }
}
@keyframes hero-particles-twinkle {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.54; }
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(14, 15, 15, 0.88) 0%,
    rgba(14, 15, 15, 0.7) 45%,
    var(--bg) 100%
  );
}
.hero-bg-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 30%;
}

/* Solo se anima transform (no top/left) para mantener el trabajo en la GPU. */
.hero-fan {
  --fan-x: -500px;
  --fan-y: -500px;
  --fan-size: 1px;
  --fan-scale-x: 1;
  position: absolute;
  z-index: 2;
  left: var(--fan-x);
  top: var(--fan-y);
  width: var(--fan-size);
  height: var(--fan-size);
  border-radius: 50%;
  opacity: 0;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 38deg,
    rgba(113, 236, 255, 0.2) 66deg,
    transparent 104deg 176deg,
    rgba(189, 255, 9, 0.12) 214deg,
    transparent 250deg 308deg,
    rgba(255, 255, 255, 0.12) 334deg,
    transparent 360deg
  );
  -webkit-mask: radial-gradient(circle, transparent 0 34%, #000 43% 68%, transparent 76%);
  mask: radial-gradient(circle, transparent 0 34%, #000 43% 68%, transparent 76%);
  mix-blend-mode: screen;
  filter: blur(2px);
  will-change: transform;
  transform: translate(-50%, -50%) scaleX(var(--fan-scale-x)) rotate(0deg);
  animation: hero-fan-spin 6.5s linear infinite;
  transition: opacity 0.35s ease;
}
.hero-fan-left { --fan-scale-x: 0.84; }
.hero-media.fans-ready.fans-enabled .hero-fan { opacity: 0.18; }
.hero-fan-right-top { animation-duration: 5.8s; animation-direction: reverse; }
.hero-fan-right-bottom { animation-duration: 6.9s; }
.hero.fans-paused .hero-fan,
.hero.fans-paused .hero-ram::after { animation-play-state: paused; }

@keyframes hero-fan-spin {
  to { transform: translate(-50%, -50%) scaleX(var(--fan-scale-x)) rotate(360deg); }
}

.hero-ram {
  --ram-x: -500px;
  --ram-y: -500px;
  --ram-width: 1px;
  --ram-height: 1px;
  position: absolute;
  left: var(--ram-x);
  top: var(--ram-y);
  z-index: 2;
  width: var(--ram-width);
  height: var(--ram-height);
  overflow: hidden;
  border-radius: 999px;
  opacity: 0;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.hero-ram::after {
  content: '';
  position: absolute;
  inset: -45% 0;
  background: linear-gradient(
    180deg,
    transparent 15%,
    rgba(113, 236, 255, 0.12) 38%,
    rgba(255, 255, 255, 0.28) 50%,
    rgba(189, 255, 9, 0.12) 62%,
    transparent 85%
  );
  filter: blur(1px);
  will-change: transform;
  animation: hero-ram-scan 4.6s ease-in-out infinite;
}
.hero-ram-right::after { animation-delay: -2.3s; }
.hero-media.fans-ready.fans-enabled .hero-ram { opacity: 0.2; }

@keyframes hero-ram-scan {
  0%, 18% { transform: translateY(-42%); }
  82%, 100% { transform: translateY(42%); }
}

.hero-glow {
  position: absolute;
  z-index: 1;
  top: -20%;
  left: 50%;
  transform: translate3d(calc(-50% + var(--particle-x)), var(--particle-y), 0);
  transition: transform 1.35s cubic-bezier(0.2, 0.72, 0.2, 1);
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent) 0%, transparent 60%);
  pointer-events: none;
}
.hero-glow::after {
  content: '';
  position: absolute;
  inset: -18% -12%;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    radial-gradient(circle at 18% 34%, rgba(220, 207, 255, 0.62) 0 1.4px, transparent 2.3px),
    radial-gradient(circle at 74% 18%, rgba(117, 216, 231, 0.48) 0 0.8px, transparent 1.7px),
    radial-gradient(circle at 84% 76%, rgba(184, 151, 255, 0.5) 0 1.8px, transparent 2.8px),
    radial-gradient(circle at 42% 86%, rgba(220, 207, 255, 0.36) 0 0.7px, transparent 1.5px);
  background-size: 330px 290px, 430px 370px, 510px 450px, 390px 340px;
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 0 16%, #000 55%, #000 100%);
  mask-image: radial-gradient(ellipse at center, transparent 0 16%, #000 55%, #000 100%);
  will-change: transform, opacity;
  animation: hero-depth-drift 29s ease-in-out infinite alternate, hero-particles-twinkle 9s ease-in-out infinite;
}
@keyframes hero-depth-drift {
  to { transform: translate3d(34px, -26px, 0) scale(1.04); }
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 760px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  margin-bottom: 20px;
}

.grad {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat strong {
  display: block;
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 4px;
}
.stat span {
  font-family: var(--font-accent);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============ Sections ============ */
.section {
  padding: 100px 0;
  /* El navegador omite pintura/layout de las secciones lejanas y conserva su
     tamaño estimado. Al acercarse al viewport se renderizan normalmente. */
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}
.section-alt { background: var(--bg-alt); }
#cursos {
  padding-top: 72px;
  padding-bottom: 78px;
}
#cursos .section-head { margin-bottom: 38px; }

/* Partículas ambientales compartidas: conectan las secciones sin distraer del contenido. */
#cursos,
#videos {
  position: relative;
  --particle-x: 0px;
  --particle-y: 0px;
  overflow: hidden;
}
#cursos::before,
#videos::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    radial-gradient(circle at 8% 22%, color-mix(in srgb, var(--accent) 65%, transparent) 0 1px, transparent 1.8px),
    radial-gradient(circle at 86% 36%, color-mix(in srgb, var(--accent-2) 55%, transparent) 0 1px, transparent 1.7px),
    radial-gradient(circle at 44% 84%, color-mix(in srgb, var(--accent) 48%, transparent) 0 1px, transparent 1.6px);
  background-size: 360px 330px, 470px 390px, 520px 440px;
  -webkit-mask-image: radial-gradient(ellipse 92% 84% at 50% 48%, transparent 0%, transparent 16%, #000 48%, #000 100%);
  mask-image: radial-gradient(ellipse 92% 84% at 50% 48%, transparent 0%, transparent 16%, #000 48%, #000 100%);
  transform: translate3d(var(--particle-x), var(--particle-y), 0);
  will-change: transform, opacity;
  transition: transform 1.25s cubic-bezier(0.2, 0.72, 0.2, 1);
  animation: hero-particles-drift 21s ease-in-out infinite alternate, hero-particles-twinkle 8s ease-in-out infinite;
}
#videos::before { animation-delay: -8s; opacity: 0.16; }
.hero.effects-paused::before,
.hero.effects-paused .hero-glow::after,
#cursos.effects-paused::before,
#videos.effects-paused::before { animation-play-state: paused; }
#cursos > .container,
#videos > .container { position: relative; z-index: 1; }

.section-head {
  max-width: 620px;
  margin: 0 auto 56px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-accent);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.section-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin-bottom: 14px; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; }

/* ============ Grids & Cards ============ */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cursos { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.card-media {
  aspect-ratio: 16/9;
  overflow: hidden;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-media img { transform: scale(1.06); }
.card-body { padding: 26px 28px 32px; }
.card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 20px; }
.card-link {
  font-family: var(--font-accent);
  color: var(--accent);
  font-weight: 500;
  font-size: 0.82rem;
}

/* ============ Cursos: mosaico ============ */
.course-mosaic {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr) minmax(0, 0.9fr);
  grid-template-areas:
    "support redes linux"
    "programming redes infrastructure";
  grid-template-rows: repeat(2, 250px);
  gap: 2px;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 2.5%, #000 97.5%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 2.5%, #000 97.5%, transparent 100%);
  width: calc(100% + 48px);
  margin-left: -24px;
}

.course-tile {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
}
.course-tile-support { grid-area: support; --course-accent: #7de3b2; --course-position: 50% 48%; }
.course-tile-featured { grid-area: redes; --course-accent: #b897ff; --course-position: 50% 85%; }
.course-tile-linux { grid-area: linux; --course-accent: #7eb7ff; --course-position: 50% 48%; }
.course-tile-programming { grid-area: programming; --course-accent: #f3c878; --course-position: 50% 46%; }
.course-tile-infrastructure { grid-area: infrastructure; --course-accent: #75d8e7; --course-position: 50% 50%; }

.course-tile > a {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  color: var(--text);
  isolation: isolate;
}
.course-tile > a::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 78% 18%, color-mix(in srgb, var(--course-accent) 42%, transparent), transparent 58%),
    linear-gradient(135deg, color-mix(in srgb, var(--course-accent) 20%, transparent), transparent 62%);
  mix-blend-mode: screen;
  opacity: 0.85;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.course-tile > a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(11, 9, 16, 0.16) 0%, rgba(11, 9, 16, 0.4) 46%, rgba(11, 9, 16, 0.92) 100%);
  transition: background 0.3s ease;
}
.course-tile img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--course-position);
  filter: brightness(0.72) saturate(1.05) contrast(1.04);
  transform: scale(1.1);
  transition: filter 0.35s ease, transform 0.45s ease;
}
.course-tile-content {
  position: relative;
  z-index: 1;
  isolation: isolate;
  width: 100%;
  padding: 24px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85);
}
.course-tile-content::before {
  content: '';
  position: absolute;
  inset: -54px -24px -24px;
  z-index: -1;
  background: linear-gradient(180deg, transparent 0%, rgba(14, 15, 15, 0.72) 48%, rgba(14, 15, 15, 0.94) 100%);
  pointer-events: none;
}
.course-tile h3 {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  margin-bottom: 10px;
}
.course-tile-featured .course-tile-content { padding: 34px; }
.course-tile-featured .course-tile-content::before { inset: -72px -34px -34px; }
.course-tile-featured h3 {
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  margin-bottom: 14px;
}
.course-tile-featured p {
  max-width: 420px;
  margin-bottom: 22px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.course-featured-tag {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-family: var(--font-accent);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.course-tile-link {
  color: var(--accent);
  font-family: var(--font-accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.course-tile-link span {
  display: inline-block;
  margin-left: 3px;
  transition: transform 0.2s ease;
}
.course-tile:hover img,
.course-tile:focus-within img {
  filter: brightness(0.85) saturate(1.2) contrast(1.02);
  transform: scale(1.13);
}
.course-tile:hover > a::after,
.course-tile:focus-within > a::after {
  background: linear-gradient(180deg, rgba(11, 9, 16, 0.08) 0%, rgba(11, 9, 16, 0.3) 46%, rgba(11, 9, 16, 0.88) 100%);
}
.course-tile:hover > a::before,
.course-tile:focus-within > a::before { opacity: 1; }
.course-tile:hover .course-tile-link span,
.course-tile:focus-within .course-tile-link span { transform: translateX(4px); }
.course-tile > a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.cta-inline { text-align: center; margin-top: 64px; }

/* ============ eBooks ============ */
.ebooks-section { padding: 0; }
.ebooks-section > .container {
  max-width: none;
  padding: 0;
}

.ebook-split {
  --ebook-gutter: max(24px, calc(50vw - 586px));
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 430px;
  overflow: hidden;
  background: var(--bg-alt);
  isolation: isolate;
}

.ebook-split-head {
  position: absolute;
  z-index: 5;
  top: 32px;
  left: 50%;
  width: min(560px, 72%);
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
.ebook-split-head .eyebrow { margin-bottom: 6px; }
.ebook-split-head h2 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.75);
}

.ebook-half {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-width: 0;
  min-height: 430px;
  overflow: hidden;
}

.ebook-half::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--ebook-bg);
  background-size: cover;
  background-position: center;
  filter: saturate(0.88) brightness(0.76);
  transform: scale(1.025);
  transition: transform 0.55s ease, filter 0.35s ease;
}
.ebook-half-redes::before {
  background-position: 52% center;
  filter: saturate(0.78) brightness(0.68);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 76%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 76%, transparent 100%);
}
.ebook-half-soporte::before {
  background-position: 56% center;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 25%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 25%, #000 100%);
}
.ebook-half:hover::before {
  filter: saturate(0.96) brightness(0.8);
  transform: scale(1.055);
}
.ebook-half-redes:hover::before { filter: saturate(0.84) brightness(0.72); }

.ebook-half::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(14, 15, 15, 0.66) 0%,
    rgba(14, 15, 15, 0.13) 33%,
    rgba(14, 15, 15, 0.25) 52%,
    rgba(14, 15, 15, 0.94) 100%
  );
}

.ebook-split::after {
  content: '';
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 14% 78% at 50% 52%, rgba(14, 15, 15, 0.72) 0%, rgba(14, 15, 15, 0.3) 42%, transparent 76%),
    linear-gradient(180deg, rgba(14, 15, 15, 0.38), transparent 25%);
}

.ebook-half-inner {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  width: 100%;
  padding: 34px 44px 36px var(--ebook-gutter);
}
.ebook-half-soporte .ebook-half-inner {
  justify-content: flex-end;
  padding: 34px var(--ebook-gutter) 36px 44px;
  text-align: right;
}

.ebook-tag {
  display: inline-block;
  font-family: var(--font-accent);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.ebook-half-body { max-width: 430px; }
.ebook-half-soporte .ebook-half-body { max-width: 370px; }
.ebook-half-body {
  min-height: 188px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.ebook-half-soporte .ebook-half-body { align-items: flex-end; }
.ebook-half-body h3 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.1;
  margin-bottom: 10px;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.72);
  min-height: 2.2em;
}
.ebook-half-body p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 20px;
  min-height: 4.65em;
}
.ebook-half-body .btn { margin-top: auto; }

/* ============ Sobre mí ============ */
.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  align-items: center;
}
.photo-frame {
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 6px;
  background: var(--accent);
  max-width: 320px;
  margin: 0 auto;
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.about-text h2 { font-size: clamp(1.7rem, 3.5vw, 2.2rem); margin-bottom: 18px; }
.about-text p { color: var(--text-muted); margin-bottom: 16px; }
.about-actions { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; }

/* ============ Videos ============ */
.video-grid { align-items: start; }
.video-wrap {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}
.video-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.3s ease;
}
.video-wrap:hover img { transform: scale(1.05); filter: brightness(0.75); }
.video-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.play-btn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent-2) 68%, transparent);
  background: color-mix(in srgb, var(--bg-alt) 76%, transparent);
  color: var(--text);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.72), 0 0 0 5px rgba(184, 151, 255, 0.08);
  backdrop-filter: blur(8px);
}
.play-btn::before { content: '▶'; margin-left: 3px; }
.video-wrap:hover .play-btn,
.video-wrap:focus-within .play-btn {
  transform: scale(1.1);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, var(--bg-alt));
  box-shadow: 0 10px 28px -8px rgba(184, 151, 255, 0.55), 0 0 0 6px rgba(184, 151, 255, 0.14);
}
.play-btn:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 4px; }

/* ============ Contacto ============ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
}
.contact-info h2 { font-size: clamp(1.7rem, 3.5vw, 2.2rem); margin-bottom: 14px; }
.contact-info p { color: var(--text-muted); margin-bottom: 28px; }

.contact-list { list-style: none; margin-bottom: 28px; }
.contact-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 0.98rem;
}
.contact-icon { flex: none; color: var(--accent); }

.social-row { display: flex; gap: 12px; }
.social-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.social-btn:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--accent); }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-accent);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: normal;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.contact-form button { align-self: flex-start; }
.contact-honeypot { display: none; }

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-inner p {
  font-family: var(--font-accent);
  color: var(--text-muted);
  font-size: 0.76rem;
}

/* ============ Reveal animation ============ */
/* Solo se oculta si el JS confirmó que corrió (clase "js" en <html>); sin JS queda visible. */
.reveal {
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .course-mosaic {
    width: 100%;
    margin-left: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "redes redes"
      "support linux"
      "programming infrastructure";
    grid-template-rows: 360px repeat(2, 230px);
  }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .photo-frame { max-width: 220px; }
  .contact-grid { grid-template-columns: 1fr; }
  .header-actions .btn-primary { display: none; }

  .ebooks-section { padding: 0; }
  .ebook-split {
    grid-template-columns: 1fr;
    grid-template-rows: 96px repeat(2, minmax(290px, 1fr));
    min-height: 676px;
  }
  .ebook-split-head {
    position: relative;
    top: auto;
    left: auto;
    display: grid;
    place-content: center;
    width: auto;
    transform: none;
    background: var(--bg-alt);
  }
  .ebook-half { min-height: 290px; }
  .ebook-half-redes::before,
  .ebook-half-soporte::before {
    -webkit-mask-image: none;
    mask-image: none;
  }
  .ebook-split::after {
    top: 96px;
    background: linear-gradient(180deg, transparent 43%, rgba(14, 15, 15, 0.82) 50%, transparent 57%);
  }
  .ebook-half-soporte .ebook-half-inner {
    justify-content: flex-start;
    text-align: left;
  }
  .ebook-half-soporte .ebook-half-body { align-items: flex-start; }
  .ebook-half-inner,
  .ebook-half-soporte .ebook-half-inner { padding: 28px; }
  .ebook-half-body,
  .ebook-half-soporte .ebook-half-body { max-width: 440px; }
}

@media (max-width: 560px) {
  #cursos { padding-top: 60px; padding-bottom: 64px; }
  #cursos .section-head { margin-bottom: 30px; }
  .course-mosaic {
    grid-template-columns: 1fr;
    grid-template-areas:
      "redes"
      "support"
      "linux"
      "programming"
      "infrastructure";
    grid-template-rows: 310px repeat(4, 210px);
  }
  .course-tile-content,
  .course-tile-featured .course-tile-content { padding: 24px; }
  .course-tile-featured h3 { font-size: 2rem; }
  .course-tile-featured p { font-size: 0.88rem; margin-bottom: 16px; }

  .ebooks-section { padding: 0; }
  .ebook-split {
    grid-template-rows: 88px repeat(2, minmax(280px, 1fr));
    min-height: 648px;
  }
  .ebook-split::after { top: 88px; }
  .ebook-half { min-height: 280px; }
  .ebook-half-inner,
  .ebook-half-soporte .ebook-half-inner { padding: 24px; }
  .ebook-half-body h3 { font-size: 1.5rem; }
  .ebook-half-body p { font-size: 0.84rem; margin-bottom: 16px; }
}

@media (max-width: 700px) {
  .hero-fan,
  .hero-ram { display: none; }
}

@media (max-width: 860px) {
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px 28px;
    gap: 18px;
  }
}

/* ============ Producto: landing de eBook ============ */
.product-hero {
  padding: 72px 0 40px;
}
.product-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  align-items: center;
}
.product-cover {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  max-width: 300px;
  margin: 0 auto;
}
.product-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-info h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 14px;
}
.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 0.92rem;
}
.stars {
  position: relative;
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--border);
}
.stars-fill {
  position: absolute;
  inset: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #ffb400;
}
.rating-badge strong { color: var(--text); }
.rating-badge a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rating-badge a:hover { color: var(--text); }
.product-info .lede {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 28px;
  max-width: 560px;
}
.product-info .btn { margin-bottom: 12px; }
.product-note {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.product-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 20px;
}
.product-benefit {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
}
.product-benefit h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.product-benefit p {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.product-cta {
  text-align: center;
  padding: 56px 0 80px;
}
.product-cta h2 { margin-bottom: 14px; }
.product-cta p {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 28px;
}

/* Para quién es */
.product-audience {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 20px;
}
.product-audience-item {
  padding: 24px;
  border-left: 2px solid var(--accent);
}
.product-audience-item p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Qué vas a aprender */
.product-checklist {
  list-style: none;
  max-width: 640px;
  margin: 24px auto 0;
  display: grid;
  gap: 16px;
}
.product-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 1rem;
}
.product-checklist svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent);
}

/* Autor */
.product-author {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  align-items: center;
  max-width: 640px;
  margin: 0 auto;
}
.product-author .photo-frame { max-width: 140px; }
.product-author p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* FAQ */
.product-faq {
  max-width: 680px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}
.product-faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
}
.product-faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.product-faq summary::-webkit-details-marker { display: none; }
.product-faq summary::after {
  content: '+';
  float: right;
  color: var(--accent);
  font-size: 1.2rem;
}
.product-faq details[open] summary::after { content: '−'; }
.product-faq p {
  color: var(--text-muted);
  margin-top: 12px;
  font-size: 0.92rem;
}

@media (max-width: 760px) {
  .product-grid { grid-template-columns: 1fr; text-align: center; }
  .product-info .lede { margin-left: auto; margin-right: auto; }
  .product-benefits { grid-template-columns: 1fr; }
  .product-audience { grid-template-columns: 1fr; }
  .product-audience-item { border-left: none; border-top: 2px solid var(--accent); }
  .product-author { grid-template-columns: 1fr; text-align: center; }
  .product-author .photo-frame { margin: 0 auto; }
}

/* ============ Modal de oferta (exit intent) ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 14, 0.72);
  backdrop-filter: blur(6px);
  padding: 24px;
  animation: modal-fade 0.25s ease;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  position: relative;
  max-width: 420px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 32px 32px;
  text-align: center;
  animation: modal-pop 0.3s ease;
}
.modal-card .eyebrow { margin-bottom: 10px; }
.modal-card h3 { font-size: 1.55rem; margin-bottom: 12px; }
.modal-card p { color: var(--text-muted); margin-bottom: 24px; font-size: 0.95rem; }
.modal-card .btn { width: 100%; justify-content: center; margin-bottom: 14px; }
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }
.modal-dismiss {
  display: block;
  margin: 0 auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}
body.modal-open { overflow: hidden; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .modal-overlay, .modal-card { animation: none; }
}

/* ============ Accesibilidad: respetar "reducir movimiento" ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .hero-fan,
  .hero-ram { display: none; }
}

/* ============ Apuntes: captación ============ */
.apuntes-section {
  position: relative;
  background:
    radial-gradient(ellipse 70% 120% at 12% 50%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.apuntes-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.apuntes-pitch h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  margin-bottom: 14px;
}
.apuntes-pitch > p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 46ch;
}

.apuntes-temas {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 32px;
}
.apuntes-temas li {
  font-family: var(--font-accent);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text-muted);
}

.apuntes-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}
.apuntes-stats .stat { text-align: left; }

.apuntes-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px;
}
.apuntes-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.apuntes-form h3 { font-size: 1.35rem; }
.apuntes-form-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: -8px;
}
.apuntes-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-accent);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.apuntes-form input[type="email"] {
  font-family: var(--font-body);
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: normal;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.apuntes-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
}
.apuntes-form button { justify-content: center; width: 100%; }
.apuntes-form button:disabled {
  cursor: wait;
  opacity: 0.72;
}
.apuntes-form-status {
  color: var(--accent-2);
  font-size: 0.84rem;
  line-height: 1.5;
  text-align: center;
}
.apuntes-legal {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.apuntes-honeypot { display: none; }
.apuntes-hidden-frame { display: none; }

/* ============ Apuntes: página de descargas ============ */
.descargas-hero { padding-bottom: 0; }
.descargas-hero .section-head { margin-bottom: 0; }
.descargas-section { padding-top: 64px; }

.apuntes-lista {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.apunte-tema-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 14px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.apunte-tema-head h2 { font-size: 1.4rem; }
.apunte-tema-count {
  font-family: var(--font-accent);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.apunte-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}

.apunte-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 26px 24px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.apunte-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.apunte-card-body { flex: 1; }
.apunte-card h3 { font-size: 1.08rem; margin-bottom: 9px; }
.apunte-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}
.apunte-meta {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  font-family: var(--font-accent);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.apunte-meta span + span::before {
  content: '·';
  margin-right: 8px;
}
.apunte-card .btn { align-self: flex-start; }

.apunte-error {
  color: var(--text-muted);
  text-align: center;
  padding: 40px 0;
}

.descargas-cta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}
.descargas-cta-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.descargas-cta-card h3 { font-size: 1.08rem; }
.descargas-cta-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  flex: 1;
}
.descargas-cta-card .btn { align-self: flex-start; }

/* ============ Apuntes: página de gracias ============ */
.gracias-section { padding: 140px 0 120px; }
.gracias-inner {
  max-width: 600px;
  text-align: center;
}
.gracias-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
.gracias-inner h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 16px;
}
.gracias-inner > p {
  color: var(--text-muted);
  font-size: 1.05rem;
}
.gracias-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 34px;
}

@media (max-width: 900px) {
  .apuntes-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .apuntes-pitch > p { max-width: none; }
}

@media (max-width: 560px) {
.apuntes-form-card { padding: 26px 22px; }
  .apuntes-stats { gap: 26px; }
  .gracias-section { padding: 100px 0 80px; }
}

/* ============ Rendimiento en pantallas táctiles ============ */
/* El blend y el desenfoque se recalculan en cada frame del scroll: en móvil
   cuestan bastante y casi no se perciben. El desktop queda igual. */
@media (pointer: coarse) {
  .noise { display: none; }
  .site-header {
    backdrop-filter: none;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
  }

  /* La deriva anima background-position, que no es acelerada: repinta la capa
     entera —con su máscara— en cada frame. Se congela la textura, que queda
     igual de visible pero sin costo por frame. */
  .hero::before,
  .hero-glow::after,
  #cursos::before,
  #videos::before {
    animation: none;
    transition: none;
    will-change: auto;
  }

  /* opacity: 0 no descarta la capa: con will-change, blur y mask se sigue
     rasterizando aunque no se vea. */
  .hero-fan,
  .hero-ram { display: none; }
}
