/* ============================================================
   $TREASURE — Sherwood Treasure Chest
   Dark theme with the chest's lime + gold. No frameworks.
   ============================================================ */

:root {
  --bg: #0b0e09;
  --surface: #131810;
  --surface-2: #1a2115;
  --line: #2a331f;
  --ink: #f2f4ec;
  --ink-2: #c4ccb4;
  --muted: #8d977c;
  --lime: #c9f04d;
  --lime-deep: #a8d32a;
  --gold: #e7b64c;
  --red: #e77c6a;
  --radius: 16px;
  --maxw: 1080px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, .stat-value, .rewards-value, .brand-name {
  font-family: "Space Grotesk", "Inter", sans-serif;
}

a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.92em;
}

.hidden { display: none !important; }
.center { text-align: center; justify-content: center; }

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 34px; height: 34px; border-radius: 50%; }
.brand-name { font-weight: 700; font-size: 1.05rem; color: var(--ink); letter-spacing: 0.02em; }

.topnav { display: flex; gap: 20px; margin-left: auto; }
.topnav a { color: var(--ink-2); font-size: 0.95rem; font-weight: 500; }
.topnav a:hover { color: var(--ink); text-decoration: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-accent {
  background: var(--lime);
  color: #16210a;
  box-shadow: 0 4px 24px rgba(201, 240, 77, 0.25);
}
.btn-accent:hover { background: #d6f76a; box-shadow: 0 6px 28px rgba(201, 240, 77, 0.35); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--surface-2); }

/* ---------- Hero ---------- */

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 84px 24px 48px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 22px;
}
.badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
  animation: pulse 2.2s infinite;
}
.badge-link {
  margin: 18px 0 0;
  color: var(--lime);
  border-color: rgba(201, 240, 77, 0.35);
  transition: background 0.12s ease;
}
.badge-link:hover { background: var(--surface-2); text-decoration: none; }
.card-link { margin-right: 16px; }
@keyframes pulse { 50% { opacity: 0.45; } }

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.7rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.grad {
  background: linear-gradient(92deg, var(--lime) 20%, var(--gold) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede { color: var(--ink-2); font-size: 1.08rem; max-width: 54ch; }
.lede strong { color: var(--ink); }

.ca-row { display: flex; align-items: center; gap: 10px; margin: 26px 0 18px; }
.ca {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--gold);
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-art { position: relative; display: flex; justify-content: center; }
.chest {
  width: min(320px, 70vw);
  border-radius: 50%;
  position: relative;
  z-index: 1;
  animation: floaty 5s ease-in-out infinite;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-14px) rotate(1deg); }
}
.chest-glow {
  position: absolute;
  inset: 10% 15%;
  background: radial-gradient(closest-side, rgba(201, 240, 77, 0.28), transparent 70%);
  filter: blur(30px);
}

/* ---------- Marquee ---------- */

.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 12px 0;
  background: var(--surface);
}
.marquee-track {
  display: flex;
  gap: 36px;
  width: max-content;
  animation: scroll 30s linear infinite;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-2);
}
.marquee-track .tick { color: var(--gold); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- Terminal (matrix-style RWA/stats look) ---------- */

.mono, .term-bar, .term-title, .term-live, .stat-label, .stat-value, .stat-sub,
.stats-note, .rewards-value, .rewards-note, .chip, .term-h, .marquee-track {
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

.stats-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 24px 8px;
}

.terminal {
  position: relative;
  background: #0c120a;
  border: 1px solid rgba(201, 240, 77, 0.32);
  border-radius: 12px;
  box-shadow: 0 0 28px rgba(201, 240, 77, 0.08),
              inset 0 0 60px rgba(201, 240, 77, 0.04);
  overflow: hidden;
}
/* scanlines */
.terminal::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg, transparent 0 2px, rgba(0, 0, 0, 0.16) 2px 4px);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(201, 240, 77, 0.22);
  background: rgba(201, 240, 77, 0.05);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}
.term-dots { display: flex; gap: 6px; }
.term-dots i {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(201, 240, 77, 0.35);
}
.term-dots i:first-child { background: var(--lime); }
.term-dots i:nth-child(2) { background: var(--gold); }
.term-title { color: var(--ink-2); }
.term-live {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--lime);
  font-weight: 700;
}

.term-body { position: relative; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
  min-width: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 1px dashed rgba(201, 240, 77, 0.18);
}
.stat:first-child { border-left: none; }

.stat-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
}
.stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--lime);
  text-shadow: 0 0 14px rgba(201, 240, 77, 0.45);
}
.stat-sub { font-size: 0.82rem; font-weight: 700; }
.stat-sub.up { color: var(--lime-deep); }
.stat-sub.down { color: var(--red); }

.stats-note {
  position: relative;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-align: right;
  padding: 8px 16px 10px;
  border-top: 1px solid rgba(201, 240, 77, 0.14);
}

.cursor {
  display: inline-block;
  margin-left: 4px;
  color: var(--lime);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.term-h {
  color: var(--lime);
  text-shadow: 0 0 16px rgba(201, 240, 77, 0.4);
  letter-spacing: 0.04em;
}
.term-h::before { content: "// "; color: var(--muted); text-shadow: none; }

/* ---------- Sections ---------- */

.section { max-width: var(--maxw); margin: 0 auto; padding: 72px 24px; }
.section h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  letter-spacing: -0.01em;
  margin-bottom: 32px;
}

.section-alt {
  max-width: none;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section-alt h2 { max-width: var(--maxw); }
.section-alt .cards, .section-alt .steps, .section-alt .rewards-grid { max-width: var(--maxw); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.section-alt .card { background: var(--surface-2); }
.card-icon { font-size: 1.8rem; margin-bottom: 14px; }
.card h3 { font-size: 1.12rem; margin-bottom: 10px; }
.card p { color: var(--ink-2); font-size: 0.95rem; }
.card code { color: var(--gold); }
.card-link { display: inline-block; margin-top: 12px; font-size: 0.9rem; font-weight: 600; }

/* Rewards — ladder-style terminal panel */
.ladder {
  position: relative;
  background: #0c120a;
  border: 1px solid rgba(201, 240, 77, 0.32);
  border-radius: 12px;
  padding: 36px 44px;
  box-shadow: 0 0 28px rgba(201, 240, 77, 0.08);
  overflow: hidden;
}
/* dashed side rails like an activation ladder */
.ladder::before, .ladder::after {
  content: "";
  position: absolute;
  top: 10px; bottom: 10px;
  width: 5px;
  background: repeating-linear-gradient(
    180deg, var(--lime) 0 12px, transparent 12px 26px);
  opacity: 0.7;
}
.ladder::before { left: 10px; }
.ladder::after { right: 10px; }

.rewards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.rewards-value {
  display: block;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  color: var(--lime);
  text-shadow: 0 0 20px rgba(201, 240, 77, 0.5);
  margin: 8px 0 12px;
}
.rewards-note { color: var(--muted); font-size: 0.82rem; max-width: 48ch; line-height: 1.7; }

.stock-board {
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stock-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: baseline;
  padding: 9px 2px;
  border-bottom: 1px dashed rgba(201, 240, 77, 0.18);
  font-size: 0.92rem;
}
.stock-shares { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.04em; }
.stock-row:last-child { border-bottom: none; }
.stock-tick { color: var(--gold); font-weight: 700; }
.stock-price {
  color: var(--lime);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(201, 240, 77, 0.35);
}
.stock-change { font-size: 0.8rem; font-weight: 700; min-width: 3.5em; text-align: right; }
.stock-change.up { color: var(--lime-deep); }
.stock-change.down { color: var(--red); }

/* Story */
.story { max-width: 68ch; display: grid; gap: 18px; }
.story p { color: var(--ink-2); font-size: 1.05rem; }
.story strong { color: var(--ink); }

/* Steps */
.steps { list-style: none; display: grid; gap: 14px; }
.step {
  display: flex;
  gap: 20px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
}
.step-num {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--lime);
  color: #16210a;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
}
.step h3 { font-size: 1.05rem; margin-bottom: 4px; }
.step p { color: var(--ink-2); font-size: 0.95rem; }

/* Community */
.community { text-align: center; }
.community .lede { margin: -14px auto 28px; }

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 40px 24px 48px;
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  gap: 12px;
}
.footer p { color: var(--muted); font-size: 0.82rem; max-width: 76ch; }
.footer-ca code { color: var(--muted); font-size: 0.78rem; word-break: break-all; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .topnav { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 48px; text-align: left; }
  .hero-art { order: -1; }
  .chest { width: min(220px, 55vw); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(odd) { border-left: none; }
  .stat:nth-child(n+3) { border-top: 1px dashed rgba(201, 240, 77, 0.18); }
  .cards { grid-template-columns: 1fr; }
  .rewards-grid { grid-template-columns: 1fr; }
  .ladder { padding: 28px 30px; }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 1.4rem; }
  .cta-row .btn { width: 100%; justify-content: center; }
}
