/* ==========================================================================
   Cryptopocketbase — Global Design Tokens
   Direction: "The Ledger" — warm paper background, deep emerald as the
   money/growth accent, tabular precision borrowed from financial ledgers
   and departure boards. Fraunces (display) + Inter (UI) + IBM Plex Mono
   (numbers, prices, wallet addresses, countdowns).
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

:root {
  /* Color — paper & ink */
  --color-paper: #F7F8F5;
  --color-surface: #FFFFFF;
  --color-surface-sunken: #EFF2ED;
  --color-ink: #10241C;
  --color-ink-muted: #4B5A52;
  --color-ink-faint: #8A9990;
  --color-line: #DDE3DA;
  --color-line-strong: #C3CCC0;

  /* Color — accents */
  --color-emerald: #0B6E4F;
  --color-emerald-deep: #094F39;
  --color-emerald-tint: #E4F0EA;
  --color-gain: #1B8A5A;
  --color-gain-tint: #E5F4EC;
  --color-loss: #B23A2E;
  --color-loss-tint: #FBEAE8;
  --color-gold: #B8863B;
  --color-gold-tint: #F6EEDD;
  --color-platinum: #5B6B75;
  --color-platinum-tint: #E9EDEF;
  --color-diamond: #3A5B8C;
  --color-diamond-tint: #E6ECF5;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;

  /* Space (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Shape */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-card: 0 1px 2px rgba(16, 36, 28, 0.04), 0 6px 20px rgba(16, 36, 28, 0.06);
  --shadow-popover: 0 8px 30px rgba(16, 36, 28, 0.14);

  /* Motion */
  --ease-standard: cubic-bezier(0.2, 0.7, 0.3, 1);
  --duration-fast: 140ms;
  --duration-base: 240ms;

  /* Layout */
  --header-height: 64px;
  --marquee-height: 40px;
  --content-max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p { margin: 0 0 var(--space-4); color: var(--color-ink-muted); }

a { color: var(--color-emerald); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* Numeric / tabular data (prices, balances, wallet addresses, countdowns) */
.mono,
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Focus visibility — never suppressed */
:focus-visible {
  outline: 2px solid var(--color-emerald);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------ Primitives ------------------------------ */

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 11px 20px;
  font-weight: 600;
  font-size: var(--text-sm);
  transition: background var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--color-emerald);
  color: #fff;
}
.btn-primary:hover { background: var(--color-emerald-deep); text-decoration: none; }

.btn-secondary {
  background: var(--color-surface);
  border-color: var(--color-line-strong);
  color: var(--color-ink);
}
.btn-secondary:hover { border-color: var(--color-emerald); text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--color-ink-muted);
}
.btn-ghost:hover { color: var(--color-ink); text-decoration: none; }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}
.field label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input,
.field select,
.field textarea {
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--color-surface);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--color-emerald);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-gain { background: var(--color-gain-tint); color: var(--color-gain); }
.badge-loss { background: var(--color-loss-tint); color: var(--color-loss); }
.badge-gold { background: var(--color-gold-tint); color: var(--color-gold); }
.badge-platinum { background: var(--color-platinum-tint); color: var(--color-platinum); }
.badge-diamond { background: var(--color-diamond-tint); color: var(--color-diamond); }

.divider {
  border: none;
  border-top: 1px solid var(--color-line);
  margin: var(--space-6) 0;
}

/* Generic page-section spacing — used by every page, not just Home, so it
   lives here rather than in a single page's stylesheet. */
.section {
  padding: var(--space-12) 0;
}
.section--sunken {
  background: var(--color-surface-sunken);
}
.section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}
.section__header a {
  font-size: var(--text-sm);
  font-weight: 600;
}

.skeleton {
  background: linear-gradient(90deg, var(--color-surface-sunken) 25%, var(--color-line) 37%, var(--color-surface-sunken) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.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;
}