/* It Flies website: same sky palette as the game. */
:root {
  --sky: #4aa3ff;
  --sky-soft: #e8f4ff;
  --ink: #12304d;
  --muted: #557089;
  --line: #d6e6f5;
  --card: #ffffff;
  --accent: #ff7a3d;
  --blue: #2f6fd0;
  --good: #22b07d;
  --bad: #e5484d;
  --wrap: 1080px;
  --shadow: 0 12px 40px rgba(18, 48, 77, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #f6fbff;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}
a { color: var(--blue); }
img { max-width: 100%; display: block; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(246, 251, 255, 0.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -0.3px; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand small { color: var(--muted); font-weight: 700; font-size: 15px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 700; padding: 8px 10px; border-radius: 10px; }
.nav a:not(.btn):hover { color: var(--ink); background: var(--sky-soft); }
.nav .btn { margin-left: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; background: var(--card); color: var(--ink);
  border-radius: 14px; padding: 12px 20px; font: inherit; font-weight: 800; font-size: 16px;
  text-decoration: none; cursor: pointer; transition: transform 0.08s, filter 0.15s;
  box-shadow: inset 0 0 0 2px var(--line);
}
.btn:hover { filter: brightness(0.98); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: none; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.big { font-size: 19px; padding: 15px 26px; }
.btn small { display: block; font-weight: 600; font-size: 12px; color: var(--muted); }
.store { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.2; padding: 10px 18px; cursor: default; }
.store:active { transform: none; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 56px 0 48px; background: linear-gradient(180deg, #d7ecff 0%, #f6fbff 100%); }
.hero .wrap { position: relative; }
.sky-deco { position: absolute; top: 10%; left: -10%; font-size: 72px; opacity: 0.8; animation: drift 34s linear infinite; pointer-events: none; }
.sky-deco.far { top: 62%; font-size: 44px; opacity: 0.55; animation-duration: 52s; animation-delay: -24s; }
@keyframes drift { to { transform: translateX(125vw); } }
@media (prefers-reduced-motion: reduce) { .sky-deco { animation: none; } }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(44px, 7vw, 80px); line-height: 1; letter-spacing: -2px; margin: 0 0 18px; font-weight: 800; }
.hero h1 span { color: var(--accent); }
.hero .lead { font-size: 20px; color: var(--muted); margin: 0 0 28px; max-width: 520px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 22px 0 0; padding: 0; list-style: none; color: var(--muted); font-weight: 700; }

/* Playable game in a phone frame (desktop); phones get the Play button instead. */
.phone {
  justify-self: center; width: clamp(320px, calc((100vh - 140px) / 2), 370px); aspect-ratio: 1 / 2; border-radius: 44px; padding: 12px;
  background: #12304d; box-shadow: var(--shadow); position: relative;
}
.phone iframe { width: 100%; height: 100%; border: 0; border-radius: 34px; background: #5ab0ff; }
.phone-start {
  width: 100%; height: 100%; border: 0; border-radius: 34px; cursor: pointer; font: inherit;
  background: linear-gradient(180deg, #5ab0ff, #bfe3ff); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
}
.phone-start img { width: 46%; border-radius: 22%; }
.phone-note { text-align: center; color: var(--muted); font-size: 14px; margin: 12px 0 0; }

/* ---------- sections ---------- */
section { padding: 64px 0; }
.section-title { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; letter-spacing: -0.8px; margin: 0 0 8px; text-align: center; font-weight: 800; }
.section-lead { color: var(--muted); text-align: center; margin: 0 auto 36px; max-width: 560px; font-size: 18px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--card); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
.card .ico { font-size: 34px; line-height: 1; }
.card h3 { margin: 12px 0 6px; font-size: 20px; }
.card p { margin: 0; color: var(--muted); }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.steps li { background: var(--card); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); counter-increment: step; }
.steps li::before {
  content: counter(step); display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--sky-soft); color: var(--blue); font-weight: 800;
}
.steps h3 { margin: 12px 0 4px; font-size: 20px; }
.steps p { margin: 0; color: var(--muted); }

/* Try-it quiz */
.quiz { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.q { background: var(--card); border-radius: 20px; padding: 20px 16px; box-shadow: var(--shadow); text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.q .e { font-size: 64px; line-height: 1; }
.q .n { font-weight: 800; font-size: 18px; }
.q .opts { display: flex; gap: 8px; width: 100%; }
.q .opts .btn { flex: 1; padding: 10px 6px; font-size: 15px; }
.q .res { min-height: 1.5em; font-weight: 800; margin: 0; }
.q.right { box-shadow: 0 0 0 3px var(--good), var(--shadow); }
.q.wrong { box-shadow: 0 0 0 3px var(--bad), var(--shadow); }
.q.right .res { color: var(--good); }
.q.wrong .res { color: var(--bad); }

/* Leaderboard preview */
.boards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 820px; margin: 0 auto; }
.board { background: var(--card); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.board h3 { margin: 0 0 10px; font-size: 20px; }
.board ol { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; padding: 8px 6px; border-top: 1px solid var(--line); }
.board li:first-child { border-top: 0; }
.board .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.board .sc { font-weight: 800; }
.board .empty { display: block; color: var(--muted); text-align: center; padding: 18px 0; }

.band { background: linear-gradient(180deg, #4aa3ff, #2f6fd0); color: #fff; }
.band .section-lead { color: #e3f1ff; }
.band .cta { justify-content: center; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--muted); text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--ink); }

/* ---------- legal pages ---------- */
.doc { padding: 40px 0 64px; }
.doc .wrap { max-width: 780px; }
.doc h1 { font-size: clamp(32px, 5vw, 44px); letter-spacing: -1px; margin: 0 0 4px; }
.doc .updated { color: var(--muted); margin: 0 0 24px; }
.doc h2 { margin: 36px 0 8px; font-size: 22px; }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0; background: var(--card); border-radius: 12px; overflow: hidden; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { background: var(--sky-soft); }
.callout { background: var(--sky-soft); border-radius: 16px; padding: 4px 20px; }

/* Privacy notice (site.js) */
.notice {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 20; max-width: 640px; margin: 0 auto;
  background: var(--ink); color: #fff; border-radius: 16px; padding: 14px 16px; display: flex; gap: 14px; align-items: center;
}
.notice p { margin: 0; font-size: 14px; }
.notice a { color: #bfe3ff; }
.notice .btn { white-space: nowrap; }
.notice[hidden] { display: none; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .phone-col { display: none; }
  .grid, .steps { grid-template-columns: 1fr; }
  .quiz { grid-template-columns: 1fr 1fr; }
  .boards { grid-template-columns: 1fr; }
  .nav a:not(.btn) { display: none; }
}
@media (max-width: 480px) {
  .quiz { grid-template-columns: 1fr; }
  .notice { flex-direction: column; align-items: stretch; }
}
