/* muizi.com (English) and muizi.net (Finnish): one page in two languages.
 *
 * Two voices, two faces. Muizi talks in the game's own sans — its questions,
 * its replies, its buttons. What a person brings (a page of a textbook, a
 * book, a transcript) is set in a book serif, because it is someone else's
 * text. The colours are the game's: paper, ink, the blue of a question, the
 * green of right and the red of wrong. The highlighter is the one the game
 * marks key words with. */

:root {
  --ink: #16161d;
  --paper: #fbf7f0;
  --sheet: #fffdf8;
  --ask: #2b4cf0;
  --right: #0f7b4a;
  --wrong: #b4341f;
  --aside: #6b6459;
  --rule: #e4ddd0;
  --bubble: #f2ece1;
  --marker: #ffe9a8;
  --measure: 34rem;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--sans);
  font-feature-settings: "ss01";
}

img, video { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--ask); outline-offset: 3px; border-radius: 4px; }

.wrap {
  width: min(100% - 2rem, 70rem);
  margin-inline: auto;
}

/* ── top ─────────────────────────────────────────────────────────────── */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}
.mark { font-weight: 600; font-size: 1.5rem; letter-spacing: -0.02em; text-decoration: none; }
.lang { font-size: 0.95rem; }
.top-nav { display: flex; align-items: center; gap: 1.1rem; }
/* The way into the game for someone who already has an account: small next
   to the page's own "Play now", but always in the same corner. */
.signin-btn {
  display: inline-block;
  max-width: 12rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font: 600 0.95rem/1.2 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.signin-btn:hover { background: var(--ink); color: var(--paper); }

/* ── hero: the promise, asked as a question ─────────────────────────── */

.hero {
  display: grid;
  gap: 2rem 4rem;
  padding-block: 2rem 4.5rem;
}
@media (min-width: 60rem) {
  .hero { grid-template-columns: 1.1fr 1fr; align-items: center; padding-block: 3.5rem 6rem; }
}

h1 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(3.1rem, 11vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.lead {
  max-width: 30rem;
  margin: 1.25rem 0 2rem;
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--ink);
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.go {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--ask);
  border-radius: 12px;
  background: var(--ask);
  color: #fff;
  font: 600 1.05rem/1.2 var(--sans);
  text-decoration: none;
}
.go:hover { background: #1f3bd0; }
.go.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.go.ghost:hover { border-color: var(--ink); }

/* The question card is the game's card: paper with an edge, a blue rule
   down the side that turns green or red once it is answered. */
.card {
  position: relative;
  padding: 1.4rem 1.4rem 1.25rem 1.6rem;
  border: 1px solid var(--ink);
  border-radius: 0 18px 18px 0;
  background: #fff;
  box-shadow: inset 5px 0 0 var(--ask);
  transition: box-shadow 0.25s ease;
}
.card.is-right { box-shadow: inset 5px 0 0 var(--right); }
.card.is-wrong { box-shadow: inset 5px 0 0 var(--wrong); }
.card-ask { margin: 0 0 1rem; font-size: 1.45rem; line-height: 1.25; letter-spacing: -0.01em; }
.card-ask b { font-weight: 650; }

.choices { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.choice {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: 400 1.05rem/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.choice:hover:not(:disabled) { border-color: var(--ink); }
.choice:disabled { cursor: default; }
.choice.right { border-color: var(--right); background: #edf6f0; }
.choice.wrong { border-color: var(--wrong); background: #fbeceb; }
.choice.dim { color: #9c958a; }

/* Muizi's reply: a bubble, no edge. */
.say {
  max-width: 28rem;
  margin: 0.9rem 0 0;
  padding: 0.8rem 1.1rem;
  border-radius: 18px;
  background: var(--bubble);
}
.say[hidden] { display: none; }
.say + .say { margin-top: 0.5rem; }

/* ── sections ────────────────────────────────────────────────────────── */

section { padding-block: 4rem; border-top: 1px solid var(--rule); }
h2 {
  max-width: 24ch;
  margin: 0 0 0.75rem;
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.intro { max-width: var(--measure); margin: 0 0 2.5rem; color: var(--aside); font-size: 1.125rem; }

/* ── what goes in, what comes out ───────────────────────────────────── */

.sources { display: grid; gap: 3.5rem; margin: 0; padding: 0; list-style: none; }
.source { display: grid; gap: 1rem 3rem; align-items: center; }
@media (min-width: 52rem) {
  .source { grid-template-columns: 1fr 1fr; }
}
.source h3 { margin: 0 0 0.9rem; font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; }
.source .note { max-width: 26rem; margin: 0.9rem 0 0; color: var(--aside); font-size: 0.95rem; }

/* What a person brings, in a book's type. */
.material { font-family: var(--serif); font-size: 1.05rem; line-height: 1.65; }
.material mark { background: var(--marker); color: inherit; padding: 0 0.12em; border-radius: 2px; }

/* A phone photo of a page: a little askew, the pencil line under it. */
.photo {
  max-width: 26rem;
  padding: 1.3rem 1.4rem 1.5rem;
  background: var(--sheet) repeating-linear-gradient(transparent 0 calc(1.65em - 1px), #efe8da calc(1.65em - 1px) 1.65em);
  background-position: 0 1.3rem;
  border: 1px solid var(--rule);
  box-shadow: 0 1px 0 var(--rule), 0 12px 24px -18px rgba(22, 22, 29, 0.45);
  transform: rotate(-1.2deg);
}
.photo p { margin: 0; }
.photo .page { display: block; margin-top: 0.75rem; font-size: 0.8rem; color: var(--aside); font-variant-numeric: oldstyle-nums; }
.photo u { text-decoration-color: #5b5b66; text-decoration-thickness: 1.5px; text-underline-offset: 0.2em; }

/* A book, by its name. */
.book {
  display: inline-block;
  padding: 1.3rem 1.6rem 1.3rem 1.3rem;
  border-left: 10px solid #3a3346;
  border-radius: 3px 8px 8px 3px;
  background: var(--sheet);
  box-shadow: 0 0 0 1px var(--rule);
}
.book cite { display: block; font-style: italic; font-size: 1.35rem; line-height: 1.2; }
.book span { display: block; margin-top: 0.3rem; font-size: 0.95rem; color: var(--aside); }

/* A transcript, pasted in. */
.transcript { max-width: 26rem; margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--rule); }
.transcript li { display: grid; grid-template-columns: 3.4rem 1fr; gap: 0.5rem; padding: 0.15rem 0 0.15rem 1rem; }
.transcript time { font-family: var(--sans); font-size: 0.85rem; color: var(--aside); font-variant-numeric: tabular-nums; padding-top: 0.2em; }

/* A goal is what someone types to Muizi, so it is their bubble. */
.me {
  justify-self: end;
  max-width: 24rem;
  margin: 0 0 0 auto;
  padding: 0.8rem 1.1rem;
  border-radius: 18px;
  background: var(--ink);
  color: var(--paper);
}
@media (min-width: 52rem) { .me { margin: 0; } }

.source .card { max-width: 30rem; }
.source .card-ask { margin: 0; font-size: 1.2rem; }

/* ── cases ───────────────────────────────────────────────────────────── */

.cases { display: grid; gap: 1.25rem; max-width: 44rem; margin: 0; padding: 0; list-style: none; }
.cases li { padding-left: 1.25rem; border-left: 3px solid var(--rule); font-size: 1.3rem; line-height: 1.35; }
.cases b { font-weight: 650; font-variant-numeric: lining-nums tabular-nums; }

/* ── see it ──────────────────────────────────────────────────────────── */

.watch { display: grid; gap: 2.5rem 4rem; align-items: start; }
@media (min-width: 60rem) { .watch { grid-template-columns: auto 1fr; } }

.phone {
  width: min(100%, 19rem);
  margin: 0;
  padding: 9px;
  border-radius: 38px;
  background: var(--ink);
}
.phone video, .phone img { width: 100%; aspect-ratio: 390 / 844; border-radius: 30px; background: var(--paper); object-fit: cover; }
.phone figcaption { padding: 0.6rem 0.5rem 0.2rem; color: #c9c3b8; font-size: 0.9rem; text-align: center; }

.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(12rem, 1fr);
  gap: 1.25rem;
  margin: 0;
  padding: 0 0 0.75rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}
.shots li { scroll-snap-align: start; }
.shots figure { margin: 0; }
.shots img { border: 1px solid var(--rule); border-radius: 22px; aspect-ratio: 390 / 844; background: #fff; }
.shots figcaption { margin-top: 0.75rem; font-size: 0.95rem; color: var(--aside); max-width: 18rem; }
.shots figcaption b { color: var(--ink); font-weight: 600; }

/* ── the rest ────────────────────────────────────────────────────────── */

.facts {
  display: grid;
  gap: 0.25rem 3rem;
  max-width: 52rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 44rem) { .facts { grid-template-columns: 1fr 1fr; } }
.facts li { padding: 0.9rem 0; border-bottom: 1px solid var(--rule); font-size: 1.1rem; }

.again { display: grid; gap: 1.5rem; }
.again p { margin: 0; max-width: var(--measure); font-size: 1.25rem; }

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--rule);
  color: var(--aside);
  font-size: 0.95rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── pricing ─────────────────────────────────────────────────────────── */
/* Three sheets of paper side by side; the family plan, the one most homes
   want, carries the question's blue edge. */

.plans {
  display: grid;
  gap: 1rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
@media (min-width: 52rem) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.4rem 1.4rem 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--sheet);
}
.plan.featured { border-color: var(--ink); box-shadow: inset 5px 0 0 var(--ask); }
.plan h3 { margin: 0; font-size: 1.2rem; font-weight: 650; }
.plan p { margin: 0; }
.plan .price { font-size: 1.05rem; color: var(--aside); }
.plan .price b { font-size: 2rem; font-weight: 650; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: lining-nums; }
.plan ul { margin: 0.2rem 0 0.4rem; padding-left: 1.1rem; color: var(--aside); font-size: 0.98rem; }
.plan ul li + li { margin-top: 0.3rem; }
.plan .go { margin-top: auto; text-align: center; }
#pricing > .note, #hinnat > .note { max-width: var(--measure); color: var(--aside); font-size: 0.95rem; }
