@import url('https://fonts.googleapis.com/css2?family=Libre+Caslon+Text:ital,wght@0,400;0,700;1,400&family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=Pinyon+Script&display=swap');

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

:root {
  /* Page background */
  --cream: #FFFFFF;
  --ink: #1a1a1a;
  --ink-mid: #3a3a3a;
  --ink-light: #7a7a7a;

  /* DC landmark palette */
  --dc-capitals: #C13B2A;   /* Washington Capitals */
  --dc-blossom: #F0B7C6;    /* Cherry Blossoms */
  --dc-mall: #2E5B41;       /* National Mall */
  --dc-rowhouse: #CFA22E;   /* Row Houses */
  --dc-potomac: #24405C;    /* Potomac River */
  --dc-tidal: #4E7CA8;      /* Tidal Basin */
  --dc-bens: #DFA829;       /* Ben's Chili Bowl */
  --dc-rockcreek: #5C7233;  /* Rock Creek Park */
  --dc-market: #D2704A;     /* Eastern Market */
  --dc-club930: #9C4E97;    /* 9:30 Club */
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Libre Caslon Text', Georgia, serif;
  line-height: 1.8;
  min-height: 100vh;
}

.typewriter {
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
}

.strike-target {
  position: relative;
  display: inline;
}

.strike-target::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  height: 1px;
  width: 0;
  background: var(--ink);
  transition: width 0.5s ease-in-out;
}

.strike-target.struck::after {
  width: 100%;
}

.editorial-comment {
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  color: var(--ink-light);
  font-size: 0.85rem;
}

.draft-note {
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  color: var(--ink-light);
  font-size: 0.9rem;
  margin-top: 0.4rem;
  text-align: right;
}

/* ── Navigation ── */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid rgba(26,26,26,0.12);
  padding: 1.1rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 2.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

nav.visible {
  opacity: 1;
  pointer-events: all;
}

nav .nav-home {
  margin-right: auto;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}

nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* ── Letter (home page) ── */

.letter-wrap {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 7.5rem 2rem 5rem;
}

.letter {
  width: 100%;
  max-width: 640px;
}

.letter-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 1.2rem;
  margin-bottom: 2.8rem;
  border-bottom: 1px solid rgba(26,26,26,0.14);
}

.letter-lines {
  display: flex;
  gap: 5px;
  align-items: center;
}

.letter-lines span {
  display: block;
  width: 1px;
  height: 1.1rem;
  background: rgba(26,26,26,0.22);
}

.letter-date {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--ink-light);
  letter-spacing: 0.03em;
}

.letter-body {
  font-size: 1.06rem;
}

.salutation {
  margin-bottom: 1.6rem;
  min-height: 1.8em;
}

.intro-para {
  margin-bottom: 1.6rem;
  min-height: 1.8em;
}

/* ── Typewriter cursor ── */

.cursor {
  display: inline-block;
  width: 1.5px;
  height: 1em;
  background: var(--ink);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: blink 0.75s step-end infinite;
}

.cursor.off {
  display: none;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Fading content ── */

.fade-in {
  opacity: 0;
  transition: opacity 1.1s ease;
}

.fade-in.visible {
  opacity: 1;
}

/* ── Links ── */

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(26,26,26,0.35);
}

a:hover {
  text-decoration-color: var(--ink);
}

/* ── Inner pages ── */

.page-wrap {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 7.5rem 2rem 5rem;
}

.page-content {
  width: 100%;
  max-width: 640px;
}

.page-label {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 2.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(26,26,26,0.14);
}

.placeholder-text {
  font-style: italic;
  color: var(--ink-light);
}

/* ── Comedy page ── */

.comedy-section {
  margin-bottom: 3.5rem;
}

.video-thumb {
  display: block;
  position: relative;
  overflow: hidden;
  background: #111;
}

.video-thumb img {
  width: 100%;
  display: block;
  transition: opacity 0.25s ease;
}

.video-thumb:hover img {
  opacity: 0.8;
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: background 0.25s ease;
  font-size: 0.85rem;
  padding-left: 3px; /* optical center for triangle */
  color: var(--ink);
}

.video-thumb:hover .play-btn {
  background: rgba(255, 255, 255, 1);
}

/* ── Skip button ── */

#skip-btn {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  font-size: 0.72rem;
  color: var(--ink-light);
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.6s ease, color 0.2s;
  padding: 0.4rem 0;
}

#skip-btn:hover {
  color: var(--ink);
}

#skip-btn.visible {
  opacity: 1;
}

/* ── Fun Facts page ── */

/* See's-style box: white lid, checkered trim, fluted paper cups */

.choc-box {
  position: relative;
  background: repeating-conic-gradient(var(--ink) 0% 25%, #fffdf8 0% 50%);
  background-size: 12px 12px;
  padding: 12px;
  border-radius: 3px;
  margin-bottom: 3rem;
  box-shadow:
    0 3px 0 rgba(0,0,0,0.12),
    0 6px 24px rgba(0,0,0,0.18);
}

.choc-tray {
  background: #fffdf8;
  padding: 1.5rem 1.2rem 1.1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

/* ── The lift-off lid ── */

.choc-lid {
  position: absolute;
  inset: 0;
  border: none;
  cursor: pointer;
  background: repeating-conic-gradient(var(--ink) 0% 25%, #fffdf8 0% 50%);
  background-size: 12px 12px;
  padding: 12px;
  border-radius: 3px;
  box-shadow:
    0 3px 0 rgba(0,0,0,0.12),
    0 6px 24px rgba(0,0,0,0.18);
  transition: transform 0.7s ease, opacity 0.7s ease;
}

.choc-lid:hover {
  transform: translateY(-5px) rotate(-0.5deg);
}

.choc-lid.lifted {
  transform: translateY(-60px) rotate(-3.5deg);
  opacity: 0;
  pointer-events: none;
}

.choc-lid-face {
  background: #fffdf8;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 1rem;
}

.choc-script {
  display: block;
  font-family: 'Pinyon Script', cursive;
  font-size: 2.1rem;
  line-height: 1.25;
  color: var(--ink);
  max-width: 18ch;
}

.choc-lid-sub {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-light);
}

.choc-item {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  padding: 0.6rem 0;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M50.0,5.0 A4.5,4.5 0 0 1 63.9,7.2 A4.5,4.5 0 0 1 76.5,13.6 A4.5,4.5 0 0 1 86.4,23.5 A4.5,4.5 0 0 1 92.8,36.1 A4.5,4.5 0 0 1 95.0,50.0 A4.5,4.5 0 0 1 92.8,63.9 A4.5,4.5 0 0 1 86.4,76.5 A4.5,4.5 0 0 1 76.5,86.4 A4.5,4.5 0 0 1 63.9,92.8 A4.5,4.5 0 0 1 50.0,95.0 A4.5,4.5 0 0 1 36.1,92.8 A4.5,4.5 0 0 1 23.5,86.4 A4.5,4.5 0 0 1 13.6,76.5 A4.5,4.5 0 0 1 7.2,63.9 A4.5,4.5 0 0 1 5.0,50.0 A4.5,4.5 0 0 1 7.2,36.1 A4.5,4.5 0 0 1 13.6,23.5 A4.5,4.5 0 0 1 23.5,13.6 A4.5,4.5 0 0 1 36.1,7.2 A4.5,4.5 0 0 1 50.0,5.0 Z' fill='%234a2410'/><path d='M50.0,17.0L50.0,6.0 M60.2,18.6L63.6,8.2 M69.4,23.3L75.9,14.4 M76.7,30.6L85.6,24.1 M81.4,39.8L91.8,36.4 M83.0,50.0L94.0,50.0 M81.4,60.2L91.8,63.6 M76.7,69.4L85.6,75.9 M69.4,76.7L75.9,85.6 M60.2,81.4L63.6,91.8 M50.0,83.0L50.0,94.0 M39.8,81.4L36.4,91.8 M30.6,76.7L24.1,85.6 M23.3,69.4L14.4,75.9 M18.6,60.2L8.2,63.6 M17.0,50.0L6.0,50.0 M18.6,39.8L8.2,36.4 M23.3,30.6L14.4,24.1 M30.6,23.3L24.1,14.4 M39.8,18.6L36.4,8.2' stroke='%232c1208' stroke-width='1.5' stroke-linecap='round' opacity='0.5' fill='none'/><circle cx='50' cy='50' r='34' fill='%233a1c0a'/></svg>") center / 84px 84px no-repeat;
}

.choc-inner {
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
  transform-origin: center;
}

.choc-item:hover:not(.open) .choc-inner {
  transform: scale(1.1);
  filter: brightness(1.2);
}

.choc-item.open .choc-inner {
  /* eaten — leaves the empty paper cup */
  transform: scale(0.4);
  opacity: 0;
}

.choc-svg {
  width: 70px;
  height: auto;
  display: block;
}

.fact-panel {
  display: none;
  padding: 1.8rem 0;
  border-top: 1px solid rgba(26,26,26,0.1);
  animation: factReveal 0.4s ease;
}

.fact-panel.open {
  display: block;
}

.fact-panel p + p {
  margin-top: 1rem;
}

@keyframes factReveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fact-number {
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  color: var(--ink-light);
  font-size: 0.85rem;
  margin-right: 0.3rem;
}

.cascade {
  margin: 0.8rem 0 0.4rem 0;
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  font-size: 0.95rem;
  color: var(--ink-mid);
}

.cascade span {
  display: block;
  opacity: 0;
  transform: translateX(-8px);
}

.fact-panel.open .cascade span {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.fact-panel.open .cascade span:nth-child(1) { transition-delay: 0.05s; padding-left: 0; }
.fact-panel.open .cascade span:nth-child(2) { transition-delay: 0.18s; padding-left: 2.2rem; }
.fact-panel.open .cascade span:nth-child(3) { transition-delay: 0.31s; padding-left: 4.4rem; }
.fact-panel.open .cascade span:nth-child(4) { transition-delay: 0.44s; padding-left: 6.6rem; }

.fact-clip {
  margin-top: 1.5rem;
  max-width: 480px;
}

.tv-frame {
  margin: 5rem 0 0 18rem;
  width: 450px;
  background: #e4ddd0;
  border-radius: 16px 16px 20px 20px;
  padding: 2rem 1.6rem 1.2rem;
  position: relative;
  transform: rotate(2.5deg);
  box-shadow:
    0 5px 0 #bfb8ac,
    0 8px 24px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.5);
}

.tv-antenna {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 34px;
}

.tv-screen {
  background: #111;
  border-radius: 6px;
  padding: 5px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.7);
}

.tv-screen video {
  width: 100%;
  display: block;
  border-radius: 3px;
}

.tv-knobs {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-right: 0.2rem;
}

.tv-knob {
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #c8c0b4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.4);
}

.fact-gallery {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.fact-gallery img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.fact-audio {
  margin-top: 1.5rem;
}

.fact-audio-label {
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 0.4rem;
}

.fact-audio audio {
  width: 100%;
  display: block;
  margin-bottom: 1rem;
}

/* ── Puppy Tax ── */

/* A pile of polaroids — click to send the top one to the bottom */

.puppy-pile {
  position: relative;
  height: min(130vw, 540px);
  margin-top: 1.5rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.puppy-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(88%, 340px);
  background: #fff;
  padding: 0.7rem 0.7rem 0.9rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.14);
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  transition: transform 0.35s ease;
}

/* Scatter — recomputed as the pile reorders, so it reshuffles as you click */
.puppy-card:nth-child(5n+1) { --rot: -2.5deg; }
.puppy-card:nth-child(5n+2) { --rot: 1.8deg; }
.puppy-card:nth-child(5n+3) { --rot: -1deg; }
.puppy-card:nth-child(5n+4) { --rot: 3deg; }
.puppy-card:nth-child(5n)   { --rot: 0.6deg; }

.puppy-card.leaving {
  transform: translate(-50%, -165%) rotate(7deg);
}

/* Horizontal shots: frame cut close to the photo, and a touch wider */
.puppy-card.tight {
  width: min(88%, 380px);
  padding: 0.35rem;
}

.puppy-card.tight figcaption {
  margin-top: 0.45rem;
  padding-bottom: 0.2rem;
}

.puppy-card img {
  width: 100%;
  display: block;
}

.puppy-card figcaption {
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  color: var(--ink-mid);
  margin-top: 0.6rem;
  text-align: center;
}


/* ── Essays two-pane ── */

.essays-wrap {
  display: flex;
  align-items: flex-start;
  padding-top: 3.6rem;
  min-height: 100vh;
}

.essays-toc {
  width: 260px;
  flex-shrink: 0;
  padding: 2.8rem 2rem 3rem 2.5rem;
  border-right: 1px solid rgba(26,26,26,0.12);
  position: sticky;
  top: 3.6rem;
  height: calc(100vh - 3.6rem);
  overflow-y: auto;
}

.essays-toc .page-label {
  margin-bottom: 1.6rem;
}

.toc-list {
  list-style: none;
}

.toc-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Libre Caslon Text', Georgia, serif;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-light);
  text-align: left;
  padding: 0.5rem 0;
  width: 100%;
  transition: color 0.2s;
}

.toc-btn:hover {
  color: var(--ink);
}

.toc-btn.active {
  color: var(--ink);
  font-style: italic;
}

.essay-reader {
  flex: 1;
  min-width: 0;
  padding: 2.8rem 3.5rem 6rem;
  max-width: 700px;
}

.essay-header {
  margin-bottom: 2.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(26,26,26,0.14);
}

.essay-title {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0;
}

.essay-subtitle {
  font-style: italic;
  color: var(--ink-light);
  font-size: 1rem;
  margin-top: 0.4rem;
}

.essay-date {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--ink-light);
  letter-spacing: 0.03em;
  margin-top: 0.4rem;
}

.essay-text p {
  font-size: 1.06rem;
  margin-bottom: 1.6rem;
}

.essay-text p:last-child {
  margin-bottom: 0;
}

.essay-text hr {
  border: none;
  border-top: 1px solid rgba(26,26,26,0.1);
  margin: 2.5rem 0;
}

.essay-text blockquote {
  border-left: 2px solid rgba(26,26,26,0.18);
  padding-left: 1.5rem;
  margin: 1.6rem 0;
  color: var(--ink-mid);
}

.stagger {
  margin: 1.6rem 0;
  line-height: 2.4;
  font-size: 1.06rem;
}

.stagger span {
  display: block;
}

.essay-divider {
  text-align: center;
  color: var(--ink-light);
  margin: 2rem 0;
  letter-spacing: 0.3em;
}

.essay-audio {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(26,26,26,0.1);
}

.essay-audio-label {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 0.7rem;
}

.essay-audio audio {
  width: 100%;
  display: block;
}

.poem {
  font-size: 1.06rem;
}

.essay-text .poem p {
  margin-bottom: 1.6rem;
  line-height: 1.75;
}

.essay-text .poem .poem-aside {
  padding-left: 1.5rem;
  font-style: italic;
}

.essay-text .poem .poem-gap {
  margin-top: 3.5rem;
}

.essay-footnotes {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(26,26,26,0.12);
}

.essay-footnote {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.essay-footnote-num {
  font-family: 'Courier Prime', monospace;
  color: var(--ink-light);
  font-size: 0.78rem;
  flex-shrink: 0;
  padding-top: 0.15rem;
}

.essay-text .essay-footnote p {
  font-size: 0.88rem;
  color: var(--ink-mid);
  line-height: 1.65;
  margin-bottom: 0;
}

/* ── Responsive ── */

@media (max-width: 700px) {
  .essays-wrap {
    flex-direction: column;
  }

  .essays-toc {
    width: 100%;
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(26,26,26,0.12);
    padding: 2rem 1.4rem 1.5rem;
  }

  .essay-reader {
    padding: 2rem 1.4rem 4rem;
  }
}

/* ── DC landmark accents ── */

/* Letterhead ticks (home): the palette in miniature */
.letter-lines span {
  width: 2px;
}

.letter-lines span:nth-child(1) { background: var(--dc-capitals); }
.letter-lines span:nth-child(2) { background: var(--dc-blossom); }
.letter-lines span:nth-child(3) { background: var(--dc-mall); }
.letter-lines span:nth-child(4) { background: var(--dc-rowhouse); }
.letter-lines span:nth-child(5) { background: var(--dc-potomac); }
.letter-lines span:nth-child(6) { background: var(--dc-market); }
.letter-lines span:nth-child(7) { background: var(--dc-tidal); }
.letter-lines span:nth-child(8) { background: var(--dc-club930); }
.letter-lines span:nth-child(9) { background: var(--dc-rockcreek); }

/* Each section keeps its own landmark color */
nav a[href="fun-facts.html"] { --nav-accent: var(--dc-bens); }
nav a[href="essays.html"]    { --nav-accent: var(--dc-potomac); }
nav a[href="comedy.html"]    { --nav-accent: var(--dc-capitals); }
nav a[href="bookshelf.html"] { --nav-accent: var(--dc-rockcreek); }
nav a[href="contact.html"]   { --nav-accent: var(--dc-tidal); }

nav a {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

nav a:hover {
  text-decoration-color: var(--nav-accent, rgba(26,26,26,0.3));
}

nav a[aria-current="page"] {
  text-decoration-color: var(--nav-accent, var(--ink));
}

nav a:focus-visible {
  outline: 2px solid var(--nav-accent, var(--ink));
  outline-offset: 3px;
}

/* Per-page accent for the hairlines */
body.p-funfacts  { --accent: var(--dc-bens); }
body.p-essays    { --accent: var(--dc-potomac); }
body.p-comedy    { --accent: var(--dc-capitals); }
body.p-bookshelf { --accent: var(--dc-rockcreek); }
body.p-contact   { --accent: var(--dc-tidal); }

body[class*="p-"] .page-label {
  border-bottom-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

body.p-essays .essay-header {
  border-bottom-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

body.p-essays .essay-text blockquote {
  border-left-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

body.p-essays .toc-btn.active {
  color: var(--accent);
}

body.p-funfacts .fact-panel {
  border-top-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

@media (max-width: 600px) {
  nav {
    padding: 1rem 1.4rem;
    gap: 1.4rem;
  }

  nav a {
    font-size: 0.63rem;
    letter-spacing: 0.09em;
  }

  .letter-wrap,
  .page-wrap {
    padding-top: 6rem;
  }

  .letter-body {
    font-size: 1rem;
  }
}
