/* Receipt Warden — site styles.
 *
 * Colours, type and assets are the APP's, not an approximation of them. The
 * palette below is design/_ds/classical-*/styles.css verbatim (the same source
 * src/ui/tokens.ts is generated from), and the fonts are the very .ttf files
 * the app ships from @expo-google-fonts, converted to woff2 (1.5MB -> 320KB).
 *
 * Self-hosted rather than pulled from Google Fonts, which is what the design
 * system's own CSS does. Two reasons: the privacy policy states this site
 * loads no third-party resources and sets no cookies, and a Google Fonts tag
 * would hand every visitor's IP to Google and make that claim false; and
 * serving the app's exact font binaries guarantees the site and the product
 * render identically instead of drifting when Google updates a face.
 */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/CormorantGaramond_600SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/CormorantGaramond_400Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lora";
  src: url("/assets/fonts/Lora_400Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lora";
  src: url("/assets/fonts/Lora_600SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f3f2f2;
  --surface: #eae9e9;
  --text: #201f1d;
  --accent: #b68235;
  --accent-deep: #7d5411;
  --divider: rgba(32, 31, 29, 0.16);
  --muted: #605d5d;
  --wrap: 68rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Lora, Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

h1, h2, h3 {
  font-family: "Cormorant Garamond", Garamond, Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }

/* ------------------------------------------------------------------ nav -- */

.nav {
  border-bottom: 1px solid var(--divider);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Cormorant Garamond", Garamond, Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

/* The app's real launcher icon, not a CSS approximation of it. */
.brand .mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.35rem;
  display: block;
  flex: none;
}

.nav-links { display: flex; gap: 1.4rem; font-size: 0.97rem; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover { color: var(--text); }

/* ---------------------------------------------------------------- hero -- */

.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero .lead { font-size: 1.2rem; max-width: 40ch; color: var(--muted); }
.hero h1 em { font-style: italic; color: var(--accent-deep); }

.badges { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; align-items: center; }

.badge {
  display: inline-flex;
  flex-direction: column;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--divider);
  border-radius: 0.6rem;
  background: var(--surface);
  font-size: 0.95rem;
  line-height: 1.3;
}
.badge span { color: var(--muted); font-size: 0.8rem; }
.badge strong { font-weight: 600; }

/* -------------------------------------------------------------- content -- */

section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--divider); }
section .sub { color: var(--muted); max-width: 52ch; margin-top: -0.3em; }

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: 2.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 0.7rem;
  padding: 1.4rem 1.5rem;
}
.card h3 { margin-bottom: 0.35em; }
.card p { margin: 0; color: var(--muted); font-size: 0.97rem; }

.steps { counter-reset: step; margin-top: 2.5rem; display: grid; gap: 1.75rem; }
.step { display: grid; grid-template-columns: 2.4rem 1fr; gap: 1rem; align-items: start; }
.step .num {
  counter-increment: step;
  width: 2.4rem; height: 2.4rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 600;
  font-family: "Cormorant Garamond", Garamond, Georgia, serif;
  font-size: 1.2rem;
}
.step h3 { margin-bottom: 0.2em; }
.step p { margin: 0; color: var(--muted); }

/* --------------------------------------------------------------- prose -- */

.prose { max-width: 46rem; padding-bottom: 4rem; }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.5em; }
.prose .updated { color: var(--muted); font-size: 0.95rem; }
.prose table { border-collapse: collapse; width: 100%; margin: 1.5em 0; font-size: 0.97rem; }
.prose th, .prose td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--divider); vertical-align: top; }
.prose th { font-weight: 600; }

.callout {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 1rem 1.25rem;
  margin: 1.5em 0;
}
.callout p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------- footer -- */

footer {
  border-top: 1px solid var(--divider);
  padding: 2.5rem 0 3.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
footer a { color: var(--muted); }

/* --------------------------------------------------------------- oauth -- */

.centred { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 2rem 0; }
.centred .wrap { max-width: 34rem; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
