/* ───────────────────────────────────────────────────────────────────────────
   Connect - shared design system.
   Extracted verbatim from the finished connect-landing-aesthetic-test.html.
   Link this on every page for one consistent dark + lime identity.
   Page-specific styling (heroes, the orbit portal, content sections) stays in
   each page's own <style>.
   ─────────────────────────────────────────────────────────────────────────── */

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

:root {
  --black: #060608;
  --bg-1: #0B0B0E;      /* first dark-on-dark layer */
  --bg-2: #101013;      /* raised panel */
  --white: #F4F2EE;
  --accent: #C8FF00;
  --accent-deep: #A6D400;
  --gray: #131316;
  --gray2: #1E1E22;
  --muted: #6B6B70;
  --muted-bright: #9A9AA0;
  --border: rgba(255,255,255,0.07);
  --border-lime: rgba(200,255,0,0.22);
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 300;
  /* clip (not hidden) contains off-screen/decorative overflow without creating a
     scroll container, so position: sticky keeps working. Kills sideways scroll. */
  overflow-x: clip;
  max-width: 100%;
  cursor: none;
  position: relative;
}

/* ── Atmospheric global layers ──────────────────────────────────────── */
/* Fine film grain over the whole page for tactile depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
/* Top-bleed lime aura - commits hard to the dark+lime identity */
body::after {
  content: '';
  position: fixed;
  top: -40vh; left: 50%;
  width: 120vw; height: 90vh;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 60% at 50% 0%, rgba(200,255,0,0.10) 0%, rgba(200,255,0,0.03) 35%, transparent 70%);
}

/* Optional page-wide scrolling grid texture for content pages that don't use
   the landing's per-section grid. Add class="bg-grid" to the page <body>. The
   grid is painted on the body background so it scrolls with the page content. */
body.bg-grid {
  background-image:
    linear-gradient(rgba(200,255,0,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200,255,0,0.018) 1px, transparent 1px);
  background-size: 64px 64px;
}

/* Custom cursor (kept from original brand) */
.cursor {
  width: 9px; height: 9px;
  background: var(--accent);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.18s var(--ease);
  mix-blend-mode: difference;
}
.cursor-ring {
  width: 38px; height: 38px;
  border: 1px solid rgba(200,255,0,0.5);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9998;
  transition: width 0.25s var(--ease), height 0.25s var(--ease), border-color 0.25s var(--ease), opacity 0.25s var(--ease);
}

/* ── NAV ────────────────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(16px) saturate(140%);
  background: rgba(6,6,8,0.72);
  transform: translateY(-100%);
  animation: navDrop 0.9s var(--ease) 0.1s forwards;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--white);
  text-decoration: none;
}
.nav-logo span { color: var(--accent); }
.nav-left { display: flex; align-items: center; gap: 1.1rem; }
.nav-back {
  font-size: 11px; font-weight: 500; color: var(--muted);
  text-decoration: none; letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 2px;
  background: rgba(200,255,0,0.05);
  border: 1px solid rgba(200,255,0,0.18);
  box-shadow: 0 0 14px rgba(200,255,0,0.12);
  transition: color 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.nav-back:hover {
  color: var(--black); font-weight: 600;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 22px rgba(200,255,0,0.35);
  transform: translateX(-2px);
}

.nav-center {
  display: flex; background: var(--gray);
  border: 1px solid var(--border); border-radius: 2px; padding: 3px;
}
.nav-tab {
  font-size: 12px; font-weight: 500; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 7px 18px; border-radius: 1px;
  color: var(--muted); cursor: none; background: none; border: none;
  transition: color 0.25s var(--ease), background 0.25s var(--ease); text-decoration: none;
  position: relative;
}
.nav-tab.active { background: var(--accent); color: var(--black); font-weight: 600; }
.nav-tab:hover:not(.active) { color: var(--white); }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.wallet-btn {
  font-family: var(--font-body); font-size: 12px; font-weight: 600;
  padding: 9px 18px; background: transparent; color: var(--white);
  border: 1px solid var(--border); border-radius: 2px; cursor: none;
  display: flex; align-items: center; gap: 8px;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.wallet-btn:hover { border-color: var(--border-lime); background: rgba(200,255,0,0.04); }
.wallet-dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; animation: pulse 2s infinite; box-shadow: 0 0 8px var(--accent); }

/* ── Page-wide section grid (faint static, fades at each section's top/bottom
      edges so it frames each section with breathing room). Scrolls with the
      page. Apply by giving a section the .section class (or .how/.who/.model
      section classes used on the landing). ───────────────────────────────── */
.section::before, .how-section::before, .who-section::before, .model-section::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(200,255,0,0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200,255,0,0.024) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 110px, #000 calc(100% - 110px), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 110px, #000 calc(100% - 110px), transparent 100%);
}

/* ── Buttons with crafted micro-interactions ────────────────────────── */
.btn-primary {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 17px 38px;
  background: var(--accent);
  color: var(--black);
  border: none;
  border-radius: 2px;
  cursor: none;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  box-shadow: 0 0 0 rgba(200,255,0,0);
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--white);
  transform: translateY(101%);
  transition: transform 0.4s var(--ease);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(200,255,0,0.25);
}
.btn-primary:hover::before { transform: translateY(0); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--muted-bright);
  background: none;
  border: none;
  cursor: none;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: color 0.25s var(--ease);
  text-decoration: none;
}
.btn-secondary:hover { color: var(--white); }
.btn-secondary .arrow {
  display: inline-flex;
  transition: transform 0.3s var(--ease);
}
.btn-secondary:hover .arrow { transform: translateX(6px); }

.btn-outline {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 17px 34px;
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 2px;
  cursor: none;
  transition: all 0.3s var(--ease);
  text-decoration: none;
  display: inline-block;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: rgba(200,255,0,0.04); }

/* ── Ticker ─────────────────────────────────────────────────────────── */
.ticker {
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 15px 0;
  overflow: hidden;
  margin-top: 5.5rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) 1.3s forwards;
}
.ticker-track { display: flex; animation: ticker 30s linear infinite; width: max-content; }
.ticker-item {
  font-family: var(--font-body);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); padding: 0 2rem; white-space: nowrap;
  display: flex; align-items: center; gap: 2rem;
  transition: color 0.25s var(--ease);
}
.ticker-track:hover .ticker-item { color: var(--muted-bright); }
.ticker-dot { width: 4px; height: 4px; background: var(--accent); border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 6px var(--accent); }

/* ── Generic section scaffolding ────────────────────────────────────── */
.section { padding: 9rem 3rem; position: relative; z-index: 2; }

.section-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::before {
  content: '';
  display: block;
  width: 40px; height: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* Reveal-on-scroll utility (JS-toggled, CSS-driven) */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }

/* ── Footer ─────────────────────────────────────────────────────────── */
footer { padding: 2.5rem 3rem; border-top: 1px solid rgba(255,255,255,0.06); display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 2; }
.footer-logo { font-family: var(--font-display); font-size: 17px; font-weight: 800; letter-spacing: -0.03em; }
.footer-logo span { color: var(--accent); }
.footer-copy { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }

.live-dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; display: inline-block; margin-right: 8px; animation: pulse 2s infinite; box-shadow: 0 0 8px var(--accent); }

/* ── Shared toast (small "Coming soon" / "Demo only" notices) ───────────
   Created and positioned by window.connectToast() in connect-design.js. */
.connect-toast {
  position: fixed;
  z-index: 10000;
  background: var(--gray2);
  color: var(--white);
  border: 1px solid var(--border-lime);
  border-radius: 6px;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  max-width: 92vw;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.connect-toast.show { opacity: 1; transform: translateY(0); }

/* ── Keyframes ──────────────────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lineRise { from { transform: translateY(110%); } to { transform: translateY(0); } }
@keyframes navDrop { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes ghostIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes breathe { 0%, 100% { opacity: 0.82; } 50% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinRev { to { transform: rotate(-360deg); } }
@keyframes corePulse { 0%,100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.08); opacity: 1; } }

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

/* ── Mobile nav: hamburger toggle + slide-in menu ───────────────────────
   The toggle button, backdrop and menu panel are injected on every page by
   connect-design.js, which populates the panel from each page's existing nav
   links (tabs + Investor Hub + Connect Wallet). Desktop nav is untouched. */
.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 10px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 4px; cursor: pointer; z-index: 130; flex-shrink: 0;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%;
  background: var(--white); border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu-backdrop {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(0,0,0,0.55);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.mobile-menu-backdrop.open { opacity: 1; pointer-events: auto; }

.mobile-menu {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(82vw, 320px);
  z-index: 125;
  background: rgba(9,9,12,0.98);
  backdrop-filter: blur(18px) saturate(140%);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.32s var(--ease);
  display: flex; flex-direction: column;
  padding: 84px 1.25rem 2rem; gap: 4px;
  overflow-y: auto; max-width: 100vw;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu a, .mobile-menu button {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-size: 15px; font-weight: 500;
  letter-spacing: 0; text-transform: none;
  color: var(--white); text-decoration: none;
  padding: 13px 14px; border-radius: 6px;
  background: transparent; border: none; width: 100%;
  text-align: left; cursor: pointer; transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.mobile-menu a:hover, .mobile-menu a:active, .mobile-menu a.active {
  background: rgba(200,255,0,0.08); color: var(--accent);
}
.mobile-menu .mm-divider { height: 1px; background: var(--border); margin: 8px 4px; }
.mobile-menu .mm-investor { color: var(--accent); }
.mobile-menu .mm-wallet {
  justify-content: center; margin-top: 6px;
  background: var(--accent); color: var(--black); font-weight: 600;
}
.mobile-menu .mm-wallet:hover { background: var(--accent-deep); color: var(--black); }

/* ── Responsive base ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .nav-center { display: none; }
  .nav-toggle { display: flex; }   /* hamburger appears wherever the inline tabs are hidden */
}
@media (max-width: 768px) {
  nav { padding: 0.85rem 1.25rem; }
  /* "← Investor Hub" stays visible top-left next to the logo; hamburger on the right. */
  .nav-left { gap: 0.7rem; min-width: 0; }
  .nav-back { padding: 5px 9px; white-space: nowrap; }
  .nav-right { display: none; }     /* Connect Wallet moves into the mobile menu */
}
@media (max-width: 640px) {
  body { cursor: auto; }
  .cursor, .cursor-ring { display: none; }
}
