@font-face {
  font-family: "IBM Plex Sans";
  src: url("./assets/plex.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 100 900;
}

:root {
  --background: #f6f6f5;
  --foreground: #171717;
  --card: #ffffff;
  --soft: #efefed;
  --muted-foreground: #686868;
  --border: #dedede;
  --accent: #ff5900;
  --accent-dark: #d94c00;
  --accent-soft: #fff1e6;
  --catalog: #6550a8;
  --catalog-soft: #f1edff;
  --shadow: 0 8px 25px rgba(23, 23, 23, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--foreground);
  background: var(--background);
  font-family: "IBM Plex Sans", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  color: #fff;
  background: var(--accent-dark);
  border-radius: 8px;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  color: #fff;
  background: rgba(23, 23, 23, 0.97);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 48px, 1520px);
  height: 100%;
  margin: 0 auto;
}

.brand-lockup {
  display: flex;
  width: 235px;
  height: 44px;
  align-items: center;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  filter: brightness(0) invert(1);
  object-fit: contain;
  object-position: left center;
}

.brand-lockup:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.header-meta {
  margin: 0;
  color: #c9c9c9;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 36px;
  width: min(100% - 64px, 1480px);
  margin: 0 auto;
  padding: 32px 0 28px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(2.2rem, 4.1vw, 4.25rem);
  font-weight: 650;
  letter-spacing: -0.065em;
  line-height: 0.88;
}

h1 span {
  color: var(--accent);
}

.hero-description {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted-foreground);
  font-size: clamp(0.86rem, 1vw, 0.98rem);
  line-height: 1.5;
}

.hero-stat {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 190px;
  padding: 10px 0 3px 22px;
  border-left: 2px solid var(--accent);
}

.hero-stat-number {
  color: var(--accent);
  font-size: 2.75rem;
  font-weight: 650;
  letter-spacing: -0.06em;
  line-height: 1;
}

.hero-stat-label {
  color: var(--muted-foreground);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.map-section {
  padding: 44px 0 30px;
  background: #eeeeec;
  border-top: 1px solid #e3e3e0;
}

.map-heading,
.map-footer,
.swipe-hint {
  width: min(100% - 64px, 1480px);
  margin-right: auto;
  margin-left: auto;
}

.map-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
}

.map-heading .section-kicker {
  margin-bottom: 8px;
}

h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -0.045em;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 22px;
  color: var(--muted-foreground);
  font-size: 0.78rem;
  font-weight: 600;
}

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

.legend-dot {
  width: 8px;
  height: 8px;
  background: #c8c8c5;
  border-radius: 50%;
}

.legend-dot--accent {
  background: var(--accent);
}

.legend-dot--catalog {
  width: 9px;
  height: 9px;
  background: transparent;
  border: 2px solid var(--catalog);
  border-radius: 2px;
}

.swipe-hint {
  display: none;
  margin-top: 0;
  margin-bottom: 14px;
  color: var(--muted-foreground);
  font-size: 0.82rem;
}

.swipe-hint span {
  margin-right: 6px;
  color: var(--accent-dark);
  font-size: 1.1rem;
}

.map-shell {
  position: relative;
  width: 100%;
  min-height: 675px;
  padding: 0 max(32px, calc((100vw - 1480px) / 2));
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--accent) #dadad7;
  scrollbar-width: thin;
}

.map-shell::-webkit-scrollbar {
  height: 10px;
}

.map-shell::-webkit-scrollbar-track {
  background: #dadad7;
}

.map-shell::-webkit-scrollbar-thumb {
  background: var(--accent);
  border: 2px solid #dadad7;
  border-radius: 999px;
}

.map-shell:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.loading-state,
.error-state {
  display: grid;
  min-height: 500px;
  place-items: center;
  color: var(--muted-foreground);
}

.error-state {
  color: #9b2c00;
}

.curriculum-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(9, minmax(190px, 1fr));
  gap: 10px;
  width: max(1780px, 100%);
  min-height: 620px;
  padding-bottom: 24px;
}

.connections {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.semester-column {
  position: relative;
  z-index: 1;
  min-width: 190px;
  padding: 15px 10px 12px;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(23, 23, 23, 0.07);
  border-radius: 16px;
}

.semester-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 4px 12px;
}

.semester-number {
  display: block;
  margin-bottom: 2px;
  color: var(--accent-dark);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.semester-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.semester-period {
  display: block;
  margin-top: 4px;
  color: var(--muted-foreground);
  font-size: 0.66rem;
  font-weight: 600;
}

.semester-count {
  margin-top: 2px;
  color: var(--muted-foreground);
  font-size: 0.68rem;
  font-weight: 600;
}

.course-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.course-card {
  position: relative;
  z-index: 3;
  display: flex;
  width: 100%;
  min-height: 66px;
  padding: 10px;
  color: var(--foreground);
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 7px rgba(23, 23, 23, 0.035);
  transition: opacity 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

button.course-card {
  cursor: pointer;
}

button.course-card:hover {
  border-color: #ffb084;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.course-card::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  background: transparent;
  border-radius: 0 3px 3px 0;
  content: "";
}

.course-card--linked::before {
  background: var(--accent);
}

.course-card--flexible {
  cursor: pointer;
  border-color: #bdb1df;
  background: linear-gradient(145deg, #fff 72%, var(--catalog-soft));
}

.course-card--flexible::before {
  background: var(--catalog);
}

.course-icon {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 1px 8px 0 1px;
  color: #8a8a85;
}

.course-content {
  min-width: 0;
  flex: 1;
}

.course-name {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.71rem;
  font-weight: 650;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.course-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-top: 7px;
  color: var(--muted-foreground);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.course-code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-credits {
  flex: none;
}

.course-catalog-label {
  display: block;
  margin-top: 6px;
  color: var(--catalog);
  font-size: 0.59rem;
  font-weight: 700;
}

.curriculum-board.has-active .course-card:not(.is-in-chain) {
  opacity: 0.24;
}

.course-card.is-in-chain {
  border-color: rgba(255, 89, 0, 0.55);
}

.course-card.is-origin {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 89, 0, 0.16), 0 8px 20px rgba(217, 76, 0, 0.1);
}

.course-card:focus-visible,
.clear-button:focus-visible {
  z-index: 5;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.chain-line-halo {
  fill: none;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-linecap: round;
  stroke-width: 7;
}

.chain-line {
  fill: none;
  stroke: var(--accent);
  stroke-dasharray: 7 4;
  stroke-linecap: round;
  stroke-width: 2.5;
  animation: chain-flow 0.8s linear infinite;
}

@keyframes chain-flow {
  to {
    stroke-dashoffset: -11;
  }
}

.map-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  color: var(--muted-foreground);
  font-size: 0.78rem;
}

.map-footer p {
  display: flex;
  align-items: center;
  margin: 0;
}

.footer-icon {
  display: inline-grid;
  width: 25px;
  height: 25px;
  margin-right: 9px;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  place-items: center;
}

.clear-button {
  padding: 8px 13px;
  color: var(--accent-dark);
  background: transparent;
  border: 1px solid #e7a078;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 650;
}

.clear-button:hover {
  color: #fff;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.catalog-dialog {
  width: min(920px, calc(100% - 32px));
  max-height: min(780px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  color: var(--foreground);
  background: var(--card);
  border: 0;
  border-radius: 20px;
  box-shadow: 0 28px 90px rgba(23, 23, 23, 0.3);
}

.catalog-dialog::backdrop {
  background: rgba(23, 23, 23, 0.68);
  backdrop-filter: blur(4px);
}

.catalog-panel {
  display: flex;
  max-height: min(780px, calc(100dvh - 32px));
  flex-direction: column;
}

.catalog-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding: 28px 30px 22px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.catalog-kicker {
  margin: 0 0 7px;
  color: var(--accent-dark);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.catalog-title {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  letter-spacing: -0.035em;
}

.catalog-summary {
  margin: 8px 0 0;
  color: var(--muted-foreground);
  font-size: 0.86rem;
}

.catalog-close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0 0 3px;
  color: var(--foreground);
  background: var(--soft);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
  place-items: center;
}

.catalog-close:hover,
.catalog-close:focus-visible {
  color: #fff;
  background: var(--accent-dark);
  outline: none;
}

.catalog-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 20px 30px 30px;
  overflow-y: auto;
}

.catalog-course {
  min-width: 0;
  padding: 15px 16px;
  background: #fafaf9;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.catalog-course--recommended {
  background: linear-gradient(145deg, #fff 55%, var(--accent-soft));
  border-color: var(--accent);
  box-shadow: 0 5px 16px rgba(217, 76, 0, 0.09);
}

.coordinator-recommendation {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.coordinator-recommendation span {
  color: var(--accent);
  font-size: 0.82rem;
}

.catalog-course-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.catalog-course-code {
  color: var(--accent-dark);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.catalog-course-details {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.catalog-credit-badge {
  padding: 3px 6px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 0.59rem;
  font-weight: 700;
  white-space: nowrap;
}

.catalog-prerequisite {
  color: var(--muted-foreground);
  font-size: 0.62rem;
  font-weight: 600;
}

.catalog-course h3 {
  margin: 0;
  font-size: 0.83rem;
  font-weight: 620;
  line-height: 1.35;
}

body:has(.catalog-dialog[open]) {
  overflow: hidden;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 26px max(32px, calc((100vw - 1480px) / 2));
  color: #a4a4a4;
  background: var(--foreground);
  font-size: 0.73rem;
  font-weight: 550;
  letter-spacing: 0.04em;
}

.conditions-section {
  width: min(100% - 64px, 1480px);
  margin: 0 auto;
  padding: 66px 0 72px;
}

.conditions-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 520px);
  align-items: end;
  gap: 48px;
  margin-bottom: 30px;
}

.conditions-heading .section-kicker {
  margin-bottom: 8px;
}

.conditions-intro {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.96rem;
  line-height: 1.6;
}

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

.milestone-card {
  position: relative;
  min-width: 0;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.milestone-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: #c9c9c6;
  content: "";
}

.milestone-card--featured {
  background: linear-gradient(145deg, #fff 58%, var(--accent-soft));
  border-color: #f0ad86;
}

.milestone-card--featured::before {
  background: var(--accent);
}

.milestone-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.milestone-progress {
  color: var(--accent);
  font-size: 2.55rem;
  font-weight: 680;
  letter-spacing: -0.06em;
  line-height: 1;
}

.milestone-credits {
  color: var(--muted-foreground);
  font-size: 0.7rem;
  font-weight: 650;
}

.milestone-card h3 {
  margin: 0 0 13px;
  font-size: 1.06rem;
  font-weight: 680;
}

.milestone-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 0 0 18px;
  color: #4f4f4c;
  font-size: 0.81rem;
  line-height: 1.45;
}

.milestone-card li::marker {
  color: var(--accent);
}

.milestone-consequence {
  margin: 18px 0 0;
  padding-top: 14px;
  color: var(--muted-foreground);
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  line-height: 1.45;
}

.milestone-consequence strong {
  color: var(--foreground);
}

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

.completion-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 17px 18px;
  background: #ececea;
  border-radius: 13px;
}

.completion-check {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: #fff;
  background: var(--foreground);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 750;
  place-items: center;
}

.completion-card h3 {
  margin: 1px 0 4px;
  font-size: 0.82rem;
}

.completion-card p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.72rem;
  line-height: 1.45;
}

.conditions-note {
  margin: 20px 0 0;
  color: var(--muted-foreground);
  font-size: 0.69rem;
  font-style: italic;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

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

@media (max-width: 860px) {
  .site-header {
    height: 50px;
  }

  .header-inner,
  .hero,
  .map-heading,
  .map-footer,
  .swipe-hint {
    width: min(100% - 36px, 1480px);
  }

  .brand-logo {
    width: 100%;
  }

  .brand-lockup {
    width: 190px;
    height: 34px;
  }

  .header-meta {
    font-size: 0.65rem;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 28px 0 25px;
  }

  .hero-stat {
    width: fit-content;
  }

  .map-section {
    padding-top: 36px;
  }

  .map-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .legend {
    justify-content: flex-start;
  }

  .swipe-hint {
    display: block;
  }

  .map-shell {
    padding-right: 18px;
    padding-left: 18px;
  }

  .conditions-section {
    width: min(100% - 36px, 1480px);
    padding: 48px 0 54px;
  }

  .conditions-heading {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .milestones-grid,
  .completion-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .header-meta span {
    display: none;
  }

  .header-meta {
    max-width: 68px;
    text-align: right;
  }

  h1 {
    font-size: clamp(2.25rem, 11vw, 3.25rem);
  }

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

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

  .catalog-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
  }

  .catalog-panel {
    max-height: calc(100dvh - 16px);
  }

  .catalog-header {
    padding: 22px 20px 18px;
  }

  .catalog-list {
    grid-template-columns: 1fr;
    padding: 16px 20px 22px;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .chain-line {
    animation: none;
  }
}
