/*
  Alliops shared styles, loaded by every page as /css/site.css?v=N.

  firebase.json lets browsers cache CSS and JS for 3 days. When you change this file,
  bump ?v= in every page's <link> so returning visitors get the new version.
  (Quick way: grep -rl "site.css?v=" public | xargs sed -i '' 's/site.css?v=1/site.css?v=2/')

  Page-only styles live next to it: home.css (homepage) and simple-scan.css (Simple Scan page).

  Contents
    1. Tokens (light and dark)
    2. Base
    3. Header
    4. Buttons
    5. Sections
    6. Components: card, icon, checks, tag, store badge
    7. Document pages: support, privacy, and the 404 page
    8. Footer
    9. Motion
*/

/* 1. Tokens ------------------------------------------------------------- */

:root {
  --bg: #ffffff;
  --bg-alt: #f3f7f5;
  --panel: #ffffff;
  --text: #0f1f1b;
  --muted: #55625e;
  --line: #e1e8e5;
  --accent: #0d7a67;
  --accent-soft: #e4f4ed;
  --on-accent: #ffffff;
  --grad: linear-gradient(135deg, #6ccb5f 0%, #3db58a 50%, #17a2a8 100%);
  --grad-text: linear-gradient(110deg, #2e9e57 0%, #0f8f80 55%, #0b7f8f 100%);
  --glow-1: rgba(108, 203, 95, .20);
  --glow-2: rgba(61, 181, 138, .20);
  --glow-3: rgba(23, 162, 168, .18);
  --dot: rgba(15, 31, 27, .07);
  --btn-bg: #0f1f1b;
  --btn-text: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 31, 27, .05), 0 4px 14px rgba(15, 31, 27, .05);
  --shadow-lg: 0 2px 6px rgba(15, 31, 27, .04), 0 28px 56px -16px rgba(15, 31, 27, .22);
  --header-h: 64px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b100f;
    --bg-alt: #101715;
    --panel: #141c1a;
    --text: #eef4f2;
    --muted: #9eaba7;
    --line: #23302c;
    --accent: #4fd1a5;
    --accent-soft: rgba(79, 209, 165, .12);
    --on-accent: #062a22;
    --grad-text: linear-gradient(110deg, #7ad86b 0%, #4fd1a5 50%, #36c2c8 100%);
    --glow-1: rgba(108, 203, 95, .14);
    --glow-2: rgba(61, 181, 138, .16);
    --glow-3: rgba(23, 162, 168, .18);
    --dot: rgba(238, 244, 242, .06);
    --btn-bg: #eef4f2;
    --btn-text: #0b100f;
    --shadow-sm: none;
    --shadow-lg: 0 28px 56px -16px rgba(0, 0, 0, .6);
  }
}

/* 2. Base --------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -0.025em; text-wrap: balance; }
p { margin: 0 0 14px; }
p, li { text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 776px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* 3. Header ------------------------------------------------------------- */

.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
  transition: background-color .25s, border-color .25s;
}
/* Homepage: transparent over the hero until the page scrolls (site.js adds .scrolled). */
.top.overlay:not(.scrolled) {
  background: transparent;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  border-bottom-color: transparent;
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-weight: 800; font-size: 1.2rem; letter-spacing: -0.03em;
}
.brand img { width: 30px; height: 30px; border-radius: 22%; background: #fff; }
.brand img.pad { padding: 3px; border: 1px solid #e6ebe9; }
.brand-dot { width: 12px; height: 12px; border-radius: 4px; background: var(--grad); transform: rotate(45deg); }

.top nav { display: flex; align-items: center; gap: 24px; font-size: .95rem; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.top nav a:hover { color: var(--text); }
.top nav .nav-cta {
  color: var(--btn-text); background: var(--btn-bg);
  padding: 8px 16px; border-radius: 999px; font-weight: 600;
}
.top nav .nav-cta:hover { color: var(--btn-text); opacity: .88; }
@media (max-width: 639px) { .top nav .opt { display: none; } }

/* 4. Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 24px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  transition: transform .2s ease, opacity .2s ease, background-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); }
.btn-primary:hover { opacity: .9; }
.btn-ghost {
  color: var(--text); border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
.btn-ghost:hover { background: var(--panel); }

/* 5. Sections ----------------------------------------------------------- */

.section { padding: 72px 0; }
@media (min-width: 960px) { .section { padding: 112px 0; } }
.alt { background: var(--bg-alt); }

.eyebrow {
  display: inline-block; margin-bottom: 14px;
  color: var(--accent); font-weight: 700; font-size: .8rem;
  letter-spacing: .1em; text-transform: uppercase;
}
.section-head { max-width: 40em; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(2rem, 4.6vw, 3.25rem); font-weight: 800; letter-spacing: -0.035em; margin-bottom: 16px; }
.section-head p { color: var(--muted); font-size: 1.15rem; margin: 0; }

/* 6. Components --------------------------------------------------------- */

.card {
  padding: 28px; border-radius: 24px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.card h3 { font-size: 1.2rem; margin: 20px 0 8px; letter-spacing: -0.02em; }
.card p { color: var(--muted); margin: 0; }

.icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.checks li { position: relative; padding-left: 32px; margin-bottom: 12px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .2em;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-soft);
}
.checks li::after {
  content: ""; position: absolute; left: 7px; top: calc(.2em + 5px);
  width: 5px; height: 9px;
  border: solid var(--accent); border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: .78rem;
}

/* Store badges, 48px tall. */
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 10px; }
.badge { display: block; height: 48px; border-radius: 9px; transition: transform .2s ease; }
.badge:hover { transform: translateY(-2px); }
.badge img { display: block; height: 48px; width: auto; }
/* The Play badge PNG has transparent padding; crop it to match the App Store badge. */
.badge-play { width: 161px; overflow: hidden; border-radius: 8px; }
.badge-play img { height: 71.4px; max-width: none; margin: -11.7px 0 0 -11.7px; }
.store-meta { color: var(--muted); font-size: .92rem; }

/* 7. Document pages ----------------------------------------------------- */

.doc { padding-top: 56px; padding-bottom: 72px; }
@media (min-width: 720px) { .doc { padding-top: 72px; padding-bottom: 96px; } }
.doc h1 { font-size: clamp(2rem, 5.5vw, 2.75rem); font-weight: 800; letter-spacing: -0.035em; margin-bottom: 10px; }
.doc h2 { font-size: 1.3rem; letter-spacing: -0.02em; margin: 44px 0 12px; }
.doc p, .doc ul, .doc ol { margin: 0 0 14px; }
.doc ul { list-style: disc; padding-left: 1.25em; }
.doc ol { list-style: decimal; padding-left: 1.25em; }
.doc li { margin-bottom: 6px; }
.doc li::marker { color: var(--muted); }
.doc-meta { color: var(--muted); margin-bottom: 32px; }

.callout {
  margin-bottom: 8px; padding: 22px 24px 8px;
  border-radius: 20px; background: var(--accent-soft);
}
.callout h2 { margin-top: 0; }

/* FAQ */
.doc details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.doc h2 + details { border-top: 1px solid var(--line); }
.doc summary {
  position: relative; cursor: pointer; list-style: none;
  padding: 12px 32px 12px 0; font-weight: 600;
}
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after {
  content: "+"; position: absolute; right: 4px; top: 9px;
  color: var(--muted); font-weight: 400; font-size: 1.35rem;
}
.doc details[open] summary::after { content: "\2212"; }
.doc summary:hover { color: var(--accent); }
.doc details > div { padding: 0 0 12px; color: var(--muted); }
.doc details > div > :last-child { margin-bottom: 0; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 8px 0 16px; }
.doc table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.doc th, .doc td {
  text-align: left; vertical-align: top;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
}
.doc th { font-weight: 600; }
.doc td:first-child { white-space: nowrap; font-weight: 500; }

/* Not found page (404.html) */
.notfound {
  display: grid; place-items: center; text-align: center;
  min-height: calc(100vh - var(--header-h) - 100px); padding: 64px 0;
}
.notfound .code { font-size: clamp(5rem, 22vw, 9rem); font-weight: 800; letter-spacing: -0.06em; line-height: 1; margin-bottom: 8px; }
.notfound h1 { font-size: clamp(1.6rem, 4vw, 2.25rem); font-weight: 800; margin-bottom: 12px; }
.notfound p:not(.code) { color: var(--muted); font-size: 1.1rem; margin-bottom: 28px; }
.notfound .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* 8. Footer ------------------------------------------------------------- */

.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: .9rem; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); text-decoration: underline; }

/* 9. Motion ------------------------------------------------------------- */

/* Elements with .reveal fade in on scroll. site.js sets the "js" class on <html>, so if the script
   doesn't load, nothing stays hidden. Use .reveal only below the first screen. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
  .js .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
