/* joans.cat: editorial precision with an instrument layer.
   Two voices: Newsreader (the judgment), Spline Sans Mono (the instruments).
   Restraint is still the design; now it is set properly. */

:root {
  color-scheme: light dark;
  --bg: #faf7f1;
  --bg-elev: #ffffff;
  --bg-tint: #f2ede3;
  --fg: #211d18;
  --muted: #6e6659;
  --accent: #b23327;
  --accent-soft: rgba(178, 51, 39, .09);
  --rule: #e6dfd2;
  --rule-strong: #d4cbb9;
  --mark: #fdf0b6;
  --shadow: 0 24px 70px -24px rgba(33, 25, 15, .28), 0 4px 18px -8px rgba(33, 25, 15, .14);
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  --bg: #151310;
  --bg-elev: #1d1a16;
  --bg-tint: #1a1713;
  --fg: #ebe6dc;
  --muted: #a39c8d;
  --accent: #e56a58;
  --accent-soft: rgba(229, 106, 88, .12);
  --rule: #2b2822;
  --rule-strong: #3a352c;
  --mark: #4a4210;
  --shadow: 0 24px 70px -24px rgba(0, 0, 0, .8), 0 4px 18px -8px rgba(0, 0, 0, .5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151310;
    --bg-elev: #1d1a16;
    --bg-tint: #1a1713;
    --fg: #ebe6dc;
    --muted: #a39c8d;
    --accent: #e56a58;
    --accent-soft: rgba(229, 106, 88, .12);
    --rule: #2b2822;
    --rule-strong: #3a352c;
    --mark: #4a4210;
    --shadow: 0 24px 70px -24px rgba(0, 0, 0, .8), 0 4px 18px -8px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.68;
  font-weight: 420;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Cross-document view transitions (progressive enhancement) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .14s ease both; }
::view-transition-new(root) { animation: vt-in .18s ease both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* ---------- utility voices ---------- */

.kicker, .stats b, header.site nav, .tools, kbd, .pager, .toc,
footer.site, .card .tags, .hero-scope {
  font-family: var(--mono);
}

kbd {
  font-size: .72em;
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: .1em .45em;
  background: var(--bg-elev);
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- skip link & progress ---------- */

.skip {
  position: fixed;
  top: .6rem; left: .6rem;
  z-index: 60;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: .8rem;
  padding: .55em .9em;
  border-radius: 6px;
  text-decoration: none;
  transform: translateY(-300%);
}
.skip:focus-visible { transform: none; outline-offset: 1px; outline-color: var(--fg); }

.progress {
  position: fixed;
  top: 0; left: 0;
  z-index: 55;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}

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

header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .3rem 1.2rem;
  padding: .95rem clamp(1.1rem, 4vw, 2.2rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
header.site.scrolled { border-bottom-color: var(--rule); }

header.site .brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 560;
  letter-spacing: -.01em;
  text-decoration: none;
  color: var(--fg);
  margin-right: auto;
}
header.site nav {
  display: flex;
  flex-wrap: wrap;
  gap: .1rem;
  font-size: .78rem;
  letter-spacing: .04em;
}
header.site nav a {
  color: var(--muted);
  text-decoration: none;
  padding: .35em .55em;
  border-radius: 6px;
  transition: color .15s ease, background-color .15s ease;
}
header.site nav a:hover { color: var(--fg); background: var(--accent-soft); }
header.site nav a[aria-current] {
  color: var(--accent);
  font-weight: 600;
}

.tools { display: flex; gap: .4rem; align-items: center; }

@media (max-width: 700px) {
  header.site { position: static; }
  header.site nav {
    order: 3;
    flex-basis: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-top: .15rem;
  }
  header.site nav::-webkit-scrollbar { display: none; }
  .tools { margin-left: auto; }
}
@media (hover: none) {
  #palette-btn { display: none; }
}
.tools button {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: .35em .6em;
  cursor: pointer;
  line-height: 1.4;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.tools button:hover { color: var(--fg); border-color: var(--rule-strong); background: var(--bg-elev); }
.tools .theme-icon { display: inline-block; width: 1em; height: 1em; vertical-align: -.12em; }

/* ---------- main column ---------- */

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(2.2rem, 6vh, 4rem) 1.35rem 4rem;
}
main:focus { outline: none; }

h1 {
  font-size: clamp(2.1rem, 5.5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -.022em;
  font-weight: 500;
  margin: 0 0 1.2rem;
  text-wrap: balance;
}
h2 {
  font-size: 1.45rem;
  line-height: 1.3;
  letter-spacing: -.012em;
  font-weight: 540;
  margin: 2.6rem 0 .7rem;
  text-wrap: balance;
  scroll-margin-top: 5rem;
}
h3 {
  font-size: 1.12rem;
  font-weight: 560;
  margin: 1.8rem 0 .4rem;
  scroll-margin-top: 5rem;
}

/* Heading anchors (added by JS) */
.anchor {
  margin-left: .35em;
  color: var(--rule-strong);
  text-decoration: none;
  font-weight: 400;
  opacity: 0;
  transition: opacity .15s ease;
}
h2:hover .anchor, h2:focus-within .anchor { opacity: 1; }
.anchor:hover { color: var(--accent); }

p, ul, ol { margin: 0 0 1.05rem; }
li { margin-bottom: .4rem; }
em { font-style: italic; }
strong { font-weight: 600; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  transition: text-decoration-color .15s ease;
}
a:hover { text-decoration-color: var(--accent); }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.4rem 0;
}

.kicker {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--accent);
  margin: 0 0 .9rem;
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 1.6em;
  height: 1px;
  background: var(--accent);
  vertical-align: .3em;
  margin-right: .7em;
  opacity: .7;
}

.lede {
  font-size: clamp(1.3rem, 3vw, 1.55rem);
  line-height: 1.45;
  font-weight: 430;
  letter-spacing: -.012em;
  color: var(--fg);
  text-wrap: pretty;
}

.question {
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  padding-left: 1.1rem;
  margin: 0 0 2.2rem;
  text-wrap: pretty;
}

/* Highlighted narrative moment; not a quotation */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
  padding: 1.05rem 1.3rem 1.1rem;
  margin: 1.7rem 0;
}
.callout .callout-label {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .5rem;
}
.callout p:last-child { margin-bottom: 0; }

.coda {
  color: var(--muted);
  font-style: italic;
  border-top: 1px solid var(--rule);
  padding-top: 1.3rem;
  margin-top: 2.6rem;
}

mark.todo {
  background: var(--mark);
  color: inherit;
  padding: 0 .25em;
  border-radius: 2px;
}
mark.todo::before { content: "TODO: "; font-weight: 700; }

/* ---------- diagrams ---------- */

figure.diagram {
  margin: 2rem 0;
}
figure.diagram, .dscroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(90deg, var(--bg) 30%, transparent) left / 44px 100% no-repeat local,
    linear-gradient(270deg, var(--bg) 30%, transparent) right / 44px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--fg) 20%, transparent), transparent) left / 16px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--fg) 20%, transparent), transparent) right / 16px 100% no-repeat scroll;
}
figure.diagram.has-scroller { overflow-x: visible; background: none; }
.scroll-hint {
  display: none;
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--muted);
  margin: .45rem 0 0;
}
@media (hover: none) { .scroll-hint { display: block; } }
@media (max-width: 700px) {
  figure.diagram { margin-inline: -1.35rem; }
  figure.diagram figcaption, figure.diagram .scroll-hint { padding-inline: 1.35rem; }
}
figure.diagram svg {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
  color: var(--fg);
  font-family: var(--mono);
}
.chart-past { fill: color-mix(in srgb, var(--accent) 45%, var(--bg)); }
.chart-now { fill: var(--accent); }
figure.diagram figcaption {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--muted);
  margin-top: .7rem;
  line-height: 1.55;
}

/* ---------- index cards ---------- */

.card {
  border-top: 1px solid var(--rule);
  padding: 1.4rem 1rem 1.4rem;
  margin: 0 -1rem;
  border-radius: 0 0 10px 10px;
  cursor: pointer;
  transition: background-color .2s ease;
}
.card:hover { background: var(--bg-tint); }
.card h2 { margin: 0 0 .35rem; font-size: 1.35rem; }
.card h2 a { color: var(--fg); text-decoration: none; }
.card h2 a:not(.anchor)::after {
  content: "\2192";
  display: inline-block;
  margin-left: .4em;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s ease, transform .2s ease;
}
.card:hover h2 a { color: var(--accent); }
.card:hover h2 a:not(.anchor)::after { opacity: 1; transform: none; }
.card .q { font-style: italic; color: var(--muted); margin: 0 0 .45rem; }
.card p { margin: 0; }

/* ---------- home hero & section index ---------- */

.hero { padding: clamp(1rem, 5vh, 3rem) 0 1rem; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
}
.hero > * { animation: rise .7s cubic-bezier(.2, .6, .2, 1) backwards; }
.hero > :nth-child(2) { animation-delay: .08s; }
.hero > :nth-child(3) { animation-delay: .16s; }
.hero > :nth-child(4) { animation-delay: .26s; }
.hero h1 {
  font-size: clamp(2.8rem, 9vw, 4.6rem);
  font-weight: 470;
  line-height: 1.04;
  letter-spacing: -.028em;
  margin-bottom: 1.4rem;
}
.hero h1 em { font-style: italic; font-weight: 430; color: var(--accent); }
.hero-scope {
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.6rem;
}
.hero-hint {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
  margin-top: 1.6rem;
}
@media (hover: none) { .hero-hint, .foot-kbd { display: none; } }

.index { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.index li { margin: 0; }
.index a {
  display: grid;
  grid-template-columns: 2.6rem 1fr auto;
  gap: .2rem 1rem;
  align-items: baseline;
  padding: 1.05rem .9rem;
  margin: 0 -.9rem;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  color: var(--fg);
  border-radius: 8px;
  transition: background-color .2s ease;
}
.index li:last-child a { border-bottom: 1px solid var(--rule); }
.index a:hover { background: var(--bg-tint); }
.index .n {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
  transition: color .2s ease;
}
.index a:hover .n { color: var(--accent); }
.index .t {
  font-size: 1.25rem;
  font-weight: 540;
  letter-spacing: -.01em;
  transition: color .2s ease;
}
.index a:hover .t { color: var(--accent); }
.index kbd { justify-self: end; opacity: .75; }
.index .d {
  grid-column: 2 / -1;
  font-size: .95rem;
  color: var(--muted);
  line-height: 1.5;
}
@media (hover: none) { .index kbd { display: none; } }

/* ---------- pager ---------- */

.pager {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.35rem 2.2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .78rem;
}
.pager a {
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: .7em 1em;
  max-width: 48%;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.pager a:hover { color: var(--accent); border-color: var(--rule-strong); background: var(--bg-elev); }
.pager .label { display: block; text-transform: uppercase; letter-spacing: .12em; font-size: .62rem; opacity: .7; margin-bottom: .3em; }
.pager .next { margin-left: auto; text-align: right; }

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

footer.site {
  border-top: 1px solid var(--rule);
  font-size: .76rem;
  color: var(--muted);
}
footer.site .foot {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.4rem 1.35rem 2.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.6rem;
  align-items: baseline;
}
footer.site a { color: var(--muted); text-decoration-color: transparent; }
footer.site a:hover { color: var(--fg); text-decoration-color: currentColor; }
.foot-kbd { margin-left: auto; }
.foot-kbd kbd { cursor: pointer; }

/* ---------- table of contents (JS, wide screens) ---------- */

.toc {
  position: fixed;
  top: 7rem;
  left: calc(50vw + 24rem);
  width: 13rem;
  font-size: .72rem;
  line-height: 1.5;
  display: none;
}
@media (min-width: 1250px) { .toc { display: block; } }
.toc h2 {
  font-size: .62rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  margin: 0 0 .6rem;
  font-weight: 500;
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0 0 .15rem; }
.toc a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  padding: .22em .6em;
  border-left: 2px solid var(--rule);
  transition: color .15s ease, border-color .15s ease;
}
.toc a:hover { color: var(--fg); }
.toc a.current { color: var(--accent); border-left-color: var(--accent); }

/* ---------- command palette & help ---------- */

dialog.palette, dialog.help {
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  background: var(--bg-elev);
  color: var(--fg);
  box-shadow: var(--shadow);
  padding: 0;
  width: min(37rem, 92vw);
  margin: 12vh auto auto;
}
dialog.palette::backdrop, dialog.help::backdrop {
  background: color-mix(in srgb, var(--fg) 22%, transparent);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.palette input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--fg);
  font-family: var(--mono);
  font-size: .95rem;
  padding: 1rem 1.2rem;
  outline: none;
}
.palette input::placeholder { color: var(--muted); }
.palette ul {
  list-style: none;
  margin: 0;
  padding: .45rem;
  max-height: min(21rem, 48vh);
  overflow-y: auto;
}
.palette li[role="option"] {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  padding: .6rem .8rem;
  border-radius: 8px;
  cursor: pointer;
  margin: 0;
}
.palette li .group {
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  min-width: 4.2rem;
}
.palette li .name { font-size: 1rem; }
.palette li .hint { margin-left: auto; }
.palette li[aria-selected="true"] {
  background: var(--accent-soft);
}
.palette li[aria-selected="true"] .name { color: var(--accent); }
.palette .empty {
  padding: 1rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .8rem;
}
.palette .hints {
  display: flex;
  gap: 1.2rem;
  padding: .6rem 1.2rem .7rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--muted);
}

.help .body { padding: 1.2rem 1.4rem 1.4rem; }
.help h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}
.help table { border-collapse: collapse; width: 100%; }
.help td {
  padding: .34em 0;
  font-size: .88rem;
  vertical-align: top;
}
.help td:first-child {
  font-family: var(--mono);
  white-space: nowrap;
  padding-right: 1.6rem;
  width: 1%;
}
.help .close-hint {
  margin: 1.1rem 0 0;
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--muted);
}

/* ---------- reveal animation (JS adds .reveal; visible without JS) ---------- */

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity .7s cubic-bezier(.2, .6, .2, 1), transform .7s cubic-bezier(.2, .6, .2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ---------- chart art & emblems (the portolan layer) ---------- */

.hero-art {
  position: absolute;
  z-index: 0;
  inset: -1.5rem calc(50% - 50vw) -1rem;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(100deg, transparent 4%, rgba(0,0,0,.28) 34%, rgba(0,0,0,.9) 62%, #000 78%);
  mask-image: linear-gradient(100deg, transparent 4%, rgba(0,0,0,.28) 34%, rgba(0,0,0,.9) 62%, #000 78%);
}
.hero-art svg { width: 100%; height: 100%; display: block; }
@media (max-width: 900px) { .hero-art { display: none; } }
.hero { position: relative; }
.hero > :not(.hero-art) { position: relative; z-index: 1; }

.art-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: art-draw 1.1s cubic-bezier(.4, .2, .2, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes art-draw { to { stroke-dashoffset: 0; } }
.art-appear {
  opacity: 0;
  animation: art-appear .5s ease forwards;
  animation-delay: var(--d, 0s);
}
@keyframes art-appear { to { opacity: 1; } }

header.site .brand { display: flex; align-items: center; gap: .55rem; }
.brand .mark { width: 24px; height: 24px; color: var(--fg); overflow: visible; display: block; }
.brand .word {
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity .25s ease, transform .25s ease;
  font-size: 1.05rem;
}
.brand:hover .word, .brand:focus-visible .word { opacity: 1; transform: none; }

.hero h1 {
  margin: 0 calc(50% - 50vw) 1.6rem;
  padding: 0 clamp(1.1rem, 4vw, 2.2rem);
  font-size: clamp(3.2rem, 9vw, 8.6rem);
  line-height: .98;
  letter-spacing: -.03em;
  font-weight: 460;
  text-wrap: balance;
}

.marginalia { display: none; }
@media (min-width: 1150px) {
  .with-note { position: relative; }
  .marginalia {
    display: block;
    position: absolute;
    left: -7.8rem;
    top: .1em;
    width: 4.75rem;
    color: var(--muted);
  }
  .marginalia svg { width: 100%; height: auto; overflow: visible; display: block; }
}
.ms  { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mas { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.maf { fill: var(--accent); stroke: none; }
.mf  { fill: currentColor; stroke: none; }
.marginalia.m-anim :is(.ms, .mas) { stroke-dasharray: 1; stroke-dashoffset: 1; }
.marginalia.m-anim :is(.maf, .mf) { opacity: 0; }
.marginalia.in :is(.ms, .mas) {
  animation: art-draw .9s cubic-bezier(.4, .2, .2, 1) forwards;
  animation-delay: var(--d, 0s);
}
.marginalia.in :is(.maf, .mf) {
  animation: art-appear .45s ease forwards;
  animation-delay: var(--d, .5s);
}

.em-s { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.em-as { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.em-af { fill: var(--accent); stroke: none; }

.page-mark { margin: 0 0 .7rem; }
.page-mark svg {
  width: 36px;
  height: 36px;
  overflow: visible;
  color: var(--muted);
  display: block;
}

.index a { grid-template-columns: 2rem 2.6rem 1fr auto; }
ul.index--plain a { grid-template-columns: 2.6rem 1fr auto; }
ul.index--plain .q, ul.index--plain .d { grid-column: 2 / -1; }
.index .dt {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
  align-self: baseline;
  white-space: nowrap;
}
.index .q {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.5;
}
.index .em {
  width: 22px;
  height: 22px;
  overflow: visible;
  color: var(--muted);
  align-self: center;
  transition: color .2s ease;
}
.index a:hover .em { color: var(--accent); }
.index .d { grid-column: 3 / -1; }


.unlock-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin: 1.6rem 0; }
.button {
  display: inline-block;
  font-family: var(--mono);
  font-size: .8rem;
  padding: .65em 1.1em;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  color: var(--fg);
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.button:hover { background: var(--bg-elev); border-color: var(--muted); }
.button--accent { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.button--accent:hover { background: var(--accent); opacity: .9; }
.unlock-card {
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  margin: 1.8rem 0;
  overflow: hidden;
}
.unlock-card form { display: flex; }
.unlock-card input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--mono);
  font-size: .95rem;
  padding: 1rem 1.2rem;
  outline: none;
}
.unlock-card input::placeholder { color: var(--muted); }
.unlock-card button {
  border: 0;
  border-left: 1px solid var(--rule);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: .8rem;
  padding: 0 1.3rem;
  cursor: pointer;
}
.unlock-card button:hover { opacity: .9; }
.unlock-card .hints {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  padding: .55rem 1.2rem .65rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--muted);
}
.unlock-card.error { border-color: var(--accent); }
.unlock-card.error .hints { color: var(--accent); }
.lockic { width: .8em; height: .8em; overflow: visible; vertical-align: -.05em; margin-left: .4em; }

/* ---------- print ---------- */

@media print {
  header.site nav, .tools, .skip, .progress, .pager, .toc, .foot-kbd { display: none !important; }
  header.site { position: static; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; }
  main { max-width: none; padding: 0; }
  .stats, .stats > div { background: #fff; }
}
