/* IDHEIP — abismo y papel; teal de la estola de egreso; ámbar solo para la acción principal y la banda ascendente. */
:root {
  --abismo: #0f2531;
  --marino: #153a4b;
  --tinta: #1f2b3e;
  --pino: #3e6b63;
  --agua: #52918b;
  --menta: #6fd6c4;
  --papel: #f4f7f6;
  --papel-2: #e7eeec;
  --ambar: #d8821f;
  --linea: rgba(31, 43, 62, .2);
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --texto: "Source Serif 4", Georgia, serif;
  /* En pantallas muy anchas el contenido se queda en ~92rem y los márgenes crecen */
  --gutter: max(clamp(1.25rem, 5vw, 4.5rem), calc((100vw - 92rem) / 2));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--papel); color: var(--tinta);
  font: 400 1.125rem/1.6 var(--texto); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: .95; margin: 0; letter-spacing: .005em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--ambar); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--abismo); color: #fff; padding: .6rem 1rem; z-index: 50; }
.skip:focus { left: 0; }

/* Dato pendiente: se ve a propósito */
.pend { background: #ffe9a8; color: var(--tinta); font: 600 .78em/1 var(--texto); padding: .15em .45em; border: 1px dashed #a8741a; }

/* ───────── Barra superior ───────── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem var(--gutter); background: rgba(15, 37, 49, .94);
  backdrop-filter: blur(8px); border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.top__logo img { height: 2.4rem; width: auto; }
.top__nav { display: flex; align-items: center; gap: 1.8rem; font: 700 1.2rem/1 var(--display); letter-spacing: .03em; color: #dbe8e5; }
.top__nav a { text-decoration: none; padding: .4rem 0; border-bottom: 2px solid transparent; transition: border-color .2s, color .2s; }
.top__nav a:hover { border-color: var(--menta); color: #fff; }
.top__nav .top__cta { background: var(--ambar); color: var(--abismo); padding: .65rem 1.05rem; border: 0; border-radius: 2px; transition: background .2s; }
.top__nav .top__cta:hover { background: #e8932f; color: var(--abismo); }

/* ───────── Botones ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  font: 800 1.3rem/1 var(--display); letter-spacing: .03em; text-decoration: none;
  padding: 1.05rem 1.7rem; border: 2px solid var(--tinta); border-radius: 2px;
  background: transparent; color: var(--tinta); cursor: pointer;
  transition: background .18s, color .18s, transform .18s, border-color .18s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ambar); border-color: var(--ambar); color: var(--abismo); }
.btn--primary:hover { background: #e8932f; border-color: #e8932f; }
.btn--ghost:hover { background: var(--tinta); color: var(--papel); }
.btn--light { border-color: rgba(255, 255, 255, .7); color: #fff; }
.btn--light:hover { background: #fff; color: var(--abismo); border-color: #fff; }
.btn--sm { font-size: 1.1rem; padding: .8rem 1.2rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .65; cursor: progress; }

/* ───────── Hero ───────── */
.hero {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  background: radial-gradient(120% 90% at 0% 100%, #1a5560 0%, transparent 55%), linear-gradient(160deg, var(--abismo) 20%, var(--marino) 100%);
  min-height: min(88vh, 52rem); padding: clamp(3rem, 7vw, 6rem) var(--gutter);
  display: flex; align-items: center;
}
.hero__ondas { position: absolute; z-index: 0; left: -6%; bottom: 0; height: 100%; width: auto; fill: none; stroke: rgba(255, 255, 255, .06); stroke-width: 30; stroke-linecap: round; pointer-events: none; }
.hero__text { position: relative; z-index: 3; width: min(46%, 40rem); }
.hero h1 { font-size: clamp(2.9rem, 5.7vw, 5.5rem); font-weight: 900; line-height: .9; }
.hero__lead { margin-top: 1.6rem; max-width: 30rem; font-size: 1.2rem; color: #c6d9d6; }
.hero__actions { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: .9rem; }

.hero__foto { position: absolute; z-index: 1; top: 0; right: 0; bottom: 0; width: 54%; clip-path: polygon(16% 0, 100% 0, 100% 100%, 0 100%); }
.hero__foto img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
/* Banda ámbar sobre el borde diagonal: se dibuja de abajo hacia arriba al cargar */
.hero__foto::before {
  content: ""; position: absolute; inset: 0; z-index: 2; background: var(--ambar);
  clip-path: polygon(16% 0, calc(16% + 14px) 0, 14px 100%, 0 100%);
  transform-origin: bottom; animation: sube 1.1s cubic-bezier(.6, .05, .2, 1) .25s both;
}
@keyframes sube { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ───────── Modalidades ───────── */
.modalidades {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: center;
  padding: clamp(3.5rem, 7vw, 6.5rem) var(--gutter);
}
.modalidades__foto { margin: 0 14px 14px 0; max-width: 36rem; }
.modalidades__foto img { width: 100%; aspect-ratio: 5 / 5.3; object-fit: cover; border-radius: 2px; box-shadow: 14px 14px 0 var(--menta); }
.modalidades h2 { font-size: clamp(2.6rem, 5.2vw, 4.4rem); margin-bottom: 1rem; }
.modalidades__intro { color: var(--pino); max-width: 30rem; margin-bottom: 2rem; }
.modo { border-top: 2px solid var(--tinta); padding: 1.2rem 0 1.6rem; max-width: 32rem; }
.modo h3 { font-size: 2.1rem; margin-bottom: .5rem; }
.modo p { margin-bottom: .9rem; }
.enlace { font: 700 1.2rem/1 var(--display); letter-spacing: .03em; background: none; border: 0; padding: .3rem 0; color: var(--tinta); cursor: pointer; border-bottom: 3px solid var(--ambar); transition: color .15s, border-color .15s; }
.enlace:hover { color: var(--pino); border-color: var(--pino); }

/* ───────── Registro de programas ───────── */
.registro { padding: clamp(3rem, 6vw, 5.5rem) var(--gutter); background: var(--papel-2); border-top: 1px solid var(--linea); }
.registro__intro { max-width: 40rem; margin-bottom: 2.4rem; }
.registro h2 { font-size: clamp(2.6rem, 5.2vw, 4.4rem); margin-bottom: .9rem; }
.registro__intro p { color: var(--pino); }

.filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2.2rem; margin-bottom: 2rem; }
.filtros__grupo { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.filtros__titulo { font: 700 1.15rem/1 var(--display); letter-spacing: .03em; margin-right: .5rem; color: var(--pino); }
.filtros button {
  font: 700 1.1rem/1 var(--display); letter-spacing: .03em; padding: .6rem 1rem;
  border: 1.5px solid var(--tinta); background: transparent; color: var(--tinta); border-radius: 2px; cursor: pointer;
  transition: background .15s, color .15s;
}
.filtros button:hover { background: rgba(31, 43, 62, .08); }
.filtros button[aria-pressed="true"] { background: var(--abismo); color: #fff; }
.filtros__cuenta { margin-left: auto; font-size: .95rem; color: var(--pino); }

.ledger-head, .prog summary {
  display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem 10.5rem 9rem 2.6rem; column-gap: 1.4rem; align-items: center;
}
.ledger-head { font: 700 1.05rem/1 var(--display); letter-spacing: .04em; color: var(--pino); padding: 0 .2rem .7rem; border-bottom: 2px solid var(--tinta); }

.nivel { margin-top: 2.6rem; }
.nivel:first-of-type { margin-top: 1.6rem; }
.nivel__titulo { font-size: clamp(2rem, 4vw, 3rem); color: var(--pino); margin-bottom: .6rem; }
/* Escalón: las maestrías quedan un peldaño arriba de las licenciaturas */
.nivel--mae .nivel__titulo { border-left: 4px solid var(--agua); padding-left: .9rem; margin-left: clamp(0rem, 3vw, 2.4rem); }
.nivel[hidden] { display: none; }

.prog { border-bottom: 1px solid var(--linea); }
.prog[hidden] { display: none; }
.prog summary { list-style: none; cursor: pointer; padding: 1.1rem .2rem; transition: background .18s; }
.prog summary::-webkit-details-marker { display: none; }
.prog summary:hover { background: rgba(255, 255, 255, .6); }
.prog__nombre { font: 800 clamp(1.6rem, 2.6vw, 2.25rem)/1 var(--display); letter-spacing: .005em; }
.prog[open] .prog__nombre { color: var(--pino); }
.prog__mod, .prog__dur, .prog__rvoe { font-size: 1rem; }
.prog__rvoe { font-variant-numeric: tabular-nums; font-weight: 600; }
.prog__mas { position: relative; width: 1.6rem; height: 1.6rem; justify-self: end; }
.prog__mas::before, .prog__mas::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2.5px; background: var(--tinta); transition: transform .25s; }
.prog__mas::after { transform: rotate(90deg); }
.prog[open] .prog__mas::after { transform: rotate(0); }

.prog__panel { margin: .2rem 0 1.6rem; padding: 1.6rem 1.8rem; display: grid; gap: 1.3rem; max-width: 62rem; background: #fff; border-left: 4px solid var(--agua); animation: abre .28s ease-out; }
@keyframes abre { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.prog__leyenda { font: 800 1.5rem/1.05 var(--display); letter-spacing: .02em; color: var(--pino); }
.prog dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.1rem 2rem; }
.prog dt { font-size: .88rem; color: var(--pino); }
.prog dd { margin: .1rem 0 0; font-weight: 600; }
.prog .btn { justify-self: start; }

.vacio { padding: 2.5rem 0; display: grid; gap: 1rem; justify-items: start; }
.vacio[hidden] { display: none; }

/* ───────── Informes ───────── */
.informes {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: start;
  padding: clamp(3.5rem, 7vw, 6.5rem) var(--gutter); color: #fff;
  background: radial-gradient(90% 80% at 100% 0%, #1a5560 0%, transparent 60%), linear-gradient(200deg, var(--marino) 0%, var(--abismo) 70%);
}
.informes h2 { font-size: clamp(2.8rem, 6vw, 5rem); margin-bottom: 1.2rem; }
.informes__texto p { max-width: 30rem; color: #c6d9d6; }
.contacto { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .6rem; max-width: 32rem; }
.contacto a { color: #fff; text-underline-offset: 4px; text-decoration-color: var(--ambar); text-decoration-thickness: 2px; }
.contacto a:hover { text-decoration-color: #fff; }
.informes__foto { margin-top: 2.2rem; width: 100%; max-width: 30rem; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 25%; border-radius: 2px; }

.form { display: grid; gap: 1.3rem; align-content: start; padding: clamp(1.4rem, 3vw, 2.4rem); background: rgba(8, 22, 30, .55); border: 1px solid rgba(255, 255, 255, .1); border-top: 4px solid var(--menta); }
.campo { display: grid; gap: .35rem; font: 700 1.1rem/1 var(--display); letter-spacing: .03em; }
.campo input, .campo select {
  font: 400 1.1rem/1.3 var(--texto); color: #fff; background: rgba(255, 255, 255, .07);
  border: 0; border-bottom: 2px solid #8aa4a1; border-radius: 2px 2px 0 0; padding: .9rem .8rem; width: 100%;
  transition: background .15s, border-color .15s;
}
.campo select option, .campo select optgroup { color: var(--tinta); background: #fff; }
.campo input:hover, .campo select:hover { background: rgba(255, 255, 255, .11); }
.campo input:focus, .campo select:focus { outline: none; background: rgba(255, 255, 255, .14); border-bottom-color: var(--ambar); }
.campo input:focus-visible, .campo select:focus-visible { outline: 3px solid var(--ambar); outline-offset: 2px; }
.campo[data-invalido] input, .campo[data-invalido] select { border-bottom-color: #ffb4a2; }
.campo__error { font: 400 .95rem/1.3 var(--texto); color: #ffb4a2; }
.trampa { position: absolute; left: -9999px; }
.btn--block span { display: inline-flex; align-items: center; gap: .6rem; }
.btn.cargando span::before { content: ""; width: 1em; height: 1em; border: 2.5px solid var(--abismo); border-right-color: transparent; border-radius: 50%; animation: gira .7s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.form__estado { min-height: 1.6rem; }
.form__estado[data-tipo="ok"] { color: #b9e3d2; }
.form__estado[data-tipo="error"] { color: #ffb4a2; }

/* ───────── Pie ───────── */
.pie { display: grid; grid-template-columns: auto 1fr; gap: 2rem 3rem; align-items: start; padding: 2.5rem var(--gutter); background: #0a1a24; color: #b9ccc9; font-size: .95rem; }
.pie__logo { height: 2.6rem; width: auto; }
.pie__legal { display: grid; gap: .5rem; max-width: 46rem; }
.pie strong { color: #fff; }

/* ───────── Responsive ───────── */
@media (max-width: 62rem) {
  .informes { grid-template-columns: 1fr; }
  .modalidades { grid-template-columns: 1fr; }
  .modalidades__foto { max-width: 30rem; margin-right: 14px; }
}
@media (max-width: 48rem) {
  .hero { display: block; min-height: 0; padding-bottom: 0; }
  .hero__text { width: 100%; }
  .hero__ondas { opacity: .8; left: -30%; }
  .hero__foto { position: relative; width: auto; height: 19rem; margin: 2.4rem calc(var(--gutter) * -1) 0; clip-path: polygon(0 12%, 100% 0, 100% 100%, 0 100%); }
  .hero__foto::before { clip-path: polygon(0 12%, 100% 0, 100% 10px, 0 calc(12% + 10px)); transform-origin: left; animation-name: avanza; }
  @keyframes avanza { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  .ledger-head { display: none; }
  .prog summary { grid-template-columns: auto auto auto 1fr; grid-template-areas: "n n n m" "d u r ."; row-gap: .5rem; column-gap: 1.1rem; }
  .prog__nombre { grid-area: n; }
  .prog__mas { grid-area: m; align-self: start; margin-top: .2rem; }
  .prog__mod { grid-area: d; }
  .prog__dur { grid-area: u; }
  .prog__rvoe { grid-area: r; }
  .prog__panel { padding: 1.2rem 1.1rem; }
  .filtros__cuenta { margin-left: 0; width: 100%; }
  .pie { grid-template-columns: 1fr; }
  .top__nav { gap: 1rem; }
  .top__nav a:not(.top__cta) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__foto::before { animation: none; }
  .prog__panel { animation: none; }
}
