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

:root {
  --paper: #f6f2ea;
  --paper-2: #efe9dd;
  --ink: #221e1a;
  --body: #4f4841;
  --muted: #8a8076;
  --faint: #c9bfb2;
  --line: rgba(60, 45, 30, 0.12);
  --mat: #fffdf9;
  --accent: #a4553a;      /* canyon red, from the Grand Canyon Suite */
  --accent-2: #3f7a80;    /* glacial teal, from the volcano fissures */
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --gap: clamp(14px, 2.2vw, 30px);
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--body);
  background-color: var(--paper);
  /* faint cold-press paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .2 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

/* ── top bar ─────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px var(--gutter);
  font-size: 0.8rem; letter-spacing: 0.02em;
}
.home { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.home:hover { color: var(--ink); }
.book-link {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  border: 1px solid var(--ink); border-radius: 999px;
  padding: 8px 16px 8px 12px; background: rgba(255,253,249,0.6);
  transition: background .2s, color .2s;
}
.book-link:hover { background: var(--ink); color: var(--paper); }
.book-link svg { flex: none; }
.book-link .new { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); }
.book-link:hover .new { color: #f0b89c; }

/* ── hero ────────────────────────────────────────────── */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  padding: clamp(20px, 5vw, 64px) var(--gutter) clamp(36px, 6vw, 80px);
  max-width: 1400px; margin: 0 auto;
}
.wash { position: absolute; inset: -80px 0 0; pointer-events: none; overflow: hidden; z-index: 0; }
.wash span {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.33; mix-blend-mode: multiply;
}
.wash span:nth-child(1) { width: 46vw; height: 32vw; left: -8vw; top: 2vw; background: #e3b27a; }
.wash span:nth-child(2) { width: 30vw; height: 26vw; left: 22vw; top: 14vw; background: #d68f86; opacity: .22; }
.wash span:nth-child(3) { width: 36vw; height: 30vw; right: -6vw; top: -4vw; background: #8fb9c2; }
.hero > *:not(.wash) { position: relative; z-index: 1; }

.eyebrow {
  font-size: 0.74rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted);
}
.hero h1 {
  font-family: var(--serif); font-weight: 300; color: var(--ink);
  font-size: clamp(3.3rem, 10vw, 7.6rem); line-height: 0.92; letter-spacing: -0.03em;
  margin: 14px 0 22px;
}
.hero h1 em { font-style: italic; font-weight: 300; color: var(--accent); }
.lede {
  font-family: var(--serif); font-size: clamp(1.2rem, 2.1vw, 1.55rem); line-height: 1.45;
  color: var(--body); max-width: 34ch;
}
.stats { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.82rem; color: var(--muted); }
.stats b { color: var(--ink); font-weight: 500; }

.book-card {
  margin-top: 30px; display: flex; gap: 16px; align-items: center; max-width: 480px;
  padding: 14px 16px; border: 1px solid var(--line); background: rgba(255,253,249,0.72);
  text-decoration: none; transition: border-color .2s, transform .2s;
}
.book-card:hover { border-color: var(--faint); transform: translateY(-1px); }
.book-card .cover {
  flex: none; width: 58px; aspect-ratio: 5/7; background-size: cover; background-position: center;
  box-shadow: 2px 3px 8px rgba(0,0,0,0.18), inset -3px 0 0 rgba(0,0,0,0.12);
}
.book-card strong { display: block; font-family: var(--serif); font-size: 1.3rem; font-weight: 500; color: var(--ink); line-height: 1.15; }
.book-card span { font-size: 0.8rem; color: var(--muted); }
.book-card.postcard-card { margin-top: 12px; }
.postcard-card .cover { width: 70px; aspect-ratio: 3/2; }
.postcard-card .pc-links { display: block; margin-top: 5px; }
.postcard-card .pc-links a { color: var(--accent); text-decoration: none; font-weight: 500; }
.postcard-card .pc-links a:hover { text-decoration: underline; }

.feature { justify-self: center; width: 100%; max-width: 560px; text-decoration: none; }
.feature .matframe { transform: rotate(0.6deg); }
.feature figcaption { margin-top: 14px; text-align: center; font-size: 0.8rem; color: var(--muted); }
.feature figcaption i { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); font-style: italic; }

/* shared framed-painting look: white mat + soft shadow */
.matframe {
  background: var(--mat);
  padding: clamp(8px, 1.2vw, 14px);
  box-shadow: 0 1px 1px rgba(40,30,20,0.06), 0 6px 18px -6px rgba(40,30,20,0.22), 0 22px 40px -24px rgba(40,30,20,0.35);
}
.matframe img { width: 100%; height: auto; background: var(--paper-2); }

/* ── filters ─────────────────────────────────────────── */
.filters {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 242, 234, 0.86);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.filters-inner {
  max-width: 1400px; margin: 0 auto; padding: 10px var(--gutter);
  display: flex; align-items: center; gap: 14px;
}
.chips {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0;
  padding-right: 24px;
}
.chips.overflowing { cursor: grab; }
.chips.dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.chips.dragging .chip { pointer-events: none; }
.chips.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.chips.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%); mask-image: linear-gradient(90deg, transparent, #000 12%); }
.chips.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: stretch; white-space: nowrap; font-size: 0.84rem; border-radius: 999px;
  border: 1px solid transparent; color: var(--body); transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--faint); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip small { font-size: 0.7rem; opacity: 0.6; margin-left: 5px; }
.chip button { color: inherit; font: inherit; }
.chip-f { padding: 7px 4px 7px 14px; border-radius: 999px 0 0 999px; }
/* the play button sits on the right of every chip and starts a full-screen slideshow of that category */
.chip-play {
  display: grid; place-items: center; width: 30px; margin: 3px 3px 3px 4px; border-radius: 50%;
  color: inherit; opacity: 0.55; transition: opacity .15s, background .15s;
}
.chip-play svg { margin-left: 1px; }
.chip-play:hover, .chip-play:focus-visible { opacity: 1; background: rgba(60,45,30,0.1); }
.chip[aria-pressed="true"] .chip-play { opacity: 0.8; }
.chip[aria-pressed="true"] .chip-play:hover { opacity: 1; background: rgba(255,255,255,0.18); }
.sort { flex: none; font-size: 0.8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 6px 4px; }
.sort:hover { color: var(--ink); }

.series-intro {
  max-width: 1400px; margin: 0 auto; padding: 28px var(--gutter) 0;
  font-family: var(--serif); font-size: clamp(1.1rem, 1.8vw, 1.35rem); color: var(--body); font-style: italic;
  min-height: 1px;
}
.series-intro:empty { padding-top: 8px; }

/* ── masonry grid (columns built in JS to keep reading order) ── */
.grid {
  max-width: 1400px; margin: 0 auto; padding: 28px var(--gutter) 40px;
  display: flex; gap: var(--gap); align-items: flex-start;
}
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: calc(var(--gap) * 1.35); }
.tile { display: block; text-decoration: none; color: inherit; }
.tile .matframe { transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; }
.tile:hover .matframe { transform: translateY(-4px); box-shadow: 0 1px 1px rgba(40,30,20,0.06), 0 14px 28px -8px rgba(40,30,20,0.28), 0 30px 50px -28px rgba(40,30,20,0.4); }
.tile img { opacity: 0; transition: opacity .6s ease; }
.tile img.loaded { opacity: 1; }
.tile-cap { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 12px 2px 0; }
.tile-title { font-family: var(--serif); font-size: 1.2rem; line-height: 1.2; color: var(--ink); font-weight: 500; }
.tile-meta { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.verse-mark {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 3px;
  font-size: 0.72rem; color: var(--accent); letter-spacing: 0.04em;
}
.empty { text-align: center; padding: 60px 0; color: var(--muted); }

footer {
  max-width: 1400px; margin: 0 auto; padding: 36px var(--gutter) 56px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 0.8rem; color: var(--muted);
}
footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }

/* ── lightbox ────────────────────────────────────────── */
body.lb-open { overflow: hidden; }
.lb {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: #15120f; color: #e9e2d6;
  grid-template-columns: minmax(0, 1fr) min(470px, 40vw);
}
.lb.open { display: grid; animation: lbIn .25s ease; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lb-stage { position: relative; display: flex; align-items: center; justify-content: center; padding: 48px 72px; min-height: 0; touch-action: pan-y; }
.lb-stage img {
  cursor: zoom-in;
  max-width: 100%; max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); width: auto; height: auto; object-fit: contain;
  background: #fffdf9; padding: clamp(6px, 1vw, 12px);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7);
  transition: opacity .3s ease, transform .3s ease;
}
.lb-stage img.fading { opacity: 0; transform: scale(0.985); }
.lb-panel {
  overflow-y: auto; padding: 64px 40px 48px 36px; border-left: 1px solid rgba(255,255,255,0.07);
  background: #1b1714; overscroll-behavior: contain;
}
.lb-series { font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: #a89c8c; }
.lb-title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.9rem, 2.6vw, 2.5rem); line-height: 1.08; color: #fbf6ee; margin: 10px 0 10px; }
.lb-meta { font-size: 0.82rem; color: #a89c8c; }
.lb-poem { margin-top: 30px; padding: 22px 0 4px; border-top: 1px solid rgba(255,255,255,0.1); }
.lb-poem + .lb-poem { margin-top: 10px; }
.lb-poem h3 { font-family: var(--serif); font-weight: 500; font-size: 1.25rem; color: #fbf6ee; margin-bottom: 10px; }
.lb-poem p {
  font-family: var(--serif); font-style: italic; font-size: 1.2rem; line-height: 1.55; color: #efe7da;
}
.lb-poem .ln { display: block; padding-left: 1.3em; text-indent: -1.3em; }
.lb-poem .stanza { display: block; height: 0.85em; }
.lb-poem .sig { margin-top: 12px; font-size: 0.82rem; color: #a89c8c; font-style: normal; font-family: var(--sans); }
.lb-story { margin-top: 30px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,0.1); }
.lb-story h4 { font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: #a89c8c; font-weight: 500; margin-bottom: 10px; }
.lb-story p { font-size: 0.92rem; line-height: 1.7; color: #cfc5b7; margin-bottom: 12px; }
.lb-actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 16px; font-size: 0.8rem; }
.lb-actions a { color: #cfc5b7; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.2); }
.lb-actions a:hover { color: #fff; border-color: #fff; }
.lb-count { font-size: 0.75rem; color: #7d7266; margin-top: 30px; }

.lb-btn {
  position: absolute; z-index: 3; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; color: #e9e2d6; background: rgba(255,255,255,0.06);
  transition: background .2s;
}
.lb-btn:hover { background: rgba(255,255,255,0.16); }
.lb-close { top: 14px; right: 14px; position: fixed; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

/* ── responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .feature { max-width: 440px; order: 2; }
  .lede { max-width: none; }
}
@media (max-width: 860px) {
  .lb { display: none; grid-template-columns: 1fr; grid-template-rows: auto; overflow-y: auto; overscroll-behavior: contain; }
  .lb.open { display: block; }
  .lb-stage { padding: 56px 12px 16px; min-height: 0; }
  .lb-stage img { max-height: 68vh; max-height: 68dvh; }
  .lb-panel { overflow: visible; border-left: 0; padding: 18px 22px 110px; background: #15120f; }
  .lb-prev, .lb-next { position: fixed; top: auto; bottom: 18px; transform: none; background: rgba(40,34,28,0.92); }
  .lb-prev { left: 18px; } .lb-next { right: 18px; }
  .lb-close { background: rgba(40,34,28,0.92); }
}
@media (max-width: 560px) {
  .topbar { padding-top: 12px; }
  .book-link .label-long { display: none; }
  .tile-cap { flex-direction: column; gap: 2px; }
  .sort span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.lb:focus { outline: none; }

/* ── top bar right side ── */
.topbar-right { display: inline-flex; align-items: center; gap: 18px; }
.about-link { color: var(--muted); text-decoration: none; }
.about-link:hover { color: var(--ink); }

/* ── about the artist ── */
.about {
  max-width: 1400px; margin: 0 auto; padding: clamp(40px, 7vw, 96px) var(--gutter);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(28px, 5vw, 72px); align-items: center;
  scroll-margin-top: 70px;
}
.about-photos { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2vw, 24px); align-items: start; }
.about-photos figure:nth-child(2) { margin-top: clamp(24px, 5vw, 64px); }
.about-photos img {
  width: 100%; height: auto; background: var(--mat); padding: clamp(6px, 0.8vw, 10px);
  box-shadow: 0 1px 1px rgba(40,30,20,0.06), 0 6px 18px -6px rgba(40,30,20,0.22), 0 22px 40px -24px rgba(40,30,20,0.35);
}
.about-photos figcaption { margin-top: 10px; font-size: 0.78rem; line-height: 1.45; color: var(--muted); }
.about-text h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(2.4rem, 5vw, 3.8rem); line-height: 1; color: var(--ink); margin: 12px 0 22px; letter-spacing: -0.02em; }
.about-text p { font-family: var(--serif); font-size: clamp(1.1rem, 1.6vw, 1.28rem); line-height: 1.6; margin-bottom: 14px; max-width: 42ch; }
.about-text .about-names { font-size: 1.05rem; color: var(--muted); }
.about-text a { color: var(--accent); }
@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; }
  .about-text p { max-width: none; }
}
@media (max-width: 560px) {
  .about-link { display: none; }
}

.series-intro .series-pdf { display: inline-block; margin-left: 6px; font-family: 'DM Sans', sans-serif; font-style: normal; font-size: 0.82rem; color: #a4553a; text-decoration: none; border-bottom: 1px solid rgba(164,85,58,0.4); }
.series-intro .series-pdf:hover { border-color: #a4553a; }

/* ── slideshow ─────────────────────────────────────── */
body.ss-open { overflow: hidden; }
.ss { position: fixed; inset: 0; z-index: 200; display: none; background: #0b0908; color: #e9e2d6; cursor: none; overflow: hidden; }
.ss.open { display: block; animation: lbIn .35s ease; }
.ss.ui { cursor: default; }
.ss:fullscreen { background: #0b0908; }
.ss-stage { position: absolute; inset: 0; }
/* each slide is matted like the gallery tiles: a white border around the painting and a soft shadow.
   app.js sizes the frame to the painting's proportions (ssFit), so the mat hugs the picture at any size. */
.ss-img {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: none; object-fit: contain;
  background: var(--mat); padding: clamp(8px, 1.2vw, 14px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3), 0 30px 80px -20px rgba(0,0,0,0.75);
  opacity: 0; transition: opacity .9s ease; will-change: opacity;
}
.ss-img.on { opacity: 1; }
.ss-top, .ss-bottom { position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.ss.ui .ss-top, .ss.ui .ss-bottom, .ss.paused .ss-bottom { opacity: 1; pointer-events: auto; }
.ss-top { top: 0; padding-top: max(16px, env(safe-area-inset-top)); background: linear-gradient(rgba(11,9,8,0.7), transparent); }
.ss-bottom { bottom: 0; padding-bottom: max(18px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(11,9,8,0.78)); justify-content: space-between; }
.ss-name { font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: #fbf6ee; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-n { font-size: 0.75rem; letter-spacing: 0.08em; color: #a89c8c; }
.ss-cap { min-width: 0; }
.ss-title { font-family: var(--serif); font-size: clamp(1.3rem, 2.4vw, 2rem); line-height: 1.1; color: #fbf6ee; }
.ss-sub { margin-top: 5px; font-size: 0.8rem; color: #a89c8c; }
.ss-ctl { display: flex; align-items: center; gap: 8px; flex: none; }
.ss-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #e9e2d6; background: rgba(255,255,255,0.08); transition: background .2s; }
.ss-btn:hover { background: rgba(255,255,255,0.18); }
.ss-big { width: 54px; height: 54px; background: rgba(255,255,255,0.14); }
.ss .i-play { display: none; } .ss.paused .i-play { display: block; } .ss.paused .i-pause { display: none; }
@media (max-width: 600px) {
  .ss-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  .ss-ctl { align-self: center; }
}
.ss-tog[aria-pressed="true"] { background: rgba(207,169,143,0.28); color: #f3dccb; }
.ss-tog[hidden] { display: none; }
.ss .i-exit { display: none; } .ss.full .i-exit { display: block; } .ss.full .i-enter { display: none; }
@media (max-width: 600px) { .ss-top { gap: 8px; } .ss-top .ss-btn { width: 40px; height: 40px; } }
.ss-name, .ss-n, .ss-title, .ss-sub { text-shadow: 0 1px 6px rgba(0,0,0,0.75), 0 0 2px rgba(0,0,0,0.6); }
.ss-n { color: #d6cabb; }
.ss-speed { width: auto; min-width: 44px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px;
  font: 500 0.8rem/1 var(--sans); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .ss-top .ss-speed { width: auto; padding: 0 10px; } .ss-speed svg { display: none; } }
.series-intro .series-pdfs { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-left: 6px; }
.series-intro .series-pdfs .series-pdf { margin-left: 0; }
.series-intro .series-pdfs .sep { color: var(--faint); font-style: normal; }
@media (max-width: 600px) { .series-intro .series-pdfs .sep { display: none; } .series-intro .series-pdfs { display: flex; margin: 8px 0 0; } }
