:root {
  --bg: #ffffff;
  --surface: #f8f9fa;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e7eb;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --border: #334155;
  }

  body {
    background: var(--bg);
  }
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #F8F7FF 0%, #F0EFFE 50%, #E8F9F4 100%) fixed;
  min-height: 100vh;
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
}

/* Language visibility — default: show EN, hide VI */
.vi { display: none; }
.lang-vi .vi { display: inline; }
.lang-vi .en { display: none; }

.back-link {
  margin-right: auto;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Floating language switcher / back link (not inside a header) */
body > .lang-switcher,
body > .back-link {
  position: fixed;
  top: 1rem;
  z-index: 10;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(60, 60, 90, 0.08);
}

body > .lang-switcher {
  right: 1rem;
}

body > .back-link {
  left: 1rem;
  display: flex;
  align-items: center;
  line-height: 1.9;
}

.lang-switcher button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  transition: color 0.15s, background-color 0.15s;
}

.lang-switcher button:hover {
  color: var(--accent);
  background-color: var(--surface);
}

.lang-switcher button.active {
  color: var(--accent);
  font-weight: 700;
}

/* Main content */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 3.75rem 1.5rem 4rem;
}

h1 {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.last-updated {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2.5rem;
}

section {
  margin-bottom: 2rem;
}

h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

p {
  margin-bottom: 0.75rem;
  color: var(--text);
}

ul {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

li {
  margin-bottom: 0.5rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
}

footer p {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-bottom: 0;
}

/* Mobile */
@media (max-width: 480px) {
  main {
    padding: 2rem 1.25rem 3rem;
  }

  h1 {
    font-size: 1.375rem;
  }
}

/* Landing page */
.hero {
  text-align: center;
  padding: 1rem 0 2.5rem;
}

.hero .logo {
  width: 128px;
  height: 128px;
  margin-bottom: 1rem;
  border-radius: 22%;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(60, 60, 90, 0.18), 0 4px 10px rgba(60, 60, 90, 0.1);
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  border-bottom: none;
  padding-bottom: 0;
}

.hero .tagline {
  color: var(--text-muted);
  font-size: 1.0625rem;
  margin-bottom: 2rem;
}

.store-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.store-button {
  display: inline-flex;
  align-items: center;
  transition: opacity 0.15s;
}

.store-button:hover {
  opacity: 0.8;
}

.store-button img {
  height: 48px;
  width: 144px;
  object-fit: contain;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.feature-card {
  padding: 1.25rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feature-card .icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 480px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }

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