/*
 * SaveBox — shared site styles.
 *
 * The palette is the app's, from savebox-mobile src/theme/colors.js: terracotta
 * on a warm cream ground, every neutral warm, shadows brown rather than black.
 * The type is the Play Store listing's (assets/play-store/posters.html):
 * Fraunces for display, Karla for text, IBM Plex Mono for kickers. The fonts are
 * served from this site rather than from Google, so loading a page here makes no
 * third-party request at all.
 *
 * If the app's palette or the listing's type changes, change them here too.
 */

@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 500 700; font-display: swap; src: url(fonts/fraunces.woff2) format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 500 700; font-display: swap; src: url(fonts/fraunces-italic.woff2) format("woff2"); }
@font-face { font-family: "Karla"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/karla.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/plex-mono-500.woff2) format("woff2"); }

/* ---------- tokens ---------- */
:root {
  --bg: #F7F2EC;
  --bg-2: #F1E7DC;
  --surface: #FFFFFF;
  --surface-alt: #F1E7DC;
  --border: #E8DCCF;
  --border-strong: #D0BCA8;
  --fg: #241A14;
  --fg-2: #57433A;
  --fg-muted: #6B564A;
  --primary: #A9502D;
  --primary-bright: #C2683F;
  --primary-deep: #8F3F23;
  --on-primary: #FFFFFF;
  --primary-soft: #F9E9E0;
  --glow: rgba(194, 104, 63, .42);
  --success: #2F6B45;
  --success-soft: #DFEEE3;
  --track: #E8DCCF;

  --grad-brand: linear-gradient(135deg, #A9502D 0%, #8F3F23 100%);
  --grad-mark: linear-gradient(140deg, #C2683F 0%, #A9502D 55%, #8F3F23 100%);
  --grad-hero: linear-gradient(180deg, rgba(194,104,63,.16) 0%, rgba(169,80,45,.06) 45%, rgba(169,80,45,0) 100%);
  --grad-card: linear-gradient(160deg, rgba(194,104,63,.08) 0%, rgba(255,255,255,0) 55%);
  --bloom: rgba(194, 104, 63, .30);
  --bloom-alt: rgba(208, 140, 63, .24);

  /* The dark brown of the Play feature graphic. Constant in both schemes. */
  --ember: #2A1C17;
  --ember-2: #3B2620;
  --ember-fg: #FBF3EC;
  --ember-muted: #D9C3B6;
  --ember-accent: #F0C4A9;

  --shadow-sm: 0 1px 4px rgb(58 36 26 / .08);
  --shadow-md: 0 5px 14px rgb(58 36 26 / .10), 0 1px 2px rgb(58 36 26 / .06);
  --shadow-lg: 0 10px 26px rgb(58 36 26 / .16), 0 2px 6px rgb(58 36 26 / .06);
  --shadow-xl: 0 30px 60px -18px rgb(58 36 26 / .35), 0 12px 24px -12px rgb(58 36 26 / .2);
  --shadow-glow: 0 8px 20px var(--glow);

  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px;
  --maxw: 1160px;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Karla", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #181110; --bg-2: #1E1614; --surface: #221917; --surface-alt: #2E2321;
    --border: #3A2B27; --border-strong: #4E3A34;
    --fg: #F3E9E3; --fg-2: #C9B4A9; --fg-muted: #BBA497;
    --primary: #EFA582; --primary-bright: #EFA582; --primary-deep: #DF8A61;
    --on-primary: #2B1408; --primary-soft: rgba(239, 165, 130, .16); --glow: rgba(223, 138, 97, .38);
    --success: #6FD79A; --success-soft: rgba(111, 215, 154, .16); --track: #3A2B27;
    --grad-brand: linear-gradient(135deg, #EFA582 0%, #DF8A61 100%);
    --grad-mark: linear-gradient(140deg, #EFA582 0%, #DF8A61 60%, #C2683F 100%);
    --grad-hero: linear-gradient(180deg, rgba(239,165,130,.14) 0%, rgba(194,104,63,.06) 45%, rgba(194,104,63,0) 100%);
    --grad-card: linear-gradient(160deg, rgba(239,165,130,.08) 0%, rgba(239,165,130,0) 55%);
    --bloom: rgba(223, 138, 97, .24); --bloom-alt: rgba(208, 140, 63, .18);
    --ember: #120C0B; --ember-2: #2A1C17;
    --shadow-sm: 0 1px 4px rgb(0 0 0 / .35); --shadow-md: 0 5px 14px rgb(0 0 0 / .40);
    --shadow-lg: 0 10px 26px rgb(0 0 0 / .50); --shadow-xl: 0 30px 60px -18px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #181110; --bg-2: #1E1614; --surface: #221917; --surface-alt: #2E2321;
  --border: #3A2B27; --border-strong: #4E3A34;
  --fg: #F3E9E3; --fg-2: #C9B4A9; --fg-muted: #BBA497;
  --primary: #EFA582; --primary-bright: #EFA582; --primary-deep: #DF8A61;
  --on-primary: #2B1408; --primary-soft: rgba(239, 165, 130, .16); --glow: rgba(223, 138, 97, .38);
  --success: #6FD79A; --success-soft: rgba(111, 215, 154, .16); --track: #3A2B27;
  --grad-brand: linear-gradient(135deg, #EFA582 0%, #DF8A61 100%);
  --grad-mark: linear-gradient(140deg, #EFA582 0%, #DF8A61 60%, #C2683F 100%);
  --grad-hero: linear-gradient(180deg, rgba(239,165,130,.14) 0%, rgba(194,104,63,.06) 45%, rgba(194,104,63,0) 100%);
  --grad-card: linear-gradient(160deg, rgba(239,165,130,.08) 0%, rgba(239,165,130,0) 55%);
  --bloom: rgba(223, 138, 97, .24); --bloom-alt: rgba(208, 140, 63, .18);
  --ember: #120C0B; --ember-2: #2A1C17;
  --shadow-sm: 0 1px 4px rgb(0 0 0 / .35); --shadow-md: 0 5px 14px rgb(0 0 0 / .40);
  --shadow-lg: 0 10px 26px rgb(0 0 0 / .50); --shadow-xl: 0 30px 60px -18px rgb(0 0 0 / .7);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary-bright); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--primary-bright) 30%, transparent); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (max-width: 480px) { .wrap { padding: 0 16px; } }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: var(--r-sm);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- type ---------- */
.display, h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.022em; font-optical-sizing: auto; }
h1 em, h2 em, .display em { font-style: italic; color: var(--primary); font-weight: 600; }
.kicker {
  font-family: var(--font-mono); font-weight: 500; font-size: 12.5px;
  letter-spacing: .22em; text-transform: uppercase; color: var(--primary);
  margin: 0 0 14px;
}
.lede { font-size: clamp(17px, 2vw, 20px); color: var(--fg-2); }

/* ---------- the app mark ---------- */
.mark { flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border-radius: var(--r-md);
  font-size: 16px; font-weight: 600; line-height: 1.2; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--grad-brand); color: var(--on-primary); box-shadow: var(--shadow-glow); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px var(--glow); }
.btn-ghost { background: var(--surface); color: var(--fg); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--border-strong); }
.btn-sm { padding: 9px 16px; font-size: 14.5px; border-radius: var(--r-sm); }

/* The store button: an unmistakably "get the app" control, without borrowing
   any store's artwork. Links to the Google Play listing. */
.store {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 22px 10px 16px; border-radius: var(--r-md);
  background: var(--fg); color: var(--bg); text-decoration: none;
  box-shadow: var(--shadow-lg); border: 1px solid transparent;
}
.store { transition: transform .15s ease; }
.store:hover { transform: translateY(-2px); text-decoration: none; }
.store svg { width: 28px; height: 28px; flex: none; color: var(--primary-bright); }
.store small { display: block; font-size: 11.5px; font-weight: 500; letter-spacing: .02em; opacity: .75; line-height: 1.2; }
.store b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); box-shadow: 0 6px 20px -16px rgb(58 36 26 / .4); }
.bar { display: flex; align-items: center; gap: 16px; height: 70px; }
.brand {
  display: flex; align-items: center; gap: 11px; margin-right: auto;
  font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.02em;
  color: var(--fg); text-decoration: none;
}
.brand .mark { width: 34px; height: 34px; filter: drop-shadow(0 4px 10px var(--glow)); }
.nav { display: flex; gap: 2px; }
.nav a {
  color: var(--fg-2); text-decoration: none; font-weight: 500; font-size: 15.5px;
  padding: 7px 13px; border-radius: 999px; transition: color .15s, background .15s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
.bar-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-sm); flex: none;
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--fg-2);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--primary); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}
.menu-btn { display: none; }
.menu-btn .x { display: none; }
.menu-open .menu-btn .x { display: block; }
.menu-open .menu-btn .bars { display: none; }

@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .bar-cta { display: none; }
  .nav {
    position: absolute; left: 0; right: 0; top: 70px;
    flex-direction: column; gap: 2px; padding: 10px 16px 18px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: 0 20px 30px -20px rgb(58 36 26 / .35);
    display: none;
  }
  .menu-open .nav { display: flex; }
  .nav a { padding: 12px 14px; border-radius: var(--r-sm); font-size: 17px; }
}

/* ---------- sections ---------- */
.section { padding: 112px 0; position: relative; }
@media (max-width: 720px) { .section { padding: 80px 0; } }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--border); }
.section-head { max-width: 680px; margin: 0 0 56px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.06; margin: 0 0 16px; }
.section-head p { margin: 0; color: var(--fg-2); font-size: 18px; }
.section-head p.kicker { margin: 0 0 14px; color: var(--primary); font-size: 12.5px; }

/* ---------- footer ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--border); padding: 72px 0 32px; color: var(--fg-2); font-size: 15px; }
.fgrid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; }
@media (max-width: 860px) { .fgrid { grid-template-columns: 1fr 1fr; } .fabout { grid-column: 1 / -1; } }
@media (max-width: 420px) { .fgrid { grid-template-columns: 1fr; } }
.fabout p { margin: 14px 0 0; max-width: 320px; color: var(--fg-muted); }
.fcol h4 {
  margin: 4px 0 16px; font-family: var(--font-mono); font-weight: 500; font-size: 12px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--fg-muted);
}
.fcol ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fcol a { color: var(--fg-2); text-decoration: none; }
.fcol a:hover { color: var(--primary); }
.fbottom {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  color: var(--fg-muted); font-size: 14px;
}

/* ---------- reveal on scroll (only once JS has opted the page in) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); 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; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- legal pages (privacy, delete account) ---------- */
.legal-hero { background: var(--grad-hero); border-bottom: 1px solid var(--border); position: relative; overflow: hidden; isolation: isolate; }
.legal-hero::before {
  content: ""; position: absolute; z-index: -1; width: 600px; height: 600px; right: -160px; top: -260px; border-radius: 50%;
  background: radial-gradient(circle, var(--bloom) 0%, transparent 68%);
}
.legal-hero .wrap { padding-top: 72px; padding-bottom: 56px; }
.legal-hero h1 { font-size: clamp(40px, 6vw, 68px); line-height: 1.02; margin: 0 0 18px; letter-spacing: -.03em; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; font-weight: 600; color: var(--fg-2);
}
.pill svg { width: 14px; height: 14px; color: var(--primary); }
.legal-hero .scope { max-width: 720px; margin: 0; font-size: 18.5px; color: var(--fg-2); }

.legal { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 64px; padding-top: 56px; padding-bottom: 112px; }
@media (max-width: 960px) { .legal { grid-template-columns: 1fr; gap: 0; padding-top: 32px; } }
.toc { position: sticky; top: 100px; align-self: start; font-size: 14.5px; }
.toc h2 {
  font-family: var(--font-mono); font-weight: 500; font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--fg-muted); margin: 6px 0 14px;
}
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a {
  display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 2px solid transparent;
  color: var(--fg-muted); text-decoration: none; line-height: 1.4;
}
.toc a:hover { color: var(--fg); }
.toc a.active { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
@media (max-width: 960px) { .toc { display: none; } }

.prose { max-width: 740px; font-size: 17px; color: var(--fg-2); }
.prose h2 {
  font-size: clamp(26px, 3vw, 32px); line-height: 1.15; color: var(--fg);
  margin: 64px 0 16px; padding-top: 8px;
}
.prose > h2:first-child, .prose .callout + h2 { margin-top: 48px; }
.prose h3 { font-size: 19px; font-weight: 700; color: var(--fg); margin: 32px 0 8px; letter-spacing: -.01em; }
.prose p { margin: 0 0 16px; }
.prose strong { color: var(--fg); font-weight: 700; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.prose ul li { position: relative; padding-left: 26px; }
.prose ul li::before {
  content: ""; position: absolute; left: 4px; top: .62em; width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary-bright);
}
.prose ol { counter-reset: n; }
.prose ol li { counter-increment: n; position: relative; padding: 14px 18px 14px 62px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.prose ol li::before {
  content: counter(n); position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--grad-brand); color: var(--on-primary); font-family: var(--font-display); font-weight: 600; font-size: 15px;
}
.prose code {
  font-family: var(--font-mono); font-size: .86em; padding: 2px 7px; border-radius: var(--r-xs);
  background: var(--surface-alt); color: var(--fg); border: 1px solid var(--border);
}

.callout {
  position: relative; margin: 0 0 8px; padding: 28px 30px; border-radius: var(--r-xl);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
  background-image: var(--grad-card); overflow: hidden;
}
.callout::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad-mark); }
.callout h2 { margin: 0 0 14px !important; padding: 0; font-size: 24px; }
.callout ul { margin: 0; gap: 12px; }
.callout ul li::before { background: none; width: auto; height: auto; top: .1em; left: 0; content: "✓"; color: var(--success); font-weight: 700; font-size: 15px; }
.callout p:last-child { margin: 0; }

.tablewrap { margin: 18px 0 24px; overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.tablewrap table { border-collapse: collapse; width: 100%; font-size: 15.5px; line-height: 1.55; }
.tablewrap th, .tablewrap td { text-align: left; vertical-align: top; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.tablewrap tr:last-child td { border-bottom: 0; }
.tablewrap th {
  font-family: var(--font-mono); font-weight: 500; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-muted); background: var(--surface-alt);
}
.tablewrap td:first-child { color: var(--fg); font-weight: 600; min-width: 180px; }
@media (max-width: 560px) { .tablewrap td:first-child { min-width: 140px; } .tablewrap th, .tablewrap td { padding: 12px 14px; } }

.help-card {
  margin-top: 56px; padding: 28px 30px; border-radius: var(--r-xl);
  background: var(--grad-brand); color: var(--on-primary); box-shadow: var(--shadow-glow);
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.help-card h3 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 600; font-size: 24px; color: inherit; letter-spacing: -.02em; }
.help-card p { margin: 0; opacity: .9; }
.help-card a.btn { background: #FFF6F0; color: #241A14; }
:root[data-theme="dark"] .help-card a.btn { background: #241A14; color: #FBF3EC; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .help-card a.btn { background: #241A14; color: #FBF3EC; } }
