/* ============================================================
   MythMaker — site styles (landing + games)
   Dark "game-forge" theme. Solana gradient accents on near-black.
   Self-hosted fonts; content on solid surfaces over a dimmed 3D bg.
   ============================================================ */

@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/chakra-600.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/chakra-700.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/manrope-400.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/manrope-500.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/manrope-600.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/manrope-700.woff2") format("woff2"); }

:root {
  --bg: #080b10;
  --panel: #121823;
  --panel-2: #0e131c;
  --ink: #eef1f7;
  --muted: #a3acbd;
  --faint: #6c7485;
  --purple: #9d5cff;
  --green: #20f0a0;
  --grad: linear-gradient(120deg, #b07bff 0%, #8aa0ff 45%, #20f0a0 100%);
  --border: rgba(255, 255, 255, 0.10);
  --border-accent: rgba(157, 92, 255, 0.45);
  --radius: 14px;
  --maxw: 1140px;
  --font-display: "Chakra Petch", "Bahnschrift", "Segoe UI Semibold", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* base glow (furthest back) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(50vw 50vw at 85% -5%, rgba(157, 92, 255, 0.16), transparent 60%),
    radial-gradient(45vw 45vw at 0% 100%, rgba(32, 240, 160, 0.10), transparent 55%),
    var(--bg);
}
/* veil over the 3D bg: clearer at the hero, near-solid dark below so text is crisp */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(8, 11, 16, 0.32) 0%,
    rgba(8, 11, 16, 0.55) 40%,
    rgba(8, 11, 16, 0.86) 72%,
    rgba(8, 11, 16, 0.97) 100%
  );
}

/* interactive three.js background */
#bg3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
  display: block;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(8, 11, 16, 0.82);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 22px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: 0.3px; color: var(--ink); }
.brand img { width: 32px; height: 32px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.08); }
.brand b { color: var(--ink); font-weight: 700; }
.ticker { font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: 1px; color: var(--green); border: 1px solid var(--border-accent); border-radius: 6px; padding: 2px 7px; background: rgba(32, 240, 160, 0.08); white-space: nowrap; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 24px; }
.nav-links a { font-size: 14.5px; font-weight: 600; color: var(--muted); transition: color 0.18s; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { color: var(--green) !important; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: 0.4px;
  padding: 12px 22px; border-radius: 11px; border: 1px solid transparent; cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, border-color 0.16s, background 0.16s;
}
.btn-primary { background: var(--grad); color: #05120b; box-shadow: 0 8px 26px -10px rgba(157, 92, 255, 0.7); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn-ghost { background: rgba(255, 255, 255, 0.05); border-color: var(--border); color: var(--ink); }
.btn-ghost:hover { border-color: var(--green); background: rgba(32, 240, 160, 0.07); transform: translateY(-2px); }

/* ---------- hero ---------- */
.hero { padding: 84px 0 64px; position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--green);
  padding: 7px 14px; border: 1px solid var(--border-accent); border-radius: 999px; background: rgba(8, 11, 16, 0.6);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.headline {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(40px, 6.5vw, 78px); line-height: 1.03; letter-spacing: -0.5px;
  margin: 22px 0 0; max-width: 15ch; color: var(--ink);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6);
}
.headline .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.lede { font-size: 18.5px; color: var(--muted); max-width: 54ch; margin: 20px 0 0; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 32px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 44px; align-items: center; }
.hero-art {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border-accent);
  box-shadow: 0 30px 80px -28px rgba(0, 0, 0, 0.9), 0 0 50px -18px rgba(157, 92, 255, 0.4);
  aspect-ratio: 16 / 11;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, transparent 45%, rgba(8, 11, 16, 0.5)); }
.hero-badge {
  position: absolute; left: 14px; bottom: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 12.5px; letter-spacing: 0.4px;
  padding: 7px 12px; border-radius: 9px; background: rgba(8, 11, 16, 0.78); border: 1px solid var(--border-accent); backdrop-filter: blur(6px);
}

/* ---------- sections ---------- */
.section { padding: 56px 0; }
.section-head { margin-bottom: 32px; }
.section-head h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.4px; margin: 8px 0 0; color: var(--ink); }
.kicker { font-family: var(--font-display); font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--purple); }

/* solid, visible cards */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 30px -22px rgba(0, 0, 0, 0.9);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--border-accent); box-shadow: 0 18px 44px -24px rgba(157, 92, 255, 0.55); }
.card .ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: rgba(157, 92, 255, 0.14); border: 1px solid var(--border-accent); margin-bottom: 14px; font-size: 20px; }
.card h3 { font-family: var(--font-display); font-weight: 600; font-size: 17px; margin: 0 0 6px; color: var(--ink); }
.card p { color: var(--muted); font-size: 14.5px; margin: 0; line-height: 1.55; }

/* steps */
.step { position: relative; padding-top: 26px; }
.step-num { position: absolute; top: 16px; right: 18px; font-family: var(--font-display); font-weight: 700; font-size: 28px; letter-spacing: 1px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; opacity: 0.9; }
.step h3 { font-family: var(--font-display); font-weight: 600; font-size: 18px; margin: 0 0 8px; color: var(--ink); }
.step p { color: var(--muted); font-size: 14.5px; margin: 0; line-height: 1.55; }

/* ---------- worlds / games grid ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.world {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--panel-2);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 30px -24px rgba(0, 0, 0, 0.9);
}
.world:hover { transform: translateY(-4px); border-color: var(--border-accent); box-shadow: 0 22px 54px -28px rgba(32, 240, 160, 0.45); }
.world-thumb { aspect-ratio: 16 / 10; overflow: hidden; position: relative; background: #0b0f16; }
.world-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.world:hover .world-thumb img { transform: scale(1.06); }
.world-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(8, 11, 16, 0.9)); }
.world-tag { position: absolute; top: 11px; left: 11px; z-index: 2; font-family: var(--font-display); font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; padding: 5px 10px; border-radius: 7px; color: var(--green); background: rgba(8, 11, 16, 0.78); border: 1px solid var(--border-accent); }
.world-body { padding: 15px 17px 17px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.world-body h3 { font-family: var(--font-display); font-weight: 600; font-size: 18px; margin: 0; color: var(--ink); }
.world-body p { color: var(--muted); font-size: 13.5px; margin: 0 0 6px; flex: 1; line-height: 1.5; }
.world-actions { display: flex; gap: 9px; margin-top: 4px; }
.world-actions .btn { padding: 9px 14px; font-size: 13px; flex: 1; justify-content: center; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 56px; padding: 40px 0 56px; background: rgba(8, 11, 16, 0.6); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; justify-content: space-between; }
.footer .links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer .links a { color: var(--muted); font-size: 14.5px; font-weight: 600; transition: color 0.18s; }
.footer .links a:hover { color: var(--ink); }
.footer .note { color: var(--faint); font-size: 13px; margin-top: 14px; width: 100%; }

/* ---------- load animation ---------- */
.reveal { opacity: 0; transform: translateY(16px); animation: fadeUp 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }
.d1 { animation-delay: 0.05s; } .d2 { animation-delay: 0.12s; } .d3 { animation-delay: 0.19s; }
.d4 { animation-delay: 0.26s; } .d5 { animation-delay: 0.33s; } .d6 { animation-delay: 0.40s; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-art { order: -1; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .nav-links .hide-sm { display: none; }
}
@media (max-width: 560px) {
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 36px; }
  body { font-size: 16px; }
  .nav-links { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
}
