/* claire e k: the whole site's styling.
   After editing, bump the ?v= number where pages load this file
   (find-and-replace "style.css?v=" across public\) so browsers fetch the new version.
   Keep this file ASCII. */

/* The background: a faint grid of pixel dots, and a small pixel heart (the site's icon) every
   few squares. */
html {
  background-color: #181219;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' shape-rendering='crispEdges'%3E%3Cpath fill='%23f0b7c9' fill-opacity='.035' d='M74 74h4v2h-4zM82 74h4v2h-4zM72 76h16v6H72zM74 82h12v2H74zM76 84h8v2h-8zM78 86h4v2h-4z'/%3E%3C/svg%3E");
}
body {
  margin: 0;
  padding: 1.5rem 0.75rem 2.5rem;
  color: #e6dbe0;
  font: 18px/1.65 "Times New Roman", Times, serif;
}

a { color: #e6b3c4; text-underline-offset: 3px; }
a:visited { color: #c9abdc; }
a:hover { color: #2b1a2f; background: #e6b3c4; text-decoration: none; }

/* little framed boxes ("tabs") above and below the main panel */
.tab {
  width: fit-content;
  margin: 0 auto;
  padding: 4px 16px;
  background: #1d1520;
  border: 3px solid #a27a8e;
}
.tab.top { border-bottom: 0; }
.tab.bottom { border-top: 0; font: 14px/1.6 var(--ui); }
.tab h1 { margin: 0; font-size: 26px; line-height: 1.2; }
.tab h1 a { color: inherit; text-decoration: none; }
.tab h1 a:hover { background: none; color: #e6b3c4; }

#panel {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 22px 24px;
  background: #1d1520;
  border: 3px solid #a27a8e;
}
#panel p { margin: 0 0 1em; }
#panel > :last-child { margin-bottom: 0; }
.hello { text-align: center; font-size: 20px; margin: 0.4em 0 0.6em; }

h2 {
  margin: 1.4em 0 0.6em;
  padding-bottom: 4px;
  font-size: 26px;
  border-bottom: 3px dotted #a27a8e;
}

/* story / chapter rows: title + date on top, blurb + word count below */
.rows { margin: 0; padding: 0; list-style: none; }
.rows li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1rem;
  margin: 0 0 10px;
  padding: 6px 10px;
  background: #2a1f2e;
  border-left: 3px solid #a27a8e;
}
.rows .blurb { font-style: italic; }
.rows .meta { font: 15px/1.9 var(--ui); text-align: right; white-space: nowrap; }

.meta { font: 15px/1.6 var(--ui); }

/* book page: cover beside title + synopsis */
.book {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 20px;
  align-items: start;
}
.book:not(:has(img)) { grid-template-columns: 1fr; }
.book img {
  display: block;
  width: 100%;
  height: auto;
  border: 3px solid #a27a8e;
}
h2.book-title { margin: 0 0 0.5em; border: 0; padding: 0; line-height: 1.2; }
@media (max-width: 520px) {
  .book { grid-template-columns: 1fr; }
  .book img { max-width: 200px; margin: 0 auto; }
}

/* contents list: chapter rows without blurbs */
.rows.toc li { margin-bottom: 6px; padding: 3px 10px; }

/* chapter titles: Unbounded (self-hosted, SIL Open Font License: fonts/Unbounded-OFL.txt) */
@font-face {
  font-family: "Unbounded";
  src: url("/fonts/unbounded-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

/* chapter pages */
.chapter h2 {
  text-align: right;
  border: 0;
  margin: 0.8em 0 1.4em;
  font: 800 30px/1.15 "Unbounded", "Arial Black", "Segoe UI Black", Impact, sans-serif;
  letter-spacing: -0.01em;
}
.chapter h2 strong {                 /* the number: small, pink, above the title */
  display: block;
  margin-bottom: 0.25em;
  font-size: 0.5em;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #a27a8e;
}
.chapter h2 em { font-style: normal; }
.chapter h2.reveal { margin: 2.6em 0 1.6em; }   /* a withheld title, revealed mid-chapter */
@media (max-width: 520px) { .chapter h2 { font-size: 23px; } }
.chapter-nav { text-align: center; font: 15px/1.6 var(--ui); }
#panel .chapter-nav { margin: 0; }
.chapter-nav .off { opacity: 0.4; }
.chapter-nav a.whole { padding: 0 6px; border: 1px solid var(--hair); border-radius: 4px; white-space: nowrap; }

/* the entire story on one page */
.full-story .story-toc { margin: 0 0 8px; font: 15px/1.6 var(--ui); }
.full-arc { margin: 3em 0 0; text-align: center; color: var(--soft); font: 600 14px/1.4 var(--ui); letter-spacing: 0.08em; }
.full-ch { margin-top: 3em; padding-top: 1.5em; border-top: 1px solid var(--hair); scroll-margin-top: 12px; }
.full-arc + .full-ch { margin-top: 1em; }
.full-talk { margin: 2em 0 0; text-align: center; font: 14px/1.6 var(--ui); }
/* Discord-style chat logs (generated by tools/build_book.py) */
table.discord {
  width: 100%;
  margin: 0 0 1em;
  border-collapse: collapse;
  background: #313338;
  border: 2px solid #1e1f22;
  color: #dbdee1;
  font: 15px/1.4 "gg sans", "Noto Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
table.discord td { padding: 1px 12px 1px 0; vertical-align: top; }
table.discord tr.first td { padding-top: 10px; }
table.discord tr:first-child td { padding-top: 8px; }
table.discord tr:last-child td { padding-bottom: 8px; }
table.discord td.av { width: 36px; padding: 0 12px 0 12px; }
table.discord tr.first td.av { padding-top: 12px; }
table.discord td.av img {          /* avatar picture */
  display: block;
  width: 36px;
  height: 36px;
  object-fit: cover;
}
table.discord td.av span {         /* no picture: square with the user's initial */
  display: block;
  width: 36px;
  height: 36px;
  color: #1e1f22;
  font: bold 17px/36px "Segoe UI", Arial, sans-serif;
  text-align: center;
}
table.discord .who { font-weight: 600; }
table.discord tr:hover td { background: #2e3035; }

/* Flashback dialogue: hazy and swimming, stronger at higher levels (fb-1 .. fb-4).
   Each level sets the glow, the pink/blue "ghost" offsets, the drift and the speed. */
.flashback {
  --drift: 0.5px;
  --skew: 0deg;
  --speed: 9s;
  animation: swim var(--speed) ease-in-out infinite;
}
.fb-1 {
  color: rgba(242, 230, 234, 0.85);
  text-shadow: 0 0 3px rgba(240, 183, 201, 0.55);
}
.fb-2 {
  --drift: 1px; --skew: 0.4deg; --speed: 7s;
  color: rgba(242, 230, 234, 0.8);
  text-shadow: 0 0 4px rgba(240, 183, 201, 0.7), 1px 0 2px rgba(148, 156, 247, 0.35);
}
.fb-3 {
  --drift: 2px; --skew: 1deg; --speed: 5s;
  color: rgba(242, 230, 234, 0.55);
  text-shadow: 0 0 1.2px #e6dbe0, 2px 0 3px rgba(240, 183, 201, 0.6), -2px 0 3px rgba(148, 156, 247, 0.5);
}
.fb-4 {
  --drift: 3px; --skew: 1.8deg; --speed: 3.2s;
  color: transparent;
  text-shadow: 0 0 1.6px #e6dbe0, 3px 0 5px rgba(240, 183, 201, 0.75), -3px 1px 5px rgba(148, 156, 247, 0.6);
}
@keyframes swim {
  0%, 100% { transform: translateX(0) skewX(0deg); }
  25%      { transform: translateX(var(--drift)) skewX(calc(var(--skew) * -1)); }
  50%      { transform: translateX(0) skewX(var(--skew)); }
  75%      { transform: translateX(calc(var(--drift) * -1)) skewX(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .flashback { animation: none; }
}

ul.credits { font-size: 16px; }

/* paragraphs centered in the manuscript */
#panel p.center { text-align: center; }
#panel p.right { text-align: right; }   /* right-aligned in the manuscript (Blue Star) */

/* ---- invocations: one colour per system, shared by everyone, perfectly still ----
   span.inv.SYSTEM (written by tools/build_book.py from INVOCATIONS). */
.inv { font-weight: bold; }
.inv.magic   { color: #b3c8ff; text-shadow: 0 0 6px rgba(140, 170, 255, 0.45); }   /* magic: pale blue */
.inv.ability { color: #ffd27a; text-shadow: 0 0 6px rgba(255, 200, 100, 0.4); }    /* abilities: gold */
.inv.vow     { color: #ff8fa3; text-shadow: 0 0 6px rgba(255, 110, 140, 0.4); }    /* vows: rose red */

hr.scene {
  width: 30%;
  margin: 2em auto;
  border: 0;
  border-top: 3px dotted #a27a8e;
}

/* ---- The Labyrinth Quiz (001): a homemade CYOA, like an old image someone made in Paint ----
   Flat black, plain fonts, thin grey boxes. Panels after "the page darkened" (.dark) lose
   their frame. Built by tools/build_book.py. */
.cyoa {
  margin: 1.4em 0;
  padding: 16px 14px;
  border: 1px solid #555;
  background: #000;
  color: #fff;
  font: 15px/1.4 Arial, Helvetica, sans-serif;
  text-align: center;
}
#panel .cyoa p { margin: 0 0 0.8em; }
#panel .cyoa > :last-child { margin-bottom: 0; }
#panel .cyoa p.cyoa-title {
  margin-bottom: 0.4em;
  font: bold 30px/1.2 "Times New Roman", Times, serif;
  color: #ffcc33;
}
#panel .cyoa p.cyoa-welcome { font-size: 20px; font-weight: bold; }
#panel .cyoa p.cyoa-select { margin: 1em 0 0.2em; font-size: 20px; font-weight: bold; color: #ffcc33; }
#panel .cyoa p.cyoa-points { font-weight: bold; }
.cyoa h3.cyoa-category {
  margin: 0.6em 0;
  font: bold 22px/1.2 "Times New Roman", Times, serif;
  color: #ff6666;
}
.cyoa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cyoa-card {
  padding: 8px;
  border: 1px solid #888;
  font-size: 14px;
}
.cyoa-card h4 { margin: 0 0 0.3em; font-size: 16px; }
.cyoa-card .cyoa-cost { font-weight: normal; color: #aaa; }
#panel .cyoa-card p { margin: 0; }
@media (max-width: 520px) {
  .cyoa-grid { grid-template-columns: 1fr; }
}
/* after "The page darkened": just black */
.cyoa.dark { border-color: #000; color: #ccc; }
#panel .cyoa.dark p.cyoa-final { margin: 0; font-size: 20px; font-weight: bold; color: #fff; }
.cyoa > h3.cyoa-category:first-child { margin-top: 0; }

/* ambient sound toggle in the chapter nav (public/sound/ambience.js shows it) */
.sound-toggle {
  padding: 0;
  border: 0;
  background: none;
  color: #e6b3c4;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.sound-toggle:hover { color: #2b1a2f; background: #e6b3c4; text-decoration: none; }
.sound-toggle[aria-pressed="true"] { color: #fff; }

/* ---- chapter comments (public/comments.js, server/server.py) ---- */
.comments { margin-top: 2.6em; padding-top: 0.8em; border-top: 3px dotted #a27a8e; }
.chapter h2.comments-title {
  text-align: left; margin: 0 0 0.8em;
  font: 800 20px/1.2 "Unbounded", "Arial Black", "Segoe UI Black", Impact, sans-serif;
}
.comment-list { margin: 0 0 1.4em; padding: 0; list-style: none; }
.comment-list li { margin: 0 0 12px; padding: 8px 12px; background: #2a1f2e; border-left: 3px solid #a27a8e; }
#panel .comment-list p { margin: 0 0 0.5em; }
#panel .comment-list p:last-child { margin-bottom: 0; }
.comment-head { font: 14px/1.5 var(--ui); }
.comment-name { color: #e6b3c4; font-weight: bold; }
.comment-time { color: #9c8a98; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.comments form { display: grid; gap: 8px; }
.comments label { font: 14px/1.5 var(--ui); }
.comments input, .comments textarea {
  box-sizing: border-box; width: 100%; padding: 6px 8px;
  background: #0f0a11; color: #e6dbe0; border: 2px solid #5e4357; border-radius: 0;
  font: 17px/1.5 "Times New Roman", Times, serif;
}
.comments input:focus, .comments textarea:focus { outline: none; border-color: #e6b3c4; }
.comments textarea { min-height: 7em; resize: vertical; }
.comments .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.comments button {
  justify-self: start; padding: 4px 16px; cursor: pointer;
  background: #1d1520; color: #e6b3c4; border: 3px solid #a27a8e;
  font: 15px/1.6 var(--ui);
}
.comments button:hover { background: #e6b3c4; color: #2b1a2f; }
.comments button:disabled { opacity: 0.5; cursor: wait; }
.comment-note, .comment-status { margin: 0; font: 14px/1.5 var(--ui); color: #9c8a98; }

/* "hidden" always hides, even on elements given a display above (the login form's labels) */
[hidden] { display: none !important; }

/* ---- the site's header: the heart, the name, and pixel-icon links (one for every page) */
.ic { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.site-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px;
  max-width: 640px; margin: 0 auto; padding: 9px 22px 8px; background: #1d1520;
  border: 3px solid #a27a8e; border-bottom: 1px dotted #a27a8e;
}
.site-top .brand { display: inline-flex; align-items: center; gap: 9px; color: #e6dbe0; text-decoration: none;
  font: 800 21px/1.1 "Unbounded", "Segoe UI", sans-serif; letter-spacing: -0.02em; }
.site-top .brand:hover { background: none; color: #e6b3c4; }
.site-top .heart { width: 24px; height: 24px; background: url(/favicon.svg) center / contain no-repeat; image-rendering: pixelated; }
.site-top .brand:hover .heart { animation: heartbeat 0.9s ease-in-out infinite; }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.18); } 40% { transform: scale(1); } 60% { transform: scale(1.1); } }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px; font: 13px/1.2 var(--ui); }
.site-nav a { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; color: #e6dbe0; text-decoration: none; border: 1px solid transparent; }
.site-nav a:hover { color: #e6b3c4; background: #2a1f2e; border-color: #4a3346; }
.site-top + #panel, .site-top + .wrap { border-top: 0; }
@media (max-width: 520px) { .site-nav a span { display: none; } .site-nav a { padding: 6px; } .site-top { padding: 8px 12px; } }
@media (prefers-reduced-motion: reduce) { .site-top .brand:hover .heart { animation: none; } }

/* headings outside chapters, in the author pages' style */
#panel:not(.chapter) > h2, #panel:not(.chapter) > section > h2, #more-chapters > h2, h2.comments-title {
  font: 800 21px/1.25 "Unbounded", "Segoe UI", sans-serif; letter-spacing: -0.02em; }
#panel:not(.chapter) > h2::before, #more-chapters > h2::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: 1px;
  background: url(/favicon.svg) center / contain no-repeat; image-rendering: pixelated; }
.rows li { transition: background 0.15s, border-color 0.15s; }
.rows li:hover { background: #2e1f33; border-left-color: #e6b3c4; }
.tab.bottom { border-top: 1px dotted #a27a8e; }
.announce { max-width: 640px; margin: 0 auto 10px; padding: 8px 14px; background: #e6b3c4; color: #2b1a2f; border: 3px solid #a27a8e; font: 15px/1.5 var(--ui); text-align: center; box-sizing: content-box; }

/* Reading comforts (site.js): text size, a paper or sepia page, picking up where you left off,
   continue reading. Kept in the reader's own browser. */
#panel.chapter { font-size: calc(18px * var(--rs, 1)); }
html[data-page="paper"] #panel.chapter { background: #fbf6ee; color: #2b2320; border-color: #c9a9b6; }
html[data-page="sepia"] #panel.chapter { background: #f3e7cf; color: #3b2d1f; border-color: #b9926f; }
html[data-page] #panel.chapter a { color: #9c3d63; }
html[data-page] #panel.chapter a:hover { color: #fbf6ee; background: #9c3d63; }
html[data-page] #panel.chapter h2 { border-bottom-color: #c9a9b6; }
html[data-page] #panel.chapter h2 strong, html[data-page] #panel.chapter h2 em { color: inherit; }
html[data-page] #panel.chapter .wip { color: #9a6a00; }
.rset { position: relative; }
.rset-b, .rset-p button { font: inherit; color: inherit; background: transparent; border: 1px solid currentColor; padding: 0 6px; cursor: pointer; }
.rset-p { position: absolute; right: 0; top: 1.8em; z-index: 20; display: grid; gap: 6px; padding: 8px 10px; background: #1d1520; color: #e6dbe0; border: 2px solid #a27a8e; white-space: nowrap; text-align: left; font-size: 14px; }
.rset-p[hidden] { display: none; }
.rset-row { display: flex; gap: 6px; align-items: center; }
.rset-p button.on { background: #e6b3c4; color: #2b1a2f; }
.resume-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50; display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: #1d1520; border: 2px solid #e6b3c4; font: 15px/1.4 var(--ui); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); }
.resume-bar button { font: inherit; background: #e6b3c4; color: #2b1a2f; border: 0; padding: 3px 10px; cursor: pointer; }
.resume-bar button[data-no] { background: transparent; color: #e6b3c4; }
.resume { text-align: center; font: 15px/1.6 var(--ui); margin: 0 0 1em; }
.resume-f { opacity: 0.7; }

/* ---- calm: the frames, hearts and titles stay; everything around the words gets quieter. Solid
   surfaces, hairlines, one sans for the interface, and the pink kept for links and the way in.
   The words themselves stay bright: quiet surroundings, clear text. */
:root { --ui: Inter, "Segoe UI", system-ui, -apple-system, sans-serif; --surface: #1f1822; --raised: #2a2130; --hair: #3b2f40; --text: #e9e1e5; --soft: #a99ba6; --acc: #e0afc0; }
body { color: var(--text); }
a { color: var(--acc); text-decoration-color: rgba(224, 175, 192, 0.4); }
a:visited { color: #c6a8d6; }
a:hover { color: var(--text); background: none; text-decoration-color: currentColor; }
#panel, .site-top, .tab, .rset-p, .resume-bar { background: var(--surface); border: 1px solid var(--hair); }
.site-top { max-width: 680px; padding: 10px 26px; border-radius: 10px 10px 0 0; }
#panel { max-width: 680px; padding: 22px 26px 30px; border-radius: 0 0 10px 10px; }
.site-top + #panel { border-top: 0; }
#panel.chapter { line-height: 1.75; }
#panel:not(.chapter):not(.sitepage) { font: 16px/1.6 var(--ui); }
.tab.bottom, .tab.top { background: none; border: 0; color: var(--soft); font-size: 13px; }
h2 { border-bottom: 1px solid var(--hair); }
.site-nav { font-size: 14px; }
.site-nav a { color: var(--soft); border: 0; border-radius: 6px; }
.site-nav a:hover { color: var(--text); background: var(--raised); }
.site-read { position: relative; display: inline-flex; }
.site-sub { position: absolute; z-index: 30; top: 100%; left: 0; display: none; min-width: 240px; padding: 6px; background: var(--surface); border: 1px solid var(--hair); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.site-read:hover .site-sub, .site-read:focus-within .site-sub { display: grid; }
.site-sub a { display: block; padding: 6px 9px; }
.hello { color: var(--soft); font-size: 17px; text-align: left; margin: 0 0 1em; }
.rows li { background: none; border-left: 0; border-radius: 6px; padding: 7px 10px; }
.rows li:hover { background: var(--raised); }
.rows.toc li { padding: 4px 10px; margin-bottom: 2px; }
.rows .meta, .meta { color: var(--soft); font-size: 13px; }
.rows .blurb { color: var(--soft); font-style: normal; }
.rows.stories li { grid-template-columns: 44px 1fr auto; }
.rows.stories img, .rows.stories li > i { grid-row: span 2; width: 44px; height: 62px; object-fit: cover; border-radius: 3px; }
.book img, .story-cover img { border: 1px solid var(--hair); border-radius: 6px; }
.story { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: start; margin: 0 0 8px; }
.story-cover img { display: block; width: 100%; height: auto; }
.story:not(:has(.story-cover)) { grid-template-columns: 1fr; }
.story .blurb { margin: 0 0 0.5em; }
.story .book-title a { color: var(--text); text-decoration: none; }
#panel .story p { margin-bottom: 0.5em; }
.story-toc { margin: 0 0 26px; padding-bottom: 14px; border-bottom: 1px solid var(--hair); }
.story-toc summary { color: var(--soft); cursor: pointer; font-size: 14px; }
.story-toc h3 { margin: 1em 0 0.3em; font: 600 13px/1.4 var(--ui); color: var(--soft); }
.story-text { min-width: 0; overflow-wrap: anywhere; }
.library .rows.stories li { grid-template-columns: 34px 1fr auto; column-gap: 12px; margin: 0; padding: 7px 8px; border-bottom: 1px solid var(--hair); border-radius: 0; }
.library .rows.stories li:last-child { border-bottom: 0; }
.library .rows.stories img, .library .rows.stories li > i { width: 34px; height: 48px; }
.library .rows.stories .meta { line-height: 1.5; }
.library .rows.stories img, .library .rows.stories li > i { grid-row: span 3; align-self: start; }
.row-tags { grid-column: 2 / -1; position: relative; z-index: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 12px/1.6 var(--ui); }
.row-tags a::after { display: none !important; }
.ttag, .ttag:visited { display: inline-block; margin: 0 8px 0 0; color: var(--soft); text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 2px; }
.rows.stories li .ttag, .rows.stories li:hover .ttag { color: var(--soft); text-decoration: underline; text-decoration-color: var(--hair); }
.ttag:hover, .rows.stories li .ttag:hover { color: var(--acc); background: none; }
.tagmeta { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 16px 0 0; padding: 10px 12px; font: 13px/1.6 var(--ui); background: var(--raised); border-radius: 6px; }
.tagmeta dt { color: var(--soft); white-space: nowrap; } .tagmeta dd { margin: 0; } .tagmeta .ttag { color: var(--text); }
.tagindex h3 { margin: 1.2em 0 0.3em; font: 600 14px/1.4 var(--ui); color: var(--soft); }
.tagcloud { margin: 0; line-height: 1.9; } .tagcloud .ttag { color: var(--text); font: 14px/1.6 var(--ui); } .tagcloud .ttag span { color: var(--soft); font-size: 12px; }
@media (max-width: 520px) { .tagmeta { grid-template-columns: 1fr; gap: 0; } .tagmeta dd { margin-bottom: 6px; } }
.story-tag { display: inline-block; margin-left: 4px; padding: 0 6px; border: 1px solid currentColor; border-radius: 999px; font: 600 11px/1.5 var(--ui); vertical-align: 1px; white-space: nowrap; }
.story-tag.ongoing { color: var(--acc); } .story-tag.complete { color: #8fd6a0; } .story-tag.abandoned { color: var(--soft); }
.library .rows.stories .blurb { font-size: 14px; line-height: 1.4; }
.library > :last-child { margin-bottom: 0 !important; padding-bottom: 0 !important; border-bottom: 0 !important; }
.cta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0.9em 0 0.6em; }
a.btn-read, a.btn-read:visited { padding: 7px 16px; color: #2b1a2f; background: var(--acc); border-radius: 6px; font: 600 15px/1.4 var(--ui); text-decoration: none; }
a.btn-read:hover { color: #2b1a2f; background: #ecc4d1; }
a.btn-soft, a.btn-soft:visited { padding: 7px 14px; color: var(--text); border: 1px solid var(--hair); border-radius: 6px; font: 15px/1.4 var(--ui); text-decoration: none; }
a.btn-soft:hover { background: var(--raised); }
.also { color: var(--soft); font: 13px/1.5 var(--ui); }
.cta.dl { align-items: center; margin-top: 0; } .cta.dl .btn-soft { padding: 3px 10px; font-size: 13px; }
.resume { text-align: left; font-size: 14px; color: var(--soft); }
.comments { border-top: 1px solid var(--hair); }
.comment-list li { background: var(--raised); border-left: 0; border-radius: 6px; }
.comments input, .comments textarea { background: #1a141d; border: 1px solid var(--hair); border-radius: 6px; font-family: var(--ui); font-size: 15px; }
.comments button { background: none; color: var(--text); border: 1px solid var(--hair); border-radius: 6px; font-size: 14px; }
.comments button:hover { background: var(--raised); color: var(--text); }
.rset-p { border-radius: 8px; } .resume-bar { border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }
.rset-b, .rset-p button { border-color: var(--hair); border-radius: 4px; }
.announce { max-width: 680px; color: var(--text); background: var(--raised); border: 1px solid var(--hair); border-radius: 8px; }
html[data-page] #panel.chapter { line-height: 1.75; }
@media (max-width: 520px) { .story { grid-template-columns: 96px 1fr; gap: 14px; } #panel { padding: 16px 16px 24px; } }

/* ---- comments: what markdown draws (public/comments.js) */
.comment-list li { position: relative; }
.comment-list .comment-body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--ui); font-size: 15px; line-height: 1.55; }
.comment-list code, .cm-preview code { padding: 1px 4px; background: #1a141d; border-radius: 4px; font: 0.9em Consolas, "Courier New", monospace; }
.cm-code { margin: 0.5em 0; padding: 8px 10px; overflow-x: auto; background: #1a141d; border-radius: 6px; } .cm-code code { padding: 0; background: none; }
.cm-quote { margin: 0.5em 0; padding: 1px 0 1px 10px; border-left: 2px solid var(--hair); color: var(--soft); }
.cm-h { margin: 0.5em 0 0.2em; font: 600 16px/1.3 var(--ui); } .cm-h1 { font-size: 20px; } .cm-h2 { font-size: 18px; }
.cm-small { margin: 0.2em 0; color: var(--soft); font: 12.5px/1.4 var(--ui); }
.cm-list { margin: 0.4em 0; padding-left: 1.4em; font: 15px/1.5 var(--ui); }
.comment-list .cm-list li { margin: 0; padding: 0; background: none; border-radius: 0; }
.cm-rule { border: 0; border-top: 1px solid var(--hair); margin: 0.7em 0; }
.cm-spoiler { color: transparent; background: #3b2f40; border-radius: 3px; cursor: pointer; } .cm-spoiler * { color: transparent; }
.cm-spoiler.open, .cm-spoiler:focus { color: inherit; background: #332838; cursor: auto; } .cm-spoiler.open *, .cm-spoiler:focus * { color: inherit; }
.cm-embed { margin: 0.5em 0; } .cm-embed img, .cm-embed video { display: block; max-width: 100%; max-height: 420px; border-radius: 6px; } .cm-embed audio { width: 100%; max-width: 420px; }
.cm-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 6px; } .cm-frame.short { aspect-ratio: auto; height: 152px; }
.cm-play, .cm-tool, .cm-reply, .cm-mod button { font: 13px/1.4 var(--ui); color: var(--text); background: none; border: 1px solid var(--hair); border-radius: 5px; padding: 2px 8px; cursor: pointer; }
.cm-play:hover, .cm-tool:hover, .cm-reply:hover, .cm-mod button:hover, .cm-tool.on { background: var(--raised); }
.cm-play { padding: 6px 12px; }
.cm-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: -2px; } .cm-tools .cm-prev { margin-left: auto; }
.comments form .cm-tool { justify-self: auto; }
.cm-preview { padding: 8px 10px; min-height: 2em; background: #1a141d; border: 1px dashed var(--hair); border-radius: 6px; }
.cm-count { margin-left: 8px; color: var(--soft); font: 13px var(--ui); }
.cm-reply { float: right; opacity: 0; font-size: 12px; } .comment-list li:hover .cm-reply, .cm-reply:focus { opacity: 1; }
.cm-mod { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0.5em 0 0 !important; font: 12px var(--ui); color: var(--soft); } .cm-who { margin-right: auto; }
.cm-hidden { opacity: 0.55; }
.quote-pop { position: fixed; z-index: 60; padding: 5px 11px; color: var(--text); background: var(--raised); border: 1px solid var(--hair); border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); font: 13px/1.4 var(--ui); cursor: pointer; }
.quote-pop:hover { color: var(--acc); }
@media (hover: none) { .cm-reply { opacity: 1; } }

/* ---- lists read as lists: a whole row is the link, with no underlines shouting */
.rows li { position: relative; }
.rows li > span:first-child > a, .rows.stories li span > a { color: var(--text); text-decoration: none; }
.rows li > span:first-child > a::after, .rows.stories li span > a::after { content: ""; position: absolute; inset: 0; }
.rows li:hover > span:first-child > a, .rows.stories li:hover span > a { color: var(--acc); }
.rows li > span:first-child > a:visited { color: #bdaeb8; }
.rows.toc strong { font-weight: 400; color: var(--soft); font-variant-numeric: tabular-nums; }
.rows.toc em { font-style: normal; }
h2.book-title, #panel h2.book-title { font: 800 22px/1.25 "Unbounded", "Segoe UI", sans-serif; letter-spacing: -0.02em; border: 0; }
h2.book-title::before { display: none !important; }
.chapter-nav a { text-decoration: none; }
.chapter-nav { color: var(--soft); }
.site-read > a[aria-current], .site-nav a[aria-current] { color: var(--text); }

/* the comment box: buttons on top of the box, one row, post at the end */
.cm-box { background: #1a141d; border: 1px solid var(--hair); border-radius: 8px; overflow: hidden; }
.cm-box:focus-within { border-color: #5b4659; }
.cm-tools { margin: 0; padding: 4px; gap: 1px; border-bottom: 1px solid var(--hair); }
.comments form .cm-tool { padding: 3px 7px; border: 0; color: var(--soft); }
.comments form .cm-tool:hover { color: var(--text); }
.cm-box textarea { display: block; border: 0; border-radius: 0; background: none; font-family: var(--ui); }
.cm-box textarea:focus { border: 0; }
.cm-box .cm-preview { border: 0; border-top: 1px dashed var(--hair); border-radius: 0; background: none; }
.comments form { justify-items: stretch; }
.comments form > button[type=submit] { justify-self: end; padding: 7px 18px; color: #2b1a2f; background: var(--acc); border: 0; font-weight: 600; }
.comments form > button[type=submit]:hover { color: #2b1a2f; background: #ecc4d1; }
.comment-note { font-size: 13px; }

/* header links with no icon keep their words on a phone */
@media (max-width: 520px) { .site-nav a:not(:has(.ic)) span { display: inline; font-size: 13px; } }

/* ---- the CV (/cv): a site page from the desk whose words sit inside <div class="cv">. Its own
   name heading replaces the page title; section headings are small caps; prints as one plain page
   (tools\build_cv_pdf.py saves that as the PDF). */
#panel.sitepage:has(> .cv) > h2 { display: none; }
#panel .cv { font: 16px/1.6 var(--ui); }
.cv h1 { margin: 0; font: 800 32px/1.1 "Unbounded", "Arial Black", "Segoe UI Black", sans-serif; letter-spacing: -0.01em; }
#panel .cv .contact { margin: 8px 0 0; color: var(--soft); font-size: 14px; }
#panel .cv .intro { margin: 18px 0 0; padding: 14px 16px; background: var(--raised); border-left: 3px solid var(--acc); border-radius: 0 6px 6px 0; font: 18px/1.6 "Times New Roman", Times, serif; }
#panel .cv h2 { font: 600 13px/1.4 var(--ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--acc); margin: 2em 0 0.8em; padding-bottom: 6px; border: 0; border-bottom: 1px solid var(--hair); }
#panel .cv h3 { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; align-items: baseline; margin: 1.1em 0 0; font: 600 16.5px/1.4 var(--ui); }
#panel .cv h3 small { color: var(--soft); font-size: 13px; font-weight: 400; white-space: nowrap; }
#panel .cv p, #panel .cv ul { margin: 4px 0 0; }
#panel .cv ul { padding-left: 1.2em; }
#panel .cv li { margin: 2px 0; }
#panel .cv ul.skills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
#panel .cv ul.skills li { margin: 0; padding: 2px 10px; border: 1px solid var(--hair); border-radius: 999px; background: var(--raised); font-size: 14px; }
#panel .cv .actions { margin: 2em 0 0; }
#panel .cv .actions a { display: inline-block; margin-right: 8px; padding: 6px 12px; border: 1px solid var(--hair); border-radius: 6px; color: var(--text); text-decoration: none; font-size: 14px; }
#panel .cv .actions a:hover { background: var(--raised); border-color: var(--acc); }
@media (max-width: 520px) { .cv h1 { font-size: 26px; } #panel .cv .intro { font-size: 17px; } }
@media print {
  @page { margin: 0.5in; }
  html:has(.cv) { background: #fff; }
  body:has(.cv) { padding: 0; color: #111; }
  body:has(.cv) .site-top, body:has(.cv) .tab, body:has(.cv) .announce, #panel.sitepage:has(> .cv) > .wip, #panel .cv .actions { display: none; }
  #panel.sitepage:has(> .cv) { max-width: none; padding: 0; border: 0; background: #fff; }
  #panel .cv { font-size: 12.5px; line-height: 1.4; color: #111; }
  #panel .cv a { color: #111; text-decoration: none; }
  #panel .cv .contact, #panel .cv h3 small { color: #444; }
  .cv h1 { font-size: 24px; }
  #panel .cv .intro { margin-top: 10px; background: none; border-left: 2px solid #999; padding: 2px 12px; font-size: 13.5px; line-height: 1.45; }
  #panel .cv h2 { color: #111; border-color: #bbb; margin: 0.8em 0 0.35em; padding-bottom: 2px; break-after: avoid; }
  #panel .cv h3 { margin-top: 0.4em; font-size: 13px; break-after: avoid; }
  #panel .cv li { margin: 0; }
  #panel .cv ul.skills li { background: none; border-color: #bbb; font-size: 11.5px; padding: 0 8px; }
}
