:root {
  color-scheme: light dark;
  --paper: #f2efe8;
  --ink: #191917;
  --muted: #65645e;
  --line: rgba(25, 25, 23, 0.2);
  --accent: #1558d6;
  --accent-soft: rgba(21, 88, 214, 0.09);
  --max-width: 1440px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), var(--line) 50%, transparent calc(50% + 0.5px)) top 4.75rem center / 100% 1px no-repeat,
    var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  opacity: 0;
  animation: page-in 500ms ease-out forwards;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.skip-link,
.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;
}

.skip-link:focus {
  z-index: 10;
  top: 1rem;
  left: 1rem;
  width: auto;
  height: auto;
  padding: 0.75rem 1rem;
  clip: auto;
  color: white;
  background: var(--accent);
}

.site-header,
main {
  width: min(calc(100% - 4rem), var(--max-width));
  margin-inline: auto;
}

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

.wordmark,
.home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.wordmark-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--paper);
  background: var(--ink);
  place-items: center;
  letter-spacing: -0.04em;
}

.home-link {
  color: var(--muted);
  transition: color 180ms ease;
}

.home-link:hover,
.home-link:focus-visible {
  color: var(--accent);
}

.intro {
  display: grid;
  grid-template-columns: 3fr 1fr;
  min-height: 0;
  border-bottom: 1px solid var(--line);
}

.intro-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2.5rem, 5vw, 4.5rem) 3rem clamp(2.5rem, 5vw, 4.5rem) 0;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: none;
  margin-bottom: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.5rem, 7vw, 6.75rem);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.84;
}

.lede {
  max-width: 34rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.45;
}

.catalog-count {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 0 clamp(2.5rem, 5vw, 4.5rem) clamp(2rem, 4vw, 4rem);
  border-left: 1px solid var(--line);
}

.count-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 7vw, 6.5rem);
  letter-spacing: -0.08em;
  line-height: 0.85;
}

.count-label {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.45;
  text-transform: uppercase;
}

.catalog {
  padding-block: clamp(2rem, 4vw, 3.5rem);
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}

.folder-panel {
  position: sticky;
  top: 1.25rem;
  min-width: 0;
  padding-right: clamp(1rem, 2vw, 2rem);
  border-right: 1px solid var(--line);
}

.folder-panel-label {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.folder-tree svg {
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.tree-root,
.tree-folder,
.tree-file {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.45rem;
}

.tree-root {
  min-height: 2rem;
  color: var(--ink);
  font-size: 0.77rem;
  font-weight: 750;
}

.tree-count {
  display: grid;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: auto;
  color: var(--muted);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 0.62rem;
  place-items: center;
}

.tree-list {
  margin: 0.2rem 0 0 0.45rem;
  padding: 0 0 0 0.85rem;
  border-left: 1px solid var(--line);
  list-style: none;
}

.tree-branch {
  position: relative;
  padding-block: 0.35rem;
}

.tree-branch::before {
  position: absolute;
  top: 1.15rem;
  left: -0.85rem;
  width: 0.55rem;
  border-top: 1px solid var(--line);
  content: "";
}

.tree-folder,
.tree-file {
  overflow: hidden;
  padding: 0.35rem 0.45rem;
  border-radius: 0.35rem;
  font-size: 0.72rem;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 160ms ease, background-color 160ms ease;
}

.tree-folder {
  font-weight: 700;
}

.tree-file {
  margin-left: 0.75rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.65rem;
}

.tree-folder:hover,
.tree-folder:focus-visible,
.tree-file:hover,
.tree-file:focus-visible {
  color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.tree-branch[hidden] {
  display: none;
}

.catalog-content {
  min-width: 0;
}

.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.15rem;
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 4vw, 3.75rem);
  font-weight: 400;
  letter-spacing: -0.055em;
}

.search {
  display: flex;
  align-items: center;
  width: min(100%, 22rem);
  gap: 0.65rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--ink);
}

.search svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.search input {
  width: 100%;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

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

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.filter {
  padding: 0.36rem 0.7rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 650;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.filter:hover,
.filter:focus-visible,
.filter.is-active {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.presentation-list {
  border-top: 1px solid var(--ink);
}

.presentation-row {
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(12px);
  animation: row-in 450ms ease-out forwards;
  animation-delay: calc(120ms + var(--row-index, 0) * 70ms);
}

.presentation-row[hidden] {
  display: none;
}

.presentation-link {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 8rem 2rem;
  align-items: start;
  gap: 1.1rem;
  padding: 1.15rem 0;
  text-decoration: none;
  transition: color 180ms ease, padding 180ms ease, background 180ms ease;
}

.presentation-link:hover,
.presentation-link:focus-visible {
  margin-inline: -1rem;
  padding-inline: 1rem;
  color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.presentation-index,
.presentation-meta {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.presentation-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.presentation-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 2.25vw, 2rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.presentation-description {
  max-width: 48rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.presentation-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.presentation-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: right;
}

.presentation-arrow {
  font-size: 1.35rem;
  transition: transform 180ms ease;
}

.presentation-link:hover .presentation-arrow,
.presentation-link:focus-visible .presentation-arrow {
  transform: translate(0.25rem, -0.25rem);
}

.empty-state {
  padding: 3rem 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

@keyframes page-in {
  to { opacity: 1; }
}

@keyframes row-in {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  body {
    background: var(--paper);
  }

  .site-header,
  main {
    width: min(calc(100% - 2rem), var(--max-width));
  }

  .site-header {
    min-height: 4.25rem;
  }

  .wordmark > span:last-child {
    display: none;
  }

  .intro {
    display: block;
    min-height: auto;
  }

  .intro-copy {
    padding: 2.75rem 0 1.75rem;
  }

  h1 {
    font-size: clamp(3.5rem, 18vw, 5.5rem);
  }

  .catalog-count {
    flex-direction: row;
    align-items: end;
    justify-content: space-between;
    padding: 1.25rem 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .count-value {
    font-size: 4rem;
  }

  .catalog-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-layout {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .folder-panel {
    position: static;
    padding: 0 0 1.25rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tree-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.4rem 1rem;
  }

  .search {
    width: 100%;
  }

  .presentation-link {
    grid-template-columns: 2rem minmax(0, 1fr) 1.5rem;
    gap: 0.75rem;
  }

  .presentation-meta {
    display: none;
  }

}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171816;
    --ink: #eeece5;
    --muted: #aaa89f;
    --line: rgba(238, 236, 229, 0.18);
    --accent: #79a5ff;
    --accent-soft: rgba(121, 165, 255, 0.1);
  }

  .wordmark-mark,
  .filter:hover,
  .filter:focus-visible,
  .filter.is-active {
    color: #171816;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
