/* Everyvore's public shell.
 *
 * Hand-written CSS rather than the app's Tailwind build, because these two pages must render
 * without a build step and without JavaScript. `/bot` in particular is read by a webmaster
 * deciding whether to block us, quite possibly in a text browser or with scripts off, and an
 * obligation discharged only when a bundle resolves is not discharged.
 *
 * Tokens are copied from `apps/web/src/index.css` (ADR-019) rather than imported. Two copies is a
 * real cost; the alternative is coupling a static page to a Tailwind pipeline it does not
 * otherwise need. If the palette moves, move it here too.
 */

:root {
  --ground: #f5f4f0;
  --paper: #ffffff;
  --ink: #16221c;
  --ink-soft: #48524b;
  --ink-faint: #767f78;
  --rule: #dedcd3;
  --rule-soft: #ecebe4;
  --tide: #0f6e64;
  --tide-deep: #0a4f48;
  --tide-wash: #e4efec;
  --sans:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --quote:
    ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", "Roboto Mono", Menlo, Consolas,
    monospace;
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 5rem;
}

/* The wordmark. Small caps and wide tracking rather than a logo we do not have. */
.mark {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tide-deep);
  text-decoration: none;
}

.mark::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 0.5rem;
  background: var(--tide);
}

h1 {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 2rem 0 0.75rem;
}

h2 {
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 2.75rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

h3 {
  font-size: 1rem;
  margin: 1.75rem 0 0.4rem;
}

p {
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.1875rem;
  color: var(--ink-soft);
}

a {
  color: var(--tide-deep);
  text-underline-offset: 0.18em;
}

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

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

ul {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
}

li {
  margin-bottom: 0.4rem;
}

/* The one place these pages raise their voice, for the same reason the app does: this is a string
   as it will actually appear, unedited. */
.ua {
  display: block;
  font-family: var(--quote);
  font-size: 0.9375rem;
  line-height: 1.5;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--tide);
  border-radius: 3px;
  padding: 0.85rem 1rem;
  margin: 0 0 1rem;
  overflow-wrap: anywhere;
}

code {
  font-family: var(--quote);
  font-size: 0.9em;
  background: var(--rule-soft);
  border-radius: 3px;
  padding: 0.1em 0.35em;
}

pre {
  font-family: var(--quote);
  font-size: 0.9375rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.85rem 1rem;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

dl {
  margin: 0 0 1rem;
  border-top: 1px solid var(--rule-soft);
}

dt {
  font-weight: 600;
  font-size: 0.9375rem;
  padding-top: 0.75rem;
}

dd {
  margin: 0 0 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-soft);
}

.note {
  background: var(--tide-wash);
  border-radius: 3px;
  padding: 1rem 1.15rem;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

.note :last-child {
  margin-bottom: 0;
}

footer {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--ink-faint);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #121915;
    --paper: #182220;
    --ink: #eaeee9;
    --ink-soft: #b3bcb5;
    --ink-faint: #8c958e;
    --rule: #2b3833;
    --rule-soft: #222d29;
    --tide: #4fb3a5;
    --tide-deep: #7fcabd;
    --tide-wash: #1b2a27;
  }
}
