/* Praxis Crítica — hoja de estilos principal */
:root{
  --ink:#0f1417; --ink-2:#3a454c; --muted:#6b777f;
  --paper:#ffffff; --paper-2:#f4f6f7; --line:#e1e6e9;
  --surface:#ffffff; --tint:#e7f3f3; --header-bg:rgba(255,255,255,.92);
  --notice-bg:#fdf3f3; --band:#0f1417; --on-accent:#ffffff;
  --acred-bg:#fff4e0; --acred-fg:#8a5a00; --neutral-bg:#eef0f2; --neutral-fg:#3a454c;
  --accent:#0e7c7b; --accent-2:#0a5f5e; --pulse:#d64545;
  --radius:14px; --max:1140px;
  --shadow:0 1px 2px rgba(15,20,23,.06),0 8px 24px rgba(15,20,23,.06);
  font-family:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;color:var(--ink);background:var(--paper);line-height:1.6;font-size:17px}
img{max-width:100%;display:block}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
.wrap{max-width:var(--max);margin:0 auto;padding:0 22px}
h1,h2,h3{line-height:1.2;letter-spacing:-.01em;margin:0 0 .5em}
h1{font-size:clamp(2rem,4.5vw,3.2rem)}
h2{font-size:clamp(1.5rem,3vw,2.1rem)}
h3{font-size:1.15rem}
p{margin:0 0 1em}
.muted{color:var(--muted)}
.eyebrow{text-transform:uppercase;letter-spacing:.12em;font-size:.78rem;font-weight:700;color:var(--accent)}

/* Cabecera */
.site-header{position:sticky;top:0;z-index:50;background:var(--header-bg);backdrop-filter:saturate(1.4) blur(8px);border-bottom:1px solid var(--line)}
.site-header .wrap{display:flex;align-items:center;justify-content:space-between;height:68px}
.brand{display:flex;align-items:center;gap:10px;color:var(--ink);font-weight:800;font-size:1.1rem}
.brand:hover{text-decoration:none}
.brand img,.brand svg{width:40px;height:40px}
.nav{display:flex;gap:4px;align-items:center}
.nav a{color:var(--ink-2);padding:8px 12px;border-radius:999px;font-weight:600;font-size:.95rem}
.nav a:hover{background:var(--paper-2);text-decoration:none}
.nav a.active{color:var(--accent);background:var(--tint)}
.nav a.btn-primary,.nav a.btn-primary:hover{color:var(--on-accent);background:var(--accent)}
.menu-btn{display:none;background:none;border:1px solid var(--line);border-radius:10px;padding:8px 10px;font-size:1rem;cursor:pointer}
@media (max-width:860px){
  .menu-btn{display:block}
  .nav{display:none;position:absolute;top:68px;left:0;right:0;flex-direction:column;background:var(--paper);border-bottom:1px solid var(--line);padding:10px 22px 16px;align-items:stretch}
  .nav.open{display:flex}
}

/* Botones */
.btn{display:inline-flex;align-items:center;gap:8px;padding:12px 20px;border-radius:999px;font-weight:700;border:2px solid transparent;cursor:pointer;font-size:.98rem}
.btn:hover{text-decoration:none}
.btn-primary{background:var(--accent);color:var(--on-accent)}
.btn-primary:hover{background:var(--accent-2)}
.btn-ghost{border-color:var(--ink);color:var(--ink)}
.btn-ghost:hover{background:var(--ink);color:var(--paper)}
.btn-light{background:#fff;color:#0f1417}

/* Hero */
.hero{padding:84px 0 64px;background:
  radial-gradient(1200px 400px at 80% -10%,var(--tint) 0,transparent 60%),var(--paper)}
.hero .wrap{display:grid;grid-template-columns:1.2fr .8fr;gap:48px;align-items:center}
.hero p.lead{font-size:1.2rem;color:var(--ink-2);max-width:40ch}
.hero .actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:24px}
.ecg{width:100%;height:auto;color:var(--pulse)}
.ecg path{stroke-dasharray:1200;stroke-dashoffset:1200;animation:trace 3.2s ease-out forwards}
@keyframes trace{to{stroke-dashoffset:0}}
@media (prefers-reduced-motion:reduce){.ecg path{animation:none;stroke-dashoffset:0}}
@media (max-width:860px){.hero .wrap{grid-template-columns:1fr}.hero{padding:56px 0 40px}}

/* Secciones */
section{padding:64px 0}
.section-alt{background:var(--paper-2)}
.section-head{display:flex;justify-content:space-between;align-items:end;gap:20px;margin-bottom:28px;flex-wrap:wrap}
.section-head p{max-width:60ch;margin:0}

/* Tarjetas */
.grid{display:grid;gap:20px;grid-template-columns:repeat(auto-fill,minmax(260px,1fr))}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:22px;box-shadow:var(--shadow);display:flex;flex-direction:column}
.card h3{margin-bottom:.35em}
.card p{color:var(--ink-2);font-size:.97rem}
.card .meta{margin-top:auto;font-size:.85rem;color:var(--muted);display:flex;gap:12px;flex-wrap:wrap}
.card a.stretch{font-weight:700;margin-top:10px}
.tag{display:inline-block;font-size:.75rem;font-weight:700;padding:3px 10px;border-radius:999px;background:var(--tint);color:var(--accent-2);margin:0 6px 8px 0}
.tag.soon{background:#fdecec;color:#a33}
.icon{width:42px;height:42px;border-radius:12px;background:var(--tint);color:var(--accent);display:grid;place-items:center;margin-bottom:14px;font-size:1.3rem}

/* Cursos y vídeos */
.module{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);margin-bottom:22px;overflow:hidden}
.module>header{padding:22px 24px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;align-items:center}
.module>header h2{font-size:1.4rem;margin:0}
.module .lessons{display:grid;gap:18px;padding:22px 24px;grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
.lesson h3{font-size:1rem;margin:10px 0 4px}
.lesson p{font-size:.92rem;color:var(--ink-2);margin:0}
.yt{position:relative;aspect-ratio:16/9;border-radius:10px;overflow:hidden;background:#111;cursor:pointer;border:0;padding:0;width:100%}
.yt img{width:100%;height:100%;object-fit:cover;opacity:.9;transition:opacity .2s}
.yt:hover img{opacity:1}
.yt .play{position:absolute;inset:0;display:grid;place-items:center}
.yt .play span{width:64px;height:44px;border-radius:12px;background:rgba(214,69,69,.95);display:grid;place-items:center;color:#fff;font-size:1.2rem}
.yt iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.yt.empty{display:grid;place-items:center;color:#c9d1d5;background:repeating-linear-gradient(45deg,#1b2327,#1b2327 12px,#20292e 12px,#20292e 24px);cursor:default;font-weight:700;font-size:.9rem}

/* Filtros */
.filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:24px}
.filters button{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:7px 14px;font-weight:600;cursor:pointer;color:var(--ink-2)}
.filters button.on{background:var(--ink);color:var(--paper);border-color:var(--ink)}
.search{width:100%;max-width:420px;padding:11px 16px;border:1px solid var(--line);border-radius:999px;font-size:1rem;background:var(--surface);color:var(--ink)}

/* Banda llamada a la acción */
.cta-band{background:var(--band);color:#fff;border-radius:22px;padding:44px;display:grid;grid-template-columns:1fr auto;gap:24px;align-items:center}
.cta-band p{color:#c9d1d5}
.cta-band .actions{display:flex;gap:12px;flex-wrap:wrap;justify-content:flex-end}
@media (max-width:860px){.cta-band{grid-template-columns:1fr;padding:30px}.cta-band .actions{justify-content:flex-start}}

/* Páginas de texto */
.page-head{padding:56px 0 24px;border-bottom:1px solid var(--line)}
.prose{max-width:760px}
.prose h2{margin-top:1.6em;font-size:1.4rem}
.prose ul{padding-left:1.2em}
.notice{border-left:4px solid var(--pulse);background:var(--notice-bg);padding:14px 18px;border-radius:8px;font-size:.95rem;color:var(--ink-2)}

/* Pie */
.site-footer{border-top:1px solid var(--line);padding:44px 0 28px;margin-top:40px;font-size:.92rem;color:var(--ink-2)}
.site-footer .cols{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:28px}
.site-footer h4{font-size:.8rem;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);margin:0 0 10px}
.site-footer ul{list-style:none;margin:0;padding:0}
.site-footer li{margin:6px 0}
.site-footer a{color:var(--ink-2)}
.site-footer .legal{margin-top:30px;padding-top:18px;border-top:1px solid var(--line);font-size:.82rem;color:var(--muted);display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
@media (max-width:860px){.site-footer .cols{grid-template-columns:1fr 1fr}}

/* Cursos: acreditación, acciones y plegado */
.tag.acred{background:var(--acred-bg);color:var(--acred-fg)}
.tag.neutral{background:var(--neutral-bg);color:var(--neutral-fg)}
.mod-actions{display:flex;gap:10px;flex-wrap:wrap}
.mod-actions .btn{padding:9px 16px;font-size:.9rem}
.lessons.collapsed .lesson.more{display:none}
.show-more{padding:0 24px 22px;text-align:center}

/* Cifras de portada */
.cifras{display:flex;gap:32px;margin-top:34px;flex-wrap:wrap}
.cifras div{display:flex;flex-direction:column}
.cifras strong{font-size:1.9rem;line-height:1;color:var(--ink)}
.cifras span{font-size:.85rem;color:var(--muted);margin-top:4px}
.btn-x{border-color:#fff;color:#fff}
.btn-x:hover{background:#fff;color:#0f1417}

/* ---------- Modo oscuro (para personas sensibles a la luz) ---------- */
:root[data-theme="dark"]{
  color-scheme:dark;
  --ink:#e3e9ec; --ink-2:#b5c0c6; --muted:#8a979f;
  --paper:#0f1518; --paper-2:#141c20; --line:#25313a;
  --surface:#151d22; --tint:#173634; --header-bg:rgba(15,21,24,.92);
  --accent:#4cc0bd; --accent-2:#8fd8d5; --pulse:#e8706d;
  --notice-bg:#2a1c1d; --band:#0a0f11; --on-accent:#05211f;
  --acred-bg:#3b2c12; --acred-fg:#f2c47c; --neutral-bg:#222d33; --neutral-fg:#b5c0c6;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px rgba(0,0,0,.35);
}
:root[data-theme="dark"] .cta-band{border:1px solid var(--line)}
:root[data-theme="dark"] img.og-light{display:none}

.theme-btn{background:none;border:1px solid var(--line);border-radius:999px;width:40px;height:40px;display:grid;place-items:center;cursor:pointer;color:var(--ink);font-size:1.1rem;flex:0 0 auto}
.theme-btn:hover{background:var(--paper-2)}
.head-tools{display:flex;gap:8px;align-items:center;order:3}
@media (min-width:861px){.head-tools{order:3;margin-left:8px}}

/* Logo protagonista en la portada */
.hero-logo{position:relative;display:grid;place-items:center;min-height:380px}
.hero-logo img{position:relative;z-index:1;width:min(380px,100%);height:auto;border-radius:50%;
  box-shadow:0 10px 40px rgba(15,20,23,.18),0 0 0 8px var(--paper)}
:root[data-theme="dark"] .hero-logo img{box-shadow:0 10px 40px rgba(0,0,0,.6),0 0 0 8px var(--paper),0 0 60px rgba(76,192,189,.18)}
@media (max-width:860px){.hero-logo{min-height:0;order:-1;margin-bottom:8px}.hero-logo img{width:min(220px,62%)}}

/* Bloque de contacto */
.contact-box{border:1px solid var(--line);background:var(--surface);border-radius:var(--radius);padding:22px;margin:12px 0 8px}
.contact-mail{display:block;font-size:1.3rem;margin-bottom:14px;word-break:break-all;user-select:all}
.contact-actions{display:flex;gap:10px;flex-wrap:wrap}
.contact-actions .btn{padding:10px 16px;font-size:.92rem;background-clip:padding-box}
.contact-actions button.btn-ghost{background:none}

/* ---- Idioma (ES / EN) ---- */
.lang-btn{border:1px solid var(--line);border-radius:999px;height:40px;min-width:40px;padding:0 10px;display:grid;place-items:center;color:var(--ink);font-weight:800;font-size:.85rem;letter-spacing:.04em;flex:0 0 auto}
.lang-btn:hover{background:var(--paper-2);text-decoration:none}
.lang-hint{background:var(--tint);border-bottom:1px solid var(--line);font-size:.92rem;color:var(--ink-2)}
.lang-hint .wrap{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding-top:8px;padding-bottom:8px}
.lang-hint a{font-weight:700}
.lang-hint button{margin-left:auto;background:none;border:0;color:var(--muted);cursor:pointer;font-size:1rem;padding:4px 8px}
