/* Millatbooks — shared tokens, fonts and primitives (landing + app) */
@font-face { font-family: 'Satoshi'; src: url('../fonts/satoshi-400.woff2?v=josmuth3ow8') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/satoshi-500.woff2?v=jr0muth3ow8') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/satoshi-700.woff2?v=jjkmuth3ow8') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/satoshi-900.woff2?v=i4cmuth3ow8') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Clash Display'; src: url('../fonts/clash-display-600.woff2?v=bskmuth3ow8') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('../fonts/instrument-serif-400-italic.woff2?v=c3omuth3ow8') format('woff2'); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono.woff2?v=v6cmuth3ow8') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #F2F0E9;
  --bg-2: #E9E6DC;
  --surface: #FFFFFF;
  --surface-2: #F8F7F2;
  --surface-3: #F0EEE6;
  --line: rgba(17, 33, 26, 0.08);
  --line-2: rgba(17, 33, 26, 0.15);
  --ink: #0E1A15;
  --ink-2: #45534C;
  --ink-3: #7B8780;
  --brand: #0B4F3A;
  --brand-2: #0E6B4E;
  --brand-ink: #FFFFFF;
  --mint: #3DDC97;
  --mint-2: #A6F4CE;
  --accent-text: #0A7A55;
  --in: #0E9F6E;
  --in-bg: rgba(14, 159, 110, 0.1);
  --out: #E0453F;
  --out-bg: rgba(224, 69, 63, 0.09);
  --warn: #D98A06;
  --warn-bg: rgba(245, 165, 36, 0.14);
  --move: #4B6BDF;
  --move-bg: rgba(75, 107, 223, 0.1);
  --side: #0A2B21;
  --side-ink: #DDEDE5;
  --hero-a: #0B3D2E;
  --hero-b: #11624A;
  --logo-bg: #0B4F3A;
  /* the same in light and dark (themes.css swaps all of these per colour theme) */
  --mint-ink: #04130B;
  --mint-soft: #AAFFD6;
  --on-deep: #E6F4EC;
  --side-logo: #135F46;
  --deep-0: #04140E;
  --deep-1: #082A1F;
  --deep-2: #0B4433;
  --deep-3: #0F5A43;
  --toast: #0D1813;
  --glow-2: #0EA5E9;
  --mint-rgb: 61 220 151;
  --mint-soft-rgb: 170 255 214;
  --on-deep-rgb: 230 244 236;
  --side-ink-soft-rgb: 221 237 229;
  --deep-0-rgb: 4 20 14;
  --card-a-rgb: 16 38 29;
  --card-b-rgb: 8 24 18;
  --hero-a-rgb: 11 61 46;
  --shadow-sm: 0 1px 2px rgba(14, 26, 21, 0.06);
  --shadow: 0 1px 2px rgba(14, 26, 21, 0.05), 0 10px 30px -14px rgba(14, 26, 21, 0.2);
  --shadow-lg: 0 2px 4px rgba(14, 26, 21, 0.06), 0 30px 70px -24px rgba(14, 26, 21, 0.35);
  --glass: rgba(255, 255, 255, 0.72);
  --r-xs: 8px;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: 'Satoshi', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Clash Display', 'Satoshi', ui-sans-serif, system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #070E0B;
  --bg-2: #0B1511;
  --surface: #0F1A15;
  --surface-2: #13211B;
  --surface-3: #182A22;
  --line: rgba(214, 245, 229, 0.07);
  --line-2: rgba(214, 245, 229, 0.14);
  --ink: #E7F0EB;
  --ink-2: #A3B4AB;
  --ink-3: #6B7D74;
  --brand: #3DDC97;
  --brand-2: #63E8AE;
  --brand-ink: #03130B;
  --accent-text: #5BE3A6;
  --in: #34D399;
  --in-bg: rgba(52, 211, 153, 0.12);
  --out: #FF6B63;
  --out-bg: rgba(255, 107, 99, 0.12);
  --warn: #FBBF24;
  --warn-bg: rgba(251, 191, 36, 0.13);
  --move: #8EA4FF;
  --move-bg: rgba(142, 164, 255, 0.12);
  --side: #050B08;
  --side-ink: #CFE3D9;
  --hero-a: #0A3326;
  --hero-b: #0F5440;
  --logo-bg: #0E3B2C;
  --hero-a-rgb: 10 51 38;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 34px 80px -24px rgba(0, 0, 0, 0.8);
  --glass: rgba(15, 26, 21, 0.72);
}

*, *::before, *::after { box-sizing: border-box; }
/* thin, theme-coloured scrollbars everywhere: Windows otherwise draws thick grey bars inside every list and dialog */
:root { scrollbar-color: color-mix(in srgb, var(--ink) 24%, transparent) transparent; }
* { scrollbar-width: thin; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'tnum';
}
img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--mint); color: var(--mint-ink); }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 6px; }

.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.display { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; }
.muted { color: var(--ink-3); }
.in { color: var(--in); }
.out { color: var(--out); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* svg icon sprite */
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 24px; height: 24px; }

/* ---------- Buttons ---------- */
.btn {
  --b-bg: var(--surface);
  --b-ink: var(--ink);
  --b-line: var(--line-2);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border-radius: 999px;
  background: var(--b-bg); color: var(--b-ink);
  box-shadow: inset 0 0 0 1px var(--b-line);
  font-weight: 700; font-size: 14px; letter-spacing: 0.005em; white-space: nowrap;
  overflow: hidden; isolation: isolate;
  flex-shrink: 0; min-width: max-content; /* a button never squeezes its own label; the row around it wraps or the text beside it gives way */
  transition: transform 0.35s var(--spring), box-shadow 0.3s var(--ease), background-color 0.3s var(--ease), color 0.3s;
  user-select: none;
}
.btn:hover { box-shadow: inset 0 0 0 1px var(--b-line), var(--shadow); }
.btn:active { transform: scale(0.96); transition-duration: 0.12s; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn .i { width: 18px; height: 18px; }
.btn-primary { --b-bg: var(--brand); --b-ink: var(--brand-ink); --b-line: transparent; }
.btn-primary:hover { box-shadow: 0 10px 28px -10px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn-primary::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.8s var(--ease);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-mint { --b-bg: var(--mint); --b-ink: var(--mint-ink); --b-line: transparent; }
.btn-ghost { --b-bg: transparent; --b-line: transparent; }
.btn-ghost:hover { --b-bg: var(--surface-3); box-shadow: none; }
.btn-danger { --b-bg: var(--out); --b-ink: #fff; --b-line: transparent; }
.btn-soft-danger { --b-bg: var(--out-bg); --b-ink: var(--out); --b-line: transparent; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 15px; }
.btn-icon { width: 42px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn-block { width: 100%; min-width: 0; height: auto; min-height: 42px; padding-top: 9px; padding-bottom: 9px; white-space: normal; text-align: center; line-height: 1.3; }

/* ripple */
.ripple-wave {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
  background: currentColor; opacity: 0.18; transform: scale(0);
  animation: ripple 0.65s var(--ease) forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* odometer */
.odo { white-space: nowrap; }
.odo-in { display: inline-flex; align-items: flex-start; line-height: 1; vertical-align: top; }
.odo-col { display: inline-block; height: 1em; line-height: 1; overflow: hidden; } /* width snaps: animating it re-lays-out the page every frame */
.odo-strip { display: block; transition: transform 0.9s cubic-bezier(0.2, 0.9, 0.1, 1); text-align: center; }
.odo-strip > span { display: block; height: 1em; line-height: 1; text-align: left; }
.odo-sym { display: inline-block; white-space: pre; height: 1em; line-height: 1; }

/* split text */
.split-line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split-word { display: inline-block; white-space: nowrap; }
.split-char { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
:root[data-motion='reduced'] *, :root[data-motion='reduced'] *::before, :root[data-motion='reduced'] *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
