/* UNIverse · Temario UNI v4 (extiende /biblioteca/galaxia/catalogo.css) */
:root {
  --fg-3: #85858e;
  --mat: #8fb0ff;
  --cie: #74d3a8;
  --apt: #f0c27a;
  --press: cubic-bezier(0.2, 0, 0, 1);
}
html { scroll-padding-top: 132px; }
html, body { overflow-x: clip; }
ol { list-style: none; margin: 0; padding: 0; }

/* ---------- Hero ---------- */
.t-hero { position: relative; isolation: isolate; padding-top: 104px; padding-bottom: 28px; }
.t-crest {
  position: absolute; z-index: -1; right: calc(var(--gutter) - 24px); top: 56px;
  width: min(46vw, 300px); height: auto;
  opacity: .07; filter: grayscale(1) brightness(2.4);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 92%); mask-image: linear-gradient(180deg, #000 30%, transparent 92%);
  pointer-events: none; user-select: none;
}
.t-kicker { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 14px; font-size: 13.5px; color: var(--fg-2); }
.t-kicker img { width: 18px; height: auto; }
.t-hero h1 { margin: 0 0 0 -.04em; font-size: clamp(54px, 15vw, 132px); font-weight: 600; letter-spacing: -.06em; line-height: .9; }
.t-hero h1 em { font-style: normal; color: var(--accent); }
.t-hero h1 .w { display: inline-block; white-space: nowrap; }
.t-hero h1 .ch { display: inline-block; }
.js .t-hero h1 .ch { opacity: 0; transform: translateY(.28em); filter: blur(8px); animation: chIn 820ms var(--ease-out) forwards; animation-delay: calc(var(--i) * 36ms + 120ms); }
@keyframes chIn { to { opacity: 1; transform: none; filter: blur(0); } }
.t-hero .stats span { margin-right: 6px; }
@media (min-width: 768px) { .t-hero { padding-top: 128px; padding-bottom: 36px; } .t-crest { top: 40px; width: 300px; opacity: .08; } }

/* ---------- Console (sticky) ---------- */
.t-console {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  transition: box-shadow 200ms ease;
}
.t-console.is-stuck { box-shadow: 0 1px 0 var(--line); }
.t-console-in { display: grid; gap: 10px; padding-block: 10px; }
.search input {
  width: 100%; height: 48px; padding: 0 84px 0 44px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  font: 400 16px var(--sans); -webkit-appearance: none; appearance: none;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
@media (min-width: 900px) { .t-console-in { grid-template-columns: auto minmax(0, 420px); justify-content: space-between; align-items: center; } }

/* Segmented control with a sliding pill */
.seg { --n: 3; --i: 0; position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.seg button { position: relative; z-index: 1; height: 38px; padding: 0 18px; border: 0; border-radius: 999px; background: none; color: var(--fg-2); font-size: 14.5px; font-weight: 500; white-space: nowrap; transition: color 200ms ease; }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { color: var(--bg); }
.seg button:active { transform: scale(.97); }
.seg-pill { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n)); border-radius: 999px; background: var(--fg); transform: translateX(calc(var(--i) * 100%)); transition: transform 360ms var(--ease-drawer); }
.seg-sm button { height: 32px; padding: 0 14px; font-size: 13.5px; }
@media (hover: hover) and (pointer: fine) { .seg button:not([aria-selected="true"]):not([aria-pressed="true"]):hover { color: var(--fg); } }

/* ---------- Views ---------- */
.t-body { padding-top: 20px; padding-bottom: 96px; min-height: 70svh; }
.view.is-entering { animation: viewIn 280ms var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

[data-s="mat"] { --c: var(--mat); } [data-s="cie"] { --c: var(--cie); } [data-s="apt"] { --c: var(--apt); }

.adm { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.adm-main { min-width: 0; }
.idx { display: none; }

@media (min-width: 1024px) {
  .adm { grid-template-columns: 272px minmax(0, 1fr); gap: 48px; margin-top: 24px; }
  .idx { display: block; position: sticky; top: 92px; align-self: start; max-height: calc(100svh - 112px); overflow-y: auto; scrollbar-width: none; padding-right: 4px; }
  .idx::-webkit-scrollbar { display: none; }
  .c-down { display: none; }
  .c-pick { pointer-events: none; }
}
.idx-g + .idx-g { margin-top: 22px; }
.idx-g h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding-left: 12px; font-size: 12.5px; font-weight: 500; color: var(--fg-3); }
.idx-g h3::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.idx a, .pick-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; font-size: 14.5px; color: var(--fg-2); text-decoration: none; transition: color 140ms ease, background-color 140ms ease; }
.idx a[aria-current], .pick-list a[aria-current] { color: var(--fg); background: var(--surface-2); }
.idx a b, .pick-list a b { font: 500 11.5px/1 var(--mono); color: var(--fg-3); font-variant-numeric: tabular-nums; }
.idx a b.full, .pick-list a b.full { color: var(--cie); }
@media (hover: hover) and (pointer: fine) { .idx a:not([aria-current]):hover { color: var(--fg); background: rgba(255, 255, 255, .04); } }

/* Course */
.c-head { display: grid; gap: 4px; padding: 0 0 18px; border-bottom: 1px solid var(--line); }
.c-sec { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--fg-3); }
.c-sec::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.c-head h2 { margin: 0; font-size: clamp(30px, 8vw, 44px); font-weight: 600; letter-spacing: -.04em; line-height: 1.05; overflow-wrap: anywhere; }
.c-pick { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; transition: transform 120ms var(--ease-out); }
.c-pick:active { transform: scale(.98); }
.c-down { flex: none; width: .6em; height: .6em; margin-top: .08em; color: var(--fg-3); stroke-width: 2.2; }
.c-prog { margin: 10px 0 0; }
.c-prog { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.c-prog .bar { width: 96px; height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.c-prog .bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--cie); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 420ms var(--ease-out); }

/* Topic rows */
.topics { counter-reset: none; }
.topic { border-bottom: 1px solid var(--line); }
.topic.in { animation: rowIn 360ms var(--ease-out) both; animation-delay: calc(min(var(--k), 12) * 28ms); }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } }
.t-row { width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 20px; align-items: center; gap: 12px; min-height: 60px; padding: 12px 2px; border: 0; background: none; text-align: left; color: var(--fg); }
.t-num { font: 500 13px/1 var(--mono); color: var(--fg-3); font-variant-numeric: tabular-nums; transition: color 160ms ease; }
.t-title { font-size: 16px; font-weight: 450; line-height: 1.35; overflow-wrap: anywhere; transition: color 160ms ease; }
.t-chev { width: 18px; height: 18px; color: var(--fg-3); transition: transform 260ms var(--ease-out); }
.topic[data-open] .t-chev { transform: rotate(45deg); }
.topic.done .t-title { color: var(--fg-2); }
.topic.done .t-num { color: var(--cie); }
@media (hover: hover) and (pointer: fine) { .t-row:hover .t-title { color: #fff; } .t-row:hover .t-chev { color: var(--fg); } }

/* Frequency: 3 bars, filled by how often the topic shows up in past exams */
.freq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.freq i { width: 3px; border-radius: 2px; background: var(--line-2); }
.freq i:nth-child(1) { height: 6px; } .freq i:nth-child(2) { height: 10px; } .freq i:nth-child(3) { height: 14px; }
.freq[data-f="1"] i:nth-child(-n+1), .freq[data-f="2"] i:nth-child(-n+2), .freq[data-f="3"] i { background: var(--accent); }
.freq-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-3); white-space: nowrap; }
@media (max-width: 420px) { .freq-tag span { display: none; } }

.t-body-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 280ms var(--ease-out); }
.topic[data-open] .t-body-wrap { grid-template-rows: 1fr; }
.t-in { overflow: hidden; min-height: 0; }
.t-detail { padding: 0 2px 20px 46px; opacity: 0; transform: translateY(-4px); transition: opacity 200ms ease, transform 280ms var(--ease-out); }
.topic[data-open] .t-detail { opacity: 1; transform: none; }
.concepts { display: grid; gap: 8px; margin: 0 0 16px; }
.concepts li { overflow-wrap: anywhere; position: relative; padding-left: 16px; font-size: 15px; line-height: 1.55; color: var(--fg-2); }
.concepts li::before { content: ""; position: absolute; left: 0; top: .72em; width: 6px; height: 1px; background: var(--fg-3); }
.mark { display: inline-flex; align-items: center; gap: 8px; height: 36px; margin-left: -4px; padding: 0 10px 0 4px; border-radius: 999px; border: 0; background: none; color: var(--fg-2); color: var(--fg); font-size: 14px; transition: background-color 160ms ease, border-color 160ms ease, transform 120ms var(--ease-out); }
.mark svg { width: 18px; height: 18px; }
.mark .ck { stroke-dasharray: 14; stroke-dashoffset: 14; transition: stroke-dashoffset 260ms var(--ease-out); }
.topic.done .mark { color: var(--fg); }
.topic.done .mark .ck { stroke-dashoffset: 0; }
.topic.done .mark svg { color: var(--cie); }
.mark:active { transform: scale(.97); }

/* Search results */
.res-head { margin: 4px 0 8px; font-size: 13.5px; color: var(--fg-3); }
.res-g { padding: 14px 0 6px; border-top: 1px solid var(--line); }
.res-g:first-of-type { border-top: 0; }
.res-g h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 13px; font-weight: 500; color: var(--fg-3); }
.res-g h3::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.res { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) 16px; align-items: center; gap: 12px; padding: 10px 0; border: 0; background: none; text-align: left; color: var(--fg); }
.res > b { font: 500 12px/1 var(--mono); color: var(--fg-3); min-width: 34px; }
.res span { display: grid; gap: 2px; font-size: 15.5px; line-height: 1.35; }
.res .rt { font-style: normal; }
.res small { font-size: 13.5px; color: var(--fg-3); }
.res svg { width: 16px; height: 16px; color: var(--fg-3); transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .res:hover svg { transform: translateX(3px); color: var(--fg); } }
.empty { padding: 48px 0; text-align: center; color: var(--fg-3); font-size: 15px; }

/* Skeleton while the JSON loads */
.sk { display: grid; gap: 14px; padding-top: 6px; }
.sk i { display: block; height: 18px; border-radius: 6px; background: linear-gradient(90deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: sk 1.4s linear infinite; }
.sk .sk-h { width: 46%; height: 40px; margin-bottom: 14px; }
.sk .sk-r:nth-child(odd) { width: 78%; } .sk .sk-r:nth-child(even) { width: 64%; }
@keyframes sk { to { background-position: -300% 0; } }

/* ---------- CEPREUNI ---------- */
.cyc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.cyc-row .seg { width: 252px; }
.cyc-title { margin: 0; font-size: 14px; color: var(--fg-2); }

.next { position: relative; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 16px; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); overflow: hidden; color: var(--fg); text-align: left; font: inherit; transition: background-color 160ms ease, transform 120ms var(--ease-out); }
.next:active { transform: scale(.99); }
.next:disabled { cursor: default; }
.next[aria-pressed="true"] { background: var(--surface-2); }
.nx { display: grid; gap: 3px; min-width: 0; }
.nx .nm { font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.nx .d { font-size: 14px; color: var(--fg-2); }
.nx .d b { color: var(--accent); font-weight: 500; }
.next .go { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; color: var(--fg); }
.next .go svg { width: 16px; height: 16px; transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .next:not(:disabled):hover { background: var(--surface-2); } .next:not(:disabled):hover .go svg { transform: translateX(3px); } }
@media (min-width: 640px) { .next { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.next::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.nx .k { font-size: 12.5px; color: var(--fg-3); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--fg); color: var(--bg); font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none; transition: background-color 160ms ease, transform 120ms var(--ease-out); }
.btn svg { width: 16px; height: 16px; }
.btn.ghost { background: rgba(255, 255, 255, .07); color: var(--fg); }
.btn:active { transform: scale(.97); }

.weeks-wrap { margin: 18px calc(var(--gutter) * -1) 0; }
.weeks { display: flex; gap: 4px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 4px var(--gutter); -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); }
.weeks::-webkit-scrollbar { display: none; }
.wk { position: relative; flex: none; scroll-snap-align: center; display: grid; justify-items: center; gap: 3px; width: 58px; padding: 9px 0 10px; border: 1px solid transparent; border-radius: 14px; background: none; color: var(--fg-2); transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease, transform 120ms var(--ease-out); }
.wk b { font: 600 16px/1 var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.wk small { font-size: 11px; color: var(--fg-3); white-space: nowrap; }
.wk.now::after { content: ""; position: absolute; top: 6px; right: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.wk.past { color: var(--fg-3); }
.wk.inr { background: color-mix(in oklab, var(--accent) 10%, transparent); color: var(--fg); }
.wk[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.wk[aria-pressed="true"] small { color: rgba(8, 8, 10, .55); }
.wk:active { transform: scale(.95); }
.wk-ev { flex: none; align-self: stretch; width: 2px; margin: 8px 1px; border-radius: 2px; background: color-mix(in oklab, var(--accent) 70%, transparent); }
@media (hover: hover) and (pointer: fine) { .wk:not([aria-pressed="true"]):hover { background: rgba(255, 255, 255, .06); color: var(--fg); } }

.w-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 22px 0 6px; }
.w-head h2 { margin: 0; font-size: clamp(28px, 5.4vw, 40px); font-weight: 600; letter-spacing: -.04em; line-height: 1.05; }
.w-head p { margin: 0; font-size: 14.5px; color: var(--fg-2); }
.w-head .tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: color-mix(in oklab, var(--accent) 16%, transparent); color: var(--accent); font-size: 12px; font-weight: 500; }
.w-head .x { margin-left: auto; }
.w-note { margin: 4px 0 0; font-size: 13.5px; color: var(--fg-3); }
.w-body.slide-l { animation: slideL 280ms var(--ease-out); }
.w-body.slide-r { animation: slideR 280ms var(--ease-out); }
@keyframes slideL { from { opacity: 0; transform: translateX(14px); } }
@keyframes slideR { from { opacity: 0; transform: translateX(-14px); } }

.w-sec { margin-top: 26px; }
.w-sec > h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-size: 13px; font-weight: 500; color: var(--fg-3); }
.w-sec > h3::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.w-grid { display: grid; gap: 10px; }
@media (min-width: 700px) { .w-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .w-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.w-card { padding: 16px 18px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.w-card.in { animation: rowIn 360ms var(--ease-out) both; animation-delay: calc(min(var(--k), 10) * 30ms); }
.w-card h4 { margin: 0 0 10px; font-size: 13.5px; font-weight: 500; color: var(--fg-2); }
.w-card ul { display: grid; gap: 8px; }
.w-card li { font-size: 15.5px; line-height: 1.4; overflow-wrap: anywhere; }
.w-card li small { display: inline-block; min-width: 30px; margin-right: 6px; font: 500 11px/1 var(--mono); color: var(--fg-3); }
.w-card .none { color: var(--fg-3); font-size: 14px; }

/* ---------- Actualidad ---------- */
.n-head h2 { margin: 6px 0 4px; font-size: clamp(30px, 6vw, 44px); font-weight: 600; letter-spacing: -.04em; line-height: 1.02; }
.n-head p { margin: 0; max-width: 56ch; font-size: 15px; color: var(--fg-2); }
.n-g { margin-top: 32px; }
.n-g > h3 { margin: 0 0 12px; font-size: 13px; font-weight: 500; color: var(--fg-3); }
.n-grid { display: grid; gap: 8px; }
@media (min-width: 640px) { .n-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .n-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.n-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) 16px; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: background-color 160ms ease, border-color 160ms ease, transform 120ms var(--ease-out); }
.n-card.in { animation: rowIn 360ms var(--ease-out) both; animation-delay: calc(min(var(--k), 10) * 28ms); }
.n-logo { width: 48px; height: 48px; border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); }
.n-logo img { width: 36px; height: 36px; object-fit: contain; }
.n-logo.full img { width: 48px; height: 48px; }
.n-card span { display: grid; gap: 2px; min-width: 0; }
.n-card b { font-size: 15.5px; font-weight: 500; }
.n-card small { font-size: 13px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.n-card > svg { width: 16px; height: 16px; color: var(--fg-3); transition: transform 200ms var(--ease-out), color 160ms ease; }
.n-card:active { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) { .n-card:hover { background: var(--surface-2); border-color: var(--line-2); } .n-card:hover > svg { color: var(--fg); transform: translate(2px, -2px); } }

@media (prefers-reduced-motion: reduce) {
  .js .t-hero h1 .ch { animation: none; opacity: 1; transform: none; filter: none; }
  .view.is-entering, .topic.in, .w-card.in, .n-card.in, .w-body.slide-l, .w-body.slide-r { animation: fadeOnly 160ms ease both; }
  .sk i { animation: none; }
  .seg-pill, .t-body-wrap, .t-detail, .t-chev, .c-prog .bar i { transition-duration: 1ms; }
}
@keyframes fadeOnly { from { opacity: 0; } }

/* Course picker sheet (uses catalogo.css .sheet) */
.pick-t { margin: 4px 0 14px; font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.pick-list { padding-bottom: 8px; }
.pick-list .idx-g h3 { padding-left: 12px; }
.pick-list a { min-height: 48px; font-size: 16px; }
@media (max-width: 380px) { .t-detail { padding-left: 2px; } .t-row { grid-template-columns: 28px minmax(0, 1fr) auto 18px; gap: 10px; } }
.t-hero .stats .g { font-style: normal; white-space: nowrap; }
@media (max-width: 400px) { .seg button { padding: 0 6px; font-size: 14px; } .seg-sm button { padding: 0 10px; font-size: 13.5px; } }
