/* ===========================================================================
   Trap Devil — site styles
   Palette is lifted from the game's own renderer and app icon:
   the cave purples, the spike ember (#E8431F) and the lava rim (#FF9838).
   =========================================================================== */

:root {
  --void:      #0B0710;
  --crypt:     #150C1F;
  --stone:     #241634;
  --amethyst:  #3B1F52;
  --ember:     #E8431F;
  --flare:     #FF9838;
  --bone:      #EDE7F2;
  --ash:       #9C8FAE;
  --hairline:  rgba(237, 231, 242, 0.10);

  --shell: min(1120px, 92vw);
  --display: "Archivo Black", "Arial Black", system-ui, sans-serif;
  --body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--flare); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ember); }

:focus-visible {
  outline: 2px solid var(--flare);
  outline-offset: 3px;
  border-radius: 2px;
}

img { max-width: 100%; display: block; }

.shell { width: var(--shell); margin-inline: auto; }

/* ---------- utility type ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ember);
  margin: 0 0 14px;
}

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.02; margin: 0; }

h2 {
  font-size: clamp(30px, 5.2vw, 54px);
  letter-spacing: -0.015em;
}

.lede { color: var(--ash); font-size: clamp(16px, 2vw, 19px); max-width: 56ch; }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 7, 16, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.nav-in {
  width: var(--shell);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
}
.nav-mark { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--bone); }
.nav-mark img { width: 34px; height: 34px; border-radius: 9px; }
.nav-mark b { font-family: var(--display); font-size: 16px; letter-spacing: 0.02em; }
.nav-spacer { flex: 1; }
.nav a.nav-link {
  color: var(--ash);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.nav a.nav-link:hover { color: var(--bone); }
@media (max-width: 700px) { .nav-link { display: none; } }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 15px;
  padding: 13px 22px;
  border-radius: 11px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.16s cubic-bezier(0.34, 1.5, 0.64, 1), background 0.16s, box-shadow 0.16s;
}
.btn-primary {
  background: var(--ember);
  color: #fff;
  box-shadow: 0 8px 26px rgba(232, 67, 31, 0.32);
}
.btn-primary:hover { background: #ff5327; color: #fff; transform: translateY(-2px); }
.btn-ghost {
  background: rgba(237, 231, 242, 0.06);
  color: var(--bone);
  border-color: var(--hairline);
}
.btn-ghost:hover { background: rgba(237, 231, 242, 0.12); color: var(--bone); transform: translateY(-2px); }
.btn-sm { padding: 9px 16px; font-size: 13.5px; }

/* ---------- hero ---------- */

.hero { padding: clamp(48px, 9vw, 104px) 0 clamp(30px, 5vw, 56px); position: relative; }
.hero::before {
  /* ember glow bleeding up from the stage below */
  content: "";
  position: absolute;
  left: 50%;
  bottom: -80px;
  width: 900px;
  height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(232, 67, 31, 0.16), transparent 68%);
  pointer-events: none;
}
.hero-in { position: relative; z-index: 1; max-width: 780px; }

h1.hero-title {
  font-size: clamp(42px, 9.2vw, 104px);
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}
h1.hero-title .drop {
  color: var(--ember);
  display: inline-block;
}
.hero .lede { font-size: clamp(17px, 2.3vw, 21px); margin: 0 0 30px; }

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

.qr-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--hairline);
  border-radius: 13px;
  background: rgba(237, 231, 242, 0.04);
}
.qr-inline img { width: 56px; height: 56px; border-radius: 6px; background: #fff; padding: 3px; }
.qr-inline span { font-family: var(--mono); font-size: 11.5px; line-height: 1.45; color: var(--ash); letter-spacing: 0.04em; }

/* ---------- the live stage (signature) ---------- */

.stage-wrap { padding-bottom: clamp(40px, 7vw, 86px); }
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 6.2;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  overflow: hidden;
  background: var(--crypt);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.stage canvas { width: 100%; height: 100%; display: block; }
.stage-tag {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(237, 231, 242, 0.42);
  pointer-events: none;
}

/* Narrow screens: the letterbox gets too short to read the animation, and the
   caption starts colliding with the platforms. Give it height, drop the label. */
@media (max-width: 760px) {
  .stage { aspect-ratio: 16 / 10; }
  .stage-tag { display: none; }
}

/* ---------- sections ---------- */

section { padding: clamp(52px, 8vw, 100px) 0; }
.section-head { margin-bottom: clamp(28px, 4vw, 46px); }
.rule { height: 1px; background: var(--hairline); border: 0; margin: 0; }

/* ---------- trap catalogue (signature structure) ---------- */

.traps { display: grid; gap: 0; border-top: 1px solid var(--hairline); }
.trap {
  display: grid;
  grid-template-columns: minmax(190px, 0.9fr) 1fr;
  gap: clamp(16px, 4vw, 48px);
  padding: 22px 0;
  border-bottom: 1px solid var(--hairline);
  align-items: baseline;
}
.trap-name {
  font-family: var(--display);
  font-size: clamp(17px, 2.1vw, 22px);
  letter-spacing: -0.01em;
}
.trap-body { display: grid; gap: 5px; }
.trap-claim { color: var(--ash); }
.trap-truth { color: var(--bone); font-weight: 700; }
.trap-truth::before {
  content: "→ ";
  color: var(--ember);
  font-weight: 400;
}
@media (max-width: 620px) {
  .trap { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- worlds ---------- */

.worlds { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(26px, 5vw, 64px); align-items: center; }
@media (max-width: 860px) { .worlds { grid-template-columns: 1fr; } }

.world-list { display: grid; gap: 2px; margin: 26px 0 0; padding: 0; list-style: none; }
.world-list li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hairline);
}
.world-list .w-name { font-weight: 700; }
.world-list .w-lv { font-family: var(--mono); font-size: 12px; color: var(--ash); margin-left: auto; letter-spacing: 0.06em; }
.world-list .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

.map-frame {
  border: 1px solid var(--hairline);
  border-radius: 16px;
  overflow: hidden;
  max-height: 560px;
  background: var(--crypt);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.map-frame img { width: 100%; object-fit: cover; }

/* ---------- facts strip ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
}
.fact { background: var(--void); padding: 22px 20px; }
.fact b { display: block; font-family: var(--display); font-size: clamp(24px, 3.4vw, 36px); color: var(--flare); line-height: 1; }
.fact span { display: block; margin-top: 7px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ash); }
@media (max-width: 700px) { .facts { grid-template-columns: repeat(2, 1fr); } }

/* ---------- download ---------- */

.download { text-align: center; }
.download-card {
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: clamp(30px, 5vw, 54px);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(232, 67, 31, 0.13), transparent 62%),
    var(--crypt);
}
.download-card img.qr-big {
  width: 168px;
  height: 168px;
  margin: 26px auto 18px;
  background: #fff;
  padding: 10px;
  border-radius: 14px;
}
.download-note { font-family: var(--mono); font-size: 12px; color: var(--ash); margin-top: 18px; letter-spacing: 0.04em; }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--hairline);
  padding: 40px 0 56px;
  color: var(--ash);
  font-size: 14px;
}
.foot-in { display: flex; flex-wrap: wrap; gap: 16px 26px; align-items: center; }
.foot-in nav { display: flex; flex-wrap: wrap; gap: 20px; margin-left: auto; }
footer a { color: var(--ash); text-decoration: none; }
footer a:hover { color: var(--bone); }

/* ---------- legal / content pages ---------- */

.page { padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px); }
.page-title { font-size: clamp(32px, 6vw, 58px); letter-spacing: -0.02em; margin-bottom: 10px; }
.page-meta { font-family: var(--mono); font-size: 12px; color: var(--ash); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 38px; }

.prose { max-width: 74ch; }
.prose h2 { font-size: clamp(21px, 3vw, 28px); margin: 42px 0 12px; }
.prose h3 { font-family: var(--body); font-weight: 700; font-size: 17px; margin: 26px 0 6px; }
.prose p, .prose li { color: #cfc6da; }
.prose ul { padding-left: 20px; }
.prose li { margin: 7px 0; }
.prose strong { color: var(--bone); }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.prose th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ash); font-weight: 400; }
.callout {
  border-left: 2px solid var(--ember);
  background: rgba(232, 67, 31, 0.07);
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
  margin: 22px 0;
}
.callout p { margin: 0; }
