@font-face {
  font-family: 'Cormorant Garamond';
  src: url('assets/fonts/cormorant-garamond-medium-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
:root {
  --paper: #beaf9a;
  --ink: #30372f;
  --muted: #404337;
  --line: #414c372e;
  --serif: Georgia, 'Times New Roman', serif;
  --poem-serif: 'Cormorant Garamond', Georgia, serif;
  --poem-ink: #41433b;
  --sans: Arial, Helvetica, sans-serif;
  --page-pad: clamp(22px, 4vw, 76px);
  /* The original artwork: arch width 744px, height 1191px. */
  --arch-ratio: .6246851385;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { background: var(--paper) url('assets/wall.webp') center / cover fixed; color: var(--ink); font: 14px var(--sans); -webkit-font-smoothing: antialiased; }
html { color-scheme: light; }
::selection { color: #30372f; background: #dbc49a; }

button, a, input, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: default; opacity: .4; }
:is(button,a,input,select,blockquote):focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; border-radius: 2px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app { height: 100vh; height: 100dvh; display: grid; grid-template-rows: 76px minmax(0,1fr); padding: env(safe-area-inset-top,0px) max(var(--page-pad),env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(var(--page-pad),env(safe-area-inset-left,0px)); position: relative; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { font: 26px var(--serif); letter-spacing: .28em; line-height: 1.4; }
.brand-dot { margin-left: -.15em; color: #937844; }
.header-controls, .socials { display: flex; align-items: center; }
.header-controls { gap: 21px; }
.socials { gap: 9px; }
.socials a { display: grid; place-items: center; width: 44px; height: 44px; opacity: .8; transition: opacity .2s; }
.socials a:hover { opacity: 1; }
.socials svg { width: 18px; height: 18px; }
.library-toggle { display: none; align-items: center; gap: 4px; min-height: 44px; font-size: 11px; }
.library-toggle svg { width: 15px; height: 15px; transition: transform .2s; }
.library-toggle[aria-expanded=true] svg { transform: rotate(180deg); }
.stage { min-height: 0; display: grid; grid-template: minmax(0,1fr) / minmax(0,1fr) minmax(0,1.5fr) minmax(0,1fr); gap: clamp(28px,3vw,54px); padding: 12px 0 28px; position: relative; max-width: 1720px; width: 100%; margin: 0 auto; }
.portal-column { grid-column: 2; grid-row: 1; width: 100%; height: 100%; min-height: 0; container-type: size; display: grid; place-items: center; }
.portal-wrap { width: min(100cqw,calc(100cqh * var(--arch-ratio))); height: min(100cqh,calc(100cqw / var(--arch-ratio))); position: relative; filter: drop-shadow(0 12px 15px #55452915); container: portal / inline-size; }
.portal { position: absolute; inset: 0; overflow: hidden; border-radius: 50% 50% 0 0 / 31.234% 31.234% 0 0; background: #233c4d; touch-action: pinch-zoom; user-select: none; -webkit-user-select: none; }
.portal-art { position: absolute; inset: 0; background: url('assets/portal-large.webp') center bottom / auto 105.28967% no-repeat; transition: opacity .5s; }
.portal.field-ready .portal-art { opacity: .72; }
.portal-light { position: absolute; inset: 0; background: radial-gradient(ellipse at 55% 48%,#d0b88645,transparent 65%); mix-blend-mode: screen; opacity: .06; }
#atmosphere { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
[hidden] { display: none!important; }
.compact-song { display: none; }
.poem-panel { grid-column: 1; grid-row: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; align-self: stretch; }
.poem-copy { margin: 0; white-space: pre-line; font: 500 clamp(20px,1.45vw,23px)/1.42 var(--poem-serif); color: var(--poem-ink); font-kerning: normal; flex: 0 0 auto; }
.poem-credit { display: flex; align-items: center; justify-content: space-between; min-height: 32px; margin-top: 18px; gap: 12px; flex: 0 0 auto; }
.poem-credit cite { font: 10px/1.4 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--poem-ink); }
.poem-note { font: italic 12px/1.5 var(--serif); color: var(--muted); margin: 8px 0 0; flex: 0 0 auto; }
.poem-pages { display: flex; align-items: center; gap: 3px; }
.poem-pages .icon-button { width: 32px; height: 32px; }
.poem-pages svg { width: 16px; height: 16px; }
#poem-previous svg { transform: rotate(180deg); }
#poem-page-count { font: 9px var(--sans); min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.library-panel { grid-column: 3; grid-row: 1; align-self: center; min-width: 0; padding-left: clamp(0px,3vw,48px); }
.library-heading { display: none; }
.library-heading h2 { margin: 0; font: 11px var(--sans); font-weight: 400; }
#close-panel { display: none; }
.track-list { padding: 0; margin: 0; list-style: none; }
.track-button { display: flex; align-items: center; gap: 12px; min-height: 48px; width: 100%; text-align: left; }
.track-button::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: currentColor; flex: 0 0 4px; opacity: 0; }
.track-button[aria-current=true]::before { opacity: 1; }
.track-name { font: 500 clamp(21px,1.65vw,25px)/1.4 var(--poem-serif); position: relative; }
.track-name::after { content: ''; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px; background: #937844; opacity: .45; transform: scaleX(0); transform-origin: left; transition: transform .5s cubic-bezier(.2,.65,.25,1); }
.track-button[aria-current=true] .track-name::after { transform: scaleX(.24); }
.track-button::before { transition: opacity .4s ease,transform .4s ease; transform: scale(.5); }
.track-button[aria-current=true]::before { transform: scale(1); }
.track-button { transition: color .3s ease; }
.track-button[aria-current=true] { color: #503817; }
.player { position: absolute; bottom: 0; left: 0; width: 100%; height: min(120px,60%); color: #f0e0c7; background: linear-gradient(0deg,#07161dba, #07161d38 65%,transparent); }
.player :focus-visible { outline-color: #f0e0c7; outline-offset: 2px; }
.transport { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; gap: 8px; }
.icon-button { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-button svg { width: 16px; height: 16px; }
.play-button { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; }
.play-button svg { width: 23px; height: 23px; }
.transport button { position: relative; transition: transform .25s ease,opacity .25s ease; }
.transport button:active { transform: scale(.9); }
.play-button::before { content: ''; position: absolute; width: 34px; height: 34px; border: 1px solid #eddbba50; border-radius: 50%; opacity: 0; transform: scale(.8); transition: opacity .5s ease,transform .65s cubic-bezier(.2,.65,.25,1); }
.play-button[aria-pressed=true]::before { opacity: .7; transform: scale(1); }
.play-button[aria-busy=true]::before { opacity: .9; border-color: #eddbba25; border-top-color: #eddbba; animation: loading-ring 1.4s linear infinite; }
@keyframes loading-ring { to { transform: rotate(360deg); } }
.socials a { transition: opacity .25s ease,transform .3s ease; }
.socials a:active { transform: translateY(1px); }
@media(hover:hover) and (pointer:fine) {
  .track-button:hover .track-name::after { transform: scaleX(1); }
  .socials a:hover { transform: translateY(-2px); }
  .transport button:hover { transform: translateY(-1px); }
  .play-button:hover::before { opacity: 1; transform: scale(1.06); }
  .transport button:active { transform: scale(.9); }
}
@media(prefers-reduced-motion:no-preference) {
  .header { animation: ink-arrive .8s cubic-bezier(.2,.65,.25,1) both; }
  .portal-wrap { animation: portal-arrive 1.2s ease-out both; }
  @media(min-width:861px) {
    .track-list>li { animation: ink-arrive .75s cubic-bezier(.2,.65,.25,1) both; animation-delay: calc(.12s + var(--track-order,0) * .045s); }
  }
}
@keyframes ink-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes portal-arrive { from { opacity: .15; } to { opacity: 1; } }
.timeline>span { position: absolute; bottom: 12px; font-size: 9px; color: #dfceb7; font-variant-numeric: tabular-nums; }
.timeline { --progress: 0%; }
.seek-glow { position: absolute; bottom: -1.5px; left: 0; height: 3px; width: var(--progress); border-radius: 3px; background: #ffe7bb; box-shadow: 0 0 6px #f7d69880,0 0 16px #e6b96635; pointer-events: none; opacity: .45; }
body[data-playing=true] .seek-glow { animation: seek-breathe 2.8s ease-in-out infinite; }
@keyframes seek-breathe { 0%,100% { opacity: .4; } 50% { opacity: .95; box-shadow: 0 0 8px #f7d698a0,0 0 20px #e6b96660; } }
#elapsed { left: 16px; }
#duration { right: 16px; }
.timeline input { position: absolute; bottom: -14px; left: 0; width: 100%; height: 28px; margin: 0; cursor: pointer; appearance: none; -webkit-appearance: none; background: transparent; }
.timeline input::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right,#f0d9b2 var(--progress),#d5c7ae65 var(--progress)); }
.timeline input::-moz-range-track { height: 3px; border-radius: 3px; background: #d5c7ae65; }
.timeline input::-moz-range-progress { height: 3px; border-radius: 3px; background: #f0d9b2; }
.timeline input::-webkit-slider-thumb { -webkit-appearance: none; width: 8px; height: 8px; border-radius: 50%; background: #f7dfb5; margin-top: -2.5px; box-shadow: 0 0 8px #f1cf9170; }
.timeline input::-moz-range-thumb { width: 8px; height: 8px; border: 0; border-radius: 50%; background: #f7dfb5; box-shadow: 0 0 8px #f1cf9170; }
.timeline input:disabled { cursor: default; }
.timeline input:disabled::-webkit-slider-thumb { opacity: 0; }
.timeline input:disabled::-moz-range-thumb { opacity: 0; }
.status-message { position: fixed; bottom: calc(94px + env(safe-area-inset-bottom,0px)); left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); width: max-content; font-size: 12px; line-height: 1.5; background: #273f4c; color: #fff3db; padding: 12px 18px; z-index: 20; box-shadow: 0 8px 30px #0002; pointer-events: none; }
.status-message:empty { display: none; }
.noscript { position: fixed; bottom: 0; inset-inline: 0; background: var(--paper); padding: 15px; z-index: 30; }
.noscript a { text-decoration: underline; }
@media(max-width:1100px) and (min-width:861px) {
  .stage { gap: 26px; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr) minmax(0,.8fr); }
  .library-panel { padding-left: 0; }
  .track-name { font-size: 20px; }
}
@media(max-width:860px) {
  :root { --page-pad: clamp(16px,4vw,30px); }
  .app { grid-template-rows: 62px minmax(0,1fr); }
  .wordmark { font-size: 23px; }
  .header-controls { gap: 8px; }
  .socials { gap: 0; }
  .socials a { width: 40px; }
  .library-toggle { display: flex; }
  .stage { grid-template: minmax(0,1fr) / minmax(0,1fr) minmax(0,1fr); gap: 28px; padding: 10px 0 20px; }
  .poem-copy { font-size: 20px; line-height: 1.42; }
  .portal-art { background-image: url('assets/portal-small.webp'); }
  .poem-panel, .portal-column { transition: opacity .3s ease; }
  .library-panel { display: none; position: absolute; z-index: 5; grid-area: 1 / 1 / -1 / -1; inset: 0; width: 100%; padding: 18px 8px 30px; align-self: stretch; flex-direction: column; align-items: center; justify-content: center; }
  body[data-library=open] .library-panel { display: flex; animation: sleeve-in .3s ease both; }
  body[data-library=open] .track-list>li { animation: ink-arrive .55s cubic-bezier(.2,.65,.25,1) both; animation-delay: calc(var(--track-order,0) * .035s); }
  body[data-library=open] .portal-column { opacity: .055; }
  body[data-library=open] .player { visibility: hidden; }
  body[data-library=open] .poem-panel { opacity: 0; visibility: hidden; }
  .library-heading { display: flex; align-items: center; justify-content: center; min-height: 36px; margin-bottom: clamp(22px,5vh,48px); }
  .library-heading h2 { font: 10px/1.5 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--ink); }
  #close-panel { display: inline-flex; position: absolute; top: 6px; right: 0; }
  .track-list { width: min(100%,380px); display: flex; flex-direction: column; gap: clamp(6px,1.4vh,18px); }
  .track-button { position: relative; min-height: 48px; justify-content: center; gap: 0; padding: 4px 16px; }
  .track-button::before { position: absolute; left: 0; width: 12px; height: 1px; border-radius: 0; background: #715637; }
  .track-name { font: 500 clamp(25px,5vw,32px)/1.25 var(--poem-serif); }
  .track-button[aria-current=true] { color: #503817; }
  .track-button:hover .track-name { text-decoration: none; }
  .track-button:hover { color: #503817; }
  @keyframes sleeve-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
  .player #player-title { position: absolute; bottom: 74px; left: 12px; right: 12px; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; text-align: center; font: 11px/1.35 var(--serif); }
  .status-message { bottom: 88px; }
}
@media(max-width:600px) and (min-height:501px) {
  .stage { grid-template: minmax(0,1.3fr) minmax(0,1fr) / minmax(0,1fr); gap: 20px; padding: 6px 0 16px; }
  .portal-column { grid-column: 1; grid-row: 1; }
  .poem-panel { grid-column: 1; grid-row: 2; width: min(100%,380px); justify-self: center; text-align: center; }
  .poem-copy { font-size: 19px; line-height: 1.4; }
  .poem-credit { justify-content: center; position: relative; margin-top: 12px; }
  .poem-pages { position: absolute; right: 0; }
}
@media(max-width:380px) {
  .wordmark { font-size: 20px; letter-spacing: .22em; }
  .header-controls { gap: 4px; }
  .header { gap: 8px; }
  .socials a { width: 36px; }
  .socials svg { width: 15px; height: 15px; }
}
@media(max-height:560px) {
  .app { grid-template-rows: 48px minmax(0,1fr); }
  .stage { padding: 2px 0 18px; gap: 24px; }
  .track-button { min-height: 32px; }
  .poem-copy { font-size: 18px; line-height: 1.35; }
  .poem-credit { margin-top: 8px; }
  .status-message { bottom: 76px; }
}
@media(max-height:500px) and (max-width:600px) {
  .stage { grid-template-columns: minmax(0,1.7fr) minmax(0,.7fr); gap: 16px; }
  .poem-copy { font-size: 18px; }
}
@media(max-height:560px) and (max-width:860px) {
  .library-panel { padding: 8px 0 16px; }
  .track-list { width: min(100%,560px); display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
  .track-name { font-size: clamp(18px,3.5vw,25px); }
  .track-button { min-height: 44px; padding-inline: 10px; }
  .track-button::before { width: 6px; }
  .library-heading { margin-bottom: 12px; }
}
@media(max-height:300px) {
  .app { grid-template-rows: 32px minmax(0,1fr); }
  .header-controls { width: 100%; justify-content: space-between; }
  .header .wordmark, .library-toggle, body[data-library=open] .library-panel, .library-panel { display: none; }
  .compact-song { display: block; max-width: 180px; color: var(--ink); background: transparent; border: 0; border-radius: 0; min-height: 28px; font: 14px var(--serif); }
  .compact-song option { background: var(--paper); color: var(--ink); }
  .socials a { height: 28px; }
  .stage { grid-template-columns: minmax(0,1.7fr) minmax(0,1fr); gap: 20px; padding: 0 0 16px; }
  .poem-panel { text-align: left; width: 100%; }
  .poem-copy { font-size: 16px; line-height: 1.35; }
  .poem-credit { justify-content: space-between; height: 24px; min-height: 24px; margin-top: 4px; }
  .poem-credit cite { font-size: 9px; }
  .poem-pages { position: static; }
  .poem-pages .icon-button { height: 24px; width: 28px; }
  .poem-note { margin-top: 2px; font-size: 11px; line-height: 1.4; }
  .player #player-title { display: none; }
  .status-message { bottom: 48px; }
}
@container portal (max-width:180px) {
  .transport { gap: 0; bottom: 16px; }
  .transport .icon-button { width: 24px; height: 36px; }
  .play-button { width: 28px; height: 36px; }
  .player #player-title { display: none; }
  .timeline>span { font-size: 8px; bottom: 7px; }
  #elapsed { left: 7px; }
  #duration { right: 7px; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation: none!important; transition: none!important; }
  .portal.field-ready .portal-art { opacity: 1; }
  #atmosphere,.portal-light { display: none; }
}
