:root {
  --paper: #efe7d1;
  --paper-deep: #e3d6b9;
  --ink: #1c211d;
  --muted: #63655d;
  --accent: #ad3e2f;
  --accent-ink: #fff8e9;
  --line: rgba(28, 33, 29, 0.26);
  --panel: rgba(255, 252, 242, 0.56);
  --shadow: 0 18px 45px rgba(45, 39, 25, 0.11);
  --display: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
}

html[data-wing="bugs"] { --accent: #5a6249; --accent-ink: #fbf8ec; }
html[data-wing="almost"] { --accent: #346d74; --accent-ink: #f2fbf9; }
html[data-wing="funerals"] { --accent: #654d78; --accent-ink: #fbf6ff; }

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.65), transparent 24rem),
    linear-gradient(rgba(28, 33, 29, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 100% 12px, auto;
  font-family: var(--sans);
  line-height: 1.6;
  min-width: 18rem;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background:
    repeating-radial-gradient(circle at 0 0, transparent 0 3px, rgba(28, 33, 29, 0.12) 3px 3.6px),
    repeating-linear-gradient(97deg, transparent 0 19px, rgba(28, 33, 29, 0.08) 19px 20px);
  background-size: 31px 29px, 43px 37px;
  z-index: 20;
}

a { color: inherit; text-underline-offset: 0.22em; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

:focus-visible {
  outline: 3px solid #1967d2;
  outline-offset: 4px;
}

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: white;
  transform: translateY(-180%);
  z-index: 100;
}

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

.masthead {
  max-width: 90rem;
  min-height: 5.6rem;
  margin: 0 auto;
  padding: 0 3rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  line-height: 1.15;
}

.brand-mark {
  width: 2.65rem;
  aspect-ratio: 1;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 500 0.65rem var(--mono);
  letter-spacing: 0.08em;
}

.brand strong {
  display: block;
  font: 650 1.05rem var(--display);
}

.brand small {
  display: block;
  margin-top: 0.22rem;
  color: var(--muted);
  font: 400 0.66rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.masthead nav { display: flex; align-items: stretch; align-self: stretch; }

.masthead nav a {
  display: grid;
  place-items: center;
  padding: 0 1.1rem;
  border-inline-start: 1px solid var(--line);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.masthead nav a:last-child { border-inline-end: 1px solid var(--line); }
.masthead nav a:hover, .masthead nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.menu-button { display: none; border: 0; background: transparent; font-weight: 700; }

main, footer { overflow: hidden; }

.hero {
  width: min(84rem, calc(100% - 6rem));
  margin: 0 auto;
  padding: clamp(5rem, 9vw, 9rem) 0 clamp(4rem, 7vw, 7rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 25rem);
  gap: clamp(3rem, 8vw, 9rem);
  align-items: center;
}

.eyebrow, .specimen-number, .card-kicker {
  margin: 0 0 1rem;
  color: var(--accent);
  font: 500 0.71rem var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }

h1 {
  max-width: 15ch;
  margin: 0;
  font: 650 clamp(3.35rem, 7vw, 7.25rem)/0.92 var(--display);
  letter-spacing: -0.055em;
}

.lede {
  max-width: 42rem;
  margin: 2rem 0 0;
  color: #41443e;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.7;
}

.hero-actions { margin-top: 2.3rem; display: flex; align-items: center; gap: 1.7rem; flex-wrap: wrap; }

.button {
  min-height: 3.25rem;
  padding: 0.78rem 1.25rem;
  border: 1px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(28, 33, 29, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 rgba(28, 33, 29, 0.18); }
.button:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(28, 33, 29, 0.16); }
.button:disabled { opacity: 0.55; cursor: wait; }
.button-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button-secondary { background: transparent; }
.text-link { font-weight: 700; }

.admission-card {
  position: relative;
  min-height: 25rem;
  padding: 2.2rem;
  border: 1px solid var(--ink);
  background: var(--panel);
  box-shadow: 14px 14px 0 color-mix(in srgb, var(--accent) 22%, transparent);
  transform: rotate(1.25deg);
}

.admission-card::before, .admission-card::after {
  content: "";
  position: absolute;
  width: 1rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--ink);
  left: -0.55rem;
}

.admission-card::before { top: 4rem; }
.admission-card::after { bottom: 4rem; }
.large-number { margin: 2rem 0 0; font: 650 6rem/0.8 var(--display); color: var(--accent); }
.large-number + p { margin-top: 1.2rem; }
.admission-rule { border-top: 1px dashed var(--line); margin: 2rem 0; }

.stamp {
  position: absolute;
  right: 1.4rem;
  bottom: 1.3rem;
  width: 5.5rem;
  aspect-ratio: 1;
  border: 3px double var(--accent);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent);
  font: 500 0.68rem/1.15 var(--mono);
  text-align: center;
  transform: rotate(-12deg);
  opacity: 0.75;
}

.ticker {
  border-block: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}

.ticker p { width: max-content; margin: 0; padding: 0.72rem 1rem; font: 400 0.72rem var(--mono); letter-spacing: 0.05em; }

.wing-cards, .collection, .submit-section, .pricing {
  width: min(84rem, calc(100% - 6rem));
  margin: 0 auto;
  padding: clamp(5rem, 9vw, 8rem) 0;
}

.section-heading { margin-bottom: 3rem; }
.section-heading h2, .submit-intro h2 {
  max-width: 18ch;
  margin: 0;
  font: 650 clamp(2.4rem, 4.5vw, 4.4rem)/1 var(--display);
  letter-spacing: -0.035em;
}

.wing-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--ink); }
.wing-card { min-height: 30rem; padding: 2rem; display: flex; flex-direction: column; border-inline-end: 1px solid var(--ink); background: rgba(255,255,255,0.15); }
.wing-card:last-child { border: 0; }
.wing-card:hover { background: var(--panel); }
.wing-symbol { margin: 2rem 0 4.5rem; font: 500 5rem/1 var(--display); color: var(--accent); }
.wing-bugs .wing-symbol { color: #5a6249; }
.wing-almost .wing-symbol { color: #346d74; }
.wing-funerals .wing-symbol { color: #654d78; }
.wing-card h3 { margin: 0; font: 650 2rem/1.08 var(--display); }
.wing-card p:not(.specimen-number) { color: var(--muted); }
.wing-card a { margin-top: auto; font-weight: 700; }

.collection { border-top: 1px solid var(--line); }
.collection-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; }
.filter-row { display: flex; border: 1px solid var(--ink); }
.filter-row button { padding: 0.65rem 0.85rem; border: 0; border-inline-end: 1px solid var(--ink); background: transparent; cursor: pointer; font-size: 0.78rem; font-weight: 700; }
.filter-row button:last-child { border: 0; }
.filter-row button:hover, .filter-row button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.artifact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.artifact-card { min-height: 20rem; padding: 1.5rem; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; transition: transform 160ms ease, border-color 160ms ease; }
.artifact-card:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: var(--shadow); }
.artifact-card[data-kind="bug_cemetery"] { border-top: 5px solid #5a6249; }
.artifact-card[data-kind="museum_almost"] { border-top: 5px solid #346d74; }
.artifact-card[data-kind="api_funeral"] { border-top: 5px solid #654d78; }
.artifact-topline, .artifact-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.artifact-kind { font: 500 0.65rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.artifact-symbol { font-size: 1.5rem; }
.artifact-card h3 { margin: 2rem 0 0.8rem; font: 650 1.65rem/1.1 var(--display); }
.artifact-excerpt { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 4; -webkit-box-orient: vertical; color: var(--muted); }
.artifact-footer { margin-top: auto; padding-top: 2rem; border-top: 1px solid var(--line); font-size: 0.75rem; }
.artifact-open { font-weight: 700; }

.gallery-state { min-height: 18rem; padding: 4rem 2rem; border: 1px dashed var(--line); text-align: center; display: grid; place-items: center; align-content: center; }
.gallery-state h3 { margin: 0.5rem 0; font: 650 1.7rem var(--display); }
.gallery-state p { max-width: 34rem; margin: 0.5rem auto; color: var(--muted); }
.gallery-state .button { margin-top: 1.2rem; }
.state-symbol { color: var(--accent) !important; font: 650 3rem var(--display); }
.loader { width: 2.2rem; aspect-ratio: 1; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.submit-section { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(3rem, 8vw, 8rem); border-top: 1px solid var(--line); }
.submit-intro > p:not(.eyebrow) { max-width: 34rem; color: var(--muted); font-size: 1.05rem; }
.promise-list { margin-top: 3rem; border-top: 1px solid var(--line); }
.promise-list div { padding: 1rem 0; display: grid; grid-template-columns: 8rem 1fr; border-bottom: 1px solid var(--line); gap: 1rem; }
.promise-list dt { font-weight: 700; }
.promise-list dd { margin: 0; color: var(--muted); }

form { padding: clamp(1.5rem, 4vw, 3rem); border: 1px solid var(--ink); background: rgba(255, 252, 242, 0.5); box-shadow: 12px 12px 0 rgba(28,33,29,0.08); }
.field-row { margin-bottom: 1.45rem; }
.field-row label { display: block; margin-bottom: 0.45rem; font-weight: 700; }
.field-row label span { font-weight: 400; color: var(--muted); }
input, textarea, select { width: 100%; border: 1px solid var(--ink); border-radius: 0; padding: 0.78rem 0.85rem; color: var(--ink); background: rgba(255,255,255,0.5); }
textarea { resize: vertical; min-height: 9rem; }
input:hover, textarea:hover, select:hover { background: rgba(255,255,255,0.75); }
input:user-invalid, textarea:user-invalid, select:user-invalid { border-color: #a22e23; }
.field-help, .field-meta, .fine-print { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.74rem; }
.field-meta { display: flex; justify-content: space-between; gap: 1rem; }
.check-row { display: grid; grid-template-columns: 1.2rem 1fr; gap: 0.75rem; align-items: start; margin: 1.5rem 0; font-size: 0.82rem; }
.check-row input { width: 1.1rem; aspect-ratio: 1; margin: 0.15rem 0 0; }
.turnstile-field { margin: 1.5rem 0; min-height: 4.1rem; }
.turnstile-field .field-help { margin-top: 0.55rem; }
.form-error { margin: 1rem 0; padding: 0.85rem; border-inline-start: 4px solid #a22e23; background: rgba(162,46,35,0.08); }
.submit-button { width: 100%; }
.fine-print { text-align: center; }
.success-state { min-height: 30rem; display: grid; place-items: center; align-content: center; text-align: center; }
.success-state h3 { margin: 0.4rem 0; font: 650 2rem var(--display); }
.success-state p { max-width: 28rem; }
.success-state .button { margin-top: 1rem; }
.text-button { padding: 0.6rem; border: 0; background: transparent; text-decoration: underline; cursor: pointer; }

.pricing { border-top: 1px solid var(--line); }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.price-grid article { min-height: 15rem; padding: 1.8rem; border: 1px solid var(--line); border-inline-end: 0; }
.price-grid article:last-child { border-inline-end: 1px solid var(--line); }
.price-grid article.featured-price { border: 2px solid var(--accent); background: var(--panel); transform: translateY(-0.7rem); }
.price { margin: 0; color: var(--accent); font: 650 2rem var(--display); }
.price small { font: 400 0.72rem var(--mono); }
.price-grid h3 { font: 650 1.35rem var(--display); }
.price-grid article > span { font: 500 0.65rem var(--mono); color: var(--accent); text-transform: uppercase; }

dialog { width: min(41rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid var(--ink); color: var(--ink); background: var(--paper); box-shadow: 0 2rem 8rem rgba(0,0,0,0.4); }
dialog::backdrop { background: rgba(24, 25, 22, 0.72); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; top: 0.6rem; right: 0.8rem; width: 2.5rem; aspect-ratio: 1; border: 0; background: transparent; font-size: 2rem; cursor: pointer; }
.dialog-plaque { padding: clamp(2rem, 7vw, 4rem); }
.dialog-symbol { margin: 3rem 0 1rem; color: var(--accent); font: 650 4rem var(--display); }
.dialog-plaque h2 { margin: 0; max-width: 13ch; font: 650 clamp(2.2rem, 7vw, 4rem)/1 var(--display); }
.dialog-story { margin: 2rem 0; white-space: pre-wrap; color: #41443e; font-size: 1.05rem; }
.dialog-details { border-block: 1px solid var(--line); }
.dialog-details div { display: grid; grid-template-columns: 8rem 1fr; padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
.dialog-details div:last-child { border-bottom: 0; }
.dialog-details dt { font: 500 0.67rem var(--mono); text-transform: uppercase; }
.dialog-details dd { margin: 0; }
.dialog-plaque .button { margin-top: 1.5rem; }
.copy-status { min-height: 1.5rem; color: var(--muted); font-size: 0.75rem; }

.policy-dialog {
  width: min(70rem, calc(100% - 2rem));
  height: min(46rem, calc(100dvh - 2rem));
  max-height: calc(100dvh - 2rem);
}

.policy-close {
  position: absolute;
  z-index: 2;
  top: 0.55rem;
  right: 0.7rem;
  width: 2.7rem;
  aspect-ratio: 1;
  border: 0;
  background: var(--paper);
  font-size: 2rem;
  cursor: pointer;
}

.policy-shell {
  min-height: 100%;
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
}

.policy-nav {
  padding: 4rem 1rem 1rem;
  border-inline-end: 1px solid var(--line);
  background: rgba(28, 33, 29, 0.035);
}

.policy-nav button {
  width: 100%;
  padding: 0.8rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: start;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.policy-nav button:hover,
.policy-nav button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.policy-body { padding: clamp(2rem, 6vw, 4rem); overflow-y: auto; }
.policy-body > h2 { margin: 0 0 2rem; font: 650 clamp(2rem, 5vw, 3.5rem)/1 var(--display); }
.policy-panel { max-width: 46rem; }
.policy-panel h3 { margin: 0 0 1.4rem; font: 650 1.8rem var(--display); }
.policy-panel h4 { margin: 1.7rem 0 0.4rem; font-size: 0.95rem; }
.policy-panel p, .policy-panel li { color: #41443e; }
.policy-panel li + li { margin-top: 0.55rem; }
.policy-panel:focus { outline: 0; }
.policy-panel:focus-visible { outline: 3px solid #1967d2; outline-offset: 6px; }

.report-form {
  margin-top: 2rem;
  padding: 1.4rem;
  box-shadow: none;
}

.report-success {
  min-height: 20rem;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.report-success h4 { margin: 0; font: 650 1.7rem var(--display); }
.report-success p { text-align: center; }

footer { width: min(84rem, calc(100% - 6rem)); margin: 0 auto; padding: 3rem 0 4rem; border-top: 1px solid var(--ink); display: flex; justify-content: space-between; gap: 3rem; color: var(--muted); font-size: 0.78rem; }
.footer-brand { margin: 0; color: var(--ink); font: 650 1.15rem var(--display); }
footer p { margin: 0.3rem 0; }
footer nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }

@media (max-width: 900px) {
  .masthead { padding-inline: 1.5rem; }
  .menu-button { display: block; }
  .masthead nav { display: none; position: absolute; z-index: 10; right: 1.5rem; top: 4.7rem; width: min(18rem, calc(100% - 3rem)); border: 1px solid var(--ink); background: var(--paper); box-shadow: var(--shadow); }
  .masthead nav.is-open { display: block; }
  .masthead nav a { min-height: 3rem; border: 0; border-bottom: 1px solid var(--line); }
  .masthead nav a:last-child { border: 0; }
  .brand small { display: none; }
  .hero { grid-template-columns: 1fr; gap: 4rem; }
  .admission-card { width: min(24rem, 100%); }
  .wing-grid { grid-template-columns: 1fr; }
  .wing-card { min-height: 23rem; border: 0; border-bottom: 1px solid var(--ink); }
  .wing-card:last-child { border: 0; }
  .wing-symbol { margin-bottom: 2rem; }
  .artifact-grid { grid-template-columns: repeat(2, 1fr); }
  .submit-section { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .masthead { min-height: 4.7rem; }
  .brand strong { font-size: 0.94rem; }
  .brand-mark { width: 2.2rem; }
  .hero, .wing-cards, .collection, .submit-section, .pricing, footer { width: min(100% - 2rem, 84rem); }
  .hero { padding-top: 4.5rem; }
  h1 { font-size: clamp(3rem, 17vw, 5rem); }
  .admission-card { min-height: 21rem; padding: 1.5rem; }
  .large-number { font-size: 4.5rem; }
  .collection-heading { align-items: start; flex-direction: column; }
  .filter-row { width: 100%; overflow-x: auto; }
  .filter-row button { flex: 1 0 auto; }
  .artifact-grid { grid-template-columns: 1fr; }
  .artifact-card { min-height: 18rem; }
  .field-meta { display: block; }
  .promise-list div { grid-template-columns: 1fr; gap: 0.15rem; }
  form { padding: 1.2rem; }
  .price-grid { grid-template-columns: 1fr; gap: 0.8rem; }
  .price-grid article, .price-grid article:last-child { min-height: auto; border: 1px solid var(--line); }
  .price-grid article.featured-price { transform: none; }
  footer { flex-direction: column; }
  footer nav { flex-direction: column; gap: 0.6rem; }
  .policy-shell { display: block; }
  .policy-nav { padding: 3.6rem 1rem 0; border: 0; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; }
  .policy-nav button { width: auto; flex: 0 0 auto; border: 0; border-inline-end: 1px solid var(--line); }
  .policy-body { padding: 1.5rem; }
}

@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; }
  .loader { animation: none; border-top-color: var(--line); border-inline-start-color: var(--accent); }
}

@media (prefers-contrast: more) {
  :root { --line: rgba(28, 33, 29, 0.65); --muted: #3e403b; }
  .artifact-card, form, .price-grid article { background: var(--paper); }
}

@media print {
  .masthead nav, .menu-button, .hero-actions, .ticker, .filter-row, .submit-section, .pricing, footer, .dialog-close, .dialog-plaque .button { display: none !important; }
  body { background: white; }
  .hero, .collection { width: 100%; padding: 2rem 0; }
}
