/* The House, its pop-ups, About and the 404. Shared styles are in css/base.css (loaded first). */
/* ───────── Phones: tap an eye to preview it, then Enter ───────── */

.preview-hint { display: none; }
.preview { display: none; }

@media (pointer: coarse), (max-width: 760px) {
  .label { display: none; }
  /* the diagram's centre sits 60% of the way up the screen, with the hint just above it */
  .stage {
    --hw: min(calc(100vw - 16px), calc((100dvh - 180px) * 1200 / 1060));   /* diagram width */
    --hh: calc(var(--hw) * 1060 / 1200);                                   /* diagram height */
    display: block;
    padding: max(env(safe-area-inset-top), calc(40dvh - var(--hh) / 2 - 36px)) 8px 0;
  }
  .house-wrap { width: var(--hw); margin: 0 auto; }

  .preview-hint {
    display: block;
    height: 22px;
    margin: 0 0 14px;
    text-align: center;
    font: italic var(--body-weight) 16px/22px var(--font-serif);
    color: var(--muted);
    transition: opacity .3s ease;
  }
  .preview-hint.gone, body.modal-open .preview-hint { opacity: 0; }

  .preview {
    display: block;
    position: fixed;
    z-index: 6;
    left: 12px; right: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .3s ease, transform .4s cubic-bezier(.2,.8,.2,1);
    touch-action: pan-y;
  }
  .preview[hidden] { display: none; }
  .preview.show { opacity: 1; transform: none; }
  .preview-card {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 12px;
    border-radius: 18px;
    background: linear-gradient(180deg, var(--panel-top), var(--panel));
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border-dark));
    box-shadow: 0 20px 60px color-mix(in srgb, var(--shadow) 80%, transparent), 0 0 40px color-mix(in srgb, var(--accent) 12%, transparent);
  }
  .preview-eye .mini-eye { width: 52px; height: 52px; }
  .preview-text { display: flex; flex-direction: column; min-width: 0; }
  .preview-sub { margin-bottom: 1px; font: italic var(--body-weight) 14px var(--font-serif); color: var(--accent-text); }
  .preview-count { margin-top: 5px; font: 10.5px var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
  .preview-name { font-family: var(--font-display); font-size: 26px; line-height: 1.05; color: var(--ink); }
  .preview-enter {
    align-self: center;
    padding: 11px 16px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
    color: var(--ink);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 18px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
  }
  .preview-enter:active { transform: scale(.96); }
  .preview-dots { display: flex; justify-content: center; gap: 7px; margin-top: 10px; }
  .preview-dots i {
    width: 6px; height: 6px; border-radius: 50%;
    background: color-mix(in srgb, var(--ink) 25%, transparent);
    transition: background .3s ease, transform .3s ease;
  }
  .preview-dots i.on { background: var(--accent); transform: scale(1.4); }

}

/* ───────── Modal ───────── */

.veil {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 4vh 16px;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--bg) 35%, transparent), color-mix(in srgb, var(--bg) 75%, transparent));
  opacity: 0;
  transition: opacity .35s ease;
}
.veil[hidden] { display: none; }
.veil.open { opacity: 1; }

.modal {
  --accent: var(--bronze);
  --accent-text: var(--accent);
  position: relative;
  width: min(820px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    linear-gradient(180deg, var(--panel-top), var(--panel) 60%);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border-dark));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--shadow) 80%, transparent),
    0 0 0 6px color-mix(in srgb, var(--bronze) 5%, transparent),
    0 40px 120px color-mix(in srgb, var(--shadow) 85%, transparent),
    0 0 80px color-mix(in srgb, var(--accent) 14%, transparent);
  transform-origin: var(--ox, 50%) var(--oy, 50%);
  transform: scale(.25);
  opacity: 0;
  transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .35s ease;
}
.veil.open .modal { transform: none; opacity: 1; }

/* each eye's colour (from css/theme.css) becomes the pop-up's accent */
.modal[data-eye="essays"]     { --accent: var(--essays-accent); }
.modal[data-eye="fantasy"]    { --accent: var(--fantasy-accent); }
.modal[data-eye="scifi"]      { --accent: var(--scifi-accent); }
.modal[data-eye="historical"] { --accent: var(--historical-accent); }
.modal[data-eye="other"]      { --accent: var(--other-accent); --accent-text: var(--other-text); }
.modal[data-eye="rural"]      { --accent: var(--rural-accent); }

.sheet-handle { display: none; }

/* the scrolling happens inside, so the close button stays pinned to the frame's corner */
.modal-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 44px clamp(20px, 5vw, 56px) 56px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 50%, var(--scrollbar)) transparent;
}

.modal::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 46px;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(var(--modal-top, var(--panel-top)) 40%, transparent);
}
.modal[data-eye="scifi"]      { --modal-top: var(--scifi-bg-top); }
.modal[data-eye="historical"] { --modal-top: var(--historical-bg-top); }
.modal[data-eye="other"]      { --modal-top: var(--other-bg-top); }
.modal[data-eye="essays"]     { --modal-top: var(--essays-bg-top); }
.modal[data-eye="rural"]      { --modal-top: var(--rural-bg-top); }

.modal-head { text-align: center; margin-bottom: 36px; }
.modal-eye-wrap {
  position: relative;
  width: 150px;
  margin: -14px auto 0;
}
.modal-eye { display: block; width: 150px; height: 150px; overflow: visible; }
.modal-epithet {
  margin: 14px 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  color: var(--accent-text);
}
.modal h2 {
  margin: 6px 0 18px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 64px);
  line-height: 1;
  color: var(--ink);
}
.modal-def {
  max-width: 560px;
  margin: 0 auto;
  font-family: var(--font-serif);
  font-weight: var(--body-weight);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.modal-def em { color: var(--ink); margin-right: 4px; }
.modal-def .attr { display: block; margin-top: 8px; font-size: 15px; color: var(--muted); }

.rule {
  display: flex; align-items: center; gap: 14px;
  margin: 36px 0 20px;
  color: var(--accent);
}
.rule::before, .rule::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.rule h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-style: italic;
  font-size: 19px;
  color: var(--ink);
}
.rule .tag {
  color: var(--accent-text);                         /* the readable shade of the eye's colour */
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 4px;
}
.section-note {
  max-width: 600px;
  margin: -6px auto 22px;
  text-align: center;
  font-family: var(--font-serif);
  font-weight: var(--body-weight);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* a margin note inside a pop-up section (aside: { by, text } in content/house.js) */
.modal .note.section-aside {
  position: static;
  width: auto;
  max-width: 520px;
  margin: -8px auto 24px;
  padding: 2px 0 2px 14px;
  border-left-color: var(--accent);
}
.modal .note.section-aside b { color: var(--accent-text); }

.cards {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 260px;
  height: 100%;
  padding: 18px;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  isolation: isolate;
  background: linear-gradient(160deg, var(--card-top), var(--card-bottom));
  border: 1px solid color-mix(in srgb, var(--white) 6%, transparent);
  transition: border-color .3s ease, transform .3s ease, box-shadow .3s ease;
}
.card img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
  filter: saturate(.75) brightness(.8);
  transition: transform .6s ease, filter .4s ease;
}
.card::after {
  content: '';
  position: absolute; inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 18%, color-mix(in srgb, var(--card-shade) 70%, transparent) 50%, color-mix(in srgb, var(--card-shade) 95%, transparent));
  transition: background .4s ease;
}
.card:hover, .card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 10px 40px color-mix(in srgb, var(--shadow) 60%, transparent), 0 0 24px color-mix(in srgb, var(--accent) 22%, transparent);
  transform: translateY(-2px);
  outline: none;
}
.card:hover img, .card:focus-visible img { transform: scale(1.05); filter: saturate(1) brightness(.9); }
.card-title {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.05;
  color: var(--ink);
  text-shadow: 0 2px 10px color-mix(in srgb, var(--shadow) 80%, transparent);
}
.card-hook {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-weight: var(--body-weight);
  font-style: italic;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  position: relative;
  display: block;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--white) 8%, transparent);
  height: 24px;
}
.card-src, .card-go {
  position: absolute;
  left: 0; top: 10px;
  font: var(--body-weight) 13px var(--font-serif);
  letter-spacing: .01em;
  white-space: nowrap;
  transition: opacity .3s ease, transform .3s ease;
}
.card-src { color: var(--ink-soft); opacity: .75; }
.card-go { color: var(--accent-text); opacity: 0; transform: translateX(-6px); }
.card:hover .card-src, .card:focus-visible .card-src { opacity: 0; transform: translateX(6px); }
.card:hover .card-go, .card:focus-visible .card-go { opacity: 1; transform: none; }

/* a newly entered story: a small badge in the card's top corner */
.card-new {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 1;
  font: 10px/1 var(--font-body);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent-text);
  padding: 5px 8px 4px;
  border: 1px solid currentColor;
  border-radius: 4px;
  background: color-mix(in srgb, var(--card-shade) 75%, transparent);
  backdrop-filter: blur(3px);
}
.card-new-short { display: none; }
.card.is-new { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

/* a work in progress: not a link yet */
.card.is-pending {
  cursor: default;
  background:
    radial-gradient(90% 70% at 50% 30%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    linear-gradient(160deg, var(--card-top), var(--card-bottom));
  border-style: dashed;
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.card.is-pending:hover { transform: none; box-shadow: none; }
.card.is-pending .card-src { color: var(--accent-text); opacity: 1; }

/* neighbouring eyes at the foot of each modal */
.modal-neighbours {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.nb {
  display: flex; align-items: center; gap: 12px;
  min-width: 0; flex: 0 1 50%;
  text-decoration: none;
  padding: 6px 0;
}
.nb.next { text-align: right; justify-content: flex-end; }
.nb-eye { width: 40px; height: 40px; flex: none; transition: transform .45s cubic-bezier(.3,1.4,.5,1); }
.nb:hover .nb-eye, .nb:focus-visible .nb-eye { transform: scale(1.14); }
.nb.prev:hover .mini-iris, .nb.prev:focus-visible .mini-iris { transform: translateX(3px); }
.nb.next:hover .mini-iris, .nb.next:focus-visible .mini-iris { transform: translateX(-3px); }
.nb-text { display: flex; flex-direction: column; min-width: 0; }
.nb-name {
  position: relative;
  align-self: flex-start;
  font-family: var(--font-display); font-size: 18px; line-height: 1.15; color: var(--ink);
}
.nb.next .nb-name { align-self: flex-end; }
.nb-sub { font-family: var(--font-serif); font-weight: var(--body-weight); font-style: italic; font-size: 12px; color: var(--muted); }

/* an underline that draws out from the centre: used on the neighbour links and the About ledgers */
.nb-name::after, .ledger-name::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);                               /* drawn out from the centre on hover */
  transition: transform .35s ease;
}
.nb:hover .nb-name::after, .nb:focus-visible .nb-name::after,
.ledger a:hover .ledger-name::after, .ledger a:focus-visible .ledger-name::after { transform: scaleX(1); }

/* swapping between neighbours */
#modal-body { transition: opacity .2s ease, transform .2s ease; }
.modal.swapping #modal-body { opacity: 0; transform: translateY(6px); }
.modal.swapping.swap-next #modal-body { transform: translateX(-24px); }
.modal.swapping.swap-prev #modal-body { transform: translateX(24px); }

/* ───────── Phones: the pop-up becomes a bottom sheet ───────── */

@media (pointer: coarse), (max-width: 760px) {
  .veil {
    place-items: end stretch;
    padding: 0;
  }
  .modal {
    width: 100%;
    height: 92vh;
    height: 92dvh;
    max-height: none;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    transform-origin: 50% 100%;
    transform: translateY(100%);
    opacity: 1;
    transition: transform .45s cubic-bezier(.2,.8,.2,1);
  }
  .veil.open .modal { transform: none; }
  .modal.dragging { transition: none; }
  .veil .modal[data-eye] { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }   /* (beats each eye's own corners) */
  .rule h3 { font-size: 17px; }
  .sheet-handle {
    display: block;
    position: absolute;
    top: 8px; left: 50%;
    z-index: 4;
    width: 44px; height: 5px;
    margin-left: -22px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--ink) 30%, transparent);
  }
  .modal-scroll {
    padding: 58px 16px calc(28px + env(safe-area-inset-bottom));
    touch-action: pan-y;
  }
  /* header as on desktop: the eye at the top, subtitle and title centred beneath it;
     the definition below reads left-aligned */
  .modal-head { text-align: center; }
  .modal-eye-wrap, .modal-eye { width: 104px; height: 104px; }
  .modal-eye-wrap { margin: 0 auto; }
  .modal-epithet { margin: 10px 0 0; }
  .modal h2 { font-size: 36px; margin: 4px 0 14px; }
  .modal-def { font-size: 16px; text-align: left; }
  .section-note { text-align: left; margin-left: 0; margin-right: 0; }
  .modal-head { margin-bottom: 8px; }
  .modal::before { height: 54px; background: linear-gradient(var(--modal-top, var(--panel-top)) 50%, transparent); }
  /* section headings sit on the left with a single rule trailing off */
  .rule { margin: 28px 0 12px; }
  .rule::before { display: none; }

  /* stories become compact rows: picture, title, hook, reading time */
  .cards { grid-template-columns: 1fr; gap: 10px; }
  .card {
    display: grid;
    grid-template-columns: 92px 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 0;
    align-items: start;
    align-content: start;
    min-height: 92px;
    height: auto;
    padding: 0;
    border-radius: 14px;
    background: linear-gradient(160deg, var(--card-top), var(--card-bottom));
  }
  .card::after { display: none; }
  .card img {
    position: static;
    /* the photo fills the whole height of its row, flush to the card's edge */
    grid-column: 1; grid-row: 1 / 4;
    align-self: stretch;
    width: 92px; height: 100%; min-height: 92px;
    border-radius: 0;
    filter: saturate(.85) brightness(.9);
  }
  .card > :not(img) { grid-column: 2; padding: 0 14px; }
  .card-title { font-size: 20px; text-shadow: none; padding-top: 10px !important; }
  .card-hook { margin-top: 3px; font-size: 14px; -webkit-line-clamp: 2; }
  .card-foot { margin: 4px 0 10px; padding-top: 0; border-top: 0; height: 18px; }
  .card-src, .card-go { top: 0; left: 14px; font-size: 12.5px; }
  .card:hover, .card:active { transform: none; }
  .card:active { border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
  .card > .card-new { grid-column: auto; padding: 4px 6px 3px; top: 6px; left: 6px; font-size: 9px; letter-spacing: .16em; }
  /* phones: just "New" on the photo (screen readers still hear "Newly entered") */
  .card-new-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .card-new-short { display: inline; }
  .card.is-pending { min-height: 84px; }
  /* a work in progress with no picture yet uses the full width */
  .card.is-pending:not(:has(img)) { grid-template-columns: 1fr; }
  .card.is-pending:not(:has(img)) > * { grid-column: 1; }
  .modal[data-eye="other"] .cards li:nth-child(n) .card { transform: none; }
  .modal[data-eye="rural"]::after { display: none; }

  .modal-neighbours { margin-top: 28px; }
  .nb-name { font-size: 16px; }
  .nb-sub { font-size: 11px; }
  .nb-eye { width: 34px; height: 34px; }
}

/* ───────── Each modal takes on its eye's character ───────── */

/* Fantasy — the Gilded Eye: double gold border, warm light from above */
.modal[data-eye="fantasy"] {
  border-color: color-mix(in srgb, var(--fantasy-accent) 55%, transparent);
  box-shadow:
    inset 0 0 0 6px color-mix(in srgb, var(--panel-edge) 90%, transparent),
    inset 0 0 0 7px color-mix(in srgb, var(--fantasy-accent) 35%, transparent),
    0 40px 120px color-mix(in srgb, var(--shadow) 85%, transparent),
    0 0 90px color-mix(in srgb, var(--fantasy-accent) 12%, transparent);
}
.modal[data-eye="fantasy"] .rule h3 { font-family: var(--font-display); font-style: normal; font-size: 22px; color: var(--fantasy-heading); }

/* Sci-Fi — the Unblinking Lens: faint scanlines, bracketed corners, terminal labels */
.modal[data-eye="scifi"] {
  border-color: color-mix(in srgb, var(--scifi-accent) 40%, transparent);
  border-radius: 10px;
  background:
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--scifi-accent) 3.5%, transparent) 0 1px, transparent 1px 4px),
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--scifi-accent) 10%, transparent), transparent 60%),
    linear-gradient(180deg, var(--scifi-bg-top), var(--scifi-bg-bottom) 60%);
}
.modal[data-eye="scifi"] .rule h3,
.modal[data-eye="scifi"] .card-src,
.modal[data-eye="scifi"] .card-go,
.modal[data-eye="scifi"] .modal-def .attr {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-style: normal;
  letter-spacing: .08em;
}
.modal[data-eye="scifi"] .rule h3::before { content: '> '; color: var(--accent); }
.modal[data-eye="scifi"] .card { border-radius: 4px; }

/* Historical — the Honor Guard: royal purple brocade, a double frame of gold and violet */
.modal[data-eye="historical"] {
  border-color: color-mix(in srgb, var(--historical-gold) 55%, transparent);
  background:
    /* a faint diamond brocade */
    repeating-linear-gradient(45deg, color-mix(in srgb, var(--historical-gold) 4%, transparent) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(-45deg, color-mix(in srgb, var(--historical-gold) 4%, transparent) 0 1px, transparent 1px 22px),
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--historical-accent) 20%, transparent), transparent 60%),
    linear-gradient(180deg, var(--historical-bg-top), var(--historical-bg-bottom) 60%);
  box-shadow:
    inset 0 0 0 7px color-mix(in srgb, var(--historical-bg-bottom) 70%, transparent),
    inset 0 0 0 8px color-mix(in srgb, var(--historical-gold) 35%, transparent),
    inset 0 0 0 12px color-mix(in srgb, var(--historical-bg-bottom) 70%, transparent),
    inset 0 0 0 13px color-mix(in srgb, var(--historical-accent) 30%, transparent),
    0 40px 120px color-mix(in srgb, var(--shadow) 85%, transparent),
    0 0 90px color-mix(in srgb, var(--historical-accent) 14%, transparent);
}
.modal[data-eye="historical"] .rule::before, .modal[data-eye="historical"] .rule::after { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--historical-gold) 45%, transparent), transparent); }
.modal[data-eye="historical"] .rule .tag { color: var(--historical-gold); }
.modal[data-eye="historical"] .card { border-color: color-mix(in srgb, var(--historical-gold) 22%, transparent); }
.modal[data-eye="historical"] .card img { filter: saturate(.75) brightness(.8) hue-rotate(-8deg); }
.modal[data-eye="historical"] .card:is(:hover, :focus-visible) img { filter: saturate(.95) brightness(.9); }

/* Other Fiction — the Common Clay: dark maroon, an edge that slowly shifts between reds */
.modal[data-eye="other"] {
  /* the edge's colour drifts in small steps (about 4 a second): too slow to notice, and it spares
     the browser repainting the whole sheet every frame */
  animation: capricious 14s steps(56) infinite;
  background:
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--other-accent) 16%, transparent), transparent 60%),
    linear-gradient(180deg, var(--other-bg-top), var(--other-bg-bottom) 60%);
}
.modal[data-eye="other"] .card img { filter: saturate(.8) brightness(.78) sepia(.1) hue-rotate(-10deg); }
.modal[data-eye="other"] .card:is(:hover, :focus-visible) img { filter: saturate(.95) brightness(.9) sepia(.05) hue-rotate(-10deg); }
@keyframes capricious {
  0%   { border-color: color-mix(in srgb, var(--other-accent) 55%, transparent); }
  25%  { border-color: color-mix(in srgb, var(--other-shift-1) 55%, transparent); }
  50%  { border-color: color-mix(in srgb, var(--other-shift-2) 55%, transparent); }
  75%  { border-color: color-mix(in srgb, var(--other-shift-3) 55%, transparent); }
  100% { border-color: color-mix(in srgb, var(--other-accent) 55%, transparent); }
}
.modal[data-eye="other"] .cards li:nth-child(odd) .card  { transform: rotate(-.5deg); }
.modal[data-eye="other"] .cards li:nth-child(even) .card { transform: rotate(.5deg); }
.modal[data-eye="other"] .cards li:nth-child(n) .card:hover,
.modal[data-eye="other"] .cards li:nth-child(n) .card:focus-visible { transform: rotate(0) translateY(-2px); }

/* Essays — the Vox Populi: a moonlit notebook page, faint ruled lines and a margin */
.modal[data-eye="essays"] {
  border-color: color-mix(in srgb, var(--essays-accent) 40%, transparent);
  background:
    linear-gradient(90deg, transparent 38px, color-mix(in srgb, var(--other-accent) 22%, transparent) 38px 39px, transparent 39px),
    repeating-linear-gradient(180deg, transparent 0 31px, color-mix(in srgb, var(--essays-accent) 7%, transparent) 31px 32px),
    radial-gradient(circle at 50% 95px, color-mix(in srgb, var(--moonlight) 13%, transparent), transparent 170px),
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--essays-accent) 12%, transparent), transparent 60%),
    linear-gradient(180deg, var(--essays-bg-top), var(--essays-bg-bottom) 60%);
}

.modal[data-eye="essays"] .card-hook { font-style: normal; }

/* Rural — the Wolf's Mother: moonlit pine forest, cool light, claw marks in the corner */
.modal[data-eye="rural"] {
  border-color: color-mix(in srgb, var(--rural-accent) 40%, transparent);
  background:
    radial-gradient(70% 45% at 80% 0%, color-mix(in srgb, var(--moonlight-cool) 12%, transparent), transparent 70%),
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--rural-accent) 10%, transparent), transparent 60%),
    linear-gradient(180deg, var(--rural-bg-top), var(--rural-bg-bottom) 60%);
  box-shadow:
    inset 0 0 0 8px color-mix(in srgb, var(--rural-bg-bottom) 70%, transparent),
    inset 0 0 0 9px color-mix(in srgb, var(--rural-accent) 16%, transparent),
    0 40px 120px color-mix(in srgb, var(--shadow) 85%, transparent);
}
.modal[data-eye="rural"]::after {
  content: '';
  position: absolute;
  right: 18px; bottom: 18px;
  width: 110px; height: 110px;
  pointer-events: none;
  background: var(--rural-accent);
  opacity: .22;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M30 20 Q52 52 66 98'/%3E%3Cpath d='M48 14 Q70 48 84 92'/%3E%3Cpath d='M66 10 Q88 42 100 84'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M30 20 Q52 52 66 98'/%3E%3Cpath d='M48 14 Q70 48 84 92'/%3E%3Cpath d='M66 10 Q88 42 100 84'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
.modal[data-eye="rural"] .card img { filter: saturate(.55) brightness(.74) hue-rotate(-8deg); }
.modal[data-eye="rural"] .card:is(:hover, :focus-visible) img { filter: saturate(.85) brightness(.86); }

/* ───────── Section headings: each pop-up's in its eye's own manner ─────────
   (Fantasy: gilded blackletter, above. Sci-Fi: terminal prompt, above.) */

/* Historical: ceremonial engraved capitals in pale violet, between two gold lozenges like its crest */
.modal[data-eye="historical"] .rule h3 {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-serif); font-style: normal; font-weight: 500;
  font-size: 15px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--historical-heading);
}
.modal[data-eye="historical"] .rule h3::before,
.modal[data-eye="historical"] .rule h3::after {
  content: ''; width: 7px; height: 7px; flex: none;
  background: var(--historical-gold); transform: rotate(45deg);
  box-shadow: 0 0 8px color-mix(in srgb, var(--historical-gold) 50%, transparent);
}

/* Essays: moonlit blackletter with a small crescent before it */
.modal[data-eye="essays"] .rule h3 {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-style: normal; font-size: 23px;
  color: var(--essays-heading);
  text-shadow: 0 0 14px color-mix(in srgb, var(--moonlight) 30%, transparent);
}
.modal[data-eye="essays"] .rule h3::before {
  content: ''; width: 12px; height: 12px; flex: none; border-radius: 50%;
  box-shadow: inset -3px -1px 0 0 var(--essays-heading);   /* a crescent: the lit edge of a dark disc */
  transform: rotate(-20deg);
}

/* Other Fiction: blackletter in its red, set a little askew like its tilted eye */
.modal[data-eye="other"] .rule h3 {
  font-family: var(--font-display); font-style: normal; font-size: 23px;
  color: var(--other-heading);
  transform: rotate(-2deg);
  text-shadow: 0 0 16px color-mix(in srgb, var(--other-accent) 45%, transparent);
}

/* Rural: lichen-green blackletter, with three claw marks raked after it */
.modal[data-eye="rural"] .rule h3 {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-style: normal; font-size: 23px;
  color: var(--rural-heading);
}
.modal[data-eye="rural"] .rule h3::after {
  content: ''; width: 16px; height: 14px; flex: none; opacity: .7;
  background: repeating-linear-gradient(115deg, transparent 0 3px, var(--rural-claws) 3px 4.2px, transparent 4.2px 6px);
  -webkit-mask: linear-gradient(180deg, transparent, #000 25%, #000 70%, transparent);
          mask: linear-gradient(180deg, transparent, #000 25%, #000 70%, transparent);
}

@media (pointer: coarse), (max-width: 760px) {
  .modal[data-eye="historical"] .rule h3 { font-size: 13px; letter-spacing: .24em; }
  .modal[data-eye="essays"] .rule h3,
  .modal[data-eye="other"] .rule h3,
  .modal[data-eye="rural"] .rule h3 { font-size: 21px; }
}


@media (prefers-reduced-motion: reduce) {
  .spin-slow, .spin-rev, .house-twinkle, .mini-ball, .orbit, .moon-phase, .aura, .corona, .swirl { animation: none; }
  .eye-link .thrum, .eye-link .filigree, .eye-link .crest, .eye-link .scan, .eye-link .ticks circle { animation: none !important; }
  .eye.awake .vox-ripple { animation: none; }
  .modal, .veil, .house-wrap, #modal-body { transition: none; }
  .modal[data-eye="other"] { animation: none; }
  /* the curtain simply fades instead of opening as a circle */
  .curtain { transition: opacity .25s ease; opacity: 1; -webkit-mask: none; mask: none; }
  .curtain.is-open { opacity: 0; transition-duration: .25s; }
  /* everything else: no springs, slides or zooms, just near-instant changes */
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* ───────── About page ───────── */

.about-page .stage { display: block; min-height: auto; padding: 0; }

.dossier {
  position: relative;
  z-index: 3;
  max-width: 680px;
  margin: 0 auto;
  padding: 120px 20px 120px;
}
.dossier .kicker {
  text-align: center;
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--bronze);
}
.dossier h1 {
  margin: 14px 0 10px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 9vw, 76px);
  line-height: .95;
}
.dossier h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 34px;
  margin: 64px 0 14px;
  color: var(--bronze-hi);
}
.dossier p, .dossier li {
  font-family: var(--font-serif);
  font-weight: var(--body-weight);
  font-size: var(--body-size);
  line-height: 1.65;
  color: var(--ink);
}
.dossier p { margin: 0 0 1.1em; }
.dossier a { color: var(--bronze-hi); text-decoration-color: color-mix(in srgb, var(--bronze-hi) 40%, transparent); text-underline-offset: 3px; transition: text-decoration-color .3s ease; }
.dossier a:hover, .dossier a:focus-visible { text-decoration-color: currentColor; }
.dossier figure {
  margin: 56px 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px color-mix(in srgb, var(--shadow) 70%, transparent);
}
.dossier figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1400 / 411;
  object-fit: cover;
}
@media (max-width: 640px) {
  /* a phone would show a thin strip: crop to a calmer shape, centred on the orb */
  .dossier figure img { aspect-ratio: 16 / 9; object-position: 48% 50%; }
}
.dossier .ledger { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.dossier .ledger li {
  display: flex; justify-content: space-between; align-items: center; gap: 6px 16px; flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
}
/* the grey secondary text: about 15% smaller, centred on the line */
.dossier .ledger li > span { color: var(--muted); font-style: italic; font-size: .85em; }
.ledger a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.ledger-name { position: relative; }
.ledger-name::after { background: var(--bronze-hi); }
@media (max-width: 760px) {
  .dossier figure { margin: 40px 0; }
}

/* ───────── Copy buttons (About: the email address and the bios) ───────── */
.petition-copy {
  font: 10.5px/1 var(--font-body); letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 14px 12px; min-height: 44px;            /* a comfortable tap area for a small label */
  transition: color .3s ease;
}
.petition-copy.shown { font: italic 14px/1 var(--font-serif); letter-spacing: 0; text-transform: none; user-select: all; }
.petition-copy:hover, .petition-copy:focus-visible, .petition-copy.done { color: var(--bronze-hi); }

/* ───────── About: the court record ───────── */

.record { padding-top: 110px; }
.record-head { text-align: center; margin-bottom: 56px; }
.docket {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
  max-width: 520px;
  margin: 28px auto 30px;
  text-align: left;
}
.docket div {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.docket dt {
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--bronze);
}
.docket dd {
  margin: 3px 0 0;
  font-family: var(--font-serif);
  font-weight: var(--body-weight);
  font-size: 17px;
  color: var(--ink);
}

.dossier .speaker {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 18px;
}

.transcript {
  list-style: none;
  counter-reset: line;
  margin: 0;
  padding: 0;
}
.transcript li {
  position: relative;
  counter-increment: line;
  padding-left: 0;
}
.transcript li::before {
  content: '§' counter(line);
  position: absolute;
  left: -52px;
  top: 6px;
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--muted);
}
.transcript li:first-child > p::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 92px;
  line-height: .8;
  padding: 6px 12px 0 0;
  color: var(--bronze-hi);
}
/* A margin note sits beside the top of the block it is in: a testimony <li>, a <div class="with-note">,
   or any element holding a note directly. (Without this it would pin itself to the top of the page.) */
.transcript li, .with-note { position: relative; }   /* the blocks a margin note can sit beside */
.note {
  position: absolute;
  left: calc(100% + 40px);
  top: 4px;
  width: 210px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  font-family: var(--font-serif);
  font-weight: var(--body-weight);
  font-style: italic;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.note b { font-style: normal; font-weight: 500; color: var(--bronze-hi); display: block; font-size: 13px; letter-spacing: .04em; }
.note span { color: var(--muted); }

.exhibit { position: relative; }
.exhibit-tag {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 1;
  padding: 5px 10px;
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--bronze-hi);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.exhibit figcaption {
  padding: 12px 16px;
  font-family: var(--font-serif);
  font-weight: var(--body-weight);
  font-style: italic;
  font-size: 15px;
  color: var(--muted);
  background: var(--card-bottom);
  border-top: 1px solid var(--line);
}
/* the Bench: each category's small eye in place of a number */
.bench .seat { display: inline-block; width: 26px; height: 26px; flex: none; }
.bench .seat .mini-eye { width: 26px; height: 26px; transition: transform .45s cubic-bezier(.3,1.4,.5,1); }
.bench a:hover .mini-eye, .bench a:focus-visible .mini-eye { transform: scale(1.15); }
.bench a:hover .mini-iris, .bench a:focus-visible .mini-iris { transform: translateX(3px); }

.adjourn { text-align: center; margin-top: 88px; }
.dossier .adjourn-note {
  margin: 6px 0 22px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  color: var(--muted);
}
/* the presiding eye, in the left margin */
.presiding {
  position: fixed;
  z-index: 4;
  top: 50%;
  left: max(24px, calc(50% - 340px - 250px));
  width: 200px;
  transform: translateY(-50%);
  text-align: center;
  text-decoration: none;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.presiding svg {
  width: 200px; height: 200px; display: block; overflow: visible;
  transition: transform 1.1s cubic-bezier(.2, .7, .2, 1);
}
/* its glow: a soft light behind it that fades in on hover. (A filter on the eye itself would be
   recomputed every frame, since the eye never stops moving.) */
.presiding::after {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: 100px; width: 230px; height: 230px; margin: -115px 0 0 -115px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--bronze-hi) 30%, transparent), color-mix(in srgb, var(--bronze-hi) 10%, transparent) 60%, transparent);
  opacity: 0; transition: opacity 1.1s ease;
}
.presiding:hover::after, .presiding:focus-visible::after { opacity: 1; }
.presiding-label {
  display: block;
  position: relative;
  margin: 8px 0 0;
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--muted);
}
.presiding-idle, .presiding-go { display: block; transition: opacity .35s ease; }
.presiding-go { position: absolute; inset: 0; opacity: 0; color: var(--bronze-hi); }
.presiding-short { display: none; }
/* hovered or focused: the eye leans in and glows, and its label says where it leads */
.presiding:hover svg, .presiding:focus-visible svg { transform: scale(1.05); }
.presiding:hover .presiding-idle, .presiding:focus-visible .presiding-idle { opacity: 0; }
.presiding:hover .presiding-go, .presiding:focus-visible .presiding-go { opacity: 1; }
.presiding:focus-visible svg { outline: 1px solid var(--bronze-hi); outline-offset: 2px; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .presiding svg { transition: none; } .presiding:hover svg { transform: none; } }

/* narrower screens: notes fall inline, the eye watches from the corner */
@media (max-width: 1240px) {
  .note {
    position: static;
    width: auto;
    margin: -4px 0 26px;
  }
  .transcript li::before { position: static; display: block; margin-bottom: 4px; }
  .presiding {
    top: max(10px, env(safe-area-inset-top)); left: auto; right: max(16px, env(safe-area-inset-right));
    width: 72px;
    transform: none;
  }
  .presiding svg { width: 72px; height: 72px; }
  .presiding::after { top: 36px; width: 96px; height: 96px; margin: -48px 0 0 -48px; }
  .presiding-label { margin-top: 2px; font-size: 9px; letter-spacing: .2em; }
  .presiding-idle, .presiding-go { display: none; }
  .presiding-short { display: inline-block; padding: 2px 6px; border-radius: 999px; background: color-mix(in srgb, var(--bg, #000) 78%, transparent); transition: opacity .45s ease; }
  .presiding.is-quiet .presiding-short { opacity: 0; }
  .presiding:focus-visible .presiding-short { opacity: 1; }
}
@media (max-width: 520px) {
  .docket { grid-template-columns: 1fr; }
}

/* ───────── 404 ───────── */

.lost {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 24px 16px;
  text-align: center;
}
.lost-eye { width: 140px; height: 140px; margin-bottom: 10px; }
.lost .kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--bronze);
}
.lost h1 {
  margin: 6px 0 4px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 7vw, 60px);
  line-height: 1;
}

/* shown only when JavaScript is off */
.noscript {
  position: relative;
  z-index: 3;
  max-width: 520px;
  margin: 0 auto 48px;
  padding: 0 16px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.noscript a { color: var(--bronze-hi); }


/* ───────── About on phones ───────── */

@media (pointer: coarse), (max-width: 760px) {
  .dossier { padding: calc(176px + env(safe-area-inset-top)) 18px calc(72px + env(safe-area-inset-bottom)); }
  .dossier p, .dossier li { font-size: var(--body-size-phone); }
  .dossier h1 { font-size: clamp(40px, 12vw, 56px); }
  .dossier h2 { font-size: 28px; margin-top: 48px; }
  .record-head { margin-bottom: 36px; }
  .docket { margin: 20px auto 22px; }
  .docket div { padding: 8px 0; }
  .docket dd { font-size: 16px; }
  /* Bench and Record: the subtitle sits under the name instead of squeezing beside it */
  .dossier .ledger li { flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 0; }
  .dossier .ledger li > span { padding-left: 36px; }
  .dossier .ledger:not(.bench) li > span { padding-left: 0; }
}

/* ───────── 404 illustration ───────── */

.lost-ring { fill: none; stroke: var(--bronze); stroke-opacity: .3; stroke-width: 1.2; }
.lost-socket { fill: var(--panel); stroke: var(--bronze); stroke-width: 4; }
.lost-lid { fill: none; stroke: var(--bronze); stroke-opacity: .7; stroke-width: 3; stroke-linecap: round; }
.lost-lashes { fill: none; stroke: var(--bronze); stroke-opacity: .5; stroke-width: 2; stroke-linecap: round; }




/* ───────── Phones: line structure ───────── */

@media (pointer: coarse), (max-width: 760px) {
  /* headings and short lines break into even lines rather than leaving one word behind */
  h1, h2, h3, .card-title, .modal-epithet, .preview-name, .nb-name, .docket dd { text-wrap: balance; }
  /* paragraphs avoid a single orphaned word on their last line */
  p, .card-hook, .note, .modal-def, .section-note, figcaption { text-wrap: pretty; hyphens: manual; }
  .dossier p, .dossier li { line-height: 1.6; }
  .modal-def, .section-note { line-height: 1.55; }
  .card-hook { line-height: 1.4; }
  .note { line-height: 1.5; }
}

/* ───────── About: For Petitioners, three wax seals ───────── */
.summons .seals {
  list-style: none; margin: 34px 0 0; padding: 30px 0 4px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 40px;
  border-top: 1px solid var(--line);
}
.seal-item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; flex: 0 1 auto; min-width: 150px; }
.seal { display: flex; flex-direction: column; align-items: center; text-decoration: none; padding: 6px 4px; border-radius: 12px; }
.seal-text { display: flex; flex-direction: column; align-items: center; }
.seal-verb { font-size: 10.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.seal-name { margin-top: 4px; font-family: var(--font-display); font-size: 18px; line-height: 1.1; color: var(--bronze-hi); }
.seal-sub { margin-top: 4px; font: italic var(--body-weight) 13.5px/1.3 var(--font-serif); color: var(--muted); }
/* hover: the seal presses in and warms */
.seal:hover .seal-disc, .seal:focus-visible .seal-disc {
  transform: scale(.95);
  box-shadow: 0 0 0 1px var(--bronze-hi), 0 0 22px color-mix(in srgb, var(--bronze-hi) 35%, transparent), inset 0 2px 8px color-mix(in srgb, var(--shadow) 80%, transparent);
}
.seal:hover .seal-disc svg, .seal:focus-visible .seal-disc svg { opacity: 1; }
.seal:hover .seal-sub, .seal:focus-visible .seal-sub { color: var(--ink-soft); }
.seal-item .petition-copy { margin-top: 0; }

/* ───────── About: "For the Record", a fold-out with the bios and credits ─────────
   A bronze-edged dossier panel that stands apart from the testimony around it. */
.record-fold {
  position: relative; margin: 28px 0 48px;   /* close under For Petitioners */
  border: 1px solid color-mix(in srgb, var(--bronze) 55%, transparent); border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bronze) 9%, transparent), transparent 140px),
    color-mix(in srgb, var(--panel) 72%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--bg) 80%, transparent), 0 0 0 5px color-mix(in srgb, var(--bronze) 22%, transparent), 0 18px 40px color-mix(in srgb, var(--shadow) 60%, transparent);
  transition: box-shadow .4s ease, border-color .4s ease;
}
.record-fold:hover, .record-fold[open] { border-color: color-mix(in srgb, var(--bronze-hi) 70%, transparent); }
.record-fold summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 16px;
  padding: 20px 22px; min-height: 44px;
}
.record-fold summary::-webkit-details-marker { display: none; }
.fold-seal svg { width: 46px; height: 46px; display: block; transition: transform .45s cubic-bezier(.3,1.4,.5,1); }
.record-fold summary:hover .fold-seal svg, .record-fold summary:focus-visible .fold-seal svg { transform: scale(1.08); }
.fold-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.dossier .fold-title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1; color: var(--bronze-hi); }   /* a real heading (h2), sized for the panel */
.fold-sub { font: italic var(--body-weight) 14.5px/1.3 var(--font-serif); color: var(--ink-soft); }
.fold-hint {
  flex: none; font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--bronze-hi);
  padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--bronze) 50%, transparent); border-radius: 999px;
}
.record-fold[open] .fold-hint { font-size: 0; }
.record-fold[open] .fold-hint::after { content: 'Close'; font-size: 10.5px; }
.fold-body { padding: 4px 22px 24px; border-top: 1px solid var(--line); }
.fold-body p { margin: 0 0 10px; }
.fold-body .petition-copy { padding-left: 0; }
.record-fold .ledger a { min-height: 44px; }        /* a comfortable tap target */
@media (max-width: 640px) {
  .record-fold summary { padding: 16px; gap: 12px; }
  .fold-seal svg { width: 38px; height: 38px; }
  .dossier .fold-title { font-size: 24px; }
  .fold-hint { display: none; }
  .fold-body { padding: 4px 16px 20px; }
}
@media (prefers-reduced-motion: reduce) { .fold-seal svg { transition: none; } }

/* phones: the seals become a tidy list, one per row: the disc on the left, its words beside it */
@media (max-width: 640px) {
  .summons .seals { flex-direction: column; flex-wrap: nowrap; gap: 0; padding-top: 6px; margin-top: 26px; }
  .seal-item { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 12px; padding: 12px 0; border-bottom: 1px solid var(--line); text-align: left; }
  .seal { flex-direction: row; align-items: center; gap: 14px; flex: 1; min-width: 0; padding: 2px 0; }
  .seal-disc { width: 46px; height: 46px; margin: 0; flex: none; }
  .seal-disc svg { width: 20px; height: 20px; }
  .seal-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
  .seal-verb { font-size: 9.5px; letter-spacing: .2em; }
  .seal-name { margin-top: 2px; font-size: 17px; }
  .seal-sub { margin-top: 1px; font-size: 12.5px; }
  .seal-item .petition-copy { flex-basis: 100%; text-align: left; margin-left: 60px; padding: 10px 0 6px; min-height: 44px; font-size: 9.5px; letter-spacing: .16em; }
}


/* About, Seated at the Bench: the whole row is the link, and the row lights up */
.bench li { position: relative; }
/* the link stretches over the row; its highlight is a soft rounded glow that reaches a little
   past the text on both sides, rather than a hard band cut off at the text's edges */
.bench a::before {
  content: ''; position: absolute; inset: 0 -12px;   /* reaches a little past the row, but stays inside the page margin */
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bronze-hi) 11%, transparent) 18%, color-mix(in srgb, var(--bronze-hi) 11%, transparent) 82%, transparent);
  opacity: 0; transition: opacity .35s ease;
}
.bench li:hover a::before, .bench a:focus-visible::before { opacity: 1; }
.bench li:hover > span { color: var(--ink-soft); }

/* For the Record: section headings in the display face, so they don't read like the Copy buttons */
.fold-body h3 {
  display: flex; align-items: center; gap: 12px;
  margin: 28px 0 10px; font: 400 21px/1.1 var(--font-display); letter-spacing: 0; text-transform: none; color: var(--bronze-hi);
}
.fold-body h3::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, color-mix(in srgb, var(--bronze) 45%, transparent), transparent); }

/* works in progress aren't links, so their footer label stays put on hover */
.card.is-pending:hover .card-src, .card.is-pending:focus-visible .card-src { opacity: 1; transform: none; }

/* For the Record: a small engraved icon before each credit */
.credit-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; box-shadow: 0 0 0 1px color-mix(in srgb, var(--bronze) 50%, transparent); }
.credit-icon svg { width: 18px; height: 18px; fill: none; stroke: var(--bronze-hi); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: .85; transition: transform .45s cubic-bezier(.3,1.4,.5,1), opacity .3s ease; }
.ledger a:hover .credit-icon svg, .ledger a:focus-visible .credit-icon svg { transform: scale(1.12); opacity: 1; }

/* narrow screens: the eye in the corner sits in a soft pool of darkness, so text scrolling beneath it stays out of the way */
@media (max-width: 1240px) {
  .presiding::before {
    content: ''; position: absolute; inset: -12px -8px -10px; z-index: -1; border-radius: 50%;
    background: radial-gradient(closest-side, var(--bg) 55%, color-mix(in srgb, var(--bg) 70%, transparent) 75%, transparent);
    pointer-events: none;
  }
}


@media (max-width: 760px) { .bench a::before { inset: 0; } }
