/* What every page of theweald.app shares: the app's typeface and colours,
   the name at the top, and the foot. The home page has a look of its own on
   top of this; every other page is a page of words, laid out as the home
   page's tiles are, with the pieces below. */

/* Nunito, the app's one typeface, as the same variable font file. */
@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito.ttf") format("truetype");
  font-weight: 200 1000;
  font-display: swap;
}

/* The app's colours (ui/theme/Theme.kt in alconbury-weald/android), and
   the frame drawn round its screens and the green of the mark's trees. */
:root {
  --background: #F5F1E4;
  --on-background: #22261F;
  --on-surface-variant: #62635A;
  --primary: #2E6B3F;
  --on-primary: #FFFFFF;
  --primary-container: #E3EFE4;
  --on-primary-container: #0F3A1C;
  --card: #FFFFFF;
  --outline-variant: #DDD8C6;
  --tertiary: #8A5600;
  --on-tertiary: #FFFFFF;
  --tertiary-container: #FDF0D6;
  --frame: #1D201A;
  --leaf: #6DB37E;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #151712;
    --on-background: #E6E3D6;
    --on-surface-variant: #B5B3A3;
    --primary: #93D5A0;
    --on-primary: #003915;
    --primary-container: #223A28;
    --on-primary-container: #CDE8D3;
    --card: #24271F;
    --outline-variant: #3A3D34;
    --tertiary: #F2BE62;
    --on-tertiary: #442B00;
    --tertiary-container: #3D2E12;
    --frame: #0B0C09;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--on-background);
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.5;
}
a { color: inherit; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

/* The mark and the name, at the top of every page. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 1000;
  color: var(--primary);
  text-decoration: none;
}
.brand img { width: 44px; height: 44px; }

/* The foot of every page. */
footer { margin: 64px 0 0; padding: 0 16px 48px; text-align: center; font-size: 14px; }
footer a { color: var(--on-surface-variant); }
footer .coffee { margin: 0 0 12px; }

/* A page of words: one column, the name at its top, then big words saying
   what the page is, then a tile (.part) for each part of it. */
.page { max-width: 792px; margin: 0 auto; padding: 24px 16px 0; }
.intro { padding: 48px 0 24px; }
.intro h1 {
  margin: 0;
  font-size: clamp(44px, 9vw, 80px);
  font-weight: 1000;
  line-height: 1;
  letter-spacing: -0.035em;
}
.intro h1 em { font-style: normal; color: var(--primary); }
.intro p { margin: 20px 0 0; font-size: clamp(18px, 2.2vw, 21px); color: var(--on-surface-variant); }
.intro p + p { margin-top: 12px; }
.intro .updated { margin-top: 20px; font-size: 14px; }
.pill {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--tertiary-container);
  color: var(--tertiary);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.part {
  margin-top: 16px;
  padding: 28px;
  border-radius: 28px;
  background: var(--card);
  border: 1px solid var(--outline-variant);
  scroll-margin-top: 16px;
}
.part.green { background: var(--primary-container); border-color: transparent; }
.part.amber { background: var(--tertiary-container); border-color: transparent; }
@media (max-width: 600px) {
  .part { padding: 24px 20px; border-radius: 24px; }
}
.part h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 3.4vw, 30px);
  font-weight: 1000;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.part { font-size: 17px; }
.part p { margin: 0 0 12px; color: var(--on-surface-variant); }
.part p:last-child { margin-bottom: 0; }
.part ul { margin: 0 0 12px; padding-left: 20px; color: var(--on-surface-variant); }
.part ul li { margin-bottom: 6px; }
.part ul li::marker { color: var(--leaf); }
.page strong { color: var(--on-background); font-weight: 800; }
.page a:not(.button) { color: var(--primary); }
.updated { font-size: 14px; }

.button {
  display: inline-block;
  margin: 8px 0 12px;
  padding: 14px 24px;
  border-radius: 16px;
  background: var(--on-background);
  color: var(--background);
  font-size: 17px;
  font-weight: 1000;
  text-decoration: none;
  transition: translate 0.2s ease;
}
.button:hover { translate: 0 -2px; }
.button:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.button[hidden] { display: none; }
.buttons { display: flex; flex-wrap: wrap; gap: 0 12px; }

/* Steps to follow, each with its number in a green square. */
.steps { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: step; }
.steps > li {
  position: relative;
  min-height: 40px;
  padding-left: 56px;
  margin-bottom: 20px;
  color: var(--on-surface-variant);
  counter-increment: step;
}
.steps > li:last-child { margin-bottom: 0; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -6px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 20px;
  font-weight: 1000;
}
.steps .button { margin-bottom: 0; }
.hint {
  margin: 10px 0 0;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--card);
  color: var(--on-background);
  font-size: 15px;
}
.part .check {
  margin: 16px 0;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--tertiary-container);
  color: var(--on-background);
}

/* Questions, each opening on its answer. */
details { border-top: 1px solid var(--outline-variant); }
details:last-of-type { border-bottom: 1px solid var(--outline-variant); }
summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  color: var(--on-background);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--primary-container);
  color: var(--primary);
  font-weight: 1000;
}
details[open] summary::after { content: "\2212"; }
summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
details > p { margin-bottom: 12px; }
details > p:last-child { margin-bottom: 16px; }

/* What is on a long page, to jump to. */
.contents { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; }
.page .contents a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--outline-variant);
  color: var(--on-background);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}
.page .contents a:hover { border-color: var(--primary); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
