/* ===========================================================================
   DUSKWALKER — warm "Twilight Canyon" theme (standalone).
   Deep ink night, a magenta-ember horizon glow, layered canyon ridges, drifting
   fireflies and a gold crescent moon. Soft cinematic-storybook type (Fraunces)
   over a clean sans (Outfit). Warm gold + teal accents on near-black — built to
   feel cosy and atmospheric, nothing like the Cosmic arcade or Symbiosis candy.
   Palette + content come straight from the game (src/engine/skins.js, index.html).
   ========================================================================= */

:root {
  --bg: #0a0810;
  --bg-2: #120e1c;
  --ink: #ffe7c4;          /* bone / body text */
  --cream: #fff1d8;
  --muted: #cbb8e0;        /* plum */
  --muted-2: #8a8398;      /* ash */
  --line: rgba(255,235,210,0.12);
  --card: rgba(20,16,31,0.6);
  --card-2: rgba(30,24,46,0.72);

  --gold: #ffd27a;
  --ember: #ff9d6c;
  --teal: #8fe3d8;
  --plum: #cbb8e0;

  --warm: linear-gradient(92deg, #fff1d8, #ffd27a 50%, #ff9d6c);
  --warm-soft: linear-gradient(120deg, #ffd27a, #ff9d6c);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.62;
  overflow-x: hidden; position: relative;
}
.shell { width: min(1180px, calc(100% - 2.4rem)); margin-inline: auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.06; margin: 0; }
kbd { font-family: var(--font-body); font-size: 0.82em; font-weight: 600; color: var(--cream);
  background: rgba(255,235,210,0.1); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; padding: 1px 7px; }

.gold-text {
  background: var(--warm); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ── Dusk backdrop ────────────────────────────────────────────────────────── */
.dusk { position: fixed; inset: 0; z-index: -2; overflow: hidden;
  background: linear-gradient(180deg, #1b1426 0%, #120d1c 38%, #0a0810 78%); }
.dusk .glow { position: absolute; left: 50%; bottom: -28vh; width: 130vw; height: 70vh;
  transform: translateX(-50%); border-radius: 50%; filter: blur(10px);
  background: radial-gradient(ellipse at 50% 100%, rgba(255,120,80,0.5), rgba(180,80,140,0.28) 38%, transparent 66%); }
.dusk .moon { position: absolute; top: 12vh; right: 11vw; width: 84px; height: 84px; border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #fff6e2, #ffd27a 70%, #e7b463);
  box-shadow: 0 0 50px rgba(255,210,122,0.4), inset -26px -8px 0 -6px rgba(10,8,16,0.92); }
.dusk .ridge { position: absolute; left: -2%; right: -2%; bottom: 0; }
.dusk .ridge-far { height: 34vh; background: #2a2138;
  clip-path: polygon(0 62%, 9% 40%, 18% 56%, 27% 30%, 38% 52%, 48% 26%, 58% 50%, 68% 34%, 79% 54%, 88% 36%, 100% 58%, 100% 100%, 0 100%); opacity: 0.7; }
.dusk .ridge-near { height: 22vh; background: linear-gradient(180deg, #160f20, #0a0810);
  clip-path: polygon(0 48%, 12% 70%, 22% 44%, 33% 66%, 44% 40%, 55% 64%, 65% 38%, 76% 62%, 86% 42%, 100% 64%, 100% 100%, 0 100%); }
.dusk .flies { position: absolute; inset: 0;
  background-image:
    radial-gradient(2px 2px at 18% 32%, rgba(255,210,122,0.9), transparent),
    radial-gradient(2px 2px at 72% 22%, rgba(143,227,216,0.8), transparent),
    radial-gradient(1.5px 1.5px at 44% 48%, rgba(255,210,122,0.7), transparent),
    radial-gradient(1.5px 1.5px at 86% 56%, rgba(255,157,108,0.7), transparent),
    radial-gradient(2px 2px at 30% 64%, rgba(255,210,122,0.6), transparent),
    radial-gradient(1.5px 1.5px at 62% 70%, rgba(143,227,216,0.6), transparent);
  animation: twinkle 6s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-body); font-weight: 600; font-size: 16px; padding: 13px 24px;
  border-radius: 14px; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .3s var(--ease), filter .2s, background .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-play { color: #1a1322; background: var(--warm); background-size: 180% 100%;
  box-shadow: 0 10px 28px rgba(255,157,108,0.32), 0 4px 14px rgba(255,210,122,0.28);
  animation: shimmer 7s ease infinite; }
.btn-play svg { width: 18px; height: 18px; }
.btn-play:hover { box-shadow: 0 14px 36px rgba(255,157,108,0.5), 0 6px 18px rgba(255,210,122,0.4); }
@keyframes shimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.btn-ghost { color: var(--ink); background: rgba(255,235,210,0.04); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255,235,210,0.09); border-color: rgba(255,210,122,0.45); }

/* ── Header ───────────────────────────────────────────────────────────────── */
.dw-header { position: fixed; top: 0; left: 0; right: 0; z-index: 60; padding: 15px 0;
  transition: background .3s, backdrop-filter .3s, border-color .3s; border-bottom: 1px solid transparent; }
.dw-header.is-scrolled { background: rgba(10,8,16,0.72); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line); }
.dw-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.dw-brand { display: inline-flex; align-items: center; gap: 11px; }
.dw-brand img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 4px 14px rgba(0,0,0,0.5); }
.dw-brand .wm { font-family: var(--font-display); font-weight: 900; font-size: 20px; letter-spacing: 0.02em;
  background: var(--warm); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.dw-nav { display: flex; gap: 26px; margin-left: auto; }
.dw-nav a { font-weight: 500; font-size: 15px; color: var(--muted); white-space: nowrap; transition: color .2s; }
.dw-nav a:hover { color: var(--cream); }
.header-cta { display: flex; align-items: center; gap: 10px; }
.header-cta .btn { padding: 10px 18px; font-size: 14px; }
.header-cta .btn-ghost { display: none; }
.nav-toggle { display: none; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 4px; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero { position: relative; padding: 150px 0 80px; }
.hero-inner { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.eyebrow { display: inline-block; font-weight: 600; font-size: 12.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold); padding: 6px 14px;
  border: 1px solid rgba(255,210,122,0.3); border-radius: 999px; background: rgba(255,210,122,0.07); margin-bottom: 22px; }
.hero h1 { font-size: clamp(2.7rem, 6.4vw, 4.8rem); font-weight: 600; letter-spacing: -0.01em; }
.tagline { font-size: clamp(1.05rem, 1.7vw, 1.28rem); color: var(--muted); margin: 22px 0 14px; max-width: 38ch; }
.solve-evolve { letter-spacing: 0.06em; color: var(--muted-2); margin: 0 0 28px; text-transform: uppercase; font-size: 0.92rem; }
.solve-evolve b { color: var(--teal); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 13px; align-items: center; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.pill { font-size: 13px; font-weight: 500; color: var(--muted); padding: 7px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,235,210,0.03); }
.pill b { color: var(--gold); font-weight: 700; }

.hero-art { position: relative; display: grid; place-items: center; min-height: 380px; }
.hero-man { width: min(78%, 360px); position: relative; z-index: 1;
  filter: drop-shadow(0 26px 50px rgba(0,0,0,0.6)); animation: bob 5s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-16px) rotate(1.5deg); } }
.hero-bloom { position: absolute; inset: 6% 8% 14% 8%; z-index: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(255,210,122,0.32), rgba(255,157,108,0.14), transparent 64%);
  filter: blur(42px); animation: breathe 8s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.08); opacity: 1; } }
.hero-thread { position: absolute; top: -2%; left: 52%; width: 3px; height: 46%;
  background: linear-gradient(180deg, transparent, var(--gold)); border-radius: 3px;
  transform: rotate(20deg); transform-origin: bottom; box-shadow: 0 0 12px rgba(255,210,122,0.6); z-index: 2; }
.horizon { height: 4px; max-width: 1180px; margin: 60px auto 0; border-radius: 4px;
  width: calc(100% - 2.4rem); background: var(--warm); background-size: 200% 100%;
  opacity: 0.85; animation: shimmer 9s ease infinite; }

/* ── Sections ─────────────────────────────────────────────────────────────── */
.section { padding: 84px 0; position: relative; }
.section-head { max-width: 720px; margin: 0 auto 50px; text-align: center; }
.section-head h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); font-weight: 600; margin-bottom: 16px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.section-head kbd { color: var(--cream); }

/* ── Feature grid ─────────────────────────────────────────────────────────── */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature-card { padding: 26px 22px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--card); position: relative; overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; }
.feature-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--warm-soft); opacity: 0; transition: opacity .3s; }
.feature-card:hover { transform: translateY(-5px); border-color: rgba(255,210,122,0.4); box-shadow: 0 18px 40px rgba(0,0,0,0.4); }
.feature-card:hover::before { opacity: 1; }
.feature-ico { font-size: 1.8rem; margin-bottom: 14px; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 9px; font-weight: 600; color: var(--cream); }
.feature-card p { font-size: 0.93rem; color: var(--muted); margin: 0; }
.feature-card i { color: var(--teal); font-style: italic; }

/* ── Meet the little guy (interactive state-swapper) ──────────────────────── */
.meet-feature { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(30px, 5vw, 64px);
  align-items: center; }
.meet-stage { position: relative; display: grid; place-items: center; min-height: 360px; }
.meet-stage .bloom { position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,210,122,0.34), rgba(255,157,108,0.16), transparent 68%);
  filter: blur(30px); animation: breathe 7s ease-in-out infinite; }
.meet-mug { position: relative; width: 74%; max-width: 320px;
  filter: drop-shadow(0 20px 44px rgba(0,0,0,0.55));
  transition: opacity .2s var(--ease), transform .2s var(--ease); }
.meet-mug.is-swapping { opacity: 0; transform: scale(.86); }
.meet-mug.pop { animation: facepop .5s var(--ease); }
@keyframes facepop { 0% { transform: scale(.86); } 55% { transform: scale(1.06); } 100% { transform: scale(1); } }

.state-list { display: flex; flex-direction: column; gap: 12px; }
.state { display: flex; align-items: flex-start; gap: 14px; text-align: left; cursor: pointer;
  padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--card);
  font: inherit; color: inherit; transition: border-color .25s, background .25s, transform .2s var(--ease); }
.state:hover { transform: translateX(4px); border-color: rgba(255,210,122,0.4); }
.state.is-active { border-color: transparent; background: var(--card-2);
  box-shadow: inset 0 0 0 1.5px rgba(255,210,122,0.7), 0 10px 26px rgba(0,0,0,0.34); }
.state-dot { width: 16px; height: 16px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; box-shadow: 0 0 12px currentColor; }
.s-swing { color: var(--teal); background: var(--teal); }
.s-fly { color: var(--gold); background: var(--gold); }
.s-fall { color: var(--ember); background: var(--ember); }
.state-body { display: flex; flex-direction: column; gap: 3px; }
.state-body b { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; color: var(--cream); }
.state-body span { font-size: 0.92rem; color: var(--muted); }
.state-body i { color: var(--gold); font-style: italic; }
.meet-hint { font-size: 0.85rem; color: var(--muted-2); margin: 16px 0 0; }

/* ── Steps ────────────────────────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.step { padding: 26px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.num { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; color: #1a1322; background: var(--warm-soft); margin-bottom: 16px; }
.step h3 { font-size: 1.05rem; margin-bottom: 9px; font-weight: 600; color: var(--cream); }
.step p { color: var(--muted); font-size: 0.9rem; margin: 0; }
.step kbd { color: var(--cream); }

/* ── Characters (the shop) ────────────────────────────────────────────────── */
.rarity-ladder { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin-bottom: 40px; }
.rarity { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--rc);
  padding: 7px 16px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--rc) 50%, transparent);
  background: color-mix(in srgb, var(--rc) 12%, transparent); }
.rsep { color: var(--muted-2); }
.char-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.char-card { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 18px 10px 15px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--card);
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; }
.char-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--cb) 60%, var(--line));
  box-shadow: 0 16px 36px rgba(0,0,0,0.4); }
.char-swatch { width: 56px; height: 56px; border-radius: 50% 50% 46% 46%; position: relative; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 32%, color-mix(in srgb, var(--cb) 88%, white 22%), var(--cb) 62%, color-mix(in srgb, var(--cb) 70%, black 30%));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--cb) 40%, transparent), inset 0 2px 5px rgba(255,255,255,0.4), inset 0 -5px 11px rgba(0,0,0,0.3); }
.char-swatch i { width: 16px; height: 16px; border-radius: 5px; background: var(--ca);
  border: 1.5px dashed color-mix(in srgb, var(--ca) 60%, black 30%); }
.char-name { font-family: var(--font-display); font-weight: 600; font-size: 0.96rem; color: var(--cream); }
.char-rarity { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.r-starter .char-rarity { color: var(--muted-2); }
.r-common .char-rarity { color: var(--teal); }
.r-rare .char-rarity { color: #9fd0ff; }
.r-epic .char-rarity { color: var(--plum); }
.r-legendary .char-rarity { color: var(--gold); }

/* ── Worlds (themes) ──────────────────────────────────────────────────────── */
.world-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.world-card { border-radius: 16px; border: 1px solid var(--line); background: var(--card); overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; }
.world-card:hover { transform: translateY(-5px); border-color: rgba(255,210,122,0.4); box-shadow: 0 16px 36px rgba(0,0,0,0.4); }
.world-sky { position: relative; aspect-ratio: 4/3; }
.world-sky::after { content: ''; position: absolute; top: 16%; right: 18%; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #fff6e2, rgba(255,235,200,0.7)); box-shadow: -5px -1px 0 -2px rgba(0,0,0,0.35); opacity: 0.85; }
.world-anchor { position: absolute; bottom: 30%; left: 26%; width: 9px; height: 9px; border-radius: 50%; }
.world-mote { position: absolute; bottom: 50%; left: 56%; width: 7px; height: 7px; border-radius: 50%; }
.world-meta { padding: 13px 15px 15px; }
.world-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--cream); }
.world-sub { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.world-amb { font-size: 0.78rem; color: var(--muted-2); }
.world-rare { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.world-rare.r-starter { color: var(--muted-2); }
.world-rare.r-common { color: var(--teal); }
.world-rare.r-rare { color: #9fd0ff; }
.world-rare.r-epic { color: var(--plum); }
.world-rare.r-legendary { color: var(--gold); }

/* ── Screenshots ──────────────────────────────────────────────────────────── */
.shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; max-width: 880px; margin: 0 auto; }
.shot { margin: 0; }
.shot img { width: 100%; border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 22px 50px rgba(0,0,0,0.5); }
.shot figcaption { text-align: center; color: var(--muted); font-size: 0.92rem; margin-top: 14px; }

/* ── Final CTA ────────────────────────────────────────────────────────────── */
.cta-final { padding: 30px 0 96px; }
.cta-card { position: relative; text-align: center; padding: clamp(40px, 6vw, 64px) 28px;
  border-radius: 28px; border: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(120% 130% at 50% 0%, rgba(255,210,122,0.14), rgba(18,14,28,0.72)); }
.cta-card .bloom { position: absolute; inset: -30% 30% auto 30%; height: 60%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,157,108,0.3), transparent 65%); filter: blur(42px); }
.cta-logo { width: 132px; height: 132px; margin: 0 auto 14px; position: relative; border-radius: 50%;
  filter: drop-shadow(0 12px 30px rgba(255,157,108,0.3)); }
.cta-card h2 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 600; margin-bottom: 14px; position: relative; }
.cta-card p { color: var(--muted); max-width: 52ch; margin: 0 auto 28px; position: relative; }
.cta-card .hero-cta { justify-content: center; position: relative; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.dw-footer { border-top: 1px solid var(--line); padding: 44px 0 38px; background: rgba(8,6,12,0.6); }
.dw-footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
.dw-footer-links { display: flex; flex-wrap: wrap; gap: 22px; }
.dw-footer-links a { color: var(--muted); font-size: 0.92rem; transition: color .2s; }
.dw-footer-links a:hover { color: var(--cream); }
.dw-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 0.86rem; }

/* ── Reveal-on-scroll ─────────────────────────────────────────────────────── */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .hero { padding-top: 124px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 420px; margin: 0 auto; }
  .tagline { max-width: none; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .meet-feature { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .char-grid { grid-template-columns: repeat(4, 1fr); }
  .world-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .dw-nav { position: fixed; inset: 64px 12px auto 12px; flex-direction: column; gap: 4px;
    background: rgba(18,14,28,0.96); backdrop-filter: blur(16px); border: 1px solid var(--line);
    border-radius: 18px; padding: 14px; transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity .25s, transform .25s; }
  .dw-nav.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-toggle { display: inline-flex; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .char-grid, .world-grid { grid-template-columns: repeat(2, 1fr); }
  .shots { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(2.4rem, 12vw, 3.2rem); }
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, .flies, .btn-play, .horizon, .hero-man, .hero-bloom, .meet-stage .bloom, .meet-mug { animation: none !important; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
