@font-face {
  font-family: "Quicksand";
  src: url("/assets/fonts/quicksand.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --ink: #0a0b1c;
  --ink-2: #111331;
  --ink-3: #1a1d45;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.5);
  --text: #ffffff;
  --body: rgba(255, 255, 255, 0.76);
  --label: rgba(255, 255, 255, 0.62);

  --l1: #ff4d4d; --l2: #ff9233; --l3: #ffd23f; --l4: #8be04e; --l5: #2fd9c4;
  --l6: #4c9bff; --l7: #9a74ff; --l8: #e55ce5; --l9: #ff7aab;
  --rainbow: linear-gradient(180deg, #ffb3c1, #ffd9a8, #fff3a8, #c4f5b0, #aef0ea, #b5cfff, #d9bfff);

  --pad: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { background: var(--ink); color-scheme: dark; scroll-behavior: smooth; }

body {
  font-family: "Quicksand", ui-rounded, system-ui, sans-serif;
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--body);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

::selection { background: var(--l5); color: var(--ink); }
:focus-visible { outline: 2px solid var(--l3); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--text); text-decoration-color: rgba(255, 255, 255, 0.35); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--l3); }
h1, h2, h3 { color: var(--text); font-weight: 500; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }

html { scrollbar-color: var(--ink-3) var(--ink); }

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

/* ---------- Site header ---------- */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: 72px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 1.05rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text); text-decoration: none;
}
.wordmark i { display: flex; gap: 2px; }
.wordmark i b { width: 4px; height: 14px; background: var(--c); }
.site-nav { display: flex; gap: clamp(16px, 3vw, 32px); }
.site-nav a { color: var(--label); text-decoration: none; font-size: 0.95rem; transition: color 0.2s; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--text); }

/* ---------- Ladder strip (footer + legal heads) ---------- */
.ladder-strip { display: flex; height: 6px; }
.ladder-strip span { flex: 1; background: var(--c); }
.ladder-strip span:last-child { background: var(--rainbow); }

/* ---------- Store badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.badges a { display: block; border-radius: 9px; transition: transform 0.3s var(--ease); }
.badges a:hover { transform: translateY(-2px); }
.badges img { height: 48px; width: auto; }

/* ---------- Footer ---------- */
.site-foot { margin-top: clamp(80px, 12vw, 160px); }
.site-foot .row {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 32px;
  padding-top: 28px; padding-bottom: 40px; font-size: 0.92rem; color: var(--label);
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.site-foot a { color: var(--label); text-decoration: none; }
.site-foot a:hover { color: var(--text); }

/* ---------- Legal / reading pages ---------- */
.doc { display: grid; grid-template-columns: 220px minmax(0, 68ch); gap: clamp(32px, 6vw, 96px); padding-top: clamp(40px, 7vw, 96px); }
.doc-head { grid-column: 1 / -1; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: end; }
.doc-chip {
  aspect-ratio: 1; width: 100%; background: var(--c);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 16px;
  color: var(--ink); line-height: 1.25;
}
.doc-chip strong { font-size: 2.6rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1; margin-bottom: 8px; }
.doc-chip span { font-size: 0.85rem; font-weight: 600; }
.doc-chip small { font-size: 0.8rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.04em; }
.doc-head h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 400; }
.doc-head p { margin-top: 16px; color: var(--label); }

.toc { position: sticky; top: 32px; align-self: start; font-size: 0.92rem; }
.toc ol { list-style: none; display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 16px; }
.toc a { display: flex; gap: 10px; align-items: center; padding: 5px 0; color: var(--label); text-decoration: none; }
.toc a::before { content: ""; width: 8px; height: 8px; flex: none; background: var(--c); }
.toc a:hover { color: var(--text); }

.prose > section { padding-top: 40px; scroll-margin-top: 24px; }
.prose > section + section { margin-top: 32px; border-top: 1px solid var(--line); }
.prose h2 { display: flex; align-items: baseline; gap: 14px; font-size: 1.6rem; margin-bottom: 16px; }
.prose h2::before { content: ""; width: 12px; height: 12px; flex: none; background: var(--c); transform: translateY(-1px); }
.prose h3 { font-size: 1.15rem; margin: 28px 0 8px; }
.prose p + p, .prose p + ul, .prose ul + p, .prose dl + p { margin-top: 14px; }
.prose ul { list-style: none; display: grid; gap: 8px; margin-top: 14px; }
.prose ul li { padding-left: 20px; position: relative; }
.prose ul li::before { content: ""; position: absolute; left: 2px; top: 0.7em; width: 6px; height: 1px; background: var(--line-strong); }
.prose strong { color: var(--text); font-weight: 600; }
.prose dl { display: grid; grid-template-columns: minmax(120px, 0.4fr) 1fr; border-top: 1px solid var(--line); margin-top: 16px; }
.prose dt, .prose dd { padding: 12px 0; border-bottom: 1px solid var(--line); }
.prose dt { color: var(--label); padding-right: 16px; }
.prose dd { color: var(--text); }
.prose section > dl:last-child > :nth-last-child(-n+2) { border-bottom: 0; }
.prose .lead { font-size: 1.2rem; color: var(--text); line-height: 1.55; }

@media (max-width: 860px) {
  .doc, .doc-head { grid-template-columns: 1fr; }
  .doc-chip { width: 132px; }
  .doc-chip strong { font-size: 1.8rem; }
  .toc { position: static; }
  .toc ol { grid-template-columns: 1fr 1fr; column-gap: 16px; }
}
@media (max-width: 520px) {
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 0.88rem; }
  .toc ol { grid-template-columns: 1fr; }
  .prose dl { grid-template-columns: 1fr; }
  .prose dt { padding-bottom: 0; border-bottom: 0; }
  .prose dd { padding-top: 2px; }
}

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