@font-face {
  font-family: "Addiction";
  src: url("/Addiction.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Campton";
  src: url("/Campton Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Campton";
  src: url("/Campton Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000000;
  --fg: #D7BEA0;
  --fg-dim: rgba(215, 190, 160, 0.62);
  --fg-faint: rgba(215, 190, 160, 0.18);
  --rule: rgba(215, 190, 160, 0.22);
  --measure: 68ch;
}

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

html {
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 5vw, 3rem) 6rem;
  font-family: "Campton", "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  font-size: clamp(15px, 1.05vw + 0.5rem, 17px);
  line-height: 1.65;
  letter-spacing: 0.005em;
}

main {
  max-width: var(--measure);
  margin: 0 auto;
}

header.page-header {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}

.kicker {
  font-family: "Campton", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--fg-dim);
  margin: 0 0 1rem;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Addiction", "Times New Roman", serif;
  font-weight: normal;
  color: var(--fg);
  line-height: 1.15;
  letter-spacing: 0.005em;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  margin: 0 0 1.5rem;
}

h2 {
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  margin: 3rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

h3 {
  font-size: clamp(1.1rem, 1.4vw, 1.25rem);
  margin: 2.25rem 0 0.85rem;
}

h4 {
  font-size: 1rem;
  margin: 1.5rem 0 0.6rem;
}

p, ul, ol, table {
  margin: 0 0 1.15rem;
}

p {
  hanging-punctuation: first;
}

a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--fg-faint);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 120ms ease;
}

a:hover {
  text-decoration-color: var(--fg);
}

strong, b {
  font-family: "Campton", sans-serif;
  font-weight: 700;
}

em, i {
  font-style: italic;
}

ul, ol {
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

li::marker {
  color: var(--fg-dim);
}

blockquote {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.25rem;
  border-left: 2px solid var(--fg);
  background: rgba(215, 190, 160, 0.04);
  font-size: 0.95em;
}

blockquote p:last-child {
  margin-bottom: 0;
}

code {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: var(--fg);
  background: rgba(215, 190, 160, 0.08);
  padding: 0.1em 0.4em;
  border-radius: 2px;
  letter-spacing: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

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

th {
  font-family: "Campton", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--fg-dim);
}

tr:last-child td {
  border-bottom: none;
}

.meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1.5rem;
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

.meta dt {
  font-family: "Campton", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--fg-dim);
  align-self: center;
}

.meta dd {
  margin: 0;
}

.toc {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 2rem;
  font-size: 0.9rem;
  columns: 2;
  column-gap: 2rem;
}

.toc li {
  margin: 0 0 0.35rem;
  break-inside: avoid;
}

.index-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}

.index-list li {
  border-top: 1px solid var(--rule);
  margin: 0;
}

.index-list li:last-child {
  border-bottom: 1px solid var(--rule);
}

.index-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  padding: 1.15rem 0;
  text-decoration: none;
  font-family: "Addiction", serif;
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
}

.index-list a::after {
  content: "→";
  font-family: "Campton", sans-serif;
  font-size: 0.9rem;
  color: var(--fg-dim);
  transition: transform 160ms ease, color 160ms ease;
}

.index-list a:hover::after {
  transform: translateX(4px);
  color: var(--fg);
}

.index-list .label {
  font-family: "Campton", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.68rem;
  color: var(--fg-dim);
  display: block;
  margin-bottom: 0.25rem;
}

footer.page-footer {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--fg-dim);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

footer.page-footer a {
  color: var(--fg-dim);
}

footer.page-footer a:hover {
  color: var(--fg);
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

@media (max-width: 560px) {
  .toc { columns: 1; }
  .meta { grid-template-columns: 1fr; gap: 0.1rem 0; }
  .meta dd { margin-bottom: 0.5rem; }
  table { font-size: 0.85em; }
  th, td { padding: 0.55rem 0.5rem; }
}
