/* FomoCLI — shared styles (home + docs).
   Palette from the logo and the CLI's own theme (internal/ui/style.go):
   ice white on near-black, cool steel greys; green/red only for gains/losses. */
:root {
  --ink: #05060f;
  --ink-2: #0a0c18;
  --ink-3: #10132a;
  --ice: #eef1fc;
  --steel: #b4bbdc;
  --muted: #6e7596;
  --border: #2b3048;
  --line: rgba(180, 187, 220, 0.12);
  --green: #5ee6a0;
  --red: #ff6b81;
  --gold: #f2d28b;
  --pink: #f5a3c7;

  --font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 18px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html:not(.has-lenis) { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--ice);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.is-locked { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
code, pre, kbd { font-family: var(--mono); }
::selection { background: var(--ice); color: var(--ink); }

.muted { color: var(--muted); }
.dim { color: var(--muted); }
.green { color: var(--green); }
.red { color: var(--red); }
.gold { color: var(--gold); }
.steel { color: var(--steel); }
.pink { color: var(--pink); }

.ic {
  font-size: 0.86em;
  background: rgba(180, 187, 220, 0.08);
  border: 1px solid var(--line);
  padding: 0.12em 0.42em;
  border-radius: 6px;
  color: var(--ice);
  white-space: nowrap;
}

/* ───────────── Grain ───────────── */
.grain {
  position: fixed; inset: -50%; z-index: 60;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ───────────── Nav ───────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background 0.4s, padding 0.4s, border-color 0.4s, transform 0.5s var(--ease);
}
.nav.is-scrolled {
  background: rgba(5, 6, 15, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-color: var(--line);
  padding-top: 12px; padding-bottom: 12px;
}
.nav.is-hidden { transform: translateY(-100%); }
.nav__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav__brand img { width: 60px; height: auto; }
.nav__links { display: flex; gap: 28px; }
.nav__links a {
  position: relative;
  text-decoration: none; color: var(--steel);
  font-size: 13px; font-weight: 500;
  transition: color 0.25s;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--ice); transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--ice); }
.nav__links a:hover::after, .nav__links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav__right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--steel);
  background: rgba(16, 19, 42, 0.45);
  transition: color 0.25s, border-color 0.25s, transform 0.3s var(--ease);
}
.icon-btn:hover { color: var(--ice); border-color: rgba(238, 241, 252, 0.4); transform: translateY(-2px); }
.nav__burger { display: none; cursor: pointer; }

/* ───────────── Buttons ───────────── */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 20px; border-radius: 12px;
  font: 600 13px/1 var(--font); text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.4s var(--ease), box-shadow 0.4s, border-color 0.3s, background 0.3s;
}
.btn svg { flex-shrink: 0; }
.btn--primary { background: var(--ice); color: var(--ink); box-shadow: 0 10px 40px -12px rgba(238, 241, 252, 0.55); }
.btn--primary::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.95), transparent);
  transform: skewX(-20deg);
  transition: left 0.8s var(--ease);
}
.btn--primary:hover::before { left: 130%; }
.btn--primary:hover { box-shadow: 0 18px 50px -12px rgba(238, 241, 252, 0.75); }
.btn--ghost { color: var(--ice); border-color: var(--border); background: rgba(16, 19, 42, 0.5); }
.btn--ghost:hover { border-color: rgba(238, 241, 252, 0.45); }
.btn--lg { padding: 15px 24px; font-size: 14px; }

/* ───────────── Footer ───────────── */
.footer { position: relative; z-index: 2; border-top: 1px solid var(--line); }
.footer__inner {
  max-width: var(--max); margin: 0 auto; padding: 56px var(--gutter) 40px;
  display: grid; grid-template-columns: 1fr auto; gap: 32px 48px; align-items: start;
}
.footer__brand img { width: 72px; height: auto; }
.footer__brand p { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.footer__cols { display: flex; gap: 64px; }
.footer__col h4 { margin: 0 0 14px; font: 500 12px/1 var(--mono); color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.footer__col a { display: block; margin: 0 0 10px; color: var(--steel); text-decoration: none; font-size: 13px; transition: color 0.2s; }
.footer__col a:hover { color: var(--ice); }
.footer__legal {
  grid-column: 1 / -1; margin: 0; padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px; line-height: 1.7;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px;
}
.footer__legal p { margin: 0; max-width: 760px; }

/* ───────────── Toast ───────────── */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 90;
  transform: translate(-50%, 20px); opacity: 0;
  padding: 12px 18px; border-radius: 12px;
  background: var(--ice); color: var(--ink); font: 600 13px/1 var(--font);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.6);
  transition: opacity 0.3s, transform 0.4s var(--ease);
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ───────────── Cursor (fine pointers only) ───────────── */
.cursor, .cursor-dot { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor, .cursor-dot {
    display: block; position: fixed; top: 0; left: 0; z-index: 95;
    pointer-events: none; border-radius: 50%;
    mix-blend-mode: difference;
  }
  .cursor {
    width: 36px; height: 36px; margin: -18px 0 0 -18px;
    border: 1px solid rgba(238, 241, 252, 0.9);
    transition: width 0.35s var(--ease), height 0.35s var(--ease), margin 0.35s var(--ease), background 0.35s, opacity 0.3s;
  }
  .cursor-dot { width: 4px; height: 4px; margin: -2px 0 0 -2px; background: var(--ice); }
  .cursor.is-hover { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: var(--ice); }
  .cursor.is-hidden, .cursor-dot.is-hidden { opacity: 0; }
}

/* ───────────── Mobile nav ───────────── */
@media (max-width: 860px) {
  .nav__links {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px;
    padding: 0 var(--gutter);
    background: rgba(5, 6, 15, 0.97);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0.4s;
  }
  .nav__links a { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--ice); padding: 4px 0; }
  .nav__links a::after { display: none; }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; }
  .nav.is-open { background: transparent; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav__burger {
    display: grid; place-content: center; gap: 6px;
    width: 40px; height: 40px; border-radius: 12px;
    border: 1px solid var(--line); background: rgba(16, 19, 42, 0.45);
  }
  .nav__burger span { display: block; width: 16px; height: 1.5px; background: var(--ice); transition: transform 0.3s var(--ease); }
  .nav.is-open .nav__burger span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .nav.is-open .nav__burger span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .footer__inner { grid-template-columns: 1fr; }
  .footer__cols { gap: 40px; flex-wrap: wrap; }
}

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