/* Letters to Mat: one small stylesheet, no JavaScript (design doc §7). */

:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --fg: #1d1c1a;
  --muted: #6b675f;
  --link: #1f5fa8;
  --rule: #d9d5cc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --fg: #e9e6df;
    --muted: #a39e94;
    --link: #8ab8f0;
    --rule: #3a3833;
  }
}

html {
  background: var(--bg);
  color: var(--fg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.column {
  max-width: 38rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

main.column {
  padding-bottom: 1.5rem;
}

h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  font-weight: 600;
  margin: 1.5rem 0 1rem;
}

p {
  margin: 0 0 1.1rem;
}

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

.center {
  text-align: center;
}

.image {
  margin: 1.75rem 0;
  text-align: center;
}

.image img {
  max-width: 100%;
  height: auto;
  border-radius: 3px;
}

/* Rainbow text: a static gradient, darker hues on light backgrounds and brighter ones on dark. */
.rainbow {
  color: #b3261e;
  font-weight: 600;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .rainbow {
    background-image: linear-gradient(90deg, #b3261e, #b35300, #8a6d00, #2f7d32, #1f5fa8, #6a3fb5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  @media (prefers-color-scheme: dark) {
    .rainbow {
      background-image: linear-gradient(90deg, #ff6b6b, #ffa94d, #ffd43b, #69db7c, #4dabf7, #b197fc);
    }
  }
}

footer.signpost {
  padding-top: 1rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}

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

/* The note page. */
form {
  margin-bottom: 2rem;
}

label {
  font-weight: 600;
}

textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 0.6rem;
  margin-bottom: 1rem;
  border: 1px solid var(--muted);
  border-radius: 4px;
  background: transparent;
  color: inherit;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
}

legend {
  font-weight: 600;
  margin-bottom: 0.3rem;
}

fieldset label {
  display: block;
  font-weight: normal;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: normal;
}

button {
  font: inherit;
  padding: 0.5rem 1.4rem;
  border: 1px solid var(--muted);
  border-radius: 4px;
  background: var(--fg);
  color: var(--bg);
  cursor: pointer;
}
