/* skdknickerbocker.com — firm case-file / power-file v1.5. Mobile-first. */

:root {
  --ink: #1a1a1a;
  --muted: #555;
  --paper: #fafafa;
  --card: #fff;
  --rule: #d0d0d0;
  --accent: #1a3a5c;
  --accent-soft: #e8eef4;
  --fact: #1a3a5c;
  --fact-bg: #e8eef4;
  --commentary: #7a3b00;
  --commentary-bg: #fffaf3;
  --link: #1a3a5c;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --measure: 42rem;
  --wide: 52rem;
  --mast-h: 3rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 17px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  line-height: 1.55;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--link);
  text-underline-offset: 0.12em;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

.skip {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 50;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  text-decoration: none;
}
.skip:focus { top: 0.5rem; }

/* Header — thinner mast */
.mast {
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 30;
}
.mast-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.45rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-height: var(--mast-h);
}
.brand {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
}
.brand a {
  color: var(--ink);
  text-decoration: none;
}
.brand a:hover { text-decoration: underline; }
.top {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.top a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.top a:hover,
.top a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* Sticky jump strip under mast */
.jump-sticky {
  position: sticky;
  top: var(--mast-h);
  z-index: 25;
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.jump-sticky .jump-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.4rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.jump-sticky a { text-decoration: none; }
.jump-sticky a:hover { text-decoration: underline; }

/* Legacy .jump (unused on index after v1.5) */
.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  margin: 1.25rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 0.9rem;
  font-weight: 600;
}
.jump a { text-decoration: none; }
.jump a:hover { text-decoration: underline; }

/* Layout */
.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.2;
  margin: 0.4rem 0 0.75rem;
  font-weight: 700;
}
h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 2px solid var(--ink);
  line-height: 1.25;
}
h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
  line-height: 1.3;
}
h4 {
  font-size: 0.95rem;
  margin: 1rem 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}

.subhead {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1rem;
}

.hero-lede {
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 1rem 0 1.25rem;
  max-width: var(--measure);
}

/* Portrait */
.portrait {
  margin: 1rem 0 1.25rem;
  max-width: 220px;
}
.portrait img {
  border: 1px solid var(--rule);
  background: #eee;
}
.portrait figcaption,
.credit {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.35rem;
  line-height: 1.35;
}

/* Power box */
.power {
  background: var(--card);
  border: 2px solid var(--ink);
  padding: 0.75rem 1rem 1rem;
  margin: 1rem 0 1.5rem;
}
.power h2 {
  border: none;
  margin: 0 0 0.75rem;
  padding: 0;
  font-size: 1.1rem;
}
.power dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.power dt {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-top: 0.65rem;
}
.power dt:first-of-type { margin-top: 0; }
.power dd {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

@media (min-width: 640px) {
  .power dl {
    grid-template-columns: 11rem 1fr;
    gap: 0.45rem 1rem;
  }
  .power dt {
    margin-top: 0;
    align-self: start;
    padding-top: 0.1rem;
  }
  .power dd { margin: 0; }
}

/* Quick file */
.quick {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 0.85rem 1rem;
  margin: 1rem 0 1.5rem;
}
.quick h2 {
  border: none;
  margin: 0 0 0.5rem;
  padding: 0;
  font-size: 1.05rem;
}
.quick ol {
  margin: 0;
  padding-left: 1.2rem;
}
.quick li {
  margin: 0.25rem 0;
  font-size: 0.95rem;
}

/* Pattern table + mobile cards */
.swipe-hint {
  font-size: 0.8rem;
  color: #555;
  display: none;
  margin: 0.35rem 0 0.25rem;
}
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.35rem 0 1.5rem;
  border: 1px solid var(--rule);
  background: var(--card);
}
.pattern {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 40rem;
}
.pattern th,
.pattern td {
  border-bottom: 1px solid var(--rule);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
  line-height: 1.35;
}
.pattern th {
  background: var(--ink);
  color: #fff;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  white-space: nowrap;
}
.pattern tr:last-child td { border-bottom: none; }
.pattern tr:nth-child(even) td { background: #f5f5f5; }

.pattern-cards {
  display: none;
  margin: 0.75rem 0 1.5rem;
  gap: 0.75rem;
}
.pattern-cards .card {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 0.75rem 0.9rem;
  margin: 0;
}
.pattern-cards .card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.35rem 0.65rem;
}
.pattern-cards .card dt {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0;
}
.pattern-cards .card dd {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

@media (max-width: 767px) {
  .swipe-hint { display: block; }
  .pattern-cards { display: grid; }
  /* Keep swipeable table; cards are the readable fallback */
  .table-scroll { margin-bottom: 0.75rem; }
}

@media (min-width: 768px) {
  .swipe-hint { display: none; }
  .pattern-cards { display: none; }
  .table-scroll { display: block; }
}

/* Badges — Fact neutral gray/navy; Commentary on callout */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  margin: 0 0 0.45rem;
  line-height: 1.2;
}
.badge-fact {
  background: #e8eef4;
  color: #1a3a5c;
  border: 1px solid #c5d0dc;
}
.badge-commentary {
  background: #fffaf3;
  color: #7a3b00;
  border: 1px solid #7a3b00;
}

/* Legacy inline labels (kept for about pages if any) */
.label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.label-fact {
  background: #e8eef4;
  color: #1a3a5c;
  border: 1px solid #c5d0dc;
}
.label-commentary {
  background: #fffaf3;
  color: #7a3b00;
  border: 1px solid #7a3b00;
}

.fact-block {
  margin: 0.75rem 0;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid #1a3a5c;
  background: #f4f7fa;
}
.commentary-box,
.commentary-block {
  margin: 0.75rem 0;
  padding: 0.85rem 1rem;
  border: 2px solid #7a3b00;
  background: #fffaf3;
  border-radius: 2px;
}
.fact-block > :first-child,
.commentary-box > :first-child,
.commentary-block > :first-child { margin-top: 0; }
.fact-block > :last-child,
.commentary-box > :last-child,
.commentary-block > :last-child { margin-bottom: 0; }
.fact-block p,
.commentary-box p,
.commentary-block p { margin: 0.35rem 0 0; }
.fact-block ul {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}

/* Episode packets */
.episode {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 1rem 1rem 1.15rem;
  margin: 1.25rem 0;
}
.episode h3 {
  margin-top: 0;
  font-size: 1.2rem;
}
.episode .meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}
.episode ul {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.2rem;
}
.episode li { margin: 0.2rem 0; }

blockquote.pull {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.4;
}
blockquote.pull cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-style: normal;
  color: var(--muted);
  font-family: var(--sans);
}

.primary-links {
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}
.primary-links li { margin: 0.25rem 0; }
.archive-pair { white-space: normal; }

/* Claims list */
.claims-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}
.claims-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}
.claims-list li:last-child { border-bottom: none; }
.claims-list strong { display: block; margin-bottom: 0.15rem; }

/* See also */
.seealso {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  display: grid;
  gap: 0.4rem;
}
.seealso a { font-weight: 600; }

/* Sources */
.sources {
  padding-left: 1.35rem;
  margin: 0.5rem 0;
  font-size: 0.92rem;
}
.sources li { margin: 0.4rem 0; }

/* Changelog / corrections */
.changelog,
.corrections {
  font-size: 0.92rem;
  color: var(--muted);
}
.changelog + .changelog { margin-top: 0.5rem; }

/* Footer */
.site {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}
.site p { margin: 0.35rem 0; }

/* About / disclaimer shared */
.kicker {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0.5rem 0 0;
}
.post-title {
  margin-top: 0.25rem;
}
.lede {
  font-size: 1.05rem;
  max-width: var(--measure);
}
.roles {
  padding-left: 1.2rem;
}
.roles li { margin: 0.5rem 0; }
.article-body { max-width: var(--measure); }
.meta { color: var(--muted); font-size: 0.9rem; }

/* Document screenshots / pull-quote figures */
.doc-shot {
  margin: 0.75rem 0 1rem;
  max-width: 36rem;
}
.doc-shot img {
  border: 1px solid var(--rule);
  background: #fff;
}


/* SKDK SVG network / money maps */
.network-diagram {
  margin: 1.25rem 0 1.75rem;
  padding: 1rem 1rem 0.75rem;
  border: 1px solid #c5d0dc;
  background: #f4f7fa;
  border-radius: 6px;
}
.network-diagram.svg-map {
  background: #eef2f6;
  scroll-margin-top: 5.5rem;
}
.network-caption {
  font-size: 0.85rem;
  color: #445566;
  margin: 0 0 0.85rem;
  font-weight: 600;
}
.power-svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: #dfe6ee;
  border-radius: 6px;
  border: 1px solid #c5d0dc;
}
.network-note { margin: 0.9rem 0 0; font-size: 0.88rem; color: #334455; }
@media (max-width: 640px) {
  .network-diagram { padding: 0.75rem 0.6rem 0.6rem; }
  .network-caption { font-size: 0.8rem; }
}


/* Original Grok dossier SVGs */
.diagram-frame.dark {
  background: #0b0e13;
  border-radius: 8px;
  padding: 0.5rem;
  overflow-x: auto;
}
.power-svg.orig-dossier {
  display: block;
  width: 100%;
  max-width: 1060px;
  height: auto;
  margin: 0 auto;
}
