/* ==========================================================================
   AlgorIus — estilo informal («cuaderno de estudio»)
   Hoja de estilos independiente: no depende de styles.css (la versión elegante).
   ========================================================================== */

/* Inclinación decorativa de cada pieza; no se hereda a los hijos */
@property --rot {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

:root {
  --paper: #FFF8EC;
  --ink: #1C1A2E;
  --ink-2: #4A4763;
  --ink-3: #8C89A6;
  --violet: #6D4AFF;
  --lavender: #C9BBFF;
  --sky: #A5DBFF;
  --mint: #A8F0D1;
  --lime: #D8F65A;
  --coral: #FF7A59;
  --butter: #FFE58A;

  /* Nombres que también usa el editor visual */
  --bg: var(--paper);
  --bg-2: #FFFFFF;
  --line: #E6DFD2;
  --line-2: var(--ink);
  --text: var(--ink);
  --text-2: var(--ink-2);
  --muted: var(--ink-2);
  --faint: var(--ink-3);
  --accent: var(--violet);

  --display: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: var(--display);
  --hand: 'Caveat', 'Segoe Print', cursive;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --max: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
  --ease: cubic-bezier(.34, 1.45, .64, 1);
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 7px 7px 0 var(--ink);

  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(28, 26, 46, .14) 1px, transparent 1.3px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--lime); color: var(--ink); }

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ol, ul, figure, blockquote, pre { margin: 0; }
ol, ul { padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 200;
  padding: 8px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--lime);
  font-weight: 700;
}
.skip:focus { top: 12px; }

.gridlines { display: none; }
main, .site-footer { position: relative; z-index: 1; }

/* Resaltador lima para las palabras en cursiva de los titulares */
.display em, .section-title em {
  font-style: normal;
  background: linear-gradient(transparent 58%, var(--lime) 58%, var(--lime) 92%, transparent 92%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ==========================================================================
   Botones
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: translate .25s var(--ease), box-shadow .25s var(--ease), background-color .2s;
}
.btn:hover { translate: -2px -2px; box-shadow: var(--shadow-lg); }
.btn:active { translate: 2px 2px; box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--lime); }
.btn-ghost { background: #fff; }

/* ==========================================================================
   Cabecera
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 248, 236, .88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--ink);
}
.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--header-h);
}

.wordmark {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  white-space: nowrap;
}
.wordmark em {
  --rot: -4deg;
  display: inline-block;
  margin-left: 3px;
  padding: 2px 7px 3px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--lavender);
  font-size: .8em;
  font-style: normal;
  letter-spacing: .02em;
  text-transform: uppercase; /* en esta tipografía la «I» de «Ius» se confunde con una «l» */
  vertical-align: .08em;
  transform: rotate(var(--rot));
}

.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.nav a {
  padding: 7px 12px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: background-color .2s, color .2s;
}
.nav a span { margin-right: 3px; font-weight: 700; color: var(--violet); }
.nav a:hover { background: var(--butter); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--lime); border-color: var(--ink); color: var(--ink); }
.nav .nav-cta { margin-left: 6px; background: var(--ink); color: var(--paper); }
.nav .nav-cta:hover { background: var(--violet); color: #fff; }

.menu-toggle {
  display: none;
  padding: 8px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
  font: 700 14px/1 var(--sans);
  cursor: pointer;
}

@media (max-width: 1199px) {
  .js .menu-toggle { display: inline-block; }
  .js .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: calc(-1 * var(--gutter));
    right: calc(-1 * var(--gutter));
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 14px var(--gutter) 22px;
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
  }
  .js .nav.is-open { display: flex; }
  .js .nav a { padding: 12px 16px; font-size: 16px; }
  .js .nav .nav-cta { margin: 8px 0 0; text-align: center; }
}

/* ==========================================================================
   Portadas
   ========================================================================== */

.eyebrow {
  --rot: -2deg;
  display: inline-block;
  margin-bottom: 22px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--lime);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .03em;
  transform: rotate(var(--rot));
}

.display {
  font-family: var(--display);
  font-size: clamp(3rem, 1.9rem + 5vw, 6.5rem);
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.lead { margin-top: 26px; max-width: 46ch; font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); color: var(--ink-2); }

/* Inicio */
.hero { display: grid; padding-block: clamp(40px, 8vh, 96px) clamp(48px, 8vh, 96px); }
.hero-home .hero-copy { max-width: 640px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero-note {
  --rot: -1deg;
  margin-top: 24px;
  max-width: 34ch;
  font-family: var(--hand);
  font-size: 25px;
  line-height: 1.2;
  color: var(--ink-2);
  transform: rotate(var(--rot));
}

/* Páginas de área */
.page-hero { padding-block: clamp(28px, 5vh, 56px) clamp(56px, 9vh, 96px); }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: clamp(32px, 6vh, 64px); font-size: 14px; color: var(--ink-3); }
.crumbs a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline wavy var(--coral);
  text-underline-offset: 4px;
}

.page-hero-grid { display: grid; gap: 40px; align-items: center; }

.page-mark {
  --rot: 8deg;
  display: none;
  place-items: center;
  justify-self: center;
  width: clamp(190px, 21vw, 270px);
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--coral);
  box-shadow: var(--shadow-lg);
  font-family: var(--display);
  font-size: clamp(3.4rem, 5.6vw, 5.2rem);
  font-weight: 800;
  letter-spacing: -.04em;
  transform: rotate(var(--rot));
}

/* Lectura asistida del art. 1494 C.C. (página de IA) */
.reader {
  --rot: 1.5deg;
  padding: 22px;
  border: 2px solid var(--ink);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  transform: rotate(var(--rot));
}
.reader-head, .reader-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
}
.reader-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--lime);
}
.reader-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.reader-text { margin-top: 16px; font-size: 1.02rem; line-height: 1.6; color: var(--ink-3); }
.reader-text mark {
  border-radius: 3px;
  background-color: transparent;
  background-image: linear-gradient(var(--lime), var(--lime));
  background-repeat: no-repeat;
  background-position: 0 88%;
  background-size: 0% 48%;
  color: inherit;
  transition: background-size 1s var(--ease), color .6s;
}
.reader-text mark.is-on { background-size: 100% 48%; color: var(--ink); }

.reader-tags { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.reader-tags li {
  padding: 8px 10px;
  border: 2px dashed var(--ink-3);
  border-radius: 12px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  transition: background-color .4s, border-color .4s, color .4s;
}
.reader-tags li span { margin-right: 4px; font-weight: 800; }
.reader-tags li.is-on { border-style: solid; border-color: var(--ink); color: var(--ink); background: var(--lavender); }
.reader-tags li.is-on:nth-child(2) { background: var(--sky); }
.reader-tags li.is-on:nth-child(3) { background: var(--mint); }
.reader-tags li.is-on:nth-child(4) { background: var(--butter); }

.reader-foot { margin-top: 16px; padding-top: 14px; border-top: 2px dashed var(--line); }
.reader-status { color: var(--ink-2); }
.reader-status.is-done { color: var(--violet); }
.reader-replay {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font: 700 13px/1.4 var(--sans);
  text-decoration: underline wavy var(--coral);
  text-underline-offset: 4px;
  cursor: pointer;
}

/* Cinta de conceptos (página de IA) */
.ticker { overflow: hidden; border-block: 2px solid var(--ink); background: var(--lime); }
.ticker-track { display: flex; width: max-content; animation: ticker 60s linear infinite; }
.ticker-group { display: flex; }
.ticker span {
  padding: 13px 22px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}
.ticker span::before { content: '§'; margin-right: 22px; color: var(--violet); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ==========================================================================
   Secciones
   ========================================================================== */

.section { padding-block: clamp(56px, 8vw, 104px) 0; }
.section-head { display: grid; justify-items: start; gap: 12px; margin-bottom: clamp(32px, 5vw, 56px); }

.section-num {
  --rot: -3deg;
  font-family: var(--hand);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--violet);
  transform: rotate(var(--rot));
}
.section-title {
  max-width: 18ch;
  font-family: var(--display);
  font-size: clamp(2.2rem, 1.5rem + 2.8vw, 3.75rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.section-aside {
  padding: 5px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--butter);
  font-size: 14px;
  font-weight: 700;
}

/* Inicio: acceso a las áreas */
.areas { display: grid; gap: 22px; }
.area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  padding: 26px;
  border: 2px solid var(--ink);
  border-radius: 26px;
  background: var(--lavender);
  box-shadow: var(--shadow);
  transition: translate .3s var(--ease), box-shadow .3s var(--ease);
}
.area:nth-child(2) { background: var(--sky); }
.area:nth-child(3) { background: var(--mint); }
.area:nth-child(4) { background: var(--butter); }
.area:hover { translate: -3px -3px; box-shadow: var(--shadow-lg); }
.area-num {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--lime);
  font-size: 14px;
  font-weight: 700;
}
.area-title {
  max-width: 14ch;
  font-family: var(--display);
  font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.75rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.03em;
}
.area-desc { max-width: 40ch; color: var(--ink-2); }
.area-go {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  margin-top: auto;
  padding: 8px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}
.area-go i { font-style: normal; transition: transform .3s var(--ease); }
.area:hover .area-go i { transform: translateX(5px); }

/* Enfoque (página de IA) */
.principles { display: grid; gap: 18px; }
.principle {
  padding: 24px;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}
.principle-num {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--coral);
  font-family: var(--display);
  font-weight: 800;
}
.principle:nth-child(2) .principle-num { background: var(--sky); }
.principle:nth-child(3) .principle-num { background: var(--mint); }
.principle h3 {
  margin: 18px 0 8px;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.principle p { color: var(--ink-2); }

/* Módulos: tarjetas de colores */
.modules { display: grid; gap: 22px; }

.module {
  border: 2px solid var(--ink);
  border-radius: 24px;
  background: var(--lavender);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: translate .3s var(--ease), box-shadow .3s var(--ease);
}
.module:nth-child(3n + 2) { background: var(--sky); }
.module:nth-child(3n + 3) { background: var(--mint); }
.module:hover { translate: -2px -2px; box-shadow: var(--shadow-lg); }

.module summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px 16px;
  align-items: center;
  padding: 20px 20px 20px 18px;
  cursor: pointer;
  list-style: none;
}
.module summary::-webkit-details-marker { display: none; }

.module-num {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 800;
}
.module-title {
  grid-column: 2;
  font-family: var(--display);
  font-size: clamp(1.45rem, 1.2rem + 1vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.module-desc { grid-column: 2; font-size: 15px; color: var(--ink-2); }
.module-meta {
  grid-column: 2;
  justify-self: start;
  padding: 3px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}
.module-icon {
  grid-column: 3;
  grid-row: 1 / span 2;
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform .35s var(--ease);
}
.module-icon::before, .module-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  margin: -1px 0 0 -7px;
  border-radius: 2px;
  background: var(--paper);
}
.module-icon::after { transform: rotate(90deg); }
.module[open] .module-icon { transform: rotate(45deg); }

.module-body {
  padding: 6px 22px 14px;
  border-top: 2px solid var(--ink);
  background: #fff;
}
.module-body li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1.5px dashed var(--line);
}
.module-body li:last-child { border-bottom: 0; }
.module-body li::before {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
}
.topic-text { font-weight: 500; }

.topic-video {
  grid-column: 2;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: 2px dashed var(--ink-3);
  border-radius: 999px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.topic-video[href] { border: 2px solid var(--ink); background: var(--ink); color: var(--lime); cursor: pointer; }
.topic-video[href]::before {
  content: '';
  border-left: 8px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.topic-video[href]:hover { background: var(--violet); border-color: var(--ink); color: #fff; }

.coming {
  --rot: -1.5deg;
  margin-top: 30px;
  font-family: var(--hand);
  font-size: 27px;
  line-height: 1.2;
  color: var(--ink-2);
  transform: rotate(var(--rot));
}
.coming::before { content: '↳ '; color: var(--coral); }

/* Charlas (página de IA) */
.talks {
  display: grid;
  justify-items: start;
  gap: 16px;
  margin-top: 40px;
  padding: 26px;
  border: 2px solid var(--ink);
  border-radius: 24px;
  background: var(--butter);
  box-shadow: var(--shadow);
}
.talks-label { font-family: var(--hand); font-size: 30px; font-weight: 700; line-height: 1; color: var(--violet); }
.talks-text { max-width: 32ch; font-family: var(--display); font-size: 1.4rem; font-weight: 700; line-height: 1.2; }

/* Recursos (página de IA): textos que se despliegan */
.readings { display: grid; gap: 18px; }
.reading {
  border: 2px solid var(--ink);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.reading summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  padding: 22px 24px;
  cursor: pointer;
  list-style: none;
}
.reading summary::-webkit-details-marker { display: none; }
.reading-type {
  grid-column: 1;
  justify-self: start;
  padding: 3px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--lavender);
  font-size: 13px;
  font-weight: 700;
}
.reading:nth-child(2) .reading-type { background: var(--sky); }
.reading:nth-child(3) .reading-type { background: var(--mint); }
.reading-title {
  grid-column: 1;
  font-family: var(--display);
  font-size: clamp(1.45rem, 1.2rem + 1vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.reading-desc { grid-column: 1; font-size: 15px; color: var(--ink-2); }
.reading-open {
  grid-column: 2;
  grid-row: 1 / span 3;
  padding: 8px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--lime);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.reading-open::after { content: 'Leer'; }
.reading[open] .reading-open { background: #fff; }
.reading[open] .reading-open::after { content: 'Cerrar'; }

.reading-body { padding: 4px 24px 30px; border-top: 2px solid var(--ink); background: #FFFDF8; }
.reading-text { max-width: 72ch; padding-top: 22px; }
.reading-text.reading-wide { max-width: none; }
.reading-text p { color: var(--ink-2); }
.reading-text h4 { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.reading-text .reading-intro {
  max-width: 46ch;
  margin-bottom: 28px;
  font-family: var(--display);
  font-size: clamp(1.25rem, 1.1rem + .5vw, 1.5rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}
.reading-text .reading-subtitle {
  margin: 36px 0 12px;
  font-family: var(--hand);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--violet);
}

.rules { counter-reset: regla; display: grid; gap: 12px; }
.rules li {
  counter-increment: regla;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  padding: 16px 18px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: #fff;
}
.rules li::before {
  content: counter(regla);
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--coral);
  font-family: var(--display);
  font-weight: 800;
}
.rules li:nth-child(3n + 2)::before { background: var(--sky); }
.rules li:nth-child(3n + 3)::before { background: var(--mint); }
.rules h4 { margin: 8px 0 4px; }

.checklist li, .bullets li { position: relative; margin: 10px 0; padding-left: 32px; color: var(--ink-2); }
.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .2em;
  width: 20px;
  height: 20px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fff;
}
.bullets li::before { content: '→'; position: absolute; left: 2px; color: var(--violet); font-weight: 700; }

.prompt {
  margin: 14px 0 0;
  padding: 20px 22px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--ink);
  color: #E9E6FF;
  font: 13.5px/1.7 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.prompt-actions { margin-top: 16px; }

.terms { display: grid; gap: 12px; }
.term { padding: 18px 20px; border: 2px solid var(--ink); border-radius: 18px; background: #fff; }
.term h4 {
  display: inline;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(transparent 60%, var(--butter) 60%);
}
.term h4 + p { margin-top: 8px; }
.reading-text .term-note { margin-top: 8px; font-size: 14px; color: var(--ink-3); }

.reading-text .reading-note { margin-top: 28px; font-size: 13px; color: var(--ink-3); }
.reading-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* Lecturas de referencia */
.references {
  margin-top: 28px;
  padding: 24px;
  border: 2px solid var(--ink);
  border-radius: 24px;
  background: var(--sky);
  box-shadow: var(--shadow);
}
.resource-type {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--lime);
  font-size: 13px;
  font-weight: 700;
}
.references h3 {
  margin: 14px 0 14px;
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.resource-links ul { display: grid; gap: 8px; }
.resource-links a {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  font-weight: 600;
  transition: translate .2s var(--ease), box-shadow .2s var(--ease);
}
.resource-links a:hover { translate: -2px -2px; box-shadow: 3px 3px 0 var(--ink); }
.resource-links a span { align-self: center; font-size: 13px; font-weight: 500; color: var(--ink-3); }

/* Trayectoria (inicio) */
.about { display: grid; gap: 40px; }
.portrait {
  --rot: -2deg;
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  max-width: 420px;
  border: 2px solid var(--ink);
  border-radius: 26px;
  background: var(--sky);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: rotate(var(--rot));
}
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portrait-mark { font-family: var(--display); font-size: 140px; font-weight: 800; color: rgba(28, 26, 46, .2); }
.portrait-caption { position: absolute; left: 16px; bottom: 14px; font-size: 13px; font-weight: 700; }

.about-name {
  --rot: -1.5deg;
  display: inline-block;
  margin-bottom: 18px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--lime);
  font-size: 14px;
  font-weight: 700;
  transform: rotate(var(--rot));
}
.bio {
  max-width: 30ch;
  font-family: var(--display);
  font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.timeline { display: grid; gap: 12px; margin-top: 36px; }
.timeline li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 14px;
  padding: 14px 18px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
}
.tl-year {
  grid-row: 1 / span 2;
  align-self: start;
  padding: 3px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--butter);
  font-size: 13px;
  font-weight: 700;
}
.tl-title { font-weight: 700; }
.tl-place { grid-column: 2; color: var(--ink-2); }

/* ==========================================================================
   Contacto
   ========================================================================== */

.contact {
  margin-block: clamp(72px, 10vw, 128px);
  padding: clamp(32px, 6vw, 72px);
  border: 2px solid var(--ink);
  border-radius: 32px;
  background: var(--violet);
  box-shadow: 8px 8px 0 var(--ink);
  color: #fff;
}
.contact .section-num { color: var(--lime); }
.contact-title {
  max-width: 20ch;
  margin: 18px 0 32px;
  font-family: var(--display);
  font-size: clamp(2rem, 1.3rem + 2.8vw, 3.5rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  padding: 12px 22px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: clamp(1rem, .9rem + .8vw, 1.35rem);
  font-weight: 700;
  overflow-wrap: anywhere;
  transition: translate .25s var(--ease), box-shadow .25s var(--ease);
}
.contact-mail:hover { translate: -2px -2px; box-shadow: var(--shadow-lg); }
.contact-mail span { color: var(--violet); }
.contact-note { margin-top: 32px; max-width: 60ch; font-size: 14px; color: rgba(255, 255, 255, .82); }

/* ==========================================================================
   Pie
   ========================================================================== */

.site-footer { background: var(--ink); color: #D6D3EA; }
.footer-inner { display: grid; gap: 12px; padding-block: 44px 52px; font-size: 15px; }
.site-footer .wordmark { color: var(--paper); }
.site-footer .wordmark em { color: var(--ink); }
.footer-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 6px; font-size: 13px; color: #A3A0BF; }
.footer-meta a:hover { color: var(--lime); }

/* ==========================================================================
   Reproductor de video
   ========================================================================== */

.player {
  width: min(960px, calc(100vw - 32px));
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: var(--ink);
  box-shadow: 8px 8px 0 #000;
  overflow: hidden;
}
.player::backdrop { background: rgba(28, 26, 46, .7); }
.player-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 10px 10px 18px;
  background: var(--lime);
  border-bottom: 2px solid var(--ink);
  color: var(--ink);
  font-weight: 700;
}
.player-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-close {
  padding: 7px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: 700 14px/1 var(--sans);
  cursor: pointer;
}
.player-frame { aspect-ratio: 16 / 9; }
.player-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ==========================================================================
   Aparición al hacer scroll (respeta la inclinación de cada pieza)
   ========================================================================== */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px) rotate(var(--rot));
  transition: opacity .6s ease, transform .7s var(--ease), translate .3s var(--ease), box-shadow .3s var(--ease);
}
.js [data-reveal].is-visible { opacity: 1; transform: rotate(var(--rot)); }

/* ==========================================================================
   Pantallas medianas y grandes
   ========================================================================== */

@media (min-width: 720px) {
  .module summary { grid-template-columns: auto minmax(0, 1fr) auto auto; padding: 22px 24px; }
  .module-meta { grid-column: 3; grid-row: 1 / span 2; justify-self: end; }
  .module-icon { grid-column: 4; }
  .module-body li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .topic-video { grid-column: 3; }
  .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .principles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .talks { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 28px; }
}

@media (min-width: 960px) {
  .page-hero-grid { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
  .page-hero-grid:has(.reader) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 56px; }
  .page-mark { display: grid; }
  .module-body { padding-left: 86px; }
  .terms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 64px; align-items: start; }
}

/* ==========================================================================
   Editor visual (solo aparece al abrir el sitio en el propio computador)
   ========================================================================== */

html body .ed-bar { background: var(--ink); border: 2px solid var(--ink); box-shadow: var(--shadow); }
html body .ed-bar .ed-btn { color: var(--paper); }
html body .ed-bar .ed-btn.ed-primary { background: var(--lime); color: var(--ink); }
html body .ed-bar .ed-status { color: #CFCBE6; }

/* ==========================================================================
   Movimiento reducido
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; transform: rotate(var(--rot)); }
}
