/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* === Variables === */
:root {
  --color-primary: #4A90D9;
  --color-primary-dark: #357ABD;
  --color-green: #27AE60;
  --color-purple: #9B59B6;
  --color-yellow: #F1C40F;
  --color-bg: #F8F9FF;
  --color-surface: #FFFFFF;
  --color-text: #191C20;
  --color-muted: #44474E;
  --color-outline: #74777F;
  --color-footer-bg: #111318;
  --color-footer-text: #E1E2E9;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --max-width: 1100px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --radius: 12px;
}

/* === Typography === */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

h1, h2, h3, h4 { line-height: 1.2; }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; }

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

img { max-width: 100%; height: auto; }

/* === Skip link === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 4px;
  z-index: 1000;
}

.skip-link:focus {
  top: 1rem;
}

/* === Nav === */
.nav {
  position: sticky;
  top: 0;
  background: var(--color-surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  z-index: 100;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-text);
  text-decoration: none;
}

.nav-brand img {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--color-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--color-text);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* === Language switcher === */
.lang-switcher {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--color-outline);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-muted);
  cursor: pointer;
  transition: border-color 0.15s;
}

.lang-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

.lang-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-radius: 8px;
  box-shadow: var(--shadow);
  list-style: none;
  min-width: 140px;
  overflow: hidden;
  z-index: 50;
}

.lang-dropdown.open {
  display: block;
}

.lang-dropdown a {
  display: block;
  padding: 8px 16px;
  color: var(--color-text);
  font-size: 0.875rem;
  transition: background 0.1s;
}

.lang-dropdown a:hover {
  background: var(--color-bg);
  text-decoration: none;
}

.lang-dropdown a[aria-current="true"] {
  font-weight: 600;
  color: var(--color-primary);
}

/* === Hero === */
.hero {
  background: linear-gradient(135deg, #2C5F9B 0%, #4A90D9 50%, #357ABD 100%);
  color: #FFFFFF;
  text-align: center;
  padding: 5rem 1.5rem;
}

.hero-inner {
  max-width: 700px;
  margin: 0 auto;
}

.hero-icon {
  width: 96px;
  height: 96px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

.btn-primary {
  background: #FFFFFF;
  color: var(--color-primary-dark);
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-right: 0.4em;
}

/* === Google Play badge === */
.play-badge {
  display: inline-block;
  transition: transform 0.15s;
}

.play-badge:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.play-badge img {
  display: block;
  height: 78px;
  width: auto;
}

.btn-secondary {
  background: transparent;
  color: #FFFFFF;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.btn-secondary:hover {
  border-color: #FFFFFF;
}

/* Inside non-hero sections, primary button uses brand colour */
.cta .btn-primary,
.error-page .btn-primary {
  background: var(--color-primary);
  color: #FFFFFF;
}

/* === Section layout === */
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Features === */
.features {
  padding: 5rem 0;
  background: var(--color-bg);
}

.features h2 {
  text-align: center;
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--color-muted);
  font-size: 0.9375rem;
}

/* === How It Works === */
.how-it-works {
  padding: 5rem 0;
  background: var(--color-surface);
}

.how-it-works h2 {
  text-align: center;
  margin-bottom: 3rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #FFFFFF;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.step h3 {
  margin-bottom: 0.5rem;
}

.step p {
  color: var(--color-muted);
  font-size: 0.9375rem;
}

/* === CTA === */
.cta {
  padding: 5rem 0;
  background: var(--color-bg);
  text-align: center;
}

.cta h2 {
  margin-bottom: 1rem;
}

.cta p {
  color: var(--color-muted);
  margin-bottom: 2rem;
  font-size: 1.0625rem;
}

/* === Page content (single pages) === */
.page {
  padding: 3rem 0 5rem;
}

.page-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-inner h1 {
  margin-bottom: 2rem;
}

.page-inner h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.page-inner h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.page-inner p {
  margin-bottom: 1rem;
  color: var(--color-text);
}

.page-inner ul, .page-inner ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.page-inner li {
  margin-bottom: 0.25rem;
}

.page-inner a {
  color: var(--color-primary);
}

/* === Changelog timeline === */
.changelog-entry {
  margin-bottom: 2.5rem;
  padding-left: 1.5rem;
  border-left: 3px solid var(--color-primary);
}

.changelog-entry h2 {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.version-badge {
  display: inline-block;
  background: var(--color-primary);
  color: #FFFFFF;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 700;
}

.version-date {
  font-size: 0.875rem;
  color: var(--color-muted);
  font-weight: 400;
}

.changelog-entry ul {
  margin-top: 0.5rem;
}

/* === FAQ accordion === */
details {
  margin-bottom: 0.75rem;
  border: 1px solid var(--color-outline);
  border-radius: 8px;
  overflow: hidden;
}

details[open] {
  border-color: var(--color-primary);
}

summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.1s;
}

summary:hover {
  background: var(--color-bg);
}

summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--color-muted);
  flex-shrink: 0;
  margin-left: 1rem;
  transition: transform 0.2s;
}

details[open] summary::after {
  content: "\2212";
}

summary::-webkit-details-marker {
  display: none;
}

details > div {
  padding: 0 1.25rem 1rem;
}

details p, details ul {
  color: var(--color-muted);
  font-size: 0.9375rem;
}

/* === Footer === */
.footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 3rem 0 0;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  color: rgba(225, 226, 233, 0.7);
  font-size: 0.9375rem;
}

.footer-col h4 {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(225, 226, 233, 0.5);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: var(--color-footer-text);
  font-size: 0.9375rem;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: #FFFFFF;
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid rgba(225, 226, 233, 0.1);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.footer-bottom p {
  font-size: 0.8125rem;
  color: rgba(225, 226, 233, 0.5);
}

/* === 404 === */
.error-page {
  padding: 6rem 0;
  text-align: center;
}

.error-page h1 {
  font-size: 6rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.error-page p {
  font-size: 1.25rem;
  color: var(--color-muted);
  margin-bottom: 2rem;
}

/* === Responsive === */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.75rem 0;
    width: 100%;
  }

  .lang-switcher {
    padding: 0.75rem 0;
  }

  .hero {
    padding: 3rem 1.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .features-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}
