/* =============================================================================
   Glyph — one stylesheet, two skins.

   A page declares which it wants on <html data-skin="paper"> or "board".

     paper  reading rooms: the landing page, writer profiles, submissions, about.
            Warm ground, serif at a real reading size, a single oxblood accent.
            Light-first, with a dark variant for anyone whose system asks.

     board  data rooms: the calendar. Inherits the datarail.org palette on
            purpose, so the family resemblance to /events is visible. Dark only —
            a board is a board.

   The split is the argument: writing is data, and the two deserve different
   rooms. Everything structural is shared so the two never drift apart.
   ============================================================================= */

/* ---- shared ---------------------------------------------------------------- */

:root {
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --shell: 1080px;
  --measure: 34em;          /* the reading measure, ~68 characters */
  --step: 1rem;
  --radius: 8px;
  --header-h: 56px;
  --transition: 150ms ease-out;
}

/* ---- paper ----------------------------------------------------------------- */

html[data-skin="paper"] {
  --bg: #f6f2ea;
  --bg-soft: #fffdf7;
  --bg-raised: #fffdf7;
  --fg: #191512;
  --muted: #5a5148;
  --dim: #7b7267;
  --rule: #ded4c4;
  --rule-hair: #e8e0d3;
  --accent: #8f2d22;
  --accent-ink: #8f2d22;
  --accent-wash: rgba(143, 45, 34, 0.07);
  --shade: rgba(25, 21, 18, 0.03);
  --body-font: var(--font-serif);
  --body-size: 1.0625rem;
  --body-leading: 1.65;
}

@media (prefers-color-scheme: dark) {
  html[data-skin="paper"]:not([data-theme="light"]) {
    --bg: #14110f;
    --bg-soft: #1b1714;
    --bg-raised: #1b1714;
    --fg: #ece6dc;
    --muted: #a99e90;
    --dim: #8b8175;
    --rule: #322b24;
    --rule-hair: #262019;
    --accent: #e0846a;
    --accent-ink: #e0846a;
    --accent-wash: rgba(224, 132, 106, 0.1);
    --shade: rgba(255, 255, 255, 0.03);
  }
}

/* ---- board (datarail.org palette) ----------------------------------------- */

html[data-skin="board"] {
  --bg: #05070b;
  --bg-soft: #0b0e16;
  --bg-raised: #10141f;
  --fg: #f5f5f7;
  --muted: #9ca3af;
  --dim: #7c8694;
  --rule: #1f2933;
  --rule-hair: rgba(31, 41, 51, 0.85);
  --accent: #42f5ff;
  --accent-ink: #42f5ff;
  --accent-strong: #42ffb3;
  --accent-warm: #ffd94a;
  --accent-wash: rgba(66, 245, 255, 0.09);
  --shade: rgba(255, 255, 255, 0.04);
  --body-font: var(--font-sans);
  --body-size: 0.9375rem;
  --body-leading: 1.55;
  color-scheme: dark;
}

/* ---- reset and base -------------------------------------------------------- */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: var(--body-size)/var(--body-leading) var(--body-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.75rem); letter-spacing: -0.015em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.0625rem; }

hr { border: 0; border-top: 1px solid var(--rule); margin: calc(var(--step) * 2.5) 0; }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.15em; }
.prose h2 { margin-top: 2em; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- header ---------------------------------------------------------------- */

.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.top-inner {
  display: flex; align-items: center; gap: clamp(0.75rem, 3vw, 2rem);
  min-height: var(--header-h);
}

.wordmark {
  display: flex; align-items: baseline; gap: 0.5rem;
  font: 600 1.25rem/1 var(--font-serif);
  letter-spacing: 0.01em;
  color: var(--fg); text-decoration: none;
}
.wordmark:hover { text-decoration: none; }
/* Reference marks — pilcrow, dagger, double dagger, section. The marks a text
   carries to point at itself, which is the name doing its own explaining. */
.wordmark .marks {
  font: 0.75rem/1 var(--font-mono);
  color: var(--accent-ink);
  letter-spacing: 0.18em;
  opacity: 0.8;
}

/* The slogan, in the header lockup on every page but the landing one, where the
   hero says it at full size instead. Folds away before it can crowd the nav. */
.tagline {
  font: italic 0.8125rem/1 var(--font-serif);
  color: var(--muted);
  border-left: 1px solid var(--rule);
  padding-left: 0.75rem;
  white-space: nowrap;
}
@media (max-width: 900px) { .tagline { display: none; } }

nav.links { margin-left: auto; display: flex; flex-wrap: wrap; gap: clamp(0.6rem, 2vw, 1.4rem); }
nav.links a {
  font: 500 0.75rem/1 var(--font-mono);
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  padding: 0.4rem 0; border-bottom: 2px solid transparent;
}
nav.links a:hover { color: var(--fg); }
nav.links a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }

/* ---- footer ---------------------------------------------------------------- */

.colophon {
  margin-top: calc(var(--step) * 4);
  border-top: 1px solid var(--rule);
  padding: calc(var(--step) * 1.75) 0 calc(var(--step) * 3);
  color: var(--dim);
  font: 0.8125rem/1.6 var(--font-sans);
}
.colophon p { margin: 0 0 0.6em; max-width: 60ch; }
.colophon a { color: var(--muted); }

/* ---- notices --------------------------------------------------------------- */

.notice {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  background: var(--accent-wash);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: var(--step) 0;
  font: 0.875rem/1.55 var(--font-sans);
  color: var(--fg);
}
.notice strong { font-weight: 650; }
.notice--loud { border-left-color: var(--accent-warm, var(--accent)); }

.empty {
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 5vw, 2.75rem);
  text-align: center;
  color: var(--muted);
  font-family: var(--font-sans);
}
.empty h2 { color: var(--fg); font-family: var(--body-font); }
.empty p { max-width: 46ch; margin: 0 auto 0.75em; }

/* ---- controls -------------------------------------------------------------- */

.controls {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center;
  padding: var(--step) 0;
  border-bottom: 1px solid var(--rule-hair);
}
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  font: 500 0.75rem/1 var(--font-mono);
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.chip:hover { color: var(--fg); border-color: var(--dim); }
.chip[aria-pressed="true"] {
  color: var(--bg); background: var(--accent); border-color: var(--accent);
}
html[data-skin="board"] .chip[aria-pressed="true"] { color: #05070b; }

.search {
  flex: 1 1 12rem; min-width: 9rem;
  font: 0.875rem var(--font-sans);
  color: var(--fg); background: var(--bg-soft);
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
}
.search::placeholder { color: var(--dim); }
.search:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.count { font: 0.75rem/1 var(--font-mono); color: var(--dim); letter-spacing: 0.06em; }

/* ---- the board ------------------------------------------------------------- */

.daygroup { margin: calc(var(--step) * 2) 0 0; }
.daygroup > h2 {
  position: sticky; top: var(--header-h); z-index: 10;
  margin: 0 0 0.5rem;
  padding: 0.5rem 0;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--rule-hair);
  font: 500 0.75rem/1 var(--font-mono);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
.daygroup > h2 .today { color: var(--accent-warm, var(--accent)); }

.listing {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: 0.35rem 1rem;
  align-items: baseline;
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid var(--rule-hair);
  border-radius: var(--radius);
}
.listing:hover { background: var(--shade); }
.listing .when { font: 0.8125rem/1.4 var(--font-mono); color: var(--accent-ink); }
.listing .what { min-width: 0; }
.listing .what h3 { margin: 0 0 0.15rem; font-size: 1rem; }
.listing .what h3 a { color: var(--fg); text-decoration: none; }
.listing .what h3 a:hover { color: var(--accent-ink); text-decoration: underline; }
.listing .where { font: 0.8125rem/1.5 var(--font-sans); color: var(--muted); }
.listing .where .dot { color: var(--dim); padding: 0 0.35rem; }
.listing .blurb {
  grid-column: 2; margin: 0.35rem 0 0;
  font: 0.8125rem/1.55 var(--font-sans); color: var(--dim);
  max-width: 62ch;
}
.listing .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; }
.listing .price { font: 0.8125rem/1 var(--font-mono); color: var(--fg); white-space: nowrap; }

.tag {
  font: 500 0.6875rem/1 var(--font-mono);
  letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--rule); border-radius: 4px;
  padding: 0.25rem 0.4rem; color: var(--muted); white-space: nowrap;
}
.tag--reading  { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 40%, var(--rule)); }
.tag--openmic  { color: var(--accent-strong, var(--accent-ink)); border-color: color-mix(in srgb, var(--accent-strong, var(--accent)) 40%, var(--rule)); }
.tag--workshop { color: var(--accent-warm, var(--fg)); border-color: color-mix(in srgb, var(--accent-warm, var(--fg)) 40%, var(--rule)); }
.tag--launch   { color: var(--fg); }
.tag--panel    { color: var(--muted); }

.note-access, .note-reg {
  grid-column: 2; margin: 0.3rem 0 0;
  font: 0.75rem/1.5 var(--font-mono); color: var(--dim);
}
.note-access::before { content: "access "; color: var(--muted); }
.note-reg::before { content: "register "; color: var(--muted); }

@media (max-width: 620px) {
  .listing { grid-template-columns: 3.75rem 1fr; }
  .listing .meta { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; }
  .listing .blurb, .listing .note-access, .listing .note-reg { grid-column: 1 / -1; }
}

/* ---- paper pages ----------------------------------------------------------- */

.lede {
  font: 1.25rem/1.5 var(--body-font);
  color: var(--fg);
  max-width: 32em;
  margin: 0 0 1.5em;
}
html[data-skin="paper"] .hero { padding: clamp(2.5rem, 8vw, 5rem) 0 clamp(1.5rem, 4vw, 2.5rem); }

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card {
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 1.1rem 1.15rem;
}
.card h3 { margin: 0 0 0.4rem; }
.card p { margin: 0; font: 0.875rem/1.6 var(--font-sans); color: var(--muted); }
.card .stat { font: 600 1.75rem/1 var(--font-mono); color: var(--accent-ink); display: block; margin-bottom: 0.3rem; }

.piece {
  border-left: 2px solid var(--rule);
  padding-left: clamp(1rem, 3vw, 1.75rem);
  margin: 2rem 0;
}
.piece h3 { font-family: var(--font-serif); font-style: italic; font-weight: 500; }
/* A poem is not prose: preserve the poet's line breaks exactly as submitted. */
.piece pre {
  font: 1.0625rem/1.7 var(--font-serif);
  white-space: pre-wrap;
  margin: 0 0 0.75rem;
  color: var(--fg);
}
.piece .credit { font: 0.8125rem/1.5 var(--font-sans); color: var(--dim); }

.terms { counter-reset: term; list-style: none; padding: 0; max-width: var(--measure); }
.terms li {
  counter-increment: term;
  position: relative;
  padding-left: 2.25rem;
  margin-bottom: 1rem;
}
.terms li::before {
  content: counter(term);
  position: absolute; left: 0; top: 0.1em;
  font: 500 0.75rem/1.6 var(--font-mono);
  color: var(--accent-ink);
  border: 1px solid var(--rule); border-radius: 50%;
  width: 1.6rem; height: 1.6rem; text-align: center;
}

.datatable { width: 100%; border-collapse: collapse; font: 0.875rem var(--font-sans); }
.datatable th, .datatable td {
  text-align: left; padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--rule-hair);
}
.datatable th {
  font: 500 0.6875rem/1 var(--font-mono);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.datatable td.num { font-family: var(--font-mono); text-align: right; }
.datatable tr td.zero { color: var(--dim); }
.scroll-x { overflow-x: auto; }

.btn {
  display: inline-block;
  font: 500 0.8125rem/1 var(--font-mono);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--bg); background: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 0.7rem 1.1rem; text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn--ghost { color: var(--accent-ink); background: transparent; }
html[data-skin="board"] .btn { color: #05070b; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
