/* FlavorShelf — shared styles for landing page and legal/support pages.
   Palette mirrors the app's Material 3 "Geometric Balance" theme (see ui/theme/Color.kt). */

/* ---------- Light theme (default) ---------- */
:root {
  color-scheme: light;
  --bg: #fdf8f6;          /* GeoBackgroundLight */
  --bg-alt: #f3edf7;      /* GeoSurfaceVariantLight */
  --surface: #ffffff;     /* GeoSurfaceLight */
  --text: #1c1b1f;        /* GeoOnSurfaceLight */
  --text-muted: #49454f;  /* GeoOnSurfaceVariantLight */
  --border: #e2dbe8;      /* soft outline */
  --accent: #6750a4;      /* GeoPrimaryLight */
  --accent-strong: #574191;
  --accent-soft: #e8def8; /* GeoSecondaryLight */
  --on-accent: #ffffff;
  --icon-bg: #1e1b2e;     /* app icon background */
  --shadow: 0 1px 2px rgba(28, 27, 31, 0.05), 0 8px 24px rgba(103, 80, 164, 0.08);
  --radius: 16px;
  --maxw: 960px;
}

/* Dark theme — applied when user picks it explicitly ... */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1f1a1d;          /* GeoBackgroundDark */
  --bg-alt: #17131a;
  --surface: #2b2529;     /* GeoSurfaceDark */
  --text: #eaddff;        /* GeoOnSurfaceDark */
  --text-muted: #cac4d0;  /* GeoOnSurfaceVariantDark */
  --border: #3a3340;
  --accent: #d0bcff;      /* GeoPrimaryDark */
  --accent-strong: #e0d0ff;
  --accent-soft: #3b2e4a; /* GeoPrimaryContainerDark */
  --on-accent: #381e72;   /* GeoOnPrimaryDark */
  --icon-bg: #1e1b2e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* ... or when the system is dark and the user hasn't forced light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1f1a1d;
    --bg-alt: #17131a;
    --surface: #2b2529;
    --text: #eaddff;
    --text-muted: #cac4d0;
    --border: #3a3340;
    --accent: #d0bcff;
    --accent-strong: #e0d0ff;
    --accent-soft: #3b2e4a;
    --on-accent: #381e72;
    --icon-bg: #1e1b2e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Site header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; display: block; }
.nav-right { display: flex; align-items: center; gap: 1.4rem; }
.nav-links { display: flex; gap: 1.4rem; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }
.nav-links a:hover { color: var(--accent-strong); text-decoration: none; }

/* Theme toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

@media (max-width: 560px) {
  .nav-links { gap: 1rem; }
  .nav-right { gap: 1rem; }
  .nav-links a.nav-hide-sm { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 4.5rem 0 3.5rem;
  background:
    radial-gradient(60% 60% at 50% 0%, var(--accent-soft) 0%, transparent 70%);
}
.hero .app-icon {
  width: 104px; height: 104px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  margin: 0 auto 1.5rem;
  display: block;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.1;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}
.hero .tagline {
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  color: var(--text-muted);
  margin: 0 auto 2rem;
  max-width: 34ch;
}
.badges { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }
.badges img { height: 56px; width: auto; }
.badge-link { display: inline-block; transition: transform 0.15s ease; }
.badge-link:hover { transform: translateY(-2px); text-decoration: none; }

/* ---------- Feature grid ---------- */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section h2.section-title {
  text-align: center;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
.section .section-sub {
  text-align: center;
  color: var(--text-muted);
  margin: 0 auto 2.5rem;
  max-width: 48ch;
}
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.feature .icon {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1rem;
}
:root[data-theme="dark"] .feature .icon { color: var(--accent); }
.feature .icon svg { width: 24px; height: 24px; }
.feature h3 { margin: 0 0 0.4rem; font-size: 1.12rem; }
.feature p { margin: 0; color: var(--text-muted); font-size: 0.97rem; }

/* ---------- CTA ---------- */
.cta { text-align: center; padding: 4rem 0; }
.cta h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); margin: 0 0 0.6rem; }
.cta p { color: var(--text-muted); margin: 0 auto 2rem; max-width: 42ch; }

/* ---------- Content pages (privacy / terms / faq) ---------- */
.doc { padding: 3rem 0 4rem; }
.doc h1 { font-size: clamp(1.9rem, 4vw, 2.4rem); margin: 0 0 0.25rem; letter-spacing: -0.01em; }
.doc .meta { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 2rem; }
.doc h2 { font-size: 1.3rem; margin-top: 2.25rem; }
.doc h3 { font-size: 1.08rem; margin-top: 1.75rem; }
.doc ul { padding-left: 1.25rem; }
.doc li { margin: 0.3rem 0; }
.doc code {
  background: var(--accent-soft);
  color: var(--text);
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  font-size: 0.9em;
}
.doc .lead { font-size: 1.05rem; }

/* FAQ specifics */
.faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin: 0.75rem 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .answer { padding: 0 1.25rem 1.25rem; color: var(--text-muted); }
.faq-item .answer p:first-child { margin-top: 0; }
.faq-cat { margin: 2.5rem 0 0.5rem; font-size: 1.3rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 2.5rem 0;
  margin-top: 2rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}
.site-footer .made { color: var(--text-muted); font-size: 0.9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--accent-strong); text-decoration: none; }
.copyright {
  width: 100%;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 0.5rem;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: background 0.15s ease, transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); filter: brightness(1.05); }
