@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond.woff") format("woff"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-italic.woff") format("woff"); font-weight: 400 800; font-style: italic; font-display: swap; }
@font-face { font-family: "IM Fell English SC"; src: url("fonts/im-fell-english-sc.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
/* Layout: one vertical stream of full-screen sheets on cool drawing paper; each work sits alone, opens into its own leaf. Deliberately single-theme: the paper is the identity. */
:root {
  --paper: #ecece8;
  --paper-deep: #dfdfdb;
  --ink: #222326;
  --graphite: #6c6e72;
  --faint: #a6a8ab;
  --indigo: #4a5363;
  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --caps: "IM Fell English SC", "EB Garamond", Georgia, serif;
  --ease: cubic-bezier(.22,.61,.36,1);
  color-scheme: light;
}
html, body { height: 100%; margin: 0; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); box-sizing: border-box; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
/* paper: generated grain + warm edge, fixed so it never scrolls */
body::before, body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50;
}
body::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .3  0 0 0 0 .32  0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .36; mix-blend-mode: multiply;
}
body::after {
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(70,74,82,.14) 100%);
}

.stream {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  transition: opacity 1.2s cubic-bezier(.33,0,.2,1) .5s; /* returning: waits for the leaf to clear, then comes back slowly */
}
/* opening a work: the stream steps back first, then the leaf arrives. Never both at once. */
body.reading .stream { opacity: 0; transition: opacity .38s var(--ease) 0s; }
.stream::-webkit-scrollbar { display: none; }

.sheet {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  padding-left: max(28px, env(safe-area-inset-left, 0px));
  padding-right: max(28px, env(safe-area-inset-right, 0px));
  padding-block: 64px 72px;
  box-sizing: border-box;
}

/* reveal: only hidden once JS is running, so the page reads without it */
.js .rise { opacity: 0; transform: translateY(10px); filter: blur(3px);
  transition: opacity 1.4s var(--ease), transform 1.4s var(--ease), filter 1.4s var(--ease);
  transition-delay: calc(var(--i, 0) * 220ms + 150ms); }
.js .sheet.on .rise { opacity: 1; transform: none; filter: none; }

/* threshold */
.threshold { text-align: center; display: grid; gap: 18px; justify-items: center; }
.name { font-family: var(--caps); font-weight: 400; font-size: clamp(1.7rem, 7vw, 2.6rem); letter-spacing: .06em; margin: 0; text-wrap: balance; }
.role { font-family: var(--serif); font-style: italic; color: var(--graphite); font-size: 1.1rem; margin: 0; }
.cue { position: absolute; bottom: 40px; left: 50%; translate: -50% 0; font-family: var(--caps); font-size: .8rem; letter-spacing: .14em; color: var(--faint); display: grid; justify-items: center; gap: 10px; }
.cue i { display: block; width: 1px; height: 34px; background: linear-gradient(var(--faint), transparent); animation: drip 3.2s var(--ease) infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); opacity: 1 } 70% { transform: scaleY(1); opacity: 1 } 100% { transform: scaleY(1); opacity: 0 } }

/* a work, as it sits in the stream */
.work { appearance: none; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
  width: min(100%, 30rem); display: grid; gap: 30px; text-align: left; padding: 8px; border-radius: 2px; }
.work:focus-visible { outline: 1px solid var(--graphite); outline-offset: 10px; }
.excerpt { font-size: clamp(1.45rem, 6.2vw, 1.95rem); line-height: 1.42; margin: 0; }
.excerpt span { display: block; }
.excerpt span:nth-child(2) { padding-left: 1.4em; }
.excerpt span:nth-child(3) { padding-left: .6em; }
.label { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 1px solid rgba(34,35,38,.18); padding-top: 12px; }
.title { font-family: var(--caps); font-size: 1.05rem; letter-spacing: .05em; }
.meta { font-style: italic; color: var(--graphite); font-size: .98rem; font-variant-numeric: oldstyle-nums; white-space: nowrap; }
.invite { font-family: var(--caps); font-size: .78rem; letter-spacing: .16em; color: var(--graphite); justify-self: start; }
.invite::after { content: " \2192"; }

/* composition recipe card */
.recipe { justify-items: center; text-align: center; gap: 22px; }
.symbol { width: min(66vw, 260px); aspect-ratio: 1; max-width: 100%; display: block;
  -webkit-mask-image: radial-gradient(closest-side, #000 52%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 52%, transparent 100%);
  mix-blend-mode: multiply; }
.recipe .title { font-size: 1.3rem; }
.ingredients { font-style: italic; color: var(--indigo); margin: -10px 0 0; font-size: 1.05rem; }
.note { margin: 0; color: var(--graphite); font-size: 1.08rem; line-height: 1.5; max-width: 22rem; text-wrap: balance; }
.recipe .invite { justify-self: center; color: var(--indigo); }
.recipe .invite::after { content: ""; }
.recipe .label { width: 100%; justify-content: center; border: 0; padding: 0; }

/* the door */
.door { width: min(100%, 24rem); display: grid; gap: 34px; }
.door p { margin: 0; }
.door .lede { font-style: italic; font-size: 1.35rem; line-height: 1.45; color: var(--ink); text-wrap: balance; }
.door nav { display: grid; gap: 4px; }
.door nav a { color: var(--ink); text-decoration: none; font-size: 1.2rem; display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(34,35,38,.14); }
.door nav a span { font-style: italic; color: var(--graphite); font-size: 1rem; }
.door nav a:hover, .door nav a:focus-visible { color: var(--indigo); outline: none; }
.mail { font-family: var(--serif); font-size: 1.05rem; color: var(--graphite); user-select: all; }
.imprint { font-family: var(--caps); font-size: .78rem; letter-spacing: .16em; color: var(--faint); }

/* folio: quiet position marker */
.folio { position: fixed; z-index: 20; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  font-family: var(--caps); font-size: .85rem; letter-spacing: .12em; color: var(--faint); transition: opacity .8s var(--ease); font-variant-numeric: tabular-nums; }
.folio.hide { opacity: 0; }

/* the opened leaf */
/* a paper band under the close button, so text scrolling up disappears cleanly behind it */
.leaf::before { content: ""; position: fixed; z-index: 1; inset: 0 0 auto; height: calc(64px + env(safe-area-inset-top, 0px)); pointer-events: none;
  background: linear-gradient(var(--paper) 88%, color-mix(in srgb, var(--paper) 0%, transparent)); }
.leaf { position: fixed; inset: 0; z-index: 30; background: var(--paper); overflow-y: auto;
  padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px));
  padding-block: 0 calc(96px + env(safe-area-inset-bottom, 0px));
  opacity: 0; visibility: hidden; transition: opacity .5s var(--ease), visibility 0s linear .5s; }
.leaf.open { opacity: 1; visibility: visible; transition: opacity .55s var(--ease) .34s, visibility 0s linear .34s; }
.leaf-inner { max-width: 30rem; margin: 0 auto; padding-top: calc(84px + env(safe-area-inset-top, 0px)); display: grid; gap: 28px; }
.leaf .close { position: fixed; top: calc(18px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px));
  appearance: none; border: 0; background: none; font-family: var(--caps); font-size: .85rem; letter-spacing: .16em; color: var(--graphite); cursor: pointer; padding: 10px 14px; border-radius: 999px; z-index: 2;
  background: color-mix(in srgb, var(--paper) 82%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.leaf .close:focus-visible { outline: 1px solid var(--graphite); }
.leaf h2 { font-family: var(--caps); font-weight: 400; font-size: 1.7rem; letter-spacing: .04em; margin: 0; text-wrap: balance; }
.leaf .meta { margin-top: -18px; }
.poem { font-size: 1.28rem; line-height: 1.62; display: grid; gap: 1.3em; }
.poem p { margin: 0; }
.poem p span { display: block; padding-left: 1.4em; text-indent: -1.4em; }
.poem p span.echo { font-style: italic; color: var(--graphite); padding-left: 2.6em; }
.js .leaf .rise { filter: none; opacity: 0; transform: translateY(8px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 120ms + 480ms); }
.js .leaf:not(.open) .rise { transition-delay: .5s; }
.js .leaf.open .rise { opacity: 1; transform: none; }
.leaf .symbol { width: min(72vw, 300px); justify-self: center; }
.player { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-block: 1px solid rgba(34,35,38,.16); }
.play { appearance: none; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--indigo); background: transparent; color: var(--indigo); cursor: pointer; display: grid; place-items: center; flex: none; transition: background .4s var(--ease), color .4s var(--ease); }
.playing .play { background: var(--indigo); color: var(--paper); }
.play:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; }
.play svg { width: 16px; height: 16px; fill: currentColor; }
.track { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: baseline; row-gap: 6px; column-gap: 12px; }
.player .p-title { font-style: italic; color: var(--graphite); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time { font-family: var(--serif); font-size: .9rem; color: var(--faint); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.scrub { grid-column: 1 / -1; grid-row: 2; -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer; --p: 0%; }
.scrub::-webkit-slider-runnable-track { height: 1px; background: linear-gradient(to right, var(--indigo) var(--p), rgba(34,35,38,.18) var(--p)); }
.scrub::-moz-range-track { height: 1px; background: rgba(34,35,38,.18); }
.scrub::-moz-range-progress { height: 1px; background: var(--indigo); }
.scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 9px; height: 9px; border-radius: 50%; background: var(--indigo); margin-top: -4px; opacity: 0; transition: opacity .4s; }
.scrub::-moz-range-thumb { width: 9px; height: 9px; border: 0; border-radius: 50%; background: var(--indigo); opacity: 0; transition: opacity .4s; }
.playing .scrub::-webkit-slider-thumb, .scrub:focus-visible::-webkit-slider-thumb, .scrub:active::-webkit-slider-thumb { opacity: 1; }
.playing .scrub::-moz-range-thumb, .scrub:focus-visible::-moz-range-thumb { opacity: 1; }
.scrub:focus-visible { outline: none; }
/* a song: the record stays at hand while you read the lyric */
.leaf[data-kind="song"] .player { position: sticky; top: calc(58px + env(safe-area-inset-top, 0px)); z-index: 1; background: var(--paper); }
.leaf[data-kind="song"] .poem { padding-top: 8px; }
.elsewhere { margin: 12px 0 0; font-family: var(--caps); font-size: .8rem; letter-spacing: .14em; color: var(--faint); }
.elsewhere a { color: var(--graphite); text-decoration: none; border-bottom: 1px solid rgba(34,35,38,.22); padding-bottom: 1px; }
.elsewhere a:hover, .elsewhere a:focus-visible { color: var(--indigo); outline: none; border-color: currentColor; }
.prose { font-size: 1.15rem; line-height: 1.6; color: var(--ink); margin: 0; }
.score { margin: 12px 0 0; display: grid; gap: 28px; }
.score img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; opacity: .92; }
.score img + img { padding-top: 28px; border-top: 1px solid rgba(34,35,38,.12); }
.score figcaption { order: -1; font-family: var(--caps); font-size: .78rem; letter-spacing: .16em; color: var(--faint); }

@media (prefers-reduced-motion: reduce) {
  .js .rise, .leaf .rise, .leaf, .folio, .stream { transition: none !important; filter: none !important; transform: none !important; }
  .cue i { animation: none; }
}
