/* Ipamorelin Order — broadside aesthetic
 * Dark editorial canvas (#111111), cream type (#F0ECE5), fire-orange accent (#E85D26).
 * Wood-type stacked display (Abril Fatface + Big Shoulders Display), Source Serif 4 body,
 * IBM Plex Mono for indices/identifiers. 1790-era broadside-handbill register.
 */

:root {
  --primary: #E85D26;
  --primary-50: #FBE6DA;
  --primary-900: #9B3914;
  --secondary: #F0ECE5;

  --neutral-50: #F0ECE5;
  --neutral-100: #E0DCD3;
  --neutral-200: #3A3A36;
  --neutral-300: #2A2A26;
  --neutral-500: #888880;
  --neutral-700: #5C5C56;
  --neutral-900: #0A0A09;

  --background: #111111;
  --background-alt: #1A1A18;
  --surface: #1A1A18;
  --surface-elevated: #22221F;
  --ink-panel: #F0ECE5;

  --text: #F0ECE5;
  --text-strong: #FFFFFF;
  --text-muted: #B8B5AD;
  --text-on-cream: #111111;
  --text-muted-on-cream: #5C5C56;

  --rule: #3A3A36;
  --rule-cream: #C8C2B5;
  --rule-strong: #E85D26;
  --accent: #E85D26;
  --accent-smoke: #282826;

  --success: #7AB178;
  --warning: #E85D26;
  --danger: #D9482A;

  --font-display: 'Abril Fatface', 'Bodoni 72', 'Bodoni Moda', 'Playfair Display', Georgia, serif;
  --font-heading: 'Big Shoulders Display', 'Oswald', 'Bebas Neue', 'Helvetica Neue', sans-serif;
  --font-body: 'Source Serif 4', 'Source Serif Pro', 'Georgia', 'Times New Roman', serif;
  --font-mono: 'IBM Plex Mono', 'JetBrains Mono', 'Courier New', monospace;

  --outer-max: 76rem;
  --sheet-max: 60rem;
  --article-max: 44rem;
  --container-px: clamp(1.25rem, 4vw, 2.5rem);

  --tracking-smallcaps: 0.22em;
  --tracking-mono-caps: 0.14em;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; }
img, picture, svg { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }

/* ---------- Base ---------- */
html { background: var(--background); }
body {
  background: var(--background);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule-cream);
  transition: color 200ms ease-out, text-decoration-color 200ms ease-out;
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

::selection { background: var(--accent); color: #111111; }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Containers ---------- */
.outer {
  width: 100%;
  max-width: var(--outer-max);
  margin: 0 auto;
  padding-left: var(--container-px);
  padding-right: var(--container-px);
}

.sheet {
  width: 100%;
  max-width: var(--sheet-max);
  margin: 0 auto;
}

.article-col {
  max-width: var(--article-max);
  margin: 0 auto;
}

/* ---------- Skip-link ---------- */
.skip-link {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 1rem; top: 1rem;
  width: auto; height: auto;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: #111;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: var(--tracking-mono-caps);
  text-transform: uppercase;
  text-decoration: none;
  z-index: 9999;
}

/* ---------- Marquee band (index only) ---------- */
.marquee-band {
  background: var(--neutral-50);
  color: var(--background);
  border-bottom: 3px solid var(--accent);
  overflow: hidden;
  position: relative;
}
.marquee-band__track {
  display: inline-flex;
  white-space: nowrap;
  animation: marquee 45s linear infinite;
  padding: 0.5rem 0;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: var(--tracking-mono-caps);
  text-transform: uppercase;
  color: var(--text-on-cream);
}
.marquee-band__phrase { padding: 0 1.5rem; }
.marquee-band__phrase + .marquee-band__phrase::before {
  content: "·";
  color: var(--accent);
  padding-right: 1.5rem;
  font-weight: 700;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-band__track { animation: none; }
}

/* ---------- Site header ---------- */
.site-header {
  background: var(--background);
  border-bottom: 1px solid var(--accent);
  position: relative;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
  min-height: 3.5rem;
  flex-wrap: wrap;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
}
.site-brand:hover { color: var(--text); }
.site-brand__mark {
  width: 10px; height: 10px;
  background: var(--accent);
  flex: 0 0 10px;
  margin-top: 4px;
}
.site-brand__type {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.site-brand__wordmark {
  font-family: var(--font-heading);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1.0625rem;
  color: var(--text);
}
.site-brand__sub {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: var(--tracking-mono-caps);
  text-transform: uppercase;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  align-items: center;
}
.site-nav a {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: var(--tracking-mono-caps);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  position: relative;
  padding: 0.35rem 0;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 1px;
  background: var(--accent);
  transition: right 200ms ease-out;
}
.site-nav a:hover::after { right: 0; }
.site-nav a[aria-current="page"] {
  color: var(--accent);
}
.site-nav a[aria-current="page"]::after { right: 0; height: 2px; bottom: -4px; }
.site-nav li + li::before {
  content: "·";
  color: var(--accent);
  margin-right: 1.1rem;
  margin-left: -0.7rem;
  pointer-events: none;
}

/* ---------- Typography ---------- */
.display-h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.5rem, 9vw, 8rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--text);
}
h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.75rem, 6vw, 5rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--text);
}
h2 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(1.875rem, 4vw, 2.875rem);
  line-height: 1.05;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  color: var(--text);
}
h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text);
}
h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono-caps);
  color: var(--text);
}

p { font-size: 1.0625rem; line-height: 1.6; }
p + p { margin-top: 1.1rem; }

.lede {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--text);
}

small, .small { font-size: 0.875rem; }
.micro { font-size: 0.75rem; }

strong, b { color: var(--text-strong); font-weight: 700; }

em, i { font-style: italic; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: var(--tracking-smallcaps);
  text-transform: uppercase;
  color: var(--text-muted);
}

.dateline {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: var(--tracking-mono-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Rules / ink-bars ---------- */
.rule-fire {
  display: block;
  height: 3px;
  background: var(--accent);
  border: 0;
  margin: 0;
}
.rule-cream {
  display: block;
  height: 1px;
  background: var(--rule-cream);
  border: 0;
  margin: 0;
  opacity: 0.55;
}
.rule-fire-thin {
  display: block;
  height: 1px;
  background: var(--accent);
  border: 0;
  margin: 0;
}
.rule-double {
  display: block;
  height: 7px;
  border: 0;
  background:
    linear-gradient(to bottom,
      var(--rule-cream) 0, var(--rule-cream) 2px,
      transparent 2px, transparent 5px,
      var(--rule-cream) 5px, var(--rule-cream) 7px);
  opacity: 0.85;
}

/* ---------- Masthead (hero) ---------- */
.masthead {
  padding: 3rem 0 2rem;
  text-align: center;
}
.masthead .sheet { display: flex; flex-direction: column; gap: 0; }
.masthead__dateline {
  display: block;
  padding: 0.65rem 0 0.55rem;
  text-align: center;
}
.masthead__eyebrow {
  display: block;
  padding: 0.9rem 0 0.45rem;
  text-align: center;
}
.masthead__h1 { padding: 0.25rem 0; }
.masthead__sub {
  font-family: var(--font-heading);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--accent);
  font-size: clamp(1.25rem, 3vw, 2rem);
  letter-spacing: 0;
  padding: 0.4rem 0 0.85rem;
  line-height: 1.05;
}
.masthead__notice {
  display: block;
  padding: 0.9rem 0;
  text-align: center;
}
.masthead__lede {
  max-width: var(--article-max);
  margin: 1.5rem auto 0;
  text-align: center;
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--text);
  padding: 0 var(--container-px);
}
.masthead__cta-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* Page-level hero (research/dosage/etc) — smaller than the index masthead */
.page-hero {
  padding: 2.5rem 0 1.5rem;
}
.page-hero__sheet { text-align: center; }
.page-hero h1,
.page-hero__h1 { font-size: clamp(2.5rem, 5.5vw, 4.25rem); margin: 1.5rem 0 0.4rem; }
.page-hero__eyebrow {
  display: block;
  padding: 0.65rem 0 0.45rem;
}
.page-hero__seal { margin-top: 1.5rem; }
.plate-wrap { margin-top: 1.5rem; }
.broadside-item__h2--inset { font-size: clamp(1.5rem, 3vw, 2.25rem); }
.rule-cream--gap { margin: 0.5rem 0 1rem; }
.broadside-item__seal--wide { margin-top: 1.5rem; }
.page-hero__sub {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1.5;
  max-width: var(--article-max);
  margin: 1rem auto 0;
  padding: 0 var(--container-px);
}
.page-hero__cta-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* ---------- Plate (figure) ---------- */
.plate {
  margin: 2rem auto;
  padding: 0;
  max-width: var(--sheet-max);
}
.plate__frame {
  border: 1px solid var(--accent);
  padding: 6px;
  background: var(--background);
}
.plate__frame--cream {
  border: 1px solid var(--accent);
  padding: 6px;
  background: var(--neutral-50);
}
.plate__img {
  display: block;
  width: 100%;
  height: auto;
}
.plate__caption {
  margin-top: 0.85rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.plate__caption-num {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: var(--tracking-mono-caps);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.plate__caption hr.rule-cream { margin-bottom: 0.5rem; }
.plate__caption-text {
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--text);
}

/* ---------- Broadside items / sections ---------- */
.broadside-item {
  padding: 2.25rem 0 1.5rem;
}
.broadside-item__sheet { margin: 0 auto; }
.broadside-item__index {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: var(--tracking-mono-caps);
  text-transform: uppercase;
  color: var(--accent);
  margin: 0.85rem 0 0.4rem;
}
.broadside-item__h2 {
  margin: 0.25rem 0 0.4rem;
}
.broadside-item__body {
  margin: 1.25rem 0 0;
  max-width: var(--article-max);
  margin-left: auto;
  margin-right: auto;
}
.broadside-item__body p { margin-bottom: 1.05rem; }
.broadside-item__body p:last-child { margin-bottom: 0; }
.broadside-item__seal {
  margin-top: 1.5rem;
}

.broadside-item__body ul,
.broadside-item__body ol {
  margin: 0.5rem 0 1.05rem 1.5rem;
  padding-left: 0.5rem;
}
.broadside-item__body li { margin-bottom: 0.4rem; }
.broadside-item__body ol li::marker {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 500;
}
.broadside-item__body ul li::marker {
  color: var(--accent);
}

/* ---------- Drop letter (index/about) ---------- */
.drop-letter {
  float: left;
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--accent);
  font-size: 6em;
  line-height: 0.85;
  margin: 0.15em 0.5rem 0 0;
  padding: 0.05em 0.25rem 0.05em 0;
  border-left: 1px solid var(--rule-cream);
  border-top: 1px solid var(--rule-cream);
  border-bottom: 1px solid var(--rule-cream);
  padding-left: 0.18em;
}
@media (max-width: 540px) {
  .drop-letter { font-size: 4.5em; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: var(--tracking-mono-caps);
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.875rem 1.5rem;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 200ms ease-out, color 200ms ease-out, border-color 200ms ease-out;
  border: 1px solid transparent;
  position: relative;
  line-height: 1.1;
}
.btn-primary {
  background: var(--accent);
  color: #111111;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: #FF7A4A;
  color: #111111;
}
.btn-primary::after {
  content: "";
  position: absolute;
  left: 1.5rem; right: 100%;
  bottom: 0.4rem;
  height: 1px;
  background: var(--neutral-50);
  transition: right 200ms ease-out;
}
.btn-primary:hover::after { right: 1.5rem; }

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--neutral-50);
  color: var(--neutral-50);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}

.btn-ghost {
  background: transparent;
  border: 0;
  color: var(--neutral-50);
  padding: 0.5rem 0;
  position: relative;
}
.btn-ghost::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 1px;
  background: var(--neutral-50);
  transition: background 200ms ease-out;
}
.btn-ghost:hover::after { background: var(--accent); }

/* ---------- Pull quote ---------- */
.pull-quote {
  position: relative;
  max-width: var(--article-max);
  margin: 2.25rem auto;
  padding: 1.5rem 1rem 1.5rem 3rem;
  border-top: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.35;
  color: var(--text);
  text-align: left;
}
.pull-quote::before {
  content: "\201C";
  position: absolute;
  left: 0.25rem;
  top: 0.6rem;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 4rem;
  line-height: 1;
  color: var(--neutral-50);
}
.pull-quote__attr {
  display: block;
  margin-top: 1rem;
  font-family: var(--font-heading);
  font-style: normal;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: var(--tracking-smallcaps);
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Callout ---------- */
.callout {
  margin: 1.75rem auto;
  max-width: var(--article-max);
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border-top: 3px solid var(--accent);
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--accent);
  border-radius: 0;
}
.callout__eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: var(--tracking-mono-caps);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.callout hr.rule-cream { margin-bottom: 0.85rem; }
.callout p { font-size: 1rem; line-height: 1.55; }

/* ---------- Card (broadside item card) ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.card::before {
  content: "";
  display: block;
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--accent);
}
.card__index {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: var(--tracking-mono-caps);
  text-transform: uppercase;
  color: var(--accent);
}
.card__title {
  margin: 0.25rem 0 0.65rem;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--text);
}
.card__body p { font-size: 1rem; line-height: 1.6; }

/* ---------- Cream sheet inset (used on /about and /faq) ---------- */
.cream-sheet {
  background: var(--neutral-50);
  color: var(--text-on-cream);
  border: 1px solid var(--rule-cream);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  margin: 2rem auto;
  max-width: var(--sheet-max);
}
.cream-sheet h2,
.cream-sheet h3,
.cream-sheet h4 { color: var(--text-on-cream); }
.cream-sheet p { color: var(--text-on-cream); }
.cream-sheet a { color: var(--primary-900); text-decoration-color: var(--rule-cream); }
.cream-sheet a:hover { color: var(--accent); }
.cream-sheet .broadside-item__index { color: var(--primary-900); }

/* ---------- Inline code (peptide sequences, CAS, NCT, etc) ---------- */
code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-elevated);
  padding: 0.125rem 0.5rem;
  border-radius: 0;
  border-left: 1px solid var(--accent);
  color: var(--text);
  vertical-align: baseline;
  line-height: 1.4;
}
.cream-sheet code {
  background: var(--neutral-100);
  color: var(--text-on-cream);
  border-left: 1px solid var(--accent);
}

/* ---------- Chip ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: var(--tracking-mono-caps);
  text-transform: uppercase;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: 0;
}
.chip--filled { background: var(--accent); color: #111111; }
.chip--cream { border-color: var(--neutral-50); color: var(--neutral-50); }
.chip--danger { border-color: var(--danger); color: var(--danger); }
.chip--missed { border-color: var(--danger); color: var(--danger); }
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
  justify-content: center;
}

/* ---------- Tables (broadside) ---------- */
.broadside-table-wrap {
  overflow-x: auto;
  margin: 1.5rem auto;
  max-width: var(--article-max);
}
table.broadside {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--rule-cream);
  font-size: 0.9375rem;
}
table.broadside thead th {
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: var(--tracking-mono-caps);
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--rule-cream);
}
table.broadside tbody td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
table.broadside tbody tr:last-child td { border-bottom: 0; }
table.broadside td.num,
table.broadside th.num {
  font-family: var(--font-mono);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  color: var(--text);
}
table.broadside th.num { color: var(--accent); }

/* ---------- References list ---------- */
.references-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  max-width: var(--article-max);
  margin-left: auto;
  margin-right: auto;
}
.references-list li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.references-list li:last-child { border-bottom: 0; }
.references-list__num {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--accent);
  letter-spacing: var(--tracking-mono-caps);
}
.references-list__body { font-size: 1rem; line-height: 1.55; }
.references-list__meta {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.references-list__meta a { color: var(--text-muted); }
.references-list__meta a:hover { color: var(--accent); }

/* ---------- Inline citations ---------- */
sup.citation {
  font-family: var(--font-mono);
  font-size: 0.7em;
  vertical-align: super;
  line-height: 1;
  margin: 0 0.05em;
}
sup.citation a {
  text-decoration: none;
  color: var(--accent);
  padding: 0 0.2em;
  border-bottom: 1px dotted var(--accent);
  cursor: help;
}
sup.citation a:hover { color: var(--text); border-color: var(--text); }

/* ---------- Contact form ---------- */
.contact-form {
  max-width: var(--article-max);
  margin: 1.5rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-form label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: var(--tracking-mono-caps);
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}
.contact-form textarea { min-height: 9rem; resize: vertical; }
.contact-form .field-required::after {
  content: " *";
  color: var(--accent);
}
.contact-form__actions { margin-top: 0.5rem; }
.contact-form__note {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--neutral-900);
  color: var(--text);
  margin-top: 4rem;
  padding: 0 0 1.5rem;
}
.site-footer__columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  padding: 2.5rem 0 1.5rem;
}
@media (min-width: 768px) {
  .site-footer__columns {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.site-footer__col h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: var(--tracking-mono-caps);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}
.site-footer__col ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.site-footer__col a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9375rem;
  line-height: 1.4;
}
.site-footer__col a:hover { color: var(--accent); }
.site-footer__col--colophon a { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
.site-footer__col--colophon a:hover { color: var(--accent); }

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-cream);
  opacity: 0.85;
}
.site-footer__disclaimer {
  font-style: italic;
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 48rem;
}
.site-footer__mark {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: var(--tracking-mono-caps);
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.site-footer__copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}

/* ---------- 404 ---------- */
.notfound {
  text-align: center;
  padding: 4rem 0 6rem;
}
.notfound__big {
  font-family: var(--font-display);
  font-size: clamp(6rem, 18vw, 12rem);
  color: var(--accent);
  line-height: 1;
}
.notfound h1 { font-size: clamp(2rem, 5vw, 3rem); margin-top: 1rem; }
.notfound p { max-width: 36rem; margin: 1.25rem auto 0; }

/* ---------- Tippy theme override ---------- */
.tippy-box[data-theme~="ipam-broadside"] {
  background: var(--neutral-50);
  color: var(--text-on-cream);
  border: 1px solid var(--accent);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.45;
  padding: 0;
}
.tippy-box[data-theme~="ipam-broadside"] .tippy-content {
  padding: 0.75rem 0.9rem;
}
.tippy-box[data-theme~="ipam-broadside"][data-placement^='top'] > .tippy-arrow::before {
  border-top-color: var(--accent);
}
.tippy-box[data-theme~="ipam-broadside"][data-placement^='bottom'] > .tippy-arrow::before {
  border-bottom-color: var(--accent);
}
.tippy-box[data-theme~="ipam-broadside"][data-placement^='left'] > .tippy-arrow::before {
  border-left-color: var(--accent);
}
.tippy-box[data-theme~="ipam-broadside"][data-placement^='right'] > .tippy-arrow::before {
  border-right-color: var(--accent);
}

/* ---------- Layout helpers ---------- */
.section { padding: 2rem 0; }
.section--narrow { padding: 1.5rem 0; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-6 { margin-top: 3rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .site-nav ul { gap: 0.2rem 0.85rem; }
  .site-nav li + li::before { margin-right: 0.85rem; margin-left: -0.5rem; }
  .masthead { padding-top: 2rem; }
  .pull-quote { padding-left: 2rem; font-size: 1.35rem; }
  .pull-quote::before { font-size: 3rem; top: 0.3rem; }
}

@media (max-width: 480px) {
  .references-list li {
    grid-template-columns: 2.5rem 1fr;
    gap: 0.5rem;
  }
  .marquee-band__track { font-size: 0.6875rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
  }
  html { scroll-behavior: auto; }
}
