/*
 * The support page and the privacy policy. Stone and ink, with the terracotta
 * of Greek pottery for links; in dark mode the red-figure version of the
 * same. They follow the phone's appearance, as the app does.
 *
 * Type is the phone's own: San Francisco on Apple devices, set heavy and
 * tight the way the app sets its titles. Everywhere else gets Inter, served
 * from here rather than Google Fonts: a privacy policy shouldn't hand its
 * readers' addresses to a third party. Apple devices never download it.
 */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --bg: #f4f1ea;
  --raised: #fbf9f5;
  --ink: #1c1a17;
  --ink-2: #4d4842;
  --ink-3: #6f685e;
  --rule: rgba(28, 26, 23, 0.12);
  --accent: #a8432a;
  --accent-line: rgba(168, 67, 42, 0.35);
  --veil: rgba(244, 241, 234, 0.85);

  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 48px);
  --column: 784px;
  /* The header's width, wider than either page so the name sits in the
     top-left corner; the policy's contents line up under it. */
  --frame: 1440px;
  /* The sticky header's height, which anchored headings and the contents
     list keep clear of. */
  --bar: 64px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #100e0c;
    --raised: #1a1714;
    --ink: #f1ece3;
    --ink-2: #bcb4a8;
    --ink-3: #8f877b;
    --rule: rgba(241, 236, 227, 0.1);
    --accent: #e8916c;
    --accent-line: rgba(232, 145, 108, 0.4);
    --veil: rgba(16, 14, 12, 0.85);
  }
  /* Light text on dark reads heavier than it is without this. */
  body { -webkit-font-smoothing: antialiased; }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Room for a scrollbar on every page, so the short support page and the long
   policy put the header in the same place. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; }

body {
  background: var(--bg);
  color: var(--ink-2);
  font: 17px/1.6 var(--sans);
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: underline 1px var(--accent-line);
  text-underline-offset: 3px;
  transition: text-decoration-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
a:hover { text-decoration-color: currentColor; }

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

strong { color: var(--ink); font-weight: 600; }

.page { max-width: calc(1068px + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* The same header on both pages: the bust from the app icon, the name, and
   the way to the other page. It stays at the top as you scroll, frosted edge
   to edge, with a hairline once the page has moved under it; what's in it
   lines up with the page below. */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--veil);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease-out);
}
.top[data-scrolled] { border-bottom-color: var(--rule); }
/* The same on both pages, so it doesn't move when you switch between them. */
.top-inner {
  max-width: var(--frame);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--bar);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.mark {
  width: 32px;
  height: 32px;
  background: currentColor;
  -webkit-mask: url("/plato-mark.svg") center / contain no-repeat;
  mask: url("/plato-mark.svg") center / contain no-repeat;
  transition: background-color 200ms var(--ease-out);
}
.brand:hover .mark { background: var(--accent); }
.top-link {
  padding: 12px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
}
.top-link:hover { color: var(--ink); }

h1 {
  font-size: clamp(44px, 11vw, 80px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--ink);
}

.label { font-size: 14px; font-weight: 600; color: var(--ink-3); }

/* Support */

.hero { padding: clamp(48px, 12vw, 120px) 0 clamp(40px, 8vw, 96px); }
.hero-text { margin-bottom: 40px; }
.lede {
  margin-top: 20px;
  max-width: 30ch;
  font-size: clamp(18px, 4.6vw, 21px);
  line-height: 1.5;
}

.mail {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 16px;
  padding: clamp(20px, 5vw, 28px);
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 18px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.mail:hover { border-color: var(--accent-line); }
.mail:active { transform: scale(0.99); }
/* The whole width, so on most phones the address fits on one line. */
.mail-address {
  grid-column: 1 / -1;
  font-size: clamp(19px, 5.3vw, 28px);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}
.mail-arrow {
  font-size: 20px;
  line-height: 12px;
  color: var(--accent);
  transition: transform 200ms var(--ease-out);
}
.mail:hover .mail-arrow { transform: translateX(4px); }
.mail-hint { margin-top: 12px; padding: 0 4px; font-size: 15px; color: var(--ink-3); }

.facts { border-top: 1px solid var(--rule); }
.fact {
  display: grid;
  gap: 8px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}
.fact h2 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Profile → Delete account, kept on one line. */
.path { white-space: nowrap; }

kbd {
  padding: 1px 7px;
  font: 500 0.875em var(--sans);
  color: var(--ink);
  white-space: nowrap;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 6px;
}

/* A tablet: the facts get a column for their names. */
@media (min-width: 720px) {
  .fact { grid-template-columns: 200px 1fr; gap: 24px; }
}

/* A computer: the heading beside the email, the facts side by side. */
@media (min-width: 960px) {
  .hero {
    display: grid;
    grid-template-columns: 1fr minmax(0, 500px);
    gap: 80px;
    align-items: end;
  }
  .hero-text { margin-bottom: 0; }
  .facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 80px;
    border-top: 0;
  }
  .fact {
    grid-template-columns: none;
    align-content: start;
    gap: 12px;
    border-top: 1px solid var(--rule);
    border-bottom: 0;
  }
}

/* Privacy policy */

.policy-head { padding: clamp(40px, 9vw, 88px) 0 8px; }
.policy-head h1 { font-size: clamp(38px, 9vw, 64px); }
.updated { margin-top: 16px; font-weight: 500; }
.intro {
  margin-top: 28px;
  font-size: clamp(18px, 4.6vw, 21px);
  line-height: 1.55;
  color: var(--ink);
}

.toc { margin: 40px 0 8px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.toc summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  list-style: none;
  cursor: pointer;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; font-size: 20px; font-weight: 400; line-height: 1; }
.toc[open] summary::after { content: "\2212"; }
.toc ol { list-style: none; padding-bottom: 16px; }
.toc a {
  display: block;
  padding: 7px 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink-2);
  text-decoration: none;
}
.toc a:hover { color: var(--accent); }

/* The policy and its footer share one column, so they line up. */
.policy-head, .policy-body, .policy .foot { max-width: var(--column); }
.policy-body { padding-bottom: 8px; }
.policy-body h2 {
  margin: 56px 0 14px;
  scroll-margin-top: calc(var(--bar) + 16px);
  font-size: clamp(22px, 5.4vw, 27px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.policy-body p,
.policy-body ul { margin-bottom: 16px; line-height: 1.7; }
.policy-body ul { padding-left: 20px; }
.policy-body li { margin-bottom: 12px; padding-left: 4px; }
.policy-body li::marker { color: var(--ink-3); }
.note {
  margin-bottom: 16px;
  padding: clamp(18px, 4.5vw, 24px);
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 18px;
  line-height: 1.7;
}

@media (min-width: 1040px) {
  body { font-size: 18px; }
}

/* With room beside the column, the contents stand at the left under the
   name in the header, and stay in view; the column, with its footer, is
   centred in the rest. */
@media (min-width: 1100px) {
  .policy { max-width: var(--frame); }
  .policy-grid {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    column-gap: 64px;
  }
  .policy-head, .policy-body, .policy .foot { grid-column: 2; justify-self: center; width: 100%; }
  .toc {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    position: sticky;
    top: calc(var(--bar) + 24px);
    margin: clamp(40px, 9vw, 88px) 0 0;
    border: 0;
  }
  .toc summary { pointer-events: none; padding-top: 4px; }
  .toc summary::after,
  .toc[open] summary::after { content: none; }
  .toc a { font-size: 15px; }
}

/* Both pages */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: clamp(72px, 12vw, 120px);
  padding: 24px 0 48px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink-3);
}
.foot nav { display: flex; gap: 24px; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.rise { animation: rise 700ms var(--ease-out) both; }
.rise-1 { animation-delay: 60ms; }
.rise-2 { animation-delay: 120ms; }
.rise-3 { animation-delay: 180ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
