/* butter.yoga — shared stylesheet.
   Palette is lifted verbatim from the iOS theme system:
   client/butter-ios/Butter/Shared/Theme/SharedColors.swift (primary scale),
   ThemeSemantic.swift (light/dark role mappings), AccentPreset.swift (butter accent).
   Light = oat/linen, dark = espresso. No JS, no external requests. */

/* ---------- Fonts ---------- */

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/InstrumentSerif-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("/fonts/DMSans.woff2") format("woff2");
  font-weight: 100 1000; /* variable font: wght 100–1000 */
  font-style: normal;
  font-display: swap;
}

/* ---------- Palette ---------- */

:root {
  --bg: #fffdf8;           /* Oat — background.primary (light) */
  --surface: #f9f5ed;      /* Linen — background.surface */
  --border: #f0ebe5;       /* Dune — border.default */
  --text: #2b2520;         /* Espresso — text.body (14.9:1 on oat) */
  --muted: #736b60;        /* Stone — text.muted (5.2:1 on oat) */
  --accent: #ab6400;       /* amber-gold ink — accent.primary (4.5:1 on oat) */
  --callout-bg: #f7edcb;   /* pale butter — accent.fillSoft */
  --callout-text: #2b2520; /* espresso on pale butter (12.9:1) */

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #2b2520;           /* Espresso — background.primary (dark) */
    --surface: #36302a;      /* Walnut — background.surface */
    --border: #3a332c;       /* Walnut Hairline — border.pageRow */
    --text: #fffdf8;         /* Oat — text.body */
    --muted: #c0b4a4;        /* Sand — text.muted (7.4:1 on espresso) */
    --accent: #e8c868;       /* butter gold — accent.primary (9.3:1 on espresso) */
    --callout-bg: #36302a;   /* Walnut */
    --callout-text: #fffdf8; /* Oat */
  }
}

/* ---------- Base ---------- */

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 1rem 1.5rem 5rem;
}

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

pre,
table {
  max-width: 100%;
  overflow-x: auto;
}

table {
  display: block;
  border-collapse: collapse;
  margin: 0 0 1.1rem;
  font-size: 0.9375rem;
}

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

th {
  font-weight: 600;
  background: var(--surface);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

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

/* ---------- Type ---------- */

h1,
h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 1rem;
}

h1 {
  font-size: clamp(2.25rem, 7vw, 3rem);
  margin-top: 2.5rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
}

p {
  margin: 0 0 1.1rem;
}

ol,
ul {
  margin: 0 0 1.1rem;
  padding-left: 1.5rem;
}

li {
  margin: 0.4rem 0;
}

li::marker {
  color: var(--muted);
}

/* ---------- Header ---------- */

.site-header {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
}

.wordmark {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.625rem;
  color: var(--text);
  text-decoration: none;
}

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

.hero {
  padding-top: 3rem;
}

.hero h1 {
  font-size: clamp(4.5rem, 18vw, 6.5rem);
  margin: 0 0 0.5rem;
}

.tagline {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
}

.hero-body {
  max-width: 34rem;
}

.pill {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

/* ---------- Legal pages ---------- */

.last-updated {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 2rem;
}

.callout {
  background: var(--callout-bg);
  color: var(--callout-text);
  border-radius: 16px; /* iOS radius.md */
  padding: 1rem 1.25rem;
  margin: 0 0 1.5rem;
}

.callout p {
  margin: 0;
}

.callout p + p {
  margin-top: 0.5rem;
}

.callout-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.attribution {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ---------- Footer ---------- */

.site-footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
}

.site-footer .dot {
  padding: 0 0.35rem;
}

.site-footer p {
  margin: 0.75rem 0 0;
}
