:root {
  --ink: #17262d;
  --muted: #58707a;
  --paper: #fffdf8;
  --canvas: #f4f0e7;
  --navy: #152a42;
  --blue: #0b6680;
  --teal: #167e78;
  --sky: #d9eef1;
  --line: #d8e0df;
  --gold: #e4a83d;
  --gold-soft: #fff4d9;
  --green-soft: #e9f5ee;
  --purple-soft: #efeffa;
  --shadow: 0 14px 40px rgba(23, 38, 45, .08);
  --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.7; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--teal); }
.skip { position: absolute; left: -9999px; top: 0; background: white; color: var(--navy); padding: .7rem 1rem; z-index: 20; }
.skip:focus { left: 1rem; top: 1rem; }
.progress { position: fixed; inset: 0 0 auto; height: 4px; z-index: 30; background: transparent; }
.progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--gold), #f2cf70); }
.site-header { background: var(--navy); color: white; }
.header-inner { max-width: 1180px; margin: auto; min-height: 74px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; gap: 12px; align-items: center; color: white; text-decoration: none; font-weight: 750; letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 42px; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.45); border-radius: 12px; color: #f4c65f; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.brand small { display: block; color: #bdd2da; font-weight: 500; font-size: .75rem; letter-spacing: .02em; }
.top-nav { display: flex; gap: 18px; align-items: center; }
.top-nav a { color: #e8f3f5; text-decoration: none; font-size: .92rem; }
.top-nav a[aria-current="page"] { color: #f4c65f; }
.hero { background: radial-gradient(circle at 85% 10%, rgba(45, 147, 143, .35), transparent 28%), linear-gradient(135deg, #19324c, #0d5366); color: white; }
.hero-inner { max-width: 1180px; margin: auto; padding: 64px 24px 58px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr); gap: 48px; align-items: end; }
.hero-inner.hero-index { grid-template-columns: minmax(0, 1fr); }
.kicker { margin: 0 0 8px; color: #f2ca6c; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; font-size: .78rem; }
h1, h2, h3 { font-family: Georgia, Cambria, serif; line-height: 1.18; }
.hero h1 { max-width: 820px; margin: 0; color: white; font-size: clamp(2.35rem, 5vw, 4.7rem); letter-spacing: -.045em; }
.hero-lead { max-width: 760px; margin: 22px 0 0; color: #dcecef; font-size: 1.15rem; }
.hero-note { padding: 20px 22px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); border-radius: var(--radius); backdrop-filter: blur(8px); }
.hero-note strong { display: block; margin-bottom: 7px; color: #f4c65f; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.hero-note p { margin: 0; color: #edf5f6; }
.layout { max-width: 1180px; margin: 0 auto; padding: 42px 24px 80px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 34px; align-items: start; }
.toc { position: sticky; top: 24px; padding: 18px; background: rgba(255,253,248,.82); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 26px rgba(23,38,45,.05); }
.toc strong { display: block; margin-bottom: 10px; color: var(--navy); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.toc ol { margin: 0; padding-left: 1.25rem; }
.toc li { margin: .4rem 0; color: var(--muted); font-size: .84rem; line-height: 1.35; }
.toc a { color: inherit; text-decoration: none; }
.toc a.is-active { color: var(--blue); font-weight: 750; }
.paper { min-width: 0; padding: clamp(26px, 5vw, 58px); background: var(--paper); border: 1px solid rgba(209,218,216,.9); border-radius: 20px; box-shadow: var(--shadow); }
.lesson-intro { margin: 0 0 18px; padding: 20px 22px; background: #eef6f5; border-radius: 12px; color: #304e55; font-size: 1.04rem; }
.question { margin: 18px 0 28px; padding: 17px 20px; background: var(--gold-soft); border-left: 5px solid var(--gold); border-radius: 8px; color: #634a18; }
.question strong { color: #7a540d; }
.objectives { margin: 22px 0 32px; padding: 22px 25px; color: white; background: var(--navy); border-radius: 14px; }
.objectives > strong { color: #8ee0dc; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.objectives ul { margin-bottom: 0; }
.paper h2 { margin: 54px 0 15px; padding-bottom: 9px; color: var(--blue); border-bottom: 2px solid var(--line); font-size: clamp(1.55rem, 3vw, 2rem); scroll-margin-top: 24px; }
.paper h2:first-of-type { margin-top: 32px; }
.paper h3 { margin: 30px 0 8px; color: var(--navy); font-size: 1.28rem; }
.paper p { margin: 11px 0; }
.paper li { margin: .35rem 0; }
.ti1-grid, .comparacion { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 18px 0; }
.ti1-card, .comparacion > div { padding: 17px 18px; background: #f8faf8; border: 1px solid var(--line); border-radius: 12px; }
.ti1-card h3, .comparacion h3 { margin-top: 0; color: var(--blue); }
.ti1-card p, .comparacion p { font-size: .94rem; color: var(--muted); }
.ti1-note, .ti1-curio, .ti1-think, .ti1-concept, .idea_clave, .aviso { margin: 18px 0; padding: 15px 18px; border-radius: 9px; }
.ti1-note { background: var(--gold-soft); border-left: 4px solid var(--gold); color: #654d1c; }
.ti1-curio { background: var(--green-soft); border-left: 4px solid var(--teal); color: #245c49; }
.ti1-think { background: var(--purple-soft); border-left: 4px solid #6869bc; color: #383974; }
.ti1-concept, .idea_clave { background: #e7f3f6; border: 1px solid #b8dae1; color: #164d5f; }
.ti1-concept-tag, .idea_clave > strong, .aviso > strong { display: block; margin-bottom: 4px; color: var(--blue); text-transform: uppercase; letter-spacing: .07em; font-size: .75rem; }
.aviso { background: #fff0ec; border-left: 4px solid #c85c40; color: #713322; }
.tabla_responsiva { overflow-x: auto; margin: 18px 0; }
.ti1-diagrama { margin: 24px 0; padding: 16px; background: #f7faf8; border: 1px solid var(--line); border-radius: 14px; }
.ti1-diagrama img { display: block; width: 100%; height: auto; }
.ti1-diagrama figcaption { margin-top: 10px; color: var(--muted); font-size: .9rem; text-align: center; }
.ti1-formula { margin: 14px 0; color: var(--navy); font-size: 1.25rem; text-align: center; }
.ti1-formula-leyenda { color: #58707a; font-size: .95rem; font-weight: 400; }
table, .ti1-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .93rem; }
th { padding: 10px 12px; color: white; background: var(--blue); text-align: left; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody th[scope="row"] { padding: 10px 12px; color: var(--navy); background: #eef6f5; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:nth-child(even) td { background: #f6f8f6; }
tr:nth-child(even) th[scope="row"] { background: #e5f0ee; }
code { padding: .12em .35em; color: #6e3141; background: #f3e9e6; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
pre { overflow-x: auto; padding: 18px 20px; background: #142b3b; color: #e8f4f5; border-radius: 10px; line-height: 1.55; }
pre:focus-visible, .tabla_responsiva:focus-visible, .ti1-diagrama:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
pre code { padding: 0; color: inherit; background: transparent; }
.ti1-timeline { margin: 20px 0 20px 10px; padding-left: 24px; border-left: 3px solid var(--teal); }
.ti1-tl-item { position: relative; margin-bottom: 20px; }
.ti1-tl-item::before { content: ""; position: absolute; left: -31px; top: 6px; width: 12px; height: 12px; background: var(--teal); border: 3px solid var(--paper); border-radius: 50%; }
.ti1-tl-year { color: var(--blue); font-weight: 800; }
.ti1-glosario { display: grid; grid-template-columns: minmax(120px, .35fr) 1fr; gap: 8px 18px; }
.ti1-glosario dt { color: var(--navy); font-weight: 800; }
.ti1-glosario dd { margin: 0; color: var(--muted); }
.ti1-key, .summary { margin-top: 44px; padding: 23px 26px; color: white; background: linear-gradient(135deg, var(--navy), #164d5f); border-radius: 14px; }
.ti1-key h2, .summary h2 { margin-top: 0; color: #91dfda; border: 0; }
.topic-footer { max-width: 1180px; margin: 0 auto; padding: 0 24px 54px; display: flex; justify-content: space-between; gap: 20px; }
.topic-footer a { font-weight: 700; text-decoration: none; }
.index-shell { max-width: 1180px; margin: 0 auto; padding: 56px 24px 84px; }
.index-intro { max-width: 780px; font-size: 1.1rem; color: var(--muted); }
.index-section + .index-section { margin-top: 72px; }
.index-kicker { color: var(--blue); }
.index-heading { margin: .3rem 0; color: var(--navy); font-size: 2.2rem; }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 34px; }
.topic-card { min-height: 240px; padding: 26px; display: flex; flex-direction: column; color: inherit; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; box-shadow: 0 10px 30px rgba(23,38,45,.05); transition: transform .18s ease, box-shadow .18s ease; }
.topic-card:hover { transform: translateY(-3px); color: inherit; box-shadow: var(--shadow); }
.topic-number { color: var(--teal); font-size: .8rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.topic-card h2 { margin: 12px 0; color: var(--navy); font-size: 1.65rem; }
.topic-card p { margin: 0; color: var(--muted); }
.topic-card .go { margin-top: auto; padding-top: 18px; color: var(--blue); font-weight: 800; }
.decision { margin-top: 42px; padding: 28px; background: #e7f3f1; border-left: 5px solid var(--teal); border-radius: 12px; }
.decision h2 { margin-top: 0; color: var(--navy); }
.resource-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.resource-links a { padding: 9px 13px; background: var(--navy); color: white; border-radius: 8px; text-decoration: none; font-size: .9rem; }
.site-footer { padding: 26px 24px; color: #c8dce1; background: var(--navy); text-align: center; font-size: .87rem; }
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; gap: 26px; padding-top: 46px; }
  .layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .topic-grid { grid-template-columns: minmax(0, 1fr); }
  .top-nav { display: none; }
}
@media (max-width: 520px) {
  .paper { padding: 24px 19px; border-radius: 12px; }
  .hero h1 { font-size: 2.25rem; }
  .ti1-glosario { grid-template-columns: 1fr; }
  .ti1-glosario dd { margin-bottom: 8px; }
  .topic-footer { flex-direction: column; }
  .ti1-diagrama { overflow-x: auto; }
  .ti1-diagrama img { min-width: 600px; }
}
@media print {
  body { background: white; }
  .site-header, .progress, .toc, .topic-footer { display: none; }
  .hero { color: black; background: white; }
  .hero-inner { display: block; padding: 20px 0; }
  .hero h1, .kicker { color: black; }
  .hero-note { border: 1px solid #aaa; }
  .hero-lead, .hero-note, .hero-note p, .hero-note strong, .objectives, .objectives > strong, .summary, .summary h2, .ti1-key h2, th { color: #000; }
  .objectives, .summary, th { background: #fff; background-image: none; }
  .layout { display: block; padding: 0; }
  .paper { padding: 0; border: 0; box-shadow: none; }
  .paper h2 { break-after: avoid; }
  table, pre, .ti1-card { break-inside: avoid; }
}
.topic-card.is-pending { background: #f7f6f1; border-style: dashed; box-shadow: none; cursor: default; }
.topic-card.is-pending:hover { transform: none; box-shadow: none; }
.topic-card.is-pending .go { color: var(--muted); font-weight: 700; }
