/* ponytail: system fonts only, no licensed Recoleta Soft available here and a
   webfont request leaks visitor IPs to a third party on a page that's about
   to publish a privacy policy; upgrade path is self-host Inter (body) plus a
   licensed display face, once licensed. */

:root {
  /* Native form controls + scrollbars follow the dark palette below too. */
  color-scheme: light dark;
  /* Palette — from mobile/ios/Cafune/Theme.swift (light), the authoritative
     source; DESIGN.md's own colour section is explicitly stale. */
  --canvas: #FBF9F4;
  --card: #FFFFFF;
  --hairline: #D3C3BE;
  --text-primary: #110402;
  --text-secondary: #4F4441;
  --cta-fill: #3A2416;
  --cta-label: #FFFFFF;
  --highlight: #F4DFCB;
  --accent-text: #9A5B2E;

  /* 4pt spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-xxl: 24px;
  --space-huge: 32px;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --font-display: Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark counterparts, same source. */
    --canvas: #17100C;
    --card: #211710;
    --hairline: #3D2F27;
    --text-primary: #F7F2EA;
    --text-secondary: #C9BBB2;
    --cta-fill: #F4DFCB;
    --cta-label: #241009;
    --highlight: #4A3524;
    --accent-text: #D08A4E;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
}

/* Wrapping: `balance` evens the line lengths of short blocks, `pretty` keeps a paragraph
   from ending on a single orphaned word. Both are progressive — older engines just wrap
   normally, so no fallback is needed. Never hard-break prose with <br>. */
h1,
h2,
h3 {
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-top: var(--space-xxl);
  padding-bottom: var(--space-lg);
}

.mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  flex: none;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin: 0;
}

/* Sections */

section {
  padding: var(--space-xxl) 0;
  border-top: 1px solid var(--hairline);
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  margin: 0 0 var(--space-lg);
}

.site-footer {
  padding: var(--space-xxl) 0 var(--space-huge);
  color: var(--text-secondary);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md) var(--space-lg);
}

.footer-nav {
  display: flex;
  gap: var(--space-lg);
}

.footer-nav a,
.legal section a {
  color: var(--accent-text);
}

/* Brand link: same look as .site-header's icon + wordmark, just clickable. */
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: inherit;
  text-decoration: none;
}

/* Legal pages (privacy.html, terms.html) */

.legal-header {
  padding-top: var(--space-huge);
}

.legal-header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  margin: 0 0 var(--space-sm);
}

.legal-header .effective-date {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

.legal section {
  max-width: 68ch;
}

.legal h2 {
  font-size: 19px;
}

.legal h3 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: var(--space-lg) 0 var(--space-xs);
}

/* Body prose only. Scoped to `section` so the shared site header and footer keep the
   same type and colour they have on the home page. */
.legal section p,
.legal section li {
  color: var(--text-secondary);
  font-size: 15px;
}

.legal ul,
.legal ol {
  margin: 0 0 var(--space-md);
  padding-left: 1.2em;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0 var(--space-lg);
  font-size: 14px;
}

.legal th,
.legal td {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--hairline);
  vertical-align: top;
}

.legal th {
  background: var(--card);
  font-weight: 600;
  color: var(--text-primary);
}

.callout {
  background: var(--highlight);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: 0 0 var(--space-lg);
}

.callout p {
  color: var(--text-primary);
  margin: 0;
  max-width: none;
}

mark.placeholder {
  background: var(--highlight);
  color: var(--accent-text);
  font-weight: 600;
  padding: 0 4px;
  border-radius: 4px;
}

/* Desktop: one centred column for the legal pages. The home page (index.html) carries
   its own inline styles. */
@media (min-width: 768px) {
  .wrap {
    max-width: 840px;
    padding: 0 var(--space-huge);
  }

  section {
    padding: var(--space-huge) 0;
  }

  .site-header {
    padding-top: var(--space-huge);
  }

  h2 {
    font-size: 28px;
    margin-bottom: var(--space-xl);
  }
}
