:root {
  --bg: #07090d;
  --bg-elev: #0e131b;
  --bg-soft: #121821;
  --line: rgba(148, 180, 210, 0.12);
  --text: #edf2f7;
  --muted: #8b98ab;
  --cyan: #3ecfff;
  --cyan-soft: rgba(62, 207, 255, 0.12);
  --yellow: #ffb020;
  --ok: #5dffb0;
  --radius: 20px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --max: 1080px;
  --narrow: 720px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #9ae6ff; }

.wrap { width: min(var(--max), calc(100% - 2.5rem)); margin-inline: auto; }
.narrow { width: min(820px, calc(100% - 2.5rem)); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--cyan); color: #041018; padding: .6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(7, 9, 13, 0.82);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 3.75rem;
}

.brand {
  display: inline-flex; align-items: center; gap: .7rem;
  color: var(--text); text-decoration: none;
  font-family: var(--display); font-weight: 700; letter-spacing: -0.02em;
}
.brand img { width: 40px; height: auto; opacity: 0.95; }

.nav-main { display: flex; gap: .15rem; }
.nav-main a {
  color: var(--muted); text-decoration: none;
  padding: .45rem .8rem; border-radius: 999px;
  font-weight: 600; font-size: .92rem;
}
.nav-main a:hover { color: var(--text); }

/* Hero — one composition */
.hero {
  position: relative;
  padding: clamp(2.5rem, 8vh, 5.5rem) 0 clamp(2rem, 5vh, 3.5rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(700px 380px at 85% 20%, rgba(62, 207, 255, 0.14), transparent 60%),
    linear-gradient(180deg, transparent 55%, var(--bg));
  pointer-events: none;
}

.hero-layout {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.eyebrow {
  margin: 0 0 .65rem;
  color: var(--cyan);
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.8rem, 7vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.hero h1 em {
  font-style: normal;
  color: var(--cyan);
}

.lede {
  margin: 1rem 0 1.5rem;
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 28rem;
}

.hero-art {
  margin: 0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}
.hero-art img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 28%;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; padding: .85rem 1.35rem;
  font-weight: 700; border: 1px solid transparent;
  text-decoration: none; cursor: pointer; font: inherit;
}
.btn-primary { background: var(--cyan); color: #041018; }
.btn-primary:hover { background: #7adfff; color: #041018; }
.btn-ghost {
  background: transparent; color: var(--text); border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.section { padding: clamp(3.5rem, 8vh, 5.5rem) 0; }
.section-split {
  background: var(--bg-soft);
  border-block: 1px solid var(--line);
}

.section-head { margin-bottom: 2rem; max-width: 34rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-kicker {
  margin: 0 0 .45rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cyan);
}
.section-head h2 {
  margin: 0 0 .5rem;
  font-family: var(--display);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  letter-spacing: -0.03em;
}
.section-head p { margin: 0; color: var(--muted); }

/* 10 temas — legibles a primera vista */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .75rem;
}
.topic-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .85rem;
  align-items: center;
  text-align: left;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: .95rem 1rem;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.topic-card:hover {
  border-color: rgba(62, 207, 255, 0.4);
  transform: translateY(-1px);
}
.topic-card.is-active {
  border-color: var(--cyan);
  background: rgba(62, 207, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(62, 207, 255, 0.25);
}
.topic-emoji {
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.55rem;
  background: rgba(62, 207, 255, 0.1);
  line-height: 1;
}
.topic-body {
  display: grid;
  gap: .2rem;
  min-width: 0;
}
.topic-body strong {
  font-family: var(--display);
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}
.topic-body span {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.topic-count {
  font-size: .78rem;
  font-weight: 800;
  color: var(--cyan);
  background: rgba(62, 207, 255, 0.1);
  padding: .3rem .55rem;
  border-radius: 999px;
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  margin-bottom: .75rem;
}
.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1rem;
}
.category-tag {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .4rem .75rem;
  font-size: .8rem;
  line-height: 1.2;
  max-width: 100%;
}
.category-tag.is-active {
  color: #041018;
  background: var(--cyan);
  border-color: var(--cyan);
}
.search-box.grow { flex: 1; min-width: 200px; display: block; }
.search-box input {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: .85rem 1.2rem;
  font: inherit;
}
.search-box input:focus {
  outline: 2px solid rgba(62, 207, 255, 0.35);
  border-color: var(--cyan);
}

.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: .55rem 1rem;
  font: inherit;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
}
.chip:hover {
  color: #041018;
  background: var(--cyan);
  border-color: var(--cyan);
}

.result-meta {
  color: var(--muted);
  font-size: .88rem;
  margin: 0 0 1rem;
  text-align: center;
}

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

.video-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 0;
  padding: 0;
  cursor: pointer;
  width: 100%;
}
.video-thumb img {
  width: 100%; height: 100%; object-fit: cover; opacity: .9;
}
.video-thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(62,207,255,.2), transparent 55%);
  opacity: 0;
  transition: opacity .2s ease;
}
.video-thumb:hover::after { opacity: 1; }
.video-body { padding: 1rem 1.05rem 1.15rem; display: grid; gap: .4rem; flex: 1; }
.video-cat {
  font-size: .72rem; font-weight: 700; color: var(--cyan);
  text-transform: uppercase; letter-spacing: .05em;
}
.video-body h3 {
  margin: 0; font-size: 1rem; line-height: 1.3;
  font-family: var(--display); letter-spacing: -0.02em;
}
.video-tip { margin: 0; color: var(--muted); font-size: .88rem; }
.video-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .4rem; }
.video-actions .btn { padding: .5rem .85rem; font-size: .85rem; }

.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 1rem;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.75); }
.modal-panel {
  position: relative;
  width: min(860px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.1rem 1.1rem 1.35rem;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.modal-head {
  display: flex; justify-content: space-between; gap: 1rem; align-items: start;
  margin-bottom: .85rem;
}
.modal-head h3 {
  margin: 0; font-family: var(--display); letter-spacing: -0.02em; font-size: 1.15rem;
}
.icon-btn {
  background: transparent; border: 1px solid var(--line); color: var(--text);
  width: 2.2rem; height: 2.2rem; border-radius: 999px; cursor: pointer; font: inherit;
}
.modal-embed {
  aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden;
}
.modal-embed iframe { width: 100%; height: 100%; border: 0; }
.modal-chapters {
  margin: .85rem 0 0;
}
.modal-chapters[hidden] { display: none; }
.modal-chapters-label {
  margin: 0 0 .45rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.modal-chapters-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(28vh, 220px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
}
.modal-chapters-list li + li {
  border-top: 1px solid var(--line);
}
.modal-chapter {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding: .55rem .75rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.modal-chapter:hover,
.modal-chapter:focus-visible {
  background: var(--cyan-soft);
  outline: none;
}
.modal-chapter.is-active {
  background: rgba(62, 207, 255, 0.16);
}
.modal-chapter-time {
  flex: 0 0 auto;
  min-width: 3.1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: .85rem;
  color: var(--cyan);
}
.modal-chapter-title {
  flex: 1 1 auto;
  font-size: .9rem;
  color: var(--text);
}
.modal-desc {
  color: var(--muted); white-space: pre-wrap; font-size: .92rem; margin: 1rem 0;
}
.modal-desc[hidden] { display: none; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.75rem 0 2.25rem;
  margin-top: 1rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-family: var(--display);
  font-weight: 700;
}
.footer-brand img { opacity: .9; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .85rem 1.1rem;
}
.footer-links a,
.footer-legal {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.footer-links a:hover,
.footer-legal:hover {
  color: var(--cyan);
}

.impressum-panel {
  width: min(560px, 100%);
}
.impressum-hint {
  margin: 0 0 .75rem;
  color: var(--muted);
  font-size: .88rem;
}
.impressum-body {
  color: var(--text);
  font-size: .92rem;
  line-height: 1.55;
  display: grid;
  gap: .75rem;
  margin-bottom: 1rem;
}
.impressum-body p { margin: 0; }
.impressum-body strong { color: var(--cyan); }
.impressum-pre {
  margin: 0;
  padding: 1rem 1.05rem;
  background: #0a0e14;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
}
.obf-email {
  display: inline;
  cursor: pointer;
  color: var(--cyan);
  direction: rtl;
  unicode-bidi: bidi-override;
  border-bottom: 1px dotted rgba(62, 207, 255, 0.45);
}
.obf-email:hover,
.obf-email:focus-visible {
  color: #9ae6ff;
  outline: none;
}
.obf-email.is-copied {
  color: var(--ok);
  border-bottom-color: transparent;
  direction: ltr;
  unicode-bidi: normal;
}

@media (max-width: 640px) {
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .wrap { width: min(var(--max), calc(100% - 1.5rem)); }
  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: .55rem;
  }
  .search-box.grow { min-width: 0; width: 100%; }
  .search-box input { padding: .75rem 1rem; font-size: 1rem; }
  .category-tags {
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .75rem;
  }
  .category-tag {
    font-size: .72rem;
    padding: .42rem .7rem;
    white-space: normal;
    text-align: left;
  }
}

@media (max-width: 800px) {
  .hero-layout { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .nav-main a { padding: .4rem .55rem; font-size: .85rem; }
  .topic-grid { grid-template-columns: 1fr; }
}
