/* Neon Grid: Block Blitz - landing page
   Visual language taken from the app's TitleScreen and the "Cyber Neon" skin.
   Skin colors are CSS variables; script.js swaps them when a skin is picked. */

:root {
  --bg: #090d16;
  --accent: #06b6d4;
  --glow: #06b6d4;
  --badge: linear-gradient(135deg, #06b6d4, #ec4899);
  --board-bg: #0f172a;
  --board-border: #1e293b;
  --empty: #172033;
  --c0: #06b6d4;
  --c1: #ec4899;
  --c2: #10b981;
  --c3: #8b5cf6;
  --c4: #f59e0b;
  --c5: #3b82f6;

  --muted: rgba(255, 255, 255, 0.72);
  --faint: rgba(255, 255, 255, 0.55);
  --glass: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.12);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s;
}

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: #fff;
}

.wrap {
  width: 100%;
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: max(1.25rem, env(safe-area-inset-left)) max(1.25rem, env(safe-area-inset-right));
}

/* Background: soft accent glows in two corners plus the app's 40px grid */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background:
    radial-gradient(circle at 0% 0%, var(--accent) 0, transparent 26rem),
    radial-gradient(circle at 100% 100%, var(--glow) 0, transparent 26rem);
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  gap: 2.5rem;
  justify-items: center;
  align-items: center;
  text-align: center;
  padding-top: clamp(2.5rem, 8vw, 5rem);
  padding-bottom: clamp(2.5rem, 7vw, 5rem);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.emblem {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.375rem;
  width: 6rem;
  height: 6rem;
  padding: 0.75rem;
  margin-bottom: 1.5rem;
  border-radius: 1.5rem;
  background: var(--badge);
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 31%, transparent);
  transition: transform 0.3s;
}
.emblem:hover { transform: rotate(3deg); }
.emblem .b {
  display: grid;
  place-items: center;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.8);
  color: #000;
  font-size: 1.25rem;
  font-weight: 900;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}
.emblem .b.dim {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* Title lockup: gradient "NEON GRID" with glow over white "BLOCK BLITZ" */
.lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}
.lockup span { display: block; }
.l1 {
  font-size: clamp(2.6rem, 11vw, 4.75rem);
  letter-spacing: 0.0625em;
  margin-right: -0.0625em;
  background: linear-gradient(135deg, #38bdf8 0%, #ec4899 50%, #fbbf24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 0.4rem rgba(236, 72, 153, 0.45));
}
.l2 {
  margin-top: 0.5rem;
  font-size: clamp(1.75rem, 7.4vw, 3.15rem);
  letter-spacing: 0.25em;
  margin-right: -0.25em;
  color: #fff;
}

.tagline {
  max-width: 26rem;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 1.0625rem;
  font-weight: 500;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
  padding: 1rem 2.25rem;
  border-radius: 1rem;
  background: var(--badge);
  color: var(--bg);
  font-size: 1.125rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 38%, transparent);
  transition: transform 0.2s, background-color 0.3s;
}
.cta svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
  transition: transform 0.2s;
}
.cta:hover { transform: scale(1.05); text-decoration: none; }
.cta:hover svg { transform: translateX(2px); }
.cta:active { transform: scale(0.95); }

.fine {
  margin-top: 0.75rem;
  color: var(--faint);
  font-size: 0.8125rem;
}

/* ---------- Demo board ---------- */
.demo { width: min(100%, 26rem); }

.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.1875rem;
  aspect-ratio: 1;
  padding: 0.5rem;
  border-radius: 1.25rem;
  background: var(--board-bg);
  border: 1px solid var(--board-border);
  box-shadow: 0 0 35px color-mix(in srgb, var(--accent) 16%, transparent);
  transition: background-color 0.3s, border-color 0.3s;
}

.cell {
  position: relative;
  border-radius: 0.5rem;
  background: var(--empty);
  transition: background-color 0.3s;
}
/* tiny dot in empty cells, like the app */
.cell::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.375rem;
  height: 0.375rem;
  margin: -0.1875rem 0 0 -0.1875rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}
.cell.on {
  background: var(--fill);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 0 0.6rem color-mix(in srgb, var(--fill) 45%, transparent);
}
.cell.on::after { display: none; }
/* top highlight on filled cells */
.cell.on::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  right: 0.25rem;
  top: 0.125rem;
  height: 0.375rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

.c0 { --fill: var(--c0); }
.c1 { --fill: var(--c1); }
.c2 { --fill: var(--c2); }
.c3 { --fill: var(--c3); }
.c4 { --fill: var(--c4); }
.c5 { --fill: var(--c5); }

/* Same keyframes as the app's index.css */
@keyframes placementHalo {
  0% {
    transform: scale(0.94);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.9), 0 0 20px 4px var(--fill), inset 0 0 12px rgba(255, 255, 255, 0.9);
    filter: brightness(1.7);
  }
  45% {
    transform: scale(1.08);
    box-shadow: 0 0 28px 8px var(--fill), 0 0 15px 3px rgba(255, 255, 255, 0.7), inset 0 0 6px rgba(255, 255, 255, 0.5);
    filter: brightness(1.35);
  }
  100% {
    transform: scale(1);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 0 0.6rem color-mix(in srgb, var(--fill) 45%, transparent);
    filter: brightness(1);
  }
}
@keyframes lineVaporize {
  0% {
    transform: scale(1);
    filter: brightness(1.9) drop-shadow(0 0 14px rgba(255, 255, 255, 0.95));
    opacity: 1;
  }
  45% {
    transform: scale(1.08);
    filter: brightness(2.4) drop-shadow(0 0 22px var(--glow));
    opacity: 0.95;
  }
  100% {
    transform: scale(0.65);
    filter: brightness(1) drop-shadow(0 0 0 transparent);
    opacity: 0;
  }
}
.cell.pop { animation: placementHalo 0.42s cubic-bezier(0.16, 1, 0.3, 1) both; }
.cell.vap {
  animation: lineVaporize 0.5s cubic-bezier(0.2, 0.8, 0.4, 1) var(--d, 0ms) forwards;
}

.caption {
  min-height: 1.75rem;
  margin-top: 1rem;
  text-align: center;
  color: var(--accent);
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.25s;
}
.caption.show { opacity: 1; }

/* ---------- Sections ---------- */
.section {
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.section h2 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.lede {
  max-width: 34rem;
  margin-top: 0.75rem;
  color: var(--muted);
}

/* Features: open list, each marked with a piece from the game */
.features ul {
  display: grid;
  gap: 2rem 3rem;
  margin-top: 2rem;
  padding: 0;
  list-style: none;
}
.features li {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 1.1rem;
  align-items: start;
}
.features h3 { font-size: 1.0625rem; font-weight: 800; line-height: 1.3; }
.features p {
  max-width: 34rem;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.piece {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 0.9rem);
  gap: 3px;
  align-content: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-top: 0.1rem;
}
.piece i {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 0.25rem;
}
.piece i.on {
  background: var(--fill);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 0 0.5rem color-mix(in srgb, var(--fill) 45%, transparent);
}

/* Skins */
.no-js .skins { display: none; }

.skin-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1.75rem;
}
.skin {
  display: grid;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--s-edge);
  border-radius: 1rem;
  background: var(--s-bg);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  transition: transform 0.15s;
}
.skin:hover { transform: translateY(-2px); }
.skin:active { transform: scale(0.97); }
.skin[aria-pressed="true"] {
  outline: 2px solid var(--s-accent);
  outline-offset: 3px;
}
.skin:focus-visible { outline-color: #fff; }
.skin .sw {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
}
.skin .sw i {
  aspect-ratio: 1;
  border-radius: 0.2rem;
}
.skin b { font-size: 0.875rem; font-weight: 800; line-height: 1.2; }

.skin-tag {
  min-height: 3rem;
  max-width: 34rem;
  margin-top: 1.25rem;
  color: var(--muted);
}
.skin-tag strong { color: #fff; }

/* Privacy policy */
.policy > * { max-width: 42rem; }
.policy .date { margin-top: 0.5rem; color: var(--faint); font-size: 0.875rem; }
.policy p { margin-top: 0.75rem; color: var(--muted); }
.policy h3 { margin-top: 2rem; font-size: 1.0625rem; font-weight: 800; }
.policy h3 + p { margin-top: 0.4rem; }

/* Footer */
footer {
  border-top: 1px solid var(--glass-border);
  padding-top: 2rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  color: var(--faint);
  font-size: 0.8125rem;
}
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.foot small { flex-basis: 100%; font-size: 0.75rem; }
.pill {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: var(--glass);
  color: rgba(255, 255, 255, 0.8);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.6875rem;
  font-weight: 700;
}

/* ---------- Wider screens ---------- */
@media (min-width: 34rem) {
  .skin-list { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 40rem) {
  .emblem { width: 7rem; height: 7rem; }
  .features ul { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 60rem) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    justify-items: start;
    text-align: left;
  }
  .hero-copy,
  .lockup { align-items: flex-start; }
  .l1, .l2 { margin-right: 0; }
  .tagline { font-size: 1.1875rem; }
  .demo { justify-self: end; }
  .skin-list { grid-template-columns: repeat(6, 1fr); }
}

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