.notes-page {
  min-height: 100vh;
}

.notes-page .site-header {
  position: absolute;
  right: 0;
  left: 0;
  color: var(--on-dark);
}

.notes-page .wordmark strong,
.notes-page .site-nav a {
  color: var(--on-dark);
}

.notes-page .wordmark small,
.notes-page .theme-picker label {
  color: var(--on-dark-muted);
}

.notes-page .wordmark-mark i {
  border-color: var(--hero-b);
}

.notes-page .theme-picker select {
  color: var(--on-dark);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
}

.notes-page .theme-picker select option {
  color: var(--ink);
  background: var(--paper);
}

.notes-page .site-nav a[aria-current="page"] {
  color: var(--gold);
}

.notes-page .site-nav a.notes-nav-link[aria-current="page"] {
  color: var(--accent-ink);
}

.notes-hero {
  position: relative;
  overflow: hidden;
  padding: 10rem 0 6.5rem;
  color: var(--on-dark);
  background:
    radial-gradient(circle at 78% 42%, color-mix(in srgb, var(--aqua) 30%, transparent), transparent 25rem),
    linear-gradient(125deg, var(--hero-a), var(--hero-b) 58%, var(--hero-c));
}

.notes-hero::before,
.notes-hero::after {
  content: "";
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--gold) 48%, transparent);
  border-radius: 50%;
  pointer-events: none;
}

.notes-hero::before {
  top: 8rem;
  right: 12%;
  width: 18rem;
  height: 18rem;
}

.notes-hero::after {
  top: 13rem;
  right: 7%;
  width: 6rem;
  height: 6rem;
  background: color-mix(in srgb, var(--gold) 9%, transparent);
}

.notes-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 2.5rem, 1160px);
  margin: 0 auto;
}

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

.notes-hero h1 {
  max-width: 12ch;
  margin: 0.7rem 0 1.35rem;
  color: var(--on-dark);
  font: 800 clamp(4.2rem, 10vw, 8.8rem)/0.78 var(--condensed);
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

.notes-hero .hero-deck {
  color: var(--gold);
}

.notes-hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 34rem) auto;
  gap: 3rem;
  align-items: end;
  margin-top: 3rem;
}

.notes-hero-copy > p {
  margin: 0;
  color: var(--on-dark-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.notes-hero-key {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-self: end;
  color: var(--on-dark-muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notes-hero-key i {
  width: 0.55rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 1.15rem 0 0 var(--orange), 2.3rem 0 0 var(--aqua);
  margin-right: 2.3rem;
}

.notes-use-notice {
  color: var(--accent-ink);
  background: var(--gold);
}

.notes-use-notice .notes-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.notes-use-notice strong {
  font: 800 0.68rem/1 var(--condensed);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notes-use-notice p {
  margin: 0;
  font-size: 0.68rem;
}

.notes-library {
  padding: 6rem 0 7rem;
}

.notes-library-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: end;
}

.notes-library-heading h2 {
  margin: 0.3rem 0 0;
  color: var(--heading);
  font: 800 clamp(3.2rem, 7vw, 5.7rem)/0.86 var(--condensed);
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.notes-library-heading > p {
  max-width: 32rem;
  justify-self: end;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.note-tools {
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) auto;
  gap: 1.5rem;
  align-items: end;
  margin: 3rem 0 1.4rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.note-search label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.note-search input {
  width: min(100%, 31rem);
  padding: 0.75rem 0;
  border: 0;
  border-bottom: 2px solid var(--heading);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font: 600 0.82rem/1.3 var(--sans);
}

.note-search input::placeholder {
  color: var(--muted);
}

.note-search input:focus {
  border-color: var(--orange);
  outline: 0;
}

.note-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.note-filters button {
  padding: 0.55rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--paper);
  font: 800 0.55rem/1 var(--sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.note-filters button:hover,
.note-filters button[aria-pressed="true"] {
  color: var(--accent-ink);
  border-color: var(--gold);
  background: var(--gold);
}

.note-count {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-align: right;
  text-transform: uppercase;
}

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

.note-card[hidden] {
  display: none;
}

.note-card a {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 22rem;
  padding: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  color: var(--ink);
  background: var(--paper);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.note-card a::after {
  content: "↗";
  position: absolute;
  right: 1.4rem;
  bottom: 1.2rem;
  display: grid;
  width: 2.6rem;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--heading);
  font-size: 0.8rem;
}

.note-card a:hover {
  box-shadow: 0 18px 40px rgba(8, 42, 56, 0.1);
  transform: translateY(-0.35rem);
}

.note-card a:hover::after {
  color: var(--accent-ink);
  border-color: var(--gold);
  background: var(--gold);
}

.note-card-number {
  color: var(--teal);
  font: 800 2.2rem/1 var(--condensed);
}

.note-card-topic {
  margin: auto 0 0.65rem;
  color: var(--orange);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.note-card h3 {
  max-width: 14ch;
  margin: 0;
  color: var(--heading);
  font: 800 2rem/0.95 var(--condensed);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.note-card-summary {
  max-width: 32ch;
  margin: 0.75rem 0 1.8rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.note-card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.note-empty-state {
  padding: 4rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.note-entry-main {
  background: var(--paper);
}

.entry-hero {
  padding: 10rem 0 4.5rem;
  color: var(--on-dark);
  background:
    radial-gradient(circle at 82% 25%, color-mix(in srgb, var(--aqua) 27%, transparent), transparent 20rem),
    linear-gradient(125deg, var(--hero-a), var(--hero-b) 58%, var(--hero-c));
}

.entry-back {
  display: inline-block;
  margin-bottom: 3.5rem;
  color: var(--on-dark-muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-transform: uppercase;
}

.entry-back:hover {
  color: var(--gold);
}

.entry-kicker {
  margin: 0 0 0.75rem;
  color: var(--gold);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.entry-hero h1 {
  max-width: 15ch;
  margin: 0;
  color: var(--on-dark);
  font: 800 clamp(3.6rem, 8vw, 7rem)/0.84 var(--condensed);
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.entry-deck {
  max-width: 48rem;
  margin: 1.5rem 0 0;
  color: var(--on-dark-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.2rem;
  margin-top: 2rem;
  color: var(--on-dark-muted);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.entry-meta span + span::before {
  content: "·";
  margin-right: 1.2rem;
  color: var(--gold);
}

.entry-layout {
  display: grid;
  grid-template-columns: 13rem minmax(0, 44rem);
  gap: clamp(3rem, 8vw, 8rem);
  justify-content: center;
  padding-top: 5rem;
  padding-bottom: 7rem;
}

.entry-toc {
  position: sticky;
  top: 2rem;
  align-self: start;
  padding-top: 0.4rem;
}

.entry-toc p {
  margin: 0 0 0.75rem;
  color: var(--teal);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.entry-toc a {
  display: block;
  padding: 0.45rem 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 0.65rem;
  text-decoration: none;
}

.entry-toc a:hover {
  color: var(--orange);
}

.entry-content {
  min-width: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.03rem;
  line-height: 1.82;
}

.entry-content > :first-child {
  margin-top: 0;
}

.entry-content h2,
.entry-content h3 {
  color: var(--heading);
  font-family: var(--condensed);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1;
  text-transform: uppercase;
}

.entry-content h2 {
  margin: 3.5rem 0 1rem;
  font-size: 2.5rem;
}

.entry-content h3 {
  margin: 2.4rem 0 0.8rem;
  font-size: 1.6rem;
}

.entry-content p,
.entry-content ul,
.entry-content ol {
  margin: 1rem 0;
}

.entry-content a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.17em;
}

.entry-content blockquote,
.entry-content .key-result {
  margin: 2rem 0;
  padding: 1.4rem 1.6rem;
  border-left: 4px solid var(--gold);
  color: var(--ink);
  background: color-mix(in srgb, var(--gold) 10%, var(--cream));
}

.entry-content .key-result strong:first-child {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--teal);
  font-family: var(--sans);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.entry-citation-note {
  margin: 3rem 0 1rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  color: var(--ink);
  background: var(--cream);
  font-family: var(--sans);
  font-size: 0.72rem;
  line-height: 1.6;
}

.entry-citation-note strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--teal);
  font-size: 0.58rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.entry-citation-note p {
  margin: 0.35rem 0 0;
}

.entry-citation-note .suggested-citation {
  color: var(--muted);
}

.entry-content code {
  padding: 0.15rem 0.3rem;
  border-radius: 0.2rem;
  background: var(--cream);
  font-size: 0.88em;
}

.entry-content pre {
  overflow-x: auto;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--cream);
}

.entry-content pre code {
  padding: 0;
  background: transparent;
}

.entry-content .MathJax {
  overflow-x: auto;
  overflow-y: hidden;
}

.entry-updated {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (max-width: 1080px) {
  .notes-page .site-nav {
    display: flex;
  }

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

@media (max-width: 760px) {
  .notes-page .site-header {
    grid-template-columns: 1fr auto;
    row-gap: 0.8rem;
  }

  .notes-page .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .notes-hero,
  .entry-hero {
    padding-top: 11.5rem;
  }

  .notes-hero-copy,
  .notes-library-heading,
  .note-tools {
    grid-template-columns: 1fr;
  }

  .notes-use-notice .notes-shell {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .notes-hero-key,
  .notes-library-heading > p {
    justify-self: start;
  }

  .note-filters {
    justify-content: flex-start;
  }

  .note-count {
    text-align: left;
  }

  .entry-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .entry-toc {
    position: static;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .notes-shell {
    width: min(100% - 1.5rem, 1160px);
  }

  .notes-page .site-nav {
    gap: 0.85rem;
  }

  .notes-hero h1 {
    font-size: 4rem;
  }

  .notes-hero::before,
  .notes-hero::after {
    display: none;
  }

  .note-grid {
    grid-template-columns: 1fr;
  }

  .note-card a {
    min-height: 19rem;
  }

  .entry-hero h1 {
    font-size: 3.5rem;
  }
}
