/* NextMate public site.
 *
 * Deliberately one stylesheet, no build step, no framework: the whole site is four
 * static pages, and Cloudflare serves this file as-is.
 *
 * Fonts are self-hosted rather than linked from Google Fonts. A font CDN sees every
 * visitor's IP address on every page load, which is exactly the kind of third-party
 * data flow this site's own Privacy Policy says NextMate does not do — linking one
 * from the page that hosts that policy would make it untrue. The woff2 files are
 * subset to Latin plus the punctuation the legal text uses (~16KB each, down from
 * ~340KB); regenerate them with scripts/build-website.py.
 *
 * Colors are taken from apps/mobile/src/theme.ts. Keep them in sync by hand: this
 * file cannot import from the app, and a web build step purely to share six hex
 * values would cost more than it saves. */

@font-face {
  font-family: 'Fraunces';
  src: url('assets/fraunces-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('assets/inter-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('assets/inter-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #faf8f4;
  --surface: #ffffff;
  --navy: #232a2e;
  --muted: #5b6469;
  --border: #e7e2d9;
  --teal: #2f9e8f;
  --teal-dark: #1e6e62;
  --teal-tint: #e3f3f0;
  --coral: #f0784f;
  --coral-tint: #fdece6;
  --gold-light: #e3bb71;
  --gold-soft: #f7ecd6;

  --measure: 34rem;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* The app is a light, warm, paper-colored product and the site matches it rather
     than inventing a second identity. Declared so browsers don't tint form controls
     or scrollbars for a dark theme the page doesn't have. */
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--teal-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--coral);
}

:focus-visible {
  outline: 2px solid var(--teal-dark);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--navy);
  padding: 0.6rem 1rem;
  z-index: 10;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ---- header ------------------------------------------------------------ */
/* Mirrors the app's AppHeader: a gold band with rounded bottom corners. */
.site-header {
  background: var(--gold-light);
  border-radius: 0 0 28px 28px;
  padding: 1rem 1.25rem 1.25rem;
}

.header-inner {
  max-width: var(--measure);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--navy);
  margin-right: auto;
}

.brand img {
  width: 38px;
  height: auto;
  display: block;
}

.brand span {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--teal-dark);
  text-decoration: underline;
}

/* ---- layout ------------------------------------------------------------ */
main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0 0 0.75rem;
}

h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.25;
  text-wrap: balance;
  margin: 2.5rem 0 0.6rem;
}

h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.35rem;
}

p {
  margin: 0 0 1rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

ul {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
}

li {
  margin-bottom: 0.45rem;
}

/* ---- mode cards -------------------------------------------------------- */
.modes {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0 0;
}

/* The reading measure stays tight because the legal pages need it, but two cards
   squeezed into 34rem are about 16 characters a line. So on a wide enough viewport
   the mode grid alone breaks out of the column, centred on it. */
@media (min-width: 54rem) {
  .modes {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    width: 46rem;
    /* 100% is main's content box, so this stays centred if the measure or the
       page padding ever changes. */
    margin-left: calc((100% - 46rem) / 2);
  }
}

.mode {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--teal);
  border-radius: 14px;
  padding: 1.25rem;
}

.mode:nth-child(2) {
  border-top-color: var(--coral);
}

.mode h3 {
  margin-top: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
}

.mode p:last-child,
.mode ul:last-child {
  margin-bottom: 0;
}

/* ---- callout ----------------------------------------------------------- */
.callout {
  background: var(--gold-soft);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  margin: 2.5rem 0 0;
}

.callout h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ---- legal pages ------------------------------------------------------- */
.updated {
  color: var(--muted);
  font-size: 0.9rem;
  margin: -0.25rem 0 2rem;
}

.legal h2 {
  font-size: 1.2rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: 2.25rem;
}

.legal .part {
  font-family: var(--display);
  font-size: 1.5rem;
  border-top: none;
  margin-top: 3rem;
  color: var(--teal-dark);
}

.labeled {
  margin: 0 0 1rem;
}

.labeled .label {
  display: block;
  font-weight: 700;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.toc h2 {
  font-family: var(--body);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-top: none;
  padding-top: 0;
  margin: 0 0 0.5rem;
}

.toc ul {
  margin: 0;
  padding-left: 1.15rem;
  columns: 2;
  column-gap: 1.5rem;
  font-size: 0.9rem;
}

@media (max-width: 30rem) {
  .toc ul {
    columns: 1;
  }
}

.toc li {
  margin-bottom: 0.2rem;
  break-inside: avoid;
}

/* ---- footer ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  padding: 1.75rem 1.25rem 2.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-inner {
  max-width: var(--measure);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  align-items: baseline;
}

.footer-inner nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
}

.footer-note {
  flex-basis: 100%;
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
}
