/* The palette mirrors mobile/src/constants/theme.ts: cream page, brown ink, caramel accent. */
:root {
  --text: #3B2A22;
  --text-secondary: #7D675A;
  --background: #FBF5E8;
  --surface: #FFFDF8;
  --border: #EADFC9;
  --accent: #A35F38;
  --accent-muted: #F6E4CF;
  --ink: #3B2A22;
  --on-ink: #FBF5E8;
  --band: #F3E9D4;
  --highlight: #F7E8BF;
  --shadow: 0 1px 2px #5F3F341F, 0 8px 24px #5F3F3424;
  --shadow-floating: 0 2px 6px #5F3F342E, 0 14px 32px #5F3F3433;

  --serif: ui-serif, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #FFF8EE;
    --text-secondary: #CDBBAA;
    --background: #0E0B09;
    --surface: #201914;
    --border: #3A2E26;
    --accent: #F2A86F;
    --accent-muted: #3D2618;
    --ink: #FFF8EE;
    --on-ink: #0E0B09;
    --band: #1C1612;
    --highlight: #3E2F17;
    /* A shadow cannot show on near-black, so the top edge catches a little light instead. */
    --shadow: inset 0 1px 0 #FFFFFF14, 0 8px 24px #00000080;
    --shadow-floating: inset 0 1px 0 #FFFFFF14, 0 14px 32px #00000099;
  }
}

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

html {
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}

.page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

/* The support and privacy pages. */
.page.wide {
  max-width: 960px;
}

main {
  flex: 1;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
}

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

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

/* Site header, on the policy and terms pages. */
.site-header {
  padding-top: 24px;
  padding-bottom: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
}

/* Home page. */
.hero {
  padding-top: 72px;
  padding-bottom: 56px;
  position: relative;
  text-align: center;
}

/* The butter yellow from behind the otter, as a soft pool of light under the hero. */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 -20px auto;
  height: 420px;
  background: radial-gradient(closest-side, var(--highlight), transparent);
  opacity: 0.8;
}

.hero img {
  width: 128px;
  height: 128px;
  border-radius: 28px;
  box-shadow: var(--shadow-floating);
}

.hero h1 {
  margin: 20px 0 12px;
  font-size: clamp(40px, 9vw, 56px);
}

.hero p {
  max-width: 32em;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 19px;
  text-wrap: pretty;
}

.button {
  display: inline-block;
  margin-top: 32px;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-floating);
  transition: transform 0.15s ease;
}

.button:hover {
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }

  .button:hover {
    transform: none;
  }
}

.hero .note {
  margin-top: 14px;
  font-size: 14px;
}

.features {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0 0 72px;
  list-style: none;
}

.features li {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.features h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.features p {
  margin: 0;
  color: var(--text-secondary);
}

@media (min-width: 640px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Long-form pages: privacy policy and terms. */
.document {
  /* A sheet as tall as its text, not stretched to fill a short page. */
  flex: none;
  width: calc(100% - 32px);
  margin-bottom: 72px;
  padding: 32px 24px 40px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

@media (min-width: 640px) {
  .document {
    padding: 48px 56px 56px;
  }
}

.document h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 7vw, 40px);
}

.document h2 {
  margin: 40px 0 8px;
  font-size: 24px;
}

.document .effective {
  margin: 0 0 24px;
  color: var(--text-secondary);
}

.document ul {
  padding-left: 22px;
}

.document li {
  margin-bottom: 8px;
}

.notice {
  margin-top: 24px;
  padding: 20px 24px;
  border-left: 4px solid var(--accent);
  border-radius: 16px;
  background: var(--accent-muted);
}

.notice p {
  margin: 0;
}

/* Support page: each question is a ruled row that opens to show its answer. <details> does
   the toggling, so there is still no JavaScript. */
.faq {
  margin-top: 16px;
  border-bottom: 1px solid var(--border);
}

.faq details {
  border-top: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "\2212";
}

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

.faq p {
  max-width: 65ch;
  margin: 0 0 12px;
  color: var(--text-secondary);
}

.faq p:last-child {
  margin-bottom: 22px;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--band);
  color: var(--text-secondary);
  font-size: 15px;
}

.site-footer .page {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  padding-top: 24px;
  padding-bottom: 32px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.site-footer a {
  color: inherit;
}
