/* Theme tokens */

:root {
  --pl-bg: #ffffff;
  --pl-ink: #0b1230;
  --pl-body: #3a4160;
  --pl-muted: #6b7392;
  --pl-hair: #e6e9f2;
  --pl-unused: #b8c0d8;
  --pl-plate: transparent;

  --pl-done: #6495ed;
  --pl-done-rim: #4f7fd9;
  --pl-done-text: #ffffff;

  --pl-prog: #c4b5fd;
  --pl-prog-rim: #a896f0;
  --pl-prog-text: #26215c;

  --homepage-link-purple: #7c6bd6;
  --pl-link: var(--homepage-link-purple);
  --pl-hover: var(--homepage-link-purple);

  --pl-font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --pl-font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pl-font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --paper-grain-opacity: 0;
}

:root[data-theme="dark"] {
  --pl-bg: #1a1b1e;
  --pl-ink: #e8e9ed;
  --pl-body: #b4b7c0;
  --pl-muted: #8a8d96;
  --pl-hair: #2e3036;
  --pl-unused: #34363e;
  --pl-plate: #22232a;

  --pl-done-rim: #82aaf3;
  --pl-done-text: #0b1230;
  --pl-prog-rim: #d9cfff;

  --homepage-link-purple: #c4b5fd;
  --pl-link: var(--homepage-link-purple);
  --pl-hover: var(--homepage-link-purple);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pl-bg: #1a1b1e;
    --pl-ink: #e8e9ed;
    --pl-body: #b4b7c0;
    --pl-muted: #8a8d96;
    --pl-hair: #2e3036;
    --pl-unused: #34363e;
    --pl-plate: #22232a;

    --pl-done-rim: #82aaf3;
    --pl-done-text: #0b1230;
    --pl-prog-rim: #d9cfff;

    --homepage-link-purple: #c4b5fd;
    --pl-link: var(--homepage-link-purple);
    --pl-hover: var(--homepage-link-purple);
  }
}

/* Base */

html {
  background: var(--pl-bg);
}

.pl-home {
  margin: 0;
  background: var(--pl-bg);
  color: var(--pl-ink);
  font-family: var(--pl-font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.pl-home *,
.pl-home *::before,
.pl-home *::after {
  box-sizing: border-box;
}

.pl-home [hidden] {
  display: none !important;
}

body.pl-home::after {
  display: none;
}

.pl-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.pl-mono {
  font-family: var(--pl-font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.pl-head {
  font-family: var(--pl-font-head);
  font-weight: 500;
}

/* Purple hyperlinks */

.pl-home a {
  color: var(--homepage-link-purple);
  text-decoration: none;
}

body.pl-home a[href],
body.pl-home a[href]:visited,
body.pl-home a[href]:hover,
body.pl-home a[href]:active {
  color: var(--homepage-link-purple) !important;
}

.pl-home :is(a, button, summary):focus-visible {
  outline: 2px solid var(--homepage-link-purple);
  outline-offset: 5px;
}

.pl-well:focus-visible {
  outline: none;
}

/* Header */

.pl-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 52px 0 24px;
}

.pl-name {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.pl-course {
  text-align: right;
  color: var(--pl-muted);
  line-height: 1.8;
}

.pl-eyebrow {
  margin: 0 0 12px;
  color: var(--pl-muted);
  font: 11px/1.6 var(--pl-font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pl-intro {
  max-width: 62ch;
  margin: 0 0 38px;
  color: var(--pl-body);
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.65;
}

.pl-small {
  margin: 0;
  color: var(--pl-muted);
  font-size: 13px;
  line-height: 1.65;
}

/* Layout */

.pl-band {
  border-top: 1px solid var(--pl-ink);
}

.pl-split {
  display: grid;
  grid-template-columns: 3fr 2fr;
}

.pl-plate-cell {
  padding: 24px 24px 24px 0;
  border-right: 1px solid var(--pl-ink);
}

.pl-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 18px;
}

.pl-toolbar h2 {
  margin: 0 0 4px;
  font: 500 19px/1.3 var(--pl-font-head);
}

/* Plate/list controls */

.pl-view-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--pl-hair);
  border-radius: 30px;
}

.pl-view-switch button {
  min-height: 40px;
  padding: 8px 18px;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: var(--pl-body);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.pl-view-switch button[aria-pressed="true"] {
  background: var(--pl-ink);
  color: var(--pl-bg);
}

/* Plate */

.pl-plate {
  width: 100%;
  height: auto;
  display: block;
  filter: none;
  box-shadow: none;
}

.pl-plate text {
  font-family: var(--pl-font-mono);
  font-size: 11px;
}

.pl-plate .pl-axis {
  fill: var(--pl-ink);
}

.pl-plate .pl-body {
  fill: var(--pl-plate);
  fill: color-mix(in srgb, var(--pl-bg) 98%, var(--pl-ink) 2%);
  stroke: var(--pl-ink);
  stroke-width: 1.2;
}

.pl-plate .pl-corner {
  fill: none;
  stroke: var(--pl-ink);
  stroke-width: 1.2;
}

.pl-plate .pl-unused {
  fill: none;
  stroke: var(--pl-unused);
  stroke-width: 1;
  opacity: 0.28;
}

.pl-well {
  cursor: pointer;
  outline: none;
}

.pl-well .pl-fill {
  pointer-events: all;
  filter: none;
  transition: stroke-width 150ms ease, filter 150ms ease;
}

.pl-well .pl-ring {
  fill: none;
  stroke: var(--pl-ink);
  stroke-width: 1.2;
  opacity: 0;
  pointer-events: none;
}

.pl-well.is-selected .pl-ring,
.pl-well:focus-visible .pl-ring {
  opacity: 1;
}

.pl-well--done .pl-fill {
  fill: var(--pl-done);
  stroke: var(--pl-done-rim);
  stroke-width: 1;
}

.pl-well--done text {
  fill: var(--pl-done-text);
}

.pl-well--done:hover .pl-fill {
  fill: var(--pl-done);
}

.pl-well--progress .pl-fill {
  fill: var(--pl-prog);
  stroke: var(--pl-prog-rim);
  stroke-width: 1;
}

.pl-well--progress text {
  fill: var(--pl-prog-text);
}

.pl-well--upcoming .pl-fill {
  fill: none;
  stroke: var(--pl-muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.pl-well--upcoming text {
  fill: var(--pl-muted);
}

.pl-well--pending .pl-fill {
  fill: var(--pl-bg);
  stroke: var(--pl-muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.pl-well--pending text {
  fill: var(--pl-muted);
}

.pl-well text {
  pointer-events: none;
}

.pl-well.is-current-week:not(.is-selected) .pl-ring {
  stroke: var(--pl-prog-rim);
  stroke-dasharray: 2 4;
  opacity: 0.7;
}

.pl-well:hover .pl-fill {
  stroke-width: 2;
}

/* Plate legends */

.pl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 14px;
  color: var(--pl-muted);
}

.pl-legend .pl-legend-end {
  margin-left: auto;
}

.pl-status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 14px;
  color: var(--pl-muted);
  font-size: 12px;
}

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

.pl-key {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.pl-key-draft {
  background: var(--pl-prog);
}

.pl-key-done {
  background: var(--pl-done);
}

.pl-key-pending {
  border: 1px dashed var(--pl-muted);
}

.pl-schedule-note {
  margin-top: 16px;
}

/* Selected-entry panel */

.pl-panel {
  padding: 30px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pl-panel-body {
  transition: opacity 0.12s ease;
}

.pl-panel-kicker {
  color: var(--pl-muted);
}

.pl-panel-title {
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.18;
  margin: 12px 0 0;
  text-wrap: balance;
}

.pl-panel-meta {
  margin-top: 20px;
  line-height: 1.8;
}

.pl-panel-summary {
  margin: 14px 0 0;
  font-size: 16px;
  color: var(--pl-body);
  line-height: 1.7;
}

.pl-panel-link,
.pl-text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 20px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline !important;
  text-underline-offset: 5px;
}

.pl-panel-help {
  margin-top: auto;
  margin-bottom: 0;
  padding-top: 14px;
  border-top: 1px solid var(--pl-hair);
  color: var(--pl-muted);
  font-size: 11px;
}

.pl-preview-image {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  margin-top: 24px;
}

/* Chronological list */

.pl-split.is-list-view {
  grid-template-columns: 1fr;
}

.is-list-view .pl-plate-cell {
  border-right: 0;
  padding-right: 0;
}

.pl-class-group {
  border-bottom: 1px solid var(--pl-hair);
}

.pl-class-group summary {
  min-height: 64px;
  padding: 18px 8px;
  cursor: pointer;
}

.pl-class-group summary > span,
.pl-class-group summary > strong {
  display: block;
}

.pl-class-group summary > strong {
  margin-top: 5px;
  font-weight: 500;
}

.pl-class-group ul {
  padding: 0 8px 14px 24px;
  margin: 0;
}

.pl-class-group li {
  padding: 10px 0;
}

.pl-class-group li small {
  display: block;
  margin-top: 3px;
  color: var(--pl-muted);
}

/* Project framework */

.pl-exploring {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  padding: 44px 0;
}

.pl-exploring h2 {
  max-width: 18ch;
  margin: 0 0 18px;
  font: 500 clamp(28px, 3vw, 40px)/1.15 var(--pl-font-head);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.pl-exploring p:not(.pl-eyebrow):not(.pl-small) {
  color: var(--pl-body);
  line-height: 1.75;
}

.pl-proposal-map {
  display: grid;
  align-content: center;
  gap: 0;
}

.pl-proposal-map > div {
  position: relative;
  padding: 18px 22px;
  border-left: 2px solid var(--pl-prog);
  border-bottom: 1px solid var(--pl-hair);
}

.pl-proposal-map > div:last-child {
  border-bottom: 0;
}

.pl-proposal-map .pl-mono {
  color: var(--pl-muted);
  font-size: 11px;
}

.pl-proposal-map h3 {
  margin: 5px 0;
  font: 500 20px/1.3 var(--pl-font-head);
}

.pl-proposal-map p {
  margin: 0;
  font-size: 14px;
}

/* About */

.pl-about {
  display: grid;
  grid-template-columns: 3fr 2fr;
}

.pl-about-content {
  padding: 32px 24px 32px 0;
  border-right: 1px solid var(--pl-hair);
  max-width: 68ch;
}

.pl-about-content h2,
.pl-about-content h3 {
  font-family: var(--pl-font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--pl-muted);
  margin: 20px 0 6px;
}

.pl-about-content h2 {
  color: var(--pl-ink);
  font: 500 22px/1.3 var(--pl-font-head);
  letter-spacing: 0;
}

.pl-about-content h2:first-child,
.pl-about-content h3:first-child {
  margin-top: 0;
}

.pl-about-content p {
  max-width: 58ch;
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.8;
}

.pl-about-content ul {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  font-size: 15px;
  line-height: 1.9;
}

.pl-about-content .anchor,
.pl-about-content .copyanchor,
.pl-about-content h2 > span.btn,
.pl-about-content h3 > span.btn {
  display: none !important;
}

.pl-about-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 0 16px;
}

.pl-about-content .fa-solid,
.pl-about-content .fa-brands,
.pl-about-content .fa-regular {
  width: 1.2em;
  color: var(--pl-muted);
}

.pl-about-side {
  padding: 32px 0 32px 24px;
}

.pl-about-side h2 {
  font-family: var(--pl-font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--pl-muted);
  margin: 0 0 6px;
}

.pl-about-side p {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.6;
}

/* Notebook chart */

.pl-notebook {
  margin-bottom: 28px;
}

.pl-notebook-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.pl-notebook-heading h2 {
  margin: 0 0 4px;
  color: var(--pl-ink);
  font: 500 16px/1.4 var(--pl-font-head);
}

.pl-notebook-heading .pl-word-total {
  margin: 0;
  text-align: right;
  font: 500 26px/1.1 var(--pl-font-head);
}

.pl-word-total span {
  display: block;
  margin-top: 5px;
  color: var(--pl-muted);
  font: 11px/1.4 var(--pl-font-mono);
}

.pl-mini-chart {
  display: block;
  width: 100%;
  height: auto;
  margin: 16px 0 8px;
  overflow: visible;
}

.pl-mini-chart text {
  fill: var(--pl-muted);
  font: 12px var(--pl-font-mono);
}

.pl-mini-grid {
  stroke: var(--pl-hair);
  stroke-width: 1;
}

.pl-mini-line {
  fill: none;
  stroke: var(--pl-done);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.pl-mini-dot {
  fill: var(--pl-prog);
  stroke: var(--pl-bg);
  stroke-width: 1.5;
}

.pl-count-details,
.pl-course-details,
.pl-resources {
  color: var(--pl-muted);
  font-size: 13px;
}

.pl-count-details summary,
.pl-course-details summary,
.pl-resources summary {
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
}

.pl-count-details table {
  width: 100%;
  border-collapse: collapse;
  font: 11px/1.7 var(--pl-font-mono);
}

.pl-count-details th,
.pl-count-details td {
  padding: 7px 4px;
  border-bottom: 1px solid var(--pl-hair);
  text-align: right;
  font-weight: 400;
}

.pl-count-details th:first-child {
  text-align: left;
}

.pl-course-details {
  border-top: 1px solid var(--pl-hair);
}

.pl-course-details p {
  margin: 8px 0 16px;
}

/* Earlier chart layout */

.pl-chart-cell {
  padding: 22px 0 24px;
}

.pl-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.pl-chart-head .pl-dim {
  color: var(--pl-muted);
}

.pl-chart-scroll {
  margin-top: 12px;
  overflow-x: auto;
  overflow-y: hidden;
}

.pl-chart {
  width: 100%;
  height: auto;
  display: block;
}

.pl-chart text {
  font-family: var(--pl-font-mono);
  font-size: 11px;
  fill: var(--pl-muted);
}

.pl-chart .pl-grid {
  stroke: var(--pl-hair);
}

.pl-chart .pl-tick {
  stroke: var(--pl-muted);
}

.pl-chart .pl-break {
  fill: var(--pl-unused);
}

.pl-chart .pl-curve {
  fill: none;
  stroke: var(--pl-done);
  stroke-width: 1.5;
}

.pl-point {
  cursor: pointer;
}

.pl-point .pl-point-ring {
  fill: none;
  stroke: var(--pl-ink);
  stroke-width: 1.2;
  opacity: 0;
}

.pl-point.is-selected .pl-point-ring {
  opacity: 1;
}

.pl-point--done .pl-point-dot {
  fill: var(--pl-done);
}

.pl-point--progress .pl-point-dot {
  fill: var(--pl-prog);
}

/* Footer */

.pl-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  border-top: 1px solid var(--pl-hair);
  padding: 16px 0 0;
}

.pl-foot h2 {
  font-family: var(--pl-font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--pl-muted);
  margin: 0 0 8px;
}

.pl-foot ul {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.pl-foot .pl-mono,
.pl-built {
  color: var(--pl-muted);
}

.pl-foot .pl-resources ul {
  display: block;
}

.pl-resources li {
  padding: 5px 0;
}

/* Accessibility */

.pl-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.pl-skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-200%);
  padding: 12px 18px;
  background: var(--pl-bg);
  border: 2px solid var(--homepage-link-purple);
}

.pl-skip:focus {
  transform: none;
}

/* Responsive layout */

@media (max-width: 900px) {
  .pl-split,
  .pl-about,
  .pl-exploring {
    grid-template-columns: 1fr;
  }

  .pl-plate-cell {
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--pl-ink);
  }

  .pl-panel {
    padding: 24px 0;
    min-height: 0;
  }

  .pl-panel-help {
    margin-top: 24px;
  }

  .pl-about-content {
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--pl-hair);
    max-width: none;
  }

  .pl-about-side {
    padding-left: 0;
  }

  .pl-top {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 32px;
  }

  .pl-course {
    text-align: left;
  }

  .pl-notebook {
    max-width: 480px;
  }
}

@media (max-width: 700px) {
  .pl-toolbar {
    align-items: flex-start;
    gap: 12px;
  }

  .pl-toolbar .pl-small {
    max-width: 23ch;
  }

  .pl-view-switch button {
    padding-inline: 13px;
  }

  #course-plate {
    overflow-x: auto;
    padding: 6px;
  }

  #course-plate .pl-plate {
    min-width: 600px;
  }

  .pl-well text {
    display: block;
  }

  .pl-chart {
    min-width: 900px;
  }

  .pl-exploring {
    padding: 32px 0;
  }

  .pl-foot {
    display: block;
  }
}

@media (max-width: 560px) {
  .pl-wrap {
    padding: 0 16px 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pl-well .pl-fill,
  .pl-panel-body {
    transition: none;
  }

  .pl-chart .pl-curve {
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
    transition: none !important;
  }
}