/* ==============================================================
   CÁLCULO EN VARIAS VARIABLES · ÍNDICE Y NAVEGACIÓN
   Navegación reformada con panel de capítulos de dos niveles.
   ============================================================== */

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

:root {
  --ink: #0B1F3A;
  --ink-2: #123151;
  --paper: #F2EFE6;
  --panel: #FBFAF6;
  --white: #FFFFFF;
  --accent: #20948B;
  --accent-dark: #14736D;
  --gold: #E8A020;
  --gold-lt: #F5C842;
  --rule: #C4BDB2;
  --rule-soft: #E7E1D8;
  --muted: #5A6E7F;
  --hover-bg: #E9E5DC;
  --nav-h: 66px;
  --shadow-nav: 0 2px 24px rgba(0, 0, 0, .40);
  --shadow-panel: 0 24px 70px rgba(11, 31, 58, .28);
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(245, 200, 66, .72);
  outline-offset: 2px;
}

/* ======================== BARRA SUPERIOR ======================== */

.site-nav {
  position: relative;
  z-index: 400;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  height: var(--nav-h);
  padding: 0 1.35rem;
  background: var(--ink);
  box-shadow: var(--shadow-nav);
}

.nav-brand {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}

.nav-brand .course-title {
  color: #fff;
  font-family: 'DM Serif Display', serif;
  font-size: 1.06rem;
  letter-spacing: .018em;
  line-height: 1;
}

.nav-brand .course-sub {
  margin-top: 4px;
  color: var(--gold-lt);
  font-family: 'DM Mono', monospace;
  font-size: .56rem;
  letter-spacing: .12em;
  line-height: 1;
  text-transform: uppercase;
}

.nav-divider {
  width: 1px;
  height: 34px;
  margin: 0 1rem;
  background: rgba(255, 255, 255, .16);
}

.desktop-nav,
.desktop-actions {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.nav-spacer {
  flex: 1;
}

.nav-link,
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .48rem;
  height: 100%;
  padding: 0 .92rem;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .82);
  cursor: pointer;
  font-size: .69rem;
  font-weight: 600;
  letter-spacing: .055em;
  text-transform: uppercase;
  transition: color .18s ease, background .18s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-btn:hover,
.nav-link.active,
.nav-btn.active,
.nav-chapters-toggle[aria-expanded='true'] {
  background: rgba(255, 255, 255, .07);
  color: var(--gold-lt);
}

.nav-link.active,
.nav-btn.active {
  box-shadow: inset 0 -3px 0 var(--gold);
}

.nav-btn i {
  font-size: .88rem;
}

.nav-btn.highlight {
  height: 36px;
  margin: auto 0 auto .45rem;
  border: 1px solid rgba(232, 160, 32, .52);
  border-radius: 4px;
  color: var(--gold-lt);
}

.nav-btn.highlight:hover {
  border-color: var(--gold-lt);
  background: rgba(232, 160, 32, .10);
}

.chevron {
  width: 7px;
  height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s ease;
}

.nav-chapters-toggle[aria-expanded='true'] .chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

/* ===================== PANEL DE CAPÍTULOS ======================= */

.chapter-backdrop,
.drawer-backdrop {
  position: fixed;
  inset: var(--nav-h) 0 0;
  z-index: 270;
  visibility: hidden;
  background: rgba(11, 31, 58, .36);
  opacity: 0;
  transition: opacity .2s ease, visibility .2s ease;
}

.chapter-backdrop.open,
.drawer-backdrop.open {
  visibility: visible;
  opacity: 1;
}

.chapter-mega {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  left: 0;
  z-index: 300;
  visibility: hidden;
  padding: 0 1.3rem 1.3rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity .19s ease, transform .19s ease, visibility .19s ease;
}

.chapter-mega.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.chapter-mega-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  width: min(1120px, 100%);
  height: min(620px, calc(100vh - var(--nav-h) - 30px));
  min-height: 440px;
  margin: 0 auto;
  overflow: hidden;
  border-top: 4px solid var(--accent);
  border-radius: 0 0 7px 7px;
  background: var(--panel);
  box-shadow: var(--shadow-panel);
}

.chapter-rail {
  display: flex;
  min-height: 0;
  flex-direction: column;
  background: linear-gradient(155deg, var(--ink-2), var(--ink));
  color: #fff;
}

.chapter-rail-head {
  padding: 1.6rem 1.45rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.chapter-rail-eyebrow {
  color: var(--gold-lt);
  font-family: 'DM Mono', monospace;
  font-size: .59rem;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.chapter-rail-head h2 {
  margin-top: .45rem;
  font-family: 'DM Serif Display', serif;
  font-size: 1.55rem;
  font-weight: 400;
}

.chapter-rail-list {
  min-height: 0;
  padding: .58rem 0 .85rem;
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
  scrollbar-width: thin;
}

.chapter-tab {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 49px;
  padding: .55rem .88rem .55rem 1rem;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .76);
  cursor: pointer;
  text-align: left;
  transition: background .16s ease, color .16s ease;
}

.chapter-tab::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--gold);
  content: '';
  opacity: 0;
}

.chapter-tab:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

.chapter-tab.active {
  background: rgba(32, 148, 139, .24);
  color: #fff;
}

.chapter-tab.active::before {
  opacity: 1;
}

.chapter-tab-number {
  color: var(--gold-lt);
  font-family: 'DM Mono', monospace;
  font-size: .67rem;
  letter-spacing: .08em;
}

.chapter-tab-title {
  padding-right: .4rem;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.25;
}

.chapter-tab-status {
  padding: .18rem .35rem;
  border: 1px solid rgba(245, 200, 66, .34);
  border-radius: 999px;
  color: var(--gold-lt);
  font-family: 'DM Mono', monospace;
  font-size: .47rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.chapter-detail {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: var(--panel);
}

.chapter-detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: end;
  padding: 1.65rem 2rem 1.35rem;
  border-bottom: 1px solid var(--rule-soft);
  background: linear-gradient(180deg, #fff, var(--panel));
}

.chapter-kicker {
  margin-bottom: .55rem;
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: .62rem;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.chapter-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}

.chapter-detail-title {
  color: var(--ink);
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.55rem, 2.4vw, 2.18rem);
  font-weight: 400;
  line-height: 1.08;
}

.chapter-development-badge {
  padding: .27rem .52rem;
  border: 1px solid rgba(232, 160, 32, .55);
  border-radius: 999px;
  background: #FFF8E8;
  color: #996114;
  font-family: 'DM Mono', monospace;
  font-size: .52rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.chapter-open-button {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 42px;
  padding: .65rem .9rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .035em;
  transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
  white-space: nowrap;
}

.chapter-open-button:hover {
  background: var(--accent-dark);
  box-shadow: 0 7px 18px rgba(32, 148, 139, .22);
  transform: translateY(-1px);
}

.chapter-sections-wrap {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 1.25rem 1.5rem 1.45rem;
}

.chapter-sections-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 .35rem .8rem;
}

.chapter-sections-meta h3 {
  color: var(--ink);
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
  font-weight: 400;
}

.chapter-sections-count {
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: .57rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.chapter-section-list {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  padding: .1rem .3rem .4rem;
  overflow-y: auto;
  scrollbar-color: var(--rule) transparent;
  scrollbar-width: thin;
}

.chapter-section-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  gap: .55rem;
  align-items: center;
  min-height: 54px;
  padding: .6rem .7rem;
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.chapter-section-item:hover {
  border-color: var(--accent);
  box-shadow: 0 5px 16px rgba(11, 31, 58, .08);
  transform: translateY(-1px);
}

.chapter-section-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #EEF7F5;
  color: var(--accent-dark);
  font-family: 'DM Mono', monospace;
  font-size: .62rem;
  font-weight: 500;
}

.chapter-section-text {
  font-size: .76rem;
  line-height: 1.35;
}

.chapter-section-arrow {
  color: var(--accent);
  font-size: .9rem;
  opacity: .72;
}

.chapter-section-item.is-placeholder {
  background: #FCFAF4;
}

/* ========================= MENÚ MÓVIL =========================== */

.hamburger {
  position: relative;
  z-index: 430;
  display: none;
  width: 34px;
  height: 34px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  margin-left: auto;
  padding: 5px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.hamburger span {
  width: 100%;
  height: 2.5px;
  border-radius: 2px;
  background: #fff;
  transition: transform .25s ease, opacity .25s ease;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-drawer {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  z-index: 380;
  visibility: hidden;
  width: min(88vw, 410px);
  height: calc(100% - var(--nav-h));
  overflow-y: auto;
  background: var(--paper);
  box-shadow: -10px 0 30px rgba(0, 0, 0, .22);
  opacity: 0;
  transform: translateX(102%);
  transition: transform .28s ease, opacity .28s ease, visibility .28s ease;
}

.mobile-drawer.open {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
}

.mobile-menu-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--accent);
  background: var(--ink);
  color: #fff;
  font-family: 'DM Serif Display', serif;
  font-size: 1.04rem;
}

.mob-direct,
.mob-chapter-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  min-height: 52px;
  padding: .85rem 1.25rem;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-size: .81rem;
  font-weight: 500;
}

.mob-direct:hover,
.mob-chapter-button:hover {
  background: var(--hover-bg);
}

.mob-chapter-label {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  align-items: center;
}

.mob-chapter-number {
  color: var(--gold);
  font-family: 'DM Mono', monospace;
  font-size: .62rem;
}

.mob-chevron {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s ease;
}

.mob-item.expanded .mob-chevron {
  transform: rotate(225deg);
}

.mob-sub {
  max-height: 0;
  overflow: hidden;
  background: #fff;
  transition: max-height .35s ease;
}

.mob-item.expanded .mob-sub {
  max-height: 1800px;
}

.mob-sub button {
  display: block;
  width: 100%;
  padding: .66rem 1.25rem .66rem 2.35rem;
  border: 0;
  border-bottom: 1px solid #F2EEE8;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .76rem;
  line-height: 1.35;
  text-align: left;
}

.mob-sub button:hover {
  background: var(--hover-bg);
  color: var(--accent-dark);
}

.mob-sub .mob-complete {
  border-left: 3px solid var(--accent);
  background: #EFF8F6;
  color: var(--ink);
  font-weight: 600;
}

.mob-divider {
  height: 10px;
  border-top: 2px solid var(--accent);
  background: #EAE6DE;
}

/* =========================== PORTADA ============================= */

#home-screen {
  position: relative;
  flex: 1;
  overflow-y: auto;
  background: var(--paper);
}

#home-screen::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 0, 0, .02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, .02) 1px, transparent 1px);
  background-size: 40px 40px;
  content: '';
  pointer-events: none;
}

#content-frame {
  display: none;
  width: 100%;
  flex: 1;
  border: 0;
  background: #fff;
}

.wip-banner {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: 980px;
  align-items: center;
  gap: .65rem;
  margin: 0 auto;
  padding: 1.3rem 3rem 0;
}

.wip-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gold);
  animation: wip-pulse 2.2s ease-in-out infinite;
}

@keyframes wip-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 160, 32, .45); }
  50% { box-shadow: 0 0 0 5px rgba(232, 160, 32, 0); }
}

.wip-text {
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: .62rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.wip-text em {
  color: var(--gold);
  font-style: normal;
  font-weight: 500;
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  max-width: 980px;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: end;
  margin: 0 auto;
  padding: 4.3rem 3rem 3.2rem;
}

.hero-eyebrow {
  margin-bottom: .9rem;
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.hero-title {
  color: var(--ink);
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  letter-spacing: -.02em;
  line-height: .96;
}

.hero-title em {
  color: var(--accent);
  font-style: italic;
}

.hero-desc {
  max-width: 540px;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.75;
}

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

.hero-more .hero-desc {
  margin-top: .8rem;
}

.hero-more-btn {
  margin-top: .7rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-family: 'DM Mono', monospace;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  border-bottom: 1px dashed var(--accent);
  transition: color .18s ease, border-color .18s ease;
}

.hero-more-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.share-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem;
  margin-top: 2rem;
}

.share-label {
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: .66rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.share-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .38rem;
}

.share-link {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: rgba(255, 255, 255, .38);
  color: #737D84;
  cursor: pointer;
  line-height: 1;
  text-decoration: none;
  transition: color .18s, border-color .18s, background .18s, transform .18s, box-shadow .18s;
}

.share-link:hover {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 5px 15px rgba(11, 31, 58, .11);
  color: var(--accent);
  transform: translateY(-2px);
}

.share-link i {
  font-size: 1rem;
}

.share-status {
  min-width: 6.5rem;
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: .6rem;
  letter-spacing: .04em;
  opacity: 0;
  transition: opacity .18s;
}

.share-status.visible {
  opacity: 1;
}

.hero-deco {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  opacity: .38;
}

.integral {
  color: var(--accent);
  font-family: 'DM Serif Display', serif;
  font-size: 7.5rem;
  line-height: 1;
}

.integral-label {
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: .62rem;
  letter-spacing: .14em;
}

.section-rule {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  border: 0;
  border-top: 1px solid var(--rule);
}

.content-section {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 3rem 3rem 2rem;
}

.section-eyebrow {
  margin-bottom: 1.4rem;
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: .66rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 1.4rem;
}

.topic-card {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  padding: 1.6rem 1.4rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: box-shadow .2s, border-color .2s, transform .12s;
}

.topic-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .12);
  transform: translateY(-2px);
}

.tc-num {
  color: var(--gold);
  font-family: 'DM Mono', monospace;
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.tc-title {
  color: var(--ink);
  font-family: 'DM Serif Display', serif;
  font-size: 1.35rem;
  line-height: 1.12;
}

.tc-sub {
  flex: 1;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.5;
}

.tc-arrow {
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: .68rem;
  letter-spacing: .08em;
  opacity: .7;
  transition: opacity .2s, transform .2s;
}

.topic-card:hover .tc-arrow {
  opacity: 1;
  transform: translateX(4px);
}

.home-footer {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: 980px;
  justify-content: space-between;
  margin: 0 auto;
  padding: 3rem 3rem 2.5rem;
  border-top: 1px solid var(--rule);
}

.footer-brand {
  color: var(--ink);
  font-family: 'DM Serif Display', serif;
  font-size: .92rem;
}

.footer-link {
  color: var(--muted);
  font-size: .78rem;
  text-decoration: none;
  transition: color .2s;
}

.footer-link:hover {
  color: var(--accent);
}

/* ============================ MODAL ============================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(11, 31, 58, .55);
  backdrop-filter: blur(3px);
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  position: relative;
  width: 90%;
  max-width: 480px;
  padding: 2.4rem 2.8rem 2.2rem;
  border-top: 4px solid var(--gold);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .30);
}

.modal-close {
  position: absolute;
  top: .9rem;
  right: 1rem;
  padding: .2rem .4rem;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-eyebrow {
  margin-bottom: 1.1rem;
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: .62rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.modal-title {
  margin-bottom: 1.4rem;
  color: var(--ink);
  font-family: 'DM Serif Display', serif;
  font-size: 1.45rem;
}

.modal-label {
  display: block;
  margin-bottom: .4rem;
  color: var(--gold);
  font-family: 'DM Mono', monospace;
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.modal-text {
  color: var(--ink);
  font-size: .88rem;
  line-height: 1.65;
}

.modal-text a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.modal-rule {
  margin: 1.3rem 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

/* ========================= RESPONSIVE ============================ */

@media (max-width: 1100px) {
  .chapter-mega-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .chapter-section-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .site-nav {
    padding: 0 1rem;
  }

  .desktop-nav,
  .desktop-actions,
  .nav-divider,
  .chapter-mega,
  .chapter-backdrop {
    display: none !important;
  }

  .hamburger {
    display: flex;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 3rem 1.5rem 2rem;
  }

  .hero-deco {
    display: none;
  }

  .content-section {
    padding: 2rem 1.5rem;
  }

  .topic-grid {
    grid-template-columns: 1fr;
  }

  .home-footer {
    flex-direction: column;
    gap: 1rem;
    padding: 2rem 1.5rem;
  }

  .wip-banner {
    padding: 1rem 1.5rem 0;
  }
}

@media (min-width: 981px) {
  .mobile-drawer,
  .drawer-backdrop {
    display: none !important;
  }
}

@media (max-width: 520px) {
  :root {
    --nav-h: 62px;
  }

  .nav-brand .course-title {
    font-size: .96rem;
  }

  .nav-brand .course-sub {
    font-size: .49rem;
    letter-spacing: .08em;
  }

  .hero-title {
    font-size: 2.45rem;
  }

  .modal-box {
    padding: 2.2rem 1.5rem 1.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
