:root {
  --paper: #f7f0e6;
  --paper-deep: #ecdcca;
  --paper-dark: #d9c0a0;
  --ink: #221916;
  --muted: #6c5d53;
  --line: rgba(34, 25, 22, 0.12);
  --accent: #aa5339;
  --accent-deep: #6b2f25;
  --tape: #efe6b0;
  --shadow: 0 24px 70px rgba(67, 44, 29, 0.14);
  --shadow-soft: 0 18px 40px rgba(67, 44, 29, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(170, 83, 57, 0.14), transparent 22%),
    radial-gradient(circle at 88% 8%, rgba(217, 192, 160, 0.45), transparent 18%),
    linear-gradient(180deg, #fcf7f1 0%, var(--paper) 35%, #efe1d2 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.25) 1px, transparent 1px);
  background-size: 28px 28px;
}

img {
  display: block;
  max-width: 100%;
}

button,
a {
  color: inherit;
}

.page-shell {
  position: relative;
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 72px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 244, 0.82);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fffaf5;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
}

.topbar-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.topbar-link {
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid currentColor;
}

.eyebrow,
.kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.74rem;
  color: var(--muted);
}

h1,
h2,
h3,
.hero-text,
.chapter-title,
.polaroid-title {
  font-family: "Cormorant Garamond", serif;
}

h1 {
  margin: 2px 0 0;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.95;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  margin: 0 0 10px;
  font-size: 1.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 34px;
  align-items: center;
  padding: 42px 4px 24px;
}

.hero-copy {
  padding: 20px 4px 20px 0;
}

.hero-text {
  margin: 16px 0 0;
  max-width: 10ch;
  font-size: clamp(2.4rem, 5vw, 5.4rem);
  line-height: 0.94;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  text-decoration: none;
  border-radius: 999px;
  padding: 14px 20px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.button:hover,
.button:focus-visible,
.filter-chip:hover,
.filter-chip:focus-visible,
.polaroid:hover,
.polaroid:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  color: #fffaf5;
  background: var(--ink);
  box-shadow: 0 16px 34px rgba(34, 25, 22, 0.16);
}

.button-secondary {
  background: rgba(255, 250, 244, 0.86);
  border: 1px solid var(--line);
}

.hero-board {
  position: relative;
  min-height: 520px;
}

.board-snippet {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 48%;
  min-height: 220px;
  padding: 18px;
  border-radius: 26px;
  color: #fff8f1;
  box-shadow: var(--shadow);
  transform: rotate(var(--angle, 0deg));
}

.board-snippet::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 22px;
  width: 74px;
  height: 22px;
  background: rgba(239, 230, 176, 0.8);
  border-radius: 4px;
  transform: rotate(-5deg);
}

.board-snippet span {
  font-size: 2.1rem;
  font-weight: 800;
}

.board-snippet p {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.board-snippet-large {
  top: 10px;
  left: 0;
  min-height: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.3)),
    linear-gradient(135deg, #6f4339 0%, #c28d63 100%);
  --angle: -4deg;
}

.board-snippet-note {
  top: 62px;
  right: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.24)),
    linear-gradient(135deg, #88412c 0%, #55312b 100%);
  --angle: 5deg;
}

.board-snippet-polka {
  left: 8%;
  bottom: 28px;
  background:
    radial-gradient(circle at 12px 12px, rgba(255, 255, 255, 0.16) 2px, transparent 2.6px),
    linear-gradient(135deg, #be7f5f 0%, #6b402d 100%);
  background-size: auto, 28px 28px, auto;
  --angle: 3deg;
}

.board-snippet-accent {
  right: 0;
  bottom: 0;
  min-height: 260px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.28)),
    linear-gradient(135deg, #ab4b3b 0%, #4d2927 100%);
  --angle: -3deg;
}

.intro-panel {
  margin: 22px 0 54px;
  padding: 20px 22px;
  border-left: 3px solid var(--accent);
  background: rgba(255, 248, 240, 0.6);
}

.intro-panel p,
.note-card p,
.chapter-caption,
.chapter-note p,
.lightbox-copy p:last-child {
  color: var(--muted);
}

.section-heading {
  margin-bottom: 22px;
}

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

.filter-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 250, 244, 0.88);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
}

.filter-chip.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fffaf5;
}

.timeline-list {
  position: relative;
  display: grid;
  gap: 34px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 145px;
  width: 2px;
  background: linear-gradient(180deg, rgba(34, 25, 22, 0.14), rgba(34, 25, 22, 0.04));
}

.timeline-entry {
  position: relative;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.timeline-year {
  position: sticky;
  top: 18px;
  z-index: 1;
  padding-top: 8px;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.timeline-year::after {
  content: "";
  position: absolute;
  top: 24px;
  right: -28px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 7px rgba(170, 83, 57, 0.12);
}

.timeline-card {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid rgba(34, 25, 22, 0.08);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.18)),
    rgba(255, 249, 242, 0.82);
  box-shadow: var(--shadow);
}

.timeline-card::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 32px;
  width: 86px;
  height: 24px;
  border-radius: 4px;
  background: rgba(239, 230, 176, 0.88);
  transform: rotate(4deg);
}

.chapter-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.chapter-title {
  margin: 4px 0 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.94;
}

.chapter-tag {
  flex: 0 0 auto;
  align-self: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  background: rgba(170, 83, 57, 0.1);
  color: var(--accent-deep);
}

.chapter-caption {
  margin: 0;
  max-width: 60ch;
}

.timeline-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 22px;
  align-items: start;
}

.polaroid-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.polaroid {
  appearance: none;
  border: 0;
  padding: 14px 14px 18px;
  background: #fffdf9;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.polaroid:nth-child(odd) {
  transform: rotate(-2deg);
}

.polaroid:nth-child(even) {
  transform: rotate(2deg);
}

.polaroid:hover,
.polaroid:focus-visible {
  box-shadow: var(--shadow);
}

.polaroid-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: linear-gradient(135deg, #c18b66 0%, #5c3428 100%);
}

.polaroid-frame img,
.photo-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  display: flex;
  align-items: end;
  padding: 16px;
  color: #fffaf5;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.3)),
    linear-gradient(135deg, #be7a58 0%, #64382c 100%);
}

.photo-placeholder span {
  font-size: 1.6rem;
  font-family: "Cormorant Garamond", serif;
}

.polaroid-title {
  margin: 12px 0 4px;
  font-size: 1.55rem;
}

.polaroid-caption {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.chapter-note {
  position: relative;
  padding: 22px 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.2)),
    #f1e2c2;
  box-shadow: var(--shadow-soft);
}

.chapter-note::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 18px;
  width: 64px;
  height: 18px;
  border-radius: 4px;
  background: rgba(255, 247, 181, 0.9);
  transform: rotate(-6deg);
}

.chapter-note p {
  margin: 0;
  line-height: 1.65;
}

.notes-section {
  margin-top: 64px;
}

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

.note-card {
  padding: 24px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 244, 0.76);
  box-shadow: var(--shadow-soft);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.lightbox {
  width: min(980px, calc(100% - 24px));
  border: 0;
  padding: 0;
  background: transparent;
}

.lightbox::backdrop {
  background: rgba(16, 12, 10, 0.82);
  backdrop-filter: blur(6px);
}

.lightbox-backdrop {
  display: flex;
  justify-content: flex-end;
}

.lightbox-close {
  margin-bottom: 12px;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255, 248, 240, 0.9);
  cursor: pointer;
}

.lightbox-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: end;
}

.lightbox-body img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 24px;
  background: #241713;
}

.lightbox-copy {
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 250, 244, 0.94);
}

.fade-in {
  animation: fadeInUp 500ms ease both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .hero-grid,
  .timeline-layout,
  .notes-grid,
  .lightbox-body {
    grid-template-columns: 1fr;
  }

  .hero-board {
    min-height: 420px;
  }

  .timeline-list::before {
    left: 23px;
  }

  .timeline-entry {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-left: 46px;
  }

  .timeline-year {
    position: relative;
    top: 0;
    padding-top: 0;
  }

  .timeline-year::after {
    left: -30px;
    right: auto;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: calc(100% - 20px);
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-grid {
    gap: 22px;
    padding-top: 28px;
  }

  .hero-text {
    max-width: 11ch;
  }

  .hero-board {
    min-height: 360px;
  }

  .board-snippet {
    width: 52%;
    min-height: 180px;
  }

  .board-snippet-large {
    min-height: 220px;
  }

  .polaroid-stack {
    grid-template-columns: 1fr;
  }

  .chapter-header {
    flex-direction: column;
  }
}
