/* The Yellow Pieces — "Lemon Dusk": blue-black ground, soft cream text, golden lemon.
   Display + reading type: Newsreader. Interface: Instrument Sans. */
:root {
  --ground: #15181C;
  --surface: #242A33;
  --surface-2: #2B323C;
  --line: #343B46;
  --line-strong: #4A525E;
  --text: #E6E1D6;
  --text-soft: #A4AAB2;
  --text-read: #CFCAC0;
  --lemon: #F2D24A;
  --lemon-hover: #F7DF73;
  --on-lemon: #15181C;
  --stuck: #F2D24A;
  --x: #FF8A7D;
  --ok: #8FD18A;
  --radius: 16px;
  --radius-sm: 10px;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --ui: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hl-yellow: #F2D24A; --hl-blue: #7FB8E8; --hl-green: #8FD18A; --hl-red: #F28B82;
  --hl-orange: #F7B267; --hl-purple: #C3A3E6; --hl-gray: #BDBDBD;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--text); font: 17px/1.55 var(--ui); }
a { color: var(--text); text-underline-offset: 3px; }
a:hover { color: var(--lemon); }
:focus-visible { outline: 3px solid var(--lemon); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; }
sup { font-size: 0.6em; }
img { max-width: 100%; }

/* ---------- highlighter (the sister-site thread: same marker, darker ground) ---------- */
.hl { --hlc: var(--hl-yellow); background: linear-gradient(104deg, transparent 0.6%, var(--hlc) 2%, var(--hlc) 96%, transparent 98%) 0 60% / 100% 90% no-repeat;
  padding: 0 0.15em; color: #15181C; text-decoration: none; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
a.hl:hover { color: #15181C; text-decoration: underline; }
.hl-yellow { --hlc: var(--hl-yellow); } .hl-blue { --hlc: var(--hl-blue); } .hl-green { --hlc: var(--hl-green); } .hl-red { --hlc: var(--hl-red); }
.hl-orange { --hlc: var(--hl-orange); } .hl-purple { --hlc: var(--hl-purple); } .hl-gray { --hlc: var(--hl-gray); }
.underline { border-bottom: 4px solid var(--lemon); }

/* ---------- top bar + category bar ---------- */
.topbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--surface); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 400 1.65rem/1 var(--serif); }
.brand:hover { color: var(--text); }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lemon); }
.top-actions { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.top-actions > a:not(.btn), #account a, #account .link { font-weight: 600; text-decoration: none; padding: 8px 4px; }
#account { display: inline-flex; gap: 10px; align-items: center; }
.cats { border-bottom: 1px solid var(--surface); padding: 0 24px; }
.cats-inner { max-width: 1240px; margin: 0 auto; display: flex; gap: 4px 24px; overflow-x: auto; scrollbar-width: none; }
.cats-inner::-webkit-scrollbar { display: none; }
.cats a { flex: none; padding: 13px 0; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
  border-bottom: 3px solid transparent; }
.cats a[aria-current] { color: var(--lemon); border-bottom-color: var(--lemon); }
#banner { background: var(--lemon); color: var(--on-lemon); text-align: center; padding: 6px 12px; font-size: 0.9rem; font-weight: 600; }

main { max-width: 1240px; margin: 0 auto; padding: 36px 24px 72px; }
.foot { border-top: 1px solid var(--surface); padding: 32px 24px 48px; }
.foot-inner { max-width: 1240px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; color: var(--text-soft); }
.foot-brand { font: 400 1.35rem var(--serif); color: var(--text); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ---------- surfaces ---------- */
.paper { background: var(--surface); border-radius: var(--radius); padding: 28px; }

/* ---------- buttons ---------- */
.btn, .btn-ghost, .btn-dark { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 8px 20px;
  border-radius: 12px; font: 700 1rem var(--ui); text-decoration: none; cursor: pointer; }
.btn { background: var(--lemon); color: var(--on-lemon); border: 2px solid var(--lemon); }
.btn:hover { background: var(--lemon-hover); border-color: var(--lemon-hover); color: var(--on-lemon); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--lemon); color: var(--text); }
.btn-dark { background: var(--ground); color: var(--lemon); border: 2px solid var(--ground); }
.btn-dark:hover { color: var(--lemon-hover); }
.btn-small { min-height: 38px; padding: 4px 14px; }
.link { background: none; border: 0; padding: 4px; color: var(--text); font: inherit; text-decoration: underline; cursor: pointer; }
.link:hover { color: var(--lemon); }
.danger { color: var(--x); }
button:disabled { opacity: 0.5; cursor: default; }

/* ---------- section headings ---------- */
.kicker { margin: 0; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lemon); }
.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; margin-bottom: 22px; }
.section-title { font: 500 clamp(1.8rem, 4vw, 2.6rem)/1.15 var(--serif); margin: 6px 0 0; }
.sec-blurb { margin: 0; color: var(--text-soft); max-width: 440px; }
.sec-all { font-weight: 600; }
.home section, .block { margin-top: 72px; }
.lede { color: var(--text-read); font: 1.2rem/1.6 var(--serif); margin: 0; max-width: 62ch; }
.eyebrow { margin: 0 0 8px; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-soft); font-weight: 700; }

/* ---------- pick one ---------- */
.home > section:first-child { margin-top: 0; }
.pick-head { display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; }
.pick-head h1 { flex: 1 1 520px; font: 500 clamp(2.2rem, 6vw, 3.4rem)/1.1 var(--serif); margin: 0; }
.pick-head p { flex: 0 1 380px; }
.pair { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 520px)); justify-content: center; gap: 20px; }
.pair-opt { position: relative; aspect-ratio: 4 / 5; padding: 0; border: 3px solid transparent; border-radius: 18px; overflow: hidden;
  background: var(--surface); cursor: pointer; color: var(--text); font: inherit; text-align: left; transition: border-color 0.2s, opacity 0.2s; }
.pair-opt:hover { border-color: var(--line-strong); }
.pair-opt[aria-pressed="true"] { border-color: var(--lemon); }
.pair.voted .pair-opt[aria-pressed="false"] { opacity: 0.55; }
.pair-or { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 84px; height: 84px; border-radius: 50%;
  background: var(--lemon); color: var(--on-lemon); border: 6px solid var(--ground); display: flex; align-items: center; justify-content: center;
  font: 400 1.75rem var(--serif); pointer-events: none; }
.pair-results { display: grid; grid-template-columns: repeat(2, minmax(0, 520px)); justify-content: center; gap: 20px; margin-top: 12px; }
.pair-result { padding: 12px 16px; border-radius: 12px; background: var(--surface); font-weight: 700; font-size: 1.1rem;
  display: flex; flex-direction: column; gap: 8px; }
.pair-result .bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pair-result .bar i { display: block; height: 100%; background: var(--lemon); }
.pair-result small { font-weight: 400; color: var(--text-soft); font-size: 0.9rem; }
.pair-controls { max-width: 1060px; margin: 16px auto 0; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.timer { flex: 1 1 100%; height: 6px; border-radius: 3px; background: var(--surface); overflow: hidden; }
.timer i { display: block; height: 100%; width: 0; background: var(--lemon); }
.pair-hint { font: 1.3rem var(--serif); margin: 0; }
.pair-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.take { max-width: 1060px; margin: 16px auto 0; background: var(--surface); border-radius: var(--radius); padding: 22px;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.take label { flex: 1 1 460px; display: flex; flex-direction: column; gap: 10px; font: 400 1.35rem var(--serif); margin: 0; }
.take .pair-buttons { align-items: center; }
@media (max-width: 640px) {
  .pair, .pair-results { grid-template-columns: minmax(0, 1fr); }
  .pair-or { top: 50%; width: 64px; height: 64px; font-size: 1.35rem; }
}

/* ---------- media: photos, text-in-picture posts ---------- */
.media { position: absolute; inset: 0; margin: 0; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media.fit .blur { position: absolute; inset: 0; object-fit: cover; filter: blur(28px) brightness(0.55); transform: scale(1.15); }
.media.fit .main { position: relative; object-fit: contain; }
.media-box { position: relative; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.media-box.wide { aspect-ratio: 4 / 3; }
.tone img:not(.blur) { filter: saturate(0.5) contrast(0.95) brightness(0.94); transition: filter 0.45s ease; }
.tone::after { content: ''; position: absolute; inset: 0; background: #5E7A96; mix-blend-mode: color; opacity: 0.3; transition: opacity 0.45s ease; pointer-events: none; }
a:hover .tone img, a:focus-visible .tone img, .tone:hover img { filter: none; }
a:hover .tone::after, a:focus-visible .tone::after, .tone:hover::after { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .tone img, .tone::after { transition: none; } }

/* ---------- featured ---------- */
.featured { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.featured-side { display: grid; gap: 16px; }
.tile { position: relative; display: block; min-height: 260px; border-radius: var(--radius); overflow: hidden; background: var(--surface); text-decoration: none; color: var(--text); }
.tile:hover { color: var(--text); }
.tile.big { min-height: 560px; }
.tile .panel { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 22px; background: rgba(21, 24, 28, 0.88); display: flex; flex-direction: column; gap: 4px; }
.tile .panel b { font-size: 1.3rem; }
.tile.big .panel b { font-size: 1.7rem; }
.tile .panel q { font: italic 1.08rem/1.45 var(--serif); color: #C9C5BC; quotes: '\201C' '\201D'; }
.tile.big .panel q { font-size: 1.3rem; }
.tile.text { display: flex; flex-direction: column; justify-content: center; padding: 32px; background: var(--surface); }
.tile.text .lineq { font: italic 500 clamp(1.4rem, 3vw, 2.1rem)/1.35 var(--serif); margin: 10px 0 14px; }
.tile .acts { display: flex; gap: 16px; margin-top: 8px; font-size: 0.92rem; font-weight: 600; color: var(--text-soft); }
@media (max-width: 860px) { .featured { grid-template-columns: minmax(0, 1fr); } .tile.big { min-height: 440px; } }

/* ---------- trending ---------- */
.trend { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); list-style: none; padding: 0; margin: 0; }
.trend a { display: flex; flex-direction: column; gap: 14px; height: 100%; min-height: 240px; padding: 24px; border-radius: var(--radius);
  background: var(--surface); text-decoration: none; color: var(--text); }
.trend a:hover { color: var(--text); outline: 1px solid var(--line-strong); }
.trend .top { display: flex; justify-content: space-between; gap: 10px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.trend .top span:first-child { color: var(--lemon); }
.trend .top span:last-child { color: var(--text-soft); }
.trend .line { flex: 1; font: 1.35rem/1.4 var(--serif); }
.trend .by { font-size: 0.9rem; color: var(--text-soft); }
.trend .counts { display: flex; gap: 16px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 0.9rem; font-weight: 600; }

/* ---------- share band ---------- */
.band { background: var(--lemon); color: var(--on-lemon); border-radius: 20px; padding: 40px; display: flex; flex-wrap: wrap; gap: 24px 32px;
  align-items: center; justify-content: space-between; }
.band h2 { font: 500 clamp(1.8rem, 4vw, 2.5rem)/1.15 var(--serif); margin: 0; }
.band p { margin: 10px 0 0; max-width: 60ch; font-size: 1.05rem; }
.band .btn-ghost { color: var(--on-lemon); border: 2px solid var(--on-lemon); }
.band .btn-ghost:hover { color: var(--on-lemon); background: rgba(21, 24, 28, 0.08); }
.band-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- color chips ---------- */
.colors { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.colors-label { color: var(--text-soft); font-size: 0.95rem; margin-right: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.chip { --c: var(--hl-yellow); display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 4px 14px; border-radius: 999px;
  background: transparent; border: 2px solid var(--c); color: var(--text); font: 700 0.92rem var(--ui); text-decoration: none; cursor: pointer; }
.chip:hover { color: var(--text); background: color-mix(in srgb, var(--c) 18%, transparent); }
.chip[aria-current], .chip[aria-pressed="true"], .chip-radio:has(input:checked) { background: var(--c); color: #15181C; }
.chip b { font-weight: 700; opacity: 0.75; }
.chip-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-radio:has(input:focus-visible) { outline: 3px solid var(--lemon); outline-offset: 2px; }
.dot { width: 12px; height: 12px; border-radius: 50%; margin-left: auto; flex: none; background: var(--hl-yellow); }
.dot-blue { background: var(--hl-blue); } .dot-green { background: var(--hl-green); } .dot-red { background: var(--hl-red); }
.dot-orange { background: var(--hl-orange); } .dot-purple { background: var(--hl-purple); } .dot-gray { background: var(--hl-gray); }

/* ---------- quote cards (live text, so the words always fit the frame) ---------- */
.qcard { --qa: #f6eccf; --qb: #e9d9ac; --qi: #2e2618; --qs: #6e5f3e; margin: 0; position: relative; aspect-ratio: 4 / 5;
  display: flex; flex-direction: column; justify-content: center; padding: 14% 11%; border-radius: 14px;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.18) 100%), linear-gradient(135deg, var(--qa), var(--qb));
  color: var(--qi); overflow: hidden; container-type: inline-size; }
.qcard::before { content: '\201C'; position: absolute; top: -0.12em; left: 0.08em; font: italic 9rem/1 var(--serif); color: var(--qs); opacity: 0.3; z-index: 1; }
.qcard blockquote { margin: 0; font: italic 400 clamp(1.15rem, 7.5cqi, 2.4rem)/1.32 var(--serif); position: relative; z-index: 1; }
.qcard-long blockquote { font-size: clamp(1rem, 5.6cqi, 1.8rem); }
.qcard figcaption { margin-top: 0.9em; font: 700 clamp(0.85rem, 3.6cqi, 1.1rem) var(--ui); color: var(--qs); position: relative; z-index: 1; }
.qcard.photo { --qi: #F4F0E6; --qs: #E8D98A; background: #15181C; }
.qcard.photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qcard.photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(21,24,28,0.35), rgba(21,24,28,0.72)); }
.qcard.photo blockquote, .qcard.photo figcaption { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5); }
.pair-opt .qcard, .tile .qcard { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
.qcard-lg { max-width: 520px; }
.qlink { display: block; text-decoration: none; border-radius: 14px; }

/* ---------- cards (section grids) ---------- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border-radius: var(--radius); padding: 14px; }
.card .media-box { margin: -2px -2px 2px; }
.card h3 { font: 500 1.45rem/1.25 var(--serif); margin: 4px 6px 0; }
.card h3 a { text-decoration: none; }
.body-ex, .writeup-ex { margin: 0 6px; color: var(--text-read); white-space: pre-line; font-family: var(--serif); font-size: 1.05rem; }
.writeup-ex { font-size: 0.98rem; color: var(--text-soft); }
.card footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: auto; padding: 8px 4px 2px; }
.meta { margin: 0; color: var(--text-soft); font-size: 0.9rem; }
.replies { color: var(--text-soft); font-size: 0.9rem; font-weight: 600; text-decoration: none; }

.stuck { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-strong); color: var(--text); font: 700 0.95rem var(--ui); }
.stuck:hover { border-color: var(--lemon); }
.stuck svg { width: 16px; height: 16px; fill: none; stroke: var(--lemon); stroke-width: 2; stroke-linejoin: round; }
.stuck.on { background: var(--lemon); border-color: var(--lemon); color: var(--on-lemon); }
.stuck.on svg { fill: currentColor; stroke: currentColor; }

/* ---------- single piece ---------- */
.sheet { max-width: 760px; margin: 0 auto; }
.sheet.narrow { max-width: 480px; }
.sheet .qcard-lg, .sheet .hero-media { margin: 0 auto 22px; }
.hero-media { max-width: 560px; }
.sheet-title { font: 500 clamp(2rem, 5vw, 2.8rem)/1.15 var(--serif); margin: 0 0 14px; }
.sub { font: 700 0.85rem var(--ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--lemon); margin: 26px 0 8px; }
.prose { font: 1.25rem/1.7 var(--serif); white-space: pre-line; margin: 0 0 16px; color: var(--text-read); }
.prose.verse { font-size: 1.32rem; }
.prose-page p, .prose-page li { font: 1.15rem/1.7 var(--serif); color: var(--text-read); }
.from { color: var(--text-soft); margin: 0 0 6px; text-align: center; }
.aim { background: var(--surface-2); border-left: 4px solid var(--lemon); padding: 10px 14px; margin: 0 0 8px; border-radius: 0 8px 8px 0; }
.scene { font: 1.02rem/1.6 'Courier New', Courier, monospace; white-space: pre-wrap; background: var(--ground); padding: 14px; border-radius: var(--radius-sm); margin: 0 0 10px; }
.pill { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: var(--lemon); color: var(--on-lemon); margin: 0 0 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.highlighter { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.label { font-weight: 700; margin: 0 0 8px; }
.opt { font-weight: 400; color: var(--text-soft); }
.comments { max-width: 760px; margin: 40px auto 0; }
.comments .section-title { margin-bottom: 14px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 18px; }
.comment-list li { border-bottom: 1px solid var(--line); padding: 12px 0; }
.comment-list p { margin: 2px 0; }
.legend { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plain { padding-left: 1.1em; }
details summary { cursor: pointer; font-weight: 700; margin: 10px 0; }

/* ---------- forms ---------- */
.stack { display: flex; flex-direction: column; gap: 6px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
label, legend { font-weight: 700; margin: 10px 0 0; }
input, select, textarea { font: 1rem var(--ui); color: var(--text); background: var(--ground); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 11px 13px; min-height: 46px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--lemon); outline: none; box-shadow: 0 0 0 2px rgba(242, 210, 74, 0.35); }
textarea { resize: vertical; }
#f-body:not(.scene-input) { font: 1.15rem/1.5 var(--serif); }
.verse-input { font: 1.15rem/1.6 var(--serif); }
.scene-input { font: 1rem/1.55 'Courier New', Courier, monospace; }
.hint { flex-basis: 100%; margin: 4px 0 0; color: var(--text-soft); font-size: 0.92rem; }
.toggles { border: 0; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 6px; }
.toggles label { font-weight: 400; margin: 0; display: flex; gap: 10px; align-items: center; }
.toggles input, .check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--lemon); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 400; }
.backdrops { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.bd { margin: 0; display: flex; align-items: flex-end; height: 64px; padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer;
  background: linear-gradient(135deg, var(--qa), var(--qb)); color: var(--qi); font: 700 0.85rem var(--ui); border: 3px solid transparent; }
.bd input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bd:has(input:checked) { border-color: var(--lemon); }
.bd:has(input:focus-visible) { outline: 3px solid var(--lemon); outline-offset: 2px; }
#preview { max-width: 340px; margin: 10px 0 4px; }
.choices { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.choice { display: flex; flex-direction: column; gap: 4px; height: 100%; color: var(--text); text-decoration: none; }
.choice b { font: 500 1.55rem var(--serif); }
.choice span { color: var(--text-soft); }
.choice:hover { outline: 1px solid var(--lemon); color: var(--text); }
.error { color: var(--x); font-weight: 700; }

/* ---------- admin ---------- */
.admin-grid { display: grid; gap: 24px; }
.admin-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.admin-list li { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.admin-list .thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: none; }
.admin-list .what { flex: 1 1 240px; }
.admin-list .what small { display: block; color: var(--text-soft); }
#photo-preview img { max-width: 260px; border-radius: 12px; display: block; margin-top: 8px; }

/* ---------- section / profile / search ---------- */
.page-head { margin-bottom: 26px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.page-head h1 { font: 500 clamp(2.2rem, 6vw, 3.2rem)/1.1 var(--serif); margin: 0; }
.head-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; width: 100%; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { padding: 7px 16px; border-radius: 999px; text-decoration: none; color: var(--text); border: 1px solid var(--line-strong); font-weight: 600; }
.tabs a[aria-current] { background: var(--lemon); border-color: var(--lemon); color: var(--on-lemon); }
.search { display: flex; gap: 8px; width: 100%; max-width: 560px; }
.empty { color: var(--text-soft); font-style: italic; }
#bio-form { width: 100%; max-width: 560px; }
.learn-teaser { border: 1px solid var(--lemon); border-radius: 20px; padding: 32px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.learn-teaser p { max-width: 62ch; margin: 8px 0 0; color: var(--text-read); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--lemon); color: var(--on-lemon); padding: 10px 18px;
  border-radius: 999px; font-weight: 700; z-index: 20; }

@media (max-width: 560px) {
  main { padding: 26px 16px 56px; }
  .topbar, .cats { padding-left: 16px; padding-right: 16px; }
  .paper { padding: 20px 16px; }
  .band { padding: 28px 22px; }
  .home section, .block { margin-top: 56px; }
}

/* ---------- piece images (from the Writing Desk) ---------- */
.art { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--surface-2); }
.artvis { position: absolute; inset: 0; }
.arttile { position: relative; display: block; border-radius: 14px; overflow: hidden; aspect-ratio: 1 / 1; text-decoration: none; color: #fff; background: var(--surface-2); }
.arttile .art { position: absolute; inset: 0; transition: transform 0.5s ease; }
.arttile:hover .art, .arttile:focus-visible .art { transform: scale(1.04); }
.arttile .arttitle { position: absolute; left: 0; right: 0; bottom: 0; padding: 38px 16px 14px; font: 500 1.4rem/1.2 var(--serif); color: #fff;
  background: linear-gradient(to top, rgba(10, 12, 16, 0.82), rgba(10, 12, 16, 0)); text-wrap: balance; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); }
.card.has-art .arttile + h3 { display: none; }
/* Alternate layout: the title next to the picture */
body[data-tiles="beside"] .card.has-art { padding: 12px; }
body[data-tiles="beside"] .card.has-art .arttile { display: grid; grid-template-columns: 42% minmax(0, 1fr); aspect-ratio: auto; background: transparent; color: var(--text); gap: 14px; align-items: center; }
body[data-tiles="beside"] .card.has-art .arttile .art { position: static; aspect-ratio: 1 / 1; border-radius: 12px; }
body[data-tiles="beside"] .card.has-art .arttile .arttitle { position: static; padding: 0; background: none; color: var(--text); text-shadow: none; font-size: 1.35rem; }
body[data-tiles="beside"] .card.has-art .arttile:hover .art { transform: none; }
.tilepref { display: inline-flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 0.92rem; }
.tilepref button { background: none; border: 1px solid var(--line, #3a3f47); color: var(--text-soft); border-radius: 999px; padding: 4px 12px; font: 600 0.88rem var(--ui); cursor: pointer; }
.tilepref button[aria-pressed="true"] { color: var(--text); border-color: var(--text); }
/* The faded picture behind a piece while it's read */
.piece-bg { position: fixed; inset: 0; z-index: -1; background-size: cover; background-position: center; background-repeat: no-repeat; opacity: 0.14; pointer-events: none; }
.paper.has-bg { background: color-mix(in srgb, var(--surface) 62%, transparent); backdrop-filter: blur(1.5px); }
.import-art { width: 44px; height: 44px; border-radius: 8px; vertical-align: middle; margin-right: 8px; object-fit: cover; }

/* trending picture + formatting bar */
.trend .trend-vis { position: relative; display: block; aspect-ratio: 16 / 9; margin: -24px -24px 0; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; background: var(--surface-2, var(--surface)); }
.trend .trend-vis img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trend .trend-vis .media, .trend .trend-vis figure { margin: 0; width: 100%; height: 100%; }
.fmt-bar { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.fmt-bar .btn-small { min-width: 40px; font-size: 1.05rem; }
.prose strong { font-weight: 700; } .prose em { font-style: italic; }

/* intro line, highlighted title word, From strip, signup */
.home > .intro { margin-top: 0; }
.home > .intro + section { margin-top: 36px; }
.intro-line { font: 1.3rem/1.5 var(--serif); color: var(--text-read); margin: 0; max-width: 62ch; }
.intro-line b { color: var(--text); font-weight: 500; }
mark.hlw { --hlc: var(--hl-yellow); background: linear-gradient(104deg, transparent 0.6%, var(--hlc) 2%, var(--hlc) 96%, transparent 98%) 0 60% / 100% 90% no-repeat; color: #15181C; padding: 0 0.18em; margin: 0 -0.08em; }
[class*="hl-"] mark.hlw { --hlc: inherit; }
.hl-yellow mark.hlw { --hlc: var(--hl-yellow); } .hl-blue mark.hlw { --hlc: var(--hl-blue); } .hl-green mark.hlw { --hlc: var(--hl-green); }
.hl-red mark.hlw { --hlc: var(--hl-red); } .hl-orange mark.hlw { --hlc: var(--hl-orange); } .hl-purple mark.hlw { --hlc: var(--hl-purple); } .hl-gray mark.hlw { --hlc: var(--hl-gray); }
.from-card, .signup-card { display: flex; flex-wrap: wrap; gap: 24px 36px; align-items: center; padding: 32px; border-radius: var(--radius); background: var(--surface); }
.from-card > div:last-child { flex: 1 1 340px; }
.from-card p { font: 1.12rem/1.6 var(--serif); color: var(--text-read); margin: 10px 0 0; }
.from-photo { flex: 0 0 auto; width: 132px; height: 132px; border-radius: 50%; overflow: hidden; background: var(--hl-yellow); display: grid; place-items: center; }
.from-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; display: block; }
.from-photo .ph { font: 500 2.2rem var(--serif); color: #15181C; }
.signup-card > div:first-child { flex: 1 1 300px; }
.signup-card p { font: 1.05rem/1.55 var(--serif); color: var(--text-read); margin: 8px 0 0; }
.signup-form { flex: 1 1 320px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.signup-form input { flex: 1 1 220px; min-width: 0; }
.signup-form .hint { flex-basis: 100%; margin: 0; }
.signup-thanks { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.from-card, .signup-card { text-align: left; }
.from-card h2 { color: var(--text); }
.from-card .sec-all { display: inline-block; margin-top: 14px; }

.dropzone { display: grid; gap: 4px; place-items: center; text-align: center; padding: 34px 20px; border: 2px dashed var(--line-strong); border-radius: var(--radius); cursor: pointer; color: var(--text-read); }
.dropzone b { font-size: 1.1rem; color: var(--text); } .dropzone span { font-size: 0.95rem; color: var(--text-soft); }
.dropzone.over, .dropzone:hover { border-color: var(--lemon); background: rgba(242, 210, 74, 0.08); }
#batch-cards .admin-list input { width: 100%; }

/* Emoji reactions */
.rx { position: relative; display: inline-flex; }
.rx-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-strong); color: var(--text); font: 700 0.95rem var(--ui); }
.rx-btn > span { font-size: 1.15rem; line-height: 1; }
.rx-btn:hover, .rx-btn[aria-expanded="true"] { border-color: var(--lemon); }
.rx-btn.on { border-color: var(--lemon); background: rgba(242, 210, 74, 0.14); }
.rx-pop { position: absolute; z-index: 20; left: 0; bottom: calc(100% + 8px); display: flex; gap: 2px; padding: 6px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line-strong); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.rx-pop[hidden] { display: none; }
.rx-pop button { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 44px; min-height: 48px; padding: 2px 4px;
  border: 0; border-radius: 14px; background: transparent; cursor: pointer; color: var(--text-soft); font: 700 0.72rem var(--ui); }
.rx-pop button span { font-size: 1.55rem; line-height: 1.1; transition: transform 0.12s; }
.rx-pop button:hover span, .rx-pop button:focus-visible span { transform: scale(1.25); }
.rx-pop button.on { background: rgba(242, 210, 74, 0.2); color: var(--text); }
@media (max-width: 420px) { .rx-pop { left: auto; right: -40px; } }
@media (prefers-reduced-motion: reduce) { .rx-pop button span { transition: none; } }

/* Sketches: under-construction page with teaser stills */
.stills { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.stills figure { margin: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.stills img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #1d2127; }
.stills figcaption { padding: 12px 16px 14px; font: 600 1rem/1.3 var(--ui); color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.soon-tag { background: var(--lemon); color: var(--on-lemon); border-radius: 999px; padding: 3px 12px; font-size: 0.85rem; letter-spacing: 0.04em; }
@media (min-width: 900px) { .stills { grid-template-columns: repeat(3, 1fr); } .stills li:first-child { grid-column: 1 / -1; } .stills li:first-child img { aspect-ratio: auto; max-height: 520px; object-fit: contain; background: #efe6d2; } }

/* line -> passage */
.excerpt { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 4px 0 18px; }
.excerpt p { margin: 0; color: var(--text-soft); }
.excerpt i { font-family: var(--serif); font-size: 1.1em; color: var(--text); }
.piece-bg.passage-bg { opacity: 1; background-size: cover; background-position: center bottom; }
.passage { background: rgba(31, 27, 58, 0.72); border: 1px solid rgba(251, 246, 228, 0.14); border-radius: 14px; padding: 40px 8%; color: #FBF6E4; }
.passage .passage-title { font-style: italic; font-weight: 500; }
.passage .passage-text { color: #F3EEDC; white-space: normal; }
.passage .passage-text p { margin: 0 0 18px; font: 1.25rem/1.65 var(--serif); }
.passage .hint { color: #CFC6DB; }
