/* ════════════════════════════════════════════════════════════════════
   ARTICLE III — The Bill of Rights of the Philippines
   A statute book, set on paper. Ink, narra, brass, banker's green.
   ════════════════════════════════════════════════════════════════════ */

/* ── reset ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; background: none; border: 0; }
button { cursor: pointer; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* ── the materials ────────────────────────────────────────────────── */
:root {
  --paper:      #F5F0E4;   /* aged ivory */
  --paper-2:    #EFE8D6;   /* deeper leaf */
  --paper-3:    #FBF8EF;   /* the statute block — brightest, like fresh stock */
  --ink:        #23201B;
  --ink-2:      #4F4A40;
  --ink-3:      #837C6D;
  --hairline:   rgba(35, 32, 27, .16);
  --hairline-2: rgba(35, 32, 27, .09);

  --narra:      #6E4A26;   /* the bench */
  --brass:      #8C6A28;   /* matte, engraved — never neon */
  --brass-2:    #B08D3E;
  --green:      #29503E;   /* banker's lamp */
  --oxblood:    #703029;   /* law-book spine */

  --cell:       #17150F;   /* the prologue's darkness */
  --cell-ink:   #D8D2C2;

  --f-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --f-text:    'Newsreader', 'Iowan Old Style', Georgia, serif;
  --f-ui:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --e-out: cubic-bezier(.22, 1, .36, 1);

  --gutter: clamp(20px, 4vw, 56px);
  --toc-w: 264px;
}

html, body { background: var(--paper); }
body {
  color: var(--ink);
  font-family: var(--f-text);
  font-size: 17px;
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html.is-locked { overflow: hidden; }

/* laid paper: faint grain under everything */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.skip {
  position: fixed; top: -60px; left: 16px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: var(--paper);
  font-family: var(--f-ui); font-size: 13px; border-radius: 0 0 8px 8px;
  transition: top .2s;
}
.skip:focus { top: 0; }

/* ════════════════════════════════════════════════════════════════════
   MASTHEAD
   ════════════════════════════════════════════════════════════════════ */
.masthead {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(14px, 2.5vw, 28px);
  height: 56px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .4s;
}
.scrolled .masthead { border-color: var(--hairline-2); }
.mast__mark { display: flex; align-items: baseline; gap: 10px; }
.mast__mark b {
  font-family: var(--f-display); font-weight: 500; font-size: 19px;
  letter-spacing: .14em; color: var(--narra);
}
.mast__mark span {
  font-family: var(--f-ui); font-size: 10.5px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3);
}
.mast__progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
}
.mast__progress i {
  display: block; height: 100%;
  background: var(--brass);
  transform-origin: left; transform: scaleX(0);
}
.mast__nav { display: flex; align-items: center; gap: 4px; }
.mast__read {
  font-family: var(--f-ui); font-size: 11px; font-weight: 600;
  letter-spacing: .1em; color: var(--green);
  padding: 5px 10px; margin-right: 6px;
  border: 1px solid color-mix(in srgb, var(--green) 30%, transparent);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.mast__nav button {
  font-family: var(--f-ui); font-size: 12.5px; font-weight: 550;
  letter-spacing: .04em; color: var(--ink-2);
  padding: 8px 12px; border-radius: 8px;
  transition: color .25s, background .25s;
}
.mast__nav button:hover { color: var(--ink); background: rgba(35,32,27,.06); }
.mast__toc { display: none; }
.mast__toc svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* ════════════════════════════════════════════════════════════════════
   THE INDEX RAIL
   ════════════════════════════════════════════════════════════════════ */
.toc {
  position: fixed; z-index: 20;
  top: 56px; bottom: 0; left: 0;
  width: var(--toc-w);
  padding: 28px 20px 24px clamp(14px, 2vw, 26px);
  overflow-y: auto;
  border-right: 1px solid var(--hairline-2);
  scrollbar-width: thin; scrollbar-color: var(--hairline) transparent;
}
.toc::-webkit-scrollbar { width: 5px; }
.toc::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 3px; }

.toc__label {
  font-family: var(--f-ui); font-size: 10px; font-weight: 650;
  letter-spacing: .3em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 14px;
}
.toc__group { margin: 14px 0; }
.toc__movement {
  display: block;
  font-family: var(--f-ui); font-size: 10.5px; font-weight: 650;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2);
  padding: 4px 8px 4px 0; margin-bottom: 2px;
  border-bottom: 1px solid var(--hairline-2);
  transition: color .25s;
}
.toc__movement:hover { color: var(--narra); }
.toc__item {
  position: relative;
  display: flex; align-items: baseline; gap: 8px;
  padding: 3.5px 8px;
  border-radius: 6px;
  font-family: var(--f-ui); font-size: 12.5px; color: var(--ink-2);
  transition: background .2s, color .2s;
}
.toc__item:hover { background: rgba(35,32,27,.055); color: var(--ink); }
.toc__item--front { font-style: italic; font-family: var(--f-text); font-size: 13.5px; margin: 4px 0; }
.toc__n {
  flex: none; width: 30px;
  font-weight: 600; font-size: 11.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.toc__t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc__tick {
  flex: none; width: 12px; height: 12px; align-self: center;
  fill: none; stroke: var(--green); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transition: opacity .3s;
}
.toc__item.is-read .toc__tick { opacity: 1; }
.toc__item.is-read .toc__n { color: var(--green); }
.toc__item.is-current {
  background: color-mix(in srgb, var(--brass) 12%, transparent);
  color: var(--ink);
}
.toc__item.is-current .toc__n { color: var(--brass); }
.toc__progress { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--hairline-2); }
.toc__progress span {
  font-family: var(--f-ui); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
}
.toc__progress i {
  display: block; height: 3px; margin-top: 8px;
  background: var(--hairline-2); border-radius: 2px; overflow: hidden;
}
.toc__progress b { display: block; height: 100%; background: var(--green); transition: width .5s var(--e-out); }
.toc-scrim { display: none; }

/* ════════════════════════════════════════════════════════════════════
   THE DOCUMENT
   ════════════════════════════════════════════════════════════════════ */
.doc {
  position: relative; z-index: 1;
  margin-left: var(--toc-w);
  padding: 56px var(--gutter) 0;
}
.doc > section { max-width: 860px; margin-inline: auto; }

/* gentle reveals — paper settling, nothing flying */
.will-reveal { opacity: 0; transform: translateY(14px); }
.will-reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .7s var(--e-out), transform .7s var(--e-out);
}

/* ── title page ───────────────────────────────────────────────────── */
.frontis {
  min-height: calc(100svh - 56px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: clamp(40px, 7vh, 90px) 0;
}
.frontis__rule {
  width: min(420px, 70%); height: 1px; background: var(--hairline);
  position: relative; margin: 26px 0;
}
.frontis__rule::after {
  content: ''; position: absolute; left: 50%; top: -2.5px;
  width: 6px; height: 6px; transform: translateX(-50%) rotate(45deg);
  background: var(--brass);
}
.frontis__rule--top { margin-bottom: 34px; }
.frontis__state {
  font-family: var(--f-ui); font-size: 11px; font-weight: 550;
  letter-spacing: .34em; text-transform: uppercase; color: var(--ink-2);
}
.frontis__seal { color: var(--brass); margin: 34px 0 10px; }
.frontis__title {
  font-family: var(--f-display); font-weight: 300; line-height: 1;
  display: grid; justify-items: center;
}
.frontis__title span {
  font-size: clamp(17px, 2.2vw, 24px);
  letter-spacing: .5em; text-indent: .5em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 10px;
}
.frontis__title b {
  font-size: clamp(96px, 17vw, 190px);
  font-weight: 400;
  font-variation-settings: 'opsz' 144;
  letter-spacing: .06em; text-indent: .06em;
  color: var(--ink);
}
.frontis__sub {
  font-family: var(--f-display); font-style: italic; font-weight: 350;
  font-size: clamp(24px, 3.4vw, 40px);
  color: var(--narra);
  margin-top: 12px;
}
.frontis__desc {
  max-width: 46ch; margin-top: 22px;
  font-size: 17.5px; line-height: 1.6; color: var(--ink-2);
  text-wrap: pretty;
}
.frontis__meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
  margin-top: 24px;
  font-family: var(--f-ui); font-size: 10.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-3);
}
.frontis__meta i { width: 3px; height: 3px; background: var(--brass); transform: rotate(45deg); }
.frontis__begin {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 6px;
  font-family: var(--f-ui); font-size: 13px; font-weight: 600; letter-spacing: .05em;
  color: var(--narra);
  padding: 12px 24px;
  border: 1px solid color-mix(in srgb, var(--narra) 36%, transparent);
  border-radius: 999px;
  transition: background .3s, border-color .3s, transform .3s var(--e-out);
}
.frontis__begin:hover {
  background: color-mix(in srgb, var(--narra) 7%, transparent);
  border-color: var(--narra);
  transform: translateY(-1px);
}
.frontis__begin svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ── the cell ─────────────────────────────────────────────────────── */
.cell {
  position: relative;
  max-width: none !important;
  margin: clamp(48px, 8vh, 96px) calc(var(--gutter) * -1) 0;
  background: var(--cell);
  color: var(--cell-ink);
  overflow: hidden;
}
/* light through bars, falling across the concrete */
.cell__bars {
  position: absolute; inset: -10% -5%;
  background: repeating-linear-gradient(
    104deg,
    transparent 0 90px,
    rgba(214, 196, 150, .05) 90px 118px,
    rgba(214, 196, 150, .10) 118px 128px,
    rgba(214, 196, 150, .05) 128px 156px,
    transparent 156px 260px
  );
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .cell__bars { animation: barsDrift 60s linear infinite alternate; }
  @keyframes barsDrift { from { transform: translateX(-2%); } to { transform: translateX(2%); } }
}
.cell__inner {
  position: relative;
  max-width: 820px; margin-inline: auto;
  padding: clamp(64px, 10vh, 120px) var(--gutter) clamp(72px, 10vh, 130px);
}
.cell__emblem { width: 64px; color: var(--brass-2); opacity: .8; margin-bottom: 26px; }
.cell__label {
  font-family: var(--f-ui); font-size: 10.5px; font-weight: 550;
  letter-spacing: .32em; text-transform: uppercase; color: rgba(216,210,194,.55);
}
.cell__title {
  font-family: var(--f-display); font-weight: 300;
  font-size: clamp(30px, 4.6vw, 52px); line-height: 1.08;
  color: #F2EDDF;
  margin-top: 14px;
  max-width: 18ch;
}
.cell__lead {
  font-size: clamp(17px, 2vw, 20px); font-style: italic;
  color: rgba(216,210,194,.85);
  max-width: 44ch;
  margin-top: 18px;
}
.timeline { margin-top: clamp(40px, 6vh, 64px); display: grid; gap: clamp(34px, 5vh, 52px); }
.beat {
  display: grid; grid-template-columns: 150px 1fr; gap: 24px;
  align-items: start;
}
.beat__date {
  font-family: var(--f-ui); font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--brass-2);
  padding-top: 6px;
  text-align: right;
  border-right: 1px solid rgba(176,141,62,.35);
  padding-right: 18px;
  line-height: 1.7;
}
.beat--turn .beat__date { color: #C79A45; }
.beat--light .beat__date { color: #E3C87E; }
.beat__body h3 {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(19px, 2.3vw, 25px); line-height: 1.2;
  color: #EFE9D8;
}
.beat__body p {
  margin-top: 8px;
  font-size: 16.5px; line-height: 1.7;
  color: rgba(216,210,194,.82);
  max-width: 58ch;
  text-wrap: pretty;
}
.beat__body strong { color: #F2EDDF; font-weight: 600; }
.beat__body em { color: #EFE9D8; }
.beat--light .beat__body h3 { color: #F7EFD8; }

/* ── chapters ─────────────────────────────────────────────────────── */
.chapter { padding-top: clamp(64px, 10vh, 110px); }
.chapter__head {
  text-align: center;
  padding-bottom: clamp(28px, 4vh, 44px);
  margin-bottom: clamp(28px, 4vh, 44px);
  position: relative;
}
.chapter__head::after {
  content: ''; position: absolute; left: 50%; bottom: 0;
  width: 240px; height: 1px; transform: translateX(-50%);
  background: var(--hairline);
}
.chapter__emblem {
  width: 76px; margin: 0 auto 18px;
  color: var(--narra);
}
.chapter__count {
  font-family: var(--f-ui); font-size: 10.5px; font-weight: 550;
  letter-spacing: .3em; text-transform: uppercase; color: var(--ink-3);
}
.chapter__title {
  font-family: var(--f-display); font-weight: 350;
  font-size: clamp(28px, 4vw, 44px); line-height: 1.1;
  margin-top: 10px;
}
.chapter__blurb {
  font-style: italic; font-size: 17px; color: var(--ink-2);
  max-width: 52ch; margin: 12px auto 0;
}

/* ── a section of law ─────────────────────────────────────────────── */
.law { padding: clamp(36px, 6vh, 60px) 0; scroll-margin-top: 66px; }
.law + .law { border-top: 1px solid var(--hairline-2); }

.law__no { display: flex; align-items: baseline; justify-content: space-between; }
.law__sec {
  font-family: var(--f-ui); font-size: 11px; font-weight: 650;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--brass);
}
.law__roman {
  font-family: var(--f-display); font-weight: 300;
  font-size: 30px; line-height: 1;
  color: var(--hairline);
}
.law__title {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(26px, 3.2vw, 36px); line-height: 1.12;
  letter-spacing: -.005em;
  margin-top: 10px;
}
.law__kicker {
  font-style: italic; font-size: 16.5px; color: var(--ink-2);
  margin-top: 8px;
}

/* the statute block — the law itself, set like the gazette */
.statute {
  margin-top: 26px;
  background: var(--paper-3);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--narra);
  padding: 22px 28px 24px;
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 10px 28px -22px rgba(35,32,27,.5);
}
.statute__label {
  font-family: var(--f-ui); font-size: 9.5px; font-weight: 650;
  letter-spacing: .3em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 12px;
}
.statute__p {
  font-size: 18.5px; line-height: 1.72;
  font-variation-settings: 'opsz' 22;
  text-wrap: pretty;
}
.statute__p + .statute__p { margin-top: 12px; }
.statute__p--marked { position: relative; padding-left: 2.6em; }
.statute__p--marked b {
  position: absolute; left: 0; top: .35em;
  font-family: var(--f-ui); font-size: 12px; font-weight: 650;
  color: var(--narra);
  font-variant-numeric: tabular-nums;
}
.statute__note {
  margin-top: 16px; padding-top: 12px;
  border-top: 1px dashed var(--hairline);
  font-size: 14px; line-height: 1.6; color: var(--ink-2);
}
.statute__note span {
  display: block;
  font-family: var(--f-ui); font-size: 9.5px; font-weight: 650;
  letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 4px;
}

/* commentary — the annotations around the statute */
.notes {
  margin-top: 30px;
  display: grid; gap: 26px 40px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.note-block--wide { grid-column: 1 / -1; }
.note-block h4 {
  font-family: var(--f-ui); font-size: 10.5px; font-weight: 650;
  letter-spacing: .26em; text-transform: uppercase;
  color: var(--green);
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.note-block h4::after { content: ''; flex: 1; height: 1px; background: var(--hairline-2); }
.note-block > p { font-size: 16.5px; line-height: 1.7; color: var(--ink-2); text-wrap: pretty; }
.note-block em { color: var(--ink); }
.note-block strong { color: var(--ink); font-weight: 600; }

.doctrine-list { counter-reset: doc; display: grid; gap: 12px; }
.doctrine-list li {
  counter-increment: doc;
  position: relative;
  padding-left: 40px;
  font-size: 16px; line-height: 1.65; color: var(--ink-2);
  text-wrap: pretty;
}
.doctrine-list li::before {
  content: counter(doc, decimal-leading-zero);
  position: absolute; left: 0; top: .2em;
  font-family: var(--f-ui); font-size: 11px; font-weight: 650;
  color: var(--brass);
  font-variant-numeric: tabular-nums;
}
.doctrine-list b { color: var(--ink); font-weight: 600; }
.doctrine-list em { color: var(--ink); }

.case-list { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.case-list li { padding-left: 14px; border-left: 2px solid var(--hairline); }
.case-list__name { font-size: 16px; line-height: 1.4; }
.case-list__name i { font-style: italic; }
.case-list__name span {
  font-family: var(--f-ui); font-style: normal;
  font-size: 10px; font-weight: 650; letter-spacing: .1em;
  color: var(--oxblood);
  margin-left: 8px; padding: 1.5px 7px;
  border: 1px solid color-mix(in srgb, var(--oxblood) 32%, transparent);
  border-radius: 4px;
  white-space: nowrap; vertical-align: 2px;
}
.case-list__holding { margin-top: 4px; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }

.note-block--callout {
  background: var(--paper-2);
  border: 1px solid var(--hairline-2);
  padding: 18px 20px;
}
.note-block--callout h4 { color: var(--narra); }
.note-block--limit h4 { color: var(--oxblood); }
.note-block--callout > p { font-size: 15.5px; }

.law__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 28px;
}
.markread {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--f-ui); font-size: 12.5px; font-weight: 600;
  color: var(--ink-3);
  padding: 9px 16px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  transition: color .3s, border-color .3s, background .3s;
}
.markread svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: .5; }
.markread:hover { color: var(--ink); border-color: var(--ink-3); }
.markread[aria-pressed="true"] {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 42%, transparent);
  background: color-mix(in srgb, var(--green) 7%, transparent);
}
.markread[aria-pressed="true"] svg { opacity: 1; }
.law__cite {
  font-family: var(--f-ui); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
}

/* ── closing ──────────────────────────────────────────────────────── */
.closing {
  text-align: center;
  padding: clamp(80px, 12vh, 140px) 0 clamp(60px, 9vh, 100px);
  margin-top: clamp(60px, 9vh, 100px);
  border-top: 1px solid var(--hairline);
}
.closing__seal { color: var(--brass); display: inline-flex; justify-content: center; margin-bottom: 20px; }
.closing__label {
  font-family: var(--f-ui); font-size: 10.5px; font-weight: 550;
  letter-spacing: .3em; text-transform: uppercase; color: var(--ink-3);
}
.closing__title {
  font-family: var(--f-display); font-weight: 350;
  font-size: clamp(28px, 4.4vw, 46px); line-height: 1.1;
  margin: 12px auto 34px;
}
.closing__notes {
  display: grid; gap: 18px 34px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  text-align: left;
}
.closing__note { padding-left: 16px; border-left: 2px solid var(--hairline); }
.closing__note h3 {
  font-family: var(--f-display); font-weight: 500;
  font-size: 17.5px; line-height: 1.35;
  margin-bottom: 6px;
}
.closing__note p { font-size: 15px; line-height: 1.65; color: var(--ink-2); text-wrap: pretty; }
.closing__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 44px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-ui); font-size: 13.5px; font-weight: 600; letter-spacing: .02em;
  padding: 13px 26px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--ink-2);
  transition: color .3s, border-color .3s, background .3s, transform .3s var(--e-out);
}
.btn:hover { color: var(--ink); border-color: var(--ink-3); transform: translateY(-1px); }
.btn--primary {
  color: var(--paper-3);
  background: var(--green);
  border-color: var(--green);
}
.btn--primary:hover { background: #1F4232; border-color: #1F4232; color: #fff; }

.colophon {
  max-width: 62ch; margin: 56px auto 0;
  padding-top: 26px; border-top: 1px solid var(--hairline-2);
}
.colophon p { font-size: 13.5px; line-height: 1.75; color: var(--ink-3); }
.colophon__dedication {
  margin-top: 16px; font-style: italic;
  font-size: 14.5px !important; color: var(--ink-2) !important;
}

/* ════════════════════════════════════════════════════════════════════
   OVERLAYS — paper modals
   ════════════════════════════════════════════════════════════════════ */
#overlays { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.overlay { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .35s var(--e-out), visibility .35s; }
.overlay.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.overlay__scrim { position: absolute; inset: 0; background: rgba(35,32,27,.42); }
.overlay__panel {
  position: absolute; inset: clamp(10px, 4vh, 48px) clamp(10px, 5vw, 80px);
  max-width: 1080px; margin-inline: auto;
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--hairline);
  box-shadow: 0 30px 80px -30px rgba(35,32,27,.55);
  transform: translateY(10px);
  transition: transform .4s var(--e-out);
}
.overlay.is-open .overlay__panel { transform: none; }
.overlay__head {
  flex: none;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 26px clamp(20px, 3vw, 36px) 20px;
  border-bottom: 1px solid var(--hairline-2);
}
.overlay__head > div { min-width: 0; }
.overlay__head h2 {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(22px, 2.6vw, 30px); line-height: 1.15;
}
.overlay__head p { margin-top: 6px; font-size: 14.5px; color: var(--ink-2); max-width: 62ch; }
.overlay__x {
  flex: none; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--hairline); color: var(--ink-2);
  transition: color .3s, border-color .3s, transform .3s;
}
.overlay__x:hover { color: var(--ink); border-color: var(--ink-3); transform: rotate(90deg); }
.overlay__x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.overlay__body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 24px clamp(20px, 3vw, 36px) 36px;
  scrollbar-width: thin; scrollbar-color: var(--hairline) transparent;
}
.overlay__body::-webkit-scrollbar { width: 6px; }
.overlay__body::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 3px; }

/* index overlay */
.map__filter {
  position: sticky; top: -24px; z-index: 2;
  display: flex; align-items: center; gap: 12px;
  margin: -24px -8px 20px; padding: 16px 8px 12px;
  background: linear-gradient(180deg, var(--paper) 78%, transparent);
}
.map__filter svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 1.7; stroke-linecap: round; }
.map__filter input {
  flex: 1; padding: 11px 14px;
  border: 1px solid var(--hairline);
  background: var(--paper-3);
  font-family: var(--f-ui); font-size: 14px; color: var(--ink);
}
.map__filter input:focus { border-color: var(--brass); outline: none; }
.map__filter input::placeholder { color: var(--ink-3); }
.map__count { font-family: var(--f-ui); font-size: 11px; letter-spacing: .14em; color: var(--ink-3); min-width: 60px; text-align: right; }
.map__grid { display: grid; gap: 26px; }
.mapgrp[hidden] { display: none; }
.mapgrp__head { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline; margin-bottom: 10px; }
.mapgrp__dot { width: 7px; height: 7px; background: var(--c2, var(--brass)); transform: rotate(45deg); grid-row: span 2; align-self: center; }
.mapgrp__head h3 { font-family: var(--f-ui); font-size: 11.5px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; }
.mapgrp__head p { font-size: 13.5px; font-style: italic; color: var(--ink-3); grid-column: 2; }
.mapgrp__cards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.mapcard {
  display: flex; align-items: flex-start; gap: 14px; text-align: left;
  padding: 13px 15px;
  border: 1px solid var(--hairline-2);
  background: var(--paper-3);
  transition: border-color .25s, transform .25s var(--e-out), box-shadow .25s;
}
.mapcard[hidden] { display: none; }
.mapcard:hover {
  border-color: var(--brass);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -14px rgba(35,32,27,.5);
}
.mapcard__roman {
  flex: none; min-width: 36px;
  font-family: var(--f-display); font-weight: 300; font-size: 20px;
  color: var(--narra); line-height: 1.2;
}
.mapcard__body { display: grid; gap: 2px; min-width: 0; }
.mapcard__body b { font-family: var(--f-ui); font-size: 9.5px; font-weight: 650; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); }
.mapcard__body i { font-style: normal; font-size: 15px; font-weight: 500; line-height: 1.3; }
.mapcard__body em { font-size: 13px; font-style: italic; line-height: 1.45; color: var(--ink-3); }

/* quiz overlay */
.overlay--quiz .overlay__body { display: grid; align-content: start; }
.quiz { max-width: 720px; margin-inline: auto; width: 100%; }
.quiz__progress { height: 2px; background: var(--hairline-2); margin-bottom: 30px; }
.quiz__progress i { display: block; height: 100%; background: var(--brass); transform-origin: left; transform: scaleX(0); transition: transform .5s var(--e-out); }
.quiz__q {
  font-size: clamp(18px, 2.2vw, 22px); line-height: 1.55;
  margin-bottom: 26px;
}
.quiz__options { display: grid; gap: 9px; }
.quiz__opt {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 14px 17px;
  border: 1px solid var(--hairline);
  background: var(--paper-3);
  font-size: 15.5px;
  transition: border-color .25s, background .25s, transform .25s var(--e-out);
}
.quiz__opt:not(:disabled):hover { border-color: var(--brass); transform: translateX(3px); }
.quiz__key {
  display: grid; place-items: center; flex: none;
  width: 26px; height: 26px;
  border: 1px solid var(--hairline);
  font-family: var(--f-ui); font-size: 11px; font-weight: 650; color: var(--ink-3);
}
.quiz__opt.is-right { border-color: var(--green); background: color-mix(in srgb, var(--green) 8%, var(--paper-3)); }
.quiz__opt.is-right .quiz__key { border-color: var(--green); color: var(--green); }
.quiz__opt.is-wrong { border-color: var(--oxblood); background: color-mix(in srgb, var(--oxblood) 7%, var(--paper-3)); }
.quiz__opt.is-wrong .quiz__key { border-color: var(--oxblood); color: var(--oxblood); }
.quiz__opt:disabled { cursor: default; }
.quiz__why {
  margin-top: 20px; padding: 16px 20px;
  border-left: 3px solid var(--brass);
  background: var(--paper-2);
  font-size: 15px; line-height: 1.66; color: var(--ink-2);
}
.quiz__verdict {
  font-family: var(--f-ui); font-size: 10.5px; font-weight: 650;
  letter-spacing: .26em; text-transform: uppercase; margin-bottom: 7px;
}
.quiz__verdict.ok { color: var(--green); }
.quiz__verdict.no { color: var(--oxblood); }
.quiz__why em { color: var(--ink); }
.quiz__jump {
  display: inline-block; margin-top: 12px;
  font-family: var(--f-ui); font-size: 12.5px; font-weight: 600;
  color: var(--narra);
  border-bottom: 1px solid color-mix(in srgb, var(--narra) 40%, transparent);
  padding-bottom: 1px;
  transition: border-color .3s;
}
.quiz__jump:hover { border-color: var(--narra); }
.quiz__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 26px; }
.quiz__score { font-family: var(--f-ui); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.quiz__done { text-align: center; padding: 30px 0; }
.quiz__bignum {
  font-family: var(--f-display); font-weight: 300;
  font-size: clamp(64px, 12vw, 110px); line-height: 1;
  color: var(--narra);
}
.quiz__bignum span { font-size: .3em; color: var(--ink-3); margin-left: 8px; }
.quiz__verdictbig { font-size: clamp(17px, 2vw, 20px); font-style: italic; color: var(--ink-2); margin-top: 12px; }
.quiz__doneacts { display: flex; gap: 10px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }

/* ════════════════════════════════════════════════════════════════════
   NOSCRIPT · RESPONSIVE · REDUCED MOTION · PRINT
   ════════════════════════════════════════════════════════════════════ */
.noscript { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 40px; background: var(--paper); text-align: center; }
.noscript h1 { font-family: var(--f-display); font-weight: 400; font-size: 32px; margin-bottom: 12px; }
.noscript a { color: var(--narra); text-decoration: underline; }

@media (max-width: 1080px) {
  .toc {
    transform: translateX(-100%);
    transition: transform .4s var(--e-out);
    background: var(--paper);
    z-index: 40;
    box-shadow: 30px 0 60px -40px rgba(35,32,27,.4);
  }
  .toc-open .toc { transform: none; }
  .toc-scrim {
    display: block; position: fixed; inset: 0; z-index: 35;
    background: rgba(35,32,27,.3);
    opacity: 0; pointer-events: none; transition: opacity .35s;
  }
  .toc-open .toc-scrim { opacity: 1; pointer-events: auto; }
  .mast__toc { display: grid; place-items: center; width: 40px; height: 40px; }
  .doc { margin-left: 0; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .notes { grid-template-columns: 1fr; gap: 22px; }
  .case-list { grid-template-columns: 1fr; }
  .closing__notes { grid-template-columns: 1fr; }
  .beat { grid-template-columns: 1fr; gap: 8px; }
  .beat__date { text-align: left; border-right: 0; padding-right: 0; border-left: 2px solid rgba(176,141,62,.4); padding-left: 12px; padding-top: 0; }
  .statute { padding: 18px 18px 20px; margin-inline: -4px; }
  .statute__p { font-size: 17px; }
  .law__foot { flex-direction: column-reverse; align-items: flex-start; gap: 12px; }
  .mast__nav button:not(.mast__toc) { padding: 8px 8px; font-size: 12px; }
  .mast__read { display: none; }
  .mast__mark span { display: none; }
  .frontis__desc { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .will-reveal { opacity: 1; transform: none; }
}

@media print {
  .masthead, .toc, .toc-scrim, #overlays, .markread, .frontis__begin, .closing__actions { display: none !important; }
  .doc { margin: 0; padding: 0; }
  .cell { background: #fff; color: #000; }
  .cell * { color: #000 !important; }
  body::before { display: none; }
}
