:root {
  color-scheme: light dark;
  --paper: #f8f9f6;
  --ink: #202923;
  --muted: #58635b;
  --accent: #326348;
  --line: #d5ddd5;
  --hover: #edf1eb;
  --focus: #326348;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html {
  scroll-padding-top: 2rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 6px;
}

::selection { background: var(--accent); color: var(--paper); }

.page {
  width: min(100% - 4rem, 62rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: .65rem 1rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-200%);
  z-index: 1;
}

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

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 5rem;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 650;
  letter-spacing: -.065em;
  text-decoration: none;
}

.wordmark-dot { color: var(--accent); }

.masthead nav { display: flex; gap: 1.5rem; }

.masthead nav a,
.footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--muted);
  font-size: .875rem;
  text-decoration: none;
}

.intro { padding-block: 4.5rem 4rem; }

.intro-label {
  margin: 0 0 1.35rem;
  color: var(--accent);
  font-size: .875rem;
  font-weight: 600;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  font-weight: 550;
  line-height: 1.08;
  letter-spacing: -.055em;
}

.intro-copy {
  max-width: 36rem;
  margin: 1.55rem 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -.025em;
}

.section-description { color: var(--muted); font-size: .8rem; }

.note { border-bottom: 1px solid var(--line); }

summary {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) 1.5rem;
  align-items: start;
  gap: 1rem;
  padding-block: 1.65rem;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

summary::-webkit-details-marker { display: none; }

.note-topic {
  padding-top: .18rem;
  color: var(--accent);
  font-size: .8rem;
  font-weight: 600;
}

.note-heading { display: block; }

.note-title {
  display: block;
  font-size: 1.25rem;
  font-weight: 550;
  line-height: 1.35;
  letter-spacing: -.025em;
}

.note-excerpt {
  display: block;
  margin-top: .45rem;
  color: var(--muted);
  font-size: .925rem;
  line-height: 1.6;
}

.note-toggle {
  position: relative;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: .15rem;
  color: var(--accent);
}

.note-toggle::before,
.note-toggle::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: .75rem;
  height: 1px;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%);
}

.note-toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
details[open] .note-toggle::after { display: none; }

.note-body {
  max-width: 43rem;
  padding: 0 1.5rem 1.5rem 8.5rem;
  font-size: .975rem;
}

.note-body p { margin: 0 0 1rem; }
.note-body p:last-child { margin-bottom: 0; }

.about {
  max-width: 38rem;
  padding-block: 3.5rem 4rem;
}

.about p { margin: .85rem 0 0; color: var(--muted); }

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}

.footer a { gap: .6rem; }

@media (hover: hover) and (pointer: fine) {
  .masthead nav a:hover,
  .footer a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: .3em; }
  summary:hover .note-title { color: var(--accent); }
}

summary:active { background: var(--hover); }

@media (max-width: 767px) {
  .page { width: min(100% - 2.5rem, 62rem); }
  .masthead { min-height: 4.5rem; }
  .masthead nav { gap: 1.25rem; }
  .intro { padding-block: 3rem 2.75rem; }
  .intro-copy { font-size: 1rem; }
  summary { grid-template-columns: minmax(0, 1fr) 1.5rem; gap: .4rem 1rem; }
  .note-topic { grid-column: 1; padding: 0; }
  .note-heading { grid-column: 1; }
  .note-toggle { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .note-title { font-size: 1.15rem; }
  .note-body { padding: 0 2rem 1.5rem 0; }
  .about { padding-block: 2.75rem 3rem; }
}

@media (max-width: 360px) {
  .page { width: calc(100% - 2rem); }
  .section-heading { align-items: start; flex-direction: column; gap: .25rem; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191e1b;
    --ink: #e3eae1;
    --muted: #abb7ac;
    --accent: #a5c9a8;
    --line: #38463b;
    --hover: #242f27;
    --focus: #a5c9a8;
  }
}

@media print {
  .masthead nav, .skip-link, .footer a, .note-toggle { display: none; }
  .page { width: 100%; }
  .intro { padding-block: 2rem; }
}
