/*
 * Balance Quest website: privacy policy, terms and support.
 * Colours mirror src/ui/theme/tokens.ts (Blush & Pine, light and dark). Fonts are self-hosted so visiting
 * the privacy policy never sends anyone's IP address to a font CDN.
 */

@font-face {
  font-family: 'Gaegu';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/gaegu-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/nunito-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/nunito-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/nunito-800.woff2') format('woff2');
}

:root {
  --bg: #f5e7ea;
  --surface: #fffafb;
  --sunken: #ebd5db;
  --note: #fce0e7;
  --tip: #e2ece6;
  --ink: #1b2e25;
  --ink-2: #4c5e55;
  --soft: #93a098;
  --accent: #1e5a43;
  --warm: #a8481a;
  --offset: #9db2ee;
  color-scheme: light;
}
/* Dark follows the device unless the footer switch picked Light or Dark (theme.js sets data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #14201b;
    --surface: #1b2a24;
    --sunken: #101915;
    --note: #2e2530;
    --tip: #24392f;
    --ink: #f6e9ec;
    --ink-2: #c9b7bd;
    --soft: #4a5b53;
    --accent: #8fd1ae;
    --warm: #ff9a57;
    --offset: #6f82c9;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #14201b;
  --surface: #1b2a24;
  --sunken: #101915;
  --note: #2e2530;
  --tip: #24392f;
  --ink: #f6e9ec;
  --ink-2: #c9b7bd;
  --soft: #4a5b53;
  --accent: #8fd1ae;
  --warm: #ff9a57;
  --offset: #6f82c9;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    'Nunito',
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  font-size: 17px;
  line-height: 1.6;
}
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px max(16px, env(safe-area-inset-left)) 64px max(16px, env(safe-area-inset-right));
}
.site-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  margin-bottom: 32px;
}
.brand {
  font-family: 'Gaegu', 'Comic Sans MS', cursive;
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--ink);
  text-decoration: none;
}
nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-weight: 700;
}
nav a {
  color: var(--ink-2);
  text-decoration: none;
}
nav a[aria-current='page'] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}
h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
}
h1 {
  font-family: 'Gaegu', 'Comic Sans MS', cursive;
  font-size: clamp(2.2rem, 7vw, 3rem);
  margin: 0 0 8px;
}
h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 40px 0 8px;
  padding-top: 16px;
  border-top: 1.5px dashed var(--soft);
}
h3 {
  font-size: 1.08rem;
  font-weight: 800;
  margin: 24px 0 4px;
}
p,
ul,
ol {
  margin: 0 0 12px;
}
li {
  margin-bottom: 6px;
}
a {
  color: var(--accent);
  font-weight: 700;
  overflow-wrap: anywhere;
}
a:focus-visible,
summary:focus-visible,
.table-wrap:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.lede {
  font-size: 1.15rem;
  color: var(--ink-2);
}
.meta {
  color: var(--ink-2);
  font-size: 0.92rem;
}
.card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--offset);
  padding: 18px 20px;
  margin: 20px 0;
}
.card > :first-child {
  margin-top: 0;
}
.card > :last-child {
  margin-bottom: 0;
}
.draft {
  background: var(--note);
  border: 2px dashed var(--warm);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 20px 0;
}
.draft strong {
  color: var(--warm);
}
.tip {
  background: var(--tip);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 16px 0;
}
.tip > :last-child,
.draft > :last-child {
  margin-bottom: 0;
}
.todo {
  background: var(--note);
  border-bottom: 2px solid var(--warm);
  padding: 0 3px;
  font-weight: 700;
}
.table-wrap {
  overflow-x: auto;
  margin: 12px 0 20px;
  border: 1.5px solid var(--soft);
  border-radius: 10px;
  background: var(--surface);
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 0.94rem;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--sunken);
}
th {
  background: var(--sunken);
  font-weight: 800;
}
tr:last-child td {
  border-bottom: 0;
}
details {
  background: var(--surface);
  border: 1.5px solid var(--soft);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 10px 0;
}
details[open] {
  border-color: var(--ink);
}
summary {
  font-weight: 800;
  cursor: pointer;
}
details > :not(summary):first-of-type {
  margin-top: 10px;
}
details > :last-child {
  margin-bottom: 0;
}
.toc {
  columns: 2 220px;
  padding-left: 1.2em;
}
.site-foot {
  margin-top: 56px;
  padding-top: 16px;
  border-top: 1.5px dashed var(--soft);
  color: var(--ink-2);
  font-size: 0.9rem;
}
.site-foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  list-style: none;
  padding: 0;
}

/* Appearance switch in the footer. Hidden until theme.js runs, since it does nothing without it. */
.appearance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}
.appearance[hidden] {
  display: none;
}
.appearance button {
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--soft);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.appearance button[aria-pressed='true'] {
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.appearance button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Shared additions for the home page ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 12px;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 1;
}
.wrap.wide {
  max-width: 1120px;
}
.eyebrow {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 6px;
}
figure {
  margin: 0;
}
.home img,
.home picture {
  max-width: 100%;
  height: auto;
  display: block;
}
.home section {
  margin: 72px 0;
}
.home h2 {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
  font-family: 'Gaegu', 'Comic Sans MS', cursive;
  font-weight: 700;
  font-size: clamp(1.9rem, 5vw, 2.5rem);
}
.home h3 {
  margin-top: 8px;
}

/* Hero */
.home .hero {
  display: grid;
  gap: 32px;
  align-items: center;
  margin-top: 8px;
}
.hero h1 {
  font-size: clamp(2.6rem, 8vw, 4rem);
  line-height: 1.05;
}
.hero-art img,
.journey figure img {
  border: 2px solid var(--ink);
  border-radius: 22px;
  box-shadow: 6px 6px 0 var(--offset);
}
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 14px;
}
.store-chip {
  display: inline-block;
  background: var(--ink);
  color: var(--bg);
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 0.95rem;
}

/* How it works */
.how {
  display: grid;
  gap: 40px;
  align-items: center;
}
.phone {
  justify-self: center;
  width: min(300px, 80vw);
  padding: 10px;
  background: var(--ink);
  border-radius: 46px;
  box-shadow: 8px 8px 0 var(--offset);
}
.phone img {
  border-radius: 36px;
}
.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: 18px;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 48px 1fr;
  column-gap: 14px;
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50% 46% 52% 48%;
  background: var(--note);
  font-family: 'Gaegu', 'Comic Sans MS', cursive;
  font-weight: 700;
  font-size: 1.5rem;
}
.steps h3,
.steps p {
  margin: 0;
}
.steps h3 {
  margin-top: 8px;
}

/* Features */
.features {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.features li {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 18px;
  padding: 18px;
  margin: 0;
}
.features h3 {
  margin: 10px 0 4px;
}
.features p {
  margin: 0;
  color: var(--ink-2);
}

/* Journey */
.journey {
  display: grid;
  gap: 28px;
  align-items: center;
}

/* Who it's for */
.chips {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chips li {
  margin: 0;
  background: var(--tip);
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
}

/* Call to action */
.cta {
  text-align: center;
  padding: 32px 20px;
}
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 4px 0 var(--ink);
  padding: 12px 28px;
  text-decoration: none;
  font-family: 'Gaegu', 'Comic Sans MS', cursive;
  font-size: 1.5rem;
}

@media (min-width: 880px) {
  .home .hero {
    grid-template-columns: 1fr 1.1fr;
  }
  .how {
    grid-template-columns: 340px 1fr;
  }
  .journey {
    grid-template-columns: 1fr 1.2fr;
  }
}
