/* StackStats Apps — site styles (hand-written, no runtime CSS framework).
   Theme follows the OS (prefers-color-scheme). The header toggle stores an
   explicit override in localStorage ('ss-theme'); "system" clears it. */
:root{
  --bg:#f7f8fa; --bg-2:#ffffff; --surface:#ffffff; --surface-2:#f1f3f6;
  --border:#e3e7ed; --text:#0f172a; --text-2:#334155; --muted:#475569;
  --accent:#b4532a; --accent-ink:#ffffff; --accent-soft:rgba(180,83,42,.10);
  --link:#9a4422; --focus:#2563eb;
  --shadow:0 1px 2px rgba(15,23,42,.06),0 8px 24px rgba(15,23,42,.06);
  --radius:14px; --radius-lg:22px; --max:1120px; --nav-h:64px;
  --font:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --font-display:-apple-system,BlinkMacSystemFont,"SF Pro Display","Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#0b1220; --bg-2:#0f172a; --surface:#111a2b; --surface-2:#172235;
    --border:#243149; --text:#f1f5f9; --text-2:#cbd5e1; --muted:#94a3b8;
    --accent:#e07a4b; --accent-ink:#0b1220; --accent-soft:rgba(224,122,75,.14);
    --link:#f0a57f; --focus:#60a5fa; --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px rgba(0,0,0,.35);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#0b1220; --bg-2:#0f172a; --surface:#111a2b; --surface-2:#172235;
  --border:#243149; --text:#f1f5f9; --text-2:#cbd5e1; --muted:#94a3b8;
  --accent:#e07a4b; --accent-ink:#0b1220; --accent-soft:rgba(224,122,75,.14);
  --link:#f0a57f; --focus:#60a5fa; --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px rgba(0,0,0,.35);
  color-scheme:dark;
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-padding-top:calc(var(--nav-h) + 12px)}
body{margin:0;font-family:var(--font);background:var(--bg);color:var(--text);line-height:1.6;font-size:16px;-webkit-font-smoothing:antialiased}
img{max-width:100%;height:auto;display:block}
a{color:var(--link);text-underline-offset:2px}
a:hover{text-decoration:underline}
:focus-visible{outline:3px solid var(--focus);outline-offset:2px;border-radius:6px}
h1,h2,h3{font-family:var(--font-display);line-height:1.15;letter-spacing:-.015em;color:var(--text);margin:0 0 .5em}
h1{font-size:clamp(2rem,4.6vw,3.25rem);font-weight:750}
h2{font-size:clamp(1.4rem,2.6vw,2rem);font-weight:700}
h3{font-size:1.125rem;font-weight:650}
p{margin:0 0 1em;color:var(--text-2)}
.container{width:100%;max-width:var(--max);margin:0 auto;padding:0 24px}
.narrow>*{max-width:760px}
.skip{position:absolute;left:-999px;top:8px;background:var(--surface);color:var(--text);padding:8px 14px;border-radius:8px;z-index:200}
.skip:focus{left:12px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Header */
.site-header{position:sticky;top:0;z-index:100;background:var(--bg-2);border-bottom:1px solid var(--border)}
.site-header .bar{display:flex;align-items:center;gap:20px;height:var(--nav-h)}
.brand{display:flex;align-items:center;gap:10px;font-family:var(--font-display);font-weight:750;font-size:1.06rem;color:var(--text);text-decoration:none;letter-spacing:-.01em}
.brand:hover{text-decoration:none}
.brand-mark{width:28px;height:28px;border-radius:8px;background:linear-gradient(135deg,#1e293b,#334155);display:grid;place-items:center;color:#f3b08a;font-size:.8rem;font-weight:800}
.brand small{font-weight:500;color:var(--text-2);font-size:.95rem}
.nav{margin-left:auto;display:flex;align-items:center;gap:4px}
.nav a{color:var(--text-2);text-decoration:none;font-size:.94rem;padding:8px 12px;border-radius:10px}
.nav a:hover,.nav a[aria-current="page"]{color:var(--text);background:var(--surface-2)}
.theme-btn{border:1px solid var(--border);background:var(--surface);color:var(--text-2);border-radius:10px;height:36px;min-width:36px;padding:0 10px;cursor:pointer;font:inherit;font-size:.85rem;display:inline-flex;align-items:center;gap:6px}
.theme-btn:hover{color:var(--text)}
.menu-btn{display:none;border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:10px;height:36px;min-width:36px;padding:0 10px;cursor:pointer;font:inherit;font-size:.85rem;align-items:center}
@media (max-width:760px){
  .menu-btn{display:inline-flex;margin-left:auto}
  .nav{display:none;position:absolute;top:var(--nav-h);left:0;right:0;flex-direction:column;align-items:stretch;background:var(--bg-2);border-bottom:1px solid var(--border);padding:8px 16px 16px}
  .nav.open{display:flex}
  .nav a{padding:12px}
  .theme-wrap{order:3}
}

/* Buttons & badges */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 20px;border-radius:12px;font-weight:650;font-size:.95rem;text-decoration:none;border:1px solid transparent;cursor:pointer}
.btn:hover{text-decoration:none}
.btn-primary{background:var(--text);color:var(--bg)}
.btn-primary:hover{opacity:.9}
.btn-ghost{background:var(--surface);color:var(--text);border-color:var(--border)}
.btn-ghost:hover{background:var(--surface-2)}
.badge-link{display:inline-block;line-height:0;border-radius:8px}
.badge-link img{height:44px;width:auto}
.badge-link.sm img{height:36px}
.badge-appstore--dark{display:none}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]) .badge-appstore--light{display:none}
  html:not([data-theme="light"]) .badge-appstore--dark{display:inline}
}
html[data-theme="dark"] .badge-appstore--light{display:none}
html[data-theme="dark"] .badge-appstore--dark{display:inline}
.cta-row .btn-android-soon{min-height:44px;display:inline-flex;align-items:center;padding:0 16px}
.chip{display:inline-flex;align-items:center;gap:6px;font-size:.82rem;font-weight:600;color:var(--text-2);background:var(--surface-2);border:1px solid var(--border);border-radius:999px;padding:4px 12px}
.chip.soon::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--accent)}
.cta-row{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:24px}

/* Hero */
.hero{padding:72px 0 56px}
.hero .eyebrow{display:inline-block;font-size:.8rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--accent);margin-bottom:14px}
.hero .lede{font-size:clamp(1.05rem,1.6vw,1.25rem);max-width:44rem;color:var(--text-2)}
.hero-icons{display:flex;flex-wrap:wrap;gap:12px;margin-top:36px}
.hero-icons img{width:56px;height:56px;border-radius:13px;box-shadow:var(--shadow)}

/* Sections */
.section{padding:56px 0}
.section.alt{background:var(--bg-2);border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
.section-head{max-width:46rem;margin-bottom:28px}
.section-head p{color:var(--text-2)}

/* App cards */
.grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(300px,1fr))}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:22px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:12px}
.card-top{display:flex;gap:14px;align-items:center}
.card-top h2 a,.card-top .sub a{display:inline-block;min-height:24px;line-height:24px}
.card-top .sub{margin-top:6px}
.card-top picture{flex:none;width:64px;height:64px}
.card-top img{width:64px;height:64px;border-radius:15px;flex:none;object-fit:cover;aspect-ratio:1/1}
.card h2,.card h3{margin:0;font-size:1.06rem}
.card .sub{margin:0;color:var(--text-2);font-size:.9rem}
.card p{margin:0;font-size:.95rem}
.card .links{margin-top:auto;display:flex;flex-wrap:wrap;gap:6px 16px;font-size:.88rem;align-items:center}
.card .links a{font-weight:600}
.card a.stretch{color:var(--text);text-decoration:none}
.card a.stretch:hover{text-decoration:underline}

/* Pillars */
.pillars{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(230px,1fr))}
.pillar{padding:20px;border-radius:var(--radius);background:var(--surface);border:1px solid var(--border)}
.pillar h3{font-size:1rem;margin-bottom:6px}
.pillar p{margin:0;font-size:.94rem}

/* App page */
.app-hero{padding:56px 0 32px;position:relative}
.app-hero::before{content:"";position:absolute;inset:0;background:radial-gradient(1100px 380px at 15% -10%,var(--app-tint,var(--accent-soft)),transparent 70%);pointer-events:none}
.app-hero .row{position:relative;display:flex;gap:28px;align-items:center;flex-wrap:wrap}
.app-hero .icon{width:112px;height:112px;border-radius:25px;box-shadow:var(--shadow);flex:none}
.app-hero h1{font-size:clamp(1.9rem,4vw,2.75rem);margin-bottom:6px}
.app-hero .subtitle{font-size:1.15rem;font-weight:600;color:var(--text-2);margin-bottom:10px}
.app-hero .lede{max-width:44rem}
.breadcrumb{font-size:.88rem;color:var(--muted);margin-bottom:18px;position:relative}
.breadcrumb a{color:var(--muted)}
.shots{display:flex;gap:16px;overflow-x:auto;scroll-snap-type:x mandatory;padding:8px 2px 18px;-webkit-overflow-scrolling:touch}
.shot{flex:0 0 auto;width:clamp(200px,24vw,260px);scroll-snap-align:start;margin:0}
.shot img{border-radius:18px;border:1px solid var(--border);background:var(--surface-2);width:100%;height:auto}
.shot figcaption{font-size:.85rem;color:var(--text-2);margin-top:8px}
.mode-pill{display:inline-flex;border:1px solid var(--border);border-radius:999px;overflow:hidden;font-size:.75rem;font-weight:650;margin-bottom:8px}
.mode-pill span{padding:3px 10px}
.mode-pill span:first-child{background:#fff;color:#0f172a}
.mode-pill span:last-child{background:#0f172a;color:#f1f5f9}
.features{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}
.feature{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:20px}
.feature h3{font-size:.8rem;letter-spacing:.07em;text-transform:uppercase;color:var(--accent);margin-bottom:10px}
.feature ul{margin:0;padding-left:18px}
.feature li{color:var(--text-2);font-size:.95rem;margin-bottom:6px}
.note-box{border-left:3px solid var(--accent);background:var(--surface);border-radius:0 var(--radius) var(--radius) 0;padding:14px 18px;color:var(--text-2);font-size:.92rem}
.note-box p:last-child{margin:0}
.facts{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px;position:relative}
.legal-links{display:flex;flex-wrap:wrap;gap:8px 20px;font-size:.92rem}

/* Prose (blog, legal) */
.prose{max-width:740px}
.prose h1{font-size:clamp(1.8rem,3.6vw,2.5rem)}
.prose h2{font-size:1.4rem;margin-top:2em}
.prose h3{margin-top:1.6em}
.prose p,.prose li{color:var(--text-2);font-size:1.02rem;line-height:1.75}
.prose ul,.prose ol{padding-left:1.3em}
.prose li{margin-bottom:.4em}
.prose table{width:100%;border-collapse:collapse;margin:1.2em 0;font-size:.93rem;display:block;overflow-x:auto}
.prose th,.prose td{border:1px solid var(--border);padding:8px 10px;text-align:left}
.prose th{background:var(--surface-2)}
.prose code,.prose pre{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.9em;background:var(--surface-2);border-radius:6px}
.prose code{padding:1px 5px}.prose pre{padding:14px;overflow:auto}
.prose blockquote{margin:1.2em 0;padding:10px 18px;border-left:3px solid var(--accent);background:var(--surface)}
.prose img{border-radius:12px}
.prose .meta{color:var(--muted);font-size:.9rem}
.prose .callout{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:18px;margin:1.5em 0}
.page-head{padding:56px 0 8px}
.page-head p{color:var(--text-2);max-width:44rem}

/* FAQ */
details{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:0 18px;margin-bottom:10px}
summary{cursor:pointer;padding:16px 0;font-weight:650;color:var(--text);list-style:none;display:flex;justify-content:space-between;gap:12px}
summary::-webkit-details-marker{display:none}
summary::after{content:"+";color:var(--muted);font-weight:500}
details[open] summary::after{content:"–"}
details p{padding-bottom:6px}

/* Forms */
.form{display:grid;gap:14px;max-width:560px}
.form label{font-weight:600;font-size:.92rem;display:grid;gap:6px;color:var(--text)}
.form input,.form textarea,.form select{font:inherit;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:11px 12px}
.form textarea{min-height:150px;resize:vertical}

/* Draft banner */
.draft-banner{background:#fde68a;color:#422006;padding:12px 0;font-weight:650;font-size:.95rem;border-bottom:1px solid #f59e0b}

/* Footer */
.site-footer{border-top:1px solid var(--border);padding:40px 0 48px;margin-top:40px;background:var(--bg-2)}
.footer-grid{display:grid;gap:28px;grid-template-columns:2fr repeat(3,1fr)}
.footer-grid h2{font-size:.8rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:10px}
.footer-grid ul{list-style:none;margin:0;padding:0}
.footer-grid li{margin-bottom:6px}
.footer-grid a{color:var(--text-2);text-decoration:none;font-size:.93rem}
.footer-grid a:hover{color:var(--text);text-decoration:underline}
.footer-grid p{font-size:.92rem;color:var(--muted)}
.footer-legal{margin-top:28px;font-size:.82rem;color:var(--muted)}
.footer-legal p{color:var(--muted);margin:0 0 4px;font-size:.82rem}
@media (max-width:760px){.footer-grid{grid-template-columns:1fr 1fr}.footer-grid>div:first-child{grid-column:1/-1}}

/* 404 */
.nf{padding:96px 0;text-align:left}
@media (prefers-reduced-motion:no-preference){.card,.btn{transition:background .15s,opacity .15s}}
