@font-face {
  font-family: "IM Fell English";
  src: url("fonts/im-fell-english-v14.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IM Fell English";
  src: url("fonts/im-fell-english-italic-v14.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --night: #151e25;
  --night-ink: #f8ecd4;
  --gold: #e9bd7f;
  --ink: #2b2520;
  --muted: #655347;
  --paper: #eee2cb;
  --slip: #fbf3e1;
  --rule: #c6b596;
  --red: #8b4038;
  --green: #28483e;
  --serif: "IM Fell English", Georgia, serif;
  --mono: ui-monospace, "Courier New", monospace;
  --grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 150 150' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23000' opacity='.14' filter='url(%23n)' d='M0 0h150v150H0z'/%3E%3C/svg%3E");
}

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

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 1rem/1.55 Georgia, serif;
}

button, select { font: inherit; }
button, select, a { -webkit-tap-highlight-color: #a56c3445; }
button, select { color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .64; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #935028; outline-offset: 4px; }
.masthead :focus-visible, .title-plate :focus-visible { outline-color: var(--gold); }
::selection { color: #fff5df; background: #744440; }

.wrap {
  width: min(1200px, 100%);
  margin-inline: auto;
  padding-left: max(36px, env(safe-area-inset-left));
  padding-right: max(36px, env(safe-area-inset-right));
}

.label {
  font: .75rem/1.4 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: max(10px, env(safe-area-inset-left));
  z-index: 5;
  padding: 12px;
  background: var(--slip);
  translate: 0 -160%;
}

.skip-link:focus { translate: none; }

.masthead {
  position: relative;
  z-index: 2;
  padding-top: env(safe-area-inset-top);
  color: var(--gold);
  background: #131c23;
  border-bottom: 1px solid #66533b;
}

.masthead-inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.house-mark {
  display: inline-flex;
  align-items: center;
  gap: .43em;
  color: var(--night-ink);
  font: 1.34rem/1 var(--serif);
}

.house-mark svg { color: var(--gold); margin-right: 5px; flex: none; }
.house-amp { color: var(--gold); font-style: italic; }

.snow-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--gold);
  font: .75rem/1.2 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.snow-toggle:hover { color: #fff1d0; }

.title-plate {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 31px max(28px, env(safe-area-inset-right)) 82px max(28px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 105%, #3b3b32, transparent 67%), #19232b;
  color: var(--night-ink);
  text-align: center;
  border-bottom: 4px double #aa8052;
}

.title-plate::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--grain) 0 0 / 150px;
  content: "";
  pointer-events: none;
  opacity: .45;
}

.town {
  position: absolute;
  z-index: -3;
  inset: 0;
  background: url("counting-house.svg") bottom center / max(100%, 950px) auto no-repeat;
}

.town::after {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 40% 68% at 50% 50%, #19232bc9, #19232b80 64%, transparent 100%);
  content: "";
}

.snow {
  display: none;
  position: absolute;
  z-index: -2;
  inset: -180px 0 0;
  background: url("snow.svg") 0 0 / 260px 180px;
  opacity: .64;
  pointer-events: none;
}

.snow.is-active { display: block; animation: snowfall 22s linear infinite; }
@keyframes snowfall { to { transform: translate(0, 180px); } }

.plate-frame {
  position: absolute;
  z-index: -1;
  inset: 13px max(16px, env(safe-area-inset-right)) 15px max(16px, env(safe-area-inset-left));
  border: 1px solid #c59d654f;
  outline: 1px solid #c59d6524;
  outline-offset: -5px;
  pointer-events: none;
}

.title-content { max-width: 890px; margin: auto; }

.title-ornament {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: max-content;
  margin: 0 auto 8px;
  color: var(--gold);
}

.title-ornament > svg { opacity: .72; }
.reverse { transform: scaleX(-1); }

.candle {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  background: transparent;
  color: var(--gold);
  filter: drop-shadow(0 0 11px #f3b45f6b);
}

.candle:hover, .candle[aria-expanded="true"] { filter: drop-shadow(0 0 10px #ffc26c); }

.candle-surprise {
  position: absolute;
  z-index: 2;
  top: 49px;
  left: 50%;
  translate: -50% 0;
  width: max-content;
  padding: 8px 13px;
  border: 1px solid #b58b58;
  background: #f6e7c8;
  color: var(--green);
  box-shadow: 0 4px 14px #0c121b70;
  font: italic 1.12rem/1.2 var(--serif);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 400; }

.title-plate h1 {
  margin: 0;
  font-size: clamp(2.65rem, 6.1vw, 5.45rem);
  line-height: .99;
  letter-spacing: -.034em;
  text-wrap: balance;
  text-shadow: 0 3px 0 #0c151d, 0 6px 24px #11181d;
}

.title-plate h1 em {
  display: block;
  color: var(--gold);
  font-size: .89em;
  line-height: 1.04;
  letter-spacing: -.04em;
}

.dedication {
  margin: 20px 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px .65em;
  color: #f1d5a8;
  font: .75rem/1.5 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.dedication span { white-space: nowrap; }

.dedication span::before {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 .8em 2px 0;
  background: var(--gold);
  transform: rotate(45deg);
  content: "";
}

.intro {
  max-width: 490px;
  margin: 13px auto 0;
  color: #e8decb;
  font-size: 1rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.paper {
  background: var(--grain) 0 0 / 150px, radial-gradient(ellipse at 50% 0, #faf1da, transparent 54rem), var(--paper);
}

.book { display: flow-root; }

.quote-plate {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 108px;
  margin-top: -35px;
  padding: 18px 25px;
  border: 1px solid #a58c65;
  outline: 1px solid #b4a18080;
  outline-offset: -6px;
  background: var(--grain) 0 0 / 150px, #f8eed8;
  box-shadow: 0 3px 0 #cbb797, 0 8px 20px #4c361a21;
}

.quote-label {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: stretch;
  padding-right: 22px;
  border-right: 1px solid #c7b18e;
  color: #77372e;
}

.quote-label h2 { margin: 0; white-space: nowrap; }
.quote-mark { align-self: center; height: .65em; font: 4.6rem/.93 var(--serif); }

.quote-copy blockquote {
  margin: 0;
  color: #382a21;
  font: italic clamp(1.27rem, 2.15vw, 1.78rem)/1.12 var(--serif);
}

.quote-copy p { margin: 6px 0 0; color: var(--muted); font-size: .84rem; }

.quote-next, .return-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid #ad9776;
  background: #f7ecd4;
  color: #67392b;
  font-size: .92rem;
  white-space: nowrap;
}

.quote-next span { font: 1.25rem/1 Georgia, serif; }
.quote-next:hover:not(:disabled), .return-link:hover { background: #eadebf; }

.ledger { margin-top: 36px; padding-bottom: 65px; }

.ledger-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.ledger-heading h2 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 3.7rem);
  line-height: 1;
  letter-spacing: -.047em;
}

.ghost-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px 15px 6px 10px;
  border: 1px solid #355045;
  outline: 1px dashed #b9ab80a8;
  outline-offset: -5px;
  background: var(--grain) 0 0 / 150px, var(--green);
  color: #fff2d6;
  box-shadow: 1px 2px 0 #b8a580;
  text-align: left;
  font: 1.12rem/1.05 var(--serif);
}

.ghost-button svg { flex: none; }

.ghost-button small {
  display: block;
  margin-top: 4px;
  color: #efe0b6;
  font: .68rem/1.2 var(--mono);
  letter-spacing: .03em;
}

.ghost-button:hover:not(:disabled) { background-color: #365b4e; }
.ghost-button:focus-visible { outline: 2px solid #935028; outline-offset: 4px; }

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-bottom: 11px;
  border-bottom: 3px double #ad8f71;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid #bba581;
  background: #f9efd880;
  color: #4a382b;
  font-size: .9rem;
}

.category-tab .tab-count {
  min-width: 1.8em;
  padding: 2px 3px;
  border: 1px solid #ae957d80;
  color: #634638;
  font: .72rem/1.1 var(--mono);
  text-align: center;
}

.category-tab:hover { background-color: #e6d5b3; }
.category-tab[aria-pressed="true"] { border-color: #64382f; background: #773c34; color: #fff3d5; }
.category-tab[aria-pressed="true"] .tab-count { border-color: #eed5a688; color: #fff3d5; }

.ledger-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin: 9px 0 13px;
}

#entry-count { margin: 0; color: #654b3b; }

.selects, .selects label { display: flex; align-items: center; }
.selects { gap: 15px; }
.selects label { gap: 7px; color: #523e31; font-size: .85rem; white-space: nowrap; }

.selects select {
  appearance: none;
  min-height: 44px;
  padding: 8px 26px 8px 9px;
  border: 1px solid #b7a27e;
  border-radius: 1px;
  background: #fcf4df url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23644b3b' stroke-width='1.4' d='m1 1 5 5 5-5'/%3E%3C/svg%3E") right 8px center / 11px 7px no-repeat;
  color: #34291f;
  cursor: pointer;
}

.ledger-message { margin: 12px 0; padding: 22px; border: 1px dashed #aa8b6b; background: #fcf2dcb0; }
.ledger-message button { margin-left: 8px; min-height: 44px; padding: 5px 12px; border: 1px solid #b7a27e; background: var(--slip); }

.entries {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.entry {
  position: relative;
  min-width: 0;
  scroll-margin-top: 20px;
  border: 1px solid #beaa87;
  border-top: 3px double #ab8b67;
  background: var(--grain) 0 0 / 150px, var(--slip);
  box-shadow: 1px 3px 0 #c3ae8b85;
}

.entry-copy {
  padding: 13px 14px 2px 24px;
  background:
    linear-gradient(90deg, transparent 11px, #9c4c483e 11px, #9c4c483e 12px, transparent 12px, transparent 14px, #9c4c4827 14px, #9c4c4827 15px, transparent 15px),
    repeating-linear-gradient(0deg, transparent 0 25px, #745a3f11 25px 26px);
}

.entry-heading, .entry-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  flex-wrap: wrap;
}

.entry-heading { margin-bottom: 10px; }
.entry-number { color: #6b5140; white-space: nowrap; }

.stamp {
  padding: 3px 6px 2px;
  border: 1px solid currentColor;
  background: #86443c0c;
  color: #7a3a32;
  font: .71rem/1.3 var(--mono);
  letter-spacing: .035em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}

.stamp[data-category="muppets"] { color: #345c48; background: #50744d14; }
.stamp[data-category="alfred"] { color: #345768; background: #48687e13; }
.stamp[data-category="impressions"] { color: #735422; background: #a0783915; }
.stamp[data-category="tributes"] { color: #7b4352; background: #a8586f12; }

.entry-title {
  margin: 0;
  color: #2c251d;
  font-size: clamp(1.55rem, 2.05vw, 1.94rem);
  line-height: 1.04;
  letter-spacing: -.024em;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.entry-description { margin: 8px 0; color: #3e3329; font-size: 1rem; line-height: 1.46; }
.entry-byline { margin: 0; color: #604b3d; overflow-wrap: anywhere; font-size: .89rem; font-style: italic; }
.entry-handle { font-style: normal; }

.entry-tools {
  margin-top: 9px;
  border-top: 1px solid #d4c2a4;
}

.entry-meta { display: flex; flex-wrap: wrap; gap: 1px 8px; margin: 0; color: #634b3d; font-size: .71rem; letter-spacing: .035em; }
.entry-platform { color: #61402f; font-weight: 700; }
.entry-date { text-transform: none; }
.entry-date:not([hidden])::before { content: "·"; margin-right: 8px; }

.entry-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #753932;
  font-size: .88rem;
  text-decoration-thickness: .06em;
  text-underline-offset: .24em;
}

.entry-link:hover { color: #4d211c; text-decoration-thickness: .12em; }

.embed-slot {
  display: grid;
  align-items: stretch;
  min-width: 0;
  min-height: 224px;
  margin: 0 10px 10px;
  border: 1px solid #c9b28d;
  background: var(--grain) 0 0 / 150px, repeating-linear-gradient(135deg, #eaddc4 0 2px, #ebdfc8 2px 6px);
}

.embed-placeholder, .embed-content { grid-area: 1 / 1; min-width: 0; }
.embed-content { align-self: center; width: 100%; }
.embed-slot[data-state="idle"] .embed-content, .embed-slot[data-state="loading"] .embed-content { opacity: 0; pointer-events: none; }
.embed-slot[data-state="loading"] .embed-content { max-height: 224px; overflow: hidden; }
.embed-slot[data-state="ready"] .embed-placeholder, .embed-slot[data-state="fallback"] .embed-placeholder { display: none; }
.embed-slot[data-platform="instagram"] { min-height: 300px; }

.embed-placeholder {
  display: flex;
  flex-direction: column;
  place-content: center;
  align-items: center;
  gap: 7px;
  padding: 14px;
  color: #68513e;
  text-align: center;
}

.embed-caption { font-size: .71rem; letter-spacing: .12em; }

.embed-slot[data-platform="youtube"], .embed-slot[data-platform="tiktok"] {
  min-height: 0;
  aspect-ratio: 16 / 9;
  background-color: #202c31;
}

.embed-slot.is-portrait { width: min(100% - 20px, 325px); margin-inline: auto; aspect-ratio: 9 / 16; }

.embed-slot[data-platform="youtube"] > .embed-content,
.embed-slot[data-platform="tiktok"] > .embed-content { align-self: stretch; display: grid; }

.embed-content iframe { display: block; max-width: 100%; width: 100%; border: 0; }
.embed-slot:is([data-platform="youtube"], [data-platform="tiktok"]) .embed-content > iframe { height: 100%; }
.embed-content > .instagram-media { min-width: 0 !important; max-width: 100% !important; width: 100% !important; }
.embed-content > .bluesky-embed, .embed-content .twitter-tweet { margin-block: 0 !important; }
.embed-content > blockquote { margin: 0; }

.facade {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  min-height: 44px;
  border: 0;
  background: #263336;
  color: #fcf2d8;
  isolation: isolate;
}

.facade:focus-visible { outline-offset: -5px; outline-color: var(--gold); }
.facade img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.facade::after { position: absolute; z-index: -1; inset: 0; background: #161b2370; content: ""; }

.play-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 17px;
  border: 3px double #e6c590;
  border-radius: 50%;
  background: #1b2a27ed;
}

.facade:hover .play-mark { background: #913e34; }
.play-mark svg { margin-left: 2px; }
.facade-label { position: absolute; bottom: 9px; left: 9px; padding: 3px 7px; background: #171f24f0; }

.embed-fallback {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 20px 12px;
  color: #574231;
  text-align: center;
}

.embed-fallback p { margin: 0; font: italic 1.22rem/1.2 var(--serif); }

.entry.is-chosen {
  outline: 2px solid #995c2d;
  outline-offset: 4px;
  box-shadow: 0 0 22px #e1a343af;
  animation: candlelight .9s ease-out;
}

@keyframes candlelight {
  0%, 45% { box-shadow: 0 0 34px 9px #d58b3dc9; }
  24%, 100% { box-shadow: 0 0 22px #e1a343af; }
}

.site-footer {
  padding: 29px 0 max(28px, env(safe-area-inset-bottom));
  border-top: 4px double #a48053;
  background: var(--grain) 0 0 / 150px, var(--night);
  color: #f3e5ca;
}

.footer-inner { display: flex; justify-content: space-between; gap: 18px 30px; }
.footer-inner p { margin: 0; font-size: .9rem; }
.footer-inner .footer-motto { color: var(--gold); font: italic 1.65rem/1.2 var(--serif); }
.footer-inner .label { margin-top: 5px; color: #dbbe95; font-size: .74rem; }

.missing-page .title-plate {
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding-block: max(48px, env(safe-area-inset-top)) max(72px, env(safe-area-inset-bottom));
}

.missing-page .label { color: var(--gold); }
.missing-page .return-link { margin-top: 22px; }

@media (max-width: 1040px) {
  .entries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .wrap {
    padding-left: max(19px, env(safe-area-inset-left));
    padding-right: max(19px, env(safe-area-inset-right));
  }
  .masthead-inner { min-height: 52px; }
  .house-mark { font-size: 1.23rem; }
  .title-plate { padding-top: 20px; padding-bottom: 58px; }
  .town { background-size: max(100%, 440px) auto; background-position: center bottom 15px; }
  .town::after { background: radial-gradient(ellipse at 50% 45%, #19232bcf, transparent 90%); }
  .plate-frame { inset: 9px max(10px, env(safe-area-inset-right)) 11px max(10px, env(safe-area-inset-left)); }
  .title-plate h1 { font-size: clamp(2.45rem, 9.8vw, 3.85rem); }
  .dedication { margin-top: 15px; font-size: .72rem; letter-spacing: .04em; }
  .intro { margin-top: 10px; }
  .quote-plate { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; margin-top: -27px; padding: 11px 13px 14px; }
  .quote-label { grid-area: 1 / 1; padding-right: 0; border: 0; gap: 5px; }
  .quote-break { display: none; }
  .quote-mark { font-size: 3.2rem; }
  .quote-next { grid-area: 1 / 2; padding-inline: 9px; min-height: 44px; }
  .quote-copy { grid-column: 1 / -1; padding: 0 3px 2px; }
  .quote-copy blockquote { font-size: 1.32rem; }
  .ledger { margin-top: 28px; padding-bottom: 38px; }
  .ledger-heading { gap: 10px; margin-bottom: 13px; }
  .ledger-heading h2 { font-size: clamp(1.9rem, 8.2vw, 2.65rem); white-space: nowrap; }
  .ghost-button { gap: 5px; padding: 8px; font-size: .98rem; }
  .ghost-button svg { width: 27px; }
  .ghost-button small { font-size: .63rem; }
  .category-tabs { gap: 4px; }
  .category-tab { padding: 4px 6px; gap: 5px; font-size: .85rem; }
  .ledger-tools { margin-block: 7px 12px; gap: 5px; }
  .selects { gap: 9px; }
  .selects label { gap: 5px; }
  .selects select { font-size: 1rem; }
  .entries { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .entry-copy { padding-inline: 14px 12px; background-position: -7px 0, 0 0; }
  .entry-title { font-size: 1.81rem; }
  .footer-inner { flex-direction: column; }
}

@media (max-width: 360px) {
  .wrap {
    padding-left: max(13px, env(safe-area-inset-left));
    padding-right: max(13px, env(safe-area-inset-right));
  }
  .title-plate h1 { font-size: 2.24rem; }
  .quote-label h2 { white-space: normal; }
  .selects { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .snow.is-active { animation: none; }
  .entry.is-chosen { animation: none; }
}
