/* Chakra Online — landing page. Brand language mirrors the in-game login screen
   (client/src/hud/screens.ts): dark navy radial bg, cyan #58c8ff accents, orange CTA. */

:root {
  --bg-0: #070a14;
  --bg-1: #0b1020;
  --bg-2: #14223a;
  --ink: #e8f1ff;
  --ink-dim: #9fb4d8;
  --cyan: #58c8ff;
  --cyan-soft: rgba(88, 200, 255, 0.25);
  --card: linear-gradient(170deg, rgba(20, 30, 52, 0.92), rgba(10, 14, 26, 0.94));
  --card-border: rgba(120, 180, 255, 0.25);
  --orange-grad: linear-gradient(160deg, #ff9d2e, #e0640f);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-0);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: var(--cyan); }

/* ── buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: 12px; font-weight: 800; font-size: 16px;
  text-decoration: none; user-select: none; white-space: nowrap;
  transition: transform 0.08s ease, box-shadow 0.15s ease, filter 0.15s ease;
  position: relative; overflow: hidden;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-play {
  background: var(--orange-grad); color: #1c1206;
  box-shadow: 0 6px 26px rgba(255, 157, 46, 0.4);
}
.btn-play:hover { box-shadow: 0 10px 36px rgba(255, 157, 46, 0.55); filter: brightness(1.06); }
.btn-play::after {  /* shine sweep */
  content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: shine 3.6s ease-in-out infinite;
}
@keyframes shine { 0%, 65% { left: -80%; } 90%, 100% { left: 140%; } }
.btn-big { padding: 17px 40px; font-size: 19px; border-radius: 14px; letter-spacing: 1px; }
.btn-ghost {
  border: 1px solid var(--card-border); color: var(--ink);
  background: rgba(20, 30, 52, 0.45); backdrop-filter: blur(4px);
}
.btn-ghost:hover { border-color: var(--cyan); box-shadow: 0 6px 26px var(--cyan-soft); }

/* ── nav ─────────────────────────────────────────────────── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 26px;
  padding: 14px max(4vw, 18px);
  transition: background 0.25s ease, box-shadow 0.25s ease, padding 0.25s ease;
}
#nav.scrolled {
  background: rgba(7, 10, 20, 0.82); backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.55); padding: 9px max(4vw, 18px);
}
.brand img { height: 30px; display: block; filter: drop-shadow(0 2px 8px rgba(88, 200, 255, 0.35)); }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a {
  color: var(--ink-dim); text-decoration: none; font-weight: 600; font-size: 14px;
  letter-spacing: 0.4px; transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--cyan); }
.btn-nav { padding: 9px 20px; font-size: 14px; }
@media (max-width: 760px) { .nav-links { display: none; } .brand { margin-right: auto; } }

/* ── hero ────────────────────────────────────────────────── */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 90px 18px 60px;
  background: radial-gradient(120% 90% at 50% 0%, var(--bg-2) 0%, var(--bg-1) 55%, var(--bg-0) 100%);
  overflow: hidden;
}
#motes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-art {
  position: absolute; bottom: 0; height: min(66vh, 540px); z-index: 1;
  pointer-events: none; filter: drop-shadow(0 8px 30px rgba(0, 0, 0, 0.7));
  animation: float 7s ease-in-out infinite;
}
.art-left { left: max(1vw, 4px); animation-delay: -3.5s; }
.art-right { right: max(1vw, 4px); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@media (max-width: 1020px) { .hero-art { height: 46vh; opacity: 0.55; } }
@media (max-width: 760px) { .art-left { display: none; } .art-right { opacity: 0.35; height: 40vh; } }

.hero-core { position: relative; z-index: 2; max-width: 720px; }
.orb-wrap {
  position: absolute; left: 50%; top: -40px; transform: translateX(-50%);
  width: 380px; height: 380px; pointer-events: none; opacity: 0.5; filter: blur(1.5px);
}
.orb-wrap canvas { width: 100%; height: 100%; }
#logo {
  width: min(460px, 82vw); position: relative;
  animation: logo-glow 3.5s ease-in-out infinite;
}
@keyframes logo-glow {
  0%, 100% { filter: drop-shadow(0 2px 10px rgba(88, 200, 255, 0.27)); }
  50% { filter: drop-shadow(0 2px 26px rgba(88, 200, 255, 0.6)); }
}
.kicker {
  font-size: 12px; letter-spacing: 5px; font-weight: 700; color: var(--ink-dim); margin-top: 10px;
}
.hero h1 {
  font-size: clamp(30px, 5.4vw, 52px); line-height: 1.1; margin: 18px 0 0;
  font-weight: 900; letter-spacing: -0.5px;
  background: linear-gradient(180deg, #ffffff, #a8d4ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 10px 40px rgba(88, 200, 255, 0.18);
}
.hero .sub { color: var(--ink-dim); font-size: 17px; max-width: 620px; margin: 16px auto 26px; }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.fineprint { margin-top: 16px; font-size: 12.5px; opacity: 0.55; letter-spacing: 0.6px; }
.scroll-hint {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  color: var(--ink-dim); text-decoration: none; font-size: 22px; z-index: 2;
  animation: bob 1.8s ease-in-out infinite; opacity: 0.7;
}
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 7px); } }

/* ── stats strip ─────────────────────────────────────────── */
.stats {
  display: flex; justify-content: center; gap: clamp(20px, 6vw, 80px); flex-wrap: wrap;
  padding: 34px 18px; position: relative;
  background: linear-gradient(90deg, transparent, rgba(20, 34, 58, 0.65) 18%, rgba(20, 34, 58, 0.65) 82%, transparent);
  border-top: 1px solid rgba(120, 180, 255, 0.12);
  border-bottom: 1px solid rgba(120, 180, 255, 0.12);
}
.stat { text-align: center; min-width: 86px; }
.stat b { display: block; font-size: clamp(28px, 4vw, 42px); font-weight: 900; color: var(--cyan); text-shadow: 0 0 24px var(--cyan-soft); }
.stat span { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--ink-dim); }

/* ── sections ────────────────────────────────────────────── */
.section { padding: clamp(64px, 9vw, 110px) max(4vw, 18px); max-width: 1180px; margin: 0 auto; }
.head { text-align: center; margin-bottom: clamp(34px, 5vw, 56px); }
.head h2 { font-size: clamp(26px, 3.6vw, 40px); margin: 10px 0 0; font-weight: 900; }
.head .lead { color: var(--ink-dim); max-width: 640px; margin: 12px auto 0; }

/* features */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; }
.feat {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 16px;
  padding: 26px 24px; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.feat:hover {
  transform: translateY(-4px); border-color: rgba(159, 216, 255, 0.6);
  box-shadow: 0 14px 44px rgba(88, 200, 255, 0.16);
}
.feat .glyph {
  width: 50px; height: 50px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  font-size: 25px; background: rgba(88, 200, 255, 0.1); border: 1px solid rgba(88, 200, 255, 0.22);
  margin-bottom: 14px; text-shadow: 0 0 18px var(--cyan-soft);
}
.feat h3 { margin: 0 0 8px; font-size: 18px; }
.feat p { margin: 0; color: var(--ink-dim); font-size: 14.5px; }

/* jutsu showcase */
.jutsu {
  max-width: none;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(20, 34, 58, 0.8) 0%, transparent 100%),
    var(--bg-0);
}
.fx-row {
  display: flex; gap: 18px; flex-wrap: wrap; justify-content: center;
  max-width: 1180px; margin: 0 auto;
}
.fx-tile {
  margin: 0; text-align: center;
  background: radial-gradient(120% 120% at 50% 35%, #101a2e 0%, #070b16 75%);
  border: 1px solid var(--card-border); border-radius: 16px; padding: 14px 14px 10px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.fx-tile:hover {
  transform: translateY(-4px) scale(1.02); border-color: rgba(159, 216, 255, 0.65);
  box-shadow: 0 16px 50px rgba(88, 200, 255, 0.22);
}
.fx-tile canvas { width: 150px; height: 150px; display: block; border-radius: 10px; }
.fx-tile figcaption { font-size: 13px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--ink-dim); padding: 8px 0 4px; }
@media (max-width: 560px) { .fx-tile canvas { width: 132px; height: 132px; } }

/* screenshots */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.shot {
  margin: 0; position: relative; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--card-border); background: var(--bg-1);
}
.shot.wide { grid-column: 1 / -1; }
.shot img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  image-rendering: pixelated; transition: transform 0.35s ease;
}
.shot:hover img { transform: scale(1.04); }
.shot figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 16px 12px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.6px;
  background: linear-gradient(transparent, rgba(5, 8, 16, 0.88));
}
@media (max-width: 680px) { .gallery { grid-template-columns: 1fr; } }

/* download / CTA */
.dl { max-width: 980px; }
.dl-card {
  position: relative; overflow: hidden; text-align: center;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 22px;
  padding: clamp(40px, 6vw, 70px) 24px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
#dl-motes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.dl-card > *:not(canvas) { position: relative; }
.dl-card h2 { font-size: clamp(26px, 3.6vw, 40px); margin: 10px 0 0; font-weight: 900; }
.dl-card .lead { color: var(--ink-dim); margin: 12px auto 26px; max-width: 520px; }

/* ── M58 pre-registration form ── */
.prereg { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; max-width: 520px; margin: 0 auto; }
.prereg input {
  flex: 1 1 260px; min-width: 0; padding: 14px 16px; font-size: 16px;
  background: rgba(7, 10, 20, 0.72); color: var(--ink);
  border: 1px solid var(--card-border); border-radius: 12px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.prereg input::placeholder { color: var(--ink-dim); opacity: 0.7; }
.prereg input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.prereg .btn-play { flex: 0 0 auto; }
.prereg-msg { min-height: 21px; margin: 14px 0 0; font-size: 14px; font-weight: 600; color: var(--ink-dim); }
.prereg-msg.ok { color: #7dff9f; }
.prereg-msg.err { color: #ff9f9f; }
.dl-card .alt-link { display: inline-block; margin-top: 16px; font-size: 13px; color: var(--ink-dim); text-decoration: none; }
.dl-card .alt-link:hover { color: var(--cyan); }
.store-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.store-badge {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none;
  background: #0a0e1a; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 12px;
  padding: 10px 18px; color: var(--ink); position: relative; overflow: hidden;
}
.store-badge svg { width: 28px; height: 28px; }
.store-badge span { text-align: left; line-height: 1.15; }
.store-badge small { display: block; font-size: 10.5px; opacity: 0.65; letter-spacing: 0.4px; }
.store-badge b { font-size: 17px; }
.store-badge.soon { filter: grayscale(0.55); opacity: 0.75; cursor: default; }
.store-badge.soon:hover { opacity: 0.95; }
.ribbon {
  position: absolute; top: 7px; right: -26px; transform: rotate(38deg);
  background: var(--orange-grad); color: #1c1206; font-style: normal;
  font-size: 9px; font-weight: 900; letter-spacing: 1px; padding: 2px 28px;
}

/* footer */
footer {
  text-align: center; padding: 56px 18px 40px; color: var(--ink-dim); font-size: 13px;
  border-top: 1px solid rgba(120, 180, 255, 0.1);
  background: linear-gradient(180deg, transparent, rgba(11, 16, 32, 0.8));
}
footer img { height: 26px; opacity: 0.8; }
.foot-links { display: flex; gap: 22px; justify-content: center; margin: 14px 0 18px; }
.foot-links a { color: var(--ink-dim); text-decoration: none; font-weight: 600; }
.foot-links a:hover { color: var(--cyan); }
footer .tiny { opacity: 0.5; font-size: 11.5px; }

/* ── scroll reveal ───────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
