:root {
  color-scheme: light;
  --ink: #11100e;
  --muted: #625f58;
  --paper: #f6f3ea;
  --paper-strong: #fffdf6;
  --line: #24211c;
  --line-soft: rgba(17, 16, 14, 0.18);
  --red: #b32324;
  --red-dark: #741113;
  --blue: #174d7a;
  --blue-pale: #dceaf1;
  --green: #156c4c;
  --amber: #966115;
  --shadow: 0 20px 60px rgba(17, 16, 14, 0.14);
  --font-display: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Avenir Next", Avenir, "Segoe UI", Helvetica, sans-serif;
  --font-mono: "Berkeley Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  background:
    linear-gradient(rgba(17, 16, 14, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 16, 14, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 18% 10%, rgba(179, 35, 36, 0.08), transparent 26%),
    linear-gradient(120deg, transparent 0 58%, rgba(23, 77, 122, 0.08) 58% 64%, transparent 64%);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

button,
a {
  touch-action: manipulation;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  color: var(--paper-strong);
  background: var(--ink);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0.65rem clamp(1rem, 3vw, 2rem);
  border-bottom: 2px solid var(--line);
  background: rgba(246, 243, 234, 0.94);
  backdrop-filter: blur(14px);
}

.brand-block {
  display: flex;
  align-items: center;
}

.brand-name,
.eyebrow {
  margin: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 800;
}

.eyebrow,
.kicker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.eyebrow,
.kicker {
  color: var(--red-dark);
}

.site-nav {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.site-nav a {
  padding: 0.45rem 0.55rem;
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  border-color: var(--line);
  background: var(--paper-strong);
}

.hero {
  display: flex;
  align-items: center;
  min-height: 0;
  padding: clamp(1.35rem, 3vw, 2.4rem) clamp(1rem, 4vw, 4rem) clamp(1.2rem, 2.5vw, 2rem);
  border-bottom: 2px solid var(--line);
}

.hero-copy {
  max-width: 1040px;
}

.kicker {
  display: inline-flex;
  margin: 0 0 0.5rem;
  padding: 0.28rem 0.42rem;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  box-shadow: 6px 6px 0 var(--blue);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 0.98;
}

h1 {
  max-width: 1100px;
  font-size: clamp(2.8rem, 6.2vw, 5.35rem);
  font-weight: 900;
}

h2 {
  font-size: clamp(1.7rem, 3.2vw, 3rem);
}

h3 {
  font-size: 1.12rem;
  line-height: 1.08;
}

.lede {
  max-width: 760px;
  margin: 0.55rem 0 0;
  color: #28241f;
  font-size: clamp(0.92rem, 1.3vw, 1.02rem);
  line-height: 1.45;
}

.content-section {
  padding: clamp(2.25rem, 5vw, 4rem) clamp(1rem, 4vw, 4rem);
}

#ledger {
  padding-top: clamp(1.15rem, 2.4vw, 2rem);
}

.section-heading {
  max-width: 920px;
}

.section-heading.compact {
  max-width: 680px;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.52;
}

.correction-copy p {
  color: var(--muted);
  line-height: 1.58;
}

.tip-card {
  border: 2px solid var(--line);
  background: var(--paper-strong);
}

.tip-card p {
  color: var(--muted);
  line-height: 1.6;
}

.ledger-table {
  margin-top: 1rem;
  overflow-x: auto;
  border: 2px solid var(--line);
  background: var(--paper-strong);
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

th,
td {
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}

th {
  color: var(--paper-strong);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  background: var(--ink);
}

td {
  font-size: 0.84rem;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.source-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.summary-cell {
  max-width: 500px;
  color: #2b2823;
}

.source-notes {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 1.45;
}

.tip-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--line-soft);
  background:
    linear-gradient(90deg, rgba(179, 35, 36, 0.08), transparent 38%),
    var(--blue-pale);
}

.tip-card {
  padding: clamp(0.9rem, 2.2vw, 1.4rem);
  box-shadow: 5px 5px 0 var(--red);
}

.tip-link {
  display: inline-flex;
  max-width: 100%;
  min-height: 44px;
  align-items: center;
  margin: 0.4rem 0 0.75rem;
  padding: 0.6rem 0.7rem;
  border: 2px solid var(--line);
  color: var(--paper-strong);
  font-family: var(--font-mono);
  font-size: clamp(0.82rem, 1.8vw, 0.98rem);
  font-weight: 900;
  text-decoration: none;
  background: var(--ink);
  overflow-wrap: anywhere;
}

.tip-link:hover,
.tip-link:focus-visible {
  color: var(--ink);
  background: var(--paper-strong);
}

.tip-note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.correction-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--line-soft);
  background: var(--ink);
  color: var(--paper-strong);
}

.correction-panel .eyebrow {
  color: #f1b7a7;
}

.correction-copy {
  display: grid;
  gap: 1rem;
}

.correction-copy p {
  margin: 0;
  color: #d8d1bf;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.85rem clamp(1rem, 4vw, 4rem);
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  background: var(--paper-strong);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .tip-panel,
  .correction-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .content-section {
    padding-right: clamp(1rem, 3vw, 2rem);
    padding-left: clamp(1rem, 3vw, 2rem);
  }

  .ledger-table {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  tbody {
    display: grid;
    gap: 0.85rem;
  }

  tr {
    border: 2px solid var(--line);
    background: var(--paper-strong);
    box-shadow: 4px 4px 0 rgba(23, 77, 122, 0.28);
  }

  td {
    display: grid;
    grid-template-columns: minmax(4.8rem, 0.34fr) minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.72rem 0.8rem;
    border-bottom: 1px solid var(--line-soft);
    font-size: 0.86rem;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--red-dark);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  td:nth-child(1),
  td:nth-child(4),
  td:nth-child(5) {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  td:nth-child(1) {
    font-size: 1rem;
    font-weight: 800;
  }

  .summary-cell {
    max-width: none;
  }

  .source-link {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    min-height: 40px;
    align-items: center;
    padding: 0.5rem 0.62rem;
    border: 2px solid var(--line);
    color: var(--paper-strong);
    text-decoration: none;
    background: var(--ink);
  }
}

@media (max-width: 720px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
  }

  .site-nav {
    width: 100%;
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 0;
  }

  h1 {
    font-size: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
