/* Handoutly design tokens and base elements. The only source of colours, radii and type sizes.
   Look: warm paper, dark ink, one highlighter-yellow mark. No purple, no emojis. */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #fbfaf6;
  --paper-2: #f3f1ea;
  --card: #ffffff;
  --ink: #15171a;
  --ink-2: #4a4f57;
  --ink-3: #7b8089;
  --line: #e4e1d8;
  --line-2: #d2cec2;
  --mark: #ffe45c;          /* highlighter: marks and the "copied" state, never large areas */
  --mark-soft: #fff6c2;
  --ok: #1e7f4f;
  --ok-soft: #e3f3ea;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --focus: #1a5fb4;

  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 22px;
  --shadow: 0 1px 2px rgba(21, 23, 26, 0.06), 0 8px 24px rgba(21, 23, 26, 0.06);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 0.8125rem;
  --fs-s: 0.9375rem;
  --fs: 1.0625rem;
  --fs-l: 1.25rem;
  --fs-xl: 1.625rem;
  --fs-2xl: clamp(2rem, 6vw, 3.25rem);

  --tap: 48px;              /* minimum height of anything a thumb should hit */
  --col: 720px;
}

/* Dark look (premium theme option for hosted pages): set data-theme="dark" on <html>. */
[data-theme="dark"] {
  --paper: #121417;
  --paper-2: #1a1d21;
  --card: #1b1e23;
  --ink: #f3f1ea;
  --ink-2: #b9bcc2;
  --ink-3: #8a8e96;
  --line: #2b2f36;
  --line-2: #3a3f47;
  --mark-soft: #3a3410;
  --ok-soft: #12301f;
  --danger-soft: #3a1512;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

*, *::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: 400 var(--fs)/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 750; }
h1 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-l); }
p { margin: 0 0 0.9em; }
a { color: inherit; text-underline-offset: 3px; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* The highlighter stroke: <span class="mark">out</span> */
.mark {
  background: linear-gradient(180deg, transparent 12%, var(--mark) 12%, var(--mark) 88%, transparent 88%);
  color: #15171a;
  padding: 0 0.14em;
  margin: 0 -0.04em;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.wordmark {
  display: inline-flex; align-items: center; gap: 0.45em;
  font-weight: 800; font-size: 1.125rem; letter-spacing: -0.03em;
  color: var(--ink); text-decoration: none;
}
.wordmark .mark { padding: 0 0.05em; margin: 0; }
.wordmark svg { width: 1.4em; height: 1.4em; flex: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: var(--tap); padding: 0 1.15em;
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--paper);
  font: 650 var(--fs-s)/1 var(--font); letter-spacing: -0.005em;
  text-decoration: none; cursor: pointer; user-select: none;
  transition: transform 0.08s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: #2a2e34; border-color: #2a2e34; }
[data-theme="dark"] .btn:hover { background: #dedbd2; border-color: #dedbd2; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--paper-2); border-color: var(--ink-3); }
[data-theme="dark"] .btn-ghost:hover { background: var(--paper-2); border-color: var(--ink-3); }
.btn-mark { background: var(--mark); color: #15171a; border-color: #15171a; }
.btn-mark:hover { background: #ffdc2e; border-color: #15171a; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-s { min-height: 38px; padding: 0 0.85em; font-size: var(--fs-xs); border-radius: 10px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

/* Form fields */
.field { display: block; margin: 0 0 1rem; }
.field > span, .label { display: block; margin: 0 0 0.35rem; font-size: var(--fs-xs); font-weight: 650; color: var(--ink-2); }
.input, .textarea, .select {
  display: block; width: 100%; min-height: var(--tap);
  padding: 0.7em 0.85em;
  background: var(--card); color: var(--ink);
  border: 1.5px solid var(--line-2); border-radius: var(--radius-s);
  font: 400 1rem/1.4 var(--font);      /* 16px: iOS does not zoom on focus */
}
.textarea { min-height: 8.5rem; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--mark); }
.hint { font-size: var(--fs-xs); color: var(--ink-3); margin: 0.35rem 0 0; }
.error { font-size: var(--fs-xs); color: var(--danger); margin: 0.35rem 0 0; }

/* Surfaces */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.badge {
  display: inline-flex; align-items: center; gap: 0.35em;
  padding: 0.2em 0.6em; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-2);
  font-size: var(--fs-xs); font-weight: 650;
}
.badge-mark { background: var(--mark); color: #15171a; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.kicker { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.col { width: 100%; max-width: var(--col); margin: 0 auto; padding: 0 1.1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
