/*
 * Estilos que esta página heredaba del sitio de la ASOESEM cuando era una
 * página de Jekyll (copiados de su hoja de estilos, solo las reglas que la
 * afectaban), para que se vea igual que antes. Modo oscuro: :root[dark],
 * que marca recursos/comun/barra.js. Los estilos propios de la página
 * siguen después y tienen prioridad.
 */
:root { --primary-color: #f8ce5f; --accent-color: #d7191f; --white: #fff; --light-gray: #f0f0f0; --lighten-blue: #eaecef; --light-blue: #e4e6eb; --blue-gray: #697177; --gray: #9e9e9e; --dark: #111; --dark-blue: #1e2943; --background-color: var(--white); --background-alt-color: var(--lighten-blue); --background-alt-color-2: var(--light-blue); --text-color: #1a1a1a; --text-alt-color: var(--blue-gray); --heading-font-color: var(--dark); --link-color: var(--dark); --link-color-hover: var(--dark); --button-color: #320101; --button-background-color: var(--primary-color); --button-background-hover: #edc352; --border-color: var(--light-blue); --border-alt-color: var(--white); --th-color: var(--light-gray); --tr-color: var(--light-gray); --syntax-highlighting-background: var(--light-gray); --card-background: #add8e6; --card-preview-bg: #e0f7fa; --course-approved: #009E73; --course-available: #0173B2; --course-blocked: #D55E00; --course-elective: #E69F00; }
:root[dark] { --primary-color: #fbdab1; --accent-color: #ff6b63; --white: #fff; --light-gray: #f5f5f5; --gray: #9a9a9a; --dark: #2a2b2d; --dark-blue: #181818; --background-color: var(--dark-blue); --background-alt-color: var(--dark); --background-alt-color-2: #262729; --text-color: #d4d4d4; --text-alt-color: #a3a3a3; --heading-font-color: #f0f0f0; --link-color: var(--light-gray); --link-color-hover: var(--light-gray); --button-color: var(--dark); --button-background-color: var(--primary-color); --button-background-hover: #d3b795; --border-color: #333; --border-alt-color: #333; --th-color: var(--dark); --tr-color: var(--dark); --syntax-highlighting-background: var(--dark); --card-background: #2a2b2d; --card-preview-bg: #3a3b3d; --course-approved: #4ECDC4; --course-available: #56B4E9; --course-blocked: #FF8C69; --course-elective: #FFB347; }
html { line-height: 1.15; text-size-adjust: 100%; }
body { margin: 0px; }
h1 { font-size: 2em; margin: 0.67em 0px; }
a { background-color: rgba(0, 0, 0, 0); }
strong { font-weight: bolder; }
button { font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0px; }
button { overflow: visible; }
button { text-transform: none; }
button { appearance: button; }
::-webkit-file-upload-button { appearance: button; font: inherit; }
body, h1, h2, h3, h4, p, blockquote { margin: 0px; padding: 0px; }
h1, h2, h3, h4, blockquote, p { margin-bottom: 32px; }
*, ::after, ::before { box-sizing: border-box; }
body { font-family: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; overflow-x: hidden; color: var(--text-color); background-color: var(--background-color); -webkit-font-smoothing: antialiased; }
@media (max-width: 768px) {
  body { font-size: 16px; }
}
h1, h2, h3, h4 { font-family: "Source Serif 4", Georgia, "Times New Roman", serif; font-weight: 700; line-height: 1.3; letter-spacing: normal; color: var(--heading-font-color); }
h1 { font-size: 36px; }
h2 { font-size: 28px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }
blockquote { position: relative; margin: 48px 0px; padding-left: 32px; font-family: "Source Serif 4", Georgia, "Times New Roman", serif; font-size: 30px; line-height: 1.6; font-style: italic; border-left: 4px solid var(--primary-color); color: var(--heading-font-color); }
@media (max-width: 1400px) {
  blockquote { margin: 40px 0px; font-size: 28px; }
}
@media (max-width: 768px) {
  blockquote { font-size: 22px; }
}
@media (max-width: 576px) {
  blockquote { margin: 32px 0px; padding-left: 20px; font-size: 20px; }
}
a { text-decoration: none; color: var(--link-color); }
:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 3px; border-radius: 2px; }
.content:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
html { scroll-padding-top: 84px; }
.hero { margin: 48px 0px; }
@media (max-width: 768px) {
  .hero { margin: 16px 0px 32px; }
}
:root { --math-block-margin: 20px 0; --math-block-border-radius: 8px; --math-block-border-width: 2px; --math-block-font-family: 'Source Serif 4', Georgia, serif; --math-title-padding: 8px 12px; --math-body-padding: 12px; --math-body-text-color-default: #000000; --original-theorem-bg: #e6f7ff; --original-theorem-border: #91d5ff; --original-theorem-text: #0050b3; --original-postulate-bg: #fffbe6; --original-postulate-border: #ffe58f; --original-postulate-text: #ad8b00; --original-corollary-bg: #f6ffed; --original-corollary-border: #b7eb8f; --original-corollary-text: #389e0d; --original-lemma-bg: #fff0f6; --original-lemma-border: #ffadd2; --original-lemma-text: #c41d7f; --original-axiom-bg: #f0f5ff; --original-axiom-border: #adc6ff; --original-axiom-text: #1d39c4; --original-definition-bg: #e6fffb; --original-definition-border: #87e8de; --original-definition-text: #006d75; --original-proof-bg: #e8f5e9; --original-proof-border: #81c784; --original-proof-text: #2e7d32; --original-proof-qed-color: #2e7d32; --math-body-text-color-default-dark: #cccccc; --original-theorem-bg-dark: #3E5263; --original-theorem-text-dark: #A8B8C5; --original-theorem-border-dark: #587083; --original-postulate-bg-dark: #5A523E; --original-postulate-text-dark: #C2BBA7; --original-postulate-border-dark: #786F57; --original-corollary-bg-dark: #3E5A4C; --original-corollary-text-dark: #A7C2B3; --original-corollary-border-dark: #577867; --original-lemma-bg-dark: #634A5F; --original-lemma-text-dark: #C5AEC0; --original-lemma-border-dark: #83687E; --original-axiom-bg-dark: #4A4A6A; --original-axiom-text-dark: #AEAFC9; --original-axiom-border-dark: #68688B; --original-definition-bg-dark: #3E5A5A; --original-definition-text-dark: #A7C2C2; --original-definition-border-dark: #577878; --original-proof-bg-dark: #4F5A4E; --original-proof-text-dark: #B8C2B7; --original-proof-border-dark: #6A7869; --original-proof-qed-color-dark: var(--original-proof-text-dark); --theorem-title-bg: var(--original-theorem-text); --theorem-title-text: var(--original-theorem-bg); --theorem-body-bg: var(--original-theorem-bg); --theorem-outer-border: var(--original-theorem-border); --postulate-title-bg: var(--original-postulate-text); --postulate-title-text: var(--original-postulate-bg); --postulate-body-bg: var(--original-postulate-bg); --postulate-outer-border: var(--original-postulate-border); --corollary-title-bg: var(--original-corollary-text); --corollary-title-text: var(--original-corollary-bg); --corollary-body-bg: var(--original-corollary-bg); --corollary-outer-border: var(--original-corollary-border); --lemma-title-bg: var(--original-lemma-text); --lemma-title-text: var(--original-lemma-bg); --lemma-body-bg: var(--original-lemma-bg); --lemma-outer-border: var(--original-lemma-border); --axiom-title-bg: var(--original-axiom-text); --axiom-title-text: var(--original-axiom-bg); --axiom-body-bg: var(--original-axiom-bg); --axiom-outer-border: var(--original-axiom-border); --definition-title-bg: var(--original-definition-text); --definition-title-text: var(--original-definition-bg); --definition-body-bg: var(--original-definition-bg); --definition-outer-border: var(--original-definition-border); --proof-title-bg: var(--original-proof-text); --proof-title-text: var(--original-proof-bg); --proof-body-bg: var(--original-proof-bg); --proof-outer-border: var(--original-proof-border); --proof-qed-color: var(--original-proof-qed-color); }
:root[dark] { --math-body-text-color-default: var(--math-body-text-color-default-dark); --theorem-title-bg: var(--original-theorem-text-dark); --theorem-title-text: var(--original-theorem-bg-dark); --theorem-body-bg: var(--original-theorem-bg-dark); --theorem-outer-border: var(--original-theorem-border-dark); --postulate-title-bg: var(--original-postulate-text-dark); --postulate-title-text: var(--original-postulate-bg-dark); --postulate-body-bg: var(--original-postulate-bg-dark); --postulate-outer-border: var(--original-postulate-border-dark); --corollary-title-bg: var(--original-corollary-text-dark); --corollary-title-text: var(--original-corollary-bg-dark); --corollary-body-bg: var(--original-corollary-bg-dark); --corollary-outer-border: var(--original-corollary-border-dark); --lemma-title-bg: var(--original-lemma-text-dark); --lemma-title-text: var(--original-lemma-bg-dark); --lemma-body-bg: var(--original-lemma-bg-dark); --lemma-outer-border: var(--original-lemma-border-dark); --axiom-title-bg: var(--original-axiom-text-dark); --axiom-title-text: var(--original-axiom-bg-dark); --axiom-body-bg: var(--original-axiom-bg-dark); --axiom-outer-border: var(--original-axiom-border-dark); --definition-title-bg: var(--original-definition-text-dark); --definition-title-text: var(--original-definition-bg-dark); --definition-body-bg: var(--original-definition-bg-dark); --definition-outer-border: var(--original-definition-border-dark); --proof-title-bg: var(--original-proof-text-dark); --proof-title-text: var(--original-proof-bg-dark); --proof-body-bg: var(--original-proof-bg-dark); --proof-outer-border: var(--original-proof-border-dark); --proof-qed-color: var(--original-proof-qed-color-dark); }
@media print {
  :root, :root[dark] { --background-color: #fff; --background-alt-color: #f2f2f2; --text-color: #000; --text-alt-color: #444; --heading-font-color: #000; --link-color: #000; --border-color: #bbb; --accent-color: #b3141a; color-scheme: light; }
  html, body { color: rgb(0, 0, 0); background: rgb(255, 255, 255) !important; }
  a { color: inherit !important; }
}

/* ─── Estilos propios ─────────────────────────────────────────── */
:root {
  --ink: #1a1410;
  --cream: #f6f1e7;
  --parchment: #ede4d3;
  --gold: #c5953a;
  --gold-light: #e8c96a;
  --gold-dark: #8a6820;
  --rust: #a0522d;
  --teal: #2a7a6d;
  --teal-light: #3aa391;
  --teal-dark: #1d5a50;
  --blue-deep: #2c4a6e;
  --blue-light: #4a7eb5;
  --violet: #6b4c8a;
  --violet-light: #8e6db5;
  --red-warm: #b54a3a;
  --phase1: #2a7a6d;
  --phase2: #c5953a;
  --phase3: #a0522d;
  --phase4: #6b4c8a;
  --shadow-soft: 0 2px 20px rgba(26,20,16,0.08);
  --shadow-card: 0 4px 30px rgba(26,20,16,0.12);
  --shadow-elevated: 0 12px 50px rgba(26,20,16,0.18);
}

/* ── DARK MODE ─────────────────────────────────────────────────────────── */
:root[dark] {
  --ink:            #e2d9c4;
  --cream:          #1a180e;
  --parchment:      #272310;
  --gold:           #c8a050;
  --gold-light:     #dfc070;
  --gold-dark:      #907030;
  --rust:           #c07850;
  --teal:           #4a9e8c;
  --teal-light:     #5ab8a4;
  --teal-dark:      #2d7a6a;
  --blue-deep:      #5888b0;
  --blue-light:     #78a8d0;
  --violet:         #9070b0;
  --violet-light:   #b090d0;
  --red-warm:       #c86858;
  --phase1:         #3d8a78;
  --phase2:         #b88c38;
  --phase3:         #a86838;
  --phase4:         #806898;
  --shadow-soft:    0 2px 20px rgba(0,0,0,0.4);
  --shadow-card:    0 4px 30px rgba(0,0,0,0.5);
  --shadow-elevated: 0 12px 50px rgba(0,0,0,0.6);
}

/* Base */
:root[dark] body {
  background: #14120a;
  color: var(--ink);
}

/* Hero — keep its own gradient but darken base */
:root[dark] .hero {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(61,138,120,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(200,160,80,0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(128,104,152,0.05) 0%, transparent 50%),
    #14120a;
}
:root[dark] .hero::before {
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(226,217,196,0.025) 39px, rgba(226,217,196,0.025) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(226,217,196,0.015) 39px, rgba(226,217,196,0.015) 40px);
}
:root[dark] .hero h1 { color: var(--ink); }
:root[dark] .hero-description { color: rgba(226,217,196,0.6); }
:root[dark] .hero-author { color: var(--rust); }

/* Sticky nav */
:root[dark] .sticky-nav {
  background: rgba(20,18,10,0.95);
  border-bottom: 1px solid rgba(226,217,196,0.07);
}
:root[dark] .sticky-nav a { color: rgba(226,217,196,0.6); }

/* Context / intro section */
:root[dark] .context-section { background: #1e1c10; }
:root[dark] .context-main h2 { color: var(--ink); }
:root[dark] .context-main p { color: rgba(226,217,196,0.7); }
:root[dark] .context-sidebar { background: #272310; }
:root[dark] .context-sidebar blockquote { color: var(--ink); }
:root[dark] .context-sidebar cite { color: var(--gold); }

/* Overview / diagram section */
:root[dark] .overview-section { background: #14120a; }
:root[dark] .overview-section h2 { color: var(--ink); }
:root[dark] .overview-subtitle { color: rgba(226,217,196,0.55); }
:root[dark] .phase-diagram-card:not(:last-child)::after {
  background: repeating-linear-gradient(to bottom, rgba(226,217,196,0.12) 0px, rgba(226,217,196,0.12) 6px, transparent 6px, transparent 12px);
}
:root[dark] .phase-diagram-content h3 { color: var(--ink); }
:root[dark] .phase-diagram-content p { color: rgba(226,217,196,0.65); }

/* Phase sections */
:root[dark] .phase-section { background: #14120a; }
:root[dark] .phase-header-text h2 { color: var(--ink); }
:root[dark] .phase-intro { color: rgba(226,217,196,0.72); }
:root[dark] .role-tab {
  border-color: rgba(226,217,196,0.15);
  color: var(--ink);
  background: transparent;
}
:root[dark] .role-tab:hover { border-color: rgba(226,217,196,0.35); }
:root[dark] .q-card { background: #252210; }
:root[dark] .q-card .q-text { color: var(--ink); }
:root[dark] .q-card .q-note { color: rgba(226,217,196,0.5); }
:root[dark] .strategy-box { background: #1e1c10; box-shadow: none; border: 1px solid rgba(226,217,196,0.06); }
:root[dark] .strategy-box h4 { color: var(--ink); }
:root[dark] .strategy-item { background: #272310; color: rgba(226,217,196,0.75); }
:root[dark] .strategy-item strong { color: var(--ink); }
:root[dark] .connection-note {
  background: linear-gradient(135deg, rgba(61,138,120,0.08), rgba(128,104,152,0.08));
  border-color: rgba(226,217,196,0.07);
}
:root[dark] .connection-note p { color: rgba(226,217,196,0.65); }
:root[dark] .connection-note strong { color: var(--ink); }
:root[dark] .concept-highlight { background: linear-gradient(to bottom, transparent 60%, rgba(200,160,80,0.18) 60%); }

/* Heuristics section — already dark-on-dark in light mode; keep it very dark */
:root[dark] .heuristics-section { background: #0e0c06; }
:root[dark] .heuristics-section h2 { color: var(--ink); }
:root[dark] .heuristics-subtitle { color: rgba(226,217,196,0.45); }
:root[dark] .heuristic-category-header { border-bottom-color: rgba(226,217,196,0.08); }
:root[dark] .heuristic-category-header h3 { color: var(--ink); }
:root[dark] .heuristic-category-header .cat-desc { color: rgba(226,217,196,0.35); }
:root[dark] .heuristic-card {
  background: rgba(255,255,255,0.04);
  border-color: rgba(226,217,196,0.07);
}
:root[dark] .heuristic-card h4 { color: var(--gold); }
:root[dark] .heuristic-card p { color: rgba(226,217,196,0.6); }
:root[dark] .heuristic-card .h-en { color: rgba(226,217,196,0.25); }

/* Teacher section */
:root[dark] .teacher-deep-section { background: linear-gradient(180deg, #1a1e24 0%, #14120a 100%); }
:root[dark] .teacher-deep-section h2 { color: var(--blue-deep); }
:root[dark] .teacher-deep-subtitle { color: rgba(226,217,196,0.5); }
:root[dark] .mandamiento { background: #1c1a10; border: 1px solid rgba(226,217,196,0.05); box-shadow: none; }
:root[dark] .mandamiento h4 { color: var(--blue-light); }
:root[dark] .mandamiento p { color: rgba(226,217,196,0.6); }

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4rem 2rem;
  position: relative;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(42,122,109,0.07) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(197,149,58,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(107,76,138,0.05) 0%, transparent 50%),
    var(--cream);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(26,20,16,0.03) 39px, rgba(26,20,16,0.03) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(26,20,16,0.02) 39px, rgba(26,20,16,0.02) 40px);
  pointer-events: none;
}

.hero-ornament {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin-bottom: 2rem;
  animation: fadeSlideUp 1s ease-out 0.2s both;
}

.hero-subtitle-top {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1.5rem;
  animation: fadeSlideUp 1s ease-out 0.4s both;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 0.5rem;
  animation: fadeSlideUp 1s ease-out 0.6s both;
}

.hero h1 em {
  font-style: italic;
  color: var(--gold-dark);
}

.hero-author {
  font-family: 'Source Serif 4', serif;
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--rust);
  margin-bottom: 2rem;
  animation: fadeSlideUp 1s ease-out 0.8s both;
}

.hero-description {
  font-family: 'Source Serif 4', serif;
  font-size: 1.15rem;
  max-width: 640px;
  color: rgba(26,20,16,0.7);
  line-height: 1.85;
  margin-bottom: 3rem;
  animation: fadeSlideUp 1s ease-out 1s both;
}

.hero-phases-preview {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeSlideUp 1s ease-out 1.2s both;
}

.phase-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.phase-pill:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.phase-pill .num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.pill-1 { background: var(--phase1); }
.pill-2 { background: var(--phase2); color: var(--ink); }
.pill-2 .num { background: rgba(0,0,0,0.15); color: var(--ink); }
.pill-3 { background: var(--phase3); }
.pill-4 { background: var(--phase4); }

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite 2s;
}

.scroll-indicator svg {
  width: 28px;
  height: 28px;
  stroke: var(--gold);
  opacity: 0.5;
}

/* ===== CONTEXT / INTRO ===== */
.context-section {
  padding: 6rem 2rem;
  background: white;
  position: relative;
}

.context-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gold);
}

.context-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.context-main h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--ink);
}

.context-main p {
  font-family: 'Source Serif 4', serif;
  font-size: 1.05rem;
  color: rgba(26,20,16,0.75);
  margin-bottom: 1.2rem;
  line-height: 1.85;
}

.context-sidebar {
  background: var(--parchment);
  border-radius: 16px;
  padding: 2.5rem;
  position: relative;
}

.context-sidebar::before {
  content: '"';
  font-family: 'Playfair Display', serif;
  font-size: 6rem;
  color: var(--gold);
  position: absolute;
  top: -10px;
  left: 20px;
  line-height: 1;
  opacity: 0.5;
}

.context-sidebar blockquote {
  font-family: 'Source Serif 4', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink);
  line-height: 1.8;
  margin-bottom: 1rem;
  padding-top: 1.5rem;
}

.context-sidebar cite {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-style: normal;
  color: var(--rust);
  font-weight: 600;
}

/* ===== DIAGRAM OVERVIEW ===== */
.overview-section {
  padding: 6rem 2rem;
  background: var(--cream);
}

.overview-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  text-align: center;
  margin-bottom: 1rem;
}

.overview-subtitle {
  text-align: center;
  font-family: 'Source Serif 4', serif;
  color: rgba(26,20,16,0.6);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 4rem;
}

.phases-diagram {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  position: relative;
}

.phase-diagram-card {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
  position: relative;
  align-items: start;
}

.phase-diagram-card:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 39px;
  top: 80px;
  bottom: -10px;
  width: 2px;
  background: repeating-linear-gradient(to bottom, rgba(26,20,16,0.15) 0px, rgba(26,20,16,0.15) 6px, transparent 6px, transparent 12px);
}

.phase-number-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'Playfair Display', serif;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.phase-number-circle .roman {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}

.pnc-1 { background: var(--phase1); box-shadow: 0 4px 20px rgba(42,122,109,0.3); }
.pnc-2 { background: var(--phase2); box-shadow: 0 4px 20px rgba(197,149,58,0.3); }
.pnc-3 { background: var(--phase3); box-shadow: 0 4px 20px rgba(160,82,45,0.3); }
.pnc-4 { background: var(--phase4); box-shadow: 0 4px 20px rgba(107,76,138,0.3); }

.phase-diagram-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
}


.phase-diagram-content p {
  font-family: 'Source Serif 4', serif;
  font-size: 1rem;
  color: rgba(26,20,16,0.7);
  line-height: 1.8;
}

/* ===== PHASE SECTIONS ===== */
.phase-section {
  padding: 6rem 2rem;
  position: relative;
}

/* Fases alternas: la primera crema, la segunda blanca, etc. (como cuando la
   página era de Jekyll, donde la paridad incluía las etiquetas <link> y
   <style> previas). */
.phase-section:nth-child(odd) { background: var(--cream); }
.phase-section:nth-child(even) { background: white; }

.phase-header {
  max-width: 900px;
  margin: 0 auto 3rem;
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.phase-badge {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 900;
  flex-shrink: 0;
}

.badge-1 { background: var(--phase1); }
.badge-2 { background: var(--phase2); }
.badge-3 { background: var(--phase3); }
.badge-4 { background: var(--phase4); }

.phase-header-text {
  padding-top: 0.75rem;
}

.phase-header-text h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 0;
}


.phase-body {
  max-width: 900px;
  margin: 0 auto;
}

.phase-intro {
  font-family: 'Source Serif 4', serif;
  font-size: 1.1rem;
  line-height: 1.9;
  color: rgba(26,20,16,0.75);
  margin-bottom: 3rem;
  max-width: 750px;
}

/* Role tabs */
.role-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.role-tab {
  padding: 0.7rem 1.5rem;
  border: 2px solid rgba(26,20,16,0.12);
  background: transparent;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--ink);
}

.role-tab:hover { border-color: rgba(26,20,16,0.3); }

.role-tab.active {
  border-color: currentColor;
  color: white;
}

.role-tab.student-tab.active { background: var(--teal); border-color: var(--teal); }
.role-tab.teacher-tab.active { background: var(--blue-deep); border-color: var(--blue-deep); }

.role-content { display: none; }
.role-content.active { display: block; }

/* Question cards */
.questions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.q-card {
  background: var(--parchment);
  border-radius: 12px;
  padding: 1.5rem 1.8rem;
  border-left: 4px solid;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.q-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-soft);
}

.q-card.student-card { border-left-color: var(--teal); }
.q-card.teacher-card { border-left-color: var(--blue-deep); }

.q-card .q-icon {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.q-card .q-text {
  font-family: 'Source Serif 4', serif;
  font-size: 1.02rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.q-card .q-note {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  color: rgba(26,20,16,0.55);
  line-height: 1.6;
}

/* Strategy boxes */
.strategy-box {
  background: white;
  border-radius: 14px;
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-soft);
}

.strategy-box h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.strategy-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.strategy-item {
  font-family: 'Source Serif 4', serif;
  font-size: 0.95rem;
  padding: 0.8rem 1rem;
  background: var(--parchment);
  border-radius: 8px;
  color: rgba(26,20,16,0.8);
  line-height: 1.6;
}

.strategy-item strong {
  color: var(--ink);
}

/* ===== CONNECTIONS / ARROWS ===== */
.connection-note {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 2.5rem;
  background: linear-gradient(135deg, rgba(42,122,109,0.06), rgba(107,76,138,0.06));
  border-radius: 14px;
  border: 1px solid rgba(26,20,16,0.06);
  margin-top: 2rem;
}

.connection-note p {
  font-family: 'Source Serif 4', serif;
  font-size: 1rem;
  color: rgba(26,20,16,0.7);
  line-height: 1.8;
}

.connection-note strong {
  color: var(--ink);
}

/* ===== HEURISTICS CATALOG ===== */
.heuristics-section {
  padding: 6rem 2rem;
  background: var(--ink);
  color: var(--cream);
}

.heuristics-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--cream);
}

.heuristics-subtitle {
  text-align: center;
  font-family: 'Source Serif 4', serif;
  color: rgba(246,241,231,0.5);
  margin-bottom: 1.5rem;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.heuristics-count {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 3.5rem;
  opacity: 0.7;
}

.heuristic-category {
  max-width: 1200px;
  margin: 0 auto 3rem;
}

.heuristic-category-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(246,241,231,0.1);
}

.heuristic-category-title {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.heuristic-category-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.cat-strategy .heuristic-category-icon { background: rgba(42,122,109,0.25); }
.cat-reasoning .heuristic-category-icon { background: rgba(197,149,58,0.25); }
.cat-representation .heuristic-category-icon { background: rgba(160,82,45,0.25); }
.cat-metacognition .heuristic-category-icon { background: rgba(107,76,138,0.25); }
.cat-comprehension .heuristic-category-icon { background: rgba(74,126,181,0.25); }
.cat-mobilize .heuristic-category-icon { background: rgba(58,163,145,0.25); }
.cat-verify .heuristic-category-icon { background: rgba(181,74,58,0.25); }
.cat-historical .heuristic-category-icon { background: rgba(246,241,231,0.12); }

.heuristic-category-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--cream);
  padding-top: 0.3rem;
  margin-bottom: 0;
  margin-top: 0;
}

.heuristic-category-header .cat-desc {
  font-family: 'Source Serif 4', serif;
  font-size: 0.85rem;
  color: rgba(246,241,231,0.4);
}

.heuristics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.heuristic-card {
  background: rgba(246,241,231,0.05);
  border: 1px solid rgba(246,241,231,0.08);
  border-radius: 14px;
  padding: 1.6rem 1.8rem;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.heuristic-card:hover {
  background: rgba(246,241,231,0.1);
  border-color: rgba(246,241,231,0.2);
  transform: translateY(-3px);
}

.heuristic-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.heuristic-card-head .h-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.heuristic-card h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.08rem;
  color: var(--gold-light);
  line-height: 1.3;
}

.heuristic-card .h-en {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(246,241,231,0.3);
  display: block;
  margin-bottom: 0.7rem;
}

.heuristic-card p {
  font-family: 'Source Serif 4', serif;
  font-size: 0.9rem;
  color: rgba(246,241,231,0.6);
  line-height: 1.75;
  flex: 1;
}

.heuristic-card .h-example {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(246,241,231,0.08);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  color: rgba(246,241,231,0.45);
  line-height: 1.6;
}

.heuristic-card .h-example strong {
  color: var(--gold);
  font-weight: 600;
}

.phase-tags {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.phase-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  color: white;
  opacity: 0.75;
}

.phase-tag.t1 { background: var(--phase1); }
.phase-tag.t2 { background: var(--phase2); color: var(--ink); }
.phase-tag.t3 { background: var(--phase3); }
.phase-tag.t4 { background: var(--phase4); }

/* ===== TEACHER SECTION ===== */
.teacher-deep-section {
  padding: 6rem 2rem;
  background: linear-gradient(180deg, #eef3f8 0%, white 100%);
}

.teacher-deep-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--blue-deep);
}

.teacher-deep-subtitle {
  text-align: center;
  font-family: 'Source Serif 4', serif;
  color: rgba(26,20,16,0.5);
  margin-bottom: 4rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.mandamientos-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  gap: 1.2rem;
}

.mandamiento {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 1.2rem;
  align-items: start;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease;
}

.mandamiento:hover { transform: translateX(4px); }

.mandamiento-num {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--blue-deep);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1.1rem;
}

.mandamiento h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--blue-deep);
  margin-bottom: 0.4rem;
}

.mandamiento p {
  font-family: 'Source Serif 4', serif;
  font-size: 0.92rem;
  color: rgba(26,20,16,0.65);
  line-height: 1.7;
}


/* ===== ANIMATIONS ===== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-8px); }
  60% { transform: translateX(-50%) translateY(-4px); }
}

.fade-in {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .context-grid { grid-template-columns: 1fr; gap: 2rem; }
  .strategy-list { grid-template-columns: 1fr; }
  .heuristics-grid { grid-template-columns: 1fr; }
  .heuristic-category-header { flex-direction: column; gap: 0.5rem; }
  .phase-diagram-card { grid-template-columns: 60px 1fr; gap: 1rem; }
  .phase-number-circle { width: 60px; height: 60px; }
  .phase-number-circle .roman { font-size: 1.2rem; }
  .phase-header { flex-direction: column; align-items: flex-start; }
  .role-tabs { flex-wrap: wrap; }
  .sticky-nav { justify-content: flex-start; padding: 0.5rem 0.5rem; }
  .sticky-nav a { font-size: 0.72rem; padding: 0.35rem 0.65rem; }
}

/* Nav sticky */
.sticky-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(246,241,231,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(26,20,16,0.08);
  padding: 0.6rem 1rem;
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  overflow-x: auto;
  scrollbar-width: none;
  transform: translateY(-100%);
  transition: transform 0.4s ease;
}

.sticky-nav::-webkit-scrollbar { display: none; }

.sticky-nav.visible { transform: translateY(0); }

.sticky-nav a {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  transition: background 0.2s;
  white-space: nowrap;
}

.sticky-nav a:hover { background: rgba(26,20,16,0.06); }
.sticky-nav a.nav-1:hover, .sticky-nav a.nav-1.active { background: var(--phase1); color: white; }
.sticky-nav a.nav-2:hover, .sticky-nav a.nav-2.active { background: var(--phase2); color: var(--ink); }
.sticky-nav a.nav-3:hover, .sticky-nav a.nav-3.active { background: var(--phase3); color: white; }
.sticky-nav a.nav-4:hover, .sticky-nav a.nav-4.active { background: var(--phase4); color: white; }

/* Print awareness */
.print-note {
  display: none;
}

/* Tooltip-like emphasis */
.concept-highlight {
  background: linear-gradient(to bottom, transparent 60%, rgba(197,149,58,0.2) 60%);
  padding: 0 2px;
}
