/* The home page: built from the app's own pieces and
   tokens (frontend/src/app/styles/tokens.css), so the page reads as
   NeuroCards. The campaign stays as touches: faint pencil doodles in a few
   places, paper grain, the hand-drawn forgetting curve and one red-pen
   underline. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces-Italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("/fonts/DMSans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* The app's tokens, light then dark. */
:root {
  --bg: #f7f7f7;
  --surface: #ffffff;
  --surface-2: rgba(34, 34, 34, 0.06);
  --ink: #222222;
  --ink-2: #4a4a4a;
  --ink-3: #6c6c6c;
  --hairline: #ebebeb;
  --hairline-strong: rgba(34, 34, 34, 0.16);
  --dot: rgba(74, 74, 74, 0.09);
  --shadow-lg: rgba(0, 0, 0, 0.12);
  --flashcard-shadow: 0 18px 36px -22px var(--shadow-lg);
  --float-bg: rgba(255, 255, 255, 0.86);
  --btn-face: #ececec;
  --btn-face-hover: #e2e2e2;
  --chip-face: rgba(34, 34, 34, 0.059);
  --radius-btn: 14px;

  --accent-green: #10b981;
  --accent-orange: #d97706;
  --accent-red: #dc2626;
  --accent-blue: #007dff;
  --choice-correct: #059669;
  --choice-wrong: #dc2626;
  --choice-picked: #2563eb;
  --choice-on: #ffffff;
  --stage-new: var(--ink-3);

  --motion-quick: 150ms;
  --motion-standard: 250ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  /* Colour that changes on hover, as in the app: it fades in and out
     softly where the sharp curve looks instant. */
  --motion-hover: 350ms;
  --ease-hover: ease-out;

  /* The campaign's touches. */
  --pen: #8a3a28;
  --doodle-opacity: 0.11;
  --grain-opacity: 0.3;
  --grain-filter: none;
  --curve-clay: #8a3a28;
  --curve-ochre: #7d530e;
  --curve-sage: #1f634a;

  --serif: "Fraunces", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --bar-h: 64px;
  color-scheme: light;
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --ease-hover: linear(
      0,
      0.077,
      0.237,
      0.412,
      0.57,
      0.699,
      0.797,
      0.868,
      0.918,
      0.951,
      0.973,
      0.986,
      0.994,
      0.998,
      1
    );
  }
}

[data-theme="dark"] {
  --bg: #141414;
  --surface: #1a1a1a;
  --surface-2: #2c2c2c;
  --ink: #fafafa;
  --ink-2: #ababab;
  --ink-3: #868686;
  --hairline: #252525;
  --hairline-strong: rgba(250, 250, 250, 0.16);
  --dot: rgba(168, 168, 168, 0.06);
  --shadow-lg: rgba(0, 0, 0, 0.5);
  --float-bg: rgba(30, 30, 30, 0.86);
  --btn-face: #2c2c2c;
  --btn-face-hover: #363636;
  --chip-face: rgba(218, 218, 218, 0.07);

  --accent-green: #34d399;
  --accent-orange: #ffb86c;
  --accent-red: #f87171;
  --accent-blue: #93c5fd;
  --choice-correct: #34d399;
  --choice-wrong: #f87171;
  --choice-picked: #60a5fa;
  --choice-on: #111111;

  --pen: #e0937a;
  --doodle-opacity: 0.09;
  --grain-opacity: 0.12;
  --grain-filter: invert(1);
  --curve-clay: #e0937a;
  --curve-ochre: #dcb46a;
  --curve-sage: #8fc3a7;
  color-scheme: dark;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + 32px);
  overflow-x: clip;
}

html.menu-open {
  overflow: hidden;
}

body.home {
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Paper grain under everything on the page. The grain is dark specks, which
   vanish on the dark page, so dark mode turns them light. */
body.home::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("landing-assets/grain.webp") 0 0 / 240px repeat;
  opacity: var(--grain-opacity);
  filter: var(--grain-filter);
  pointer-events: none;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

.art {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

/* Type, as the app sets it. */

.title {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings:
    "opsz" 96,
    "SOFT" 100;
  font-size: clamp(38px, 4.8vw, 62px);
  letter-spacing: -0.03em;
  line-height: 1.04;
  text-wrap: balance;
}

h1.title {
  font-size: clamp(46px, 6.2vw, 82px);
  line-height: 1;
}

.title em,
.session-title,
.sheet-title em {
  font-style: italic;
  font-variation-settings:
    "opsz" 96,
    "SOFT" 100;
}

.label,
.list-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.label {
  margin-bottom: 18px;
}

.lede {
  margin-top: 22px;
  max-width: 36ch;
  font-size: clamp(18px, 1.6vw, 20px);
  line-height: 1.45;
  color: var(--ink-2);
}

.small {
  margin-top: 16px;
  max-width: 42ch;
  font-size: 15px;
  color: var(--ink-3);
}

/* Buttons. */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

/* The app's button: a rounded rectangle at its --radius-btn. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font: 600 16px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--motion-standard) var(--ease-out),
    scale var(--motion-quick) var(--ease-out),
    background var(--motion-hover) var(--ease-hover);
}
.button:hover {
  transform: translateY(-1px);
}
/* A button dips a little while it is held, as the app's do. */
.button:active {
  scale: 0.98;
}
/* Inside the round bar the button is round too, so the two curves match. */
.button-small {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 15px;
}
.button-quiet {
  background: var(--btn-face);
  color: var(--ink);
}
.button-quiet:hover {
  background: var(--btn-face-hover);
}
.button-static {
  cursor: default;
}
.button-static:hover,
.button-static:active {
  transform: none;
  scale: none;
}
.button-blue {
  align-self: flex-start;
  background: #007dff;
  color: #ffffff;
}

:is(a, button, summary, .flashcard, .choice:has(input)):focus-visible,
.choice:has(input:focus-visible) {
  outline: 2px solid var(--choice-picked);
  outline-offset: 3px;
  animation: focus-ring-in var(--motion-quick) var(--ease-out);
}

/* The ring eases out from the edge as it appears, as in the app. */
@keyframes focus-ring-in {
  from {
    outline-color: transparent;
    outline-offset: 0;
  }
}

/* The top bar: a floating pill on wide screens, a bar along the top on
   phones with the menu button in its corner. */

.top {
  position: fixed;
  z-index: 50;
  top: 14px;
  left: 50%;
  width: min(1160px, calc(100% - 24px));
  transform: translateX(-50%);
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--bar-h);
  padding: 0 10px 0 26px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--float-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  transition: box-shadow var(--motion-standard) var(--ease-out);
}

.is-scrolled .top-row {
  box-shadow: 0 10px 30px -18px var(--shadow-lg);
}

.wordmark-link {
  display: block;
  color: var(--ink);
}

.wordmark {
  display: block;
  width: calc(42px * 571.7 / 147.6);
  height: 42px;
  margin: 0 -6px 0 -10px;
}

.top-links {
  display: flex;
  gap: 28px;
  font-size: 15px;
  font-weight: 500;
}

.top-links a,
.top-sign-in {
  color: var(--ink-2);
  text-decoration: none;
  transition: color var(--motion-hover) var(--ease-hover);
}

.top-links a:hover,
.top-sign-in:hover {
  color: var(--ink);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 15px;
  font-weight: 500;
}

/* Three lines that fold into a cross: the outer two meet in the middle as
   the middle one fades, then turn. Closing runs it backwards. */
.menu-toggle {
  position: relative;
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}

.menu-line {
  position: absolute;
  left: 11px;
  width: 22px;
  height: 1.75px;
  border-radius: 2px;
  background: currentColor;
  transition:
    transform 200ms var(--ease-out),
    top 180ms ease 160ms,
    opacity 120ms ease 160ms;
}

.menu-line:nth-child(1) {
  top: 14.5px;
}

.menu-line:nth-child(2) {
  top: 21px;
}

.menu-line:nth-child(3) {
  top: 27.5px;
}

.menu-toggle[aria-expanded="true"] .menu-line {
  top: 21px;
  transition:
    top 180ms ease,
    opacity 100ms ease,
    transform 240ms var(--ease-out) 160ms;
}

.menu-toggle[aria-expanded="true"] .menu-line:nth-child(1) {
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-line:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-line:nth-child(3) {
  transform: rotate(-45deg);
}

/* The menu unrolls from under the bar to the foot of the screen, then its
   links fade in one after another. Closing runs it backwards. */
.menu {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: calc(var(--bar-h) + 40px) 20px 32px;
  background: var(--bg);
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition:
    clip-path 420ms cubic-bezier(0.7, 0, 0.2, 1) 120ms,
    visibility 0s linear 540ms;
}

.menu.is-open {
  clip-path: inset(0 0 0 0);
  visibility: visible;
  transition:
    clip-path 480ms cubic-bezier(0.7, 0, 0.2, 1),
    visibility 0s;
}

.menu-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-links a,
.menu-foot {
  opacity: 0;
  transform: translateY(-10px);
  transition:
    opacity var(--motion-quick) ease,
    transform var(--motion-quick) ease,
    color var(--motion-hover) var(--ease-hover);
}

.menu-links a {
  align-self: flex-start;
  font-family: var(--serif);
  font-variation-settings:
    "opsz" 96,
    "SOFT" 100;
  font-size: clamp(40px, 11vw, 56px);
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--ink-3);
  text-decoration: none;
}

.menu-links a[aria-current="page"],
.menu-links a:hover {
  color: var(--ink);
}

.menu.is-open :is(.menu-links a, .menu-foot) {
  opacity: 1;
  transform: none;
  transition:
    opacity 320ms ease calc(220ms + var(--i, 0) * 45ms),
    transform 420ms var(--ease-out) calc(220ms + var(--i, 0) * 45ms),
    color var(--motion-hover) var(--ease-hover);
}

.menu-foot {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: auto;
  --i: 6;
}

.menu-sign-in {
  font-weight: 600;
  text-decoration: none;
}

/* The pencil doodles, in a few soft patches behind the page. */
.doodles {
  position: absolute;
  z-index: -1;
  background: var(--ink);
  opacity: var(--doodle-opacity);
  pointer-events: none;
  -webkit-mask:
    url("landing-assets/pattern.svg") 0 0 / 560px repeat,
    radial-gradient(closest-side, #000 25%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask:
    url("landing-assets/pattern.svg") 0 0 / 560px repeat,
    radial-gradient(closest-side, #000 25%, transparent 100%);
  mask-composite: intersect;
}

.doodles-hero {
  top: 20px;
  right: -260px;
  width: 1000px;
  height: 820px;
}

.doodles-how {
  top: -60px;
  left: -320px;
  width: 960px;
  height: 760px;
}

.doodles-more {
  top: -160px;
  right: -300px;
  width: 960px;
  height: 720px;
}

.doodles-close {
  top: 50%;
  left: 50%;
  width: 1100px;
  height: 560px;
  transform: translate(-50%, -50%);
}

.pen {
  position: absolute;
  color: var(--pen);
  overflow: visible;
  pointer-events: none;
}

/* Hero. */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(40px, 5vw, 72px);
  padding-top: calc(var(--bar-h) + clamp(72px, 9vw, 120px));
}

.marked {
  position: relative;
  white-space: nowrap;
}

.pen-under {
  left: -6%;
  bottom: 0;
  width: 112%;
  height: 0.32em;
}

.platforms {
  margin-top: 22px;
  font-size: 14px;
  color: var(--ink-3);
}

/* One card. On arrival it shows the question, then its answer, then a red-pen
   note of when it comes back. It plays once and never asks for a click. */
.hero-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 76px;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  padding: 40px 36px;
  border: 1px solid var(--hairline);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--flashcard-shadow);
  text-align: center;
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg)) rotate(-1deg);
}

.card .card-label {
  margin-bottom: 18px;
}

/* The app's card at its full size, as a review shows it on a wide window. */
.card .card-q {
  font-size: clamp(24px, 2.6vw, 32px);
}

.card .card-a {
  font-size: clamp(20px, 2.1vw, 26px);
}

.card-answer {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-note {
  position: absolute;
  left: 10%;
  bottom: 8px;
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings:
    "opsz" 48,
    "SOFT" 100;
  font-size: 22px;
  color: var(--pen);
  white-space: nowrap;
  transform: rotate(-3deg);
}

/* The arrow rises from the note into the card's foot. */
.pen-arrow {
  left: calc(100% + 8px);
  bottom: calc(40% - 25px);
  width: 120px;
  height: 76px;
  transform: scaleY(-1);
}

.js-draw .card-answer {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 500ms var(--ease-out) 0.9s,
    transform 500ms var(--ease-out) 0.9s;
}

.js-draw .hero-note {
  opacity: 0;
  transition: opacity 400ms ease 1.7s;
}

.js-draw .pen-arrow {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 600ms cubic-bezier(0.45, 0.05, 0.25, 1) 1.4s;
}

.js-draw .is-drawn .card-answer {
  opacity: 1;
  transform: none;
}

.js-draw .is-drawn .hero-note {
  opacity: 1;
}

.js-draw .is-drawn .pen-arrow {
  clip-path: inset(-10% -10% -10% 0);
}

.card-label,
.flashcard-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.card-q,
.card-a,
.flashcard-q,
.flashcard-a {
  max-width: 420px;
  font-family: var(--serif);
  font-variation-settings:
    "opsz" 72,
    "SOFT" 100;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.card-q,
.flashcard-q {
  font-size: clamp(22px, 2.4vw, 28px);
}

.card-a,
.flashcard-a {
  font-variation-settings:
    "opsz" 48,
    "SOFT" 100;
  font-size: clamp(19px, 2vw, 23px);
}

.flashcard-q b {
  font-weight: 650;
}

/* The app's divider between question and answer. */
.squiggle,
.flashcard-divider {
  width: 84px;
  height: 6px;
  margin: 18px auto;
  flex: none;
  background: var(--ink-3);
  opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='6' viewBox='0 0 14 6'%3E%3Cpath d='M0 3q3.5-2.25 7 0t7 0' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E")
    0 0 / 14px 6px repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='6' viewBox='0 0 14 6'%3E%3Cpath d='M0 3q3.5-2.25 7 0t7 0' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E")
    0 0 / 14px 6px repeat-x;
}

/* Sections. */

.section-head {
  max-width: 560px;
}

.how,
.feature,
.more,
.everywhere,
.faq {
  margin-top: clamp(120px, 15vw, 200px);
}

/* How it works: the forgetting curve, drawn as it scrolls in, with the gap
   before each review set under the time line. */

.curve {
  margin-top: 56px;
  --field: var(--bg);
  --clay-deep: var(--curve-clay);
  --ochre-deep: var(--curve-ochre);
  --sage-deep: var(--curve-sage);
}

.curve-plot {
  position: relative;
  padding-top: 52px;
  container-type: inline-size;
}

.curve-plot svg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--ink);
  overflow: visible;
}

.curve-axis,
.curve-label,
.curve figcaption {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.curve-axis {
  position: absolute;
  top: 0;
  left: 0;
}

.curve-label {
  position: absolute;
  left: var(--x);
  top: calc(30px + 100cqw * 60 / 900);
  transform: translate(-50%, -100%);
  white-space: nowrap;
}

.curve-time {
  position: relative;
  height: 44px;
  margin-top: 14px;
  border-top: 1px solid var(--hairline-strong);
}

.curve-tick {
  position: absolute;
  top: -5px;
  left: var(--x);
  width: 1px;
  height: 9px;
  background: var(--ink-3);
}

.curve-gap {
  position: absolute;
  top: 12px;
  left: var(--x);
  transform: translateX(-50%);
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings:
    "opsz" 48,
    "SOFT" 100;
  font-size: 19px;
  color: var(--ink-2);
  white-space: nowrap;
}

.curve figcaption {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.js-draw .curve-plot svg,
.js-draw .pen-under {
  clip-path: inset(-20% 100% -20% 0);
  transition: clip-path 1.8s cubic-bezier(0.45, 0.05, 0.25, 1);
}

.js-draw .pen-under {
  transition-duration: 0.7s;
  transition-delay: 0.4s;
}

.js-draw :is(.curve-label, .curve-gap) {
  opacity: 0;
  transition: opacity 400ms ease;
}

.js-draw .is-drawn :is(.curve-plot svg, .pen-under) {
  clip-path: inset(-20% -2% -20% 0);
}

.js-draw .is-drawn :is(.curve-label, .curve-gap) {
  opacity: 1;
}

.js-draw .is-drawn .curve-gap:nth-of-type(5) {
  transition-delay: 0.3s;
}

.js-draw .is-drawn :is(.curve-label:nth-of-type(2), .curve-gap:nth-of-type(6)) {
  transition-delay: 0.6s;
}

.js-draw .is-drawn :is(.curve-label:nth-of-type(3), .curve-gap:nth-of-type(7)) {
  transition-delay: 1s;
}

.js-draw .is-drawn :is(.curve-label:nth-of-type(4), .curve-gap:nth-of-type(8)) {
  transition-delay: 1.5s;
}

/* Each feature's piece settles in as it arrives, then plays one small step
   of its own: the ratings lay out left to right, the files land in turn, the
   quiz takes its answer, and the year of reviews fills week by week. Only
   the arrival moves: hiding them at load is instant. */

.js-draw :is(.review-mock, .generate-card, .quiz-card, .stats-card) {
  opacity: 0;
  translate: 0 12px;
}

.js-draw :is(.rating, .files li) {
  opacity: 0;
  translate: 0 6px;
}

.js-draw .heatmap span {
  opacity: 0;
}

.js-draw .quiz-card:not(.is-drawn) {
  border-color: var(--hairline);
  box-shadow:
    0 0 0 1px transparent,
    0 36px 72px -42px var(--shadow-lg);
}

.js-draw .quiz-card:not(.is-drawn) .choice.is-right {
  border-color: var(--hairline);
  background: transparent;
  color: var(--ink-3);
}

.js-draw .quiz-card:not(.is-drawn) .choice.is-right .choice-n {
  background: var(--surface-2);
  color: inherit;
}

.js-draw .quiz-card:not(.is-drawn) .choice-tick {
  opacity: 0;
  scale: 0.6;
}

.js-draw .quiz-card:not(.is-drawn) .tray {
  opacity: 0;
  translate: 0 8px;
}

.js-draw :is(.review-mock, .generate-card, .stats-card).is-drawn {
  opacity: 1;
  translate: none;
  transition:
    opacity 600ms var(--ease-out),
    translate 700ms var(--ease-out);
}

.js-draw .is-drawn :is(.rating, .files li) {
  opacity: 1;
  translate: none;
  transition:
    opacity 400ms var(--ease-out) calc(300ms + var(--i, 0) * 70ms),
    translate 500ms var(--ease-out) calc(300ms + var(--i, 0) * 70ms);
}

.js-draw .is-drawn .heatmap span {
  opacity: 1;
  transition: opacity 300ms ease calc(250ms + var(--week, 0) * 12ms);
}

/* The quiz card and its answer turn green together, after the card lands. */
.js-draw .quiz-card.is-drawn,
.js-draw .quiz-card.is-drawn :is(.choice.is-right, .choice.is-right .choice-n) {
  opacity: 1;
  translate: none;
  transition-property:
    opacity, translate, border-color, box-shadow, background, color;
  transition-duration: 600ms, 700ms, 400ms, 400ms, 400ms, 400ms;
  transition-timing-function: var(--ease-out);
  transition-delay: 0s, 0s, 550ms, 550ms, 550ms, 550ms;
}

.js-draw .quiz-card.is-drawn .choice-tick {
  transition:
    opacity 300ms var(--ease-out) 700ms,
    scale 400ms var(--ease-out) 700ms;
}

.js-draw .quiz-card.is-drawn .tray {
  transition:
    opacity 400ms var(--ease-out) 850ms,
    translate 500ms var(--ease-out) 850ms;
}

/* Features: the words beside one of the app's pieces. */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
}

.feature-flip > .section-head {
  order: 2;
}

.surface {
  border: 1px solid var(--hairline);
  border-radius: 24px;
  background: var(--surface);
}

/* The review, still: the app's dotted page with a card and its ratings. */
.review-mock {
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid var(--hairline);
  border-radius: 32px;
  background-color: var(--bg);
  background-image: radial-gradient(
    circle,
    var(--dot) 1.2px,
    transparent 1.3px
  );
  background-size: 28px 28px;
}

.session {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.session-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.session-title {
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings:
    "opsz" 72,
    "SOFT" 100;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.session-sub {
  font-size: 13px;
  color: var(--ink-3);
}

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--ink-3);
}

.count i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.count b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.count-new :is(i, b) {
  color: var(--stage-new);
}

.count-learning :is(i, b) {
  color: var(--accent-red);
}

.count-review :is(i, b) {
  color: var(--accent-green);
}

.seg-bar {
  position: relative;
  display: flex;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.seg {
  height: 100%;
  opacity: 0.28;
}

.seg-done {
  position: absolute;
  z-index: 1;
  left: 0;
  top: 0;
  width: var(--done, 0%);
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: var(--ink);
}

.seg-new {
  background: var(--stage-new);
}

.seg-learning {
  background: var(--accent-red);
}

.seg-review {
  background: var(--accent-green);
}

.flashcard {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  margin-top: 8px;
  padding: 36px 36px 32px;
  border: 1px solid var(--hairline);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--flashcard-shadow);
  text-align: center;
}

.flashcard-label {
  margin-bottom: 16px;
}

.ratings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

/* The app's four rating buttons. */
.rating {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 11px 6px;
  border: 1.5px solid currentColor;
  border-radius: var(--radius-btn);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.1;
}

.rating small {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.rating.again {
  color: var(--accent-red);
}

.rating.hard {
  color: var(--accent-orange);
}

.rating.good {
  color: var(--accent-green);
}

.rating.easy {
  color: var(--accent-blue);
}

/* Generate. */

.generate-card,
.stats-card {
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 3vw, 32px);
}

.sheet-title {
  font-family: var(--serif);
  font-variation-settings:
    "opsz" 96,
    "SOFT" 100;
  font-size: 28px;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.generate-card .list-label,
.stats-card > .list-label {
  margin: 26px 0 10px;
}

.segmented {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 18px;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
}

.segmented span {
  padding: 6px 14px;
  border-radius: 9px;
  color: var(--ink-3);
}

.segmented .is-on {
  background: var(--surface);
  box-shadow: 0 1px 3px var(--shadow-lg);
  color: var(--ink);
}

.dropzone {
  margin-top: 16px;
  padding: 22px;
  border: 1.5px dashed var(--hairline-strong);
  border-radius: 16px;
  font-size: 13px;
  text-align: center;
  color: var(--ink-3);
}

.dropzone b {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  font-size: 14px;
  list-style: none;
}

.files li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-icon {
  width: 14px;
  height: 17px;
  border: 1.5px solid var(--ink-3);
  border-radius: 3px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
}

.chips span {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--chip-face);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.chips .is-on {
  background: var(--ink);
  color: var(--bg);
}

/* The quiz, answered, in the app's quiz card. */

.quiz-card {
  padding: 30px 30px 0;
  border: 1px solid var(--choice-correct);
  border-radius: 32px;
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--choice-correct),
    0 36px 72px -42px var(--shadow-lg);
}

.quiz-q {
  margin-bottom: 18px;
  font-family: var(--serif);
  font-variation-settings:
    "opsz" 72,
    "SOFT" 100;
  font-size: clamp(22px, 2.4vw, 27px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1.5px solid var(--hairline);
  border-radius: 16px;
  font-size: 16px;
  color: var(--ink-3);
}

.choice + .choice {
  margin-top: 8px;
}

.choice-n {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
}

.choice.is-right {
  border-color: var(--choice-correct);
  background: color-mix(in srgb, var(--choice-correct) 9%, var(--surface));
  color: var(--ink);
}

.choice.is-right .choice-n {
  background: var(--choice-correct);
  color: var(--choice-on);
}

/* The app's tick: a ring with a check. */
.choice-tick {
  position: relative;
  width: 22px;
  height: 22px;
  margin-left: auto;
  border: 1.5px solid var(--choice-correct);
  border-radius: 999px;
}

.choice-tick::after {
  content: "";
  position: absolute;
  left: 6.5px;
  top: 3.5px;
  width: 5px;
  height: 9px;
  border-right: 1.5px solid var(--choice-correct);
  border-bottom: 1.5px solid var(--choice-correct);
  transform: rotate(45deg);
}

.quiz-why {
  margin-top: 16px;
  font-size: 15px;
  color: var(--ink-2);
}

/* The tray along the card's foot takes the result's colour. It sits 12px
   inside the card and the button 8px inside the tray, and each radius is the
   one outside it less that gap, so the three corners run in step. */
.tray {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px -18px 12px;
  padding: 8px 8px 8px 20px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--choice-correct) 18%, var(--surface));
}

.tray-button {
  min-height: 44px;
  border-radius: 12px;
}

.tray-result {
  font-size: 16px;
  font-weight: 600;
  color: var(--choice-correct);
}

/* Stats. */

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.tile {
  padding: 16px;
  border-radius: 16px;
  background: var(--bg);
}

.tile-num {
  margin-top: 6px;
  font-family: var(--serif);
  font-variation-settings:
    "opsz" 96,
    "SOFT" 100;
  font-size: clamp(28px, 3vw, 36px);
  letter-spacing: -0.02em;
  line-height: 1;
}

.tile-num small {
  margin-left: 4px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-3);
}

.heatmap {
  display: grid;
  grid-template-rows: repeat(7, minmax(0, 1fr));
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 2px;
}

.heatmap span {
  aspect-ratio: 1;
  border-radius: 2px;
  background: color-mix(
    in srgb,
    var(--accent-green) calc(var(--level, 0) * 22%),
    var(--surface-2)
  );
}

/* And more: four small things, in a row. */

.more-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  margin-top: 48px;
  list-style: none;
}

.more-grid li {
  padding-top: 24px;
  border-top: 1px solid var(--hairline-strong);
}

.more-grid svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.more-grid h3 {
  margin-top: 18px;
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings:
    "opsz" 72,
    "SOFT" 100;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.more-grid p {
  margin-top: 8px;
  font-size: 15px;
  color: var(--ink-2);
}

/* Every screen. */

.devices {
  position: relative;
  aspect-ratio: 1.75;
  margin-top: 56px;
}

.devices-mac {
  position: absolute;
  top: 0;
  left: 12%;
  width: 76%;
  filter: drop-shadow(0 30px 40px var(--shadow-lg));
}

/* The App Store set's framed iPhone, with its real bezel. */
.devices-phone {
  position: absolute;
  left: 3%;
  bottom: 0;
  width: 17%;
  filter: drop-shadow(0 26px 30px rgba(0, 0, 0, 0.28));
}

.devices-watch {
  position: absolute;
  right: 5%;
  bottom: 2%;
  width: 11%;
  filter: drop-shadow(0 20px 26px rgba(0, 0, 0, 0.35));
}

/* Questions, as a grouped list like the app's settings. Each answer opens to
   its own height. */

.faq {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.faq-list {
  padding: 0 24px;
}

.faq-list details + details {
  border-top: 1px solid var(--hairline);
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 1.75px solid var(--ink-3);
  border-bottom: 1.75px solid var(--ink-3);
  transform: translateY(-3px) rotate(45deg);
  transition: transform var(--motion-standard) var(--ease-out);
}

.faq-list details.is-open summary::after {
  transform: translateY(2px) rotate(225deg);
}

.faq-body {
  overflow: hidden;
}

.faq-body p {
  max-width: 60ch;
  padding-bottom: 20px;
  font-size: 16px;
  color: var(--ink-2);
}

.faq-body a {
  text-decoration-color: var(--hairline-strong);
  text-underline-offset: 3px;
  transition:
    text-decoration-color var(--motion-hover) var(--ease-hover),
    color var(--motion-hover) var(--ease-hover);
}

.faq-body a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink-3);
}

/* The last ask, and the footer with the wordmark across the content. */

.close {
  margin-top: clamp(140px, 16vw, 220px);
  text-align: center;
}

.close .title {
  font-size: clamp(46px, 6.4vw, 84px);
}

.close .actions {
  justify-content: center;
}

.foot {
  margin-top: clamp(120px, 14vw, 200px);
  overflow: hidden;
}

/* Icons on the left, the line in the middle, the links on the right. */
.foot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px 24px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
}

.foot-note {
  font-size: 14px;
  color: var(--ink-3);
}

.foot-links {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 14px;
}

.foot-links a {
  color: var(--ink-3);
  text-decoration: none;
  transition: color var(--motion-hover) var(--ease-hover);
}

.foot-links a:hover {
  color: var(--ink);
}

/* Bare icons. Each link is wider than its icon for an easier tap, and the
   row is pulled left so the first icon lines up with the content. */
.foot-social {
  display: flex;
  margin-left: -8px;
}

.foot-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--ink-3);
  transition: color var(--motion-hover) var(--ease-hover);
}

.foot-social a:hover {
  color: var(--ink);
}

.foot-social svg {
  width: 19px;
  height: 19px;
}

/* The wordmark's box has room round the letters (17.3 units left, 14.3
   right, of 571.7): it is drawn wider than the content and pulled left by
   that room, so the letters themselves span the content. */
.foot-wordmark {
  display: block;
  width: calc(100% * 571.7 / 540.13);
  height: auto;
  aspect-ratio: 571.7 / 147.6;
  margin: clamp(16px, 4vw, 48px) 0 calc(-100% * 26 / 540.13)
    calc(-100% * 17.3 / 540.13);
  color: var(--ink);
}

/* Phones and narrow windows: the bar sits along the top with the menu. */

@media (max-width: 899px) {
  .foot-row {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Stacked, the links come first and the icons last. */
  .foot-links {
    order: -1;
    justify-content: flex-start;
  }

  .foot-social {
    order: 1;
  }

  :root {
    --bar-h: 60px;
  }

  .top {
    top: 0;
    left: 0;
    width: 100%;
    transform: none;
  }

  .top-row {
    padding: 0 20px;
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    transition: border-color var(--motion-standard) var(--ease-out);
  }

  .is-scrolled .top-row {
    border-bottom-color: var(--hairline);
    box-shadow: none;
  }

  .menu-open .top-row {
    border-bottom-color: transparent;
    background: var(--bg);
  }

  .wordmark {
    width: calc(38px * 571.7 / 147.6);
    height: 38px;
    margin-left: -4px;
  }

  .top-links,
  .top-actions {
    display: none;
  }

  .menu-toggle,
  .menu {
    display: flex;
  }

  .hero,
  .feature,
  .faq {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-flip > .section-head {
    order: 0;
  }

  .more-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .devices {
    aspect-ratio: 1.35;
  }

  .devices-mac {
    left: 6%;
    width: 94%;
  }

  .devices-phone {
    left: 0;
    width: 26%;
  }

  .devices-watch {
    right: 0;
    width: 17%;
  }

  .doodles-hero {
    top: 40%;
    right: -400px;
  }
}

@media (max-width: 560px) {
  .review-mock {
    margin: 0 -8px;
  }

  .card {
    min-height: 280px;
    padding: 32px 22px;
  }

  .flashcard {
    min-height: 240px;
    padding: 32px 20px 26px;
  }

  .ratings {
    gap: 6px;
  }

  .rating {
    font-size: 13px;
  }

  .curve-label {
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .curve-gap {
    font-size: 15px;
  }

  .curve-gap:last-of-type {
    display: none;
  }

  .more-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .quiz-card {
    padding: 24px 20px 0;
  }

  .tray {
    margin: 20px -10px 10px;
  }

  .tiles {
    gap: 6px;
  }

  .tile {
    padding: 12px;
  }

  .tile-num small {
    display: block;
    margin: 4px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
