/* Wemazi, in the look of the Which & Why apps: paper for the page, chalk on slate for what matters,
   Georgia for headlines, Avenir Next for reading, and a gold edge on the cards. Colours from the apps' theme. */
:root {
  --paper: #f8f7f2;
  --panel: #ecf0ee;
  --raised: #ffffff;
  --ink: #172220;
  --muted: #5e6e6b;
  --line: #d6dedb;
  --accent: #1f6f6a;
  --gold: linear-gradient(135deg, #a8905b 0%, #decfa3 21%, #f1e6c6 30%, #bca16a 47%, #a58b55 63%, #e4d5ad 83%, #b99d64 100%);

  /* The slates are the same in both appearances, as in the apps. */
  --green: #053d30;
  --green-edge: #001c1b;
  --green-card: #064033;
  --green-tint: #c4e8b0;
  --blue: #0f2145;
  --blue-edge: #09162d;
  --blue-tint: #c7dbf7;
  --chalk: #f2efe6;
  --chalk-dim: rgba(242, 239, 230, 0.6);
  --progress: #d1e0a3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1211;
    --panel: #161e1c;
    --raised: #1c2624;
    --ink: #e8eeec;
    --muted: #8c9e9a;
    --line: #2b3836;
    --accent: #62c6be;
    --gold: linear-gradient(135deg, #8d784c 0%, #bcab7f 21%, #cfc099 30%, #a28858 47%, #897247 63%, #c1b189 83%, #9f8553 100%);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: normal; text-wrap: balance; }

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent);
}

/* Navigation: the apps' masthead */
.nav-inner {
  max-width: 1000px; margin: 0 auto; padding: 22px 22px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { color: var(--ink); font-size: 16px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 22px; font-size: 15px; }
.nav-links a { color: var(--muted); font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); text-decoration: none; }

/* Slate: chalk on a dark board with a faint grid, darker at the edges, lit from above. */
.slate {
  color: var(--chalk);
  border: 1.25px solid transparent;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 50%) padding-box,
    radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.3) 100%) padding-box,
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 22px) padding-box,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 22px) padding-box,
    linear-gradient(135deg, var(--slate), var(--slate-edge)) padding-box,
    var(--gold) border-box;
}
.slate .eyebrow { color: var(--tint); }
.green { --slate: var(--green); --slate-edge: var(--green-edge); --tint: var(--green-tint); }
.blue { --slate: var(--blue); --slate-edge: var(--blue-edge); --tint: var(--blue-tint); }

/* Home */
.home { max-width: 1000px; margin: 0 auto; padding: 28px 22px 0; }

.hero { border-radius: 28px; padding: 56px 48px; box-shadow: 0 18px 40px rgba(0, 42, 40, 0.14); }
.hero h1 { margin-top: 14px; font-size: 54px; line-height: 1.08; letter-spacing: -1.2px; max-width: 760px; }
.hero .lead { margin-top: 26px; max-width: 620px; font-size: 19px; color: var(--chalk-dim); }

.stages { margin-top: 34px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 620px; }
.stage .bar { display: block; height: 4px; border-radius: 2px; background: rgba(242, 239, 230, 0.17); }
.stage.done .bar { background: var(--progress); }
.stage .label { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 14px; font-weight: 500; color: var(--chalk-dim); white-space: nowrap; }
.stage.done .label { color: var(--chalk); }
.stage .dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; }
.stage.done .dot { background: var(--progress); border-color: var(--progress); }

.apps { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.app-card { border-radius: 24px; padding: 34px 32px 36px; }
.app-card h2 { margin-top: 10px; font-size: 32px; line-height: 1.15; letter-spacing: -0.6px; }
.app-card p:last-child { margin-top: 8px; color: var(--chalk-dim); }
.app-card:only-child { grid-column: 1 / -1; }
.app-card .app-sub { margin-top: 8px; color: var(--chalk-dim); }
.app-card .units { margin-top: 28px; padding-top: 22px; border-top: 1px solid rgba(242, 239, 230, 0.16); }
.app-card .units-title { font-size: 15px; color: var(--chalk-dim); }
.app-card .units-list { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 36px; }
.app-card .units-list p { margin: 0; color: inherit; }
.app-card .units-list a { display: block; padding: 9px 0; color: var(--chalk); border-bottom: 1px solid rgba(242, 239, 230, 0.09); }
.app-card .units-list a:hover { color: var(--tint); text-decoration: none; }

.section { margin-top: 88px; }
.section > h2 { font-size: 36px; line-height: 1.15; letter-spacing: -0.8px; max-width: 640px; }
.section > p { margin-top: 12px; max-width: 620px; color: var(--muted); font-size: 18px; }

.steps { margin-top: 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { background: var(--raised); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.step h3 { font-size: 18px; font-weight: 600; }
.step p { margin-top: 6px; color: var(--muted); }
.section > .more { margin-top: 18px; font-size: 17px; }

/* The way into the science page: a gold-edged card with the forgetting curve in miniature, drawn again on hover. */
.sci-link {
  margin-top: 22px; display: grid; grid-template-columns: 132px 1fr 48px; align-items: center; gap: 26px;
  padding: 26px 28px; border-radius: 24px; color: var(--ink);
  border: 1.25px solid transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--gold) border-box;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.sci-link:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 16px 34px rgba(0, 42, 40, 0.14); }
.sci-spark { width: 132px; height: 70px; overflow: visible; }
.sci-spark path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sci-spark .faint { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: 0.6; }
.sci-spark .bright { stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 1; }
.sci-spark circle { fill: var(--accent); }
.sci-link:hover .sci-spark .bright { animation: sci-draw 1.1s ease-out; }
@keyframes sci-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.sci-text { display: grid; gap: 4px; }
.sci-title { font-family: Georgia, "Times New Roman", serif; font-size: 30px; line-height: 1.15; letter-spacing: -0.6px; }
.sci-desc { color: var(--muted); max-width: 520px; }
.sci-go {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--accent); color: var(--accent); transition: background 0.25s, color 0.25s, transform 0.25s;
}
.sci-go svg { width: 20px; height: 20px; }
.sci-link:hover .sci-go { background: var(--accent); color: var(--paper); transform: translateX(4px); }

.free {
  margin-top: 88px; border-radius: 24px; padding: 40px 36px;
  border: 1.25px solid transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--gold) border-box;
}
.free h2 { font-size: 34px; letter-spacing: -0.8px; }
.free p { margin-top: 10px; max-width: 620px; color: var(--muted); font-size: 18px; }

/* Support and privacy */
.article { max-width: 700px; margin: 0 auto; padding: 56px 22px 0; }
.article h1 { font-size: 46px; line-height: 1.1; letter-spacing: -1px; margin-bottom: 18px; }
.article h2 { font-size: 26px; line-height: 1.2; letter-spacing: -0.4px; margin: 48px 0 12px; }
.article h3 { font-size: 17px; font-weight: 600; margin: 26px 0 4px; }
.article p, .article ul { margin-bottom: 14px; }
.article ul { padding-left: 22px; }
.article li { margin-bottom: 6px; }
.article .intro { font-size: 20px; line-height: 1.45; color: var(--muted); }
.article .note { font-size: 14px; color: var(--muted); }

/* Questions sit in one card, as the apps group their settings. */
.faq { background: var(--raised); border: 1px solid var(--line); border-radius: 22px; padding: 0 26px; }
.qa { padding: 22px 0 8px; border-bottom: 1px solid var(--line); }
.qa:last-child { border-bottom: none; }
.qa h3 { margin-top: 0; }

/* Footer */
.footer { max-width: 1000px; margin: 96px auto 0; padding: 22px 22px 44px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; color: var(--muted); }
.footer a { color: var(--muted); font-weight: 500; }
.footer a:hover { color: var(--ink); }

@media (max-width: 760px) {
  .sci-link { grid-template-columns: 1fr 44px; gap: 14px 16px; padding: 22px 20px; }
  .sci-spark { grid-column: 1 / -1; width: 110px; height: 58px; }
  .sci-title { font-size: 25px; }
  .sci-go { width: 44px; height: 44px; align-self: end; }
  .nav-inner { flex-wrap: wrap; row-gap: 8px; }
  .nav-links { gap: 15px; font-size: 14px; }
  .hero { padding: 34px 20px 30px; border-radius: 24px; }
  .hero h1 { font-size: 36px; letter-spacing: -0.6px; }
  .hero .lead { font-size: 17px; }
  .stages { gap: 8px; }
  .stage .label { font-size: 11px; gap: 4px; }
  .stage .dot { width: 9px; height: 9px; }
  .apps, .steps { grid-template-columns: 1fr; }
  .app-card .units-list { grid-template-columns: 1fr; }
  .app-card { padding: 28px 24px 30px; }
  .app-card h2 { font-size: 28px; }
  .section, .free { margin-top: 64px; }
  .section > h2, .free h2 { font-size: 30px; }
  .free { padding: 30px 24px; }
  .article { padding-top: 36px; }
  .article h1 { font-size: 36px; }
  .faq { padding: 2px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .sci-link, .sci-go { transition: none; }
  .sci-link:hover .sci-spark .bright { animation: none; }
}
