/* ==========================================================
   R2LAB · Guía de normas (página interna)
   Usa las variables y componentes de style.css
   ========================================================== */

/* Progreso de lectura dentro de la barra superior */
.read-progress { position: absolute; left: 22px; right: 22px; bottom: 3px; height: 3px; border-radius: 3px; overflow: hidden; pointer-events: none; }
.read-progress span { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--teal), var(--coral)); border-radius: 3px; }

/* ---------- Hero ---------- */
.n-hero { max-width: 1120px; margin: 0 auto; padding: 40px var(--pad) 36px; position: relative; }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 22px; }
.back-link span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--white); border: 1px solid var(--line); transition: transform .3s var(--ease); }
.back-link:hover span { transform: translateX(-3px); }
.n-hero .pill-dark { display: flex; width: fit-content; }
.n-hero h1 { max-width: 13ch; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.chips li { display: inline-flex; align-items: center; gap: 10px; background: var(--white); border: 1px solid #ebe8e2; font-size: 14px; font-weight: 600; padding: 9px 18px; border-radius: 999px; }
.dot.coral { background: var(--coral); box-shadow: 0 0 0 4px rgba(240, 71, 107, .18); }

/* ---------- Capítulos ---------- */
.n-main { max-width: 1120px; margin: 0 auto; padding: 0 var(--pad); }
.chapter { padding: 84px 0 8px; scroll-margin-top: 90px; }
.ch-head { display: grid; gap: 6px; margin-bottom: 28px; }
.ch-num {
  font-size: clamp(64px, 18vw, 140px); font-weight: 800; line-height: .8; letter-spacing: -.06em;
  color: transparent; -webkit-text-stroke: 2px rgba(240, 71, 107, .35);
}
.ch-head h2 { margin-top: 8px; }
.ch-lead { color: var(--muted); font-size: 17px; margin-top: 12px; max-width: 52ch; }

/* 01 · Pilares */
.pillars { display: grid; gap: 12px; }
.pillar { border-radius: 26px; padding: 24px; }
.pillar h3 { font-size: 22px; font-weight: 800; margin: 14px 0 4px; }
.pillar p { color: var(--muted); font-size: 15px; }
.p-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--white); }
.p-ic svg { width: 26px; height: 26px; fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.callout { display: flex; gap: 16px; align-items: flex-start; margin-top: 14px; border-radius: 24px; padding: 20px 22px; }
.callout b { display: block; font-size: 17px; font-weight: 700; }
.callout p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.teal-c { background: var(--text); color: var(--white); }
.teal-c b { color: var(--teal); }
.teal-c p { color: #c9c9d2; }
.warn-c { background: #fff3f5; border: 1.5px solid rgba(240, 71, 107, .35); }
.c-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--coral); color: var(--white); font-weight: 800; font-size: 20px; }

/* 02 · Vocabulario */
.vocab-card { background: var(--white); border-radius: 28px; padding: 22px; box-shadow: 0 24px 50px -28px rgba(21, 21, 27, .25); }
.vocab-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.vocab-hint { font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.vocab-hint i { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); animation: hintPulse 1.6s ease-in-out infinite; }
@keyframes hintPulse { 50% { transform: scale(.6); opacity: .4; } }
.reveal-all { border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; background: var(--text); color: var(--white); }
.words { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.words li {
  position: relative; cursor: pointer; user-select: none;
  font-size: 15px; font-weight: 700; padding: 9px 16px; border-radius: 999px;
  background: var(--pink); color: #a31c3c;
  filter: blur(5px); transition: filter .35s var(--ease), transform .3s var(--ease);
}
.words li::after { content: ""; position: absolute; left: 12px; right: 12px; top: 50%; height: 2px; background: var(--coral); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease) .1s; }
.words li.on { filter: none; }
.words li.on::after { transform: scaleX(1); }
.words li:active { transform: scale(.95); }
.words-extra { margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--muted); }
.sensitive { margin-top: 14px; background: var(--lavender); border-radius: 26px; padding: 22px; }
.sensitive p { color: var(--muted); font-size: 15px; margin-top: 12px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tags li { background: var(--white); font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 999px; }
.tags.outline li { background: transparent; border: 1px solid rgba(21, 21, 27, .18); font-weight: 500; }

/* 03 y 05 · Cuadrícula compacta */
.rk-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid rgba(21, 21, 27, .14); border-left: 1px solid rgba(21, 21, 27, .14); }
.rk {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 16px 22px;
  border-right: 1px solid rgba(21, 21, 27, .14); border-bottom: 1px solid rgba(21, 21, 27, .14);
  transition: background .5s var(--ease);
}
.rk::after { /* línea que se dibuja al pasar el mouse */
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px;
  background: var(--text); transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease);
}
.rk:hover::after { transform: scaleX(1); }
.rk-n { position: absolute; top: 16px; right: 14px; font-size: 11px; font-weight: 600; letter-spacing: 1px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rk h3 { font-size: clamp(15px, 4.2vw, 19px); font-weight: 700; letter-spacing: -.015em; line-height: 1.2; margin-top: 10px; transition: translate .5s var(--ease); }
.rk p { font-size: 13px; color: var(--muted); line-height: 1.4; }
.rk-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(21, 21, 27, .2); transition: background .4s var(--ease), border-color .4s, color .4s, rotate .6s var(--ease); }
.rk-ic svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.rk-ic svg circle[r=".9"] { fill: currentColor; }
.rk:hover h3 { translate: 3px 0; }
.rk:hover .rk-ic { background: var(--text); color: var(--white); border-color: var(--text); rotate: -8deg; }

/* Variante oscura (alto riesgo) */
.chapter-dark { padding-top: 84px; }
.dark-panel {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--text); color: var(--white);
  border-radius: 32px; padding: 34px 22px 26px;
}
.dark-panel::before { /* luz suave que sigue al scroll */
  content: ""; position: absolute; z-index: -1; width: 620px; height: 620px; right: -260px; top: -280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 71, 107, .28), transparent 62%);
}
.dark-panel .ch-num { -webkit-text-stroke: 1.5px rgba(255, 255, 255, .22); }
.dark-panel .label { color: rgba(255, 255, 255, .55); }
.dark-panel h2 em { color: #ff8aa3; }
.dark-panel .ch-lead { color: #a9a9b4; }
.rk-list.dark { border-color: rgba(255, 255, 255, .14); }
.rk-list.dark .rk { border-color: rgba(255, 255, 255, .14); }
.rk-list.dark .rk::after { background: #ff8aa3; }
.rk-list.dark .rk-n { color: rgba(255, 255, 255, .4); }
.rk-list.dark .rk p { color: #a9a9b4; }
.rk-list.dark .rk-ic { border-color: rgba(255, 255, 255, .28); color: var(--white); }
.rk-list.dark .rk:hover { background: rgba(255, 255, 255, .03); }
.rk-list.dark .rk:hover .rk-ic { background: var(--coral); border-color: var(--coral); }

/* 04 · Imagen */
.duo-cards { display: grid; gap: 12px; }
.dcard { border-radius: 26px; padding: 24px; }
.d-k { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.dcard h3 { font-size: 22px; font-weight: 800; margin-top: 8px; }
.d-sub { color: var(--muted); font-size: 14px; }
.checks { list-style: none; display: grid; gap: 10px; margin-top: 16px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; background: var(--white); border-radius: 14px; padding: 12px 14px; font-size: 15px; font-weight: 500; }
.checks li::before { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 800; color: var(--white); }
.checks .no::before { content: "✕"; background: var(--coral); }
.checks .yes::before { content: "✓"; background: var(--teal); }
.fine { font-size: 13px; color: var(--muted); margin-top: 14px; }
.fine a { color: var(--coral); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* 06 · Expresarte */
.swap { background: var(--text); color: var(--white); border-radius: 30px; padding: 28px 22px; overflow: hidden; position: relative; }
.swap::before { content: ""; position: absolute; width: 360px; height: 360px; right: -120px; bottom: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(47, 196, 164, .35), transparent 65%); }
.swap-k { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--teal); position: relative; }
.swap-stage { position: relative; height: clamp(86px, 23vw, 100px); margin: 18px 0; overflow: hidden; }
.swap-word { position: absolute; left: 0; right: 0; top: 0; font-size: clamp(30px, 8.5vw, 72px); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.swap-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.swap-list li { font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #c9c9d2; transition: background .3s, color .3s; }
.swap-list li.active { background: var(--teal); color: var(--text); }
.tips3 { display: grid; gap: 10px; margin-top: 12px; }
.tip { display: flex; gap: 14px; align-items: center; background: rgba(255, 255, 255, .8); border-radius: 20px; padding: 16px 18px; }
.tip b { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--coral); color: var(--white); font-weight: 800; }
.tip p { font-size: 15px; font-weight: 500; }

/* 07 · Checklist de moderación */
.checklist { background: rgba(255, 255, 255, .85); border: 1px solid rgba(21, 21, 27, .08); border-radius: 26px; padding: 22px 20px; }
.cl-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 16px; border-bottom: 1px solid rgba(21, 21, 27, .1); }
.cl-head span { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.cl-count { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; transition: color .3s; }
.cl-count.done { color: var(--teal); }
.cl-cols { display: grid; }
.cl-col { padding: 20px 0; border-bottom: 1px solid rgba(21, 21, 27, .1); }
.cl-when { font-size: 12px; font-weight: 600; color: var(--coral); }
.cl-col h3 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin: 2px 0 10px; }
.cl-col ul { list-style: none; display: grid; gap: 2px; }
.cl-item { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: none; font: inherit; font-size: 15px; color: var(--text); padding: 8px 0; cursor: pointer; line-height: 1.4; }
.cl-item i { flex: none; position: relative; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; border: 1.5px solid rgba(21, 21, 27, .3); transition: background .25s, border-color .25s; }
.cl-item i::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid var(--white); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.cl-item span { transition: color .25s; }
.cl-item[aria-pressed="true"] i { background: var(--teal); border-color: var(--teal); }
.cl-item[aria-pressed="true"] i::after { transform: rotate(45deg) scale(1); }
.cl-item[aria-pressed="true"] span { color: var(--muted); }
.cl-tip { display: flex; gap: 14px; align-items: flex-start; margin-top: 20px; }
.cl-tip img { flex: none; width: 36px; height: 36px; border-radius: 10px; }
.cl-tip p { font-size: 14px; color: var(--muted); line-height: 1.5; }
.cl-tip b { display: block; color: var(--text); font-size: 13px; margin-bottom: 2px; }

/* 09 · Gravedad */
.severity { background: var(--white); border-radius: 28px; padding: 24px 22px; box-shadow: 0 24px 50px -28px rgba(21, 21, 27, .25); }
.sev-bar { height: 14px; border-radius: 999px; background: rgba(21, 21, 27, .06); overflow: hidden; }
.sev-bar span { display: block; height: 100%; width: 100%; border-radius: 999px; background: linear-gradient(90deg, #f6c76a, #f39a5a, var(--coral), #b3123c); transform-origin: left; transform: scaleX(0); }
.sev-labels { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.sev-list { list-style: none; display: grid; gap: 10px; margin-top: 18px; }
.sev-list li { display: flex; gap: 14px; align-items: center; border-radius: 18px; padding: 14px 16px; background: var(--bg); font-weight: 600; }
.sev-list b { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--white); font-size: 14px; }
.sev-list li:nth-child(1) b { background: #f6c76a; color: var(--text); }
.sev-list li:nth-child(2) b { background: #f39a5a; }
.sev-list li:nth-child(3) b { background: var(--coral); }
.sev-list li:nth-child(4) b { background: #b3123c; }


/* Estado inicial (solo con JS) */
.js .n-hero h1 { visibility: hidden; }

/* ---------- Escritorio ---------- */
@media (min-width: 860px) {
  .n-hero { padding-top: 64px; padding-bottom: 56px; }
  .chapter { padding-top: 120px; }
  .ch-head { grid-template-columns: auto 1fr; gap: 28px; align-items: end; }
  .pillars { grid-template-columns: repeat(3, 1fr); }
  .rk-list { grid-template-columns: repeat(3, 1fr); }
  .rk { padding: 30px 26px 32px; gap: 8px; }
  .rk h3 { font-size: 20px; }
  .rk p { font-size: 14px; }
  .dark-panel { padding: 64px 56px 44px; }
  .duo-cards { grid-template-columns: 1fr 1fr; }
  .swap { padding: 44px; }
  .tips3 { grid-template-columns: repeat(3, 1fr); }
  .checklist { padding: 30px 34px; }
  .cl-cols { grid-template-columns: repeat(3, 1fr); }
  .cl-col { padding: 24px 28px 24px 0; border-bottom: 0; border-right: 1px solid rgba(21, 21, 27, .1); }
  .cl-col + .cl-col { padding-left: 28px; }
  .cl-col:last-child { border-right: 0; }
  .cl-tip { padding-top: 20px; border-top: 1px solid rgba(21, 21, 27, .1); }
  .severity { padding: 32px; }
  .sev-list { grid-template-columns: repeat(4, 1fr); }
  .sev-list li { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 859px) {
  .callout.teal-c { flex-direction: column; gap: 2px; }
}

/* 09 · Regalos: "dilo así, no así" (tarjetas que se voltean) */
.gf-grid { list-style: none; display: grid; gap: 12px; }
.gf-card { perspective: 1200px; }
.gf-inner { position: relative; display: grid; width: 100%; min-height: 200px; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; transform-style: preserve-3d; transition: rotate .7s cubic-bezier(.3, .7, .2, 1); }
.gf-inner[aria-pressed="true"] { rotate: y 180deg; }
.gf-face { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 24px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.gf-bad { background: #1b1b22; color: #fff; }
.gf-good { background: var(--mint); rotate: y 180deg; }
.gf-tag { width: fit-content; font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; }
.gf-bad .gf-tag { background: rgba(240, 71, 107, .2); color: #ff8aa3; }
.gf-good .gf-tag { background: var(--teal); color: #fff; }
.gf-msg { display: flex; gap: 10px; align-items: flex-start; }
.gf-av { flex: none; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #25F4EE, #FE2C55); border: 2px solid rgba(255, 255, 255, .8); }
.gf-msg > span { display: grid; gap: 3px; font-size: 17px; font-weight: 600; line-height: 1.35; }
.gf-msg b { font-size: 12px; font-weight: 700; opacity: .7; }
.gf-msg em { font-style: normal; font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 4px; background: #FE2C55; color: #fff; margin-left: 4px; vertical-align: 1px; }
.gf-bad .gf-q { text-decoration: line-through; text-decoration-color: rgba(240, 71, 107, .8); text-decoration-thickness: 2px; }
.gf-hint { margin-top: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #a9a9b4; }
.gf-hint i { font-style: normal; transition: translate .3s var(--ease); }
.gf-inner:hover .gf-hint i { translate: 4px 0; }
.gf-why { margin-top: auto; font-size: 14px; color: #13876c; font-weight: 600; }
.gf-tips { display: grid; gap: 10px; margin-top: 12px; }
.gf-tip { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 20px; background: var(--white); border: 1px solid rgba(21, 21, 27, .08); }
.gf-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--lavender); }
.gf-ic svg { width: 22px; height: 22px; fill: none; stroke: var(--text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.gf-tip p { font-size: 14px; color: var(--muted); }
.gf-tip b { display: block; font-size: 16px; color: var(--text); }
@media (min-width: 860px) {
  .gf-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .gf-inner { min-height: 210px; }
  .gf-tips { grid-template-columns: 1fr 1fr; }
}
