/* Sweet's own colours, light and dark, from the app. */
:root {
  --ink: #1a1717;
  --paper: #fcfcfc;
  --dot: #e8e8e8;
  --card: #ffffff;
  --line: #e2e2e2;
  --mute: #696969;
  --sweet: #ce1717;
  --sky: #1c6fa6;
  --on-sweet: #ffffff;
  color-scheme: light;
}

/* Dark follows the device, unless the "dark mode" switch in the introduction has chosen. The switch sets data-theme,
   so the same dark colours are listed twice. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ink: #f2eeee;
    --paper: #141212;
    --dot: #2a2626;
    --card: #1f1c1c;
    --line: #383333;
    --mute: #a59d9d;
    --sweet: #ff6b6b;
    --sky: #6db3e6;
    --on-sweet: #1a1717;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --ink: #f2eeee;
  --paper: #141212;
  --dot: #2a2626;
  --card: #1f1c1c;
  --line: #383333;
  --mute: #a59d9d;
  --sweet: #ff6b6b;
  --sky: #6db3e6;
  --on-sweet: #1a1717;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 0.8px, transparent 0.8px);
  background-size: 12px 12px;
  font-family: 'Ubuntu', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  transition: background-color 0.3s, color 0.3s;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* One reading column on plain paper, over the dotted background. */
.page {
  width: min(100% - 32px, 680px);
  margin: 0 auto;
  padding: 32px 0 48px;
}

a {
  color: var(--sky);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

/* The "dark mode" switch looks like the links around it. */
.theme-switch {
  padding: 0;
  border: 0;
  background: none;
  color: var(--sky);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  cursor: pointer;
}

.theme-switch:hover {
  color: var(--sweet);
}

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

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

header {
  margin-bottom: 40px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--sweet);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sweet);
  color: var(--on-sweet);
  font-size: 18px;
}

h1,
h2 {
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  font-size: clamp(30px, 5vw, 38px);
  margin: 0 0 20px;
}

h2 {
  font-size: 22px;
  margin: 48px 0 12px;
  color: var(--sweet);
}

h3 {
  font-size: 18px;
  margin: 0 0 12px;
}

p,
ul {
  margin: 0 0 16px;
}

ul {
  padding-left: 22px;
}

li {
  margin-bottom: 6px;
}

/* The price and the button to start a community. */
.start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin: 24px 0;
}

.button {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--sweet);
  color: var(--on-sweet);
  font-weight: 500;
  text-decoration: none;
}

.button:hover {
  color: var(--on-sweet);
  filter: brightness(1.08);
}

.soon {
  color: var(--mute);
}

/* Screenshots of the real app. */
figure {
  margin: 32px 0;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

figcaption {
  margin-top: 8px;
  color: var(--mute);
  font-size: 14px;
}

/* The phone screenshot beside its text, or under it on a narrow screen. The section's own margin replaces its heading's,
   so the screenshot's top lines up with the heading. */
.phone {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 24px;
  align-items: start;
  margin-top: 48px;
}

.phone h2 {
  margin-top: 0;
}

.phone figure {
  margin: 0;
}

@media (max-width: 560px) {
  .phone {
    grid-template-columns: 1fr;
  }

  .phone figure {
    max-width: 240px;
  }
}

/* The photo of the person who makes Sweet, the full width of the column. */
.me {
  margin: 8px 0 24px;
}

footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: 15px;
}

footer p {
  margin-bottom: 6px;
}
