/* ============================================================
   Forked Marketplace. Brand v0.1, shared with forked.gg + forkcast.
   Game Boy DMG discipline: ~70% void black, phosphor green,
   white + arcade signals used sparingly.
   ============================================================ */
:root {
  --void: #050a05;
  --panel: #0e140c;
  --panel-2: #141b11;
  --panel-3: #182013;
  --moss: #81a454;
  --moss-deep: #5e7a3c;
  --boot: #b6d66b;
  --white: #ffffff;
  --amber: #e8b84b;
  --red: #d64b3f;
  --cyan: #5cc8c8;

  --text: #d4e3c2;
  --muted: #7f8e6c;
  --line: rgba(129, 164, 84, 0.2);
  --line-2: rgba(129, 164, 84, 0.4);

  --f-display: "Anton", system-ui, sans-serif;
  --f-pixel: "Press Start 2P", monospace;
  --f-body: "Space Grotesk", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 6px;
  --glow: 0 0 10px rgba(129, 164, 84, 0.4);
  --maxw: 1200px;
}

* { box-sizing: border-box; }
html { background: var(--void); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  background:
    radial-gradient(1100px 520px at 50% -160px, rgba(129, 164, 84, 0.08), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 34px,
    var(--void);
  overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* CRT scanlines + vignette */
.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 60;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.22) 2px 3px);
  mix-blend-mode: multiply;
}
.scanlines::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(130% 130% at 50% 35%, transparent 62%, rgba(0,0,0,0.5));
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px); }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* ============ NAV ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 12px clamp(18px, 4vw, 40px);
  border-bottom: 1px solid var(--line-2);
  background: rgba(5, 10, 5, 0.82);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-badge { width: 38px; height: 38px; filter: drop-shadow(0 0 6px rgba(129, 164, 84, 0.4)); }
.brand-name { font-family: var(--f-display); font-size: 23px; letter-spacing: 1.5px; color: var(--moss); text-shadow: var(--glow); line-height: 1; }
.brand-dot { color: var(--moss-deep); }
.brand-sub { font-family: var(--f-pixel); font-size: 8px; color: var(--moss-deep); letter-spacing: 1px; margin-top: 5px; display: block; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: var(--radius); transition: color 0.14s, background 0.14s;
}
.nav-links a:hover, .nav-links a.active { color: var(--boot); background: rgba(129, 164, 84, 0.1); }
.nav-cta { display: flex; align-items: center; gap: 10px; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--f-body); font-weight: 600; font-size: 14px; letter-spacing: 0.5px;
  text-transform: uppercase; text-decoration: none; color: var(--boot);
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 12px 22px; cursor: pointer;
  transition: background 0.14s, color 0.14s, transform 0.05s, box-shadow 0.14s;
}
.btn:hover { background: rgba(129, 164, 84, 0.16); color: var(--white); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--moss); color: var(--void); border-color: var(--moss); }
.btn-primary:hover { background: var(--boot); color: var(--void); box-shadow: 0 6px 22px rgba(129, 164, 84, 0.28); }
.btn.small { padding: 9px 15px; font-size: 12.5px; }

/* ============ HERO ============ */
.hero { position: relative; overflow: hidden; padding: clamp(60px, 10vw, 116px) 0 clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--line); }
.hero-art {
  position: absolute; inset: 0;
  background: url("assets/keyart-1.png") center 28% / cover no-repeat;
  opacity: 0.18; filter: saturate(0.7) contrast(1.05);
  -webkit-mask-image: radial-gradient(120% 100% at 70% 30%, #000 30%, transparent 78%);
  mask-image: radial-gradient(120% 100% at 70% 30%, #000 30%, transparent 78%);
}
.hero-grid {
  position: absolute; inset: 0;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 44px 100%;
  -webkit-mask-image: radial-gradient(80% 80% at 50% 0%, #000, transparent 70%);
  mask-image: radial-gradient(80% 80% at 50% 0%, #000, transparent 70%);
  opacity: 0.5;
}
.hero-inner { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px); }
.kicker {
  display: inline-block; font-family: var(--f-pixel); font-size: 9px; color: var(--moss-deep);
  letter-spacing: 1px; border: 1px solid var(--line-2); border-radius: 3px; padding: 6px 9px; text-transform: lowercase;
}
.hero-title {
  font-family: var(--f-display); font-weight: 400; font-size: clamp(38px, 6.5vw, 80px);
  line-height: 0.98; letter-spacing: 1px; margin: 20px 0 0; color: var(--white); text-shadow: 0 0 30px rgba(0,0,0,0.8);
}
.hero-title em { color: var(--moss); font-style: normal; text-shadow: 0 0 24px rgba(129, 164, 84, 0.45); }
.hero-sub { max-width: 640px; margin: 22px 0 0; font-size: clamp(16px, 2vw, 19px); color: var(--text); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

/* ============ SECTION ============ */
.section { padding: clamp(48px, 7vw, 88px) 0; border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 32px; }
.section-title { font-family: var(--f-display); font-weight: 400; font-size: clamp(26px, 4vw, 42px); line-height: 1.06; letter-spacing: 0.5px; color: var(--white); margin: 12px 0 0; }
.section-intro { margin: 12px 0 0; font-size: 15.5px; color: var(--muted); max-width: 560px; }

/* ============ COLLECTION META STRIP ============ */
.coll-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 30px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.coll-stat { background: rgba(14, 20, 12, 0.7); padding: 16px 18px; }
.coll-stat b { display: block; font-family: var(--f-display); font-size: clamp(20px, 3vw, 28px); color: var(--boot); text-shadow: var(--glow); line-height: 1; letter-spacing: 0.5px; }
.coll-stat span { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.coll-stat .coll-note { margin-top: 4px; color: var(--boot); }

/* ============ MANIFESTO ============ */
.manifesto { max-width: 780px; margin: 0 0 32px; padding: 22px 26px; background: linear-gradient(120deg, rgba(129, 164, 84, 0.1), rgba(14, 20, 12, 0.5)); border: 1px solid var(--line-2); border-left: 3px solid var(--moss); border-radius: var(--radius); }
.manifesto-lead { font-family: var(--f-display); font-weight: 400; font-size: clamp(22px, 3.4vw, 32px); color: var(--boot); text-shadow: var(--glow); letter-spacing: 0.5px; text-transform: uppercase; margin: 0 0 10px; }
.manifesto p { margin: 0; font-size: 15px; color: var(--text); line-height: 1.7; }
.manifesto p + p { margin-top: 12px; }
.manifesto b { color: var(--white); }
.manifesto-equal { color: var(--boot) !important; font-weight: 500; }
.manifesto-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.grid-empty { grid-column: 1 / -1; color: var(--muted); font-family: var(--f-mono); font-size: 13px; padding: 24px 0; }

/* ============ MARKET GRID ============ */
.market-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.item-card {
  display: flex; flex-direction: column; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.16s, transform 0.16s, box-shadow 0.16s;
}
.item-card:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: 0 0 18px rgba(129, 164, 84, 0.18); }
.item-art { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: radial-gradient(120% 120% at 50% 18%, rgba(129,164,84,0.12), var(--void) 70%); border-bottom: 1px solid var(--line); }
.item-art img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 12px; transition: transform 0.2s; }
.item-card:hover .item-art img { transform: scale(1.05); }
.item-scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.14) 2px 3px); mix-blend-mode: multiply; }
.item-rank { position: absolute; top: 8px; left: 8px; font-family: var(--f-mono); font-size: 10.5px; color: var(--moss); background: rgba(5,10,5,0.78); border: 1px solid var(--line-2); border-radius: 3px; padding: 3px 6px; }
.item-body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 10px; }
.item-name { font-family: var(--f-body); font-weight: 600; font-size: 14.5px; color: var(--white); margin: 0; }
.item-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item-price { font-family: var(--f-mono); font-size: 13px; color: var(--boot); }
.item-price small { color: var(--muted); font-size: 11px; }
.item-buy { font-family: var(--f-body); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--moss); border: 1px solid var(--line-2); border-radius: 4px; padding: 6px 10px; background: transparent; cursor: pointer; transition: all 0.14s; }
.item-buy:hover { background: var(--moss); color: var(--void); }

/* ============ HOW IT WORKS ============ */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; }
.step-n { font-family: var(--f-display); font-size: 28px; color: var(--moss-deep); line-height: 1; }
.step h4 { font-family: var(--f-body); font-weight: 600; font-size: 16px; color: var(--white); margin: 12px 0 6px; }
.step p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.55; }

/* ============ BANNER ============ */
.build-note { display: flex; gap: 14px; align-items: flex-start; margin-top: 26px; padding: 16px 20px; background: rgba(232, 184, 75, 0.06); border: 1px solid rgba(232, 184, 75, 0.4); border-left: 3px solid var(--amber); border-radius: var(--radius); }
.build-note svg { width: 20px; height: 20px; flex: none; fill: var(--amber); margin-top: 2px; }
.build-note p { margin: 0; font-size: 13.5px; color: var(--text); line-height: 1.6; }
.build-note b { color: var(--amber); }

/* ============ FOOTER ============ */
.footer { padding: 40px 0 34px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-badge { width: 42px; height: 42px; filter: drop-shadow(0 0 6px rgba(129, 164, 84, 0.35)); }
.footer-name { font-family: var(--f-display); font-size: 21px; letter-spacing: 1.5px; color: var(--moss); text-shadow: var(--glow); }
.footer-tag { font-size: 12px; color: var(--muted); margin-top: 2px; }
.footer-legal { padding-top: 20px; }
.footer-legal p { margin: 0; font-size: 12px; color: var(--moss-deep); max-width: 820px; line-height: 1.6; }
.footer-meta { margin-top: 10px !important; font-family: var(--f-mono); letter-spacing: 0.5px; }

/* ============ TOAST ============ */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); z-index: 80; background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--moss); border-radius: var(--radius); padding: 14px 18px; max-width: 380px; font-size: 13.5px; color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,0.5); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast b { color: var(--boot); }

/* ============ REDEEM (2026-10-02) ============ */
.redeem-status { scroll-margin-top: 96px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 22px; padding: 16px 20px; background: linear-gradient(120deg, rgba(129, 164, 84, 0.1), rgba(14, 20, 12, 0.5)); border: 1px solid var(--line-2); border-left: 3px solid var(--moss); border-radius: var(--radius); }
.redeem-status p { margin: 0; font-size: 14.5px; color: var(--text); line-height: 1.6; max-width: 760px; }
.redeem-status b { color: var(--white); }
.redeem-status a { color: var(--boot); }
code { font-family: var(--f-mono); font-size: 0.92em; color: var(--boot); background: rgba(129, 164, 84, 0.1); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; }
.item-num { font-family: var(--f-mono); font-weight: 400; font-size: 11.5px; color: var(--muted); }
.item-card.is-claimed { opacity: 0.55; }
.item-card.is-claimed:hover { transform: none; box-shadow: none; }
.item-card.is-mine { border-color: var(--moss); box-shadow: 0 0 18px rgba(129, 164, 84, 0.28); }
.item-rank.is-claimed { color: var(--muted); border-color: var(--line); }
.item-rank.is-mine { color: var(--void); background: var(--moss); border-color: var(--moss); }
.item-buy:disabled { opacity: 0.5; cursor: default; background: transparent; color: var(--muted); }
.item-buy.is-mine { background: var(--moss); color: var(--void); }

body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(2, 5, 2, 0.78); }
.modal[hidden] { display: none; }
.modal-card { position: relative; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-top: 3px solid var(--moss); border-radius: var(--radius); padding: 22px 22px 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); }
.modal-x { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.modal-x:hover { color: var(--white); }
.modal-fig { margin: 0 0 14px; text-align: center; }
.modal-fig img { width: 180px; height: 180px; object-fit: contain; background: radial-gradient(120% 120% at 50% 18%, rgba(129,164,84,0.14), var(--void) 70%); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.modal-fig figcaption { margin-top: 8px; font-weight: 600; color: var(--white); }
.modal-title { font-family: var(--f-display); font-weight: 400; font-size: 26px; letter-spacing: 0.5px; color: var(--boot); margin: 0 0 8px; text-transform: uppercase; }
.modal-body p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.6; }
.modal-body b { color: var(--white); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.modal-progress { display: flex; align-items: center; gap: 10px; }
.spinner { width: 16px; height: 16px; flex: none; border: 2px solid var(--line-2); border-top-color: var(--moss); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ============ RESPONSIVE ============ */
@media (max-width: 1040px) { .market-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 860px) {
  .nav-links { display: none; }
  .market-grid { grid-template-columns: repeat(3, 1fr); }
  .coll-meta { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .market-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-cta .btn.small { padding: 8px 12px; }
}
