/* ---------- tokens ---------- */
:root {
  --font-ui: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;

  --bg: #faf6f1;
  --bg-2: #f4ece4;
  --card: #fffdfa;
  --card-soft: #f8f1ea;
  --field: #fffdfa;
  --ink: #2f2823;
  --ink-2: #5f544c;
  --muted: #91847b;
  --line: #e9ddd3;
  --line-strong: #dccdc0;
  --hover: rgba(70, 45, 30, 0.045);

  --accent: #b5546e;
  --accent-ink: #9a4159;
  --accent-soft: #f7e3e8;
  --accent-faint: #fcf3f5;
  --accent-contrast: #ffffff;

  --danger: #a9433e;
  --danger-soft: #f8e7e4;
  --ok: #3d7458;
  --ok-soft: #e6f1e9;
  --warn: #8c6420;
  --warn-soft: #faf0da;

  --paper: #fffdfa;
  --paper-ink: #332a25;
  --paper-ink-2: #5d5148;
  --paper-muted: #8a7d73;
  --paper-line: #e9ddd2;

  --radius-sm: 9px;
  --radius: 13px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(61, 40, 27, 0.06);
  --shadow: 0 2px 8px rgba(61, 40, 27, 0.05), 0 20px 50px -30px rgba(61, 40, 27, 0.25);
  --shadow-paper: 0 1px 2px rgba(61, 40, 27, 0.05), 0 24px 60px -34px rgba(61, 40, 27, 0.32);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

[data-theme='lilac'] {
  --bg: #f8f6fb;
  --bg-2: #efeaf6;
  --card: #fffdfb;
  --card-soft: #f4eff9;
  --field: #fffdfb;
  --ink: #2c2733;
  --ink-2: #5c5467;
  --muted: #8b8297;
  --line: #e6dfef;
  --line-strong: #d8cde6;
  --hover: rgba(60, 40, 80, 0.05);
  --accent: #7b5aa6;
  --accent-ink: #66438f;
  --accent-soft: #eee5f8;
  --accent-faint: #f7f2fc;
  --accent-contrast: #ffffff;
  --shadow: 0 2px 8px rgba(50, 35, 70, 0.05), 0 20px 50px -30px rgba(50, 35, 70, 0.25);
}

[data-theme='sage'] {
  --bg: #f7f8f3;
  --bg-2: #edf0e7;
  --card: #fffefa;
  --card-soft: #f1f4ec;
  --field: #fffefa;
  --ink: #272e29;
  --ink-2: #566056;
  --muted: #7f8a82;
  --line: #dee5da;
  --line-strong: #ccd7c6;
  --hover: rgba(35, 55, 40, 0.05);
  --accent: #52755f;
  --accent-ink: #3f5f4b;
  --accent-soft: #e5efe7;
  --accent-faint: #f2f8f3;
  --accent-contrast: #ffffff;
}

[data-theme='honey'] {
  --bg: #fbf8f0;
  --bg-2: #f4eddd;
  --card: #fffdf7;
  --card-soft: #f8f1e1;
  --field: #fffdf7;
  --ink: #302a1e;
  --ink-2: #5f5746;
  --muted: #8d8370;
  --line: #e9dfcb;
  --line-strong: #dbcbb0;
  --hover: rgba(70, 55, 20, 0.05);
  --accent: #8a671f;
  --accent-ink: #6f5214;
  --accent-soft: #f6ecd1;
  --accent-faint: #fbf5e6;
  --accent-contrast: #ffffff;
}

[data-theme='sky'] {
  --bg: #f5f8fa;
  --bg-2: #eaf1f5;
  --card: #fffdfb;
  --card-soft: #eff5f8;
  --field: #fffdfb;
  --ink: #243038;
  --ink-2: #50616c;
  --muted: #7c8b94;
  --line: #dbe6ec;
  --line-strong: #c6d7e0;
  --hover: rgba(25, 55, 75, 0.05);
  --accent: #3f6f8f;
  --accent-ink: #2f5b78;
  --accent-soft: #e2eff6;
  --accent-faint: #f1f8fb;
  --accent-contrast: #ffffff;
}

[data-theme='midnight'] {
  --bg: #171519;
  --bg-2: #1e1b21;
  --card: #201d23;
  --card-soft: #262229;
  --field: #241f27;
  --ink: #f0e9e1;
  --ink-2: #c7bcb3;
  --muted: #8f847d;
  --line: #2d2931;
  --line-strong: #3c3741;
  --hover: rgba(255, 245, 235, 0.055);
  --accent: #c98ea0;
  --accent-ink: #e0b0bf;
  --accent-soft: #33222a;
  --accent-faint: #241a1f;
  --accent-contrast: #241a1f;
  --danger: #e08a83;
  --danger-soft: #33211f;
  --ok: #8cc4a4;
  --ok-soft: #1e2c24;
  --warn: #d9b16a;
  --warn-soft: #2d271a;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.22), 0 24px 60px -34px rgba(0, 0, 0, 0.7);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* ---------- reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

body.has-modal {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

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

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

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

/* ---------- scrollbars ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
  border: 3px solid transparent;
  background-clip: padding-box;
}

/* ---------- type ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variation-settings: 'SOFT' 30, 'WONK' 1;
}

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12.5px;
}

.tiny {
  font-size: 11.5px;
}

.strong {
  font-weight: 600;
}

.center {
  text-align: center;
}

/* ---------- helpers ---------- */
.hidden,
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.grow {
  flex: 1;
  min-width: 0;
}

.wrap {
  flex-wrap: wrap;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon {
  flex: none;
  display: inline-block;
  vertical-align: -0.18em;
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 22px 0;
}

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