/* THE QUESTIONS PAGE (/questions): the homepage's tokens, header and ground; Explore's stage and plate. Breakpoints: 1339 (plate under the stage), 1099 (chips for the list), 759 (phone). */
:root {
  --ink-2: var(--ink-secondary);
  --ink-3: var(--ink-muted);
  --ink-4: var(--ink-detail);
  --faint: var(--ink-faint);
  --fill: var(--canvas-fill);
  --border: var(--canvas-border);
  --accent-pressed: #395443; /* the app's accent.pressed, as get.css */
  --accent-subtle: #d9e9cf; /* the app's accent.subtle */
  --ground: #7bab67; /* the homepage's FIRST_GROUND */
  --sans: var(--font-sans);
  --mono: var(--font-mono);
}
body.qp {
  overflow-wrap: break-word;
}
h1,
h2,
h3,
p,
figure,
ul {
  margin: 0;
}
ul {
  padding: 0;
  list-style: none;
}
button {
  font: inherit;
  color: inherit;
}
.qp :where(a) {
  color: inherit;
}

/* ───────── the stage: Explore's, shorter (576 x 170 units) ───────── */
.stage {
  position: relative;
  margin: 20px var(--px) 0;
}
.stage .pic {
  position: relative;
  aspect-ratio: 576 / 170;
  overflow: hidden;
  border-radius: 20px;
  background: #edf3f9;
}
.stage .pic > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.plate {
  position: absolute;
  left: 24px;
  bottom: 24px;
  background: var(--canvas);
  border-radius: 14px;
  padding: 14px 22px 16px;
  display: grid;
  gap: 2px;
  max-width: 440px;
}
.plate h1 {
  font: 700 40px / 44px var(--sans);
  letter-spacing: -1.1px;
}
.plate .line {
  font: 400 17px / 24px var(--sans);
  color: var(--ink-2);
  letter-spacing: -0.2px;
}
/* the signpost's boards are links to their groups */
.stage .sl {
  cursor: pointer;
}
.stage .sl text {
  transition: fill 0.15s;
}
.stage .sl:hover text,
.stage .sl:focus-visible text {
  text-decoration: underline;
}

/* idle motion, in the drawing's own units; nothing moves without motion */
.stage svg .mv > g {
  transform-box: fill-box;
}
.stage svg .mv-clouds > g {
  animation: drift 46s ease-in-out infinite alternate;
}
.stage svg .mv-gulls > g {
  animation: glide 22s ease-in-out infinite alternate;
}
.stage svg .mv-doghead > g {
  transform-origin: 22% 92%;
  animation: cock 6s ease-in-out infinite;
}
@keyframes drift {
  from {
    transform: translateX(-14px);
  }
  to {
    transform: translateX(22px);
  }
}
@keyframes glide {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(-40px, -6px);
  }
}
@keyframes cock {
  0%,
  40% {
    transform: rotate(0deg);
  }
  50%,
  78% {
    transform: rotate(12deg);
  }
  88%,
  100% {
    transform: rotate(0deg);
  }
}

/* ───────── the desk: the sticky list of groups, the groups as cards ───────── */
.body {
  margin: 48px var(--px) 0;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 32px;
  display: grid;
  gap: 4px;
}
.toc .cap {
  font: 600 11px / 14px var(--mono);
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin: 0 0 10px 14px;
}
.toc a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  font: 500 16px / 20px var(--sans);
  letter-spacing: -0.2px;
  color: var(--ink-2);
  text-decoration: none;
  position: relative;
  transition: background 0.2s, color 0.2s;
}
.toc a .n {
  font: 500 13px var(--sans);
  color: var(--ink-4);
}
.toc a:hover {
  background: var(--fill);
}
.toc a.on {
  background: var(--soft);
  color: var(--ink);
  font-weight: 600;
}
.toc a.on::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.toc a:focus-visible,
.chip:focus-visible,
.qx summary:focus-visible,
.start:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.groups {
  display: grid;
  gap: 28px;
}
.group {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 32px 12px;
  scroll-margin-top: 24px;
}
.ghead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 12px;
}
.ghead h2 {
  font: 700 30px / 34px var(--sans);
  letter-spacing: -0.8px;
}
.ghead .gsub {
  font: 400 15px / 20px var(--sans);
  color: var(--ink-3);
  margin-top: 6px;
}
.vig {
  width: 180px;
  flex: none;
  aspect-ratio: 120 / 76;
  border-radius: 14px;
  background: var(--soft);
  overflow: hidden;
}
.vig svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* a question: one row, one chevron, the answer opening in place */
.qx {
  border-top: 1px solid var(--border);
}
.qx summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  cursor: pointer;
  font: 600 19px / 26px var(--sans);
  letter-spacing: -0.3px;
  border-radius: 6px;
}
.qx summary::-webkit-details-marker {
  display: none;
}
.qx summary:hover span {
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 4px;
}
.chev {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--fill);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  transition: transform 0.28s ease, background 0.2s;
}
.qx[open]:not(.shut) .chev {
  transform: rotate(180deg);
  background: var(--accent-subtle);
  color: var(--accent-pressed);
}
.qx .ans {
  overflow: hidden;
}
.qx .ans p {
  font: 400 17px / 28px var(--sans);
  color: var(--ink-2);
  max-width: 63ch;
  padding: 0 0 24px;
  letter-spacing: -0.1px;
}

/* ───────── the ending: a card over the homepage's ground ───────── */
.end {
  position: relative;
  margin-top: 88px;
  height: 560px;
  overflow: hidden;
}
.end .scene {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -12px;
  height: 388px;
  z-index: 1;
  background: url(/img/scene-desk-empty.svg) no-repeat 0 0 / auto 388px;
}
.end .ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
  background: var(--ground);
  z-index: 1;
}
.endcard {
  position: relative;
  z-index: 2;
  margin: 0 auto;
  width: min(640px, calc(100% - 32px));
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 36px 34px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(18, 18, 18, 0.06);
}
.endcard h2 {
  font: 700 30px / 34px var(--sans);
  letter-spacing: -0.8px;
}
.endcard p {
  font: 400 17px / 26px var(--sans);
  color: var(--ink-2);
  margin: 10px auto 0;
  max-width: 34em;
}
.endcard p a {
  color: var(--accent);
  font-weight: 500;
  text-underline-offset: 3px;
}
.endcard p b {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.start {
  font: 500 17px var(--sans);
  background: var(--accent);
  color: var(--white);
  border-radius: 14px;
  height: 52px;
  padding: 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.2px;
  text-decoration: none;
  margin-top: 24px;
}
.start:hover {
  background: var(--accent-pressed);
}

/* the chip strip is the phone's */
.chips {
  display: none;
}

/* ───────── narrower than the desk: the plate under the stage, then the chips (the list needs 1100) ───────── */
@media (max-width: 1339px) {
  .stage .pic {
    aspect-ratio: 400 / 170;
  }
  .plate {
    position: static;
    background: none;
    padding: 20px 0 0;
    max-width: none;
  }
}
@media (max-width: 1099px) {
  .chips {
    display: flex;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 5;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 12px var(--px);
    margin-top: 16px;
    background: rgba(251, 251, 249, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
  }
  .chips.stuck {
    border-bottom-color: var(--border);
  }
  .chips::-webkit-scrollbar {
    display: none;
  }
  .chip {
    flex: none;
    border: 1px solid var(--border);
    background: var(--canvas);
    border-radius: 999px;
    padding: 8px 14px;
    font: 500 15px / 18px var(--sans);
    color: var(--ink-2);
    letter-spacing: -0.2px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
  }
  .chip.on {
    background: var(--ink);
    color: var(--canvas);
    border-color: var(--ink);
  }
  .toc {
    display: none;
  }
  .body {
    display: block;
    margin: 12px var(--px) 0;
  }
  .group {
    scroll-margin-top: 72px;
  }
}

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

/* ───────── the phone ───────── */
@media (max-width: 759px) {
  .stage {
    margin: 16px 0 0;
  }
  .stage .pic {
    aspect-ratio: 300 / 166;
  }
  .plate {
    padding: 16px var(--px) 0;
  }
  .chips {
    margin-top: 12px;
  }
  .plate h1 {
    font-size: 34px;
    line-height: 38px;
    letter-spacing: -0.9px;
  }
  .plate .line {
    font-size: 16px;
    line-height: 22px;
  }
  .body {
    margin: 8px var(--px) 0;
  }
  .toc {
    display: none;
  }
  .groups {
    gap: 16px;
  }
  .group {
    padding: 20px 18px 4px;
    border-radius: 18px;
    scroll-margin-top: 72px;
  }
  .ghead {
    gap: 14px;
    padding-bottom: 8px;
  }
  .ghead h2 {
    font-size: 24px;
    line-height: 28px;
    letter-spacing: -0.6px;
  }
  .ghead .gsub {
    font-size: 14px;
    margin-top: 4px;
  }
  .vig {
    width: 112px;
    border-radius: 12px;
  }
  .qx summary {
    font-size: 17px;
    line-height: 23px;
    padding: 16px 0;
    gap: 14px;
  }
  .chev {
    width: 28px;
    height: 28px;
  }
  .qx .ans p {
    font-size: 17px;
    line-height: 27px;
    padding-bottom: 20px;
  }
  .end {
    margin-top: 48px;
    height: 560px;
  }
  .end .scene {
    bottom: 48px;
    height: 320px;
    background: url(/img/scene-phone-empty.svg) no-repeat 50% 100% / 393px 320px;
  }
  .end .ground {
    height: 49px;
  }
  .endcard {
    padding: 24px 20px 26px;
  }
  .endcard h2 {
    font-size: 24px;
    line-height: 28px;
  }
  .endcard p {
    font-size: 16px;
    line-height: 24px;
  }
}

.glink {
  display: inline-block;
  font: 600 16px / 24px var(--sans);
  color: var(--ink);
  padding: 8px 0 20px;
}
