/*
 * Illustrations of Vollnote's ideas: a note, a flashcard, a task list, a
 * week, a mind map. They are drawn for the website and are NOT the app's
 * interface, so the real design is never shown. Each homepage sets the --m-*
 * variables to dress them in its own style.
 *
 * Their animations start when an ancestor gets .is-in (see site.js).
 */

.m {
  --m-surface: #fff;
  --m-ink: #18181b;
  --m-ink-2: #52525b;
  --m-ink-3: #a1a1aa;
  --m-line: rgb(0 0 0 / 8%);
  --m-accent: #5b5bd6;
  --m-accent-soft: rgb(91 91 214 / 10%);
  --m-hl: #fde68a;
  --m-radius: 18px;
  --m-shadow: 0 1px 2px rgb(0 0 0 / 4%), 0 20px 50px rgb(20 20 40 / 10%);
  --m-font: inherit;
  --m-font-title: inherit;
  font-family: var(--m-font);
  color: var(--m-ink-2);
  text-align: left;
}
.m-panel {
  background: var(--m-surface);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
  box-shadow: var(--m-shadow);
}

/* ---------- note ---------- */

.m-note { width: 400px; padding: 26px 28px 24px; font-size: 13.5px; line-height: 1.7; }
.m-note h4 { font: 600 20px/1.25 var(--m-font-title); color: var(--m-ink); letter-spacing: -0.01em; }
.m-meta { display: block; margin: 4px 0 16px; font-size: 12px; color: var(--m-ink-3); }
.m-note p + p { margin-top: 10px; }
.m-hl {
  color: var(--m-ink);
  padding: 1px 3px;
  margin: 0 -1px;
  border-radius: 3px;
  background: linear-gradient(var(--m-hl), var(--m-hl)) no-repeat 0 0 / 100% 100%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.m-ink { color: var(--m-accent); }

.m-note--cue { width: 470px; display: grid; grid-template-columns: 118px 1fr; column-gap: 20px; }
.m-note--cue > header { grid-column: 1 / -1; }
.m-cues { border-right: 1px solid var(--m-line); padding-right: 14px; display: flex; flex-direction: column; gap: 22px; font-size: 12.5px; line-height: 1.45; color: var(--m-accent); font-weight: 500; }
.m-sum { grid-column: 1 / -1; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--m-line); font-size: 12.5px; color: var(--m-ink-2); }
.m-sum b { color: var(--m-ink); font-weight: 600; }

/* Writing in, paragraph by paragraph, then the highlighter. */
.js [data-play] .m-write > * { clip-path: inset(-10% 100% -10% 0); }
.js [data-play].is-in .m-write > * { animation: m-write 0.9s var(--ease) calc(var(--d, 0s) + var(--i, 0) * 0.32s) both; }
@keyframes m-write { from { clip-path: inset(-10% 100% -10% 0); } to { clip-path: inset(-10% -2% -10% 0); } }
.js [data-play] .m-hl { background-size: 0% 100%; }
.js [data-play].is-in .m-hl { animation: m-mark 0.6s var(--ease) calc(var(--d, 0s) + var(--hl-at, 1.4s)) both; }
@keyframes m-mark { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }

/* ---------- flashcard ---------- */

.m-card { width: 320px; padding: 20px 22px 18px; }
.m-card-top { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--m-ink-3); margin-bottom: 12px; }
.m-dot { display: inline-flex; align-items: center; gap: 6px; }
.m-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--m-accent); }
.m-q { font: 600 16.5px/1.4 var(--m-font-title); color: var(--m-ink); letter-spacing: -0.005em; }
.m-rule { height: 1px; background: var(--m-line); margin: 14px 0 12px; }
.m-a { font-size: 13.5px; line-height: 1.55; color: var(--m-ink-2); }

.m-review { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 16px; }
.m-review span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; border-radius: 10px; border: 1px solid var(--m-line); font-size: 12px; font-weight: 600; color: var(--m-ink); }
.m-review small { font-size: 10.5px; font-weight: 500; color: var(--m-ink-3); }
.m-review .is-picked { border-color: var(--m-accent); background: var(--m-accent-soft); color: var(--m-accent); }
.m-review .is-picked small { color: var(--m-accent); }
.js [data-play].is-in .m-review .is-picked { animation: m-press 0.5s ease calc(var(--d, 0s) + var(--press-at, 1.6s)) both; }
@keyframes m-press { 0% { background: transparent; border-color: var(--m-line); color: var(--m-ink); } 45% { transform: scale(0.94); } 100% { transform: none; } }

.js [data-play] .m-lift { opacity: 0; }
.js [data-play].is-in .m-lift { animation: m-lift 1.1s var(--ease) var(--d, 0s) both; }
@keyframes m-lift {
  from { opacity: 0; transform: translateY(40px) rotate(var(--r-from, -6deg)) scale(0.96); }
  to { opacity: 1; transform: rotate(var(--r, 0deg)); }
}

/* ---------- tasks ---------- */

.m-tasks { width: 330px; padding: 18px 18px 10px; }
.m-tasks-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 10px; }
.m-tasks-head b { font: 600 15px var(--m-font-title); color: var(--m-ink); }
.m-tasks-head span { font-size: 12px; color: var(--m-ink-3); }
.m-task { display: flex; align-items: center; gap: 11px; padding: 10px 4px; border-top: 1px solid var(--m-line); font-size: 13.5px; color: var(--m-ink); }
.m-check { flex: none; width: 18px; height: 18px; border-radius: 6px; border: 1.6px solid var(--m-ink-3); display: grid; place-items: center; color: #fff; }
.m-check svg { width: 12px; height: 12px; stroke-width: 3; }
.m-task.is-done .m-check { background: var(--m-accent); border-color: var(--m-accent); }
.m-task.is-done .m-text { color: var(--m-ink-3); text-decoration: line-through; text-decoration-color: var(--m-ink-3); }
.m-text { flex: 1; }
.m-due { font-size: 11.5px; font-weight: 500; color: var(--m-ink-3); }
.m-due.is-soon { color: #c2410c; }
.js [data-play].is-in .m-task.is-done .m-check { animation: m-pop 0.45s var(--ease-spring) calc(var(--d, 0s) + 0.9s) both; }
@keyframes m-pop { from { transform: scale(0.3); background: transparent; border-color: var(--m-ink-3); } }

/* ---------- week ---------- */

.m-week { width: 520px; padding: 18px; }
.m-week-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 14px; }
.m-week-head b { font: 600 15px var(--m-font-title); color: var(--m-ink); }
.m-week-head span { font-size: 12px; color: var(--m-ink-3); }
.m-days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.m-day { display: flex; flex-direction: column; gap: 6px; min-height: 196px; }
.m-day > span { font-size: 11.5px; color: var(--m-ink-3); padding: 0 2px 4px; }
.m-day > span b { display: block; font: 600 16px var(--m-font-title); color: var(--m-ink); }
.m-day.is-today > span b { color: var(--m-accent); }
.m-ev { padding: 7px 8px; border-radius: 9px; font-size: 11.5px; line-height: 1.3; font-weight: 600; color: var(--m-ink); background: var(--m-accent-soft); border-left: 3px solid var(--m-accent); }
.m-ev small { display: block; font-weight: 500; color: var(--m-ink-2); }
.m-ev.t-warm { background: rgb(234 88 12 / 9%); border-color: #ea580c; }
.m-ev.t-green { background: rgb(22 163 74 / 9%); border-color: #16a34a; }
.m-ev.t-review { background: transparent; border: 1.5px dashed var(--m-accent); border-left-width: 1.5px; color: var(--m-accent); }
.js [data-play] .m-ev { opacity: 0; }
.js [data-play].is-in .m-ev { animation: p-rise 0.7s var(--ease) calc(var(--d, 0s) + var(--e, 0) * 0.08s) both; }

/* ---------- mind map ---------- */

.m-map { position: relative; width: 420px; height: 260px; }
.m-map svg.m-links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.m-map svg.m-links path { fill: none; stroke: var(--m-ink-3); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 0; }
.js [data-play].is-in .m-map svg.m-links path { animation: m-dash 0.8s var(--ease) calc(var(--d, 0s) + 0.5s) both; }
@keyframes m-dash { from { stroke-dashoffset: 1; } }
.m-node {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 8px 13px;
  border-radius: 12px;
  background: var(--m-surface);
  border: 1px solid var(--m-line);
  box-shadow: 0 6px 18px rgb(20 20 40 / 8%);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--m-ink);
  white-space: nowrap;
}
.m-node.is-root { background: var(--m-accent); border-color: var(--m-accent); color: #fff; font-size: 13.5px; padding: 10px 16px; }
.js [data-play] .m-node { opacity: 0; }
.js [data-play].is-in .m-node { animation: m-node 0.6s var(--ease-spring) calc(var(--d, 0s) + var(--n, 0) * 0.09s) both; }
@keyframes m-node { from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* ---------- small badge ---------- */

.m-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 10px;
  border-radius: 14px;
  background: var(--m-surface);
  border: 1px solid var(--m-line);
  box-shadow: var(--m-shadow);
  font-size: 13px;
  font-weight: 600;
  color: var(--m-ink);
}
.m-badge small { display: block; font-size: 11.5px; font-weight: 500; color: var(--m-ink-3); }
.m-badge-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--m-accent-soft); color: var(--m-accent); }
.m-badge-icon .i { width: 18px; height: 18px; }
