/* ---------- Page setup ---------- */
/* The safe-area padding keeps the page clear of a phone's notch and home bar. */
:root {
    color-scheme: light;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

img {
    max-width: 100%;
}

[hidden]:not([hidden="until-found" i]) {
    display: none !important;
}

/* ---------- Colors and fonts: light, then dark ---------- */
/* Dark mode follows the system unless the theme button has set data-theme,
   which is why the dark values appear twice. */
:root {
    --bg: #F3F7FC;
    --surface: #FFFFFF;
    --ink: #0B1730;
    --muted: #4A5873;
    --line: #D6E0ED;
    --sky: #225CAB;
    --gold: #FFCD34;
    --gold-soft: #FFF4D1;
    --focus: #225CAB;
    --hero-bg: #001441;
    --hero-ink: #FFFFFF;
    --hero-muted: #B9CBE8;
    --cat-1: #225CAB;
    --cat-1-bg: #E6EEF9;
    --cat-2: #FFC72C;
    --cat-2-edge: #8C6400;
    --cat-2-bg: #FFF3CC;
    --cat-5: #5E6E86;
    --cat-5-bg: #EEF1F5;
    --cat-4: #1A7757;
    --cat-4-bg: #E1F4EC;
    --cat-3: #6A4FB3;
    --cat-3-bg: #EEE9FA;
    --new: #B4232F;
    --rh: #C00000;
    --rh-bg: #FDECEC;
    --shadow: 0 1px 2px rgba(0, 20, 65, .06), 0 4px 14px rgba(0, 20, 65, .06);
    --f-display: "Saira", "Arial Narrow", system-ui, sans-serif;
    --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #06102A;
        --surface: #0E1C3D;
        --ink: #E8EEF8;
        --muted: #A3B2CC;
        --line: #22345C;
        --sky: #7DA8EC;
        --gold-soft: #2E2510;
        --focus: #FFCD34;
        --hero-bg: #000A22;
        --hero-ink: #FFFFFF;
        --hero-muted: #A9BCDD;
        --cat-1: #7DA8EC;
        --cat-1-bg: #132A55;
        --cat-2: #FFC72C;
        --cat-2-edge: #FFC72C;
        --cat-2-bg: #33290C;
        --cat-5: #A3B2CC;
        --cat-5-bg: #1A2747;
        --cat-4: #5CCB9F;
        --cat-4-bg: #0F3328;
        --cat-3: #B7A3FF;
        --cat-3-bg: #251C4A;
        --new: #FF8A94;
        --rh: #FF6B6B;
        --rh-bg: #3A1418;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #06102A;
    --surface: #0E1C3D;
    --ink: #E8EEF8;
    --muted: #A3B2CC;
    --line: #22345C;
    --sky: #7DA8EC;
    --gold-soft: #2E2510;
    --focus: #FFCD34;
    --hero-bg: #000A22;
    --hero-ink: #FFFFFF;
    --hero-muted: #A9BCDD;
    --cat-1: #7DA8EC;
    --cat-1-bg: #132A55;
    --cat-2: #FFC72C;
    --cat-2-edge: #FFC72C;
    --cat-2-bg: #33290C;
    --cat-5: #A3B2CC;
    --cat-5-bg: #1A2747;
    --cat-4: #5CCB9F;
    --cat-4-bg: #0F3328;
    --cat-3: #B7A3FF;
    --cat-3-bg: #251C4A;
    --new: #FF8A94;
    --rh: #FF6B6B;
    --rh-bg: #3A1418;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
}

/* ---------- category colour slots ---------- */
/* A plan gives each category a slot, 1 to 5; the slot carries its colour, its
   shape and what reads on top of it. BlueSky: core 1, AI 2, elective 3,
   internship 4, gen ed 5. The shapes run from most sides to fewest, then the
   circle: pentagon, diamond, square, triangle, circle. Components read the
   --c-* values; --c-ring outlines a colour too light to stand on its own in
   the semester meters. */
.cat-1 {
    --c: var(--cat-1);
    --c-ring: none;
    --c-bg: var(--cat-1-bg);
    --c-edge: var(--cat-1);
    --c-ink: var(--cat-1);
    --c-on: #fff;
    --c-radius: 0;
    --c-clip: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%)
}

.cat-2 {
    --c: var(--cat-2);
    --c-ring: inset 0 0 0 1.5px var(--cat-2-edge);
    --c-bg: var(--cat-2-bg);
    --c-edge: var(--cat-2-edge);
    --c-ink: var(--ink);
    --c-on: #001441;
    --c-radius: 0;
    --c-clip: polygon(50% 0, 100% 50%, 50% 100%, 0 50%)
}

.cat-3 {
    --c: var(--cat-3);
    --c-ring: none;
    --c-bg: var(--cat-3-bg);
    --c-edge: var(--cat-3);
    --c-ink: var(--cat-3);
    --c-on: #fff;
    --c-radius: 2px;
    --c-clip: none
}

.cat-4 {
    --c: var(--cat-4);
    --c-ring: none;
    --c-bg: var(--cat-4-bg);
    --c-edge: var(--cat-4);
    --c-ink: var(--cat-4);
    --c-on: #fff;
    --c-radius: 0;
    --c-clip: polygon(50% 0, 100% 100%, 0 100%)
}

.cat-5 {
    --c: var(--cat-5);
    --c-ring: none;
    --c-bg: var(--cat-5-bg);
    --c-edge: var(--cat-5);
    --c-ink: var(--ink);
    --c-on: #fff;
    --c-radius: 50%;
    --c-clip: none
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px
}

@media (prefers-reduced-motion:reduce) {
    html {
        scroll-behavior: auto
    }

    * {
        transition: none !important;
        animation: none !important
    }
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--f-body);
    font-size: 1.0625rem;
    line-height: 1.6
}

h1,
h2,
h3,
h4 {
    font-family: var(--f-display);
    line-height: 1.1;
    text-wrap: balance;
    margin: 0
}

p {
    margin: 0
}

.wrap {
    max-width: 1160px;
    margin-inline: auto;
    /* viewport-fit=cover lets the navy bands run under a notch; the text stays clear of it */
    padding-inline: max(20px, env(safe-area-inset-left, 0px)) max(20px, env(safe-area-inset-right, 0px))
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

.nowrap {
    white-space: nowrap
}

/* Off-screen until tabbed to, then a gold pill over the rail (as on the hub) */
.skip-link {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + .5rem);
    left: -100vw;
    z-index: 100;
    background: var(--gold);
    color: #001441;
    font-weight: 600;
    font-size: .88rem;
    padding: .6rem 1.1rem;
    border-radius: 4px;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .35)
}

.skip-link:focus {
    left: .5rem
}

main:focus,
[tabindex="-1"]:focus {
    outline: none
}

.eyebrow {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .8rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--sky)
}

a {
    color: var(--sky)
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 4px
}

/* ---------- Rail ---------- */
.rail {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line)
}

.rail .wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-block: 10px
}

.rail-brand {
    font-family: var(--f-display);
    font-weight: 800;
    letter-spacing: .06em;
    color: var(--sky);
    font-size: 1rem;
    white-space: nowrap;
    text-decoration: none
}

.hero-eyebrow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 12px
}

.hero-eyebrow .sep {
    width: 1.5px;
    height: 1.1em;
    background: currentColor;
    opacity: .55
}

.rail nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    min-width: 0;
    flex: 1
}

.theme-btn {
    flex: none;
    margin-left: auto;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid transparent;
    background: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0
}

.theme-btn:hover {
    border-color: var(--line);
    color: var(--ink)
}

.theme-btn .spin {
    transform-origin: 12px 12px;
    transition: transform .5s cubic-bezier(.5, 0, .2, 1)
}

.theme-btn.dark .spin {
    transform: rotate(180deg)
}

.rail nav::-webkit-scrollbar {
    display: none
}

.rail nav a {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .85rem;
    text-decoration: none;
    color: var(--muted);
    padding: 5px 11px;
    border-radius: 999px;
    white-space: nowrap;
    border: 1px solid transparent
}

.rail nav a:hover {
    color: var(--ink);
    border-color: var(--line)
}

.rail nav a.on {
    background: var(--sky);
    color: var(--surface)
}

/* The nav scrolls sideways and is exactly as tall as its links, so a ring outside them is clipped */
.rail nav a:focus-visible {
    outline-offset: -3px
}

.rail nav a.on:focus-visible {
    outline-color: var(--surface)
}

.rail {
    transition: transform .25s ease
}

.rail.hide {
    transform: translateY(calc(-100% - env(safe-area-inset-top, 0px)))
}

.rail:focus-within {
    transform: none
}

/* Up to 600px, not 520: from 521px a long title ("Information Systems · BA")
   left the section nav narrower than its own "Degree plan" link, so no
   scrolling could show that link whole. */
@media (max-width:600px) {
    .rail-brand {
        display: none
    }
}

/* ---------- Programs menu ---------- */
/* A button at the start of the bar and a panel from the left edge: a different
   kind of control from the section links beside it. The panel is a popover, so
   the browser opens it, closes it on Escape or a click outside, and handles
   focus, with no script of ours. */
.programs-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: .85rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 13px 6px 10px;
    cursor: pointer
}

.programs-btn:hover {
    border-color: var(--sky);
    color: var(--sky)
}

/* Back to the hub: the Programs button's shape, first in the bar, so the way
   out of these pages is where the eye starts. A link, not a button, because
   it goes somewhere. */
.hub-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: .85rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 13px 6px 10px;
    text-decoration: none;
    white-space: nowrap
}

.hub-btn:hover {
    border-color: var(--sky);
    color: var(--sky)
}

@media (max-width:520px) {
    .programs-btn,
    .hub-btn {
        padding: 8px
    }

    .hub-word,
    .programs-word {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap
    }
}

.programs-panel {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(23rem, 88vw);
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-right: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 10px 40px rgba(0, 20, 65, .25);
    padding-block: calc(18px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-bottom, 0px));
    padding-inline: max(20px, env(safe-area-inset-left, 0px)) 20px;
    overflow-y: auto;
    transition: transform .22s ease, overlay .22s allow-discrete, display .22s allow-discrete;
    transform: translateX(-100%)
}

.programs-panel:popover-open {
    transform: none
}

@starting-style {
    .programs-panel:popover-open {
        transform: translateX(-100%)
    }
}

.programs-panel::backdrop {
    background: rgba(0, 10, 34, .45)
}

@media (prefers-reduced-motion: reduce) {
    .programs-panel {
        transition: none
    }
}

.programs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--line);
    margin-bottom: 6px
}

.programs-head h2 {
    font-size: 1.5rem;
    font-weight: 800
}

.programs-close {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: none;
    color: var(--muted);
    cursor: pointer
}

.programs-close:hover {
    color: var(--ink);
    border-color: var(--sky)
}

.programs-campus {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .76rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 20px 0 8px
}

.programs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px
}

.programs-list a {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none
}

.programs-list a:hover {
    border-color: var(--sky)
}

.programs-list a b {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2
}

.programs-list a span {
    font-size: .88rem;
    color: var(--muted)
}

.programs-list .here {
    font-style: normal;
    font-family: var(--f-mono);
    font-size: .74rem;
    font-weight: 600;
    color: var(--sky);
    margin-top: 4px
}

.programs-list a[aria-current="page"] {
    border-color: var(--sky);
    background: color-mix(in srgb, var(--sky) 10%, var(--surface));
    box-shadow: inset 4px 0 0 var(--sky)
}

@media (forced-colors: active) {
    .programs-list a[aria-current="page"] {
        border-width: 3px
    }
}

/* ---------- Hero ---------- */
.hero {
    background: var(--hero-bg);
    color: var(--hero-ink);
    position: relative;
    overflow: hidden
}

.hero .wrap {
    position: relative;
    z-index: 1;
    padding-block: 44px 56px;
    display: grid;
    gap: 34px
}

.logo-plate {
    background: #FFFFFF;
    border-radius: 14px;
    padding: 12px 18px;
    width: max-content;
    max-width: 100%
}

.logo-plate img {
    display: block;
    height: 74px;
    width: auto;
    max-width: 100%
}

.hero .eyebrow {
    color: var(--gold)
}

.hero h1 {
    font-size: clamp(2.3rem, 6vw, 4.4rem);
    font-weight: 800;
    letter-spacing: -.01em;
    margin-top: 10px
}

.hero h1 span {
    display: block;
    font-weight: 600;
    font-size: .46em;
    color: var(--hero-muted);
    letter-spacing: .01em;
    margin-top: 12px
}

.hero-lede {
    max-width: 62ch;
    color: var(--hero-muted);
    font-size: 1.12rem;
    margin-top: 18px
}

/* A link on the navy hero: the hero's own ink, underlined in gold, so it reads as a link without the sky blue. */
.hero-lede a {
    color: var(--hero-ink);
    text-decoration: underline;
    text-decoration-color: var(--gold);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px
}

.hero-lede a:hover {
    color: var(--gold)
}

/* The hero is navy in both themes, where light mode's sky-blue ring is 2.71:1
   (/is-ba/'s minor links); gold is about 11.9:1 there. */
.hero :focus-visible {
    outline-color: var(--gold)
}

.hero-lede strong {
    color: var(--hero-ink)
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    max-width: 880px
}

.stat {
    border-top: 3px solid var(--gold);
    padding-top: 10px
}

.stat b {
    display: block;
    font-family: var(--f-display);
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums
}

.stat span {
    font-size: .92rem;
    color: var(--hero-muted)
}

@media (max-width:640px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .logo-plate img {
        height: 54px
    }
}

/* ---------- Sections ---------- */
section.block {
    padding-block: 64px 8px
}

.sec-head {
    display: grid;
    gap: 8px;
    max-width: 70ch;
    margin-bottom: 28px
}

.sec-head h2 {
    font-size: clamp(1.8rem, 3.6vw, 2.6rem);
    font-weight: 700
}

.sec-head p {
    color: var(--muted)
}

/* credit bar */
.creditbar {
    display: flex;
    height: 58px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow)
}

.creditbar div {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 1.15rem;
    min-width: 0;
    background: var(--c);
    color: var(--c-on)
}

:root[data-theme="dark"] .creditbar div {
    color: #06102A
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .creditbar div {
        color: #06102A
    }
}

/* Each entry's heading, count and description share rows with every other
   entry's (subgrid), so a heading that wraps moves its whole row down, not
   just its own column, and the pieces line up across the legend. */
.legend {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0 18px;
    margin-top: 20px
}

.legend div {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 4px;
    align-content: start;
    min-width: 0;
    padding-bottom: 18px
}

.legend h3 {
    font-size: 1.15rem;
    display: flex;
    align-items: flex-start;
    gap: 8px
}

/* On the heading's first line, however many lines it runs to. */
.legend h3 i {
    width: 12px;
    height: 12px;
    margin-top: calc((1lh - 12px) / 2);
    border-radius: 3px;
    flex: none
}

.legend p {
    color: var(--muted);
    font-size: .95rem
}

.legend .n {
    font-family: var(--f-mono);
    font-size: .85rem;
    color: var(--muted)
}

@media (max-width:980px) {
    .legend {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }
}

@media (max-width:680px) {
    .legend {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

@media (max-width:480px) {
    .legend {
        grid-template-columns: 1fr
    }
}

/* Category shapes: pentagon, diamond, square, triangle, circle, one per colour slot.
   Used on the legend, the map key, the degree-plan chips and the credit bar. */
.legend i[class*="cat-"],
.mapkey i[class*="cat-"],
.cat-mark {
    background: var(--c-edge);
    border-radius: var(--c-radius);
    clip-path: var(--c-clip)
}

.cat-mark {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 5px;
    vertical-align: .05em;
    flex: none
}

.creditbar .cat-mark {
    background: currentColor;
    margin-right: 6px
}

/* Each segment shows what fits in it: the symbol and the number, then the
   number alone, then only its colour. A segment is a size container, so it
   asks of its own width, and the bar stays drawn to scale on a phone. Every
   figure is in the legend below and in the bar's label either way. The widths
   are each label's own (about 35px with a symbol and two digits, 20px for two
   digits alone) plus room to breathe; one digit needs less. */
.creditbar > div {
    container-type: inline-size;
    overflow: hidden
}

.creditbar .seg {
    display: inline-flex;
    align-items: center;
    white-space: nowrap
}

@container (max-width: 46px) {
    .creditbar .seg .cat-mark {
        display: none
    }
}

@container (max-width: 27px) {
    .creditbar .seg {
        display: none
    }
}

@container (min-width: 38px) {
    .creditbar .seg.d1 .cat-mark {
        display: inline-block
    }
}

@container (min-width: 19px) {
    .creditbar .seg.d1 {
        display: inline-flex
    }
}

/* road map */
.mapscroll {
    overflow-x: auto;
    padding-top: 6px;
    margin-top: -6px;
    padding-bottom: 10px;
    margin-inline: calc(-1 * max(20px, env(safe-area-inset-left, 0px))) calc(-1 * max(20px, env(safe-area-inset-right, 0px)));
    padding-inline: max(20px, env(safe-area-inset-left, 0px)) max(20px, env(safe-area-inset-right, 0px))
}

.roadmap {
    display: grid;
    grid-template-columns: repeat(8, minmax(126px, 1fr));
    gap: 8px;
    min-width: 1070px
}

/* Below the width eight columns need, every semester stays on screen: four a row, then two */
@media (max-width:1110px) {
    .roadmap {
        min-width: 0;
        grid-template-columns: repeat(4, minmax(0, 1fr))
    }
}

@media (max-width:640px) {
    .roadmap {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

/* Grouped by year: each year's label above its own semesters. Years sit side
   by side and wrap to the next row as the screen narrows; a year never splits. */
.roadmap.grouped {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 8px;
    min-width: 0
}

.year-col {
    flex: var(--terms) 1 0;
    min-width: min(100%, calc(var(--terms) * 120px + (var(--terms) - 1) * 8px));
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 6px
}

.year-label {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 2px 8px;
    padding: 0 4px 4px;
    border-bottom: 2px solid var(--ink)
}

.year-label .yn {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 1rem
}

.year-label .yc {
    font-family: var(--f-mono);
    font-size: .74rem;
    color: var(--muted)
}

.year-terms {
    display: grid;
    grid-template-columns: repeat(var(--terms), minmax(0, 1fr));
    gap: 8px
}

.term-col {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, transform .15s
}

.term-col:hover {
    border-color: var(--sky);
    transform: translateY(-2px)
}

.term-col .tn {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: .95rem;
    line-height: 1.1;
    white-space: nowrap
}

.term-col .td {
    font-size: .78rem;
    color: var(--muted);
    font-family: var(--f-mono)
}

.term-col .tc {
    font-size: .78rem;
    color: var(--muted);
    margin-bottom: 4px
}

.chip {
    font-size: .76rem;
    line-height: 1.25;
    padding: 5px 6px;
    hyphens: auto;
    overflow-wrap: break-word;
    border-radius: 6px;
    border-left: 4px solid
}

.chip[class*="cat-"] {
    background: var(--c-bg);
    border-color: var(--c-edge)
}

.chip.isnew {
    outline: 1.5px dashed var(--new);
    outline-offset: -1.5px
}

.mapkey {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 14px;
    font-size: .88rem;
    color: var(--muted)
}

.mapkey span {
    display: inline-flex;
    align-items: center;
    gap: 7px
}

.mapkey i {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block
}

.mapkey i.newk {
    background: transparent;
    outline: 1.5px dashed var(--new)
}

.grad {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 1.1rem
}

.grad::before {
    content: "";
    flex: 1;
    height: 3px;
    background: linear-gradient(90deg, var(--sky), var(--gold));
    border-radius: 2px
}

/* term bands */
.term {
    padding-block: 56px 12px
}

/* A semester's heading, its note, then its meter across the full width: the
   same order on every semester, whatever the heading's length. */
.term-head {
    display: grid;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--line);
    margin-bottom: 22px
}

.term-head .term-title {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 700
}

.term-head h3.term-title {
    font-size: clamp(1.4rem, 3vw, 1.9rem)
}

.term-head .term-title small {
    font-size: .5em;
    font-weight: 600;
    color: var(--muted);
    margin-left: 10px;
    letter-spacing: .02em
}

.term-head h3.term-title small {
    font-size: .6em
}

.term-head .note {
    color: var(--muted);
    max-width: 60ch
}

.term-meter {
    display: grid;
    gap: 8px;
    margin-top: 6px
}

.term-meter .bar {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--line)
}

.term-meter .bar span {
    display: block;
    background: var(--c);
    box-shadow: var(--c-ring)
}

.term-meter .meter-key {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    font-family: var(--f-mono);
    font-size: .76rem;
    color: var(--muted);
    line-height: 1.4
}

.term-meter .meter-key li {
    display: inline-flex;
    align-items: center
}

/* A year of a recommended sequence: its name once, then its semesters. */
.year {
    padding-block: 56px 12px
}

.year-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 16px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--ink)
}

.year-head h2 {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 700
}

.year-head .year-credits {
    font-family: var(--f-mono);
    font-size: .9rem;
    color: var(--muted)
}

.year .term {
    padding-block: 28px 0
}

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

@media (max-width:760px) {
    .cards {
        grid-template-columns: 1fr
    }
}

.course {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px 16px 20px;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 8px;
    position: relative;
    min-width: 0;
    box-shadow: var(--shadow)
}

.course::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 4px;
    border-radius: 0 3px 3px 0
}

.course[class*="cat-"]::before {
    background: var(--c-edge)
}

.course .top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap
}

.course .code {
    white-space: nowrap;
    font-family: var(--f-mono);
    font-weight: 600;
    font-size: .85rem;
    color: var(--muted)
}

.course .cr {
    margin-left: auto;
    font-family: var(--f-mono);
    font-size: .82rem;
    color: var(--muted);
    white-space: nowrap
}

.course h3 {
    font-size: 1.3rem;
    font-weight: 600
}

.course p {
    color: var(--muted);
    font-size: .98rem;
    align-self: start
}

.options {
    font-size: .9rem;
    color: var(--muted)
}

.options summary {
    cursor: pointer;
    color: var(--sky);
    font-weight: 600
}

.options ul {
    margin: 8px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 2px
}

.options .opt-cr {
    font-family: var(--f-mono);
    font-size: .78rem
}

.tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    align-self: end
}

/* A tag may wrap. Held to one line, the longest ("GEN ED · NATURAL SCIENCE
   OR SOCIAL SCIENCE", 314px) set its card's width, and on a 320px phone three
   program pages scrolled sideways (WCAG 1.4.10). */
.tag {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 999px
}

.tag.cat-tag {
    background: var(--c-bg);
    color: var(--c-ink)
}

.tag.new {
    background: var(--surface);
    color: var(--new);
    border: 1.5px dashed var(--new);
    padding: 3px 7.5px
}

.tag.spark {
    background: var(--gold-soft);
    color: var(--ink)
}


/* fundamentals */
.fund {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 36px;
    align-items: start
}

@media (max-width:900px) {
    .fund {
        grid-template-columns: 1fr
    }
}

.fund-lead {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: clamp(1.45rem, 2.6vw, 1.9rem);
    line-height: 1.25;
    text-wrap: balance
}

.fund-lead em {
    font-style: normal;
    color: var(--sky)
}

.fund-body {
    display: grid;
    gap: 14px;
    color: var(--muted);
    margin-top: 16px
}

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

@media (max-width:520px) {
    .pillars {
        grid-template-columns: 1fr
    }
}

.pillar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    display: grid;
    gap: 6px;
    min-width: 0
}

.pillar .ph {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px
}

.pillar h3 {
    font-size: 1.15rem;
    font-weight: 600
}

.pillar .hrs {
    font-family: var(--f-mono);
    font-size: .82rem;
    color: var(--cat-1);
    white-space: nowrap
}

.pillar .hbar {
    height: 6px;
    border-radius: 3px;
    background: var(--cat-1-bg);
    overflow: hidden
}

.pillar .hbar span {
    display: block;
    height: 100%;
    background: var(--cat-1)
}

.pillar p {
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.45
}

.pillar .codes {
    font-family: var(--f-mono);
    font-size: .76rem;
    color: var(--muted)
}

.newhead {
    margin-top: 48px;
    display: grid;
    gap: 8px;
    max-width: 70ch;
    margin-bottom: 20px
}

.newhead h3 {
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    font-weight: 700
}

.newhead p {
    color: var(--muted)
}

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

.newgrid .grp {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .8rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    grid-column: 1/-1;
    margin-top: 6px
}

@media (max-width:900px) {
    .newgrid {
        grid-template-columns: minmax(0, 1fr)
    }
}

.nc {
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid var(--cat-1);
    border-radius: 12px;
    padding: 16px 18px;
    display: grid;
    gap: 8px;
    align-content: start;
    min-width: 0
}

.nc[class*="cat-"] {
    border-top-color: var(--c-edge)
}

.nc .when {
    font-family: var(--f-mono);
    font-size: .78rem;
    color: var(--muted)
}

.nc h4 {
    font-size: 1.25rem;
    font-weight: 600
}

.nc p {
    font-size: .95rem;
    color: var(--muted)
}

.nc .builds {
    font-size: .88rem;
    color: var(--ink);
    border-top: 1px dashed var(--line);
    padding-top: 8px
}

.nc .builds b {
    font-weight: 600;
    color: var(--muted);
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    display: block
}

/* red hat */
.rh {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: clamp(20px, 4vw, 40px);
    display: grid;
    gap: 28px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow)
}

.rh::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: var(--rh)
}

.rh .eyebrow {
    color: var(--rh)
}

.rh-top {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: 32px;
    align-items: start
}

@media (max-width:860px) {
    .rh-top {
        grid-template-columns: 1fr
    }
}

.rh h2 {
    font-size: clamp(1.8rem, 3.6vw, 2.6rem);
    font-weight: 700;
    margin-top: 8px
}

.rh-top p {
    color: var(--muted);
    margin-top: 12px;
    max-width: 60ch
}

.goal {
    border: 2px solid var(--rh);
    border-radius: 14px;
    padding: 18px 20px;
    display: grid;
    gap: 6px;
    background: var(--rh-bg)
}

.goal .big {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 3.2rem;
    line-height: 1;
    color: var(--rh)
}

.goal b {
    font-family: var(--f-display);
    font-size: 1.15rem
}

.goal span {
    color: var(--muted);
    font-size: .92rem
}

.rhcsa {
    display: grid;
    gap: 10px
}

.rhcsa h3 {
    font-size: 1.4rem;
    font-weight: 700
}

.rhcsa h3 small {
    font-family: var(--f-mono);
    font-size: .62em;
    font-weight: 500;
    color: var(--muted);
    margin-left: 8px
}

.rhcsa>p {
    color: var(--muted);
    max-width: 75ch
}

.rhpath {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 8px
}

@media (max-width:860px) {
    .rhpath {
        grid-template-columns: minmax(0, 1fr)
    }
}

.step {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    display: grid;
    gap: 4px;
    align-content: start;
    min-width: 0;
    background: var(--bg)
}

.step .when {
    font-family: var(--f-mono);
    font-size: .76rem;
    color: var(--muted)
}

.step b {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.2
}

.step span.d {
    font-size: .86rem;
    color: var(--muted);
    line-height: 1.4
}

.step.exam {
    border-color: var(--rh);
    background: var(--rh-bg)
}

.step.exam b {
    color: var(--rh)
}

.tag.cert {
    background: var(--rh-bg);
    color: var(--rh)
}

/* internships */
.rotations {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px
}

@media (max-width:860px) {
    .rotations {
        grid-template-columns: minmax(0, 1fr)
    }
}

.rot {
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid var(--c);
    border-radius: 12px;
    padding: 16px 18px;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 6px;
    min-width: 0;
    box-shadow: var(--shadow)
}

.rot .when {
    font-family: var(--f-mono);
    font-size: .78rem;
    color: var(--muted)
}

.rot b {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1.2
}

.rot .d {
    color: var(--muted);
    font-size: .95rem;
    align-self: start
}

.rot .meta {
    font-family: var(--f-mono);
    font-size: .76rem;
    color: var(--c);
    border-top: 1px dashed var(--line);
    padding-top: 8px;
    margin-top: 4px
}

.sec-head p+p {
    margin-top: 10px
}

footer {
    padding-block: 22px 34px;
    color: var(--muted);
    font-size: .85rem
}

footer a {
    color: var(--sky);
    font-weight: 600
}

footer .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    justify-content: space-between
}

kbd {
    font-family: var(--f-mono);
    font-size: .8em;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 0 5px;
    background: var(--surface)
}

/* ---------- Windows high-contrast mode ---------- */
/* Forced colors drop backgrounds, which is all the credit bar, the meters and the
   swatches are made of. Keep their own colors and outline them. */
@media (forced-colors: active) {

    .creditbar,
    .term-meter .bar {
        border: 1px solid CanvasText
    }

    .creditbar div,
    .term-meter .bar span,
    .legend i,
    .mapkey i,
    .cat-mark {
        forced-color-adjust: none
    }

    .creditbar div+div,
    .term-meter .bar span+span {
        border-left: 2px solid Canvas
    }

    .chip {
        border: 1px solid CanvasText;
        border-left-width: 4px
    }
}
