:root {
  color-scheme: light;
  --ink: #282c25;
  --muted: #575c51;
  --green: #294a37;
  --line: #c7c6b8;
  --paper: #fffdf4;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background: #eeece3;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 50% 22%, #f8f6ee 0%, transparent 72%); }
button, textarea, input, .controls a, .write-link { font: 500 14px/1.4 -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif; }
button, a { color: var(--green); }
a { text-decoration-thickness: 1px; text-underline-offset: 4px; }
button, .controls a { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 48px; border: 0; background: transparent; padding: 9px 10px; cursor: pointer; text-decoration: none; }
button:hover, .controls a:hover { background: #eaece0; }
:focus-visible { outline: 3px solid #987525; outline-offset: 3px; }
h2[tabindex]:focus { outline: none; }
.mast { max-width: 914px; margin: 0 auto; min-height: 62px; display: flex; justify-content: flex-end; align-items: center; gap: 22px; border-bottom: 1px solid #afafa0; }
.write-link { display: inline-flex; align-items: center; min-height: 48px; text-decoration: none; gap: 10px; }
.write-link { font-size: 13px; }
.write-link:hover { text-decoration: underline; }
main { max-width: 652px; margin: 0 auto; padding: 0 16px 50px; }
.heading { margin: 40px 0 28px; text-align: center; }
h1, h2, p, figure, blockquote { margin: 0; }
h1 { font-size: clamp(40px, 6vw, 64px); letter-spacing: -.055em; font-weight: 400; line-height: 1.06; }
.heading p { font-size: 17px; line-height: 1.5; margin: 10px auto 0; color: #41483e; }
.paper { background: var(--paper); border: 1px solid #bdbdaf; padding: 25px 28px 18px; box-shadow: 3px 4px 0 #d9d8cb, 0 12px 34px #49462908; }
.card-top, footer { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.context, .face-label, .index { font: 600 12px/1.5 ui-monospace, 'Courier New', monospace; letter-spacing: .11em; text-transform: uppercase; }
.context { color: var(--green); white-space: pre-wrap; }
.face-label, .index { color: var(--muted); }
h2 { font-size: clamp(31px, 4vw, 40px); font-weight: 400; letter-spacing: -.04em; line-height: 1.12; margin: 14px 0 10px; }
.card-content { display: flex; flex-direction: column; }
.faces { display: grid; }
.front, .reverse { grid-area: 1 / 1; min-width: 0; }
.concealed { visibility: hidden; pointer-events: none; }
.intro { font-size: 19px; line-height: 1.42; margin-bottom: 17px; }
.stills { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; }
.stills img, .ticket img { display: block; width: 100%; height: auto; }
.stills img { aspect-ratio: 1.5; }
figcaption, .recording p, .notice { font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif; }
figcaption { margin-top: 8px; }
figcaption b, .recording b { display: block; color: var(--green); }
.ticket, .recording { border-top: 1px solid var(--line); padding-top: 16px; }
.ticket img { aspect-ratio: 2.5; }
audio { display: block; width: 100%; margin: 8px 0 16px; }
.reverse { display: flex; align-items: center; border-top: 1px solid var(--line); padding: 10px 6px; }
blockquote { font-size: clamp(25px, 4vw, 35px); line-height: 1.32; letter-spacing: -.025em; }
.controls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.controls button:last-of-type:not(:first-child) { margin-left: auto; }
button svg { width: 17px; height: 17px; flex: none; }
.primary { background: var(--green); color: var(--paper); padding-inline: 14px; }
.primary:hover { background: #163b28; }
footer { margin-top: 18px; color: var(--muted); }
footer span:first-child { font-size: 12px; font-style: italic; line-height: 1.4; }
.index { white-space: nowrap; font-weight: 400; text-transform: none; letter-spacing: 0; }
textarea { padding: 8px; width: 100%; background: #fffef8; border: 1px solid #979d8f; color: var(--ink); }
.prompt label { display: block; margin: 22px 0 8px; font-size: 20px; line-height: 1.3; }
.prompt textarea { display: block; resize: vertical; font-size: 16px; border-color: #7e8777; }
.prompt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 16px; }
button:disabled { cursor: default; opacity: .55; }
.copy-status { min-height: 1.4em; color: var(--green); font: 14px/1.4 -apple-system, sans-serif; }
.manual-copy { width: min(360px, 90vw); color: var(--ink); background: var(--paper); border: 1px solid var(--line); padding: 20px; }
.manual-copy::backdrop { background: #282c2560; }
.manual-copy label { font-size: 23px; }
.manual-copy p { margin: 10px 0; }
.manual-copy textarea { min-height: 80px; }
.manual-copy form { text-align: right; }
h1 a { color: inherit; text-decoration: none; }
.ending, .prompt { padding-bottom: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 950px) { .mast { margin-inline: 16px; } }
@media (max-width: 550px) {
  .mast { min-height: 51px; }
  .heading { margin: 25px 0 21px; }
  .heading p { font-size: 16px; text-wrap: balance; }
  .paper { padding: 19px 16px 15px; }
  .intro { font-size: 18px; }
  .stills { gap: 10px; }
  figcaption { font-size: 13px; }
  .controls { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 0; }
  .controls .primary { grid-column: 1 / -1; }
  .controls button:last-of-type:not(:first-child) { margin: 0; }
  .ending .controls a { grid-column: 1 / -1; }
}

@media (min-width: 551px) and (max-height: 800px) {
  .mast { min-height: 48px; }
  .heading { margin: 22px 0 19px; }
  h1 { font-size: 53px; }
  .paper { padding-top: 19px; }
  .stills img { aspect-ratio: 1.85; object-fit: cover; }
}


/* Collection: a responsive grid of small paper cards (the auto-fill/minmax "RAM" pattern). */
.collection > h2 { text-align: center; margin: 0 0 18px; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr)); }
.tiles > li { min-width: 0; }
.tile { display: flex; height: 100%; color: var(--ink); text-decoration: none; flex-direction: column; gap: 6px; background: var(--paper); border: 1px solid #bdbdaf; padding: 10px 10px 12px; box-shadow: 3px 4px 0 #d9d8cb; transition: transform .15s; }
.tile:hover { transform: translateY(-2px); }
.tile-art { display: grid; place-items: center; aspect-ratio: 3 / 2; overflow: hidden; background: #f3f1e6; border: 1px solid var(--line); color: var(--green); }
.tile-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-art .wave { width: 62%; }
.tile .context { font-size: 12px; letter-spacing: .08em; white-space: normal; overflow-wrap: anywhere; }
.tile h3 { margin: 0; font-size: 22px; font-weight: 400; letter-spacing: -.03em; line-height: 1.15; }
.tile:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.tile-source { margin-top: auto; font-size: 12px; font-style: italic; color: var(--muted); line-height: 1.4; }
.collection .controls { justify-content: center; }
.collection .controls a { min-height: 48px; grid-column: 1 / -1; }
@media (max-width: 550px) { .tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; } .tile { padding: 8px 8px 10px; } .tile .context { letter-spacing: .03em; } .tile h3 { font-size: 19px; } }
@media (max-width: 340px) { .tiles { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }

/* Without JavaScript the card still turns: a link to #card-back shows the back, a link to #card-front shows the front.
   The buttons need JavaScript, so they hide. Both faces stay in the HTML for crawlers and readers. */
html:not(.js) .controls button, html:not(.js) .face-label { display: none; }
.controls .nojs-turn, .controls .nojs-front, html:not(.js) .paper:has(#card-back:target) .controls .nojs-turn { display: none; }
html:not(.js) .controls .nojs-turn, html:not(.js) .paper:has(#card-back:target) .controls .nojs-front { display: inline-flex; }
.controls a svg { width: 17px; height: 17px; flex: none; }
.controls a.primary { background: var(--green); color: var(--paper); padding-inline: 14px; }
.controls a.primary:hover { background: #163b28; }
html:not(.js) #card-back:target { visibility: visible; pointer-events: auto; }
html:not(.js) .faces:has(#card-back:target) .front { visibility: hidden; }
#card-back, #card-front { scroll-margin-top: 120px; }
.prompt ol { margin: 14px 0; padding-left: 22px; line-height: 1.5; font-size: 18px; }

/* More keeps: the other cards under the one being read. */
.more { margin-top: 64px; border-top: 1px solid #afafa0; padding-top: 22px; }
.more h2 { font-size: 26px; margin: 0 0 16px; text-align: center; }
.more .tile h3 { font-size: 20px; }
@media (max-width: 550px) { .more { margin-top: 44px; } .more .write-tile { grid-column: 1 / -1; } .more .write-tile .tile-art { aspect-ratio: 5 / 1; } .more .write-tile .wave { width: auto; height: 80%; } }

/* Site note: one quiet line under the collection and under More keeps. */
.site-note { margin: 22px auto 0; max-width: 34em; text-align: center; color: var(--muted); font: italic 13px/1.5 Georgia, 'Times New Roman', serif; }

/* Example label and text-only cards */
.card-meta, .tile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.text-card .intro { font-size: clamp(22px, 3vw, 27px); line-height: 1.38; letter-spacing: -.01em; margin-bottom: 18px; }
.textmark { border-top: 1px solid var(--line); padding: 18px 0 4px; color: var(--green); display: flex; justify-content: center; }
.textmark .mark { width: 156px; height: 31px; }
.textmark .wave.mark { width: 210px; height: 70px; }
.tile-art .wave.mark { width: 94%; height: auto; }
.tile-text { display: grid; place-items: center; width: 100%; height: 100%; }
.tile-text .mark { width: 62%; height: auto; }

/* Seed cards: two steps on the back, above the teller's words. */
.reverse.has-steps { flex-direction: column; align-items: stretch; gap: 18px; }
.steps { margin: 0; padding-left: 1.4em; font-size: 17px; line-height: 1.5; }
.steps li + li { margin-top: 8px; }
.steps li::marker { color: var(--green); font: 600 14px ui-monospace, 'Courier New', monospace; }
.has-steps blockquote { font-size: clamp(22px, 3.2vw, 28px); }
/* A card with steps has a tall back. Take the hidden face out of the layout so the front has no empty band under it. */
.text-card .concealed { display: none; }
html:not(.js) .text-card #card-back:target { display: flex; }
html:not(.js) .text-card .faces:has(#card-back:target) .front { display: none; }

/* Give a card */
.give fieldset { border: 0; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.give legend { font-size: 20px; line-height: 1.3; margin-bottom: 8px; padding: 0; }
.give .choice { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; margin: 0; font: 16px/1.4 -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif; cursor: pointer; }
.give .choice input { width: 24px; height: 24px; margin: 0; accent-color: var(--green); }
.give #initials { width: 6.5em; min-height: 48px; padding: 8px 10px; font: 16px/1.4 -apple-system, sans-serif; background: #fffef8; border: 1px solid #7e8777; color: var(--ink); }
.give #initials:disabled { opacity: .5; }
.give .consent { margin-top: 18px; font-size: 17px; }
.give textarea { min-height: 220px; }
.give .before-send { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 16px; }
.give .before-send .notice { margin: 0; }
.give .field-error { margin: 4px 0 0 34px; min-height: 1.4em; color: #8a2a1c; font: 15px/1.4 -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.button-link { display: inline-flex; align-items: center; min-height: 48px; padding: 9px 14px; background: var(--green); color: var(--paper); text-decoration: none; font: 500 14px/1.4 -apple-system, sans-serif; }

/* Regulars review fixes (11/29) */
/* Fixed controls: the card box is at least as tall as the tallest card at this width (measured by app.js), capped at the
   space below the heading. Its buttons sit at the bottom, and stick to the screen's bottom edge when a card runs longer. */
html.js #reader > article.paper { display: flex; flex-direction: column; padding-bottom: 0;
  min-height: min(calc(100svh - var(--reader-top, 200px)), var(--card-tallest, 0px)); }
html.js #reader > article.paper .card-content { flex: 1 0 auto; }
html.js #reader > article.paper .card-foot { position: sticky; bottom: 0; background: var(--paper); padding-bottom: 18px; }
@media (max-width: 550px) { html.js #reader > article.paper .card-foot { padding-bottom: 15px; } }
.sizer { position: absolute; left: -10000px; top: 0; visibility: hidden; pointer-events: none; }
.sizer > .paper { display: flex; flex-direction: column; padding-bottom: 0; }
.sizer .card-foot { padding-bottom: 18px; }
html.js .faces { cursor: pointer; }
.share-status { margin: 10px 0 0; color: var(--green); font: 14px/1.45 -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif; overflow-wrap: anywhere; }
.share-status:empty { display: none; }
.share-status a { font-weight: 600; }
.all-link { margin: 18px 0 0; text-align: center; font: 500 15px/1.4 -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif; }
.all-link a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 10px; }
/* Audio: one plain play/pause button instead of the browser's grey player. Without JavaScript the native player shows. */
html.js .recording audio { display: none; }
html:not(.js) .recording .play { display: none; }
.play { gap: 10px; margin: 8px 0 10px; padding: 9px 16px 9px 12px; border: 1.5px solid var(--green); border-radius: 999px; background: var(--paper); }
.play svg { width: 18px; height: 18px; }
.play.playing { background: var(--green); color: var(--paper); }
.play-time { font: 600 13px/1 ui-monospace, 'Courier New', monospace; color: inherit; opacity: .8; }
/* Writing page: both buttons weigh the same; the draft line is quiet. */
.prompt-actions .primary { min-width: 10.5em; }
.draft-note { margin: 4px 0 0; color: var(--muted); font: 13px/1.4 -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif; }

/* For-sale line: one small link at the very bottom of every page. */
.site-foot { display: block; margin: 48px auto 0; padding: 18px 0 28px; text-align: center; color: var(--muted); font: 13px/1.5 Georgia, 'Times New Roman', serif; }
.site-foot a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
}
/* Write your own is short without JS: keep the for-sale footer out of its first screen, like every other page. */
main:has(> #reader > .prompt) { min-height: 100vh; min-height: 100svh; }
