/* ---------- tokens ---------- */
:root {
  --paper: #ede2c4;
  --paper-alt: #fff7dc;
  --paper-shadow: #c9bd9b;
  --ink: #15120e;
  --ink-faded: #3d3830;
  --stamp: #a82820;
  --rule: #15120e33;
  --highlight: #f5d547;

  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-type: 'Special Elite', 'Courier New', cursive;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 14px;
  --space-4: 22px;
  --space-5: 32px;
  --space-6: 56px;
  --space-7: 96px;
}

/* ---------- reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

::selection { background: var(--ink); color: var(--highlight); }

/* ---------- base ---------- */
html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    radial-gradient(ellipse 400px 300px at 85% 15%, rgba(80, 50, 20, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 300px 200px at 10% 90%, rgba(80, 50, 20, 0.05) 0%, transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.14 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.65;
}

p { margin-bottom: 20px; max-width: 62ch; }

p strong {
  background: var(--ink);
  color: var(--paper);
  padding: 1px 6px;
  font-weight: 700;
}

p a, .footer a, .signature a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: var(--stamp);
}

p a:hover { color: var(--stamp); }

/* ---------- layout ---------- */
.sheet {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 40px 120px;
}

header { margin-bottom: var(--space-6); }
section { margin: 64px 0; }

.doc-meta {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  border-bottom: 1px dashed var(--rule);
  padding-bottom: var(--space-3);
  margin-bottom: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  text-transform: uppercase;
}

.lang select {
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  padding: 3px 22px 3px 8px;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--stamp) 50%), linear-gradient(-45deg, transparent 50%, var(--stamp) 50%);
  background-position: right 9px center, right 5px center;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.lang select:hover { border-color: var(--stamp); color: var(--stamp); }

/* ---------- headings ---------- */
h1 {
  font-family: var(--font-type);
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin-bottom: 24px;
}

h1 .yell {
  color: var(--stamp);
  display: inline-block;
  transform: rotate(-1deg);
  transition: transform 0.2s ease;
}

h1:hover .yell { transform: rotate(2deg) scale(1.04); }

h1 .strike { position: relative; display: inline-block; }
h1 .strike::after {
  content: "";
  position: absolute;
  inset: 50% -6px auto -6px;
  height: 6px;
  background: var(--stamp);
  transform: rotate(-2deg);
}

h2 {
  font-family: var(--font-type);
  font-size: 1.8rem;
  margin-bottom: var(--space-4);
  letter-spacing: 0.01em;
  line-height: 1.1;
}
h2::before { content: "§ "; color: var(--stamp); }

/* ---------- lede ---------- */
.lede {
  font-size: 1.15rem;
  font-weight: 500;
  max-width: 56ch;
  line-height: 1.5;
}

.marker {
  background: var(--highlight);
  padding: 0 4px;
  box-shadow: -2px 0 0 var(--highlight), 2px 0 0 var(--highlight);
}

/* ---------- blockquote ---------- */
blockquote {
  margin: var(--space-5) 0;
  padding: var(--space-4) 26px;
  background: var(--paper-alt);
  border-left: 5px solid var(--stamp);
  font-size: 0.95rem;
  color: var(--ink-faded);
  position: relative;
  box-shadow: 3px 4px 0 var(--paper-shadow);
  transform: rotate(-0.3deg);
}

blockquote .exhibit-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--stamp);
  margin-bottom: 12px;
  font-weight: 800;
}

blockquote em {
  display: block;
  margin-top: var(--space-3);
  font-style: normal;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

blockquote em::before { content: "> "; color: var(--stamp); }

/* ---------- ordered rules list ---------- */
ol {
  margin: 20px 0;
  padding-left: 0;
  list-style: none;
  counter-reset: rule;
}

ol li {
  counter-increment: rule;
  padding: var(--space-3) 0 var(--space-3) 64px;
  position: relative;
  border-bottom: 1px dashed var(--rule);
  max-width: 62ch;
}

ol li:last-child { border-bottom: none; }

ol li::before {
  content: counter(rule, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 10px;
  font-family: var(--font-type);
  font-size: 1.6rem;
  color: var(--stamp);
  font-weight: 700;
}

/* ---------- shout ---------- */
.shout {
  margin: 48px 0;
  padding: var(--space-5);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-type);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  line-height: 1.15;
  text-align: center;
  transform: rotate(-0.5deg);
  box-shadow: 4px 6px 0 var(--stamp);
}

.shout span { color: var(--highlight); }

/* ---------- url tag ---------- */
.url-tag-big {
  display: inline-block;
  background: var(--highlight);
  color: var(--ink);
  padding: var(--space-2) 18px;
  font-family: var(--font-type);
  font-size: 1.6rem;
  font-weight: 700;
  transform: rotate(-1deg);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.url-tag-big:hover { transform: rotate(-1deg) translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.url-tag-big:active { transform: rotate(-1deg) translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

/* ---------- scribble & stamp ---------- */
.scribble {
  position: absolute;
  font-family: var(--font-type);
  color: var(--stamp);
  font-size: 0.9rem;
  transform: rotate(-8deg);
  opacity: 0.85;
  pointer-events: none;
}

.scribble-1 { top: 380px; right: 4px; }
.scribble-2 { top: 920px; left: -10px; transform: rotate(6deg); }

.stamp {
  position: absolute;
  top: 50px;
  right: 24px;
  transform: rotate(-11deg);
  border: 5px solid var(--stamp);
  color: var(--stamp);
  padding: 10px 22px 8px;
  font-family: var(--font-type);
  font-size: 1.8rem;
  letter-spacing: 0.08em;
  opacity: 0.82;
  text-transform: uppercase;
  pointer-events: none;
  mix-blend-mode: multiply;
  line-height: 1;
}

/* ---------- signature & footer ---------- */
.signature {
  margin-top: var(--space-7);
  padding-top: 28px;
  border-top: 2px solid var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
}

.signature .name { font-family: var(--font-type); font-size: 1.2rem; }

.signature small {
  font-size: 0.72rem;
  color: var(--ink-faded);
  letter-spacing: 0.05em;
  max-width: 38ch;
  text-align: right;
}

.footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: 0.75rem;
  color: var(--ink-faded);
  letter-spacing: 0.04em;
}
.footer p { max-width: none; margin-bottom: var(--space-2); }

/* ---------- atomic utilities ---------- */
.u-center      { text-align: center; max-width: none; }
.u-muted       { color: var(--ink-faded); }
.u-small       { font-size: 0.88rem; }
.u-mt-lg       { margin-top: var(--space-5); }
.u-mt-md       { margin-top: var(--space-4); }

/* ---------- responsive ---------- */
@media (max-width: 700px) {
  .sheet { padding: var(--space-6) var(--space-4) 80px; }
  .stamp { top: 20px; right: 12px; font-size: 1.2rem; padding: 7px 14px 5px; border-width: 4px; }
  .doc-meta { font-size: 0.62rem; }
  blockquote { padding: 16px 18px; font-size: 0.86rem; }
  ol li { padding-left: 46px; }
  ol li::before { font-size: 1.3rem; }
  .scribble { display: none; }
  .shout { padding: 24px 18px; }
}
