/* A · Reading room. The site as it is (sunset scene, frosted stone card, pink interface accent),
   with the type cut to two reading roles: Noticia Text for everything you read, Inter for everything
   you operate. Abolition names the page and nothing else. */
:root {
  --ink: rgb(12 10 9 / .86);
  --ink-2: rgb(12 10 9 / .72);
  --ink-3: rgb(12 10 9 / .64);
  --tone: rgb(255 255 255 / .42);
  --tone-2: rgb(255 255 255 / .7);
  --accent: #DB2777;
  --accent-ink: #9D174D;
  --accent-wash: rgb(219 39 119 / .1);
  --serif: "Noticia Text", Georgia, serif;
  --sans: "Inter", -apple-system, system-ui, sans-serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --sheet-ease: cubic-bezier(.32, .72, 0, 1);
  --t-enter: 280ms;
  --t-exit: 180ms;
  --sheet-w: min(520px, 42vw);
}
* { box-sizing: border-box; }
html.locked body { overflow: hidden; }
body {
  margin: 0; min-height: 100dvh; color: var(--ink); font: 400 15px/1.5 var(--sans);
  background: #FFE6D5;
}
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: url(../shared/sunset.webp) center 30% / cover no-repeat; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card {
  position: relative; width: min(760px, calc(100% - 24px)); margin: 24px auto; padding: 40px 56px 20px;
  border-radius: 20px; background: rgb(231 229 228 / .74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  min-height: calc(100dvh - 48px); display: flex; flex-direction: column;
  transition: transform 320ms var(--ease-out);
}
.head { display: flex; align-items: center; gap: 12px; }
h1 { margin: 0; font: 400 40px/1 "abolition", var(--sans); text-transform: uppercase; color: rgb(12 10 9 / .8); letter-spacing: .01em; }
.beta { font: 600 11px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-wash); padding: 5px 7px; border-radius: 6px; }

.intro { margin-top: 16px; }
.lede { margin: 0 0 28px; font: 400 17px/1.65 var(--serif); color: var(--ink-2); max-width: 58ch; text-wrap: pretty; }
.examples { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.examples button {
  width: 100%; text-align: start; border: 0; border-radius: 12px; padding: 13px 16px; background: var(--tone);
  font: 400 15px/1.45 var(--sans); color: var(--ink-2); transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.examples button:hover { background: var(--tone-2); color: var(--ink); }
.aside-link { display: inline-block; margin-top: 20px; font: 500 14px/1.4 var(--sans); color: var(--accent-ink); text-decoration: underline; text-decoration-color: rgb(190 24 93 / .3); text-underline-offset: 4px; }
.aside-link:hover { text-decoration-color: currentColor; }

#thread { flex: 1; }
.turn { padding-top: 36px; scroll-margin-top: 24px; }
.turn + .turn { margin-top: 28px; }
.question { margin: 0; font: 700 24px/1.3 var(--serif); color: var(--ink); text-wrap: balance; }

.working { display: flex; align-items: center; gap: 12px; margin-top: 14px; font: 400 14px/1.4 var(--sans); color: var(--ink-3); }
.bar { position: relative; width: 56px; height: 2px; border-radius: 2px; overflow: hidden; background: var(--accent-wash); flex: none; }
.bar::after { content: ""; position: absolute; inset: 0; width: 40%; border-radius: inherit; background: var(--accent); animation: slide 1.4s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.ghost { margin-top: 22px; display: grid; gap: 17px; }
.ghost i { display: block; height: 12px; border-radius: 6px; background: rgb(12 10 9 / .06); }
.ghost i.short { width: 62%; }

.answer { margin-top: 20px; }
.answer p { margin: 0 0 18px; font: 400 18px/1.65 var(--serif); color: var(--ink-2); text-wrap: pretty; hanging-punctuation: first; }
.cite {
  position: relative; top: -.5em; margin: 0 1px 0 2px; padding: 0 4px; min-width: 18px; height: 16px; border: 0; border-radius: 4px;
  font: 600 11px/16px var(--sans); font-variant-numeric: tabular-nums; color: var(--accent-ink); background: var(--accent-wash);
  vertical-align: baseline; transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.cite:hover, .cite.on { background: var(--accent); color: #fff; }
.notes-title { margin: 32px 0 6px; font: 600 13px/1.4 var(--sans); color: var(--ink-3); }
.notes { list-style: none; margin: 0 -12px; padding: 0; }
.notes button {
  display: grid; grid-template-columns: 24px 1fr; gap: 12px; width: 100%; text-align: start; border: 0; background: transparent;
  padding: 12px; border-radius: 12px; transition: background-color 160ms var(--ease-out);
}
.notes button:hover { background: var(--tone); }
.n { font: 600 13px/22px var(--sans); color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.note { display: grid; gap: 2px; min-width: 0; }
.note-title { font: 600 15px/1.4 var(--sans); color: var(--ink); }
.note-meta { font: 400 13px/1.4 var(--sans); color: var(--ink-3); }
.note-quote { margin-top: 4px; font: italic 400 15px/1.55 var(--serif); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trace { margin-top: 20px; font: 400 13px/1.5 var(--sans); color: var(--ink-3); }
.trace summary { cursor: pointer; width: fit-content; list-style: none; }
.trace summary::-webkit-details-marker { display: none; }
.trace summary::after { content: "›"; margin-left: 6px; display: inline-block; transition: transform 160ms var(--ease-out); }
.trace[open] summary::after { transform: rotate(90deg); }
.trace ol { margin: 8px 0 0; padding-left: 20px; }
.error { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--tone); }
.error p { margin: 0; flex: 1 1 240px; font: 400 15px/1.5 var(--sans); }
.error button { border: 0; border-radius: 10px; padding: 8px 14px; background: var(--accent); color: #fff; font-weight: 500; }

.enter { animation: rise var(--t-enter) var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.composer {
  position: sticky; bottom: 12px; z-index: 2; margin-top: 32px; display: flex; align-items: flex-end; gap: 8px;
  padding: 6px 6px 6px 18px; border-radius: 18px; background: rgb(255 255 255 / .9);
  box-shadow: 0 1px 2px rgb(57 52 88 / .08), 0 12px 32px -16px rgb(57 52 88 / .35);
}
.composer textarea {
  flex: 1; min-height: 40px; max-height: 160px; resize: none; border: 0; outline: 0; background: transparent; padding: 9px 0;
  font: 400 17px/22px var(--serif); color: var(--ink);
}
.composer textarea::placeholder { color: var(--ink-3); }
#send { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; transition: background-color 160ms var(--ease-out), opacity 160ms var(--ease-out); }
#send:hover { background: #EC4899; }
#send:disabled { opacity: .35; cursor: default; background: var(--accent); }
.fine { margin: 12px auto 0; max-width: 62ch; text-align: center; font: 400 12px/1.5 var(--sans); color: var(--ink-3); }

/* ---- the sheet ---- */
.scrim { position: fixed; inset: 0; z-index: 9; background: rgb(28 25 23 / .22); opacity: 0; transition: opacity var(--t-exit) ease-in; }
.scrim.in { opacity: 1; transition: opacity var(--t-enter) var(--ease-out); }
.sheet {
  position: fixed; z-index: 10; top: 12px; right: 12px; bottom: 12px; width: var(--sheet-w);
  display: flex; flex-direction: column; border-radius: 20px; overflow: hidden;
  background: rgb(245 243 242 / .94); -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 1px 2px rgb(57 52 88 / .1), 0 24px 60px -24px rgb(57 52 88 / .45);
  opacity: 0; transform: translateX(16px);
  transition: opacity var(--t-exit) ease-in, transform var(--t-exit) ease-in;
}
.sheet.in { opacity: 1; transform: none; transition: opacity 220ms var(--ease-out), transform 320ms var(--sheet-ease); }
.sheet[hidden], .scrim[hidden] { display: none; }
.sheet-head { position: relative; padding: 22px 64px 18px 28px; background: rgb(255 255 255 / .5); }
.sheet-meta { font: 500 12px/1.4 var(--sans); color: var(--ink-3); }
.sheet-head h2 { margin: 6px 0 0; font: 700 22px/1.25 var(--serif); color: var(--ink); text-wrap: balance; }
.sheet-author { margin: 4px 0 0; font: 400 14px/1.4 var(--sans); color: var(--ink-2); }
.sheet-actions:empty { display: none; }
.sheet-actions { margin-top: 14px; }
.open { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 14px; border-radius: 10px; background: var(--accent); color: #fff; font: 500 14px/1.3 var(--sans); text-decoration: none; transition: background-color 160ms var(--ease-out); }
.open:hover { background: #EC4899; }
.close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: var(--tone-2); color: var(--ink-2); transition: background-color 160ms var(--ease-out); }
.close:hover { background: #fff; color: var(--ink); }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 20px 28px 40px; }
.booknote { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--tone); font: 400 14px/1.5 var(--sans); color: var(--ink-2); }
.quote { margin: 0 0 20px; padding: 14px 16px; border-radius: 12px; background: var(--accent-wash); }
.quote figcaption { font: 500 12px/1.4 var(--sans); color: var(--accent-ink); margin-bottom: 6px; }
.quote blockquote { margin: 0; font: italic 400 16px/1.6 var(--serif); color: var(--ink); }
.pagetext .pp, .pagetext .pl { margin: 0 0 14px; font: 400 16px/1.7 var(--serif); color: var(--ink-2); }
.pagetext .pl { padding-left: 22px; }
.pagetext .ph { margin: 26px 0 8px; font: 700 17px/1.35 var(--serif); color: var(--ink); }
.pagetext .hit { margin-inline: -10px; padding: 8px 10px; border-radius: 10px; background: var(--accent-wash); color: var(--ink); }
.pagetext .pl.hit { padding-left: 32px; }

/* desktop, wide: the reading column steps aside instead of being covered */
@media (min-width: 1280px) {
  .scrim { display: none !important; }
  html.locked body { overflow: auto; }
  html.locked .card { transform: translateX(calc(var(--sheet-w) / -2 - 6px)); }
  .sheet { top: 24px; bottom: 24px; right: 24px; }
}

/* phones: full-bleed card, bottom sheet */
@media (max-width: 700px) {
  .card { width: calc(100% - 16px); margin: 8px auto; padding: 28px 20px 14px; border-radius: 18px; min-height: calc(100dvh - 16px); }
  h1 { font-size: 34px; }
  .lede { font-size: 16px; margin-bottom: 22px; }
  .question { font-size: 22px; }
  .answer p { font-size: 17px; line-height: 1.62; }
  .composer { bottom: max(8px, env(safe-area-inset-bottom)); }
  .sheet {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 90dvh; border-radius: 20px 20px 0 0;
    transform: translateY(100%); opacity: 1;
    transition: transform 240ms cubic-bezier(.4, 0, 1, 1);
  }
  .sheet.in { transform: none; transition: transform 340ms var(--sheet-ease); }
  .sheet-head { padding: 22px 60px 16px 20px; }
  .sheet-body { padding: 18px 20px calc(32px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .bar::after { width: 100%; transform: none; opacity: .5; }
  html.locked .card { transform: none; }
}

/* Reserve the answer's room while it is written, so the composer and footer below never jump when it lands. */
.ghost { min-height: 60dvh; align-content: start; }
