/* ─── SudoQ landing page ──────────────────────────────────────── */
:root {
  --primary: #5558a8;
  --primary-dark: #43457f;
  --primary-light: #eef0ff;
  --accent: #f59e0b;
  --text: #0f172a;
  --text-muted: #64748b;
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --border: #e2e8f0;
  --card: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --shadow: 0 4px 14px -2px rgb(15 23 42 / 0.08), 0 2px 4px -2px rgb(15 23 42 / 0.04);
  --shadow-lg: 0 24px 48px -12px rgb(85 88 168 / 0.25);
  --radius: 14px;
  --radius-sm: 8px;
  --container: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --bg: #0b1020;
    --bg-subtle: #111838;
    --border: #1e2a52;
    --card: #141b38;
    --primary-light: #1a2050;
    --shadow: 0 4px 14px -2px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
    --shadow-lg: 0 24px 48px -12px rgb(85 88 168 / 0.5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Inter", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ─── Header ──────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.brand-name {
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}
.nav {
  display: flex;
  gap: 28px;
}
.nav a {
  font-size: 0.94rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.15s;
}
.nav a:hover { color: var(--text); }
@media (max-width: 560px) {
  .nav { gap: 18px; }
  .nav a:first-child { display: none; }
}

/* ─── Hero ────────────────────────────────── */
.hero {
  padding: 72px 0 96px;
  background:
    radial-gradient(ellipse at top left, color-mix(in srgb, var(--primary) 12%, transparent), transparent 60%),
    radial-gradient(ellipse at bottom right, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero { padding: 48px 0 64px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}
h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
  font-weight: 800;
}
h1 .accent {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0 0 28px;
  max-width: 520px;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-subtle); }
.btn-lg {
  padding: 16px 28px;
  font-size: 1.05rem;
}

.stats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
}
.stats li {
  display: flex;
  flex-direction: column;
}
.stats strong {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
}
.stats span {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Hero art: phone frame with Sudoku grid ─── */
.hero-art {
  display: flex;
  justify-content: center;
  align-items: center;
}
.phone {
  width: 280px;
  aspect-ratio: 9 / 18;
  background: var(--card);
  border: 8px solid #1a1a1a;
  border-radius: 40px;
  box-shadow: var(--shadow-lg);
  padding: 24px 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 18px;
  background: #1a1a1a;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}
.sudoku-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  aspect-ratio: 1;
  background: var(--border);
  border: 2px solid var(--text);
  border-radius: 6px;
  overflow: hidden;
  gap: 1px;
}
.cell {
  background: var(--card);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  aspect-ratio: 1;
}
.cell.filled {
  color: var(--text);
  background: var(--bg-subtle);
}
.cell.selected {
  background: color-mix(in srgb, var(--primary) 20%, var(--card));
  color: var(--primary);
  box-shadow: inset 0 0 0 2px var(--primary);
}
/* thicker lines on 3x3 box borders using nth-child */
.cell:nth-child(3n):not(:nth-child(9n)) { border-right: 2px solid var(--text); }
.cell:nth-child(n+19):nth-child(-n+27),
.cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--text); }

/* ─── Section shared ──────────────────────── */
section { padding: 88px 0; }
@media (max-width: 720px) { section { padding: 56px 0; } }
.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}
.section-head h2,
.duels-copy h2,
.download-inner h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: -0.025em;
  margin: 0 0 12px;
  font-weight: 800;
}
.section-head p { color: var(--text-muted); margin: 0; font-size: 1.1rem; }

/* ─── Features grid ───────────────────────── */
.features { background: var(--bg-subtle); }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
}
.feature {
  background: var(--card);
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}
.feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--tint, var(--primary)) 12%, transparent);
  color: var(--tint, var(--primary));
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
.feature-icon svg { width: 24px; height: 24px; }
.feature h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
  font-weight: 700;
}
.feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ─── Duels section ───────────────────────── */
.duels {
  background:
    radial-gradient(ellipse at bottom left, color-mix(in srgb, var(--primary) 8%, transparent), transparent 60%);
}
.duels-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 900px) {
  .duels-inner { grid-template-columns: 1fr; gap: 40px; }
}
.duels-copy p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 24px;
}
.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}
.checklist li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 14px;
  font-size: 1rem;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235558a8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

.rank-tower {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rank {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: white;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}
.rank i { font-style: normal; opacity: 0.85; font-size: 0.82rem; }
.rank.champion { background: linear-gradient(135deg, #a855f7, #ec4899); }
.rank.grandmaster { background: linear-gradient(135deg, #dc2626, #f97316); }
.rank.master { background: linear-gradient(135deg, #f59e0b, #eab308); }
.rank.diamond { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.rank.platinum { background: linear-gradient(135deg, #10b981, #06b6d4); }
.rank.gold { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #1f2937; }
.rank.silver { background: linear-gradient(135deg, #94a3b8, #cbd5e1); color: #1f2937; }
.rank.bronze { background: linear-gradient(135deg, #b45309, #d97706); }

/* ─── Download CTA ───────────────────────── */
.download {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  text-align: center;
}
.download-inner { max-width: 640px; margin: 0 auto; }
.download-inner h2 { color: white; }
.download-inner p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  margin: 0 0 28px;
}
.download-inner .btn-primary {
  background: white;
  color: var(--primary);
}
.download-inner .btn-primary:hover {
  background: #f1f5f9;
}
.download-inner .small {
  margin-top: 20px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.7);
}

/* ─── Footer ─────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  background: var(--bg);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.94rem;
}
.footer-brand .muted {
  color: var(--text-muted);
  margin-left: 6px;
  font-weight: 400;
}
.footer-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-nav a {
  color: var(--text-muted);
  font-size: 0.92rem;
  transition: color 0.15s;
}
.footer-nav a:hover { color: var(--text); }
