/*
 * bagwrk — marketing site.
 *
 * Tokens are copied verbatim from packages/design-tokens so the site and the
 * app cannot drift apart. If a value changes there, change it here.
 */

:root {
  /* Backgrounds, darkest to lightest. */
  --bg: #0a0a0b;
  --bg-elevated: #121214;
  --surface: #17171a;
  --surface-high: #1f1f23;

  /* Hairlines. */
  --border: #26262b;
  --border-subtle: #1b1b1f;
  --border-strong: #34343b;

  /* Text ramp. */
  --text-primary: #ffffff;
  --text-secondary: #9a9aa2;
  --text-tertiary: #65656e;
  --text-quaternary: #48484f;
  --text-inverse: #0a0a0b;

  /* Brand: the lime from the bagwrk coin. Type on top of it is always inverse —
     lime is far too light to carry white. */
  --brand: #baf932;
  --brand-press: #a2de24;
  --brand-subtle: rgba(186, 249, 50, 0.12);
  --cream: #fbf7f4;

  /* Market semantics. */
  --positive: #22d07a;
  --negative: #ff4d4f;

  /* 4pt grid. */
  --sp-xs: 4px;
  --sp-sm: 6px;
  --sp-md: 8px;
  --sp-lg: 12px;
  --sp-xl: 16px;
  --sp-2xl: 20px;
  --sp-3xl: 24px;
  --sp-huge: 32px;
  --sp-massive: 40px;
  --sp-giant: 48px;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-full: 999px;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
    sans-serif;

  --page: 1120px;
}

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

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

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

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

a {
  color: inherit;
}

/* ── Layout ──────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding-inline: var(--sp-2xl);
}

section {
  padding-block: clamp(56px, 9vw, 112px);
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 var(--sp-lg);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1.1;
}

h1 {
  font-size: clamp(40px, 7vw, 68px);
  letter-spacing: -1.8px;
}

h2 {
  font-size: clamp(28px, 4.2vw, 44px);
  letter-spacing: -1.2px;
}

h3 {
  font-size: 18px;
  letter-spacing: -0.4px;
}

p {
  margin: 0;
  color: var(--text-secondary);
}

.lede {
  font-size: clamp(17px, 2vw, 20px);
  max-width: 56ch;
}

/* ── Header ──────────────────────────────────────────────────────────── */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 10, 11, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-xl);
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.6px;
}

.brand img {
  width: 30px;
  height: 30px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-3xl);
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--text-primary);
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-md);
  min-height: 52px;
  padding: 0 var(--sp-3xl);
  border-radius: var(--r-full);
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    background 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--brand);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: var(--brand-press);
}

.btn-secondary {
  background: var(--surface-high);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

/* ── Hero ────────────────────────────────────────────────────────────── */

.hero {
  padding-block: clamp(48px, 7vw, 96px) clamp(40px, 6vw, 80px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-sm) var(--sp-xl);
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--sp-3xl);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-full);
  background: var(--brand);
}

.hero h1 {
  margin-bottom: var(--sp-2xl);
}

.hero h1 em {
  font-style: normal;
  color: var(--brand);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-lg);
  margin-top: var(--sp-huge);
}

.hero-note {
  margin-top: var(--sp-xl);
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Phone frame. The bezel is drawn rather than shipped as an image, so it
   stays crisp at any size and costs nothing to load. */
.phone {
  position: relative;
  width: min(300px, 78vw);
  margin-inline: auto;
  border-radius: 46px;
  padding: 10px;
  background: linear-gradient(160deg, #2a2a30, #121214);
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.55),
    0 0 0 1px var(--border-strong);
}

.phone img {
  border-radius: 37px;
  display: block;
  width: 100%;
  /* Without this the intrinsic height wins and the frame stretches to the
     image's declared pixel height. */
  height: auto;
}

.phone-glow {
  position: absolute;
  inset: -18% -12%;
  background: radial-gradient(circle at 50% 35%, var(--brand-subtle), transparent 62%);
  filter: blur(20px);
  z-index: -1;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .lede {
    margin-inline: auto;
  }
}

/* ── Balance card (echoes the app's own) ─────────────────────────────── */

.balance-card {
  background: var(--brand);
  color: var(--text-inverse);
  border-radius: var(--r-xl);
  padding: clamp(24px, 4vw, 40px);
  display: grid;
  gap: var(--sp-md);
}

.balance-card .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-xl);
  flex-wrap: wrap;
}

.balance-card .label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.62;
}

.balance-card .amount {
  font-size: clamp(40px, 6.5vw, 64px);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.05;
}

.balance-card p {
  color: rgba(10, 10, 11, 0.72);
  max-width: 46ch;
}

/* ── Feature grid ────────────────────────────────────────────────────── */

.grid {
  display: grid;
  gap: var(--sp-xl);
  grid-template-columns: repeat(3, 1fr);
  margin-top: var(--sp-massive);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 900px) {
  .grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-3xl);
  display: grid;
  gap: var(--sp-lg);
  align-content: start;
}

.card h3 {
  color: var(--text-primary);
}

.card p {
  font-size: 15px;
}

.icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--brand-subtle);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 19px;
}

/* ── Steps ───────────────────────────────────────────────────────────── */

.steps {
  counter-reset: step;
  display: grid;
  gap: var(--sp-xl);
  grid-template-columns: repeat(3, 1fr);
  margin-top: var(--sp-massive);
}

@media (max-width: 900px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

.step {
  border-top: 2px solid var(--border);
  padding-top: var(--sp-2xl);
  display: grid;
  gap: var(--sp-md);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.8px;
}

/* ── Chains ──────────────────────────────────────────────────────────── */

.chains {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-lg);
  margin-top: var(--sp-3xl);
}

.chain {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-lg) var(--sp-2xl);
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
}

.chain .swatch {
  width: 10px;
  height: 10px;
  border-radius: var(--r-full);
}

/* ── Fees table ──────────────────────────────────────────────────────── */

.table-scroll {
  overflow-x: auto;
  margin-top: var(--sp-3xl);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 460px;
}

th,
td {
  text-align: left;
  padding: var(--sp-xl) var(--sp-3xl);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 15px;
}

th {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--surface);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td:last-child {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── FAQ ─────────────────────────────────────────────────────────────── */

details {
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--sp-3xl) 0;
}

summary {
  cursor: pointer;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--sp-xl);
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  color: var(--brand);
  font-size: 22px;
  line-height: 1;
  flex: none;
}

details[open] summary::after {
  content: '−';
}

details p {
  margin-top: var(--sp-lg);
  max-width: 72ch;
  font-size: 15px;
}

/* ── Footer ──────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border-subtle);
  padding-block: var(--sp-massive);
  margin-top: var(--sp-giant);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3xl);
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3xl);
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.fine {
  font-size: 13px;
  color: var(--text-quaternary);
  margin-top: var(--sp-2xl);
  max-width: 78ch;
}

/* ── Legal pages ─────────────────────────────────────────────────────── */

.doc {
  max-width: 760px;
  padding-block: clamp(48px, 7vw, 88px);
}

.doc h1 {
  font-size: clamp(32px, 5vw, 46px);
  margin-bottom: var(--sp-lg);
}

.doc h2 {
  font-size: 21px;
  letter-spacing: -0.4px;
  margin-top: var(--sp-massive);
  margin-bottom: var(--sp-lg);
}

.doc p,
.doc li {
  color: var(--text-secondary);
  margin-bottom: var(--sp-lg);
}

.doc ul {
  padding-left: var(--sp-3xl);
}

.doc strong {
  color: var(--text-primary);
}

.updated {
  color: var(--text-tertiary);
  font-size: 14px;
}

.notice {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: var(--sp-2xl);
  margin-block: var(--sp-3xl);
}

.notice p {
  margin: 0;
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

/* Bagwrk document pages share the browser identity. */
:root { --bg: #080909; --surface: #111513; --brand: #b5ff43; --r-lg: 10px; --r-xl: 12px; --font: Arial, Helvetica, sans-serif; }
.brand { font-size: 28px; letter-spacing: -1.4px; }
.brand img { width: 44px; height: 44px; }
.doc h1 { letter-spacing: -2px; }
.doc h2 { color: #d7e4cc; }
a:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
