/* Sudoku Variants landing page. Colours follow the app: white board, blue digits, gold stars. */
:root {
  --bg: #fefefe;
  --bg-soft: #f3f6fc;
  --card: #ffffff;
  --ink: #0f1830;
  --muted: #5a6582;
  --line: #e2e7f1;
  --blue: #0e6be8;
  --blue-deep: #0a4fc0;
  --blue-soft: #e8f1fe;
  --gold: #f5a623;
  --red: #e5484d;
  --green: #1f9d5b;
  --shadow: 0 1px 2px rgba(15, 24, 48, .06), 0 12px 32px -12px rgba(15, 24, 48, .18);
  --radius: 22px;
  --max: 1160px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1122; --bg-soft: #111a32; --card: #151f3b; --ink: #eef2fc; --muted: #a3aeca;
    --line: #26325a; --blue: #4b8ff5; --blue-deep: #2f74e6; --blue-soft: #1a2b55;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.top.scrolled { border-bottom-color: var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 900; font-size: 1.12rem; }
.brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 2px 8px rgba(14, 107, 232, .25); }
.nav { display: none; gap: 26px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 700; font-size: .96rem; }
.nav a:hover { color: var(--ink); }
.top .cta-sm { margin-left: auto; }
@media (min-width: 900px) { .nav { display: flex; } .top .cta-sm { margin-left: 8px; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 13px 22px; font: inherit; font-weight: 800;
  text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-blue { background: var(--blue); color: #fff; box-shadow: 0 8px 20px -8px rgba(14, 107, 232, .7); }
.btn-blue:hover { background: var(--blue-deep); }
.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--blue); }
.cta-sm { padding: 9px 16px; font-size: .92rem; border-radius: 12px; }
.play-badge img { height: 62px; width: auto; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 40px 0 72px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(60% 50% at 85% 20%, color-mix(in srgb, var(--blue) 18%, transparent), transparent 70%),
    radial-gradient(40% 40% at 0% 90%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(70% 70% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 70% at 50% 30%, #000 30%, transparent 75%);
}
.hero .wrap { display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) { .hero { padding: 64px 0 96px; } .hero .wrap { grid-template-columns: 1.1fr .9fr; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 99px;
  background: var(--card); border: 1px solid var(--line); font-size: .86rem; font-weight: 800; color: var(--muted);
}
.eyebrow b { background: var(--blue); color: #fff; border-radius: 99px; padding: 2px 9px; font-size: .78rem; }
.hero h1 { font-size: clamp(2.4rem, 6.4vw, 4.3rem); font-weight: 900; margin: 20px 0 18px; }
.hero h1 .hl { color: var(--blue); position: relative; white-space: nowrap; }
.hero h1 .hl::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: .04em; height: .22em; z-index: -1;
  background: color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 6px;
}
.lead { font-size: 1.16rem; color: var(--muted); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 26px; padding: 0; list-style: none; color: var(--muted); font-weight: 700; font-size: .95rem; }
.chips li { display: flex; align-items: center; gap: 7px; }
.chips svg { width: 18px; height: 18px; color: var(--green); flex: none; }

/* phone */
.stage { position: relative; display: flex; justify-content: center; padding: 10px 0; }
.phone {
  position: relative; width: min(300px, 74vw); aspect-ratio: 540 / 1020; border-radius: 42px; padding: 12px;
  background: linear-gradient(160deg, #24304f, #0d1428); box-shadow: 0 40px 80px -30px rgba(10, 40, 110, .55), inset 0 0 0 2px #3a4870;
  transform: rotate(-3deg); animation: float 7s ease-in-out infinite;
}
.phone .screen { position: relative; width: 100%; height: 100%; border-radius: 32px; overflow: hidden; background: #fff; }
.phone .screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s ease; }
.phone .screen img.on { opacity: 1; }
.phone::before { content: ""; position: absolute; top: 20px; left: 50%; width: 70px; height: 8px; margin-left: -35px; border-radius: 9px; background: #0d1428; z-index: 2; }
@keyframes float { 50% { transform: rotate(-3deg) translateY(-10px); } }
.float-card {
  position: absolute; z-index: 3; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 10px 14px; box-shadow: var(--shadow); font-weight: 800; font-size: .9rem; display: flex; align-items: center; gap: 10px;
  animation: bob 6s ease-in-out infinite;
}
.float-card small { display: block; color: var(--muted); font-weight: 700; font-size: .76rem; }
.float-card .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-size: 1.05rem; }
.fc1 { left: max(0px, calc(50% - 250px)); top: 14%; }
.fc2 { right: max(0px, calc(50% - 250px)); top: 48%; animation-delay: -2s; }
.fc3 { left: max(0px, calc(50% - 230px)); bottom: 6%; animation-delay: -4s; }
.fc2 .ic { background: color-mix(in srgb, var(--gold) 22%, transparent); color: #c27d00; }
.fc3 .ic { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
@keyframes bob { 50% { transform: translateY(-8px); } }
@media (max-width: 520px) { .float-card { font-size: .8rem; padding: 8px 10px; } .float-card .ic { width: 28px; height: 28px; } .fc1 { top: 6%; } }

/* ---------- marquee ---------- */
.marquee { border-block: 1px solid var(--line); background: var(--bg-soft); overflow: hidden; padding: 16px 0; }
.marquee .track { display: flex; gap: 44px; width: max-content; animation: slide 38s linear infinite; }
.marquee span { font-weight: 900; font-size: 1.3rem; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 44px; }
.marquee span::after { content: "✦"; color: var(--gold); font-size: .9rem; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
section { padding: 84px 0; }
.sec-head { max-width: 680px; margin: 0 auto 46px; text-align: center; }
.kicker { color: var(--blue); font-weight: 900; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; }
.sec-head h2 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); font-weight: 900; margin: 10px 0 14px; }
.sec-head p { color: var(--muted); font-size: 1.08rem; }

/* mini puzzle */
.try { background: var(--bg-soft); }
.try-box { display: grid; gap: 36px; align-items: center; justify-items: center; }
@media (min-width: 900px) { .try-box { grid-template-columns: 1fr 1fr; justify-items: stretch; } }
.try-copy h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900; margin: 10px 0 14px; }
.try-copy p { color: var(--muted); }
.try-copy ol { margin: 18px 0 0; padding-left: 20px; color: var(--muted); }
.try-copy li { margin: 4px 0; }
.mini { width: min(360px, 100%); margin: 0 auto; background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.mini-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; margin-bottom: 12px; }
.mini-top span { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.board4 { display: grid; grid-template-columns: repeat(4, 1fr); border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; aspect-ratio: 1; }
.board4 button {
  all: unset; display: grid; place-items: center; font-size: clamp(1.6rem, 7vw, 2.2rem); font-weight: 800; cursor: pointer;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--blue); background: var(--card);
  transition: background .15s;
}
.board4 button:nth-child(4n) { border-right: 0; }
.board4 button:nth-child(4n+2) { border-right: 2.5px solid var(--ink); }
.board4 button:nth-child(n+5):nth-child(-n+8) { border-bottom: 2.5px solid var(--ink); }
.board4 button:nth-child(n+13) { border-bottom: 0; }
.board4 button.given { color: var(--ink); cursor: default; }
.board4 button.peer { background: color-mix(in srgb, var(--blue) 7%, var(--card)); }
.board4 button.sel { background: color-mix(in srgb, var(--blue) 22%, var(--card)); }
.board4 button.bad { color: var(--red); }
.board4 button.won { animation: pop .5s ease both; background: color-mix(in srgb, var(--green) 16%, var(--card)); }
@keyframes pop { 40% { transform: scale(1.14); } }
.pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 14px; }
.pad button {
  font: inherit; font-weight: 800; font-size: 1.4rem; padding: 10px 0; border-radius: 12px; cursor: pointer;
  background: var(--card); color: var(--blue); border: 1px solid var(--line);
}
.pad button:hover { border-color: var(--blue); }
.pad button.erase { font-size: .9rem; color: var(--muted); }
.mini-msg { min-height: 1.6em; margin-top: 12px; text-align: center; font-weight: 800; color: var(--muted); }
.mini-msg.win { color: var(--green); }

/* rules grid */
.rules { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.rule {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: relative;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.rule:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); }
.rule .num { display: inline-block; font-weight: 900; color: var(--blue); background: var(--blue-soft); border-radius: 99px; padding: 2px 10px; font-size: .74rem; }
.rule svg { width: 100%; max-width: 150px; height: auto; margin: 14px auto 16px; display: block; }
.rule h3 { font-size: 1.15rem; font-weight: 900; }
.rule p { color: var(--muted); font-size: .94rem; margin-top: 4px; line-height: 1.45; }
.mb-grid { stroke: var(--line); stroke-width: 1; }
.mb-frame { fill: none; stroke: var(--ink); stroke-width: 3; }
.mb-box { stroke: var(--ink); stroke-width: 2; }
.mb-d { fill: var(--blue); font: 800 17px "Nunito", sans-serif; text-anchor: middle; dominant-baseline: central; }
.mb-g { fill: var(--ink); }
.mb-tint { fill: color-mix(in srgb, var(--blue) 14%, transparent); }
.mb-gold { fill: color-mix(in srgb, var(--gold) 30%, transparent); }
.mb-bg { fill: var(--card); }

/* steps */
.steps { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
.step-list { display: grid; gap: 14px; }
.step { display: flex; gap: 16px; padding: 20px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.step b { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 1.2rem; }
.step h3 { font-size: 1.15rem; font-weight: 900; margin-bottom: 4px; }
.step p { color: var(--muted); font-size: .97rem; }
.shot { border-radius: 30px; overflow: hidden; box-shadow: var(--shadow); border: 8px solid #182240; background: #fff; max-width: 320px; margin: 0 auto; }

/* bento */
.bento { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .bento { grid-template-columns: repeat(6, 1fr); } }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; overflow: hidden; position: relative;
  display: flex; flex-direction: column; gap: 8px;
}
.tile h3 { font-size: 1.3rem; font-weight: 900; }
.tile p { color: var(--muted); }
.tile .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); margin-bottom: 6px; }
.tile .ic svg { width: 24px; height: 24px; }
.tile.blue { background: linear-gradient(150deg, var(--blue), var(--blue-deep)); color: #fff; border: 0; }
.tile.blue p { color: rgba(255, 255, 255, .85); }
.tile.blue .ic { background: rgba(255, 255, 255, .18); color: #fff; }
.tile .peek { margin: 14px -26px -26px auto; width: 78%; max-width: 280px; border-radius: 22px 0 0 0; overflow: hidden; box-shadow: var(--shadow); align-self: flex-end; }
.tile .peek img { width: 100%; height: 260px; object-fit: cover; object-position: top; }
@media (min-width: 760px) {
  .t-hint { grid-column: span 3; grid-row: span 2; }
  .t-daily { grid-column: span 3; grid-row: span 2; }
  .t-a, .t-b, .t-c { grid-column: span 2; }
  .tile .peek img { height: 320px; }
  .t-lang { grid-column: span 6; }
}
.langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.langs span {
  padding: 7px 14px; border-radius: 99px; background: var(--blue-soft); color: var(--blue);
  font-weight: 800; font-size: .95rem; font-family: "Nunito", "Noto Sans", system-ui, sans-serif;
}
.hints { display: grid; gap: 8px; margin-top: 10px; }
.hints div { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .14); font-weight: 700; font-size: .95rem; }
.hints i { font-style: normal; width: 26px; height: 26px; border-radius: 8px; background: #fff; color: var(--blue-deep); display: grid; place-items: center; font-weight: 900; flex: none; }

/* gallery */
.gallery { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 16px 22px; scrollbar-width: thin; }
.gallery figure { margin: 0; flex: none; width: min(240px, 62vw); scroll-snap-align: center; }
.gallery img { border-radius: 24px; border: 6px solid #182240; box-shadow: var(--shadow); background: #fff; }
.gallery figcaption { text-align: center; font-weight: 800; color: var(--muted); font-size: .9rem; margin-top: 10px; }
@media (min-width: 1200px) { .gallery { justify-content: center; flex-wrap: wrap; } .gallery figure { width: 230px; } }

/* faq */
.faq { max-width: 780px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 4px 20px; }
.faq summary { cursor: pointer; list-style: none; font-weight: 800; padding: 16px 30px 16px 0; position: relative; font-size: 1.05rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--blue); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { color: var(--muted); padding: 0 0 18px; }

/* final cta */
.final { padding: 0 0 84px; }
.final .box {
  position: relative; overflow: hidden; border-radius: 32px; padding: 54px 26px; text-align: center; color: #fff;
  background: linear-gradient(140deg, #1677ff, #0a47b3 70%);
}
.final .box::before {
  content: ""; position: absolute; inset: 0; opacity: .14;
  background-image: linear-gradient(#fff 1.5px, transparent 1.5px), linear-gradient(90deg, #fff 1.5px, transparent 1.5px);
  background-size: 60px 60px; mask-image: radial-gradient(circle at 50% 50%, #000, transparent 75%); -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 75%);
}
.final img.icon { width: 88px; height: 88px; border-radius: 22px; margin: 0 auto 18px; position: relative; box-shadow: 0 16px 30px -10px rgba(0, 0, 0, .45); }
.final h2 { font-size: clamp(1.9rem, 4.6vw, 3rem); font-weight: 900; position: relative; }
.final p { opacity: .88; margin: 12px auto 24px; max-width: 30em; position: relative; }
.final .play-badge { display: inline-block; position: relative; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 34px 0 42px; color: var(--muted); font-size: .94rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }
footer a { color: var(--muted); text-decoration: none; font-weight: 700; }
footer a:hover { color: var(--ink); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
