/* ============================================================
   FILEDMARK — "Official Document" design system
   Ink + Paper + Stamp Red, with a restrained Gold seal.
   Type: Spectral (display), Archivo (body), IBM Plex Mono (data)
   ============================================================ */

:root {
  /* ---- Color ---- */
  --ink:        #14161F;
  --ink-soft:   #2B2E3B;
  --ink-faint:  #5A5D6B;
  --paper:      #F7F3EA;
  --paper-deep: #EFE8D8;
  --paper-card: #FBF8F1;
  --rule:       #D8CFBC;   /* ledger lines */
  --rule-soft:  #E6DECD;
  --red:        #B23A2E;
  --red-deep:   #8E2B22;
  --red-ink:    #9A3026;
  --gold:       #9A7B3F;
  --gold-light: #C2A567;
  --gold-deep:  #6F5A2E;

  /* ---- Type ---- */
  --serif: "Spectral", Georgia, serif;
  --sans:  "Archivo", -apple-system, system-ui, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  /* ---- Metrics ---- */
  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 2px;
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* Paper texture — a whisper, ≤3% */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); position: relative; z-index: 2; }
section { position: relative; z-index: 2; }
.section-pad { padding-block: clamp(72px, 10vw, 130px); }

/* ============================================================
   TYPE
   ============================================================ */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: -0.01em; line-height: 1.04; }
.display {
  font-size: clamp(44px, 7.6vw, 96px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 0.98;
}
.h2 { font-size: clamp(30px, 4.4vw, 52px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.02; }
.h3 { font-size: clamp(21px, 2.4vw, 27px); font-weight: 600; }
.lede { font-size: clamp(18px, 2vw, 22px); line-height: 1.55; color: var(--ink-soft); }
p { margin: 0 0 1em; text-wrap: pretty; }

/* Section label — letter-spaced small caps, like a form field heading */
.label {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red-ink);
}
.label--ink { color: var(--ink-faint); }
.label--gold { color: var(--gold-deep); }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

/* ============================================================
   RULED FORM LINES — section dividers as filing-form rules
   ============================================================ */
.rule-line {
  display: flex; align-items: baseline; gap: 16px;
  border-top: 1.5px solid var(--ink);
  padding-top: 10px;
}
.rule-line .field {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-faint); white-space: nowrap;
}
.rule-line .field--no { color: var(--ink); }
.hr-ledger { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.hr-ledger--double { border-top: 3px double var(--rule); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-weight: 600; font-size: 16px;
  letter-spacing: 0.005em;
  padding: 15px 24px; border-radius: var(--radius);
  border: 1.5px solid transparent; text-decoration: none;
  transition: transform .12s ease, background .18s ease, box-shadow .18s ease, color .18s ease;
  position: relative;
}
.btn .price { font-family: var(--mono); font-weight: 600; }
.btn--stamp {
  background: var(--red); color: var(--paper);
  border-color: var(--red-deep);
  box-shadow: 0 1px 0 var(--red-deep), 0 10px 26px -14px rgba(178,58,46,.7);
}
.btn--stamp:hover { background: var(--red-deep); transform: translateY(-1px); }
.btn--ghost {
  background: transparent; color: var(--ink); border-color: var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--block { width: 100%; justify-content: center; }
.arrow { font-family: var(--mono); transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ============================================================
   THE DATE STAMP — brand mark
   ============================================================ */
.stamp {
  --stamp-rot: -7deg;
  color: var(--red);
  filter: drop-shadow(0 1px 0 rgba(142,43,34,.18));
}
.stamp svg { width: 100%; height: auto; }
.stamp .ink { mix-blend-mode: multiply; }

/* thunk animation */
@keyframes thunk {
  0%   { transform: rotate(var(--stamp-rot)) scale(1.55); opacity: 0; }
  55%  { transform: rotate(var(--stamp-rot)) scale(1.55); opacity: 0; }
  70%  { transform: rotate(calc(var(--stamp-rot) - 2deg)) scale(0.94); opacity: 1; }
  82%  { transform: rotate(calc(var(--stamp-rot) + 1deg)) scale(1.03); }
  100% { transform: rotate(var(--stamp-rot)) scale(1); opacity: 1; }
}
.stamp.is-stamping { animation: thunk 1.1s cubic-bezier(.2,.7,.2,1) both; }
@media (prefers-reduced-motion: reduce) {
  .stamp.is-stamping { animation: none; transform: rotate(var(--stamp-rot)); }
}

/* ============================================================
   CERTIFICATE / CARD
   ============================================================ */
.cert {
  background: var(--paper-card);
  border: 1.5px solid var(--ink);
  position: relative;
  box-shadow: 0 30px 60px -40px rgba(20,22,31,.55);
}
.cert::after {
  content: ""; position: absolute; inset: 6px; pointer-events: none;
  border: 1px solid var(--rule);
}
.cert-inner { position: relative; padding: clamp(22px, 3vw, 38px); }

/* perforated edge for filing slips */
.perf {
  position: relative;
  background: var(--paper-card);
  border: 1.5px dashed var(--rule);
  border-radius: var(--radius);
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   GOLD SEAL (treaty block)
   ============================================================ */
.seal { color: var(--gold); filter: drop-shadow(0 1px 1px rgba(111,90,46,.35)); }
.gold-rule { border-color: var(--gold-light) !important; }

/* ============================================================
   STICKY HEADER
   ============================================================ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px var(--gutter);
  background: color-mix(in oklab, var(--paper) 86%, transparent);
  backdrop-filter: blur(8px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transform: translateY(-110%);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .3s;
}
.topbar.show { transform: none; border-bottom-color: var(--ink); }
.topbar .wm { font-family: var(--serif); font-weight: 600; font-size: 20px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 9px; }
.topbar .btn { padding: 10px 18px; font-size: 14px; }

/* ============================================================
   UTIL
   ============================================================ */
.eyebrow-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .55; }
.kbd { font-family: var(--mono); font-size: 13px; }
.grid { display: grid; gap: clamp(16px, 2vw, 24px); }
.muted { color: var(--ink-faint); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* small-caps treaty citation link */
.cite {
  font-family: var(--mono); font-size: 13.5px; letter-spacing: .01em;
  color: var(--ink); text-decoration: none;
  border-bottom: 1.5px solid var(--gold-light);
  display: inline-flex; align-items: center; gap: 7px;
  transition: border-color .2s, color .2s;
}
.cite:hover { color: var(--red-ink); border-bottom-color: var(--red); }
.cite .seal-glyph { color: var(--gold); flex: none; }
