.portal[data-page="courses"] {
  --academy-ink: #371c2b;
  --academy-paper: #fff8f0;
  --academy-rose: #f4d7ca;
  --academy-line: #d9c3bd;
  --academy-ease: cubic-bezier(.22, .75, .18, 1);
  --academy-space: clamp(3.5rem, 8vw, 8rem);
}
.portal[data-page="courses"] .portal-skip:not(:focus) { clip-path: inset(50%); }

.academy-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  margin-block-start: clamp(1.15rem, 3vw, 3rem);
  padding: clamp(1.7rem, 5.8vw, 6rem);
  overflow: hidden;
  color: var(--academy-paper);
  background: radial-gradient(ellipse at 86% 11%, #683a46, transparent 63%), #301725;
}

.academy-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -40%;
  background: radial-gradient(ellipse closest-side at 67% 43%, #d1847380, transparent);
  animation: academy-light 2.4s var(--academy-ease) both;
  pointer-events: none;
}

.academy-intro > * { animation: academy-reveal .95s var(--academy-ease) both; }
.academy-intro h1 { animation-delay: .1s; }
.academy-intro > p:not(.portal-kicker) { animation-delay: .2s; }
.academy-actions { animation-delay: .3s; }
.academy-intro .portal-kicker { color: #f0c9bd; }
.academy-hero h1 {
  margin-block: .95rem 1.35rem;
  font-size: clamp(3.15rem, 6.45vw, 7.1rem);
  line-height: .86;
  letter-spacing: -.054em;
}
.academy-hero h1 :is(span, em) { display: block; }
.academy-hero h1 em { color: #f2bda9; }
.academy-intro > p:not(.portal-kicker) { max-inline-size: 32rem; color: #f5e2da; }
.academy-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-block-start: 1.55rem; }
.portal .academy-actions .solid-button { color: var(--academy-ink); background: #f4d6c8; border-color: #f4d6c8; }
.portal .academy-actions .solid-button:hover { color: var(--academy-ink); background: #fff2e7; border-color: #fff2e7; }
.portal .academy-actions .outline-button { color: var(--academy-paper); border-color: #cfa79d; }
.portal .academy-actions .outline-button:hover { background: #6a3d49; }
.portal :is(.academy-actions, .reader-top) a { text-decoration: none; }
.academy-hero :focus-visible { outline-color: #ffc7b0; }

.academy-visual { position: relative; min-inline-size: 0; padding: 0 .65rem; }
.academy-visual::before {
  content: "";
  position: absolute;
  inset: -1rem -.2rem 1.45rem;
  border: 1px solid #ecc3af86;
  border-radius: 52% 52% 1.25rem 1.25rem / 44% 44% 1.25rem 1.25rem;
  animation: academy-frame 1.45s .08s var(--academy-ease) both;
}
.academy-photo {
  position: relative;
  aspect-ratio: 1.02;
  overflow: hidden;
  border-radius: 52% 52% .7rem .7rem / 44% 44% .7rem .7rem;
  background: #9c726d;
  animation: academy-photo-in 1.25s var(--academy-ease) both;
}
.academy-photo img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; animation: academy-photo-settle 1.7s var(--academy-ease) both; }
.portal .academy-caption {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding-block-start: .95rem;
  color: #f1d4c7;
  font-size: .78rem;
  letter-spacing: .115em;
  text-transform: uppercase;
  animation: academy-reveal .85s .4s var(--academy-ease) both;
}

.academy-program { margin-block: var(--academy-space); }
.academy-program-intro { display: flex; justify-content: space-between; align-items: end; gap: 1.2rem; padding-block-end: 1.55rem; border-block-end: 1px solid var(--academy-line); }
.academy-program-intro h2 { font-size: clamp(3rem, 5vw, 5.6rem); }
.academy-program-intro h2 em { color: #8b474f; }
.academy-program-intro p { max-inline-size: 27rem; color: var(--portal-muted); }
.academy-modules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  background: var(--academy-line);
  border: 1px solid var(--academy-line);
  border-block-start: 0;
  list-style: none;
  counter-reset: module;
}
.academy-modules li {
  display: grid;
  align-content: start;
  gap: .65rem;
  padding: clamp(1.15rem, 2.55vw, 2.8rem);
  background: var(--portal-paper);
  counter-increment: module;
  transition: background-color .3s ease;
}
.academy-modules li::before { content: counter(module, decimal-leading-zero); color: #8b474f; font-size: .8rem; font-weight: 750; }
.academy-modules li:hover { background: #f6e5db; }
.academy-modules li.is-visible > * { animation: academy-reveal .68s var(--academy-ease) both; }
.academy-modules li.is-visible > p { animation-delay: .07s; }
.academy-modules h3 { font-size: clamp(1.8rem, 3vw, 2.65rem); }
.academy-modules p { color: var(--portal-muted); }

.academy-access {
  grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
  justify-items: center;
  gap: clamp(1.5rem, 6vw, 6rem);
  border: 1px solid var(--academy-line);
  background: #fff8f1;
}
.academy-access-photo {
  inline-size: 100%;
  block-size: 100%;
  min-block-size: 18rem;
  border-radius: 50% 50% .5rem .5rem / 40% 40% .5rem .5rem;
  background: linear-gradient(155deg, #a7636428, #32182775), url('assets/texture.webp') center / cover, #673846;
}
.academy-access .portal-kicker { color: #8c454c; }

.portal .course-library-intro { background: linear-gradient(115deg, #371a29, #5d3040); }
.portal .course-featured {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, .52fr) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: #fff8f1;
  animation: academy-reveal .65s var(--academy-ease) both;
}
.course-featured-image { inline-size: 100%; block-size: 100%; max-block-size: 24rem; object-fit: cover; object-position: center 40%; }
.course-featured-copy { display: grid; align-content: center; gap: .9rem; padding: clamp(1.4rem, 4.4vw, 4.25rem); }
.course-featured-copy .portal-kicker { color: #8b474f; }
.course-featured-copy h2 { font-size: clamp(2.6rem, 5.4vw, 5.1rem); }
.course-featured-copy button { margin-block-start: .3rem; }

.academy-reader { margin-block-start: clamp(1.25rem, 3vw, 2.5rem); }
.reader-top { display: flex; flex-wrap: wrap; gap: .65rem; justify-content: space-between; }
.reader-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.3rem 2rem;
  margin-block: 1rem;
  padding: clamp(1.4rem, 4.5vw, 4rem);
  background: linear-gradient(110deg, #351827, #593142);
  color: var(--academy-paper);
  animation: academy-reveal .65s var(--academy-ease) both;
}
.reader-head .portal-kicker { color: #efc3b6; }
.reader-head h1 { max-inline-size: 18ch; margin-block-start: .45rem; font-size: clamp(2.6rem, 5.5vw, 5.5rem); line-height: .9; }
.reader-progress { flex: 0 1 15rem; margin-block-end: .1rem; }
.reader-progress label { display: flex; justify-content: space-between; gap: .65rem; color: #fff2e9; font-size: .88rem; }
.reader-progress progress { display: block; inline-size: 100%; block-size: .4rem; margin-block-start: .55rem; appearance: none; border: 0; border-radius: 2rem; background: #785463; accent-color: #f2bda9; overflow: hidden; }
.reader-progress progress::-webkit-progress-bar { background: #785463; }
.reader-progress progress::-webkit-progress-value { background: #f2bda9; transition: width .35s var(--academy-ease); }
.reader-progress progress::-moz-progress-bar { background: #f2bda9; }
.reader-layout { display: grid; grid-template-columns: minmax(14rem, .34fr) minmax(0, 1fr); align-items: start; gap: clamp(.85rem, 2.7vw, 2.15rem); }
.reader-outline { position: sticky; inset-block-start: 1rem; min-inline-size: 0; }
.reader-outline > details { background: #fff8f1; border: 1px solid var(--academy-line); }
.reader-outline summary { list-style: none; cursor: pointer; }
.reader-outline summary::-webkit-details-marker { display: none; }
.reader-outline > details > summary { padding: .95rem 1rem; font-weight: 740; }
.reader-outline summary::after {
  content: "";
  flex: 0 0 .45rem;
  inline-size: .45rem;
  block-size: .45rem;
  margin-inline-start: auto;
  border-inline-end: 1px solid currentColor;
  border-block-end: 1px solid currentColor;
  rotate: 45deg;
  transition: rotate .25s ease;
}
.reader-outline details[open] > summary::after { rotate: 225deg; }
.reader-outline summary { display: flex; align-items: center; gap: .6rem; }
[data-reader-modules] { max-block-size: min(64vh, 41rem); overflow-y: auto; scrollbar-color: #cba6a4 transparent; }
.reader-group { border-block-start: 1px solid var(--academy-line); }
.reader-group summary { padding: .65rem .85rem; font-size: .875rem; font-weight: 700; }
.reader-group-number { flex: 0 0 1.3rem; color: #88535c; font-size: .75rem; }
.reader-group ol { list-style: none; margin: 0; padding: 0 0 .55rem; }
.reader-group button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1em;
  gap: .2rem;
  align-items: start;
  inline-size: 100%;
  min-block-size: 2.5rem;
  padding: .47rem .75rem .47rem 1.45rem;
  border: 0;
  border-inline-start: 2px solid transparent;
  background: transparent;
  color: var(--academy-ink);
  font-size: .83rem;
  line-height: 1.35;
  text-align: start;
}
.reader-group button span { color: #795343; text-align: center; }
.reader-group button:is(:hover, [aria-current]) { background: #f6e6db; }
.reader-group button[aria-current] { border-color: #9a4755; font-weight: 750; }
.reader-group button:focus-visible, .reader-outline summary:focus-visible { outline-offset: -3px; }
.reader-stage { min-inline-size: 0; }
.reader-stage-heading { padding-block: .25rem .85rem; }
.reader-stage-heading .portal-kicker { margin-block-end: .32rem; color: #8b474f; }
.reader-stage-heading h2 { line-height: 1.06; }
.portal .reader-slide {
  position: relative;
  display: block;
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--academy-line);
  background: linear-gradient(120deg,#ead7ce,#faf1e9);
  cursor: zoom-in;
}
.portal .reader-slide:disabled { cursor: wait; opacity: 1; }
.reader-slide-track, .reader-slide-track img { display: block; inline-size: 100%; block-size: 100%; }
.reader-slide-track img { object-fit: contain; animation: academy-slide-in .48s var(--academy-ease) both; }
.reader-zoom-label {
  position: absolute;
  inset: auto .65rem .65rem auto;
  padding: .36rem .72rem;
  border-radius: 2rem;
  color: #fff8f1;
  background: #381a29ed;
  font-size: .78rem;
  opacity: 0;
  translate: 0 .3rem;
  transition: translate .2s ease, opacity .2s ease;
}
.reader-slide:not(:disabled):is(:hover, :focus-visible) .reader-zoom-label { opacity: 1; translate: 0; }
.reader-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .45rem; padding-block: .9rem; color: var(--portal-muted); font-size: .88rem; }
.reader-controls [data-reader-next] { justify-self: end; }
.reader-completion { padding-block: .8rem; border-block-start: 1px solid var(--academy-line); }
.reader-completion button[aria-pressed="true"] { color: #5c343d; background: #f1dcd2; border-color: #9c6e6d; }
[data-reader-slide-status]:not(:empty), #reader-status:not(:empty) { margin-block: .65rem; }
.portal .reader-lightbox {
  inline-size: min(96vw, 106rem);
  max-inline-size: none;
  max-block-size: 94dvh;
  padding: 0;
  border: 1px solid #a9797e;
  background: #3b1e2d;
  color: var(--academy-paper);
  overflow: hidden;
}
.reader-lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); animation: academy-reveal .34s var(--academy-ease) both; }
.reader-lightbox::backdrop { background: #1c0e16df; }
.reader-lightbox-bar, .reader-lightbox-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.reader-lightbox-bar { padding: .65rem clamp(.65rem, 2vw, 1.2rem); }
.reader-lightbox-bar p { font-size: .9rem; }
.portal .reader-lightbox .outline-button { color: var(--academy-paper); border-color: #b99290; }
.portal .reader-lightbox .outline-button:hover { color: var(--academy-ink); }
.reader-lightbox-body { overflow: auto; overscroll-behavior: contain; background: #24111d; }
.reader-lightbox-body img { display: block; inline-size: 100%; block-size: auto; max-block-size: 80dvh; margin: auto; object-fit: contain; }
.reader-lightbox-body.is-enlarged img { inline-size: max(168%, 58rem); max-inline-size: none; max-block-size: none; }

@keyframes academy-reveal {
  from { opacity: 0; transform: translateY(1rem); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes academy-light {
  from { opacity: .1; transform: translate(12%, 8%); }
  to { opacity: .8; transform: translate(0, 0); }
}
@keyframes academy-frame {
  from { opacity: 0; transform: translateY(.9rem) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes academy-photo-in {
  from { opacity: 0; clip-path: inset(13% 10% 2% round 45% 45% 1rem 1rem); }
  to { opacity: 1; clip-path: inset(0 round 0); }
}
@keyframes academy-photo-settle { from { transform: scale(1.11); } to { transform: scale(1); } }
@keyframes academy-slide-in {
  from { opacity: .2; transform: translateX(calc(var(--slide-direction, 1) * 1.1rem)) scale(.996); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@media (min-width: 57.01rem) {
  .reader-outline > details > summary { display: none; }
}
@media (max-width: 57rem) {
  .reader-layout { grid-template-columns: minmax(0, 1fr); }
  .reader-outline { position: static; }
  [data-reader-modules] { max-block-size: 49vh; }
  .academy-hero h1 { font-size: clamp(3rem, 7.1vw, 5.75rem); }
  .academy-modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 42rem) {
  .academy-hero { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .academy-hero h1 { font-size: clamp(2.8rem, 10.1vw, 5rem); }
  .academy-visual { inline-size: min(100%, 24rem); justify-self: center; }
  .academy-program-intro { flex-direction: column; align-items: start; }
  .academy-access { grid-template-columns: minmax(0, 1fr); }
  .academy-access-photo { display: none; }
  .portal .course-featured { grid-template-columns: minmax(0, 1fr); }
  .course-featured-image { max-block-size: 13rem; }
}
@media (max-width: 30rem) {
  .academy-modules { grid-template-columns: minmax(0, 1fr); }
  .reader-controls { font-size: .8rem; }
  .reader-controls :is(.outline-button, .solid-button) { padding-inline: .8rem; }
}
@media (hover: none) {
  .reader-slide:not(:disabled) .reader-zoom-label { opacity: 1; translate: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .portal[data-page="courses"] *, .portal[data-page="courses"] *::before, .portal[data-page="courses"] *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
