/* Polaris Terminal — tokens, theme, primitives.
   World: celestial navigation at night. Neutrals tinted toward the logo's forest green,
   one pastel-mint accent, chrome silver for the mark. */

:root {
  --bg-0: #060a08;
  --bg: #090e0c;
  --card: #0f1512;
  --raised: #161e1a;
  --raised-2: #1d2722;
  --text: #e8efea;
  --text-2: #a4b2a9;
  --muted: #7e8c84;
  --line: rgb(232 239 234 / 0.08);
  --line-2: rgb(232 239 234 / 0.14);
  --accent: #9ee6b8;          /* pastel mint, from the logo green */
  --accent-ink: #062615;      /* text on accent */
  --accent-text: #9ee6b8;     /* accent used as text */
  --chrome: #cfd8d3;
  --up: #7fd6a0;
  --down: #f2938c;
  --warn: #f1cf8a;
  --band: #efeee6;            /* cream logbook band */
  --band-ink: #0f1a14;
  --band-2: #4a5850;
  --shadow: 0 16px 40px rgb(0 0 0 / 0.35);
  --hi: inset 0 1px 0 rgb(255 255 255 / 0.08);

  --f-ui: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", monospace;
  --f-display: "Doto", "Geist Mono", monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 150ms;
  --t-menu: 200ms;
  --t-enter: 420ms;

  --r-tag: 6px;
  --r-ctl: 10px;
  --r-card: 16px;
  --r-panel: 20px;

  --page: 1440px;
  --gutter: 32px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg-0: #e9ebe3;
  --bg: #f3f4ee;
  --card: #fbfbf8;
  --raised: #e9ece4;
  --raised-2: #dfe3d9;
  --text: #0f1a14;
  --text-2: #43514a;
  --muted: #63706a;
  --line: rgb(15 26 20 / 0.09);
  --line-2: rgb(15 26 20 / 0.16);
  --accent: #0b6b3a;
  --accent-ink: #ffffff;
  --accent-text: #0a6235;
  --chrome: #5d6b64;
  --up: #15803d;
  --down: #c2410c;
  --warn: #a16207;
  --band: #0c1410;
  --band-ink: #e8efea;
  --band-2: #a4b2a9;
  --shadow: 0 8px 24px rgb(15 26 20 / 0.08);
  --hi: inset 0 1px 0 rgb(255 255 255 / 0.6);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--text-2); }
.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
.display {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 0.98;
  margin: 0;
}
.h2 { font-size: clamp(36px, 5.2vw, 72px); }
.h3 { font: 500 24px/1.2 var(--f-ui); margin: 0; letter-spacing: -0.01em; }
.lead { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.5; color: var(--text-2); max-width: 36rem; margin: 0; }
.label { font: 400 12px/16px var(--f-mono); color: var(--muted); letter-spacing: 0.01em; }

/* ---------- mark: the Polaris star, flat ---------- */
.mark { width: 24px; height: 24px; color: var(--text); flex: none; }
.star-tick { display: inline-block; width: 10px; height: 10px; color: var(--accent-text); vertical-align: -1px; }

/* ---------- buttons ---------- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 20px; border-radius: var(--r-ctl);
  font: 500 15px/1 var(--f-ui); white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--text); color: var(--bg); box-shadow: var(--hi); }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--raised); border: 1px solid var(--line); box-shadow: var(--hi); }
.btn-ghost:hover { background: var(--raised-2); border-color: var(--line-2); }
.btn-sm { --h: 34px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn .arrow { transition: transform var(--t-fast) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  color: var(--text-2); border: 1px solid var(--line); background: var(--card);
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--raised); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 16px; height: 16px; }
.i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; height: 64px;
  transition: background-color var(--t-menu) var(--ease), border-color var(--t-menu) var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.solid { background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); border-color: var(--line); }
.nav .wrap { height: 100%; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; font: 500 16px/1 var(--f-ui); }
.brand small { font: 400 12px/1 var(--f-mono); color: var(--muted); padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--r-tag); }
.nav-links { display: flex; gap: 4px; margin-right: auto; }
.nav-links a {
  height: 34px; padding: 0 12px; display: flex; align-items: center; border-radius: 8px;
  color: var(--text-2); font-size: 14px; transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.nav-links a:hover, .nav-links a.on { color: var(--text); background: var(--raised); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }

@media (max-width: 900px) {
  :root { --gutter: 16px; }
  .nav-links {
    position: fixed; inset: 64px 0 auto; flex-direction: column; padding: 8px 16px 16px; gap: 2px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(-6px); pointer-events: none;
    transition: opacity var(--t-menu) var(--ease), transform var(--t-menu) var(--ease);
  }
  .nav-links a { height: 44px; font-size: 16px; }
  .nav.open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .menu-btn { display: grid; }
  .nav .hide-sm { display: none; }
}

/* ---------- surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-panel); }
.hair { border-top: 1px solid var(--line); }
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-tag);
  font: 400 12px/1 var(--f-mono); color: var(--text-2); border: 1px solid var(--line); background: var(--raised);
}
.tag.ok { color: var(--up); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--up); flex: none; }
.dot.live { box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 60%, transparent); animation: live 2.4s var(--ease) infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* skeleton: shown only until the first value lands */
.sk { color: transparent !important; background: var(--raised); border-radius: 6px; min-width: 4ch; display: inline-block; }

/* ---------- bars ---------- */
.bar { height: 4px; border-radius: 2px; background: var(--raised-2); overflow: hidden; }
.bar > i { display: block; height: 100%; width: var(--w, 0%); background: var(--text-2); border-radius: inherit; transition: width 700ms var(--ease); }
.bar.lead > i { background: var(--accent); }

/* ---------- toast ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: grid; gap: 8px; }
.toast {
  min-width: 240px; max-width: 360px; padding: 12px 14px; border-radius: 12px; background: var(--raised);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px; display: flex; gap: 10px; align-items: flex-start;
  animation: rise var(--t-enter) var(--ease);
}
.toast.err .dot { background: var(--down); }
.toast a { color: var(--accent-text); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgb(3 6 5 / 0.6); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity var(--t-menu) var(--ease); }
.modal.on { opacity: 1; pointer-events: auto; }
.modal .sheet { width: min(420px, 100%); padding: 24px; transform: translateY(8px); transition: transform var(--t-enter) var(--ease); }
.modal.on .sheet { transform: none; }
.modal h3 { margin: 0 0 4px; font: 500 20px/1.3 var(--f-ui); }
.wallets { display: grid; gap: 8px; margin-top: 16px; }
.wallets button, .wallets a {
  height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-radius: 10px;
  background: var(--raised); border: 1px solid var(--line); text-align: left;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.wallets button:hover, .wallets a:hover { background: var(--raised-2); border-color: var(--line-2); }
.wallets img, .wallets i { width: 24px; height: 24px; border-radius: 6px; font-style: normal; display: grid; place-items: center; background: var(--card); }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border-radius: 10px; background: var(--raised); font-size: 14px; }
.steps li small { margin-left: auto; font: 400 12px var(--f-mono); color: var(--muted); }
.steps li.done small { color: var(--up); }
.steps li.err small { color: var(--down); }
.steps .s { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font: 400 12px var(--f-mono); background: var(--card); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 48px 0 32px; }
.foot .wrap { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.foot h4 { margin: 0 0 12px; font: 400 12px/16px var(--f-mono); color: var(--muted); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot a { color: var(--text-2); font-size: 14px; transition: color var(--t-fast) var(--ease); }
.foot a:hover { color: var(--text); }
.foot .legal { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px; padding-top: 24px; border-top: 1px solid var(--line); font: 400 12px var(--f-mono); color: var(--muted); }
@media (max-width: 720px) { .foot .wrap { grid-template-columns: 1fr 1fr; } .foot .wrap > :first-child { grid-column: 1 / -1; } }

/* ---------- entrance ---------- */
.reveal { opacity: 0; transform: translateY(10px); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; }
  .reveal { opacity: 1; transform: none; }
}

[hidden] { display: none !important; }
