/*
 * Shared stylesheet for the static legal pages (public/privacy.html, public/terms.html).
 * These pages must be readable without JavaScript, so vanilla-extract cannot apply here
 * (documented exception in AGENTS.md). Palette mirrors the default "sage" theme.
 */
:root {
  color-scheme: light dark;
  --bg: #FAF9F6;
  --surface: #FFFFFF;
  --text: #2C2C2C;
  --muted: #5F5F5F;
  --accent: #4A6B5D;
  --accent-hover: #3B554A;
  --border: #E2E0DA;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161A18;
    --surface: #1F2522;
    --text: #E8E6E1;
    --muted: #B4B1AA;
    --accent: #9CC4B2;
    --accent-hover: #BADBCB;
    --border: #36403B;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  line-height: 1.65;
}

.page {
  max-width: 70ch;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2.5rem) clamp(1rem, 5vw, 2rem) 4rem;
}

nav.top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-size: 0.9375rem;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

h1,
h2,
h3 {
  color: var(--accent);
  line-height: 1.25;
}

h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.25rem);
  margin: 1rem 0 0.5rem;
}

h2 {
  font-size: clamp(1.25rem, 1.15rem + 0.6vw, 1.5rem);
  margin: 2.25rem 0 0.5rem;
}

h3 {
  font-size: 1.125rem;
  margin: 1.75rem 0 0.5rem;
}

.meta {
  margin: 0;
  color: var(--muted);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

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

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

ul {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.35rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 0.1em 0.3em;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 32rem;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.9375rem;
}

th,
td {
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: none;
}

th {
  color: var(--accent);
}

.table-wrap:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Same footer as the app (AppFooter): stacked + centred on phones, copyright left / links right when wider. */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 3rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.site-footer-meta {
  margin: 0;
  padding-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 0.5rem;
}

.site-footer-copyright {
  font-weight: 600;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  font-size: 0.8125rem;
}

.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.5rem;
}

.site-footer nav a[aria-current="page"] {
  font-weight: 600;
  text-decoration: none;
}

@media (min-width: 600px) {
  .site-footer {
    flex-direction: row;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
  }

  .site-footer-meta {
    justify-content: flex-start;
    padding-top: 0;
  }
}
