/* ─── Essay pages (generated into writing/), on top of dusk.css ───
   Each essay opens like the zine it was on the rack: its cover up top, the pages taped beneath.
   --c is the issue's color, set per essay by the build. */

.progress {
  position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: 2px;
  background: var(--c, var(--amber)); box-shadow: 0 0 8px var(--c, var(--amber));
  transform-origin: left; transform: scaleX(0);
}

.essay { --c: var(--amber); padding: 1rem 2rem 0; }

/* ─── The cover ─── */
.cover {
  position: relative; max-width: 1000px; margin: 0 auto; padding: 3.2rem 3rem 3rem; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr; gap: 0 2.6rem; align-items: end;
  border-radius: 4px; border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 26%, #1d2140), #141729 72%);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}
.cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.06) 50%, transparent 60%); pointer-events: none; }
.cover .mast { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; color: color-mix(in srgb, var(--c) 70%, #fff); }
.cover .big { font-family: var(--neon); font-size: 10rem; line-height: 0.8; color: var(--c); text-shadow: 0 0 18px color-mix(in srgb, var(--c) 70%, transparent), 0 0 60px color-mix(in srgb, var(--c) 30%, transparent); }
.cover h1 { font-weight: 500; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; color: #fff8ee; }
.cover .dk { margin-top: 1rem; max-width: 34rem; font-size: 1.15rem; line-height: 1.55; font-style: italic; color: #d9d4e4; }
.cover .price { position: absolute; top: 5.2rem; right: -0.3rem; padding: 0.35rem 0.8rem; background: #ffe9a8; color: #2a2440; letter-spacing: 0.1em; transform: rotate(6deg); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }

/* ─── The pages, taped under the cover ─── */
.sheet {
  position: relative; max-width: 46rem; margin: -1.2rem auto 0; padding: 3.4rem 3.4rem 3rem;
  background: #1b1f38; border: 1px solid var(--line); border-radius: 2px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.sheet::before { content: ""; position: absolute; left: 50%; top: -6px; width: 70px; height: 14px; transform: translateX(-50%) rotate(-2deg); background: rgba(255, 233, 168, 0.35); }
.end { margin-top: 3rem; text-align: center; font-family: var(--neon); letter-spacing: 0.3em; color: var(--c); text-shadow: 0 0 6px var(--c); }

/* ─── Prose ─── */
.prose { counter-reset: sec; font-size: 1.14rem; line-height: 1.75; color: var(--ink-dim); }
.prose > * + * { margin-top: 1.25rem; }
.prose > p:first-child::first-letter { float: left; padding: 0.35rem 0.6rem 0 0; font-family: var(--neon); font-size: 4.6rem; line-height: 0.8; color: var(--c); text-shadow: 0 0 12px var(--c); }
.prose strong { font-weight: 500; color: var(--ink); }
.prose a { color: var(--ink); border-bottom: 1px solid color-mix(in srgb, var(--c) 60%, transparent); transition: border-color 0.2s ease, text-shadow 0.2s ease; }
.prose a:hover { border-color: var(--c); text-shadow: 0 0 8px color-mix(in srgb, var(--c) 40%, transparent); }

.prose h2 { counter-increment: sec; display: flex; align-items: baseline; gap: 0.8rem; margin-top: 3.2rem; font-weight: 500; font-size: 1.6rem; line-height: 1.2; color: #fff8ee; }
.prose h2::before { content: counter(sec, decimal-leading-zero); flex: none; font-family: var(--neon); font-size: 1rem; color: var(--c); text-shadow: 0 0 6px var(--c); }
.prose h3 { margin-top: 2.2rem; font-weight: 500; font-size: 1.2rem; color: var(--ink); }
.prose h4 { margin-top: 2rem; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }

.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: 0.6rem; }
.prose li::marker { color: var(--c); }

.prose blockquote { padding: 0.2rem 0 0.2rem 1.3rem; border-left: 2px solid var(--c); font-style: italic; font-size: 1.2rem; line-height: 1.55; color: var(--ink); }
.prose hr { border: none; height: 1px; width: 40px; margin: 3rem auto; background: var(--line); }

.prose code { font-family: var(--mono); font-size: 0.82em; padding: 0.1em 0.35em; background: rgba(243, 236, 226, 0.07); color: var(--ink); border-radius: 3px; }
.prose pre { overflow-x: auto; padding: 1.2rem 1.4rem; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--line); border-radius: 6px; font-family: var(--mono); font-size: 0.8rem; line-height: 1.7; }
.prose pre code { padding: 0; background: none; font-size: inherit; color: var(--ink-dim); }

.prose table { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.5; display: block; overflow-x: auto; }
.prose th { text-align: left; vertical-align: bottom; font-family: var(--mono); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.7rem; color: var(--c); padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); }
.prose td { padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose td:first-child { color: var(--ink); font-weight: 500; }

/* Diagrams are drawn in dusk colors: hung on a faint pane of glass, pink lines lit */
.prose .plate {
  margin: 2.6rem -2rem; padding: 1.6rem;
  background: linear-gradient(180deg, rgba(38, 43, 74, 0.55), rgba(24, 28, 50, 0.55));
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}
.prose .plate svg { margin: 0 !important; overflow: visible; }
.prose .plate svg [stroke="#ff7a92"], .plate svg text[fill="#ff7a92"] { filter: drop-shadow(0 0 3px rgba(255, 122, 146, 0.7)); }
.prose .plate svg rect[fill="#6b2346"] { filter: drop-shadow(0 0 10px rgba(255, 122, 146, 0.35)); }
.prose .plate img { display: block; width: 100%; height: auto; }

/* ─── After the last page: the next issue on the rack ─── */
.pager { max-width: 46rem; margin: 3.4rem auto 0; padding: 0 2rem; display: flex; flex-direction: column; align-items: center; gap: 1.6rem; }
.nextz {
  display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 1.2rem; align-items: center; width: 100%; max-width: 26rem; padding: 1.2rem 1.4rem;
  border-radius: 3px; border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, #1d2140), #141729 70%);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.45); transform: rotate(-1deg); transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.nextz:hover, .nextz:focus-visible { transform: rotate(0) translateY(-4px); box-shadow: 0 26px 40px rgba(0, 0, 0, 0.5), 0 0 26px color-mix(in srgb, var(--c) 30%, transparent); }
.nextz .label { grid-column: 2; color: color-mix(in srgb, var(--c) 70%, #fff); }
.nextz .big { grid-row: 1 / 3; font-family: var(--neon); font-size: 3rem; line-height: 1; color: var(--c); text-shadow: 0 0 10px var(--c); }
.nextz .tt { grid-column: 2; font-size: 1.15rem; line-height: 1.2; color: #fff8ee; }
.pn { font-size: 1rem; color: var(--ink-faint); transition: color 0.2s ease; }
.pn .label { margin-right: 0.4rem; }
.pn:hover { color: var(--ink); }
.essay ~ .site-foot { max-width: 46rem; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .nextz, .nextz:hover { transition: none; transform: none; }
}

@media (max-width: 760px) {
  .essay { padding: 0.4rem 1rem 0; }
  .cover { grid-template-columns: 1fr; padding: 2rem 1.3rem; }
  .cover .mast span:last-child { display: none; }
  .cover .big { font-size: 5.5rem; margin-bottom: 0.6rem; }
  .cover .price { top: 4rem; }
  .sheet { margin: -1rem 0.4rem 0; padding: 2.2rem 1.2rem; }
  .prose { font-size: 1.06rem; }
  .prose .plate { margin: 2.2rem -1.2rem; padding: 0.8rem; border-radius: 0; }
  .pager { padding: 0 1rem; }
  .pn { text-align: center; }
}

/* Dense diagrams (data-wide) keep their size on phones and scroll sideways instead of shrinking */
@media (max-width: 760px) {
  .prose .plate:has(svg[data-wide]) { overflow-x: auto; }
  .prose .plate svg[data-wide] { min-width: 600px; }
}

/* Co-written pieces: a small label says who's talking */
.prose .voice { margin: 2rem 0 -0.4rem; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; }
.prose .voice::before { content: "— "; }
.prose .voice.stephie { color: var(--amber); }
.prose .voice.pip { color: var(--pink); }
.prose h2 + .voice { margin-top: 1rem; }
