/* Pip Blast — site styles. Palette and shapes mirror the game's Theme.swift. */
:root {
  --bg-top: #f7f5f0;
  --bg-bottom: #eae7dd;
  --surface: #fdfdfb;
  --cell: #e9e6df;
  --cell-line: #dcd9d0;
  --text: #26241f;
  --text-2: #716d63;
  --accent: #2f8bff;
  --d1: #2273e8; /* royal blue */
  --d2: #0a8c90; /* teal */
  --d3: #2a944d; /* emerald */
  --d4: #7d42cc; /* violet */
  --d5: #ed612e; /* orange */
  --d6: #d63868; /* crimson */
  --flame: #e8493f;
  --card-shadow: 0 2px 6px rgba(30, 28, 22, 0.05), 0 14px 34px rgba(30, 28, 22, 0.07);
  --shot-shadow: 0 24px 60px rgba(30, 28, 22, 0.2);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg-top: #171921;
    --bg-bottom: #0b0d12;
    --surface: #20232b;
    --cell: #2c2f39;
    --cell-line: #383c48;
    --text: #f2f2f5;
    --text-2: #9fa1ab;
    --card-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), 0 14px 34px rgba(0, 0, 0, 0.3);
    --shot-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: ui-rounded, -apple-system, "SF Pro Rounded", "Helvetica Neue", system-ui, sans-serif;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom)) fixed;
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
a { color: var(--accent); }
strong { color: var(--text); }
p { color: var(--text-2); }

/* ---------- header ---------- */
header.site { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; }
header.site .brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
header.site .brand img { width: 38px; height: 38px; border-radius: 9px; }
header.site .brand span { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em; }
header.site nav a { color: var(--text-2); text-decoration: none; font-weight: 700; font-size: 0.92rem; margin-left: 22px; }
header.site nav a:hover { color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px;
  align-items: center; padding: 64px 0 30px; min-height: 480px;
}
@media (max-width: 780px) { .hero { grid-template-columns: 1fr; padding-top: 34px; text-align: center; } }

.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.4rem);
  font-weight: 900; letter-spacing: -0.03em; line-height: 1.04;
}
.hero h1 .blast { color: var(--flame); }
.hero p.tag { font-size: 1.18rem; margin: 20px 0 0; max-width: 30em; }
.hero p.sub { font-size: 1rem; margin: 10px 0 0; max-width: 32em; }
@media (max-width: 780px) { .hero p.tag, .hero p.sub { margin-left: auto; margin-right: auto; } }

.badge-row { margin-top: 30px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
@media (max-width: 780px) { .badge-row { justify-content: center; } }
.badge {
  display: inline-block; padding: 15px 30px; border-radius: 999px;
  font-weight: 800; text-decoration: none; font-size: 1rem;
  background: var(--text); color: var(--bg-top);
}
.badge.soon { background: var(--cell); color: var(--text-2); cursor: default; }
.badge-note { font-size: 0.88rem; color: var(--text-2); }
/* Apple's official badge: fixed artwork, never restyled — only sized. */
.appstore-badge { height: 56px; display: block; }

/* ---------- the live demo board ---------- */
.demo {
  justify-self: center;
  background: var(--surface);
  border-radius: 26px;
  padding: 26px 26px 22px;
  box-shadow: var(--card-shadow);
  user-select: none;
  width: min(400px, 92vw);
}
.demo .demo-head {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px;
}
.demo .target { font-weight: 800; font-size: 0.95rem; color: var(--d3); }
.demo .score { font-weight: 900; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.demo .score .mult { color: var(--flame); font-size: 0.9rem; font-weight: 800; margin-left: 6px; }
.demo .board { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.demo .cell {
  aspect-ratio: 1; border-radius: 16px; background: var(--cell);
  position: relative;
}
.demo .sumrow {
  text-align: center; margin-top: 12px; font-weight: 800; font-size: 0.92rem;
  color: var(--text-2); font-variant-numeric: tabular-nums; min-height: 1.4em;
}
.demo .sumrow .hit { color: var(--d3); }

/* dice tiles (shared by demo + decorations) */
.die {
  position: absolute; inset: 0; border-radius: 16px;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  padding: 18%;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25), 0 3px 8px rgba(30,28,22,0.22);
  animation: die-in 0.34s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.die.v1 { background: var(--d1); } .die.v2 { background: var(--d2); }
.die.v3 { background: var(--d3); } .die.v4 { background: var(--d4); }
.die.v5 { background: var(--d5); } .die.v6 { background: var(--d6); }
.die .pip { width: 62%; height: 62%; border-radius: 50%; background: #fff; place-self: center; }
.die .pip.off { visibility: hidden; }
@keyframes die-in { from { transform: scale(0.3) rotate(-14deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.die.blasting { animation: die-blast 0.5s cubic-bezier(0.5, 0, 0.75, 0.4) forwards; }
@keyframes die-blast {
  30% { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(0.1) rotate(20deg); opacity: 0; }
}
.demo .float-score {
  position: absolute; left: 50%; top: 42%; transform: translateX(-50%);
  font-weight: 900; font-size: 1.5rem; color: var(--flame);
  pointer-events: none; animation: float-up 1.1s ease-out forwards;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
@media (prefers-color-scheme: dark) { .demo .float-score { text-shadow: none; } }
@keyframes float-up { from { opacity: 0; translate: 0 14px; } 25% { opacity: 1; } to { opacity: 0; translate: 0 -46px; } }
.spark {
  position: absolute; width: 9px; height: 9px; border-radius: 3px;
  pointer-events: none; animation: spark-fly 0.7s ease-out forwards;
}
@keyframes spark-fly { to { transform: translate(var(--dx), var(--dy)) rotate(220deg); opacity: 0; } }

/* ---------- screenshots ---------- */
.shots { display: flex; gap: 26px; justify-content: center; padding: 84px 0 30px; flex-wrap: wrap; perspective: 1200px; }
.shots img {
  width: min(270px, 76vw); border-radius: 30px; box-shadow: var(--shot-shadow);
  border: 1px solid rgba(128,128,128,0.16);
  transition: transform 0.35s ease;
}
.shots img:nth-child(1) { transform: rotate(-2.4deg) translateY(10px); }
.shots img:nth-child(2) { transform: translateY(-8px); }
.shots img:nth-child(3) { transform: rotate(2.4deg) translateY(10px); }
.shots img:hover { transform: rotate(0) translateY(-6px) scale(1.02); }

/* ---------- how it plays ---------- */
.how { padding: 64px 0 8px; }
.how h2, .grid-section h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 900; letter-spacing: -0.02em; text-align: center; }
.how .steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-top: 30px; }
.step { background: var(--surface); border-radius: 22px; padding: 26px 24px; box-shadow: var(--card-shadow); text-align: center; }
.step .art { height: 74px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; }
.step .art .mini { position: relative; width: 46px; height: 46px; display: inline-block; }
.step .art .mini .die { border-radius: 11px; animation: none; }
.step .art .chip {
  font-weight: 900; font-size: 0.95rem; padding: 6px 12px; border-radius: 999px;
  background: var(--cell); color: var(--text-2);
}
.step .art .chip.go { background: var(--d3); color: #fff; }
.step .art .flame { color: var(--flame); font-weight: 900; font-size: 1.5rem; }
.step h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 4px; }
.step p { font-size: 0.94rem; }

/* ---------- features ---------- */
.grid-section { padding: 64px 0 10px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; margin-top: 30px; }
.card { background: var(--surface); border-radius: 22px; padding: 26px 24px; box-shadow: var(--card-shadow); }
.card .mini { position: relative; width: 44px; height: 44px; margin-bottom: 14px; display: block; }
.card .mini .die { border-radius: 11px; animation: none; }
.card h3 { font-size: 1.08rem; font-weight: 800; margin-bottom: 4px; }
.card p { font-size: 0.95rem; }

/* ---------- free/pro banner ---------- */
.fair {
  margin: 74px 0 10px; background: var(--surface); border-radius: 26px;
  box-shadow: var(--card-shadow); padding: 40px 34px; text-align: center;
}
.fair h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 900; letter-spacing: -0.02em; }
.fair p { max-width: 44em; margin: 12px auto 0; }

/* ---------- inner pages ---------- */
main.page { padding: 26px 0 40px; max-width: 760px; }
main.page h1 { font-size: clamp(2.1rem, 5vw, 3rem); font-weight: 900; letter-spacing: -0.02em; }
main.page .lead { font-size: 1.08rem; margin-top: 12px; }
main.page h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.01em; margin: 2.2em 0 0.5em; }
main.page h3 { font-size: 1.04rem; font-weight: 800; margin: 1.5em 0 0.25em; color: var(--text); }
.faq .card { margin-top: 14px; }
.faq .card h3 { margin: 0 0 0.25em; }

/* ---------- footer ---------- */
footer.site {
  border-top: 1px solid rgba(128,128,128,0.18); margin-top: 70px;
  padding: 26px 0 46px; display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; color: var(--text-2); font-size: 0.9rem;
}
footer.site a { color: var(--text-2); text-decoration: none; margin-right: 18px; font-weight: 600; }
footer.site a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .die, .die.blasting, .demo .float-score, .spark { animation: none !important; }
  .shots img { transition: none; }
}
