/* ============================================================
   FocusVille — landing page styles
   Calm twilight palette from the game (lib/core/theme.dart)
   ============================================================ */

:root {
  --night: #232A40;
  --night-deep: #1B2133;
  --panel: #2E3652;
  --panel-lite: #3A4466;
  --stroke: #48527A;
  --amber: #FFB02E;
  --amber-deep: #FF6A1F;
  --leaf: #63B072;
  --text-hi: #F2EFE6;
  --text-lo: #B9C0D4;
  --wood: #B07A44;
  --stone: #AEB4C0;
  --clay: #CE8B57;
  --glow-1: #FFCF6B;
  --glow-2: #E23D1F;
  --radius: 18px;
  --font-pixel: "Pixelify Sans", "Avenir Next", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@font-face {
  font-family: "Pixelify Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/pixelify-sans.woff2") format("woff2");
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

h1, h2, h3 {
  font-family: var(--font-pixel);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: .01em;
}

h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

section { padding: 88px 0; }

.section-sub {
  color: var(--text-lo);
  max-width: 560px;
  margin: 0 auto 48px;
  text-align: center;
}

/* pixel-art images must scale crisply */
.px { image-rendering: pixelated; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(27, 33, 51, .85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--stroke);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-pixel);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-hi);
}
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }

.site-nav { display: flex; gap: 26px; }
.site-nav a {
  color: var(--text-lo);
  font-size: .95rem;
  font-weight: 600;
}
.site-nav a:hover { color: var(--text-hi); text-decoration: none; }

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

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 0 90px;
  background: linear-gradient(180deg, #2E3A5E 0%, #232A40 55%, #1B2133 100%);
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 3;
  box-sizing: content-box;
  max-width: 660px;
  padding-inline: 24px;
}

.hero h1 {
  font-size: clamp(2rem, 5.2vw, 3.7rem);
  text-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}

.hero .tagline {
  color: var(--text-lo);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  max-width: 540px;
  margin: 0 auto 34px;
}

/* --- star field: two parallax layers, pure box-shadow --- */

.stars, .stars-far {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

.stars {
  background: transparent;
  box-shadow:
    -640px  80px 0 0 rgba(242,239,230,.9), -520px 210px 0 0 rgba(242,239,230,.55),
    -430px  60px 0 1px rgba(255,207,107,.8), -350px 300px 0 0 rgba(242,239,230,.7),
    -280px 140px 0 0 rgba(242,239,230,.5), -190px  40px 0 0 rgba(242,239,230,.85),
    -120px 250px 0 0 rgba(185,192,212,.6),  -40px 120px 0 1px rgba(242,239,230,.9),
      60px  70px 0 0 rgba(242,239,230,.6),  140px 280px 0 0 rgba(255,207,107,.7),
     230px 150px 0 0 rgba(242,239,230,.8),  320px  50px 0 0 rgba(242,239,230,.5),
     410px 230px 0 1px rgba(242,239,230,.85), 510px 110px 0 0 rgba(185,192,212,.6),
     600px 320px 0 0 rgba(242,239,230,.7),  660px  90px 0 0 rgba(255,207,107,.75);
  animation: twinkle 4.5s ease-in-out infinite;
}

.stars-far {
  background: transparent;
  box-shadow:
    -600px 170px 0 0 rgba(185,192,212,.4), -480px  40px 0 0 rgba(185,192,212,.35),
    -370px 250px 0 0 rgba(185,192,212,.3), -240px 330px 0 0 rgba(185,192,212,.4),
    -150px 180px 0 0 rgba(185,192,212,.35),  -60px 350px 0 0 rgba(185,192,212,.3),
      30px 200px 0 0 rgba(185,192,212,.4),  120px 380px 0 0 rgba(185,192,212,.3),
     210px  90px 0 0 rgba(185,192,212,.35), 300px 330px 0 0 rgba(185,192,212,.4),
     420px 170px 0 0 rgba(185,192,212,.3),  560px 260px 0 0 rgba(185,192,212,.35),
     640px 380px 0 0 rgba(185,192,212,.3),  -80px  30px 0 0 rgba(185,192,212,.4);
  animation: twinkle 7s ease-in-out infinite;
  animation-delay: -2s;
}

@keyframes twinkle {
  0%, 100% { opacity: .95; }
  50% { opacity: .35; }
}

/* --- crescent moon --- */

.moon {
  position: absolute;
  top: 84px;
  left: max(24px, calc(50% - 560px));
  width: 84px;
  height: 84px;
  border-radius: 50%;
  box-shadow: inset -18px 10px 0 0 #DFE4F2;
  z-index: 1;
  pointer-events: none;
}
.moon::after {
  content: "";
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(223,228,242,.18) 0%, transparent 65%);
}

/* --- island scene --- */

.hero-scene {
  position: relative;
  z-index: 2;
  width: 432px;
  height: 420px;
  margin-top: 26px;
  pointer-events: none;
}

.island-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 432px;
  height: 420px;
  animation: bob 5.5s ease-in-out infinite alternate;
}

.island-wrap > .island {
  position: absolute;
  bottom: 0;
  width: 432px;
  height: 276px;
}

@keyframes bob {
  from { transform: translateY(0); }
  to   { transform: translateY(-9px); }
}

/* sprite strips: shared engine — each sprite sets --strip-w and its own animation */
.spr {
  image-rendering: pixelated;
  background-repeat: no-repeat;
  background-position: 0 0;
}

@keyframes strip {
  to { background-position: calc(var(--strip-w) * -1) 0; }
}

.spr-fire {
  --strip-w: 1152px;
  position: absolute;
  width: 144px;
  height: 168px;
  left: 62px;
  bottom: 184px;
  background-image: url("../assets/sprites/fire.png");
  background-size: 1152px 168px;
  animation: strip .9s steps(8) infinite;
}

.fire-glow {
  position: absolute;
  left: -24px;
  bottom: 120px;
  width: 320px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,207,107,.38) 0%, rgba(255,176,46,.16) 40%, transparent 68%);
  animation: glowpulse 2.4s ease-in-out infinite alternate;
}

@keyframes glowpulse {
  from { opacity: .55; transform: scale(1); }
  to   { opacity: .95; transform: scale(1.12); }
}

.spr-axe {
  --strip-w: 1152px;
  position: absolute;
  width: 144px;
  height: 144px;
  left: 190px;
  bottom: 200px;
  background-image: url("../assets/sprites/character_axe.png");
  background-size: 1152px 144px;
  animation: strip .8s steps(8) infinite;
}

/* static full tree (frame 1 of the 12-frame chopping strip) for the villager to chop */
.spr-tree {
  position: absolute;
  width: 180px;
  height: 228px;
  left: 234px;
  bottom: 190px;
  image-rendering: pixelated;
  background: url("../assets/sprites/node_tree.png") 0 0 / 2160px 228px no-repeat;
}

.spr-pickaxe {
  --strip-w: 1152px;
  width: 144px;
  height: 144px;
  background-image: url("../assets/sprites/character_pickaxe.png");
  background-size: 1152px 144px;
  animation: strip .8s steps(8) infinite;
}

/* --- fireflies --- */

.firefly {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px 2px rgba(255, 176, 46, .8);
  z-index: 2;
  pointer-events: none;
  animation:
    drift var(--dur, 11s) ease-in-out var(--delay, 0s) infinite alternate,
    flicker 2.8s ease-in-out var(--delay, 0s) infinite;
}

@keyframes drift {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(var(--dx, 40px), calc(var(--dy, -30px) * .6)); }
  66%  { transform: translate(calc(var(--dx, 40px) * .4), var(--dy, -30px)); }
  100% { transform: translate(calc(var(--dx, 40px) * -.5), calc(var(--dy, -30px) * .3)); }
}

@keyframes flicker {
  0%, 100% { opacity: .9; }
  50% { opacity: .15; }
}

/* --- store badge (coming soon) --- */

.store-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px 22px;
  text-align: left;
}

.store-badge { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.store-badge:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: var(--amber);
  box-shadow: 0 8px 24px rgba(255, 176, 46, .25);
}
.store-pill .apple { font-size: 1.7rem; line-height: 1; color: var(--text-hi); }
.store-pill .small { display: block; font-size: .72rem; color: var(--text-lo); }
.store-pill .big { display: block; font-size: 1.05rem; font-weight: 700; color: var(--text-hi); }

.hero-mailto {
  margin-top: 16px;
  font-size: .92rem;
  color: var(--text-lo);
}

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

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1rem;
  border-radius: 14px;
  padding: 14px 28px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.btn-primary {
  background: var(--amber);
  color: var(--night-deep);
}
.btn-primary:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 176, 46, .35);
}

/* ---------- features ---------- */

.features h2, .how h2, .screens h2, .companions h2, .support h2 { text-align: center; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 26px;
}

.card h3 { color: var(--text-hi); margin-top: 18px; }
.card p { color: var(--text-lo); font-size: .95rem; margin: 0; }

.card-visual {
  height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.res-icon { width: 48px; height: 48px; image-rendering: pixelated; }

/* static frame 4 of the village strip (frames are 240x160 @1x) */
.village-thumb {
  width: 168px;
  height: 112px;
  image-rendering: pixelated;
  background: url("../assets/sprites/village.png") no-repeat;
  background-size: 672px 112px;         /* 0.7x scale */
  background-position: -504px 0;        /* 4th frame */
}

.shield {
  width: 52px;
  height: 58px;
  background: var(--panel-lite);
  border: 2px solid var(--leaf);
  border-radius: 10px 10px 50% 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--leaf);
  font-size: 1.5rem;
  font-weight: 800;
}

/* static first frame of the fire strip (1x) */
.fire-still {
  width: 48px;
  height: 56px;
  image-rendering: pixelated;
  background: url("../assets/sprites/fire.png") 0 0 / 384px 56px no-repeat;
}

/* mini heatmap: 7x5 grid, leaf greens */
.heat {
  display: grid;
  grid-template-columns: repeat(7, 13px);
  gap: 4px;
}
.heat span {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: var(--leaf);
  opacity: .16;
}
.heat span:nth-child(3n)  { opacity: .45; }
.heat span:nth-child(4n)  { opacity: .75; }
.heat span:nth-child(7n)  { opacity: .3; }
.heat span:nth-child(11n) { opacity: .95; }
.heat span:nth-child(13n) { opacity: .6; }

/* gadget sprites (3x scale) */
.spr-cat {
  --strip-w: 384px;
  width: 96px; height: 72px;
  background-image: url("../assets/sprites/gadget_cat.png");
  background-size: 384px 72px;
  animation: strip .7s steps(4) infinite;
}
.spr-fox {
  --strip-w: 432px;
  width: 108px; height: 72px;
  background-image: url("../assets/sprites/gadget_fox.png");
  background-size: 432px 72px;
  animation: strip .7s steps(4) infinite;
}
.spr-owl {
  --strip-w: 432px;
  width: 72px; height: 120px;
  background-image: url("../assets/sprites/gadget_owl.png");
  background-size: 432px 120px;
  animation: strip 1s steps(6) infinite;
}
.spr-rabbit {
  --strip-w: 288px;
  width: 72px; height: 60px;
  background-image: url("../assets/sprites/gadget_rabbit.png");
  background-size: 288px 60px;
  animation: strip .65s steps(4) infinite;
}
.spr-ducks {
  --strip-w: 720px;
  width: 120px; height: 72px;
  background-image: url("../assets/sprites/gadget_ducks.png");
  background-size: 720px 72px;
  animation: strip 1s steps(6) infinite;
}
.spr-frog {
  --strip-w: 240px;
  width: 60px; height: 48px;
  background-image: url("../assets/sprites/gadget_frog.png");
  background-size: 240px 48px;
  animation: strip .7s steps(4) infinite;
}
.spr-lantern {
  --strip-w: 240px;
  width: 60px; height: 96px;
  background-image: url("../assets/sprites/gadget_lantern.png");
  background-size: 240px 96px;
  animation: strip .9s steps(4) infinite;
}

/* ---------- how it works ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 26px;
  margin-top: 20px;
}

.step { text-align: center; padding: 10px 12px; }

.step-num {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--night-deep);
  background: var(--amber);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.step .step-visual {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.step p { color: var(--text-lo); font-size: .95rem; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  background: var(--panel);
  border: 1px solid var(--stroke);
  color: var(--text-hi);
  font-weight: 700;
  font-size: .9rem;
  border-radius: 999px;
  padding: 8px 15px;
}
.chip.hot { background: var(--amber); color: var(--night-deep); border-color: var(--amber); }

.res-arrow { color: var(--amber); font-size: 1.6rem; font-weight: 800; }

/* ---------- screenshots ---------- */

.screens-strip {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 12px 24px 28px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  scrollbar-width: thin;
  scrollbar-color: var(--stroke) transparent;
}

.screens-strip::-webkit-scrollbar { height: 8px; }
.screens-strip::-webkit-scrollbar-thumb { background: var(--stroke); border-radius: 4px; }
.screens-strip::-webkit-scrollbar-track { background: transparent; }

.screens-strip img {
  flex: 0 0 auto;
  width: min(300px, 76vw);
  height: auto;
  scroll-snap-align: center;
  border-radius: 26px;
  border: 1px solid var(--stroke);
  box-shadow: 0 24px 48px rgba(0, 0, 0, .45);
}

/* ---------- village growth band ---------- */

.growth {
  background: var(--night);
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
  text-align: center;
  padding: 64px 0;
  overflow: hidden;
}

.spr-village {
  --strip-w: 1920px;
  width: 480px;
  height: 320px;
  margin: 0 auto;
  background-image: url("../assets/sprites/village.png");
  background-size: 1920px 320px;
  animation: strip 8s steps(4) infinite;
}

.growth figcaption {
  font-family: var(--font-pixel);
  font-size: 1.3rem;
  color: var(--text-lo);
  margin-top: 8px;
}

/* ---------- companions ---------- */

.gadget-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  align-items: stretch;
}

.gadget-tile {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 128px;
  min-height: 148px;
}

.gadget-tile .spr { animation-delay: calc(var(--i, 0) * .18s); }

.companions .footnote {
  text-align: center;
  color: var(--text-lo);
  font-size: .95rem;
  margin-top: 26px;
}

/* ---------- support ---------- */

.support { text-align: center; }
.support p { color: var(--text-lo); max-width: 460px; margin: 0 auto 28px; }
.support .privacy-note { margin-top: 26px; font-size: .92rem; }

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

.site-footer {
  border-top: 1px solid var(--stroke);
  background: var(--night-deep);
  padding: 34px 0;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-pixel);
  font-weight: 700;
  color: var(--text-hi);
}
.footer-brand img { width: 24px; height: 24px; border-radius: 6px; }

.footer-links { display: flex; flex-wrap: wrap; gap: 20px; font-size: .92rem; }
.footer-links a { color: var(--text-lo); }
.footer-links a:hover { color: var(--amber); }

.footer-copy { color: var(--text-lo); font-size: .88rem; }

/* ---------- legal pages (privacy / impressum / 404) ---------- */

.page {
  max-width: 68ch;
  margin: 0 auto;
  padding: 64px 24px 90px;
}

.page h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
.page h2 { font-size: 1.25rem; color: var(--amber); margin-top: 2em; }
.page p, .page li { color: var(--text-lo); }
.page .effective { color: var(--text-lo); font-size: .92rem; margin-bottom: 2.2em; }
.page .lead { color: var(--text-hi); font-size: 1.1rem; }

.notfound {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ---------- scroll reveal (JS progressive enhancement) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease-out, transform .6s ease-out;
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js .reveal.in-view {
  opacity: 1;
  transform: none;
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  section { padding: 64px 0; }

  .hero { min-height: auto; padding-bottom: 64px; }

  .hero-scene {
    transform: scale(.72);
    transform-origin: bottom center;
    margin-top: -30px;
    margin-bottom: -80px;
  }

  .moon {
    width: 44px;
    height: 44px;
    box-shadow: inset -10px 5px 0 0 #DFE4F2;
    top: 12px;
    left: 14px;
    opacity: .85;
  }

  /* crisp 1x village strip — the scaled 2x version overflows small screens */
  .spr-village {
    --strip-w: 960px;
    width: 240px;
    height: 160px;
    background-size: 960px 160px;
  }
  .growth { padding: 40px 0; }
}

@media (max-width: 640px) {
  .site-nav { display: none; }
}

/* ---------- reduced motion: freeze into a coherent still scene ---------- */

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



