@font-face {
  font-family: "DN Condensed";
  src: url("fonts/notes/DNCondensedCapitalSerif.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "OldNewspaper Types";
  src: url("fonts/notes/OldNewspaperTypes-Regular.ttf") format("truetype");
  font-display: swap;
}

.records {
  --notes-paper: #f1e8d9;
  --notes-ink: #17130f;
  --notes-accent: #710d29;
  --notes-rule: #710d296b;
  --notes-margin: clamp(1.05rem, 4.1vw, 5rem);
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  scroll-margin-block-start: 6rem;
  padding: 0 var(--notes-margin) clamp(3rem, 7vw, 6rem);
  color: var(--notes-ink);
  background:
    radial-gradient(ellipse, #753e2314 .36px, transparent .72px) 0 0 / 5px 7px,
    radial-gradient(ellipse, #fdf7eb 0, transparent 80%) 52% 21% / 100% 46rem no-repeat,
    var(--notes-paper);
}

.notes-inner {
  container-type: inline-size;
  max-width: 96rem;
  margin-inline: auto;
}

.notes-masthead {
  position: relative;
  isolation: isolate;
  padding-block: clamp(.9rem, 2.1vw, 2rem) clamp(.3rem, .95vw, .9rem);
  border-bottom: 5px double var(--notes-accent);
}

.notes-masthead::before {
  position: absolute;
  z-index: -1;
  inset: 0 calc(-1 * var(--notes-margin)) 0 54%;
  content: "";
  background: radial-gradient(circle, #820d2e 1px, transparent 1.5px) 0 0 / 8px 8px;
  opacity: .58;
  mask-image: radial-gradient(ellipse at 96% 2%, #000, #0008 36%, transparent 74%);
  pointer-events: none;
}

#records-title {
  display: grid;
  grid-template-columns: 65% 35%;
  align-items: baseline;
  margin: 0;
  letter-spacing: 0;
  translate: 0 clamp(.375rem, 1.4vw, 1.25rem);
  white-space: nowrap;
}

#records-title span { display: block; }

.notes-title-learning {
  width: max-content;
  font: 400 23cqi/.78 "DN Condensed", "Bodoni Moda", Georgia, serif;
  letter-spacing: -.018em;
  text-transform: uppercase;
  scale: .707 1;
  transform-origin: left bottom;
}

.notes-title-notes {
  justify-self: end;
  padding-inline: .04em .085em;
  color: var(--notes-accent);
  font: italic 700 16.4cqi/.96 "Almendra", Georgia, serif;
  letter-spacing: -.065em;
}

.notes-layout {
  display: grid;
  grid-template-columns: minmax(0, 27fr) minmax(0, 73fr);
  align-items: start;
  gap: clamp(.9rem, 1.85vw, 1.8rem);
  margin-top: clamp(1.15rem, 1.8vw, 1.75rem);
}

.notes-index {
  position: sticky;
  top: 1.25rem;
}

.notes-index h3 {
  margin: 0 0 clamp(.85rem, 1.55vw, 1.4rem);
  font: 400 clamp(1.35rem, 2.36cqi, 2.45rem)/1.05 "OldNewspaper Types", Georgia, serif;
}

.notes-index ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: note;
  border-top: 1px solid var(--notes-rule);
}

.notes-index li {
  position: relative;
  counter-increment: note;
  border-bottom: 1px solid var(--notes-rule);
}

.notes-index a {
  position: relative;
  display: grid;
  grid-template-columns: 2.05rem minmax(0, 1fr);
  align-items: baseline;
  gap: .5rem;
  padding-block: clamp(.65rem, 1.05vw, 1rem);
  color: inherit;
  font: 400 clamp(1.05rem, 1.78cqi, 1.67rem)/1.12 "OldNewspaper Types", Georgia, serif;
  text-decoration: none;
  transition: color .2s;
}

.notes-index a::before {
  content: counter(note, decimal-leading-zero);
  color: #9a472f;
  font: 700 .77em/1 Georgia, serif;
  font-variant-numeric: tabular-nums;
  transition: transform .32s cubic-bezier(.2, .7, .3, 1);
}

.notes-index a::after {
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  content: "";
  background: var(--notes-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .32s cubic-bezier(.2, .7, .3, 1);
}

.notes-index a:is(:hover, :focus-visible, [aria-current]) { color: var(--notes-accent); }
.notes-index a:is(:hover, :focus-visible, [aria-current])::after { transform: scaleX(1); }
.notes-index a:is(:hover, :focus-visible)::before { transform: translateX(.26rem); }
.notes-index a:focus-visible { outline: 1px solid var(--notes-accent); outline-offset: 3px; }

.notes-content {
  min-width: 0;
  padding-inline-start: clamp(.9rem, 1.85vw, 1.8rem);
  border-inline-start: 1px solid var(--notes-accent);
}

.notes-content .record-group { padding: 0; border: 0; }
.notes-content .record-category { display: none; }
.notes-content .paper-article { padding-block: 0 clamp(1.8rem, 4vw, 3.15rem); }
.notes-content .paper-article + .paper-article {
  padding-top: clamp(1.5rem, 3.4vw, 2.8rem);
  border-top: 1px solid var(--notes-rule);
}

.notes-content h3 {
  margin: 0 0 clamp(.85rem, 1.5vw, 1.35rem);
  scroll-margin-top: clamp(1.15rem, 3.2vw, 2.75rem);
  font: 400 clamp(2.1rem, 5.45cqi, 5.2rem)/.96 "OldNewspaper Types", Georgia, serif;
  letter-spacing: -.049em;
  text-wrap: balance;
}

.notes-content h3:focus-visible, #records-title:focus-visible { outline-color: var(--notes-accent); }
.notes-content h3:target { color: var(--notes-accent); }

.notes-content .paper-spread {
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(.9rem, 2.45vw, 2.4rem);
}

.notes-content .article-copy {
  max-width: 59ch;
  font: 400 clamp(1.06rem, 1.65cqi, 1.46rem)/1.48 Georgia, serif;
}

.notes-content .paper-figure { margin: 0; }
.notes-content .paper-image {
  padding: clamp(.75rem, 2.2vw, 2rem);
  border: 2px dotted var(--notes-accent);
  background:
    radial-gradient(circle, #59324924 .48px, transparent .83px) 0 0 / 4px 4px,
    #c3a8b6;
}

.notes-content .paper-image img {
  width: auto;
  max-width: 100%;
  max-height: clamp(15rem, 25.5vw, 24rem);
  margin: auto;
  background: #e5d7b8;
  box-shadow: 0 4px 8px #130f154a;
  transition: transform .36s cubic-bezier(.2, .7, .3, 1);
}

.notes-content .paper-image:is(:hover, :focus-visible) img { transform: scale(1.025) rotate(-.65deg); }
.notes-content .paper-figure figcaption { color: #584135; font: italic .9rem/1.35 Georgia, serif; }
.notes-content .paper-figure figcaption a { color: var(--notes-accent); }

@media (prefers-reduced-motion: no-preference) {
  .notes-title-learning { animation: notes-type-reveal .66s cubic-bezier(.24, .67, .28, 1) both; }
  .notes-title-notes { animation: notes-type-reveal .68s cubic-bezier(.24, .67, .28, 1) .1s both; }
  @keyframes notes-type-reveal {
    from { opacity: 0; clip-path: inset(100% -.2em -.2em); transform: translateY(.14em); }
    to { opacity: 1; clip-path: inset(-.22em -.2em -.22em); transform: none; }
  }
}

@media (max-width: 700px) {
  .notes-masthead { padding-block: .95rem .6rem; }
  .notes-title-learning { font-size: 22.5cqi; }
  .notes-title-notes { font-size: 15cqi; }
  .notes-layout { grid-template-columns: minmax(0, 1fr); gap: 1.7rem; }
  .notes-index { position: static; padding: 0; border: 0; }
  .notes-index h3 { margin-bottom: .6rem; }
  .notes-index a { min-height: 2.75rem; align-items: center; }
  .notes-content { padding-inline-start: 0; border: 0; }
  .notes-content .paper-spread { grid-template-columns: minmax(0, 1fr); }
  .notes-content .paper-figure { max-width: 27rem; }
  .notes-content h3 { font-size: clamp(2.35rem, 8.3cqi, 3.55rem); }
}

@media (min-width: 68.75rem) {
  .notes-content .paper-figure { margin-top: -.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .notes-index a, .notes-index a::before, .notes-index a::after, .notes-content .paper-image img { transition: none; }
  .notes-content .paper-image:is(:hover, :focus-visible) img { transform: none; }
}
