:root {
  --bg: #f6f4ef;
  --bg-subtle: #f8f6f1;
  --paper: #ffffff;
  --ink: #1d1c1a;
  --ink-2: #2d2b27;
  --muted: #6b665d;
  --muted-light: #9a948a;
  --line: #e2ddd2;
  --line-strong: #d3cdc1;
  --blue: #2b4aa0;
  --blue-2: #4562b3;
  --blue-dark: #1f3474;
  --cyan: #4562b3;
  --green: #2f7d4f;
  --soft: #efebe3;
  --ocre: #b7791f;
  /* Ocre oscurecido para TEXTO: el original da 3.3:1 sobre el papel y no se
     lee bien en letra chica; este da 5.2:1 (mínimo WCAG AA: 4.5:1). El ocre
     original queda para líneas y números grandes. */
  --ocre-texto: #8c5c18;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 12px 36px -4px rgba(0, 0, 0, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

code {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: #8a4b14;
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  font-size: clamp(36px, 4.6vw, 60px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 20px;
  color: var(--ink);
}

h2 {
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--ink);
}

h3 {
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

/* ── Encabezado: barra de papel con una línea fina (sin efecto vidrio) ── */
.site-header {
  align-items: center;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 60px;
  justify-content: space-between;
  left: 0;
  padding: 0 clamp(20px, 4vw, 64px);
  position: fixed;
  right: 0;
  top: 0;
  z-index: 100;
  transition: all 0.2s ease;
}

.brand {
  align-items: center;
  display: flex;
  gap: 10px;
}

.brand img {
  display: block;
  height: 32px;
  max-width: 180px;
  object-fit: contain;
}

.nav {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 14.5px;
  font-weight: 500;
  gap: clamp(2px, 0.8vw, 12px);
}

.nav a,
.nav-more summary {
  padding: 8px 10px;
  transition: color 0.15s ease;
}

.nav a:hover,
.nav-more summary:hover {
  color: var(--ink);
}

/* Página actual: subrayada con el azul del escudo, sin fondo. */
.nav > a.active,
.nav-more.is-active summary {
  box-shadow: inset 0 -2px 0 var(--blue);
  color: var(--ink);
  font-weight: 600;
}

/* "Más": páginas técnicas y de administración en un desplegable (<details>). */
.nav-more {
  position: relative;
}

.nav-more summary {
  cursor: pointer;
  list-style: none;
}

.nav-more summary::-webkit-details-marker {
  display: none;
}

.nav-more summary::after {
  content: " ▾";
  font-size: 11px;
}

.nav-more > div {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: grid;
  min-width: 210px;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 120;
}

.nav-more > div a {
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}

.nav-more > div a:hover,
.nav-more > div a.active {
  background: var(--soft);
  color: var(--ink);
}

.hero,
.page-hero,
.section {
  padding-left: clamp(20px, 5vw, 84px);
  padding-right: clamp(20px, 5vw, 84px);
}

.hero {
  overflow: hidden;
  padding-bottom: 50px;
  padding-top: 120px;
  position: relative;
}

/* Sin cuadrícula de fondo: el papel liso se lee mejor. */
.hero-grid,
.page-hero::before {
  display: none;
}

.hero-home::before {
  display: none;
}

.hero-layout {
  align-items: center;
  display: grid;
  gap: clamp(32px, 5vw, 72px);
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  min-height: 540px;
  position: relative;
  z-index: 2;
}

.hero-copy-block {
  max-width: 720px;
}

/* Antetítulo: texto chico en ocre, sin cápsula ni sombra. */
.eyebrow {
  color: var(--ocre-texto);
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 0 0 14px;
  text-transform: uppercase;
}

/* Dentro de una sección, el antetítulo no hereda el tamaño ni el gris de ".section p". */
.section .eyebrow {
  color: var(--ocre-texto);
  font-size: 13px;
  line-height: normal;
}

.hero-copy,
.page-hero p:not(.eyebrow),
.section p {
  color: var(--muted);
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.6;
}

.hero-copy {
  max-width: 620px;
}

.hero-pills,
.api-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.hero-pills span,
.api-chip-row span {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 12px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  align-items: center;
  border-radius: var(--radius-sm);
  display: inline-flex;
  font-size: 15px;
  font-weight: 600;
  gap: 8px;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  cursor: pointer;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: #fff;
  border: 1px solid transparent;
}

.btn-primary:hover {
  background: #3a3732;
}

.btn-secondary {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--line-strong);
  background: var(--bg-subtle);
}

.btn-full {
  width: 100%;
}

.dashboard-preview,
.api-hero-panel,
.installer-window,
.school-identity {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  position: relative;
}

.dashboard-preview {
  display: grid;
  gap: 14px;
  overflow: hidden;
  padding: 20px;
}

.dashboard-preview::before {
  display: none;
}

.dashboard-preview > * {
  position: relative;
}

.preview-top,
.preview-hero-card,
.source-card,
.config-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.preview-top {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.preview-top div {
  align-items: center;
  display: flex;
  gap: 8px;
}

.status-dot {
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(47, 125, 79, 0.15);
  display: inline-block;
  height: 8px;
  width: 8px;
}

.preview-top small,
.preview-hero-card small,
.source-card span,
.installer-title small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preview-hero-card {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  gap: 14px;
  justify-content: flex-start;
  padding: 18px;
}

.preview-hero-card h2 {
  font-size: 24px;
  margin: 2px 0 0;
  letter-spacing: -0.02em;
}

.pipeline-card {
  background: #1d1c1a;
  border-radius: var(--radius-md);
  color: #fff;
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #2d2b27;
}

.pipeline-card div {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.pipeline-card span {
  color: #9a948a;
}

.pipeline-card i {
  background: #3d3a35;
  display: block;
  height: 1px;
}

.preview-grid,
.api-mini-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.preview-grid div,
.api-mini-grid div {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.preview-grid strong,
.api-mini-grid b {
  display: block;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.preview-grid span,
.api-mini-grid span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

.source-card {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.source-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.source-card b {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
}

.cog-icon {
  background: var(--ink);
  border: 2px solid var(--line);
  border-radius: 50%;
  display: inline-block;
  height: 38px;
  min-width: 38px;
  position: relative;
  width: 38px;
}

.cog-icon::after {
  background: var(--paper);
  border-radius: 50%;
  content: "";
  height: 14px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
}

.cog-icon.small {
  height: 30px;
  min-width: 30px;
  width: 30px;
}

.hero-stats {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 24px;
  overflow: hidden;
  position: relative;
  z-index: 3;
}

.hero-stats div {
  background: var(--paper);
  min-height: 96px;
  padding: 20px 22px;
  transition: background 0.15s ease;
}
.hero-stats div:hover {
  background: var(--bg-subtle);
}

.hero-stats strong {
  display: block;
  font-size: clamp(24px, 2.8vw, 36px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 8px;
}

.hero-stats span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.hero-stats strong {
  display: block;
  font-size: clamp(30px, 3.2vw, 44px);
  font-weight: 650;
  line-height: 1;
  margin-bottom: 10px;
}

.hero-stats span {
  color: var(--muted);
  font-size: 14px;
}

.section {
  padding-bottom: clamp(76px, 9vw, 124px);
  padding-top: clamp(76px, 9vw, 124px);
}

.section-white {
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.section-dark {
  background: #22201d;
  color: #f6f4ef;
}

.section-dark h2,
.section-dark h3 {
  color: #f6f4ef;
}

.section-dark .eyebrow {
  color: #a9b8de;
}

.section-dark p {
  color: #cfc9bd;
}

.section-heading {
  display: grid;
  gap: 22px;
  grid-template-columns: 0.62fr 1.38fr;
  margin-bottom: 44px;
}

.showcase-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.showcase-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.showcase-card,
.endpoint-card,
.cog-card,
.flow-step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.showcase-card {
  min-height: 260px;
  padding: 28px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.showcase-card:hover {
  border-color: var(--blue);
}

.showcase-featured {
  background: #eef1f8;
  grid-column: span 2;
}

.showcase-card span,
.endpoint-card span,
.flow-step span,
.install-timeline span,
.cog-card small {
  color: var(--ocre-texto);
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.showcase-card h3,
.endpoint-card h3,
.cog-card h3,
.flow-step h3,
.install-timeline h3 {
  font-size: 24px;
  line-height: 1.15;
  margin-bottom: 12px;
}

.showcase-card p,
.endpoint-card p,
.cog-card p,
.flow-step p,
.install-timeline p,
.download-showcase p,
.school-panel p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.mini-terminal {
  background: #22201d;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin-top: 24px;
  padding: 16px;
}

.mini-terminal code {
  background: transparent;
  border: 0;
  color: #e3e8f4;
  padding: 0;
}

.architecture-board {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.arch-column {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  min-height: 250px;
  padding: 28px;
}

.arch-column small {
  color: #a9b8de;
  font-weight: 800;
}

.arch-column h3 {
  font-size: 27px;
  margin: 40px 0 12px;
}

.page-hero {
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding-bottom: clamp(64px, 8vw, 106px);
  padding-top: 158px;
  position: relative;
}

.page-hero::before {
  content: "";
  opacity: 0.9;
}

.page-hero-grid {
  align-items: center;
  display: grid;
  gap: clamp(34px, 6vw, 82px);
  grid-template-columns: minmax(0, 1.04fr) minmax(330px, 0.72fr);
  position: relative;
  z-index: 2;
}

.page-hero h1 {
  max-width: 920px;
}

.page-hero p:not(.eyebrow) {
  max-width: 720px;
}

.api-hero-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.api-health-card {
  background: #22201d;
  border-radius: 8px;
  color: #fff;
  padding: 26px;
}

.api-health-card small {
  color: #a8a296;
  display: block;
  font-weight: 800;
  margin-bottom: 12px;
}

.api-health-card strong {
  display: block;
  font-size: 44px;
  line-height: 1;
}

.api-health-card p {
  color: #cfc9bd;
  font-size: 14px;
  margin: 12px 0 0;
}

.api-mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flow-panel {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flow-step {
  min-height: 220px;
  padding: 26px;
}

.endpoint-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.endpoint-card {
  min-height: 230px;
  padding: 26px;
}

.endpoint-card.important {
  background: #22201d;
  color: #fff;
  grid-column: span 2;
}

.endpoint-card.important p,
.endpoint-card.important span {
  color: #d5ddef;
}

.endpoint-card.important code {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.api-showcase,
.download-showcase {
  align-items: center;
  display: grid;
  gap: clamp(34px, 6vw, 86px);
  grid-template-columns: 0.9fr 1fr;
}

.terminal {
  background: #1d1c1a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.terminal-top {
  align-items: center;
  background: #2a2724;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 8px;
  height: 46px;
  padding: 0 16px;
}

.terminal-top span {
  border-radius: 50%;
  display: inline-block;
  height: 11px;
  width: 11px;
}

.terminal-top span:nth-child(1) {
  background: #ff625f;
}

.terminal-top span:nth-child(2) {
  background: #ffbd2e;
}

.terminal-top span:nth-child(3) {
  background: #28c840;
}

.terminal-top strong {
  color: #9a948a;
  font-size: 12px;
  margin-left: 8px;
}

pre {
  margin: 0;
  overflow: auto;
  padding: 30px;
}

pre code {
  background: transparent;
  border: 0;
  color: #e3e8f4;
  display: block;
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(13px, 1.35vw, 16px);
  line-height: 1.74;
  padding: 0;
}

.stack-board {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stack-board div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 130px;
  padding: 24px;
}

.stack-board strong {
  display: block;
  font-size: 21px;
  margin-bottom: 8px;
}

.stack-board span {
  color: var(--muted);
}

.installer-card {
  position: relative;
}

.installer-window {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.installer-title {
  align-items: center;
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}

.installer-title strong {
  display: block;
  font-size: 22px;
}

.file-badge {
  align-items: center;
  background: var(--blue);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  height: 54px;
  justify-content: center;
  min-width: 72px;
}

.config-row,
.connection-card div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.config-row span,
.connection-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.config-row b,
.connection-card strong {
  color: #1d1c1a;
}

.config-row .ok {
  color: var(--green);
}

.install-timeline {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.install-timeline article {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 240px;
  padding: 26px;
}

.connection-card {
  display: grid;
  gap: 14px;
}

.cog-map {
  aspect-ratio: 1.15;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(226, 221, 210, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.cog-map::before,
.cog-map::after {
  border: 1px solid rgba(31, 52, 116, 0.13);
  content: "";
  position: absolute;
}

.cog-map::before {
  inset: 16%;
  transform: rotate(18deg);
}

.cog-map::after {
  inset: 30%;
  transform: rotate(-28deg);
}

.big-cog,
.map-cog {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 18px 42px rgba(31, 52, 116, 0.12);
  display: flex;
  gap: 10px;
  padding: 10px 14px 10px 10px;
  position: absolute;
  z-index: 2;
}

.big-cog {
  left: 34%;
  top: 38%;
}

.map-kira {
  left: 10%;
  top: 18%;
}

.map-db {
  right: 10%;
  top: 20%;
}

.map-mcp {
  bottom: 18%;
  left: 13%;
}

.map-exe {
  bottom: 16%;
  right: 12%;
}

.cogs-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cog-card {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: 58px 1fr;
  min-height: 205px;
  padding: 28px;
}

.school-identity {
  align-items: center;
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 34px;
  text-align: center;
}

.school-identity img {
  width: 128px;
}

.school-identity strong {
  font-size: 24px;
}

.school-identity span {
  color: var(--muted);
  font-weight: 800;
}

.section-school {
  background: #f4f2ec;
}

.school-panel {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: clamp(28px, 5vw, 72px);
  grid-template-columns: 220px 1fr;
  padding: clamp(28px, 5vw, 58px);
}

.school-panel.polished {
  background: #ffffff;
  border-left: 3px solid var(--ocre);
}

.school-badge {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(31, 52, 116, 0.08);
  display: flex;
  justify-content: center;
  min-height: 220px;
  padding: 28px;
}

.school-badge img {
  width: 150px;
}

.school-data {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
}

.school-data li {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 120px 1fr;
  padding: 14px 16px;
}

.school-data strong {
  color: #111;
  font-size: 13px;
}

.school-data span {
  color: var(--muted);
}

.footer {
  align-items: center;
  background: #1f1d1a;
  color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 34px clamp(22px, 7vw, 112px);
}

.footer div {
  display: grid;
  gap: 6px;
}

.footer span,
.footer a {
  color: #bdb7ab;
  font-size: 14px;
}

/* ── Cog spin animation ────────────────────────────────────────────────────── */
@keyframes cog-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.cog-spin {
  transition: transform 0.2s ease;
}

.cog-spin:hover {
  animation: cog-rotate 1.1s linear infinite;
}

/* ── Chat interface ────────────────────────────────────────────────────────── */
.chat-overlay {
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(6px);
  display: none;
  inset: 0;
  position: fixed;
  z-index: 100;
}

.chat-overlay.open {
  display: flex;
}

.chat-shell {
  background: #0d1117;
  border-radius: 14px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
  display: flex;
  height: 92vh;
  margin: auto;
  overflow: hidden;
  width: 90vw;
  max-width: 1280px;
}

/* Sidebar */
.chat-sidebar {
  background: #161b22;
  border-right: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  min-width: 240px;
  width: 240px;
}

.chat-sidebar-top {
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 18px 16px;
}

.chat-sidebar-top strong {
  color: #e6edf3;
  font-size: 14px;
}

.btn-new-chat {
  align-items: center;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: #e6edf3;
  cursor: pointer;
  display: flex;
  font-size: 18px;
  height: 32px;
  justify-content: center;
  transition: background 0.15s ease;
  width: 32px;
}

.btn-new-chat:hover {
  background: rgba(255,255,255,0.14);
}

.chat-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
}

.chat-history-list::-webkit-scrollbar {
  width: 4px;
}

.chat-history-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}

.history-item {
  border-radius: 6px;
  color: #8b949e;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
  padding: 9px 12px;
  transition: background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item:hover,
.history-item.active {
  background: rgba(255,255,255,0.07);
  color: #e6edf3;
}

.history-section-label {
  color: rgba(255,255,255,0.3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  padding: 14px 12px 6px;
  text-transform: uppercase;
}

/* User panel bottom */
.chat-user-panel {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 14px 16px;
}

.chat-user-info {
  align-items: center;
  display: flex;
  gap: 10px;
}

.user-avatar {
  align-items: center;
  background: var(--blue);
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  min-width: 34px;
  width: 34px;
}

.user-avatar.guest {
  background: rgba(255,255,255,0.12);
  color: #8b949e;
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.user-meta strong {
  color: #e6edf3;
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta span {
  color: #8b949e;
  font-size: 11px;
}

/* Main chat area */
.chat-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

/* Top bar */
.chat-topbar {
  align-items: center;
  background: #0d1117;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  height: 60px;
  justify-content: space-between;
  padding: 0 24px;
}

.chat-topbar-brand {
  align-items: center;
  display: flex;
  gap: 14px;
}

.chat-brand-logo {
  align-items: center;
  background: var(--blue);
  border-radius: 8px;
  color: #fff;
  display: flex;
  font-size: 16px;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  letter-spacing: -0.02em;
  width: 36px;
}

.chat-brand-text {
  display: grid;
  line-height: 1.2;
}

.chat-brand-text strong {
  color: #e6edf3;
  font-size: 14px;
}

.chat-brand-text span {
  color: #8b949e;
  font-size: 11px;
}

.chat-topbar-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.btn-close-chat {
  align-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: #8b949e;
  cursor: pointer;
  display: flex;
  font-size: 18px;
  height: 34px;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  width: 34px;
}

.btn-close-chat:hover {
  background: rgba(255,255,255,0.12);
  color: #e6edf3;
}

/* Messages */
.chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  padding: 28px 0;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
}

.chat-message {
  display: flex;
  gap: 14px;
  padding: 12px 28px;
  transition: background 0.1s ease;
}

.chat-message:hover {
  background: rgba(255,255,255,0.025);
}

.msg-avatar {
  align-items: center;
  border-radius: 6px;
  display: flex;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  height: 32px;
  justify-content: center;
  margin-top: 2px;
  width: 32px;
}

.msg-avatar.user {
  background: var(--blue);
  color: #fff;
}

.msg-avatar.kira {
  background: var(--green);
  color: #fff;
  font-size: 11px;
}

.msg-content {
  flex: 1;
  min-width: 0;
}

.msg-name {
  color: #8b949e;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.msg-text {
  color: #c9d1d9;
  font-size: 15px;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-text p {
  color: inherit;
  font-size: inherit;
  margin-bottom: 12px;
}

.msg-text p:last-child {
  margin-bottom: 0;
}

/* Welcome state */
.chat-welcome {
  align-items: center;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.chat-welcome-logo {
  align-items: center;
  background: var(--blue);
  border-radius: 18px;
  color: #fff;
  display: flex;
  font-size: 32px;
  font-weight: 800;
  height: 72px;
  justify-content: center;
  margin-bottom: 8px;
  width: 72px;
}

.chat-welcome h2 {
  color: #e6edf3;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

.chat-welcome p {
  color: #8b949e;
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  max-width: 420px;
}

.chat-suggestions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
  max-width: 520px;
  width: 100%;
}

.suggestion-chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #c9d1d9;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
  padding: 14px 16px;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.suggestion-chip:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

.suggestion-chip strong {
  color: #e6edf3;
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

/* Input area */
.chat-input-area {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 18px 24px 22px;
}

.chat-input-box {
  align-items: flex-end;
  background: #161b22;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  transition: border-color 0.15s ease;
}

.chat-input-box:focus-within {
  border-color: rgba(43, 74, 160, 0.6);
}

.chat-textarea {
  background: transparent;
  border: 0;
  color: #e6edf3;
  flex: 1;
  font-family: 'IBM Plex Sans', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  max-height: 180px;
  outline: none;
  padding: 0;
  resize: none;
}

.chat-textarea::placeholder {
  color: #484f58;
}

.btn-send {
  align-items: center;
  background: var(--blue);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-shrink: 0;
  height: 34px;
  justify-content: center;
  transition: background 0.15s ease, transform 0.12s ease;
  width: 34px;
}

.btn-send:hover {
  background: #4562b3;
  transform: scale(1.06);
}

.btn-send:disabled {
  background: rgba(255,255,255,0.1);
  cursor: not-allowed;
  transform: none;
}

.chat-input-hint {
  color: #484f58;
  font-size: 12px;
  margin-top: 8px;
  text-align: center;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 4px 0;
}

.typing-dot {
  animation: typing-bounce 1.2s ease infinite;
  background: #8b949e;
  border-radius: 50%;
  height: 7px;
  width: 7px;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40%            { transform: translateY(-6px); opacity: 1; }
}

/* Login panel */
.chat-login-panel {
  align-items: center;
  background: rgba(0,0,0,0.6);
  display: none;
  flex-direction: column;
  gap: 20px;
  inset: 0;
  justify-content: center;
  position: absolute;
  z-index: 10;
}

.chat-login-panel.visible {
  display: flex;
}

.login-card {
  background: #161b22;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 40px 36px;
  text-align: center;
  width: 340px;
}

.login-card h3 {
  color: #e6edf3;
  font-size: 22px;
  margin-bottom: 8px;
}

.login-card p {
  color: #8b949e;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 28px;
}

.btn-google-login {
  align-items: center;
  background: #fff;
  border: 0;
  border-radius: 8px;
  color: #2a2724;
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 12px;
  justify-content: center;
  padding: 13px 20px;
  transition: box-shadow 0.15s ease;
  width: 100%;
}

.btn-google-login:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,0.22);
}

.btn-google-login svg {
  flex-shrink: 0;
  height: 18px;
  width: 18px;
}

.btn-skip-login {
  background: transparent;
  border: 0;
  color: #8b949e;
  cursor: pointer;
  font-size: 13px;
  margin-top: 12px;
  text-decoration: underline;
}

.btn-skip-login:hover {
  color: #c9d1d9;
}

/* Chat trigger button (in nav or page) */
.btn-open-chat {
  align-items: center;
  background: var(--blue);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(43, 74, 160, 0.35);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
  padding: 11px 20px;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.btn-open-chat:hover {
  box-shadow: 0 12px 32px rgba(43, 74, 160, 0.5);
  transform: translateY(-2px);
}

/* ============================================================================
   ANIMATIONS — keyframes, reveal, floats, shimmers, counters
   ============================================================================ */

/* ── Keyframes ─────────────────────────────────────────────────────────────── */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-left {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes counter-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}


/* ── Scroll-reveal base ─────────────────────────────────────────────────────── */
/*
 * El sistema reveal usa la clase .js-reveal-ready en <html> para activarse.
 * Si JS no carga, los elementos son siempre visibles (progressive enhancement).
 * animations.js agrega .js-reveal-ready al <html> antes de observar elementos.
 */
.js-reveal-ready .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.62s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.js-reveal-ready .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.js-reveal-ready .reveal-left {
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.62s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.js-reveal-ready .reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ── Stagger delays ─────────────────────────────────────────────────────────── */
.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.16s; }
.delay-3 { transition-delay: 0.24s; }
.delay-4 { transition-delay: 0.32s; }
.delay-5 { transition-delay: 0.40s; }
.delay-6 { transition-delay: 0.48s; }

.status-dot.offline {
  background: #c4473b;
  animation: none;
  box-shadow: 0 0 0 6px rgba(196, 71, 59, 0.12);
}

/* ── Palabra destacada en un título: azul liso, sin degradado animado ─────── */
.gradient-text {
  color: var(--blue);
}

/* ── Counter number pop when revealed ──────────────────────────────────────── */
.counter-done {
  animation: counter-pop 0.4s ease-out;
}

/* ── Hero copy block — slide from left ─────────────────────────────────────── */
/* Usamos forwards (no both) para no empezar en opacity:0 antes del delay */
.hero-copy-block {
  animation: fade-in-left 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
}

/* ── Dashboard preview — aparece una vez, sin flotar ──────────────────────── */
.dashboard-preview {
  animation: fade-in-up 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
}

/* ── Hero stats bar — staggered children ───────────────────────────────────── */
.hero-stats > div {
  animation: fade-in-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-stats > div:nth-child(1) { animation-delay: 0.3s; }
.hero-stats > div:nth-child(2) { animation-delay: 0.42s; }
.hero-stats > div:nth-child(3) { animation-delay: 0.54s; }
.hero-stats > div:nth-child(4) { animation-delay: 0.66s; }

/* ── Nav link hover — smooth underline already exists, add colour fade ──────── */
.nav a {
  transition: color 0.18s ease;
}

/* ── Page hero — fade in on load ────────────────────────────────────────────── */
.page-hero > .page-hero-grid {
  animation: fade-in-up 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

/* ============================================================================ */

@media (max-width: 1120px) {
  .hero-layout,
  .page-hero-grid,
  .api-showcase,
  .download-showcase {
    grid-template-columns: 1fr;
  }

  .dashboard-preview,
  .api-hero-panel,
  .installer-window,
  .cog-map,
  .school-identity {
    max-width: 720px;
  }

  .hero-stats,
  .showcase-grid,
  .flow-panel,
  .install-timeline,
  .architecture-board,
  .stack-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .endpoint-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    height: auto;
    padding-bottom: 8px;
    padding-top: 12px;
    position: sticky;
  }

  .brand img {
    height: 38px;
  }

  .nav {
    flex-wrap: wrap;
    gap: 0 2px;
    margin-left: -10px;
    width: 100%;
  }

  .nav-more {
    position: static;
  }

  .nav-more > div {
    left: 16px;
    right: 16px;
    top: calc(100% + 4px);
  }

  .hero {
    padding-top: 48px;
  }

  .page-hero {
    padding-top: 56px;
  }

  h1 {
    font-size: clamp(42px, 12vw, 68px);
  }

  .hero-actions,
  .api-chip-row,
  .hero-pills {
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .hero-stats,
  .showcase-grid,
  .showcase-grid.three,
  .flow-panel,
  .install-timeline,
  .architecture-board,
  .stack-board,
  .endpoint-grid,
  .preview-grid,
  .api-mini-grid,
  .cogs-grid {
    grid-template-columns: 1fr;
  }

  .showcase-featured,
  .endpoint-card.important {
    grid-column: span 1;
  }

  .dashboard-preview,
  .api-hero-panel,
  .installer-window,
  .cog-card,
  .showcase-card,
  .endpoint-card,
  .flow-step,
  .install-timeline article {
    padding: 22px;
  }

  .cog-card {
    grid-template-columns: 1fr;
  }

  .school-panel {
    grid-template-columns: 1fr;
  }

  .school-panel.polished {
    background: #fff;
  }

  .school-data li {
    grid-template-columns: 1fr;
  }

  pre {
    padding: 22px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }
}


/* ============================================================================
   PORTADA (index.html) — portal del colegio, al estilo de Manus
   Título y botones con tres muestras de la plataforma al lado; después la
   cinta de materias, tarjetas, la sección docente y la cita del Principito
   en una banda oscura. El movimiento lo maneja animations.js con Motion.
   ============================================================================ */

/* Texto solo para lectores de pantalla. */
.sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Estado inicial de lo que entra con animación. Solo con movimiento activo:
   la clase .mov la pone un script del <head> si la persona no pidió reducir
   el movimiento. Si animations.js no llegara a cargar, todo aparece igual a
   los 2,5 s (animations.js agrega .mov-js apenas arranca). */
.mov [data-entrada],
.mov [data-revelar],
.mov [data-revelar-grupo] > * {
  opacity: 0;
}

.mov:not(.mov-js) [data-entrada],
.mov:not(.mov-js) [data-revelar],
.mov:not(.mov-js) [data-revelar-grupo] > * {
  animation: ep-mostrar 0.01s 2.5s forwards;
}

@keyframes ep-mostrar {
  to { opacity: 1; }
}

/* ── Inicio: presentación con muestras de la plataforma ───────────────────── */
.inicio {
  align-items: center;
  display: grid;
  gap: clamp(32px, 5vw, 72px);
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  margin: 0 auto;
  max-width: 1280px;
  padding: clamp(104px, 11vw, 140px) clamp(20px, 5vw, 84px) clamp(64px, 8vw, 112px);
}

/* Logo de Intelligence Core arriba del título */
.inicio-logo {
  display: block;
  height: 72px;
  margin-bottom: 22px;
  width: 72px;
}

.inicio h1 {
  font-size: clamp(38px, 4.8vw, 64px);
  font-weight: 400;
  line-height: 1.08;
  margin-bottom: 18px;
  max-width: 14ch;
  text-wrap: balance;
}

.inicio-bajada {
  color: var(--muted);
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.6;
  margin: 0 0 30px;
  max-width: 50ch;
  text-wrap: pretty;
}

.inicio .hero-actions {
  margin-top: 0;
}

/* Tres muestras de cómo se ve la plataforma (no son datos reales). */
.muestras {
  display: grid;
  gap: 14px;
}

.muestra {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(29, 28, 26, 0.04), 0 18px 40px -26px rgba(29, 28, 26, 0.3);
  padding: 18px 20px;
}

.muestra-respuesta {
  margin-right: 12%;
}

.muestra-imagen {
  margin-left: 16%;
  padding: 10px;
}

.muestra-tarea {
  align-items: center;
  display: grid;
  gap: 4px 12px;
  grid-template-columns: auto 1fr auto;
  margin-left: 4%;
  margin-right: 6%;
}

.muestra-pregunta {
  background: var(--soft);
  border-radius: 12px 12px 4px 12px;
  color: var(--ink);
  font-size: 14.5px;
  margin: 0 0 12px auto;
  padding: 8px 12px;
  width: fit-content;
}

.muestra-etiqueta {
  align-items: center;
  color: #2f7d4f;
  display: inline-flex;
  font-size: 12.5px;
  font-weight: 600;
  gap: 6px;
  margin-bottom: 6px;
}

.muestra p {
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0;
}

.muestra-fuente,
.muestra-pie {
  color: var(--muted);
  display: block;
  font-size: 12.5px;
}

.muestra-fuente {
  margin-top: 10px;
}

.muestra-pie {
  padding: 8px 6px 2px;
}

.muestra-imagen svg {
  border-radius: 10px;
  display: block;
  height: auto;
  width: 100%;
}

/* Algunas estrellas de la ilustración titilan (solo con movimiento activo) */
.mov .muestra-imagen .titila {
  animation: titilar 3.2s ease-in-out infinite;
}

@keyframes titilar {
  50% { opacity: 0.25; }
}

.muestra-chip {
  background: var(--ink);
  border-radius: 999px;
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  grid-row: span 2;
  padding: 4px 10px;
}

.muestra-tarea strong {
  font-size: 15px;
}

.muestra-sub {
  color: var(--muted);
  font-size: 13px;
  grid-column: 2;
}

.muestra-estado {
  background: #fbf4e6;
  border: 1px solid #ecd39b;
  border-radius: 999px;
  color: var(--ocre-texto);
  font-size: 12px;
  font-weight: 600;
  grid-column: 3;
  grid-row: 1 / span 2;
  padding: 3px 10px;
}

/* ── Cinta de materias (se desliza sola; se frena al pasar el mouse) ──────── */
.cinta {
  border-block: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  overflow: hidden;
  padding: 20px 0;
}

.cinta-pista {
  display: flex;
  width: max-content;
}

.cinta ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cinta li {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 20px;
  padding: 0 26px;
  position: relative;
  white-space: nowrap;
}

.cinta li::after {
  color: var(--ocre);
  content: "·";
  position: absolute;
  right: -4px;
}

.mov .cinta-pista {
  animation: cinta 70s linear infinite;
}

.cinta:hover .cinta-pista {
  animation-play-state: paused;
}

@keyframes cinta {
  to { transform: translateX(-50%); }
}

/* ── Tarjetas: las cuatro cosas que más se usan ───────────────────────────── */
.portada-h2 {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 400;
  margin-bottom: 30px;
}

.portada-accesos {
  text-align: center;
}

.tarjetas {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  text-align: left;
}

.tarjeta {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 24px;
  transition: border-color 0.25s ease, box-shadow 0.3s ease;
}

.tarjeta:hover {
  border-color: var(--line-strong);
  box-shadow: 0 22px 44px -26px rgba(29, 28, 26, 0.32);
}

.tarjeta-icono {
  align-items: center;
  background: var(--soft);
  border-radius: 12px;
  color: var(--ink);
  display: inline-flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.tarjeta h3 {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 500;
  margin: 22px 0 8px;
}

.tarjeta p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 18px;
}

.tarjeta-ir {
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  margin-top: auto;
}

.tarjeta-ir span {
  display: inline-block;
  transition: transform 0.25s var(--ep-curva);
}

.tarjeta:hover .tarjeta-ir span {
  transform: translateX(4px);
}

/* ── Docentes: Mi materia y el orden en que se arma una respuesta ─────────── */
.portada-docentes {
  align-items: start;
  display: grid;
  gap: clamp(32px, 6vw, 96px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.portada-docentes h2 {
  font-weight: 400;
  max-width: 18ch;
}

.portada-docentes p {
  max-width: 52ch;
}

.portada-docentes .btn {
  margin-top: 8px;
}

/* (.portada-docentes delante: le gana a ".section p") */
.portada-docentes .orden-titulo {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

/* Orden de búsqueda de una respuesta, numerado con la letra de libro. */
.orden {
  border-top: 1px solid var(--line);
  counter-reset: paso;
  list-style: none;
  margin: 0;
  padding: 0;
}

.orden li {
  border-bottom: 1px solid var(--line);
  counter-increment: paso;
  display: grid;
  grid-template-columns: 48px 1fr;
  padding: 16px 0;
  row-gap: 2px;
}

.orden li::before {
  color: var(--ocre);
  content: counter(paso);
  font-family: var(--font-display);
  font-size: 28px;
  grid-row: span 2;
  line-height: 1;
}

.orden strong {
  font-size: 17px;
}

.orden span {
  color: var(--muted);
  font-size: 15px;
}

/* ── La cita, en una banda oscura (como el cierre de Manus) ───────────────── */
.cita-banda {
  background: #1d1c1a;
  color: #f6f4ef;
  padding: clamp(84px, 11vw, 150px) clamp(20px, 5vw, 84px);
  text-align: center;
}

.cita-grande {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.6vw, 60px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.2;
  margin: 0 auto;
  max-width: 17ch;
}

.cita-grande .palabra {
  display: inline-block;
  white-space: pre;
}

.cita-autor {
  color: #bdb7ab;
  font-size: 15px;
  margin: 22px 0 0;
}

@media (max-width: 1120px) {
  .inicio {
    grid-template-columns: 1fr;
  }

  .muestras {
    max-width: 580px;
  }

  .tarjetas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portada-docentes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .inicio {
    padding-top: 26px;
  }

  .muestra-respuesta,
  .muestra-imagen,
  .muestra-tarea {
    margin-left: 0;
    margin-right: 0;
  }

  .tarjetas {
    grid-template-columns: 1fr;
  }

  .tarjeta {
    min-height: 0;
  }

}

/* ── Áreas táctiles (accesibilidad) ────────────────────────────────────────────
   En pantallas táctiles (pointer: coarse) los enlaces del menú llegan a 44px
   de alto para tocarlos con el dedo sin errar. Los enlaces del pie agrandan
   su zona tocable con padding y margen negativo, así el diseño no se mueve.
   En escritorio (mouse) no cambia nada. */
@media (pointer: coarse) {
  .nav a,
  .nav-more summary,
  .nav-more > div a {
    align-items: center;
    display: flex;
    min-height: 44px;
  }

  .footer a {
    display: inline-block;
    margin: -12px 0;
    padding: 12px 0;
  }
}
