/* UAE Civil Transactions Law 2025 — Reform Catalogue
   Design system: editorial / bold infographic */

:root {
  /* base palette — crisp white, editorial */
  --bg: oklch(0.995 0 0);
  --bg-card: oklch(1 0 0);
  --bg-deep: oklch(0.22 0.010 250);
  --bg-deep-2: oklch(0.28 0.012 250);
  --bg-soft: oklch(0.984 0.002 250);
  --ink: oklch(0.18 0.012 250);
  --ink-soft: oklch(0.34 0.010 250);
  --ink-mute: oklch(0.54 0.008 250);
  --rule: oklch(0.91 0.003 250);
  --rule-soft: oklch(0.955 0.003 250);

  /* state colors — before / after — calmer accent */
  --before: oklch(0.55 0.020 250);
  --before-bg: oklch(0.96 0.006 250);
  /* British racing green — the new-law accent. Replaces the earlier warm-red
     hue (oklch 0.50 0.13 30), which now lives at --divergence and is reserved
     for marking where firm commentaries disagree. */
  --after:  oklch(0.42 0.085 148);
  --after-bg: oklch(0.975 0.014 148);
  --divergence: oklch(0.50 0.13 30);
  --divergence-bg: oklch(0.975 0.020 30);

  /* tag colors — single muted scale, distinguished by hue only */
  --t-RE:    oklch(0.50 0.060 30);
  --t-CON:   oklch(0.50 0.055 70);
  --t-CORP:  oklch(0.50 0.055 255);
  --t-FIN:   oklch(0.50 0.055 160);
  --t-SALES: oklch(0.50 0.060 310);
  --t-GOV:   oklch(0.50 0.030 220);

  /* type */
  --display: "forma-djr-display", "Helvetica Neue", Arial, sans-serif;
  --deck:    "forma-djr-deck", "forma-djr-display", "Helvetica Neue", Arial, sans-serif;
  --body: "lemonde-journal", "Source Serif 4", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  /* layout */
  --col-narrow: 720px;
  --col-wide: 1100px;
}

* { box-sizing: border-box; }

html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* ============ TOP MAST ============ */

.mast {
  background: var(--bg-deep);
  color: var(--bg);
  padding: 36px 32px 28px;
  border-bottom: 1px solid oklch(0.32 0.018 250);
}

.mast-inner {
  max-width: var(--col-wide);
  margin: 0 auto;
}

.mast-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: oklch(0.75 0.04 28);
  margin-bottom: 12px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.mast-eyebrow span:not(:last-child)::after {
  content: "·";
  margin-left: 18px;
  color: oklch(0.50 0.018 250);
}

.mast h1 {
  font-family: var(--deck);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 78px);
  line-height: 1.04;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-wrap: balance;
  font-feature-settings: "kern", "liga", "calt";
}

.mast h1 em {
  font-style: italic;
  color: oklch(0.78 0.12 28);
  font-weight: 500;
}

.mast .mast-sub {
  font-family: var(--display);
  font-size: clamp(20px, 2.2vw, 28px);
  font-style: italic;
  font-weight: 400;
  color: oklch(0.78 0.04 80);
  margin: 8px 0 24px;
}

.mast-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid oklch(0.32 0.018 250);
  margin-top: 22px;
}

.mast-meta-item {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
}

.mast-meta-item .k {
  display: block;
  color: oklch(0.65 0.04 28);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
  margin-bottom: 4px;
}

.mast-meta-item .v {
  color: var(--bg);
}

/* ============ STICKY HEADER (nav + filter combined) ============ */

.sticky-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: oklch(1 0 0 / 0.93);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}

/* ============ NAV — cluster tabs + view-mode toggle ============ */

.cluster-nav {
  background: transparent;
  border-bottom: 1px solid var(--rule-soft);
}

.cluster-nav-inner {
  max-width: var(--col-wide);
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding-right: 16px;
}

.cluster-nav-tabs {
  flex: 1 1 auto;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}

.cluster-nav-tabs::-webkit-scrollbar { display: none; }

.cluster-nav-index {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  padding: 12px 18px;
}

.nav-index-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.view-mode-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-self: center;
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-card);
}

.view-mode-btn {
  font: inherit;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  background: transparent;
  border: none;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.view-mode-btn:hover { color: var(--ink); }

.view-mode-btn.active {
  background: var(--ink);
  color: var(--bg);
}

.view-mode-btn + .view-mode-btn { border-left: 1px solid var(--rule); }

.nav-item {
  flex: 1 0 auto;
  padding: 12px 14px 12px 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: var(--ink-mute);
  display: flex;
  gap: 10px;
  align-items: baseline;
  border-bottom: 2px solid transparent;
  text-align: left;
  text-decoration: none;
  transition: color 0.18s, border-color 0.18s;
  white-space: nowrap;
  position: relative;
}

.nav-sep {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--rule);
  margin-left: 4px;
  font-weight: 400;
  align-self: center;
  transition: color 0.18s;
}

.nav-item:hover { color: var(--ink); }
.nav-item:hover .nav-sep { color: var(--ink-mute); }

.nav-item.active {
  color: var(--ink);
  border-bottom-color: var(--after);
}

.nav-item.active .nav-sep { color: var(--ink-mute); }

.nav-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--after);
  font-weight: 500;
}

.nav-label {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ============ FILTER BAR ============ */

.filter-bar {
  position: relative;
  max-width: var(--col-wide);
  margin: 0 auto;
  padding: 8px 24px 8px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  transition: background 0.2s;
}

.filter-bar.is-active {
  background: oklch(0.975 0.020 30 / 0.35);
}

.filter-pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--after);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 oklch(0.50 0.13 30 / 0.5);
  animation: filter-pulse 1.8s ease-out infinite;
}

@keyframes filter-pulse {
  0% { box-shadow: 0 0 0 0 oklch(0.50 0.13 30 / 0.5); }
  70% { box-shadow: 0 0 0 8px oklch(0.50 0.13 30 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(0.50 0.13 30 / 0); }
}

/* slicer toggle button */
.filter-toggle {
  font: inherit;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--bg-card);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 7px 12px 7px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.16s, color 0.16s, background 0.16s;
}

.filter-toggle:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
}

.filter-toggle.open {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-bar.is-active .filter-toggle {
  border-color: var(--after);
  color: var(--after);
}

.filter-toggle-label {
  font-weight: 500;
}

.filter-toggle-active {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-left: 8px;
  border-left: 1px solid var(--rule);
}

.ft-chip {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 5px;
  border: 1px solid currentColor;
  border-radius: 2px;
}

.filter-toggle-caret {
  font-size: 10px;
  color: var(--ink-mute);
  transition: transform 0.18s;
}

.filter-toggle.open .filter-toggle-caret {
  transform: rotate(180deg);
}

/* slicer dropdown */
.filter-dropdown {
  position: absolute;
  top: calc(100% - 4px);
  left: 18px;
  z-index: 50;
  min-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: 0 12px 32px -16px oklch(0 0 0 / 0.18), 0 2px 8px -2px oklch(0 0 0 / 0.06);
  padding: 8px 0 4px;
  animation: filter-dropdown-in 0.16s ease-out;
}

@keyframes filter-dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.filter-dropdown-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 14px 10px;
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.filter-dropdown-clear {
  font: inherit;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--after);
  text-decoration: underline;
  padding: 0;
}

.filter-dropdown-clear:hover { color: var(--ink); }

.filter-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.filter-option {
  width: 100%;
  font: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 20px 8px auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 14px;
  text-align: left;
  color: var(--ink-soft);
  transition: background 0.12s, color 0.12s;
}

.filter-option:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.filter-option.active {
  color: var(--ink);
}

.filter-option-check {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--after);
  text-align: center;
  width: 20px;
}

.filter-option-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.filter-option-key {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  min-width: 48px;
}

.filter-option-label {
  font-size: 13px;
  color: var(--ink-mute);
}

.filter-option.active .filter-option-label { color: var(--ink-soft); }

/* ============ CHAPTER ============ */

.chapter {
  scroll-margin-top: 60px;
  position: relative;
}

/* sticky cluster title — vertical text along the left margin */
.chapter-watermark {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 64px;
  pointer-events: none;
  z-index: 1;
}

.chapter-watermark .wm-title {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100%;
}

.chapter-watermark .wm-title-inner {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--ink-mute);
  opacity: 0.45;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  user-select: none;
}

@media (max-width: 840px) {
  .chapter-watermark { display: none; }
}

.chapter-hero {
  position: relative;
  z-index: 2;
  max-width: var(--col-narrow);
  margin: 96px auto 36px;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: flex-start;
}

.chapter-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.chapter-eyebrow-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--after);
  font-weight: 500;
  flex: 0 0 auto;
}

.chapter-eyebrow-rule {
  flex: 1 1 auto;
  height: 1px;
  background: var(--rule);
}

.chapter-eyebrow-count {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  flex: 0 0 auto;
}

.chapter-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.chapter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

@media (max-width: 880px) {
  .chapter-hero { margin-top: 60px; }
}

.chapter-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--after);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chapter-num::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.chapter-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(36px, 4.6vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 22px;
  color: var(--ink);
  text-wrap: balance;
}

.chapter-lede {
  font-family: var(--display);
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.45;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0;
  max-width: 50ch;
  text-wrap: pretty;
}

.chapter-motif {
  position: relative;
  aspect-ratio: 1 / 1;
  max-height: 380px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chapter-motif svg {
  width: 100%;
  height: 100%;
}

/* typographic motif — every cluster gets the same treatment, reflecting
   the chapter name as the only visual identity. */
.motif-typo {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 8px;
  gap: 14px;
}

.motif-typo-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.motif-typo-title {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(46px, 5.4vw, 72px);
  line-height: 0.96;
  letter-spacing: -0.028em;
  color: var(--ink);
  text-wrap: balance;
}

.motif-typo-rule {
  width: 56px;
  height: 1px;
  background: var(--after);
  margin: 6px 0 2px;
}

.motif-typo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chapter-cards {
  max-width: var(--col-narrow);
  margin: 0 auto;
  padding: 24px 32px 100px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  position: relative;
  z-index: 2;
}

/* ============ CARD ============ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  scroll-margin-top: 80px;
  transition: opacity 0.2s, filter 0.2s;
  position: relative;
  z-index: 2;
  box-shadow: 0 1px 0 oklch(0 0 0 / 0.02), 0 8px 28px -16px oklch(0 0 0 / 0.06);
}

.card.dimmed {
  opacity: 0.28;
  filter: saturate(0.4);
}

.card-head {
  padding: 24px 130px 18px 28px;
  border-bottom: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: start;
}

.card-art {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding-top: 6px;
  min-width: 78px;
}

.card-art-num {
  font-family: var(--display);
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.card-art-num.is-symbol {
  font-size: 24px;
  color: var(--ink-soft);
}

.card-art-id {
  color: var(--after);
  font-weight: 600;
}

.card-head-main {
  min-width: 0;
}

.card-id-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.card-id {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  background: transparent;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.tag[data-tag="RE"]    { color: var(--t-RE); }
.tag[data-tag="CON"]   { color: var(--t-CON); }
.tag[data-tag="CORP"]  { color: var(--t-CORP); }
.tag[data-tag="FIN"]   { color: var(--t-FIN); }
.tag[data-tag="SALES"] { color: var(--t-SALES); }
.tag[data-tag="GOV"]   { color: var(--t-GOV); }

.card-title {
  font-family: var(--body);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--ink);
  text-wrap: balance;
}

.card-headline {
  font-family: var(--body);
  font-size: 17px;
  font-style: italic;
  line-height: 1.4;
  color: var(--after);
  margin: 0;
  text-wrap: pretty;
}

/* ============ BEFORE / AFTER ============ */

.ba {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--rule-soft);
}

@media (max-width: 720px) {
  .ba { grid-template-columns: 1fr; }
}

.ba-col {
  padding: 22px 28px 24px;
  position: relative;
}

.ba-col + .ba-col {
  border-left: 1px solid var(--rule-soft);
}

@media (max-width: 720px) {
  .ba-col + .ba-col {
    border-left: none;
    border-top: 1px solid var(--rule-soft);
  }
}

.ba-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ba-col.before .ba-label { color: var(--before); }
.ba-col.after  .ba-label { color: var(--after); }

.ba-label .date {
  font-size: 9px;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
}

.ba-text {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}

.ba-col.before { background: linear-gradient(to bottom, oklch(0.97 0.004 250 / 0.6), transparent); }
.ba-col.after  { background: linear-gradient(to bottom, var(--after-bg), transparent); }

/* toggle mode */
.card[data-ba-mode="toggle"] .ba {
  grid-template-columns: 1fr;
}
.card[data-ba-mode="toggle"] .ba-col + .ba-col {
  border-left: none;
  display: none;
}
.card[data-ba-mode="toggle"][data-show="after"] .ba-col.before { display: none; }
.card[data-ba-mode="toggle"][data-show="after"] .ba-col.after { display: block; }

.ba-toggle {
  display: none;
}
.card[data-ba-mode="toggle"] .ba-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 28px;
  margin-top: -1px;
  border: 1px solid var(--rule);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  width: max-content;
  position: relative;
  top: 1px;
}
.ba-toggle button {
  font: inherit;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: transparent;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--ink-mute);
}
.ba-toggle button.active {
  background: var(--ink);
  color: var(--bg);
}

/* ============ RELEVANCE ============ */

.relevance {
  padding: 22px 28px 22px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--rule-soft);
}

.section-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label .mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--after);
}

.relevance p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
}

/* ============ DRAFTING ============ */

.drafting {
  padding: 20px 28px 22px;
  background: var(--bg-soft);
  color: var(--ink);
  border-bottom: 1px solid var(--rule-soft);
  border-top: 1px solid var(--rule-soft);
}

.drafting .section-label {
  color: var(--ink-mute);
}

.drafting .section-label .mark { background: var(--after); }

.drafting ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.drafting li {
  position: relative;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.drafting li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0;
  color: oklch(0.72 0.12 28);
  font-family: var(--mono);
  font-weight: 500;
}

/* ============ DISAGREEMENT ============ */

/* Divergence between firm commentaries. Subtle red accent on the badge
   and a hair-thin red left rule — the only place red appears in the
   site. Red is reserved for this signal so the eye learns: red = the
   firms don't agree here. */
.disagreement {
  padding: 14px 28px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--rule-soft);
  border-top: 1px solid var(--rule-soft);
  border-left: 2px solid var(--divergence);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.disagreement-badge {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--divergence);
  background: transparent;
  border: 1px solid var(--divergence);
  padding: 3px 7px;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}

.disagreement p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ============ SOURCES FOOTER ============ */

.sources {
  padding: 12px 28px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* Subtle ghost link at the right end of the card sources footer that opens
   the Feedback form on the About page, pre-filled with this card's id. */
.sources .card-feedback-trigger {
  margin-left: auto;
  font: inherit;
  color: var(--ink-mute);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px dotted oklch(0.78 0.01 250);
  transition: color 0.15s, border-bottom-color 0.15s;
}
.sources .card-feedback-trigger:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
@media (max-width: 720px) {
  .sources .card-feedback-trigger { margin-left: 0; }
}

.sources .src-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.sources .src-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.sources .src-list a,
.sources .src-list span {
  position: relative;
  padding-right: 12px;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: color 0.15s, border-color 0.15s;
}

.sources .src-list a {
  color: var(--after);
  border-bottom-color: oklch(0.53 0.18 28 / 0.4);
}

.sources .src-list a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.sources .src-list a + a::before,
.sources .src-list span + span::before,
.sources .src-list a + span::before,
.sources .src-list span + a::before {
  content: "·";
  position: absolute;
  left: -8px;
  color: var(--ink-mute);
}

/* ============ HIDE DRAFTING (tweak) ============ */

[data-show-drafting="off"] .drafting { display: none; }

/* ============ ARTICLE REFS — inline + card header ============ */

button.art-ref {
  font: inherit;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--after);
  border-bottom: 1px dotted oklch(0.45 0.08 148 / 0.45);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

button.art-ref:hover {
  color: var(--ink);
  background: oklch(0.95 0.025 148);
  border-bottom-color: var(--ink);
}

button.art-ref:focus-visible {
  outline: 2px solid var(--after);
  outline-offset: 2px;
}

/* 1985 / Old Code references render in the "before" palette so it's
   visually clear you're stepping back to the repealed Code. */
button.art-ref.art-ref-1985 {
  color: var(--before, oklch(0.45 0.04 240));
  border-bottom-color: oklch(0.45 0.04 240 / 0.45);
}
button.art-ref.art-ref-1985:hover {
  color: var(--ink);
  background: oklch(0.95 0.02 240);
  border-bottom-color: var(--ink);
}

/* When the peek panel is showing a 1985 article, tint the eyebrow so the
   corpus is unmistakable. */
.peek-panel.peek-panel-1985 .peek-eyebrow span:first-child {
  color: oklch(0.45 0.04 240);
}

/* big numeral in card header */
button.art-ref.card-art-num {
  font-family: var(--display);
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

button.art-ref.card-art-num:hover {
  color: var(--after);
  background: transparent;
  border-bottom-color: var(--after);
}

.card-art-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  margin-bottom: 4px;
  max-width: 130px;
}

button.art-ref.card-art-chip {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink-soft);
  background: var(--bg-card);
}

button.art-ref.card-art-chip:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ============ ARTICLE PEEK PANEL ============ */

.peek-scrim {
  position: fixed;
  inset: 0;
  background: oklch(0.18 0.018 250 / 0);
  pointer-events: none;
  z-index: 90;
  transition: background 0.24s ease-out;
}

.peek-scrim.open {
  background: oklch(0.18 0.018 250 / 0.45);
  pointer-events: auto;
}

.peek-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(540px, 100vw);
  background: var(--bg);
  z-index: 100;
  transform: translateX(105%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: -20px 0 60px -20px oklch(0.18 0.018 250 / 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.peek-panel.open {
  transform: translateX(0);
}

/* Compare mode widens the panel to fit two columns side-by-side. */
.peek-panel.peek-panel-compare {
  width: min(1080px, 100vw);
}

/* Header action cluster — close + compare toggle share the same flex row. */
.peek-head-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.peek-compare-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: transparent;
  color: oklch(0.72 0.04 28);
  border: 1px solid oklch(0.42 0.02 250);
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.peek-compare-btn:hover {
  color: var(--bg);
  border-color: oklch(0.72 0.04 28);
  background: oklch(0.28 0.018 250);
}
.peek-compare-btn .arrow {
  font-size: 13px;
  line-height: 1;
}

/* Compare-mode content uses a 2-column grid; each column scrolls together
   with the rest of the content (single scroll context, columns stay
   aligned). */
.peek-content-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
}

.compare-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid oklch(0.88 0.01 250);
}
.compare-col:last-child {
  border-right: none;
}

.compare-col-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  border-bottom: 1px solid oklch(0.88 0.01 250);
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compare-col-1985 .compare-col-head {
  background: oklch(0.97 0.01 250);
}

.compare-col-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.compare-col-label .instrument {
  color: var(--ink);
}
.compare-col-1985 .compare-col-label .instrument {
  color: oklch(0.45 0.04 240);
}
.compare-col-label .name {
  color: oklch(0.5 0.02 250);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--body);
  font-size: 12px;
  font-style: italic;
}

.compare-col-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.compare-col-nav .peek-nav-btn {
  flex: 0 0 auto;
  padding: 4px 10px;
}
.compare-col-num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink);
}

/* Editable article-number jump field. Sits between prev/next nav buttons
   in both the single-view nav row and each compare column header. */
.art-picker {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: oklch(0.72 0.04 28);
  padding: 4px 8px;
  border: 1px solid oklch(0.42 0.02 250);
  border-radius: 4px;
  background: transparent;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.art-picker:focus-within {
  border-color: var(--ink);
  color: var(--bg);
  background: oklch(0.28 0.018 250);
}
.art-picker-lbl {
  flex: 0 0 auto;
  opacity: 0.8;
}
.art-picker input {
  width: 4.5ch;
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
  padding: 0;
  outline: none;
  letter-spacing: inherit;
  text-align: left;
}
.art-picker input::-webkit-outer-spin-button,
.art-picker input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Compare-column picker variant — lives on the white (or tinted-white)
   column header rather than the dark panel header, so use light-on-dark
   inverted styling. */
.art-picker-sm {
  font-size: 11px;
  padding: 3px 7px;
  color: var(--ink);
  border-color: oklch(0.75 0.02 250);
  background: var(--bg);
}
.art-picker-sm:focus-within {
  border-color: var(--ink);
  background: oklch(0.97 0.01 250);
  color: var(--ink);
}
.compare-col-1985 .art-picker-sm {
  background: var(--bg);
}

.compare-col-body {
  padding: 18px 20px 24px;
  min-width: 0;
}

.peek-head {
  flex-shrink: 0;
  padding: 18px 24px 14px;
  background: var(--bg-deep);
  color: var(--bg);
  border-bottom: 1px solid oklch(0.32 0.018 250);
}

.peek-head-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.peek-eyebrow {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: oklch(0.72 0.04 28);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.peek-eyebrow span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peek-eyebrow span:last-child {
  color: oklch(0.55 0.04 28);
}

.peek-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 28px;
  line-height: 1;
  background: transparent;
  border: none;
  color: oklch(0.75 0.018 250);
  cursor: pointer;
  padding: 0;
  margin: -4px -6px 0 0;
  transition: color 0.15s;
}

.peek-close:hover { color: var(--bg); }

.peek-nav {
  display: flex;
  gap: 6px;
}

.peek-nav-btn {
  flex: 1;
  font: inherit;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid oklch(0.32 0.018 250);
  color: oklch(0.85 0.012 80);
  padding: 8px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.peek-nav-btn:not(:disabled):hover {
  background: oklch(0.27 0.018 250);
  color: var(--bg);
  border-color: oklch(0.45 0.018 250);
}

.peek-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.peek-nav-btn .arrow {
  font-family: var(--mono);
  font-size: 14px;
}

.peek-nav-btn.peek-back {
  flex: 0 0 auto;
  padding-left: 14px;
  padding-right: 14px;
  border-color: oklch(0.50 0.12 28);
  color: oklch(0.85 0.10 28);
}

.peek-nav-btn.peek-back:hover {
  background: oklch(0.40 0.16 28);
  color: var(--bg);
  border-color: oklch(0.55 0.18 28);
}

.peek-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 24px 32px;
  position: relative;
}

.peek-art {
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.peek-art:last-child { border-bottom: none; }

.peek-art.muted {
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.15s;
}

.peek-art.muted:hover { opacity: 0.85; }

.peek-art-lineage {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.peek-art-lineage .lineage-item {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--after);
  padding: 2px 8px;
  background: oklch(0.95 0.04 28);
  border-radius: 2px;
}

.peek-art-num {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 12px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.peek-art.primary .peek-art-num {
  font-size: 30px;
  color: var(--after);
}

.peek-art-num .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}

.peek-art.primary .peek-art-num .lbl {
  color: var(--ink-mute);
}

.peek-art-num .num {
  font-weight: 500;
}

.peek-art-body {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.peek-art.primary .peek-art-body {
  color: var(--ink);
  font-size: 15.5px;
}

.peek-art-body p {
  margin: 0 0 10px;
}

.peek-art-body p:last-child { margin-bottom: 0; }

.peek-li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 4px;
  margin: 0 0 8px;
}

.peek-li-2 {
  grid-template-columns: 20px 1fr;
  padding-left: 28px;
  font-size: 0.95em;
  color: var(--ink-mute);
}

.peek-li .marker {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--after);
  font-weight: 500;
}

.peek-li-2 .marker {
  color: var(--ink-mute);
}

.peek-foot {
  flex-shrink: 0;
  padding: 10px 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--bg-card);
}

@media (max-width: 720px) {
  .peek-panel { width: 100vw; }
  .peek-panel.peek-panel-compare { width: 100vw; }
  .peek-head { padding: 14px 18px 10px; }
  .peek-content { padding: 8px 18px 24px; }
  /* Stack compare columns vertically on small screens. */
  .peek-content-compare { grid-template-columns: 1fr; }
  .compare-col { border-right: none; border-bottom: 1px solid oklch(0.88 0.01 250); }
  .compare-col:last-child { border-bottom: none; }
  .peek-compare-btn .lbl { display: none; }
}

/* ============ CONCEPT TRIGGER ============ */

.card-concept {
  margin: 4px 0 -10px;
  padding: 0;
}

.card-concept .concept-trigger {
  margin-top: 0;
}

.concept-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 9px 16px 9px 12px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font: inherit;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.16s;
}

.concept-trigger:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.concept-trigger .cq {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--after);
  color: var(--bg-card);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0;
}

.concept-trigger:hover .cq {
  background: var(--bg);
  color: var(--ink);
}

.concept-trigger .cl {
  font-weight: 500;
}

/* ============ CONCEPT PANEL ============ */

.concept-scrim {
  position: fixed;
  inset: 0;
  background: oklch(0.18 0.012 250 / 0);
  pointer-events: none;
  z-index: 80;
  transition: background 0.24s ease-out;
}

.concept-scrim.open {
  background: oklch(0.18 0.012 250 / 0.4);
  pointer-events: auto;
}

.concept-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(640px, 100vw);
  background: var(--bg);
  z-index: 85;
  transform: translateX(105%);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: -20px 0 60px -20px oklch(0.18 0.012 250 / 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.concept-panel.open { transform: translateX(0); }

.concept-head {
  flex-shrink: 0;
  padding: 28px 32px 22px;
  background: var(--bg-deep);
  color: var(--bg);
  border-bottom: 1px solid oklch(0.32 0.014 250);
}

.concept-head-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.concept-eyebrow {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: oklch(0.72 0.04 28);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.concept-eyebrow span:last-child {
  color: oklch(0.55 0.018 250);
}

.concept-eyebrow span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.concept-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  font-family: var(--display);
  font-size: 28px;
  line-height: 1;
  background: transparent;
  border: none;
  color: oklch(0.75 0.012 250);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: -4px -6px 0 0;
  transition: color 0.15s;
}

.concept-close:hover { color: var(--bg); }

.concept-title {
  font-family: var(--display);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 500;
  font-style: italic;
  line-height: 1.05;
  letter-spacing: -0.022em;
  margin: 0;
  text-wrap: balance;
  color: var(--bg);
}

.concept-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 36px;
  position: relative;
}

.concept-lede {
  font-family: var(--display);
  font-size: 19px;
  line-height: 1.45;
  color: var(--ink);
  font-style: italic;
  margin: 0 0 28px;
  text-wrap: pretty;
}

.concept-section {
  margin: 0 0 28px;
}

.concept-section:last-child {
  margin-bottom: 0;
}

.concept-h {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--after);
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

.concept-section p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 12px;
}

.concept-section p:last-child {
  margin-bottom: 0;
}

.concept-quote {
  background: var(--bg-soft);
  border-left: 3px solid var(--after);
  padding: 18px 22px 16px;
  margin: 0 0 14px;
}

.concept-quote q {
  font-family: var(--display);
  font-size: 16px;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
  quotes: "\201C" "\201D" "\2018" "\2019";
}

.concept-quote q::before { content: open-quote; }
.concept-quote q::after { content: close-quote; }

.concept-quote cite {
  display: block;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  font-style: normal;
  color: var(--ink-mute);
}

.concept-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.45;
}

.concept-table tr {
  border-bottom: 1px solid var(--rule-soft);
}

.concept-table tr:last-child { border-bottom: none; }

.concept-table td {
  padding: 10px 8px;
  vertical-align: top;
  color: var(--ink-soft);
}

.concept-table td:first-child {
  font-weight: 500;
  color: var(--ink);
}

.concept-table td:last-child {
  text-align: right;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding-left: 18px;
  width: 1%;
}

.concept-table .is-yes { color: var(--after); }
.concept-table .is-no { color: var(--ink-mute); }
.concept-table .is-borderline { color: oklch(0.55 0.10 80); white-space: normal; text-align: left; max-width: 240px; }

.concept-foot {
  flex-shrink: 0;
  padding: 10px 32px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--bg-soft);
}

@media (max-width: 720px) {
  .concept-panel { width: 100vw; }
  .concept-head { padding: 20px 22px 16px; }
  .concept-content { padding: 20px 22px 28px; }
  .concept-foot { padding: 8px 22px; }
}

/* ============ INDEX VIEW ============ */

.index-view {
  max-width: var(--col-wide);
  margin: 32px auto 80px;
  padding: 0 32px;
}

.index-cluster {
  margin: 0 0 48px;
  scroll-margin-top: 130px;
}

.index-cluster-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

.index-cluster-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--after);
  font-weight: 500;
}

.index-cluster-title {
  flex: 1 1 auto;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}

.index-cluster-count {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.index-tile {
  position: relative;
  background: transparent;
  border: none;
  padding: 0;
  transition: opacity 0.18s, filter 0.18s, grid-column 0.4s;
  min-height: 168px;
  perspective: 1200px;
}

.index-tile.dimmed {
  opacity: 0.28;
  filter: saturate(0.4);
}

.index-tile.open {
  grid-column: 1 / -1;
  z-index: 5;
}

.index-tile-flip {
  width: 100%;
  height: 100%;
  animation: tile-flip 0.55s ease;
  transform-style: preserve-3d;
}

@keyframes tile-flip {
  0%   { transform: perspective(1200px) rotateX(0deg);   opacity: 1; }
  45%  { transform: perspective(1200px) rotateX(90deg);  opacity: 0.2; }
  55%  { transform: perspective(1200px) rotateX(-90deg); opacity: 0.2; }
  100% { transform: perspective(1200px) rotateX(0deg);   opacity: 1; }
}

/* compact face — the default tile */
.index-tile-front {
  font: inherit;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 16px 18px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-height: 168px;
  transition: border-color 0.16s, transform 0.16s, box-shadow 0.16s;
}

.index-tile-front:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -10px oklch(0 0 0 / 0.12);
}

.index-tile-affordance {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

.index-tile-front:hover .index-tile-affordance {
  opacity: 1;
  color: var(--after);
}

/* full face — the expanded card */
.index-tile-back {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--ink);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 12px 36px -16px oklch(0 0 0 / 0.18);
}

.index-tile-back .card {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.index-tile-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 4;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--ink-mute);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.index-tile-close:hover {
  color: var(--bg);
  background: var(--ink);
  border-color: var(--ink);
}

.index-tile-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.index-tile-art {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--after);
  font-weight: 500;
}

.index-tile-id {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
}

.index-tile-title {
  font-family: var(--body);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

.index-tile-headline {
  flex: 1 1 auto;
  font-family: var(--body);
  font-size: 14px;
  font-style: italic;
  line-height: 1.42;
  color: var(--ink-soft);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.index-tile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}

@media (max-width: 720px) {
  .index-view { padding: 0 18px; margin-top: 18px; }
  .index-grid { grid-template-columns: 1fr; }
}


/* ============ MOTIFS ============ */

.motif-text {
  font-family: var(--display);
  fill: var(--ink);
}
.motif-mono {
  font-family: var(--mono);
  fill: var(--ink-soft);
}
.motif-accent { fill: var(--after); }
.motif-muted { fill: var(--before); }

/* ============ HOW-TO-USE BANNER ============ */

.how-to-use {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 28px 24px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  margin-top: -24px;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}
.how-to-use-eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 10px;
}
.how-to-use ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 24px;
}
.how-to-use li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  position: relative;
  padding-left: 14px;
}
.how-to-use li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--after);
  font-family: var(--mono);
}
.how-to-use li strong {
  color: var(--ink);
  font-weight: 600;
}
.how-to-use li em {
  font-style: italic;
  color: var(--ink);
}

/* ============ COMMENTS ============ */

.card { position: relative; }

.card-comments {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
}

.card-comments-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.16s;
  white-space: nowrap;
}
.card-comments-chip:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
}
.card-comments-chip.has-comments {
  border-color: var(--after);
  color: var(--after);
}
.card-comments-chip .chip-icon {
  display: inline-flex;
  width: 18px; height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--after);
  color: var(--bg-card);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}
.card-comments-chip .chip-caret {
  font-size: 9px;
  opacity: 0.5;
  transition: transform 0.16s;
}
.card-comments-chip.open .chip-caret {
  transform: rotate(180deg);
}

.card-comments-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(560px, calc(100vw - 48px));
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 20px 22px 18px;
  box-shadow: 0 12px 32px -8px oklch(0.18 0.012 250 / 0.12),
              0 4px 12px -4px oklch(0.18 0.012 250 / 0.08);
  text-align: left;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.panel-head-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.panel-head-title strong { color: var(--ink); }
.panel-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.panel-close:hover { color: var(--ink); }

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.comment-row {
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.comment-row.resolved {
  padding: 8px 14px;
  background: transparent;
  border-style: dashed;
  border-color: var(--rule);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.comment-row.resolved .resolved-mark {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--after);
  font-weight: 600;
}
.comment-row.resolved .resolved-meta {
  font-size: 12px;
  color: var(--ink-mute);
  flex: 1;
}
.comment-row.resolved .resolved-meta strong { color: var(--ink-soft); }
.comment-row.resolved .show-toggle {
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 2px 6px;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 2px;
}
.comment-row.resolved .show-toggle:hover { color: var(--ink-soft); }

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.comment-author {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}
.comment-time {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  text-transform: uppercase;
  white-space: nowrap;
}
.comment-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  margin: 0;
}
.comment-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.comment-action {
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 2px 6px;
}
.comment-action:hover { color: var(--ink); }
.comment-action.danger:hover { color: oklch(0.50 0.16 25); }

.post-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.post-form-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-mute);
}
.post-form-name-row .posting-as {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.post-form-name-row strong {
  color: var(--ink);
  font-family: var(--body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}
.post-form-name-row .change-name {
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
  text-decoration-color: var(--rule);
}
.post-form-name-row .change-name:hover { color: var(--ink); }

.name-input,
.body-input {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--ink);
  resize: vertical;
}
.name-input:focus,
.body-input:focus {
  outline: none;
  border-color: var(--after);
}
.body-input {
  min-height: 80px;
  max-height: 200px;
  line-height: 1.5;
}

.post-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.char-count {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.post-btn {
  font: inherit;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.14s;
}
.post-btn:hover:not(:disabled) {
  background: var(--after);
  border-color: var(--after);
}
.post-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.form-error {
  color: oklch(0.50 0.16 25);
  font-size: 12px;
  margin-top: 4px;
}

/* Index tile badge — top-right of .index-tile-head */
.index-tile-head { position: relative; }
.index-tile-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--after);
  color: var(--bg);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

/* ============ PRINT ============ */

@media print {
  .cluster-nav, .filter-bar, #__tweaks_panel_root { display: none !important; }
  .card { break-inside: avoid; page-break-inside: avoid; border: 1px solid #999; }
  .chapter-hero { break-after: avoid; }
  .drafting { background: white; color: black; border-top: 1px solid #ccc; }
  .drafting li, .drafting .section-label { color: black; }
  body { background: white; }
  .card-comments { display: none; }
}

/* Quiet copyright at the bottom-right of the page. No background, no rule,
   just a small muted line at the end of content. */
.page-copyright {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  text-align: right;
  padding: 16px 28px 24px;
  opacity: 0.7;
}

/* ============ WELCOME OVERLAY ============ */

.welcome-scrim {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: oklch(0.18 0.018 250 / 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(2px);
  animation: welcome-fade-in 0.24s ease-out;
}

@keyframes welcome-fade-in { from { opacity: 0; } to { opacity: 1; } }

.welcome-panel {
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid oklch(0.88 0.01 250);
  border-radius: 8px;
  padding: 36px 40px 32px;
  box-shadow: 0 24px 80px -20px oklch(0.18 0.018 250 / 0.4),
              0 4px 16px -4px oklch(0.18 0.018 250 / 0.15);
}

.welcome-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.welcome-eyebrow span:not(:first-child)::before {
  content: "·";
  margin-right: 10px;
  color: var(--ink-mute);
  opacity: 0.5;
}

.welcome-h {
  font-family: var(--deck);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
  color: var(--ink);
}

.welcome-body p {
  font-family: var(--body);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 14px;
}

.welcome-body p:last-child { margin-bottom: 0; }

.welcome-h3 {
  font-family: var(--deck);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 20px 0 8px;
}

.welcome-h3:first-child { margin-top: 0; }

/* Quiet privacy lead-in: smaller than body, monospace, sits above the
   opening paragraph as a header note rather than a body claim. */
.welcome-body .welcome-privacy {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: var(--ink-mute);
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid oklch(0.9 0.01 250);
}

.welcome-inline-link {
  font: inherit;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 4px;
  color: var(--after);
  border-bottom: 1px dotted var(--after);
  cursor: pointer;
}
.welcome-inline-link:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.welcome-actions {
  margin-top: 26px;
  display: flex;
  justify-content: flex-end;
}

.welcome-accept {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--after);
  border: 1px solid var(--after);
  border-radius: 4px;
  padding: 12px 22px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.welcome-accept:hover {
  background: oklch(0.34 0.07 148);
  border-color: oklch(0.34 0.07 148);
}
.welcome-accept:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .welcome-panel { padding: 28px 24px 24px; }
  .welcome-h { font-size: 28px; }
}

/* ============ SOURCES VIEW ============ */

.sources-view {
  max-width: var(--col-narrow, 720px);
  margin: 0 auto;
  padding: 36px 24px 96px;
}

.sources-section {
  margin: 0 0 56px;
}

.sources-section:last-child {
  margin-bottom: 0;
}

.sources-h {
  font-family: var(--deck);
  font-weight: 500;
  font-size: clamp(28px, 3.2vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.005em;
  margin: 0 0 14px;
  color: var(--ink);
}

.sources-lede {
  font-family: var(--body);
  font-size: 17px;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 24px;
  max-width: 60ch;
}

.sources-section > p {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 14px;
  max-width: 64ch;
}

.sources-note {
  font-family: var(--body);
  font-size: 14px;
  font-style: italic;
  color: var(--ink-mute);
  margin: 18px 0 0;
  max-width: 60ch;
}

.sources-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sources-list-firms {
  counter-reset: src;
}

.sources-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid oklch(0.9 0.01 250);
}

.sources-list li:first-child { border-top: 1px solid oklch(0.9 0.01 250); }

a.sources-item {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  color: inherit;
  transition: color 0.15s;
}

a.sources-item:hover .src-title {
  color: var(--after);
  border-bottom-color: var(--after);
}

.src-title {
  font-family: var(--body);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid transparent;
  align-self: flex-start;
  transition: color 0.15s, border-color 0.15s;
}

.src-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  text-transform: lowercase;
}

/* About-section LinkedIn link */
a.about-linkedin {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--ink);
  padding: 8px 14px;
  border-radius: 4px;
  display: inline-block;
  transition: background 0.15s, color 0.15s;
}
a.about-linkedin:hover {
  background: var(--ink);
  color: var(--bg);
}

/* ============ FEEDBACK FORM ============ */

/* Honeypot wrapper. Hidden from layout AND assistive tech; bots that parse
   the DOM still see the input and helpfully fill it in, at which point the
   backend silently rejects the submission. Use position: absolute + 0px
   size rather than display: none so legitimate browsers don't auto-skip the
   field (some autofill engines do that). */
.feedback-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 18px;
  padding: 22px 22px 20px;
  background: oklch(0.97 0.005 250);
  border: 1px solid oklch(0.9 0.01 250);
  border-radius: 6px;
}

.feedback-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .feedback-row { grid-template-columns: 1fr; }
}

.feedback-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.feedback-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.feedback-label .opt {
  text-transform: none;
  letter-spacing: 0.02em;
  opacity: 0.7;
  margin-left: 2px;
}
.feedback-field input,
.feedback-field textarea {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid oklch(0.82 0.01 250);
  border-radius: 4px;
  padding: 9px 11px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.feedback-field textarea {
  resize: vertical;
  min-height: 100px;
}
.feedback-field input:focus,
.feedback-field textarea:focus {
  border-color: var(--after);
  box-shadow: 0 0 0 3px oklch(0.42 0.085 148 / 0.16);
}
.feedback-field input:disabled,
.feedback-field textarea:disabled { opacity: 0.6; cursor: not-allowed; }

.feedback-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.feedback-submit {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.feedback-submit:hover:not(:disabled) { background: oklch(0.28 0.018 250); }
.feedback-submit:disabled { opacity: 0.4; cursor: not-allowed; }

.feedback-error {
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.4;
  color: var(--divergence);
}

.feedback-sent p {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 12px;
}
.feedback-reset {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid oklch(0.78 0.01 250);
  border-radius: 4px;
  padding: 7px 14px;
  cursor: pointer;
}
.feedback-reset:hover { border-color: var(--ink); }

/* Article title as subtitle under the firm name. Uses the body serif
   in italic for the editorial register; not all-caps like the meta line. */
.src-article-title {
  font-family: var(--body);
  font-size: 14px;
  font-style: italic;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
  max-width: 60ch;
}

@media (max-width: 720px) {
  .sources-view { padding: 24px 18px 64px; }
  .sources-section { margin-bottom: 40px; }

}

