:root {
  --portal-navy: #071a2b;
  --portal-ink: #17354a;
  --portal-muted: #63798a;
  --portal-cyan: #63ddff;
  --portal-purple: #7553d7;
  --portal-surface: #f4f8fb;
  --portal-border: #dce7ee;
}

.portal-body {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--portal-ink);
  background: #f5f9fb;
  font-family: Aptos, "Segoe UI Variable", "Segoe UI", sans-serif;
}

.portal-body.menu-open {
  overflow: hidden;
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 74px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid rgba(22, 68, 99, .12);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 30px rgba(15, 47, 70, .07);
  backdrop-filter: blur(18px);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-brand > img {
  width: 178px;
}

.portal-brand > span {
  padding-left: 12px;
  display: grid;
  border-left: 1px solid #d4e0e7;
  line-height: 1.05;
}

.portal-brand strong {
  color: var(--uam-blue);
  font-size: .86rem;
  letter-spacing: .08em;
}

.portal-brand small {
  color: #718290;
  font-size: .66rem;
}

.portal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.portal-nav a {
  position: relative;
  padding: 10px 13px;
  border-radius: 10px;
  color: #4b6374;
  font-size: .82rem;
  font-weight: 800;
  white-space: nowrap;
}

.portal-nav a:hover,
.portal-nav a:focus-visible {
  color: var(--uam-blue);
  background: #edf5fa;
}

.portal-nav a[aria-current="page"] {
  color: #fff;
  background: linear-gradient(135deg, var(--uam-blue), #4c6dc4);
  box-shadow: 0 8px 20px rgba(33, 89, 156, .18);
}

.portal-roles {
  display: flex;
  align-items: center;
  gap: 7px;
}

.portal-roles a {
  padding: 8px 11px;
  border: 1px solid #d4e0e7;
  border-radius: 9px;
  color: #3f5a6d;
  font-size: .75rem;
  font-weight: 850;
}

.portal-roles a:last-child {
  color: #fff;
  border-color: #0c334f;
  background: #0c334f;
}

.portal-menu-toggle {
  display: none;
}

.portal-main {
  min-height: 0;
}

.portal-home {
  position: relative;
  min-height: calc(100dvh - 112px);
  padding: clamp(30px, 5vh, 60px) clamp(24px, 5vw, 76px) 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .78fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 24px 5vw;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(108deg, rgba(4, 19, 33, .98) 0%, rgba(8, 33, 54, .95) 48%, rgba(21, 43, 75, .88) 100%),
    var(--hero-image);
  background-position: center;
  background-size: cover;
}

.portal-home::before {
  position: absolute;
  inset: 0;
  opacity: .24;
  background-image:
    linear-gradient(rgba(114, 221, 255, .15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(114, 221, 255, .15) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(90deg, #000, transparent 72%);
  content: "";
  pointer-events: none;
}

.portal-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .22;
  pointer-events: none;
  animation: portal-glow 9s ease-in-out infinite alternate;
}

.glow-one {
  top: -160px;
  left: 26%;
  background: #23c9ff;
}

.glow-two {
  right: -190px;
  bottom: -180px;
  background: #b550ff;
  animation-delay: -4s;
}

.portal-home-copy {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.portal-eyebrow {
  margin: 0 0 10px;
  color: #28a7d2;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.portal-home .portal-eyebrow {
  color: #70e4ff;
}

.portal-home h1 {
  max-width: 680px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.45rem, 5vw, 4.8rem);
  font-weight: 780;
  letter-spacing: -.055em;
  line-height: .94;
  text-wrap: balance;
}

.portal-home-copy > p:not(.portal-eyebrow) {
  max-width: 640px;
  margin: 20px 0 0;
  color: #bfd3df;
  font-size: clamp(.95rem, 1.35vw, 1.12rem);
  line-height: 1.6;
}

.portal-home-actions {
  margin-top: 25px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-home-actions a {
  min-height: 44px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  border-radius: 11px;
  font-size: .84rem;
  font-weight: 900;
}

.portal-primary-action {
  color: #072033;
  background: #73e5ff;
  box-shadow: 0 12px 28px rgba(75, 213, 248, .2);
}

.portal-secondary-action {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .07);
}

.portal-home-actions a:hover,
.portal-home-actions a:focus-visible {
  outline: 3px solid rgba(103, 226, 255, .2);
  outline-offset: 3px;
  transform: translateY(-2px);
}

.portal-trust {
  margin-top: 25px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.portal-trust span {
  color: #8ea9ba;
  font-size: .72rem;
}

.portal-trust strong {
  margin-right: 4px;
  color: #fff;
}

.panther-stage {
  position: relative;
  z-index: 2;
  width: min(100%, 530px);
  height: min(57vh, 540px);
  min-height: 390px;
  justify-self: end;
  overflow: hidden;
  border: 1px solid rgba(109, 223, 255, .25);
  border-radius: 38% 38% 24px 24px;
  background:
    radial-gradient(circle at 48% 40%, rgba(29, 165, 234, .3), transparent 45%),
    rgba(4, 18, 32, .45);
  box-shadow: inset 0 0 50px rgba(60, 196, 255, .08), 0 34px 80px rgba(0, 0, 0, .24);
}

.panther-stage > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 36%;
  animation: panther-breathe 5s ease-in-out infinite;
}

.panther-stage::after {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(transparent, rgba(3, 17, 29, .96));
  content: "";
}

.panther-message {
  position: absolute;
  right: 20px;
  bottom: 18px;
  left: 20px;
  z-index: 2;
  padding: 15px 16px;
  display: grid;
  gap: 3px;
  border: 1px solid rgba(114, 226, 255, .28);
  border-radius: 15px;
  background: rgba(7, 28, 46, .84);
  backdrop-filter: blur(13px);
}

.panther-message small {
  color: #70e4ff;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.panther-message strong {
  color: #fff;
  font-size: 1rem;
}

.panther-message span {
  color: #a9c0ce;
  font-size: .76rem;
}

.portal-launcher {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.portal-launcher a {
  min-width: 0;
  min-height: 76px;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .055);
  backdrop-filter: blur(12px);
}

.portal-launcher a:hover,
.portal-launcher a:focus-visible {
  border-color: rgba(106, 224, 255, .45);
  background: rgba(68, 170, 220, .12);
  transform: translateY(-3px);
}

.portal-launcher > a > span {
  color: #6fe3ff;
  font-size: .68rem;
  font-weight: 900;
}

.portal-launcher div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.portal-launcher strong {
  overflow: hidden;
  color: #fff;
  font-size: .88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-launcher small {
  overflow: hidden;
  color: #92aaba;
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-launcher i {
  color: #6fe3ff;
  font-style: normal;
}

.portal-workspace {
  width: min(1440px, calc(100% - 40px));
  min-height: calc(100dvh - 112px);
  margin: 0 auto;
  padding: 28px 0 36px;
}

.workspace-heading {
  position: relative;
  min-height: 112px;
  margin-bottom: 18px;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .75fr);
  align-items: center;
  gap: 30px;
  overflow: hidden;
  border: 1px solid var(--portal-border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 20%, rgba(79, 209, 246, .13), transparent 30%),
    #fff;
  box-shadow: 0 14px 35px rgba(22, 59, 84, .07);
}

.workspace-heading h1 {
  margin: 0;
  color: #12364f;
  font-size: clamp(1.75rem, 3vw, 2.85rem);
  font-weight: 780;
  letter-spacing: -.04em;
  line-height: 1;
}

.workspace-heading p:not(.portal-eyebrow) {
  max-width: 680px;
  margin: 9px 0 0;
  color: var(--portal-muted);
  font-size: .88rem;
}

.compact-search {
  position: relative;
  min-height: 48px;
  padding: 5px 5px 5px 14px;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 9px;
  border: 1px solid #cedce4;
  border-radius: 999px;
  background: #f8fbfd;
}

.compact-search > img {
  width: 18px;
}

.compact-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: #19394f;
  background: transparent;
  font-size: .84rem;
}

.compact-search button {
  height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--uam-blue);
  font-size: .78rem;
  font-weight: 850;
  cursor: pointer;
}

.compact-search .search-results {
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  width: 100%;
}

.workspace-controls {
  min-height: 52px;
  margin-bottom: 16px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--portal-border);
  border-radius: 14px;
  background: #fff;
}

.workspace-controls .view-selector {
  display: flex;
  gap: 4px;
}

.workspace-controls .view-selector button {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  color: #5b7180;
  background: #edf4f8;
  font-size: .74rem;
  cursor: pointer;
}

.workspace-controls .view-selector button.active {
  color: #fff;
  background: #133b57;
}

.workspace-controls .filter-group {
  flex-wrap: nowrap;
  overflow-x: auto;
}

.workspace-controls .filter-chip {
  padding: 7px 10px;
  flex: 0 0 auto;
  font-size: .7rem;
}

.compact-course-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.compact-course-grid .catalog-course-card {
  min-height: 254px;
  display: grid;
  grid-template-columns: 42% 58%;
  border-top-width: 3px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(26, 63, 88, .08);
}

.compact-course-grid .course-cover {
  height: 100%;
  min-height: 254px;
}

.compact-course-grid .course-year {
  top: 10px;
  right: 10px;
}

.compact-course-grid .course-category {
  right: 10px;
  bottom: 10px;
  left: 10px;
  font-size: .6rem;
}

.compact-course-grid .course-card-body {
  min-width: 0;
  padding: 17px;
}

.compact-course-grid .course-instructor {
  margin-bottom: 5px;
  overflow: hidden;
  font-size: .67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-course-grid .course-card-body h2 {
  min-height: 0;
  margin: 0 0 8px;
  color: #193b52;
  font-family: inherit;
  font-size: 1.04rem;
  font-weight: 820;
  line-height: 1.2;
}

.compact-course-grid .course-summary {
  min-height: 0;
  margin-bottom: 10px;
  display: -webkit-box;
  overflow: hidden;
  color: #647988;
  font-size: .72rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.compact-course-grid .course-meta {
  padding: 8px 0;
  gap: 10px;
  font-size: .65rem;
}

.compact-course-grid .course-enter {
  margin-top: 9px;
  font-size: .75rem;
}

.workspace-note {
  padding: 14px 16px;
  display: grid;
  gap: 3px;
  border: 1px solid #d8e6ed;
  border-radius: 13px;
  color: #526b7b;
  background: #f3f9fb;
}

.workspace-note span {
  color: #2185ad;
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.workspace-note strong {
  color: #25485f;
  font-size: .78rem;
}

.compact-library-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.compact-library-grid .library-card {
  min-height: 244px;
  grid-template-columns: 37% 63%;
  grid-template-rows: 1fr;
  border: 1px solid var(--portal-border);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(25, 63, 88, .07);
}

.compact-library-grid .library-copy {
  min-width: 0;
  padding: 17px;
}

.compact-library-grid .library-copy h2 {
  margin: 0 0 8px;
  color: #183b52;
  font-size: 1rem;
  line-height: 1.2;
}

.compact-library-grid .library-copy > p:nth-of-type(2) {
  margin-bottom: 13px;
  display: -webkit-box;
  overflow: hidden;
  font-size: .72rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.compact-library-grid .library-downloads a {
  padding: 7px 9px;
  border-radius: 7px;
  font-size: .66rem;
}

.tools-workspace .workspace-heading {
  grid-template-columns: 1fr 140px;
}

.tools-panther {
  position: absolute;
  right: 18px;
  bottom: -56px;
  width: 165px;
  height: 165px;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 50%;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tool-card {
  min-height: 190px;
  padding: 22px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: start;
  gap: 13px;
  border: 1px solid var(--portal-border);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(48, 192, 236, .06), transparent 40%),
    #fff;
  box-shadow: 0 12px 32px rgba(23, 61, 87, .07);
}

.tool-card > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #0d425e;
  background: #87e7fa;
  font-size: .72rem;
  font-weight: 900;
}

.tool-card small {
  color: #388aad;
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tool-card h2 {
  margin: 5px 0 8px;
  color: #173a51;
  font-size: 1.18rem;
}

.tool-card p {
  margin: 0;
  color: #607686;
  font-size: .82rem;
  line-height: 1.55;
}

.tool-card > a {
  align-self: end;
  color: #17658d;
  font-size: .74rem;
  font-weight: 900;
  white-space: nowrap;
}

.tool-card > a i {
  margin-left: 6px;
  font-style: normal;
}

.portal-footer {
  min-height: 38px;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #6d8291;
  background: #fff;
  font-size: .68rem;
}

.portal-footer nav {
  display: flex;
  gap: 15px;
}

.portal-footer a:hover,
.portal-footer a:focus-visible {
  color: var(--uam-blue);
}

@keyframes panther-breathe {
  0%, 100% { transform: scale(1.01); }
  50% { transform: scale(1.035) translateY(-3px); }
}

@keyframes portal-glow {
  from { transform: translate3d(-20px, -10px, 0) scale(.9); }
  to { transform: translate3d(24px, 18px, 0) scale(1.08); }
}

@media (max-width: 1180px) {
  .portal-header {
    gap: 14px;
  }

  .portal-brand > img {
    width: 145px;
  }

  .portal-brand > span {
    display: none;
  }

  .portal-nav a {
    padding-inline: 9px;
    font-size: .76rem;
  }

  .compact-course-grid,
  .compact-library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .portal-header {
    min-height: 64px;
    grid-template-columns: auto 1fr auto;
    padding: 0 14px;
  }

  .portal-menu-toggle {
    display: block;
    grid-column: 3;
    grid-row: 1;
  }

  .portal-nav {
    position: fixed;
    top: 64px;
    right: 0;
    left: 0;
    padding: 12px;
    display: grid;
    visibility: hidden;
    opacity: 0;
    background: #fff;
    box-shadow: 0 18px 30px rgba(17, 51, 75, .15);
    transform: translateY(-10px);
  }

  .portal-header.nav-open .portal-nav {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .portal-roles {
    margin-left: auto;
    grid-column: 2;
    grid-row: 1;
  }

  .portal-home {
    min-height: calc(100dvh - 102px);
    padding: 32px 24px 20px;
    grid-template-columns: 1fr 40%;
    gap: 20px;
  }

  .panther-stage {
    height: 46vh;
    min-height: 330px;
  }

  .portal-launcher {
    grid-template-columns: 1fr;
  }

  .portal-launcher a {
    min-height: 62px;
  }

  .workspace-heading {
    grid-template-columns: 1fr;
  }

  .workspace-controls {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .course-count {
    margin-left: auto;
  }
}

@media (max-width: 700px) {
  .portal-roles a {
    display: none;
  }

  .portal-roles a:first-child {
    display: block;
  }

  .portal-home {
    min-height: auto;
    padding: 30px 18px 20px;
    grid-template-columns: 1fr;
  }

  .portal-home h1 {
    font-size: clamp(2.4rem, 14vw, 4rem);
  }

  .panther-stage {
    width: 100%;
    height: 390px;
    min-height: 0;
    justify-self: center;
    border-radius: 22px;
  }

  .portal-launcher {
    grid-column: 1;
  }

  .portal-workspace {
    width: calc(100% - 24px);
    padding-top: 14px;
  }

  .workspace-heading {
    padding: 17px;
    gap: 18px;
  }

  .compact-course-grid,
  .compact-library-grid,
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .compact-course-grid .catalog-course-card,
  .compact-library-grid .library-card {
    min-height: 218px;
  }

  .compact-course-grid .course-cover {
    min-height: 218px;
  }

  .tool-card {
    grid-template-columns: 42px 1fr;
  }

  .tool-card > a {
    grid-column: 2;
  }

  .portal-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 440px) {
  .portal-brand > img {
    width: 126px;
  }

  .portal-trust {
    gap: 10px;
    flex-direction: column;
  }

  .panther-stage {
    height: 330px;
  }

  .compact-course-grid .catalog-course-card,
  .compact-library-grid .library-card {
    grid-template-columns: 39% 61%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-glow,
  .panther-stage > img {
    animation: none;
  }
}
