/* Design tokens + primitives shared by the landing page and the dashboard.
   The palette mirrors theme.js so a rendered trade card dropped onto the
   marketing page looks native rather than pasted in. Change a colour here and
   in theme.js together. */

:root {
  /* Brand - two colours, locked (see theme.js) */
  --brand: #6b7bff;
  --brand-bright: #8a96ff;
  --brand-dim: #4b59d6;
  --accent: #f0b429;

  /* Signals - the only place colour carries meaning */
  --win: #3fd98a;
  --loss: #ff5c6c;
  --flat: #8a93a6;

  /* Surfaces, darkest to lightest */
  --bg: #07080c;
  --surface: #0a0c11;
  --raised: #141824;
  --raised-2: #1b2130;
  --line: #242b3d;
  --line-soft: #1a2030;

  /* Text */
  --text: #f2f4f8;
  --text-2: #a8b0c2;
  --text-3: #6c7488;

  /* Type scale */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
    sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* Geometry */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --maxw: 1180px;

  /* Elevation - soft and wide, never a hard drop shadow */
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 32px 64px -24px rgba(0, 0, 0, 0.75);
  --glow: 0 0 0 1px rgba(107, 123, 255, 0.35), 0 0 48px -8px rgba(107, 123, 255, 0.45);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* `hidden` is how the dashboard toggles the sign-in gate, the app shell and the
   modal. The UA rule for it is display:none at author-origin-zero specificity,
   so any class that sets display (.shell, .gate, .modal are all grid) silently
   beats it and the element shows anyway. This puts it back. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 620;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* Paired with the max-width above, and separated from svg because icons here
   size themselves explicitly. Without it, max-width shrinks a wide image to fit
   its column while the height attribute keeps the original number, which
   squeezes the picture horizontally. */
img {
  height: auto;
}

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

::selection {
  background: rgba(107, 123, 255, 0.32);
}

:focus-visible {
  outline: 2px solid var(--brand-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- Buttons ---------- */

.btn {
  --btn-bg: var(--raised);
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 14.5px;
  font-weight: 560;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.16s var(--ease),
    background 0.16s var(--ease),
    border-color 0.16s var(--ease),
    box-shadow 0.16s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
  border-color: #333d55;
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: linear-gradient(180deg, var(--brand-bright), var(--brand));
  border-color: transparent;
  color: #080a12;
  font-weight: 620;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 8px 24px -8px rgba(107, 123, 255, 0.7);
}

.btn--primary:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 14px 32px -8px rgba(107, 123, 255, 0.85);
  border-color: transparent;
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.04);
}

.btn--lg {
  padding: 14px 26px;
  font-size: 16px;
  border-radius: 12px;
}

.btn--sm {
  padding: 7px 13px;
  font-size: 13px;
  border-radius: 8px;
}

.btn--danger {
  border-color: rgba(255, 92, 108, 0.35);
  color: var(--loss);
  background: rgba(255, 92, 108, 0.08);
}

.btn--danger:hover {
  background: rgba(255, 92, 108, 0.16);
  border-color: rgba(255, 92, 108, 0.55);
}

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Small shared bits ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 560;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-bright);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12.5px;
  font-weight: 520;
  color: var(--text-2);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--win);
  box-shadow: 0 0 10px var(--win);
}

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

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.up {
  color: var(--win);
}

.down {
  color: var(--loss);
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

/* A hairline that fades at both ends - used as a section divider. */
.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(90deg, transparent, var(--line) 18%, var(--line) 82%, transparent);
}

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