/* Blaze Eleven — Landing Page (step 1: static layout)
   Pixel fonts are only crisp at their native multiples:
   m5x7 / TA GBA monothai → 16 / 32 / 48 px · Press Start 2P → 8 / 16 / 24 / 32 px */

@font-face { font-family: "PS2P"; src: url("assets/fonts/PressStart2P.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "m5x7"; src: url("assets/fonts/m5x7.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "TAGBA"; src: url("assets/fonts/tagba_max.ttf") format("truetype"); font-display: swap; }

:root {
  /* same palette as UiKit (scripts/view/ui_kit.gd) */
  --bg: #0a0f20;
  --bg2: #0d1736;
  --panel: #011347;
  --edge: #3c4a78;
  --gold: #ffe14a;
  --on-gold: #3a2000;
  --dim: #8d98bd;
  --ink: #05060c;
  --frost: #9ce8ff;
  --mint: #30f0d4;
  --white: #eef3ff;
  --nav-h: 64px;
  --body: "m5x7", "TAGBA", monospace;
  --head: "PS2P", "TAGBA", monospace;
}
html[lang="th"] { --body: "TAGBA", "m5x7", monospace; --head: "PS2P", "TAGBA", monospace; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0; background: var(--bg); color: var(--white);
  font-family: var(--body); font-size: 32px; line-height: 1.0;
  -webkit-font-smoothing: none; font-smooth: never;
  text-rendering: optimizeSpeed;
}
img { image-rendering: pixelated; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

/* language switch: both languages live in the markup */
html[lang="th"] [data-l="en"], html[lang="en"] [data-l="th"] { display: none !important; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 880px; }

/* ---------- pixel buttons (9-slice of the in-game skin, slice 6, drawn ×2) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  border-style: solid; border-width: 12px; border-image-slice: 6 fill; border-image-repeat: stretch;
  image-rendering: pixelated; white-space: nowrap; user-select: none;
  padding: 0 12px; height: 56px; line-height: 1;
  transition: transform .06s steps(1), filter .06s steps(1);
}
.btn:active { transform: translateY(2px); }
.btn-gold { border-image-source: url("assets/ui/btn_gold_s.png"); color: var(--on-gold); }
.btn-gold:hover { filter: brightness(1.12); }
.btn-blue { border-image-source: url("assets/ui/btn_normal_s.png"); color: var(--white); }
.btn-blue:hover { border-image-source: url("assets/ui/btn_hover_s.png"); }
.btn-blue:active { border-image-source: url("assets/ui/btn_pressed_s.png"); }
.btn-sm { height: 48px; padding: 0 8px; }
.btn-lg { height: 72px; padding: 0 28px; }
.btn-lg, .btn-sm { font-family: var(--body); }

/* ---------- navbar ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  background: linear-gradient(to bottom, rgba(4, 6, 26, .68), rgba(4, 6, 26, 0));
  border-bottom: 4px solid transparent;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.nav.solid {
  background: #0b1a44;
  border-bottom-color: var(--gold);
  box-shadow: 0 4px 0 var(--ink);
}
.nav-in { height: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 24px; }
.nav-logo img { height: 44px; width: auto; image-rendering: auto; opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s; }
.nav.solid .nav-logo img { opacity: 1; transform: none; }
.nav-links { display: flex; align-items: center; gap: 14px; margin: 0 auto; }
.nav-links a { padding: 6px 4px; color: var(--white); text-shadow: 0 2px 0 var(--ink); }
.nav-links a:hover, .nav-links a.on { color: var(--gold); }
.nav-links i { color: var(--dim); font-style: normal; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.lang { display: flex; border: 2px solid var(--edge); background: rgba(1, 19, 71, .7); box-shadow: 0 0 0 2px var(--ink); }
.lang button { border: 0; background: transparent; padding: 4px 10px; color: var(--dim); line-height: 1; }
.lang button.on { background: var(--gold); color: var(--on-gold); }
.burger { display: none; border: 2px solid var(--edge); background: var(--panel); width: 48px; height: 44px; box-shadow: 0 0 0 2px var(--ink); }

/* ---------- hero ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; max-height: 1080px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.hero-bg { position: absolute; inset: 0; overflow: hidden; background: #04061a; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.hero-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 52% 44% at 50% 52%, rgba(4, 6, 26, .66), rgba(4, 6, 26, 0) 74%),
    linear-gradient(to bottom, rgba(10, 15, 32, 0) 74%, var(--bg) 100%);
}
.hero-in { position: relative; z-index: 2; text-align: center; padding: var(--nav-h) 20px 40px; display: flex; flex-direction: column; align-items: center; transition: opacity .35s ease, transform .35s ease; }
.hero-in.intro-hide { opacity: 0; transform: scale(.96); pointer-events: none; }
.hero-ctrl {
  position: absolute; right: 20px; bottom: 18px; z-index: 4;
  border: 2px solid var(--edge); background: rgba(1, 19, 71, .82); color: var(--frost);
  box-shadow: 0 0 0 2px var(--ink); padding: 4px 12px; font-size: 24px; line-height: 1.1;
}
.hero-ctrl:hover { border-color: var(--gold); color: var(--gold); }
.hero-ctrl[data-mode="skip"] .ctrl-replay { display: none; }
.hero-ctrl[data-mode="replay"] .ctrl-skip { display: none; }
.tag-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }
.chip { font-family: var(--head); font-size: 8px; padding: 7px 10px 6px; border: 2px solid; box-shadow: 0 0 0 2px var(--ink); letter-spacing: 1px; line-height: 1; }
html[lang="th"] .chip { font-family: var(--body); font-size: 16px; padding: 4px 10px; }
html[lang="th"] .chip span[data-l] , .chip span { font-family: inherit; }
.chip-frost { color: var(--frost); border-color: #4f8cff; background: rgba(10, 30, 80, .8); }
.chip-gold { color: var(--on-gold); border-color: #fff4b5; background: var(--gold); }
.hero-logo { margin: 0; }
.hero-logo img { width: 660px; max-width: 92vw; height: auto; filter: drop-shadow(0 6px 0 rgba(5, 6, 12, .6)); }
.hero-sub { margin: 18px 0 0; font-size: 48px; color: var(--white); text-shadow: 0 3px 0 var(--ink), 0 0 18px rgba(79, 140, 255, .55); }
.hero-sub2 { margin: 10px 0 0; color: var(--frost); text-shadow: 0 2px 0 var(--ink), 0 0 12px rgba(4, 6, 26, .95); max-width: 860px; }
.cta-row { display: flex; gap: 18px; margin-top: 34px; flex-wrap: wrap; justify-content: center; }
.scroll-hint {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 2;
  font-family: var(--head); font-size: 16px; color: var(--gold); text-shadow: 0 2px 0 var(--ink);
  animation: bob 1.2s steps(2) infinite;
}
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

/* ---------- sections ---------- */
.sec { padding: 96px 0; }
.sec-alt { background: var(--bg2); border-top: 4px solid var(--ink); border-bottom: 4px solid var(--ink); }
.h2 {
  font-family: var(--head); font-size: 24px; line-height: 1.4; margin: 0 0 14px; text-align: center;
  color: var(--gold); text-shadow: 0 4px 0 var(--ink);
}
html[lang="th"] .h2 [data-l="th"] { font-family: var(--body); font-size: 48px; }
.lead { text-align: center; color: var(--dim); margin: 0 auto 44px; max-width: 900px; }
.rainbow {
  background: linear-gradient(90deg, #ff6a8a, #ffd447, #6be36b, #4fd8ff, #b084ff, #ff6a8a);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; filter: drop-shadow(0 4px 0 var(--ink));
}

/* panel = 9-slice of panel_gold.png (slice 8, ×2) */
.panel, .ur-card, .feat, .qa, .road li {
  border-style: solid; border-width: 16px; border-image: url("assets/ui/panel_gold.png") 8 fill stretch;
  image-rendering: pixelated;
}

/* ---------- UR cards ---------- */
.ur-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.ur-card {
  --c: var(--frost);
  display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 8px;
  padding: 4px; background: none; transition: transform .1s steps(2);
}
.ur-card:hover { transform: translateY(-6px); }
.ur-card.c-frost { --c: #9ce8ff; --c2: #1b3f8f; }
.ur-card.c-gold { --c: #ffd447; --c2: #3a2a10; }
.ur-card.c-mint { --c: #30f0d4; --c2: #0a3a40; }
.ur-top { display: flex; justify-content: space-between; }
.r-ur {
  font-family: var(--head); font-size: 16px; padding: 4px 6px 2px;
  background: linear-gradient(90deg, #ff6a8a, #ffd447, #6be36b, #4fd8ff, #b084ff); color: var(--ink);
  box-shadow: 0 0 0 2px var(--ink);
}
.pos { font-family: var(--head); font-size: 8px; padding: 6px 6px 4px; box-shadow: 0 0 0 2px var(--ink); color: #fff; }
.pos.fw { background: #e84a5f; } .pos.mf { background: #3fae5a; } .pos.df { background: #3d8bff; }
.ur-art {
  position: relative; height: 200px; overflow: hidden; display: flex; align-items: flex-end; justify-content: center;
  background: radial-gradient(circle at 50% 70%, var(--c2), #050a1c 75%); border: 2px solid var(--ink);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 60%, transparent);
}
.ur-art img:first-child { width: 320px; height: auto; position: relative; z-index: 1; }
.ur-fx { position: absolute; width: 192px; height: 192px; top: 4px; left: 50%; transform: translateX(-50%); opacity: .35; }
.ur-name { font-size: 48px; line-height: .9; margin-top: 6px; }
.ur-name small { font-family: var(--head); font-size: 8px; color: var(--dim); vertical-align: middle; margin-left: 6px; }
.ur-skill { font-family: var(--head); font-size: 16px; line-height: 1.3; color: var(--c); text-shadow: 0 3px 0 var(--ink); }
.ur-desc { color: var(--dim); font-size: 32px; min-height: 64px; }
html[lang="th"] .ur-desc { font-size: 32px; }
.ur-play { align-self: flex-start; font-family: var(--head); font-size: 12px; color: var(--gold); padding: 8px 0 2px; letter-spacing: .5px; }
html[lang="th"] .ur-play { font-family: var(--body); font-size: 32px; padding: 4px 0 0; letter-spacing: 0; }
.ur-card:hover .ur-play { animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- stats ---------- */
.stats { background: #0b1a44; border-top: 4px solid var(--gold); border-bottom: 4px solid var(--gold); box-shadow: 0 4px 0 var(--ink), 0 -4px 0 var(--ink); }
.stats-in { display: grid; grid-template-columns: repeat(4, 1fr); padding-top: 28px; padding-bottom: 28px; }
.stat { text-align: center; color: var(--dim); }
.stat b { display: block; font-family: var(--head); font-weight: normal; font-size: 32px; color: var(--gold); text-shadow: 0 4px 0 var(--ink); margin-bottom: 8px; }

/* ---------- features ---------- */
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 34px; }
.feat { padding: 2px; display: flex; flex-direction: column; }
.shot { border: 2px solid var(--ink); background: #000; aspect-ratio: 16 / 9; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.feat h3 { font-family: var(--body); font-weight: normal; font-size: 32px; color: var(--gold); margin: 14px 0 6px; }
.feat p { margin: 0; color: var(--dim); font-size: 32px; line-height: 1; }

/* ---------- roadmap ---------- */
.road { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: r; position: relative; }
.road li { padding: 4px; position: relative; }
.road-when { display: inline-block; font-family: var(--head); font-weight: normal; font-size: 8px; padding: 6px 8px 4px; background: var(--edge); color: var(--white); box-shadow: 0 0 0 2px var(--ink); }
html[lang="th"] .road-when { font-family: var(--body); font-size: 16px; padding: 2px 8px; }
.road li.done .road-when { background: #3fae5a; }
.road li.now .road-when { background: var(--gold); color: var(--on-gold); }
.road li.now { filter: drop-shadow(0 0 10px rgba(255, 225, 74, .35)); }
.road h3 { font-weight: normal; font-size: 32px; margin: 12px 0 6px; color: var(--white); }
.road li.done h3::before { content: "✔ "; color: #6be36b; }
.road p { margin: 0; color: var(--dim); }

/* ---------- faq ---------- */
.qa { margin: 0 0 16px; padding: 0 6px; }
.qa summary { list-style: none; cursor: pointer; padding: 10px 4px; color: var(--white); display: flex; justify-content: space-between; gap: 16px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; font-family: var(--head); font-size: 16px; color: var(--gold); }
.qa[open] summary::after { content: "-"; }
.qa p { margin: 0; padding: 0 4px 12px; color: var(--frost); }

/* ---------- final + footer ---------- */
.final { padding: 80px 0 96px; background:
  radial-gradient(ellipse 50% 70% at 50% 100%, rgba(79, 140, 255, .25), transparent 70%), var(--bg); }
.final-in { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.final-logo { width: 440px; max-width: 80vw; height: auto; }
.foot { background: #05081a; border-top: 4px solid var(--edge); padding: 28px 0; color: var(--dim); font-size: 16px; }
.foot-in { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 24px; flex-wrap: wrap; }
.foot-links a:hover { color: var(--gold); }
.foot p { margin: 0; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(4, 6, 20, .88); display: flex; align-items: center; justify-content: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lb-panel { position: relative; border-style: solid; border-width: 16px; border-image: url("assets/ui/panel_gold.png") 8 fill stretch; background: #040818; }
.lb-stage { position: relative; width: min(1024px, 88vw); aspect-ratio: 16 / 9; overflow: hidden; background: #020512; border: 2px solid var(--ink); }
.lb-stage img, .lb-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.lb-stage img { object-fit: cover; }
.lb-bar { display: flex; justify-content: flex-end; gap: 12px; padding-top: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .road { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .nav-links {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; gap: 0;
    background: #0b1a44; border-bottom: 4px solid var(--gold); box-shadow: 0 4px 0 var(--ink); padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 20px; width: 100%; text-align: center; }
  .nav-links i { display: none; }
  .burger { display: block; }
  .nav-logo img { opacity: 1; transform: none; height: 36px; }
  .ur-row { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .stats-in { grid-template-columns: repeat(2, 1fr); row-gap: 24px; }
  .hero-sub { font-size: 32px; }
  .hero-logo img { width: 440px; }
}
@media (max-width: 560px) {
  .feat-grid, .road { grid-template-columns: 1fr; }
  .nav-in { gap: 10px; padding: 0 12px; }
  .lang button { padding: 4px 6px; }
  .nav-logo { display: none; }
  .nav-right { margin-left: auto; }
  .btn-lg { height: 64px; padding: 0 16px; }
  .sec { padding: 72px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-hint, .ur-card:hover .ur-play { animation: none; }
}
