:root {
  color-scheme: light;
  --paper: #f7f1e6;
  --paper-deep: #e9dec9;
  --ink: #1b1812;
  --muted: #776c5c;
  --line: #c8b99d;
  --red: #b23820;
  --blue: #183f55;
  --gold: #b9842e;
  --card: rgba(255, 251, 242, 0.82);
  --shadow: 0 28px 80px rgba(68, 48, 22, 0.17);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: Avenir, "Gill Sans", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(178, 56, 32, 0.17), transparent 31rem),
    radial-gradient(circle at 85% 11%, rgba(24, 63, 85, 0.14), transparent 29rem),
    linear-gradient(90deg, rgba(27, 24, 18, 0.045) 1px, transparent 1px),
    linear-gradient(var(--paper), var(--paper-deep));
  background-size: auto, auto, 74px 74px, auto;
  font-family: var(--sans);
  min-height: 100vh;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-head,
main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 10px;
}

.mark {
  display: inline-grid;
  place-items: center;
  min-width: 76px;
  height: 36px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 0.98rem;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

.nav-links a:hover {
  color: var(--ink);
}

.intro {
  position: relative;
  padding: clamp(20px, 3vw, 42px) 0 clamp(18px, 2.6vw, 34px);
}

.intro::after {
  display: none;
}

.eyebrow,
.label,
.entry-location,
.tags {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  width: 100%;
  font-family: var(--serif);
  font-size: clamp(2.35rem, 4.35vw, 4rem);
  font-weight: 500;
  line-height: 0.95;
  white-space: nowrap;
}

.lede {
  width: min(520px, 100%);
  margin-top: 12px;
  color: var(--blue);
  font-family: var(--serif);
  font-size: clamp(1rem, 1.25vw, 1.22rem);
  line-height: 1.35;
}

.control-band {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, 360px) auto;
  align-items: end;
  gap: 24px;
  margin: 8px 0 34px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.filter {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(27, 24, 18, 0.2);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 251, 242, 0.42);
  cursor: pointer;
  font: 700 0.84rem var(--sans);
}

.filter:hover,
.filter.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.search-box {
  display: grid;
  gap: 10px;
}

.search-box input {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(27, 24, 18, 0.24);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 251, 242, 0.64);
  font: 700 0.95rem var(--sans);
  outline: none;
}

.search-box input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(178, 56, 32, 0.12);
}

.archive-count {
  display: grid;
  justify-items: end;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
}

#entry-count {
  color: var(--red);
  font-family: var(--serif);
  font-size: 3.2rem;
  line-height: 0.85;
  letter-spacing: 0;
}

.timeline-wrap {
  display: grid;
  grid-template-columns: minmax(130px, 250px) minmax(0, 1fr);
  gap: clamp(22px, 5vw, 72px);
  padding-bottom: 96px;
}

.section-title {
  position: sticky;
  top: 24px;
  align-self: start;
}

.section-title h2 {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 4.4rem);
  font-weight: 500;
  line-height: 0.95;
}

.year-nav {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.year-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 10px 0 12px;
  border: 1px solid rgba(27, 24, 18, 0.16);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 251, 242, 0.36);
  cursor: pointer;
  font: 800 0.9rem var(--sans);
}

.year-button em {
  min-width: 28px;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--paper);
  background: var(--blue);
  font-style: normal;
  font-size: 0.72rem;
  text-align: center;
}

.year-button:hover,
.year-button.active {
  border-color: var(--red);
  background: rgba(178, 56, 32, 0.1);
}

.timeline {
  position: relative;
  display: grid;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 137px;
  width: 1px;
  content: "";
  background: linear-gradient(var(--line), transparent);
}

.entry {
  display: grid;
  grid-template-columns: 104px 60px minmax(0, 680px);
  gap: 12px;
  align-items: start;
}

.entry-date {
  padding-top: 18px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.2;
  text-align: right;
}

.entry-connector {
  position: relative;
  display: block;
  height: 52px;
}

.entry-connector::before {
  position: absolute;
  top: 25px;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(119, 108, 92, 0.52);
  content: "";
}

.entry-connector::after {
  position: absolute;
  top: 18px;
  left: 50%;
  width: 12px;
  aspect-ratio: 1;
  border: 2px solid var(--paper);
  border-radius: 50%;
  content: "";
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(178, 56, 32, 0.11);
  transform: translateX(-50%);
}

.entry-card {
  position: relative;
  padding: 14px;
  border: 1px solid rgba(27, 24, 18, 0.12);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.entry[data-kind="image"] .entry-card {
  display: grid;
  grid-template-columns: minmax(190px, 0.82fr) minmax(220px, 1.18fr);
  gap: 16px;
  align-items: start;
}

.entry-copy {
  min-width: 0;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 6px;
}

.entry-card h3 {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.25vw, 2.15rem);
  font-weight: 500;
  line-height: 1;
}

.entry-body {
  margin-top: 8px;
  color: #3f382d;
  font-family: var(--serif);
  font-size: clamp(0.98rem, 1.25vw, 1.18rem);
  line-height: 1.45;
}

.entry-body.collapsed {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.read-more {
  margin-top: 8px;
  padding: 0;
  border: 0;
  color: var(--red);
  background: transparent;
  cursor: pointer;
  font: 800 0.78rem var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entry-media {
  margin-top: 12px;
}

.entry[data-kind="image"] .entry-media {
  margin-top: 0;
}

.entry-media:empty {
  display: none;
}

.image-preview {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(247, 241, 230, 0.55);
  cursor: zoom-in;
  overflow: hidden;
}

.entry-media img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 220px;
  margin: 0 auto;
  border-radius: 6px;
  object-fit: contain;
  border: 1px solid rgba(27, 24, 18, 0.1);
  transition: transform 180ms ease, filter 180ms ease;
}

.image-preview:hover img {
  filter: saturate(1.06) contrast(1.03);
  transform: scale(1.012);
}

.entry-media audio {
  width: 100%;
  filter: sepia(0.14) saturate(0.8);
}

.audio-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px dashed rgba(27, 24, 18, 0.24);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 251, 242, 0.45);
  cursor: pointer;
  font: 800 0.9rem var(--sans);
}

.audio-trigger em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audio-placeholder {
  margin: 0;
  padding: 14px 16px;
  border: 1px dashed rgba(27, 24, 18, 0.24);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 251, 242, 0.45);
  font-family: var(--serif);
}

.lightbox {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 16px;
  border: 0;
  border-radius: 8px;
  background: rgba(20, 18, 14, 0.94);
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.lightbox img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 96px);
  object-fit: contain;
}

.lightbox-close {
  display: block;
  margin: 0 0 12px auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(247, 241, 230, 0.28);
  border-radius: 999px;
  color: var(--paper);
  background: transparent;
  cursor: pointer;
  font: 800 0.78rem var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 4px 8px;
  border: 1px solid rgba(27, 24, 18, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
}

.empty {
  grid-column: 2;
  padding: 32px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.35rem;
}

@media (max-width: 980px) {
  .entry[data-kind="image"] .entry-card {
    display: block;
  }

  .entry[data-kind="image"] .entry-media {
    margin-top: 12px;
  }
}

@media (max-width: 760px) {
  .site-head,
  main {
    width: min(100% - 24px, 1120px);
  }

  .nav,
  .control-band,
  .timeline-wrap,
  .entry {
    display: block;
  }

  .nav-links {
    margin-top: 18px;
  }

  .intro {
    padding-top: 22px;
  }

  .intro::after,
  .timeline::before,
  .entry-connector {
    display: none;
  }

  h1 {
    font-size: clamp(2.15rem, 10vw, 3.25rem);
    white-space: normal;
  }

  .archive-count {
    justify-items: start;
    margin-top: 22px;
  }

  .search-box {
    margin-top: 18px;
  }

  .section-title {
    position: static;
    margin-bottom: 24px;
  }

  .year-nav {
    display: flex;
    flex-wrap: wrap;
  }

  .year-button {
    min-width: 92px;
  }

  .entry-date {
    display: block;
    margin-bottom: 10px;
    padding-top: 0;
    text-align: left;
  }

  .entry-card {
    padding: 14px;
  }

  .entry-media img {
    max-height: 240px;
  }
}
