/* Dial website. Colours come from the app icon: a walnut band over a graphite grinder dial
   with chalk-white ticks, and the app's own green for links. No web fonts, so the site
   makes no requests to anyone else. */

:root {
  --graphite: #262220;
  --graphite-deep: #1d1a18;
  --walnut: #6e4428;
  --walnut-light: #93613d;
  --chalk: #efe7dc;
  --steam: #a89f95;
  --leaf: #5eb59e;
  --rounded: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --measure: 38rem;
}

* { box-sizing: border-box; }

html { background: var(--graphite); }

body {
  margin: 0;
  color: var(--chalk);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--leaf); text-underline-offset: 0.18em; }
a:hover { color: var(--chalk); }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 3px; border-radius: 3px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--chalk); color: var(--graphite); padding: 0.5rem 0.75rem; z-index: 2; }

/* ---- The walnut band across the top, like the top of the icon ---- */

.band {
  background:
    repeating-linear-gradient(178deg, transparent 0 9px, rgba(0, 0, 0, 0.09) 9px 11px, transparent 11px 23px),
    repeating-linear-gradient(181deg, transparent 0 31px, rgba(255, 220, 180, 0.06) 31px 33px),
    linear-gradient(180deg, var(--walnut-light), var(--walnut));
  border-bottom: 3px solid #3c2617;
}

.band nav {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.band .home {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  color: var(--chalk);
  text-decoration: none;
  font: 700 1.3rem/1 var(--rounded);
  letter-spacing: 0.01em;
}
.band .home img { width: 2rem; height: 2rem; border-radius: 0.5rem; }

.band nav > a:not(.home) { color: var(--chalk); text-decoration: none; font-size: 0.95rem; opacity: 0.85; }
.band nav > a:not(.home):hover, .band nav > a[aria-current] { opacity: 1; text-decoration: underline; }

/* ---- The dial: a grind scale, 0 to 30, that turns and settles on 15 when the page loads ---- */

.dial {
  position: relative;
  height: 9.5rem;
  overflow: hidden;
  background: linear-gradient(180deg, #2d2926, var(--graphite) 70%);
  border-bottom: 1px solid #3a3431;
}

.dial svg.scale {
  position: absolute;
  top: 1.4rem;
  left: 50%;
  height: 6rem;
  width: auto;
  --settle: -93rem; /* minus the "15" tick's distance from the left at this height */
  transform: translateX(var(--settle));
  animation: settle 1.8s cubic-bezier(0.2, 0.75, 0.2, 1) 0.25s both;
}

.dial .needle {
  position: absolute;
  left: 50%;
  top: 6.2rem;
  width: 4px;
  height: 2.2rem;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--chalk);
}

@keyframes settle {
  from { transform: translateX(calc(var(--settle) + 24rem)); }
  to { transform: translateX(var(--settle)); }
}

@media (prefers-reduced-motion: reduce) {
  .dial svg.scale { animation: none; }
}

/* ---- Page body ---- */

main { max-width: 64rem; margin: 0 auto; padding: 3rem 1.5rem 4rem; }

.lede { max-width: var(--measure); }

h1, h2, h3 { font-family: var(--rounded); font-weight: 700; line-height: 1.15; margin: 0; }

h1 { font-size: clamp(2.6rem, 6vw, 4.25rem); letter-spacing: -0.015em; }
.lede p { font-size: 1.2rem; color: #d9cfc4; margin: 1.1rem 0 0; }

h2 { font-size: 1.65rem; margin-top: 4.5rem; }
h3 { font-size: 1.15rem; }

/* What Dial does: settings on a scale, each with a tick, not boxes */
.uses {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 2rem 3rem;
}
.uses li {
  position: relative;
  padding-left: 1.6rem;
}
.uses li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2rem;
  width: 4px;
  height: 1.35rem;
  border-radius: 2px;
  background: var(--chalk);
}
.uses li:nth-child(even)::before { height: 0.9rem; top: 0.42rem; background: var(--steam); }
.uses p { margin: 0.35rem 0 0; color: #d9cfc4; max-width: 30rem; }

/* The brewer wall */
.brewers-intro { max-width: var(--measure); color: #d9cfc4; margin: 0.8rem 0 0; }
.brewers {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 1.75rem 1rem;
}
.brewers li { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; text-align: center; }
.brewers img { width: 4rem; height: 4rem; }
.brewers span { font-size: 0.8rem; line-height: 1.3; color: var(--steam); }

.note {
  margin-top: 4.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #3a3431;
  max-width: var(--measure);
}
.note p { margin: 0.6rem 0 0; color: #d9cfc4; }

/* ---- Policy pages ---- */

.doc { max-width: var(--measure); }
.doc h1 { font-size: clamp(2.2rem, 5vw, 3rem); }
.doc .updated { color: var(--steam); margin: 0.6rem 0 2.5rem; }
.doc h2 { font-size: 1.35rem; margin: 2.5rem 0 0.4rem; }
.doc p, .doc li { color: #ded5ca; }
.doc ul { padding-left: 1.2rem; }
.doc li { margin: 0.35rem 0; }
.doc strong { color: var(--chalk); }
.doc ol { padding-left: 1.4rem; }

/* ---- Footer ---- */

footer {
  border-top: 1px solid #3a3431;
  background: var(--graphite-deep);
}
footer div {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  color: var(--steam);
  font-size: 0.9rem;
}
footer a { color: var(--steam); }
footer a:hover { color: var(--chalk); }
footer .made { margin-right: auto; }

@media (max-width: 40rem) {
  .band nav { gap: 1rem; }
  .band nav > a:not(.home) { font-size: 0.875rem; }
  main { padding-top: 2.25rem; }
  .dial { height: 8rem; }
  .dial svg.scale { height: 5rem; top: 1.2rem; --settle: -77.5rem; }
  .dial .needle { top: 5.2rem; height: 2rem; }
}
.note h2 { margin-top: 0; font-size: 1.2rem; }
