/*
  style.css: how your site looks.

  Each block below starts with a "selector" (which parts of the page it applies to),
  followed by { properties } in curly brackets. Change a value, save, and reload the page.

  The colours are chosen so text has enough contrast to be easy to read.
  Every text and link colour here, light and dark, has a contrast of at least 6.6 to 1.
  If you change them, check the contrast with a contrast checker (aim for 4.5 to 1 or more).
*/

/* Colours, in one place. Change these to restyle the whole site. */
:root {
  --background: #fdfcf8;
  --text: #1f1d1a;
  --muted: #4f4a42;
  --accent: #0b5d4f;      /* used for links */
  --accent-soft: #e3f0ec;
}

/* Darker colours when someone's computer is set to dark mode. */
@media (prefers-color-scheme: dark) {
  :root {
    --background: #161513;
    --text: #f2efe8;
    --muted: #c9c3b8;
    --accent: #7fd1bd;
    --accent-soft: #1f2d29;
  }
}

/* The whole page. */
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  /* Long words and web addresses wrap instead of running off narrow screens. */
  overflow-wrap: break-word;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 3rem 1.25rem;
}

h1 {
  font-size: 2.5rem;
  line-height: 1.15;
  margin: 0 0 0.5rem;
}

/* Headings and links may break inside a long word as a last resort, so a long
   name or web address never runs off a narrow screen. (Automatic hyphens are left
   off on purpose: in Safari they stop this wrapping from working.) */
h1,
h2,
a {
  overflow-wrap: anywhere;
}

/* On narrow screens, or when text is set very large, the main heading is a little smaller.
   It still grows with the person's text-size setting, because it's measured in rem. */
@media (max-width: 30em) {
  h1 {
    font-size: 2rem;
  }
}

h2 {
  font-size: 1.4rem;
  margin: 0 0 0.75rem;
}

section {
  margin-bottom: 3rem;
}

.tagline {
  font-size: 1.25rem;
  color: var(--muted);
  margin: 0;
}

/* Links: underlined so they don't rely on colour alone. */
a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

/* A clear outline around whatever has keyboard focus. */
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.links li {
  margin-bottom: 0.75rem;
}

.links a {
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.9rem;
  background: var(--accent-soft);
  border-radius: 0.5rem;
}

footer {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  color: var(--muted);
  font-size: 1rem;
  border-top: 1px solid var(--accent-soft);
}

/* The skip link stays hidden until someone presses Tab. */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--background);
}

.skip-link:focus {
  top: 1rem;
}

/* Respect people who ask their computer for less motion. */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
