:root {
  --ink: #07040c;
  --ink-2: #120a1f;
  --ink-3: #1c1130;
  --purple: #9333ea;         /* app AccentColor */
  --purple-lite: #c08af9;    /* readable accent on dark */
  --purple-deep: #3b1466;
  --text: #f5f1fb;
  --text-dim: #b9adcb;
  --paper: #f6f3fa;
  --paper-ink: #16101f;
  --paper-dim: #5d5270;
  --green: #34c759;
  --radius: 20px;
  --wrap: 1160px;
  --font-display: "Poppins", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 700; margin-bottom: 36px; text-wrap: balance; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.eyebrow {
  font: 600 13px/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--purple-lite);
  margin-bottom: 14px;
}
.eyebrow--dark { color: var(--purple); }

.grad-text {
  background: linear-gradient(90deg, #d8b4fe, var(--purple) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

:focus-visible { outline: 3px solid var(--purple-lite); outline-offset: 3px; border-radius: 6px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgb(7 4 12 / 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgb(255 255 255 / 0.06);
}
.nav__inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 20px/1 var(--font-display); letter-spacing: -0.01em; }
.brand img { border-radius: 9px; }
.nav__links { display: none; gap: 28px; margin-left: auto; }
.nav__links a { text-decoration: none; color: var(--text-dim); font-size: 15px; font-weight: 500; transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--purple); color: #fff; text-decoration: none;
  font: 600 15px/1 var(--font-display);
  border-radius: 999px; padding: 14px 22px;
  transition: background .2s, transform .2s;
}
.btn:hover { background: #a24ef0; transform: translateY(-1px); }
.btn--small { padding: 10px 16px; font-size: 14px; margin-left: auto; }
@media (min-width: 760px) {
  .nav__links { display: flex; }
  .btn--small { margin-left: 8px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(60% 50% at 80% 70%, rgb(147 51 234 / 0.35), transparent 70%),
    linear-gradient(180deg, var(--ink) 0%, #1b0c30 45%, #4a1b86 80%, #7a2fd6 100%);
  padding: 56px 0 72px;
  overflow: hidden;
}
.hero__grid { display: grid; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(40px, 7vw, 72px); font-weight: 700; margin-bottom: 22px; }
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--text-dim); max-width: 34em; margin-bottom: 32px; }
.lede, .hero h1 { text-wrap: pretty; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.appstore { display: inline-block; border-radius: 12px; transition: transform .2s; }
.appstore:hover { transform: translateY(-2px); }
.appstore img { height: 56px; width: auto; }
.meta { color: var(--text-dim); font-size: 14px; }

.hero__demo { display: flex; flex-direction: column; align-items: center; gap: 18px; }
@media (min-width: 900px) {
  .hero { padding: 72px 0 96px; }
  .hero__grid { grid-template-columns: 1.15fr 0.85fr; gap: 64px; }
}

/* ---------- Phone demo ---------- */
.phone {
  --w: 300px;
  width: var(--w); aspect-ratio: 300 / 620;
  padding: 10px;
  border-radius: 50px;
  background: linear-gradient(145deg, #2a2a30, #0c0c0f 40%, #1e1e24);
  box-shadow:
    0 0 0 1.5px #3a3a42 inset,
    0 40px 80px -20px rgb(0 0 0 / 0.7),
    0 0 90px -10px rgb(147 51 234 / 0.55);
  transform: rotate(-2deg);
}
@media (max-width: 359px) { .phone { --w: 272px; } }
.phone__screen {
  position: relative; height: 100%;
  border-radius: 40px; overflow: hidden;
  background: #fff; color: #000;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  display: flex; flex-direction: column;
}
.status { display: flex; align-items: center; justify-content: space-between; padding: 12px 26px 0; height: 40px; font-size: 13px; font-weight: 600; }
.island { width: 84px; height: 24px; border-radius: 20px; background: #000; }
.status__icons { width: 38px; height: 10px; border-radius: 3px; background: linear-gradient(90deg, #000 0 60%, transparent 60%); box-shadow: 0 0 0 1px #0003 inset; }
.app-title {
  text-align: center; margin-top: 14px;
  font-size: 22px; font-weight: 700; letter-spacing: -0.01em;
  background: linear-gradient(90deg, #111 30%, var(--purple));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.timer { padding: 10px 18px 0; }
.timer__row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.timer__track { height: 6px; border-radius: 4px; background: #e5e5ea; overflow: hidden; }
.timer__bar { height: 100%; width: 100%; border-radius: 4px; background: linear-gradient(90deg, #000, var(--purple)); transform-origin: left; transition: transform .25s linear; }
.points {
  position: relative; margin: 12px 14px 0; height: 62px; border-radius: 14px;
  background: #f2f2f7; display: grid; place-items: center;
  font-size: 22px; font-weight: 700; color: var(--purple);
}
.points__gain {
  position: absolute; right: 22px; top: 50%; translate: 0 -50%;
  font-size: 20px; color: var(--green); opacity: 0;
}
.points__gain.show { animation: gain 1.1s ease-out; }
@keyframes gain {
  0% { opacity: 0; transform: translateY(8px); }
  20% { opacity: 1; transform: translateY(0); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}
.tiles { position: relative; flex: 1; min-height: 80px; }
.tile {
  position: absolute; left: 0; top: calc(50% - 19px);
  width: 36px; height: 38px;
  display: grid; place-items: center;
  border: 1.5px solid #111; border-radius: 7px; background: #fff;
  font-size: 19px; font-weight: 700;
  transition: transform .5s cubic-bezier(.3,1.3,.5,1), opacity .35s, border-color .4s, color .4s, background .4s;
}
.tile.is-new { border-color: var(--purple); color: var(--purple); background: #f6edff; }
.entry { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: #f2f2f7; border-top: 1px solid #e3e3e8; }
.entry__field {
  position: relative; flex: 1; height: 32px; border-radius: 8px; background: #fff; border: 1px solid #dcdce0;
  display: flex; align-items: center; padding: 0 9px; font-size: 15px; font-weight: 500; letter-spacing: .02em;
}
.caret { width: 2px; height: 17px; background: var(--purple); margin-left: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.entry__placeholder { position: absolute; left: 12px; color: #b3b3b8; font-weight: 400; pointer-events: none; }
.entry__field.has-text .entry__placeholder { display: none; }
.entry__send { width: 28px; height: 28px; border-radius: 50%; background: var(--purple); color: #fff; display: grid; place-items: center; transition: transform .15s; }
.entry__send.press { transform: scale(.82); }
.kb { background: #d1d3d9; padding: 7px 3px 18px; display: flex; flex-direction: column; gap: 7px; }
.kb__row { display: flex; justify-content: center; gap: 4px; }
.kb__key {
  width: 23px; height: 32px; border-radius: 5px; background: #fff; box-shadow: 0 1px 0 #898a8d;
  display: grid; place-items: center; font-size: 15px; transition: background .12s, transform .12s;
}
.kb__key.press { background: #e1d0f7; transform: translateY(-2px) scale(1.12); }

.move {
  font-size: 14px; color: var(--text-dim);
  background: rgb(255 255 255 / 0.07); border: 1px solid rgb(255 255 255 / 0.1);
  padding: 8px 16px; border-radius: 999px; min-height: 38px;
  font-variant-numeric: tabular-nums;
}
.move b { color: var(--text); font-weight: 600; letter-spacing: .04em; }
.move em { font-style: normal; color: var(--purple-lite); font-weight: 600; }

/* ---------- Mini tiles (static) ---------- */
.mini-tiles { display: flex; gap: 5px; flex-wrap: nowrap; }
.mini-tiles i {
  font: normal 700 17px/1 -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  width: 30px; height: 32px; display: grid; place-items: center;
  border: 1.5px solid var(--paper-ink); border-radius: 6px; background: #fff; color: var(--paper-ink);
}
.mini-tiles i.add { border-color: var(--purple); color: var(--purple); background: #f6edff; }
.mini-tiles--dark i { background: transparent; border-color: rgb(255 255 255 / 0.85); color: #fff; }

/* ---------- How ---------- */
.how { background: var(--paper); color: var(--paper-ink); padding: 88px 0; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  position: relative; background: #fff; border-radius: var(--radius); padding: 28px 24px 26px;
  box-shadow: 0 1px 0 rgb(22 16 31 / 0.06), 0 12px 30px -18px rgb(59 20 102 / 0.35);
}
.step__num {
  position: absolute; top: 22px; right: 22px;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--purple); color: #fff; font: 600 14px/1 var(--font-display);
}
.step .mini-tiles { margin-bottom: 22px; min-height: 32px; }
.step h3 { font-size: 21px; font-weight: 600; margin-bottom: 8px; }
.step p { color: var(--paper-dim); font-size: 16px; }

/* ---------- Scoring & timer ---------- */
.scoring {
  padding: 96px 0;
  background: radial-gradient(50% 60% at 0% 100%, rgb(147 51 234 / 0.18), transparent 70%), var(--ink);
}
.scoring__grid { display: grid; gap: 72px; }
@media (min-width: 900px) { .scoring__grid { grid-template-columns: 1fr 1fr; gap: 64px; } }
.score-list, .levels { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.score-list li {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "tiles pts" "label pts";
  align-items: center; gap: 10px 16px;
  background: var(--ink-2); border: 1px solid rgb(255 255 255 / 0.07); border-radius: 16px; padding: 18px 20px;
}
.score-list .mini-tiles { grid-area: tiles; }
.score-list .mini-tiles i { width: 28px; height: 30px; font-size: 15px; }
.score-list__label { grid-area: label; color: var(--text-dim); font-size: 14px; }
.score-list b { grid-area: pts; font: 700 26px/1 var(--font-display); color: var(--purple-lite); }

.levels li {
  display: grid; grid-template-columns: 72px 1fr 40px; align-items: center; gap: 16px;
  background: var(--ink-2); border: 1px solid rgb(255 255 255 / 0.07); border-radius: 16px; padding: 18px 20px;
}
.levels__name { font: 600 16px/1 var(--font-display); }
.levels__bar { height: 8px; border-radius: 6px; background: rgb(255 255 255 / 0.08); overflow: hidden; }
.levels__bar span { display: block; height: 100%; width: calc(var(--t) * 100%); border-radius: 6px; background: linear-gradient(90deg, #5b1fa3, var(--purple), #c08af9); }
.levels__secs { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.note { color: var(--text-dim); font-size: 14px; margin-top: 16px; }

/* ---------- Screens ---------- */
.screens { padding: 96px 0 104px; background: linear-gradient(180deg, var(--ink), var(--ink-3)); }
.screens h2 { margin-bottom: 40px; }
.gallery {
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px max(16px, calc((100vw - var(--wrap)) / 2 + 32px)) 20px;
  scrollbar-width: thin; scrollbar-color: var(--purple-deep) transparent;
}
.gallery img {
  flex: 0 0 auto; width: clamp(210px, 24vw, 264px);
  border-radius: 24px; scroll-snap-align: center;
  box-shadow: 0 20px 50px -20px rgb(0 0 0 / 0.8);
}

/* ---------- Final CTA ---------- */
.final { padding: 24px 0 96px; background: var(--ink-3); }
.final__card {
  text-align: center; border-radius: 32px; padding: 64px 24px;
  background:
    radial-gradient(70% 90% at 50% 0%, rgb(255 255 255 / 0.12), transparent 60%),
    linear-gradient(160deg, #3b1466, var(--purple) 70%, #b16ef5);
  display: flex; flex-direction: column; align-items: center;
}
.final__icon { border-radius: 22px; margin-bottom: 28px; box-shadow: 0 16px 40px -12px rgb(0 0 0 / 0.5); }
.final__card h2 { margin-bottom: 12px; }
.final__card p { color: rgb(255 255 255 / 0.85); margin-bottom: 28px; font-size: 18px; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); border-top: 1px solid rgb(255 255 255 / 0.06); padding: 28px 0; font-size: 14px; color: var(--text-dim); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.footer nav { display: flex; gap: 22px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }

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