:root {
  color-scheme: light;
  --bg: #F5F3FF;
  --surface: #FFFFFF;
  --border: #E0E7FF;
  --text: #1E1B4B;
  --text-dim: #475569;
  --accent: #6366F1;
  --accent-hover: #4F46E5;
  --on-accent: #FFFFFF;
  --cta: #047857;
  --cta-hover: #059669;
  --on-cta: #FFFFFF;
  --muted: #EBEFF9;
  --header-bg: rgba(245, 243, 255, 0.85);
  --glow: rgba(99, 102, 241, 0.14);
  --accent-soft: rgba(99, 102, 241, 0.09);
  --shadow-sm: 0 1px 2px rgba(30, 27, 75, 0.06);
  --shadow-md: 0 4px 12px rgba(30, 27, 75, 0.08);
  --shadow-lg: 0 12px 28px rgba(30, 27, 75, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0F0F1A;
    --surface: #191927;
    --border: #2C2C44;
    --text: #E6E6F5;
    --text-dim: #A0A3C4;
    --accent: #818CF8;
    --accent-hover: #A5B4FC;
    --on-accent: #0F0F1A;
    --cta: #34D399;
    --cta-hover: #6EE7B7;
    --on-cta: #052E22;
    --muted: #22223A;
    --header-bg: rgba(15, 15, 26, 0.85);
    --glow: rgba(129, 140, 248, 0.15);
    --accent-soft: rgba(129, 140, 248, 0.1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.45);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

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

body {
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo, .btn, .badge {
  font-family: "Poppins", "Open Sans", -apple-system, sans-serif;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

a, [role="button"] { touch-action: manipulation; }

/* Scroll-reveal entrance (JS adds .reveal/.in; no-JS stays visible) */
.reveal {
  opacity: 0;
  transform: translateY(10px);
}

.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.nav {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.nav-link:hover { color: var(--text); }

/* Hero */
.hero {
  max-width: 700px;
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
  text-align: center;
  background: radial-gradient(ellipse 70% 55% at 50% 0%, var(--glow), transparent 70%);
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.tagline {
  font-size: 1.2rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--cta);
  color: var(--on-cta);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--cta-hover);
  box-shadow: var(--shadow-md);
}

/* Apps section */
.apps {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.apps h2, .about h2 {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  text-align: center;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.app-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.app-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.app-card:active { transform: translateY(-1px); }

.app-card:focus-within {
  border-color: var(--accent);
}

.card-stretch {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.app-icon-img {
  width: calc(100% + 3.5rem);
  max-width: none;
  height: auto;
  aspect-ratio: 1;
  margin: -2rem -1.75rem 0;
  border-radius: 12px 12px 0 0;
  object-fit: cover;
}

.app-card h3 { font-size: 1.25rem; }

.app-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
  flex-grow: 1;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.app-domain {
  position: relative;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.app-domain:hover { text-decoration: underline; }

/* Store page */
.store-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.store-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.store-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}

.store-title { flex: 1; min-width: 200px; }

.store-title h1 { font-size: clamp(1.5rem, 4vw, 2rem); }

.store-dev {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.store-dev:hover { text-decoration: underline; }

.btn-muted {
  background: var(--muted);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.screenshots {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 2rem 0 1.25rem;
  scroll-snap-type: x proximity;
}

.screenshots::-webkit-scrollbar { height: 8px; }
.screenshots::-webkit-scrollbar-track { background: transparent; }
.screenshots::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.shot {
  flex: 0 0 150px;
  aspect-ratio: 9 / 19;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  scroll-snap-align: start;
}

img.shot {
  min-width: 0;
  border-style: solid;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

/* Screenshot lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  cursor: zoom-out;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.store-section { padding: 1rem 0; }

.store-section h2 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.store-section p {
  color: var(--text-dim);
  max-width: 65ch;
}

.details { display: grid; }

.details > div {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.details dt {
  width: 110px;
  flex-shrink: 0;
  color: var(--text-dim);
}

.details dd { margin: 0; }

.details a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Privacy policy */
.policy-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.policy-hero {
  text-align: center;
  padding: 1rem 0 2.5rem;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, var(--glow), transparent 70%);
}

.policy-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-md);
}

.policy-eyebrow {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.policy-hero h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0.25rem 0 0.75rem;
}

.policy-lede {
  color: var(--text-dim);
  font-size: 1.1rem;
  margin-bottom: 1.75rem;
}

.policy-meta {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 2rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
}

.policy-meta div { display: flex; gap: 0.4rem; }
.policy-meta dt { color: var(--text-dim); }
.policy-meta dd { margin: 0; }

.policy-highlights {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.policy-highlights li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: var(--shadow-sm);
}

.policy-highlights span {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.policy-toc {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.policy-toc h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

.policy-toc ol {
  columns: 2 220px;
  column-gap: 2rem;
  padding-left: 1.25rem;
  color: var(--text-dim);
}

.policy-toc li { padding: 0.15rem 0; break-inside: avoid; }

.policy-toc a {
  color: var(--text);
  text-decoration: none;
}

.policy-toc a:hover { color: var(--accent); }

.policy-body > p {
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.policy-body section {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 5rem;
}

.policy-body h2 {
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
}

.policy-body section p {
  color: var(--text-dim);
}

.policy-body section p + p { margin-top: 0.75rem; }

.policy-body a,
.site-footer a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.policy-body code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9em;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
}

.policy-note {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
  color: var(--text) !important;
}

/* About */
.about {
  max-width: 700px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  text-align: center;
}

.about p { color: var(--text-dim); }

.about a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}
