/* ─── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0b0f14;
  --bg2:       #111820;
  --bg3:       #1a2330;
  --border:    #1e2d3d;
  --green:     #14f195;
  --green-dim: #0d9e61;
  --blue:      #28a0f0;
  --blue-dim:  #1a6ea8;
  --text:      #e2e8f0;
  --text-2:    #8ca3bf;
  --text-3:    #4a6278;
  --mono:      'Space Mono', monospace;
  --sans:      'Space Grotesk', sans-serif;
  --radius:    8px;
  --radius-lg: 16px;
  --bw:        1px;   /* border width — light mode thickens it */
}

/* ─── Light Theme ────────────────────────────────────────────────────────────
   Toggled from the wallet menu (Light/Dark Mode). data-theme is stamped on
   <html> by an inline head script (before first paint) and by toggleTheme()
   in config.js. Dark stays the default; this block only overrides the
   palette variables — every component inherits automatically. The neon
   green/blue are deepened here: #14f195 on white is unreadable. */
:root[data-theme="light"] {
  --bg:        #f4f7fa;
  --bg2:       #ffffff;
  --bg3:       #e7edf4;
  --border:    #d4dde7;
  --green:     #0d9e61;
  --green-dim: #0a7a4b;
  --blue:      #1a6ea8;
  --blue-dim:  #28a0f0;
  --text:      #16202b;
  --text-2:    #46586c;
  --text-3:    #7d92a8;
  --bw:        1.5px;  /* hairline borders wash out on white — thicker
                          (1.2px would be floored back to 1px by the browser;
                          1.5px is the smallest step that actually renders) */
}

/* Landing feature grid draws its dividers with a 1px gap over the border
   color — thicken it in step with --bw. */
:root[data-theme="light"] .features { gap: 1.5px; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ─── Nav ───────────────────────────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: var(--bg);
  border-bottom: var(--bw) solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
}
.nav-logo-mark { color: var(--green); font-size: 22px; }

.nav-links { display: flex; align-items: center; gap: 4px; }

.nav-group { position: relative; }

.nav-group-btn {
  background: none;
  border: none;
  color: var(--text-2);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-group-btn:hover { color: var(--text); background: var(--bg2); }
.nav-caret { font-size: 10px; opacity: 0.6; }

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg2);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  min-width: 160px;
  padding: 6px;
  z-index: 200;
}
.nav-group:hover .nav-dropdown { display: flex; flex-direction: column; }

.nav-dropdown a {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-2);
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.nav-dropdown a:hover { color: var(--text); background: var(--bg3); }

.nav-soon { opacity: 0.5; cursor: default; }
.badge-soon {
  font-size: 10px;
  background: var(--bg3);
  color: var(--text-3);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
}

.nav-actions { display: flex; align-items: center; gap: 10px; }

.network-badge {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--blue);
  background: rgba(40,160,240,0.1);
  border: 1px solid rgba(40,160,240,0.2);
  border-radius: 20px;
  padding: 3px 10px;
}

.btn-connect {
  background: var(--green);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-connect:hover { opacity: 0.85; }

.wallet-info {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg2);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
}
.wallet-addr {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
}
.wallet-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.wallet-caret { font-size: 9px; color: var(--text-3); opacity: 0.7; }

.wallet-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  flex-direction: column;
  background: var(--bg2);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  min-width: 180px;
  padding: 6px;
  z-index: 200;
}
.wallet-info:hover .wallet-dropdown,
.wallet-info.open .wallet-dropdown { display: flex; }

.wallet-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 8px 12px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-2);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.wallet-menu-item:hover:not(:disabled) { color: var(--text); background: var(--bg3); }
.wallet-menu-item:disabled { opacity: 0.5; cursor: default; }
.wallet-menu-item.danger:hover:not(:disabled) { color: #ff5c5c; }

.hidden { display: none !important; }

/* ─── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  padding: 80px 48px 64px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--blue);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-headline {
  font-size: clamp(48px, 6vw, 80px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 20px;
}
.headline-accent { color: var(--green); }

.hero-sub {
  font-size: 18px;
  color: var(--text-2);
  max-width: 400px;
  margin-bottom: 36px;
  line-height: 1.5;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-primary {
  background: var(--green);
  color: #000;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-weight: 700;
  font-size: 15px;
  transition: opacity 0.15s;
  display: inline-block;
}
.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  padding: 12px 24px;
  font-weight: 500;
  font-size: 15px;
  transition: border-color 0.15s, color 0.15s;
  display: inline-block;
}
.btn-secondary:hover { border-color: var(--green); color: var(--green); }

/* ─── Scroll Display (signature element) ─────────────────────────────────── */
.scroll-display {
  flex-shrink: 0;
  background: var(--bg2);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  min-width: 300px;
  text-align: center;
}

.scroll-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.scroll-window {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.scroll-char {
  width: 44px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--green);
  background: var(--bg3);
  border: var(--bw) solid var(--border);
  border-radius: 6px;
  transition: color 0.3s, border-color 0.3s;
}
.scroll-char.dim { color: var(--text-3); border-color: transparent; }
.scroll-char.masked { color: var(--text-2); border-color: var(--border); }

.scroll-meta {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 14px;
}

.scroll-pot {
  font-size: 13px;
  color: var(--blue);
  font-weight: 500;
}

/* ─── Stats Bar ─────────────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  border-top: var(--bw) solid var(--border);
  border-bottom: var(--bw) solid var(--border);
  background: var(--bg2);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 32px;
  border-right: var(--bw) solid var(--border);
  flex: 1;
  min-width: 140px;
}
.stat-item:last-child { border-right: none; }

.stat-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stat-val {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* ─── Features ──────────────────────────────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-top: var(--bw) solid var(--border);
  border-bottom: var(--bw) solid var(--border);
}

.feature-card {
  background: var(--bg);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-icon {
  font-size: 24px;
  color: var(--green);
  margin-bottom: 4px;
}

.feature-card h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.55;
  flex: 1;
}

.feature-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  margin-top: 8px;
  transition: opacity 0.15s;
}
.feature-link:hover { opacity: 0.75; }

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  font-size: 13px;
  color: var(--text-3);
  border-top: var(--bw) solid var(--border);
}

.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-3); transition: color 0.15s; }
.footer-links a:hover { color: var(--text-2); }
.footer-left { display: flex; align-items: center; gap: 8px; }
.footer-left .nav-logo-mark { color: var(--green); }

/* ─── Responsive ────────────────────────────────────────────────────────────── */

/* ─── Hamburger (tablet portrait + mobile) ──────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: background 0.15s;
}
.nav-hamburger:hover span { background: var(--text); }

/* Mobile nav overlay */
.nav-mobile-overlay {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--bg2);
  border-bottom: var(--bw) solid var(--border);
  padding: 16px 20px 20px;
  z-index: 99;
  flex-direction: column;
  gap: 4px;
}
.nav-mobile-overlay.open { display: flex; }
.nav-mobile-overlay a {
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--radius);
  display: block;
}
.nav-mobile-overlay a:hover { color: var(--text); background: var(--bg3); }
.nav-mobile-section {
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 1px;
  color: var(--text-3);
  padding: 10px 12px 4px;
}

@media (max-width: 860px) {
  .hero {
    flex-direction: column;
    padding: 48px 24px 40px;
    text-align: center;
  }
  .hero-sub { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .scroll-display { min-width: unset; width: 100%; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .footer { flex-direction: column; gap: 12px; padding: 20px 24px; text-align: center; }
}

  .nav-hamburger { display: flex; }

@media (max-width: 480px) {
  .features { grid-template-columns: 1fr; }
  .stats-bar { flex-direction: column; }
  .stat-item { border-right: none; border-bottom: var(--bw) solid var(--border); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
