/* Apex Sudoku website. Mirrors the app: Inter, the Classic blue theme, soft cards. */

@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter_700Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #f4f4f6;
  --surface: #ffffff;
  --text: #1b1b1f;
  --text-2: #5f5f67;
  --line: rgba(0, 0, 0, 0.08);
  --accent: #2563eb;
  --accent-soft: #e4ecfd;
  --brand-1: #2f86f2;
  --brand-2: #1250c4;
  --brand-3: #0a2c82;
  --radius: 22px;
  --max: 1080px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0e;
    --surface: #1a1a1d;
    --text: #f4f4f6;
    --text-2: #a3a3ab;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #6b9bff;
    --accent-soft: #1d2a47;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--surface);
  padding: 8px 14px;
  border-radius: 10px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  width: 32px;
  height: 32px;
}
.site-nav {
  display: flex;
  gap: 24px;
}
.site-nav a {
  color: var(--text-2);
  font-weight: 600;
  font-size: 15px;
}
.site-nav a[aria-current='page'],
.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2) 55%, var(--brand-3));
  color: #fff;
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 48px;
  padding-top: 72px;
  padding-bottom: 0;
}
.hero-icon {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.3));
}
.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 24px 0 16px;
}
.hero p.lead {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.86);
  margin: 0 0 32px;
  max-width: 30em;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 72px;
}
.badge {
  display: inline-flex;
  flex-direction: column;
  padding: 10px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  line-height: 1.25;
}
.badge small {
  font-size: 12px;
  opacity: 0.8;
}
.badge strong {
  font-size: 17px;
}
.hero-phones {
  position: relative;
  height: 560px;
  align-self: end;
}
.phone {
  position: absolute;
  width: 250px;
  border-radius: 34px;
  border: 6px solid #0b1430;
  box-shadow: 0 30px 60px rgba(4, 16, 54, 0.45);
  background: #0b1430;
}
.phone img {
  display: block;
  width: 100%;
  border-radius: 28px;
}
.hero-phones .phone:nth-child(1) {
  left: 0;
  top: 90px;
  transform: rotate(-6deg);
}
.hero-phones .phone:nth-child(2) {
  left: 50%;
  margin-left: -125px;
  top: 30px;
  z-index: 2;
}
.hero-phones .phone:nth-child(3) {
  right: 0;
  top: 90px;
  transform: rotate(6deg);
}

/* Sections */
section {
  padding: 88px 0;
}
.section-title {
  font-size: clamp(30px, 4vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 12px;
}
.section-lead {
  color: var(--text-2);
  font-size: 19px;
  margin: 0 0 48px;
  max-width: 36em;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
}
.card h3 {
  font-size: 19px;
  margin: 16px 0 6px;
}
.card p {
  margin: 0;
  color: var(--text-2);
  font-size: 16px;
}
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.card-icon svg {
  width: 24px;
  height: 24px;
}

.levels {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.level {
  background: var(--surface);
  border-radius: 16px;
  padding: 16px;
}
.level strong {
  display: block;
  font-size: 16px;
}
.level span {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.4;
  display: block;
  margin-top: 4px;
}
.pips {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  margin-bottom: 10px;
}
.pips i {
  width: 4px;
  border-radius: 2px;
  background: var(--line);
}
.pips i.on {
  background: var(--accent);
}

.gallery {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px 24px 24px;
  margin: 0 -24px;
}
.gallery figure {
  flex: 0 0 240px;
  margin: 0;
  scroll-snap-align: center;
}
.gallery img {
  width: 100%;
  border-radius: 28px;
  border: 1px solid var(--line);
  display: block;
}
.gallery figcaption {
  text-align: center;
  color: var(--text-2);
  font-size: 15px;
  margin-top: 12px;
}

.private {
  background: var(--surface);
}
.private-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.private-grid h3 {
  font-size: 18px;
  margin: 12px 0 4px;
}
.private-grid p {
  margin: 0;
  color: var(--text-2);
  font-size: 16px;
}

/* Text pages (support, privacy) */
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}
.page h1 {
  font-size: clamp(34px, 5vw, 48px);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 12px;
}
.page .meta {
  color: var(--text-2);
  margin: 0 0 40px;
}
.page h2 {
  font-size: 24px;
  letter-spacing: -0.01em;
  margin: 48px 0 12px;
}
.page h3 {
  font-size: 18px;
  margin: 28px 0 6px;
}
.page p,
.page li {
  color: var(--text);
}
.page ul {
  padding-left: 22px;
}
.page li {
  margin: 6px 0;
}

.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 8px 0 8px;
}
.contact p {
  margin: 0;
  color: var(--text-2);
}
.contact strong {
  display: block;
  color: var(--text);
  font-size: 19px;
}
.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 14px;
}
.button:hover {
  text-decoration: none;
  filter: brightness(1.08);
}

.faq details {
  background: var(--surface);
  border-radius: 16px;
  padding: 4px 22px;
  margin: 10px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 16px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  color: var(--text-2);
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
}
.faq details[open] summary::after {
  content: '–';
}
.faq details p {
  margin: 0 0 18px;
  color: var(--text-2);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
  color: var(--text-2);
  font-size: 15px;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.site-footer a {
  color: var(--text-2);
}

/* Mobile menu. The button only appears when JavaScript is running (html.js);
   without it, the links stay inline. */
.menu-button {
  display: none;
}

@media (max-width: 640px) {
  .js .menu-button {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 12px;
    color: var(--text);
    cursor: pointer;
  }
  .js .menu-button:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
  }
  .menu-button span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .menu-open .menu-button span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .menu-open .menu-button span:nth-child(2) {
    opacity: 0;
  }
  .menu-open .menu-button span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .js .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    padding: 8px 16px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.08);
  }
  .js .menu-open .site-nav {
    display: flex;
  }
  .js .site-nav a {
    color: var(--text);
    font-size: 19px;
    padding: 14px 12px;
    border-radius: 12px;
  }
  .js .site-nav a[aria-current='page'] {
    color: var(--accent);
    background: var(--accent-soft);
  }
}

@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  .menu-button span {
    transition: none;
  }
}

/* Wide screens: show every screenshot at once, three per row. */
@media (min-width: 901px) {
  .gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 260px));
    justify-content: center;
    gap: 40px 48px;
    overflow: visible;
    margin: 0;
    padding: 8px 0 0;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 56px;
  }
  .hero p.lead {
    margin-left: auto;
    margin-right: auto;
  }
  .badges {
    justify-content: center;
    padding-bottom: 8px;
  }
  .hero-phones {
    height: 440px;
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
  }
  .phone {
    width: 190px;
    border-radius: 28px;
  }
  .phone img {
    border-radius: 22px;
  }
  .hero-phones .phone:nth-child(2) {
    margin-left: -95px;
  }
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
  .levels {
    grid-template-columns: repeat(3, 1fr);
  }
  .private-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .site-nav {
    gap: 16px;
  }
  section {
    padding: 64px 0;
  }
  .hero-phones {
    height: 340px;
  }
  .phone {
    width: 150px;
    border-width: 4px;
    border-radius: 22px;
  }
  .phone img {
    border-radius: 18px;
  }
  .hero-phones .phone:nth-child(1),
  .hero-phones .phone:nth-child(3) {
    top: 60px;
  }
  .hero-phones .phone:nth-child(2) {
    margin-left: -75px;
    top: 20px;
  }
  .features,
  .private-grid {
    grid-template-columns: 1fr;
  }
  .levels {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery figure {
    flex-basis: 200px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
