* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f5f5;
  --surface: #fff;
  --text: #222;
  --text-secondary: #555;
  --text-muted: #888;
  --text-faint: #aaa;
  --text-body: #333;
  --text-subtle: #666;
  --link: #333;
  --link-hover: #000;
  --nav-link: #555;
  --nav-link-hover: #111;
  --nav-active: #222;
  --nav-lang: #bbb;
  --shadow-sm: rgba(0,0,0,0.10);
  --shadow-lg: rgba(0,0,0,0.18);
  --store-bg: #111;
  --store-bg-hover: #333;
  --footer-text: #aaa;
  --footer-link: #777;
  --footer-link-hover: #333;
}

[data-theme="dark"] {
  --bg: #111;
  --surface: #1e1e1e;
  --text: #e8e8e8;
  --text-secondary: #aaa;
  --text-muted: #666;
  --text-faint: #444;
  --text-body: #ccc;
  --text-subtle: #999;
  --link: #bbb;
  --link-hover: #fff;
  --nav-link: #aaa;
  --nav-link-hover: #fff;
  --nav-active: #e8e8e8;
  --nav-lang: #555;
  --shadow-sm: rgba(0,0,0,0.4);
  --shadow-lg: rgba(0,0,0,0.55);
  --store-bg: #2c2c2c;
  --store-bg-hover: #3a3a3a;
  --footer-text: #555;
  --footer-link: #777;
  --footer-link-hover: #ccc;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 0 1rem 2rem;
  transition: background 0.2s, color 0.2s;
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }

/* Top nav */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  box-shadow: 0 1px 8px var(--shadow-sm);
  padding: 0 1.5rem;
  margin: 0 -1rem 1.5rem;
  transition: background 0.2s, box-shadow 0.2s;
}
.topnav-inner {
  max-width: 640px;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.topnav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.topnav-brand:hover { color: var(--link-hover); }
.topnav-brand img { width: 28px; height: 28px; border-radius: 6px; }
.topnav-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.875rem;
}
.topnav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.875rem;
}
.topnav-links a { color: var(--nav-link); text-decoration: none; }
.topnav-links a:hover { color: var(--nav-link-hover); }
.topnav-links .active { color: var(--nav-active); font-weight: 600; pointer-events: none; }
.topnav-lang { color: var(--nav-lang); }
.topnav-lang strong { color: var(--nav-active); }
.topnav-lang a { color: var(--nav-link); text-decoration: none; }
.topnav-lang a:hover { color: var(--nav-link-hover); }

/* Hamburger: hidden on desktop, shown ≤600px */
.topnav-burger {
  display: none;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--nav-link);
  line-height: 1;
}
.topnav-burger:hover { color: var(--nav-link-hover); }
.topnav-burger .icon-close { display: none; }
.topnav-burger[aria-expanded="true"] .icon-open { display: none; }
.topnav-burger[aria-expanded="true"] .icon-close { display: inline-flex; }

/* Theme toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--nav-link);
  display: flex;
  align-items: center;
  line-height: 1;
}
.theme-toggle:hover { color: var(--nav-link-hover); }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }

/* Surface card: shared look for content panels */
.container, .hero, .features, .source-note, .highlight-banner {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 2px 12px var(--shadow-sm);
  transition: background 0.2s;
}

/* Privacy policy */
.container {
  padding: 2.5rem 2rem;
  max-width: 720px;
  margin: 0 auto;
}
h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 1.5rem; }
h2 { font-size: 1.15rem; font-weight: 600; margin-top: 1.75rem; margin-bottom: 0.5rem; }
p { line-height: 1.65; margin-bottom: 0.75rem; color: var(--text-body); }
ul { margin: 0.5rem 0 0.75rem 1.5rem; line-height: 1.65; color: var(--text-body); }
li { margin-bottom: 0.3rem; }
.back {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: underline;
}
.back:hover { color: var(--nav-link-hover); }
.effective-date { font-size: 0.85rem; color: var(--text-muted); margin-top: 1.5rem; }

/* Landing page */
.page { max-width: 640px; margin: 0 auto; }

.hero {
  padding: 2rem 2.5rem 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.icon { width: 96px; height: 96px; border-radius: 20px; margin-bottom: 1.25rem; }
.hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.tagline { font-size: 1.05rem; color: var(--text-secondary); margin-bottom: 2rem; line-height: 1.6; }

.store-buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
  justify-content: center;
}
.store-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: var(--store-bg);
  color: #fff;
  text-decoration: none;
  padding: 0.85rem 1.75rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.store-btn:hover { background: var(--store-bg-hover); transform: translateY(-2px); color: #fff; }
.store-btn:active { transform: translateY(0); }
.store-btn-row { display: flex; align-items: center; gap: 0.6rem; font-size: 1.05rem; font-weight: 600; }
.store-btn-platform { font-size: 0.7rem; opacity: 0.7; letter-spacing: 0.04em; }
.store-btn svg { flex-shrink: 0; }

/* Screenshot carousel */
.carousel { position: relative; margin-bottom: 0.5rem; }
.carousel-track {
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide {
  scroll-snap-align: center;
  flex: 0 0 auto;
  height: 540px;
  max-height: 60vh;
  width: auto;
  aspect-ratio: 608 / 1080;
  border-radius: 28px;
  box-shadow: 0 8px 32px var(--shadow-lg);
  transform: scale(0.82);
  opacity: 0.5;
  transition: transform 0.28s ease-out, opacity 0.28s ease-out;
}
.carousel-slide.is-active {
  transform: scale(1);
  opacity: 1;
}
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: var(--text-faint);
  cursor: pointer;
  transition: background 0.2s, width 0.2s;
}
.carousel-dot.active { width: 22px; background: var(--text-secondary); }

/* Arrows: desktop / mouse only */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 10px var(--shadow-lg);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s, transform 0.1s;
  z-index: 2;
}
.carousel-arrow:hover { opacity: 1; }
.carousel-arrow:active { transform: translateY(-50%) scale(0.92); }
.carousel-arrow-prev { left: 0.5rem; }
.carousel-arrow-next { right: 0.5rem; }
@media (hover: hover) and (pointer: fine) {
  .carousel-arrow { display: flex; }
}

.features {
  padding: 2rem 2.5rem;
  margin-bottom: 1.5rem;
}
.features h2 {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  margin-top: 0;
}
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 2rem; }
@media (max-width: 420px) { .feature-grid { grid-template-columns: 1fr; } }
.feature { display: flex; gap: 0.75rem; align-items: flex-start; }
.feature-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; margin-top: 0.1rem; }
.feature-text strong { display: block; font-size: 0.95rem; font-weight: 600; margin-bottom: 0.2rem; }
.feature-text span { font-size: 0.85rem; color: var(--text-subtle); line-height: 1.45; }

.source-note {
  padding: 1.25rem 2rem;
  font-size: 0.88rem;
  color: var(--text-subtle);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  text-align: center;
}

.highlight-banner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
.highlight-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.highlight-icon { font-size: 1.4rem; line-height: 1; }
.highlight-item span { font-size: 0.85rem; font-weight: 600; color: var(--text-body); line-height: 1.35; }
@media (max-width: 420px) { .highlight-banner { flex-direction: column; } }

/* Site footer (multi-column, site-wide) */
.site-footer {
  color: var(--footer-text);
  font-size: 0.85rem;
  margin-top: 3rem;
  padding: 2.5rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border, rgba(128, 128, 128, 0.18));
}
.footer-grid {
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
}
.footer-col h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
  margin: 0 0 0.9rem;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.footer-col a { color: var(--footer-link); text-decoration: none; }
.footer-col a:hover { color: var(--footer-link-hover); text-decoration: underline; }

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--footer-link-hover);
  text-decoration: none;
}
.footer-logo img { width: 28px; height: 28px; border-radius: 6px; }
.footer-tagline { margin: 0.8rem 0 0; line-height: 1.5; max-width: 32ch; }

.footer-store-links { display: flex; flex-direction: column; align-items: stretch; gap: 0.6rem; }
.footer-store-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: var(--store-bg);
  color: #fff !important;
  text-decoration: none !important;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
}
.footer-store-link:hover { background: var(--store-bg-hover); color: #fff !important; transform: translateY(-2px); }
.footer-store-link:active { transform: translateY(0); }
.footer-store-link svg { flex-shrink: 0; }

.footer-bottom {
  max-width: 640px;
  margin: 2.2rem auto 0;
  padding-top: 1.3rem;
  border-top: 1px solid var(--border, rgba(128, 128, 128, 0.18));
  text-align: center;
  color: var(--footer-text);
}
.footer-sep { margin: 0 0.5rem; opacity: 0.5; }

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; text-align: center; }
  .footer-logo { justify-content: center; }
  .footer-tagline { margin-left: auto; margin-right: auto; }
  .footer-store-links { align-items: stretch; max-width: 220px; margin: 0 auto; }
  .footer-bottom .footer-sep { display: none; }
  .footer-bottom span { display: block; margin: 0.2rem 0; }
}

/* FAQ accordion */
.faq-list details {
  border-top: 1px solid var(--text-faint);
  padding: 0.9rem 0;
}
.faq-list details:last-child { border-bottom: 1px solid var(--text-faint); }
.faq-list summary {
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
}
.faq-list details[open] summary::after { content: '−'; }
.faq-list .faq-body {
  font-size: 0.88rem;
  color: var(--text-subtle);
  line-height: 1.6;
  padding-top: 0.6rem;
  margin-bottom: 0;
}
.faq-list .faq-body a { color: var(--link); text-decoration: underline; }

/* Changelog */
.changelog { margin-top: 0.5rem; }
.changelog-entry {
  border-top: 1px solid var(--text-faint);
  padding: 1.5rem 0;
}
.changelog-entry:first-child { border-top: none; padding-top: 0.5rem; }
.changelog-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.changelog-version { font-size: 1.15rem; font-weight: 700; margin: 0; }
.changelog-date { font-size: 0.85rem; color: var(--text-muted); }
.changelog-current {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: #2e9e5b;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}
.changelog-list { list-style: none; margin: 0; padding: 0; }
.changelog-list li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.5;
}
.changelog-tag {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 6px;
  padding: 0.12rem 0.45rem;
  min-width: 4.6rem;
  text-align: center;
}
.tag-new { background: rgba(46,158,91,0.15); color: #2e9e5b; }
.tag-improved { background: rgba(59,130,246,0.15); color: #3b82f6; }
.tag-fixed { background: rgba(234,179,8,0.18); color: #b8860b; }
[data-theme="dark"] .tag-fixed { color: #e0b84a; }

@media (max-width: 600px) {
  /* Nav: collapse links behind the hamburger into a dropdown panel. */
  .topnav { padding: 0 1rem; }
  .topnav-inner { position: relative; }
  .topnav-burger { display: flex; }
  .topnav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    min-width: 170px;
    padding: 1.1rem 1.25rem;
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 4px 16px var(--shadow-lg);
  }
  .topnav-links.open { display: flex; }
}

@media (max-width: 480px) {
  /* Cards: reduce horizontal padding */
  .hero { padding: 1.5rem 1.25rem; }
  .features { padding: 1.5rem 1.25rem; }
  .container { padding: 1.5rem 1.25rem; }
  .source-note { padding: 1rem 1.25rem; }

  /* Store buttons: stack vertically and stretch full width */
  .store-buttons { flex-direction: column; align-items: stretch; }
  .store-btn { justify-content: center; }
}
