/* Palette drawn from "Tulips, All at Once" — see docs/COLOR-PALETTE.md */
:root {
  --paper: #f6f9f4;
  --ink: #0d1a19;
  --mist: #b9dbce;
  --sage: #8aae9f;
  --pine: #528173;
  --leaf: #1f6e2b;
  --marigold: #f3c909;
  --amber: #da8d0c;
  --honey: #f5cb51;
  --blush: #f4d4be;
  --rose: #eb9194;
  --coral: #dc5663;
  --poppy: #d60f13;
  --wine: #80293b;

  --hand: "Shantell Sans", "Comic Sans MS", cursive;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1400px;
  --radius: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  /* clip, not hidden — hidden would make body a scroll container and break the sticky header */
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Watercolor washes bled onto the paper */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(48rem 30rem at 8% -6%, rgba(243, 201, 9, 0.18), transparent 70%),
    radial-gradient(42rem 28rem at 96% 6%, rgba(235, 145, 148, 0.20), transparent 70%),
    radial-gradient(52rem 34rem at 50% 104%, rgba(185, 219, 206, 0.42), transparent 72%),
    radial-gradient(30rem 22rem at 92% 62%, rgba(31, 110, 43, 0.10), transparent 72%);
}

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

a { color: var(--pine); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--wine); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

/* Clipped rather than pushed off-canvas, which would widen the scroll area. */
.skip {
  position: absolute; top: 0; left: 0; z-index: 100;
  width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { width: auto; height: auto; clip-path: none; overflow: visible; }

/* ---------- header ---------- */

.site-head {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(246, 249, 244, 0.86);
  border-bottom: 1px solid rgba(82, 129, 115, 0.22);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.25rem; flex-wrap: wrap;
}
.brand {
  font-family: var(--hand);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.1;
}
.brand span { display: block; font-family: var(--body); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--pine); font-weight: 700; }

.site-nav { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.site-nav a {
  font-family: var(--hand);
  font-size: 1.0625rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease;
}
.site-nav a:hover { background: var(--honey); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--leaf); color: #fff; }

@media (max-width: 640px) {
  .site-head .wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 0.875rem;
    min-height: 0;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  .site-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  .site-nav a {
    text-align: center;
    padding: 0.55rem 0.5rem;
  }
}

/* ---------- hero ---------- */

.hero { padding: clamp(2.25rem, 6vw, 4.5rem) 0 clamp(1.5rem, 4vw, 3rem); }
.hero .wrap {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
}
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 2rem; }
}
.hero h1 {
  font-family: var(--hand);
  font-weight: 700;
  font-size: clamp(2.9rem, 11vw, 6.5rem);
  line-height: 0.98;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}
.hero h1 em {
  font-style: normal;
  display: block;
  color: var(--amber);
  font-size: 0.52em;
  margin-top: 0.15em;
}
.hero .dates {
  font-size: 0.82rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--pine); font-weight: 700; margin: 0 0 1.75rem;
}
.hero-verse {
  margin: 0;
  border: 0;
  padding: 0 0 0 1.1rem;
  border-left: 4px solid var(--coral);
  max-width: 34rem;
}
.hero-verse p {
  font-family: var(--hand);
  font-size: clamp(1.15rem, 3.2vw, 1.55rem);
  line-height: 1.5;
  margin: 0;
}
.hero-verse footer { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pine); font-weight: 700; margin-top: 0.7rem; }

.hero-art { position: relative; }
.hero-art .tile { margin: 0; }
.hero-art .tile .frame {
  border-radius: 18px;
  box-shadow: 0 2px 4px rgba(13, 26, 25, 0.12), 0 34px 60px -22px rgba(13, 26, 25, 0.45);
}
.hero-art .tile .cap { padding-top: 0.65rem; font-size: 1.05rem; }
.hero-art::after {
  content: "";
  position: absolute;
  inset: -12% -8% -8% -12%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(243, 201, 9, 0.32), rgba(235, 145, 148, 0.18), transparent 78%);
}

/* ---------- sections ---------- */

.section { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section-head { display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-head h2 {
  font-family: var(--hand);
  font-size: clamp(1.85rem, 5vw, 2.7rem);
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
}
.section-head .count { font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--pine); font-weight: 700; }

.rule { height: 6px; border: 0; margin: 0 0 2.25rem; border-radius: 999px;
  background: linear-gradient(90deg, var(--poppy), var(--amber), var(--marigold), var(--leaf), var(--pine), var(--rose), var(--wine));
  opacity: 0.85;
}

/* ---------- gallery ---------- */

.gallery { column-width: 290px; column-gap: 1.15rem; }
@media (max-width: 620px) { .gallery { columns: 2 140px; column-gap: 0.8rem; } }

.tile {
  break-inside: avoid;
  margin: 0 0 1.15rem;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  text-align: left;
  font: inherit;
  color: inherit;
}
@media (max-width: 620px) { .tile { margin-bottom: 0.8rem; } }

.tile .frame {
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(13, 26, 25, 0.12), 0 10px 24px -12px rgba(13, 26, 25, 0.30);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.tile img { width: 100%; height: auto; }
.tile:hover .frame, .tile:focus-visible .frame {
  transform: translateY(-4px) rotate(-0.35deg);
  box-shadow: 0 2px 4px rgba(13, 26, 25, 0.14), 0 22px 40px -16px rgba(13, 26, 25, 0.42);
}
.tile:focus-visible { outline: none; }
.tile:focus-visible .frame { outline: 3px solid var(--amber); outline-offset: 3px; }

.tile .cap {
  display: flex; gap: 0.5rem; align-items: baseline; justify-content: space-between;
  padding: 0.5rem 0.15rem 0;
  font-family: var(--hand);
  font-size: 0.98rem;
  line-height: 1.3;
}
.tile .cap .yr { font-family: var(--body); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; color: var(--pine); flex: none; }

/* ---------- her words ---------- */

.words { display: grid; gap: clamp(2rem, 5vw, 3.25rem); }

.piece {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(82, 129, 115, 0.2);
  border-radius: 20px;
  padding: clamp(1.1rem, 3vw, 1.9rem);
}
@media (max-width: 800px) { .piece { grid-template-columns: 1fr; } }
.piece.wide { grid-template-columns: 1fr; }

.piece h3 {
  font-family: var(--hand);
  font-size: clamp(1.45rem, 4vw, 2rem);
  margin: 0 0 0.15rem;
  line-height: 1.15;
}
.piece .meta { font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--pine); font-weight: 700; margin: 0 0 1rem; }

.verse {
  font-family: var(--hand);
  font-size: clamp(1.05rem, 2.6vw, 1.2rem);
  line-height: 1.65;
  white-space: pre-line;
  margin: 0;
}
.verse + .verse { margin-top: 1.75rem; }

.scan { display: grid; gap: 0.8rem; }
.scan .tile { margin: 0; }
.scan.pages { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .scan.pages { grid-template-columns: 1fr 1fr; } }

/* ---------- prose / about ---------- */

.prose { max-width: 46rem; }
.prose > p:first-child { font-size: 1.15rem; }
.prose h2 { font-family: var(--hand); font-size: clamp(1.7rem, 4.5vw, 2.3rem); margin: 2.5rem 0 0.5rem; line-height: 1.15; }
.prose h3 { font-family: var(--hand); font-size: 1.35rem; margin: 2rem 0 0.35rem; }
.prose p { margin: 0 0 1.1rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }

.portrait-row {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
}
@media (max-width: 700px) { .portrait-row { grid-template-columns: 1fr 1fr; gap: 0.8rem; } }
.portrait-row .tile { margin: 0; }
/* Uniform filmstrip height so the captions line up; the lightbox shows the full frame. */
.portrait-row .tile img { height: clamp(170px, 17vw, 300px); object-fit: cover; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 5.25rem 1fr;
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid rgba(82, 129, 115, 0.22);
}
.timeline li:first-child { border-top: 0; }
.timeline .yr { font-weight: 800; color: var(--wine); font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .timeline li { grid-template-columns: 1fr; gap: 0.1rem; }
}

.callout {
  background: linear-gradient(180deg, rgba(245, 203, 81, 0.28), rgba(244, 212, 190, 0.28));
  border: 1px solid rgba(218, 141, 12, 0.35);
  border-radius: 20px;
  padding: clamp(1.1rem, 3vw, 1.75rem);
  margin: 2.5rem 0 0;
}
.callout p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */

.site-foot {
  margin-top: clamp(3rem, 8vw, 5.5rem);
  border-top: 1px solid rgba(82, 129, 115, 0.25);
  background: rgba(255, 255, 255, 0.5);
  padding: 2.25rem 0 2.75rem;
  font-size: 0.95rem;
}
.site-foot .wrap { display: flex; gap: 1rem 2rem; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.site-foot .honey { font-family: var(--hand); font-size: 1.25rem; }
.site-foot nav { display: flex; gap: 1.15rem; flex-wrap: wrap; }

/* ---------- lightbox ---------- */

.lb {
  position: fixed; inset: 0; z-index: 90;
  display: none;
  background: rgba(9, 17, 16, 0.94);
  padding: clamp(0.5rem, 2vw, 1.5rem);
}
/* minmax(0, 1fr) — a bare 1fr row floors at content height and lets tall images
   push the caption off screen. */
.lb.is-open { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }

.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: #fff; }
.lb-count { font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.7); font-weight: 700; }

/* Flex, not grid: an auto grid row sizes to the image's intrinsic height (1800px)
   and pushes a tall painting out of the stage. */
.lb-stage {
  display: flex; align-items: center; justify-content: center;
  min-height: 0; padding: 0.5rem 0; position: relative;
}
.lb-stage img {
  /* Viewport-relative cap so a tall painting can never push the caption off screen. */
  max-width: 100%; max-height: min(100%, calc(100dvh - 9.5rem));
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.8);
}

.lb-cap { color: #fff; text-align: center; padding-top: 0.5rem; }
.lb-cap .t { font-family: var(--hand); font-size: clamp(1.05rem, 3vw, 1.4rem); }
.lb-cap .y { font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--honey); font-weight: 700; }

.lb button {
  font: inherit;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-radius: 999px;
  width: 2.9rem; height: 2.9rem;
  display: grid; place-items: center;
  font-size: 1.25rem; line-height: 1;
  transition: background 0.15s ease, transform 0.15s ease;
}
.lb button:hover { background: var(--honey); color: var(--ink); border-color: var(--honey); }
.lb button:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }

.lb-prev, .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 2;
}
.lb-prev { left: 0; }
.lb-next { right: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
