/* Stuff I should know: a pinboard of sticky notes on an indigo wall. */

:root {
  --wall: #2b1a6b;
  --wall-deep: #1d1150;
  --chalk: #fff8ec;
  --chalk-dim: rgba(255, 248, 236, 0.68);
  --ink: #1c1440;
  --ink-soft: rgba(28, 20, 64, 0.62);

  /* note colours */
  --c0: #ffb84d;   /* orange   */
  --c1: #ff8a80;   /* coral    */
  --c2: #d4f25a;   /* lime     */
  --c3: #8ee69a;   /* green    */
  --c4: #6ee7c8;   /* mint     */
  --c5: #d6b3ff;   /* lavender */
  --c6: #ff9ad5;   /* pink     */
  --jot: #ffe14d;  /* the blank note */

  --gap: 28px;
  --note: 224px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--wall); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--chalk);
  font-family: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  font-optical-sizing: auto;
  font-size: 17px;
  line-height: 1.45;
  padding: 24px clamp(20px, 5vw, 72px) 96px;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 248, 236, 0.13) 1px, transparent 1.5px) 0 0 / 28px 28px,
    linear-gradient(180deg, var(--wall) 0%, var(--wall-deep) 1400px);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* top bar */

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

.brand {
  display: inline-block;
  color: var(--ink);
  background: var(--jot);
  font-weight: 800;
  text-decoration: none;
  padding: 6px 14px;
  transform: rotate(-2deg);
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.25);
  transition: transform 220ms var(--spring);
}

.brand:hover { transform: rotate(0deg) scale(1.04); }

.tabs {
  display: flex;
  gap: 8px;
}

.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--chalk);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 8px 6px 14px;
  border: 2px solid rgba(255, 248, 236, 0.35);
  border-radius: 999px;
  transition: border-color 150ms, background-color 150ms;
}

.tabs a:hover { border-color: var(--chalk); background: rgba(255, 248, 236, 0.08); }

.pip {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--c6);
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
}

.tabs a:last-child .pip { background: var(--c4); }

/* hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 40px var(--gap);
  padding: 72px 0 64px;
}

.headline {
  margin: 0;
  font-size: clamp(44px, 8.4vw, 124px);
  line-height: 0.92;
  font-weight: 800;
  font-stretch: 90%;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.headline .w {
  display: inline-block;
  animation: word-in 640ms var(--spring) both;
}

.headline .w:nth-child(1) { animation-delay: 60ms; }
.headline .w:nth-child(2) { animation-delay: 120ms; }
.headline .w:nth-child(3) { animation-delay: 180ms; }
.headline .w:nth-child(5) { animation-delay: 260ms; }
.headline .w:nth-child(6) { animation-delay: 320ms; }
.headline .w:nth-child(7) { animation-delay: 380ms; }
.headline .w:nth-child(8) { animation-delay: 440ms; color: var(--jot); }

@keyframes word-in {
  from { opacity: 0; transform: translateY(28px) rotate(-4deg) scale(0.92); }
  to   { opacity: 1; transform: none; }
}

/* notes */

.note {
  position: relative;
  width: var(--note);
  color: var(--ink);
  --tilt: -2deg;
  --paper: var(--c0);
  perspective: 1200px;
  list-style: none;
}

.note::before {
  /* tape */
  content: "";
  position: absolute;
  z-index: 2;
  top: -11px;
  left: 50%;
  width: 84px;
  height: 24px;
  background: rgba(255, 255, 255, 0.5);
  transform: translateX(-50%) rotate(var(--tape, -3deg));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  pointer-events: none;
}

.faces {
  position: relative;
  min-height: var(--note);
  transform: rotate(var(--tilt));
  transform-style: preserve-3d;
  transition: transform 520ms var(--spring);
}

.note:hover .faces,
.note:focus-within .faces { transform: rotate(0deg) translateY(-6px) scale(1.03); }

.face {
  background: var(--paper);
  box-shadow: 4px 6px 0 rgba(0, 0, 0, 0.22);
  padding: 26px 18px 14px;
  min-height: var(--note);
  display: flex;
  flex-direction: column;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.word {
  margin: 0;
  font-family: "Permanent Marker", "Comic Sans MS", cursive;
  font-size: 26px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  flex: 1 1 auto;
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.pin-btn {
  font: inherit;
  font-weight: 800;
  color: var(--chalk);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
  transition: transform 180ms var(--spring), box-shadow 180ms;
}

.pin-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3); }
.pin-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
.pin-btn.small { padding: 6px 14px; font-size: 14px; }

/* boards */

.board { padding: 24px 0 8px; }

h2 {
  margin: 0 0 40px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.notes {
  display: flex;
  flex-wrap: wrap;
  gap: 40px var(--gap);
  margin: 0;
  padding: 12px 0 24px;
}

/* every note gets its own colour and lean */
.notes .note:nth-child(7n+1) { --paper: var(--c0); --tilt: -2.5deg; --tape: -4deg; }
.notes .note:nth-child(7n+2) { --paper: var(--c6); --tilt: 1.5deg;  --tape: 3deg; }
.notes .note:nth-child(7n+3) { --paper: var(--c4); --tilt: -1deg;   --tape: -2deg; }
.notes .note:nth-child(7n+4) { --paper: var(--c5); --tilt: 3deg;    --tape: 5deg; }
.notes .note:nth-child(7n+5) { --paper: var(--c2); --tilt: -3deg;   --tape: -5deg; }
.notes .note:nth-child(7n+6) { --paper: var(--c1); --tilt: 2deg;    --tape: 2deg; }
.notes .note:nth-child(7n+7) { --paper: var(--c3); --tilt: -1.5deg; --tape: -3deg; }
.notes .note:nth-child(even) { margin-top: 14px; }

/* entrance: notes cascade in once */
.notes .note { animation: note-drop 600ms var(--spring) both; }
.notes .note:nth-child(1) { animation-delay: 620ms; }
.notes .note:nth-child(2) { animation-delay: 700ms; }
.notes .note:nth-child(3) { animation-delay: 780ms; }
.notes .note:nth-child(4) { animation-delay: 860ms; }
.notes .note:nth-child(5) { animation-delay: 940ms; }
.notes .note:nth-child(6) { animation-delay: 1020ms; }
.notes .note:nth-child(n+7) { animation-delay: 1100ms; }
.notes.settled .note { animation: none; }

@keyframes note-drop {
  from { opacity: 0; transform: translateY(-30px) rotate(6deg); }
  to   { opacity: 1; transform: none; }
}

.empty {
  margin: 0;
  color: var(--chalk-dim);
  font-weight: 600;
}

/* the daily flag and word switch (js/notify.js) */

.daily {
  max-width: 560px;
  margin-top: 56px;
  padding: 18px 18px 20px;
  border-radius: 6px;
  background: var(--c4);
  color: var(--ink);
  box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.25);
}
.daily-title { margin: 0 0 4px; font-family: "Permanent Marker", cursive; font-size: 24px; font-weight: 400; line-height: 1.2; }
.daily-line, .daily-setup p { margin: 0 0 12px; font-size: 15px; line-height: 1.4; }
.daily-btn {
  min-height: 44px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--chalk);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.daily-btn:disabled { opacity: 0.5; }
.daily-btn:focus-visible, .daily-addr:focus-visible { outline: 3px solid var(--wall); outline-offset: 2px; }
.daily-setup { margin-top: 16px; padding-top: 14px; border-top: 2px dashed rgba(28, 20, 64, 0.3); }
.daily-addr {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--chalk);
  color: var(--ink);
  font: 13px ui-monospace, Consolas, monospace;
}

.foot {
  margin-top: 64px;
  color: var(--chalk-dim);
  font-weight: 600;
}

.foot p { margin: 0; }

/* accessibility */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--jot);
  outline-offset: 3px;
}

.note :focus-visible { outline-color: var(--ink); }

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

@media (max-width: 760px) {
  body { padding-bottom: 64px; }
  .hero { grid-template-columns: minmax(0, 1fr); justify-items: start; padding: 48px 0 40px; }
  .notes { gap: 32px 20px; }
  .note { width: calc(50% - 10px); --note: 200px; }
  .notes .note:nth-child(even) { margin-top: 0; }
  .word { font-size: 22px; }
}

@media (max-width: 420px) {
  .note { width: 100%; }
  .tabs a { padding: 4px 6px 4px 12px; font-size: 15px; }
}

/* ---- hub: topic notes on the home page ---- */

.hero-hub { grid-template-columns: minmax(0, 1fr); padding-bottom: 24px; }

.lede {
  margin: 0;
  max-width: 34em;
  font-size: 20px;
  font-weight: 500;
  color: var(--chalk-dim);
}

.lede a { color: var(--chalk); text-decoration-color: var(--c4); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.lede a:hover { text-decoration-color: var(--c2); }

.headline + .lede { margin-top: 18px; }

.notes.topics { padding-top: 24px; }

.note.topic { width: 320px; --note: 236px; }

.note.topic .faces {
  display: block;
  color: inherit;
  text-decoration: none;
}

.note.topic .word { font-size: 32px; }

.topic-blurb {
  display: block;
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
}

.topic-count { font-weight: 700; }

.go {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--chalk);
  font-weight: 800;
  font-size: 13px;
}

@media (max-width: 760px) {
  .note.topic { width: 100%; }
}

/* ---- hub: word of the day and topic groups ---- */

.hero-hub {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 40px var(--gap);
}

.wotd {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 300px;
  min-height: 280px;
  padding: 30px 22px 20px;
  background: var(--jot);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 6px 8px 0 rgba(0, 0, 0, 0.25);
  transform: rotate(3deg);
  transition: transform 520ms var(--spring);
  position: relative;
  animation: note-drop 700ms var(--spring) 500ms both;
}

.wotd::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 84px;
  height: 24px;
  background: rgba(255, 255, 255, 0.5);
  transform: translateX(-50%) rotate(4deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.wotd:hover { transform: rotate(0deg) scale(1.03); }

.wotd-label { font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.wotd-word { font-family: "Permanent Marker", cursive; font-size: 34px; line-height: 1.1; overflow-wrap: anywhere; }
.wotd-pron { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.wotd-def { font-size: 15px; line-height: 1.4; flex: 1 1 auto; }
.wotd-go {
  align-self: flex-end;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--chalk);
  font-weight: 800;
  font-size: 13px;
}

.group-title {
  margin: 36px 0 8px;
  font-size: 22px;
  font-weight: 800;
  color: var(--chalk-dim);
}

.group-title:first-child { margin-top: 0; }

.notes.topics { padding-top: 20px; padding-bottom: 8px; }
.note.topic { width: 250px; --note: 200px; }
.note.topic .word { font-size: 26px; }
.topic-blurb { font-size: 14px; }

@media (max-width: 760px) {
  .hero-hub { grid-template-columns: minmax(0, 1fr); }
  .hero-hub > div { min-width: 0; max-width: 100%; } /* the search box would otherwise set the width */
  .wotd { width: min(100%, 320px); }
}

/* ---- hub: search over everything ---- */

.site-search {
  position: relative;
  display: flex;
  margin: 24px 0 0;
  max-width: 34em;
}

.site-search input {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: 17px; /* under 16px and iOS zooms the page on focus */
  font-weight: 600;
  color: var(--chalk);
  background: rgba(255, 248, 236, 0.1);
  border: 2px solid rgba(255, 248, 236, 0.35);
  border-radius: 999px;
  padding: 12px 84px 12px 20px;
  transition: border-color 150ms, background-color 150ms;
  -webkit-appearance: none;
  appearance: none;
}

.site-search input::placeholder { color: var(--chalk-dim); }
.site-search input::-webkit-search-cancel-button { display: none; }
.site-search input:focus { outline: none; border-color: var(--jot); background: rgba(255, 248, 236, 0.16); }

.site-search-clear {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  background: var(--jot);
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  cursor: pointer;
}

.search-results { padding: 0 0 32px; }
.search-results .list-count { margin: 0 0 14px; font-weight: 600; color: var(--chalk-dim); }

.search-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.hit {
  display: grid;
  gap: 3px;
  height: 100%;
  padding: 12px 16px 14px;
  border-radius: 4px 12px 12px 4px;
  border-left: 8px solid var(--pc);
  background: var(--chalk);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.22);
  animation: note-drop 320ms var(--spring) both;
}

.hit-from { font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.hit-title { font-family: "Permanent Marker", cursive; font-size: 21px; line-height: 1.15; }
.hit-text { font-size: 14px; line-height: 1.45; }
.hit mark { background: var(--jot); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---- hub: today's five ---- */

.mix {
  position: relative;
  max-width: 560px;
  margin: 0 0 40px;
  padding: 22px 20px 20px;
  border-radius: 16px;
  background: rgba(255, 248, 236, 0.08);
  border: 2px dashed rgba(255, 248, 236, 0.3);
}

.mix-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mix-title { margin: 0; font-size: 26px; }
.mix-line { margin: 4px 0 16px; font-size: 15px; font-weight: 600; color: var(--chalk-dim); }

.streak {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.14);
  color: var(--chalk);
  font-size: 14px;
  font-weight: 800;
  transform: rotate(2deg);
}

.streak.is-today { background: var(--c0); color: var(--ink); }

/* ---- the small flashcard widget (hub and explainer pages) ---- */

.mini { display: grid; gap: 14px; }
.mini-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.mini-from {
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--chalk);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.mini-prog { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--chalk-dim); }

.mini-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 220px;
  padding: 28px 20px 34px;
  border: 0;
  border-radius: 14px;
  background: var(--pos, var(--c2));
  color: var(--ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  box-shadow: 6px 8px 0 rgba(0, 0, 0, 0.25);
  transition: background-color 260ms;
  -webkit-tap-highlight-color: transparent;
}

.mini-card.deal { animation: note-drop 420ms var(--spring) both; }
.mini-card.open { background: color-mix(in srgb, var(--pos, var(--c2)) 50%, white); cursor: default; }
.mini-img { width: 55%; max-width: 200px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; border: 1px solid rgba(28, 20, 64, 0.12); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2); }
.mini-q { font-size: clamp(19px, 5vw, 24px); font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.mini-sub { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.mini-hint { position: absolute; bottom: 10px; left: 0; right: 0; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.mini-answer { display: none; flex-direction: column; gap: 8px; width: 100%; padding-top: 12px; border-top: 2px dashed rgba(28, 20, 64, 0.25); }
.mini-card.open .mini-answer { display: flex; animation: word-in 360ms var(--spring) both; }
.mini-card.open .mini-hint { display: none; }
.mini-a { font-size: 18px; font-weight: 700; line-height: 1.35; }
.mini-extra { font-size: 14px; line-height: 1.4; font-style: italic; color: var(--ink-soft); }

.mini-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; opacity: 0.35; pointer-events: none; transition: opacity 200ms; }
.mini-acts.ready { opacity: 1; pointer-events: auto; }

.mini-acts .verdict-btn {
  font: inherit;
  font-weight: 800;
  font-size: 17px;
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 14px 10px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
  transition: transform 180ms var(--spring), box-shadow 180ms;
}

.mini-acts .verdict-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
.mini-acts .nope { background: var(--c1); }
.mini-acts .yep { background: var(--c2); }

.mini-done { display: grid; justify-items: center; gap: 6px; padding: 12px 0 4px; text-align: center; }
.mini-score { margin: 0; font-family: "Permanent Marker", cursive; font-size: 48px; line-height: 1; color: var(--jot); animation: word-in 640ms var(--spring) both; }
.mini-note { margin: 0 0 10px; font-weight: 600; color: var(--chalk-dim); }

/* ---- hub: stickers, due badges and progress on the topic notes ---- */

.sticker {
  position: absolute;
  z-index: 3;
  top: -14px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--jot);
  border: 3px dashed var(--jot);
  font-family: "Permanent Marker", cursive;
  font-size: 15px;
  line-height: 1;
  text-align: center;
  transform: rotate(14deg);
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.3);
  pointer-events: none;
  animation: sticker-slap 520ms var(--spring) both;
}

@keyframes sticker-slap {
  from { opacity: 0; transform: rotate(-20deg) scale(2); }
  to   { opacity: 1; transform: rotate(14deg) scale(1); }
}

.due-badge {
  position: absolute;
  z-index: 3;
  left: 10px;
  top: -12px;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--c1);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  transform: rotate(-4deg);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.topic-progress {
  display: block;
  height: 7px;
  margin: 12px 0 0;
  border-radius: 999px;
  background: rgba(28, 20, 64, 0.15);
  overflow: hidden;
}

.topic-progress + .meta { margin-top: 8px; }
.topic-progress-fill { display: block; height: 100%; border-radius: 999px; background: var(--ink); }

/* ---- phones: two compact notes to a row ---- */

@media (max-width: 760px) {
  body { padding-left: 16px; padding-right: 16px; }
  .tabs a { padding: 8px 14px; }
  .hero { gap: 18px; padding: 36px 0 28px; }
  .lede { font-size: 18px; }
  .notes.topics { gap: 26px 14px; }
  .note.topic { width: calc(50% - 7px); --note: 158px; }
  .note.topic .word { font-size: 20px; }
  .note.topic .face { padding: 22px 12px 12px; }
  .note::before { width: 60px; height: 20px; }
  .topic-blurb { font-size: 13px; line-height: 1.35; margin-top: 6px; }
  .note.topic .meta { margin-top: 10px; font-size: 12px; }
  .note.topic .go { display: none; }
  .sticker { width: 54px; height: 54px; font-size: 13px; right: 0; }
  /* the notes start below the fold on a phone, so their entrance would play unseen */
  .notes.topics .note { animation: none; }
  .notes.topics { content-visibility: auto; contain-intrinsic-size: auto 640px; }
  .group-title { margin-top: 28px; }
  .wotd { min-height: 0; transform: rotate(1.5deg); }
  .mix { margin-top: 8px; padding: 18px 14px 16px; }
}

@media (max-width: 340px) {
  .note.topic { width: 100%; }
}

/* long words break instead of running off a narrow screen */
h1, h2, h3, h4, p, li, dd, dt, figcaption { overflow-wrap: break-word; }

/* ---- hieroglyphs: a face that joins both site fonts for that block of Unicode only ---- */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url(../fonts/egyptian-hieroglyphs.woff2) format("woff2");
  font-display: swap;
  unicode-range: U+13000-1342F;
}
@font-face {
  font-family: "Permanent Marker";
  src: url(../fonts/egyptian-hieroglyphs.woff2) format("woff2");
  font-display: swap;
  unicode-range: U+13000-1342F;
}

/* runs of hieroglyphs are wrapped by js/sisk.js so they can be drawn big enough to read */
.glyph { font-size: 1.9em; line-height: 1; vertical-align: -0.1em; font-weight: 400; letter-spacing: 0.04em; }
.card-word .glyph, .flash-word .glyph { display: inline-block; line-height: 1.3; }

/* ---- the bookmark button (js/mark.js) and the home page's list of bookmarks ---- */

.mark { position: fixed; z-index: 40; right: 14px; bottom: 18px; display: grid; justify-items: end; gap: 8px; pointer-events: none; }
.mark > * { pointer-events: auto; }
.mark-btn {
  display: grid; place-items: center;
  width: 50px; height: 50px; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--jot); color: var(--ink);
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.3);
  transform: rotate(-6deg);
  cursor: pointer;
  transition: transform 180ms var(--spring), background 180ms;
}
.mark-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.mark-btn.is-on { background: var(--c6); }
.mark-btn.is-on svg { fill: currentColor; }
.mark-btn:active { transform: rotate(-6deg) scale(0.92); }
.mark-btn.pop { animation: mark-pop 400ms var(--spring); }
@keyframes mark-pop { 40% { transform: rotate(8deg) scale(1.25); } }

.mark-menu {
  display: grid; gap: 6px;
  width: min(250px, calc(100vw - 28px));
  padding: 12px;
  border-radius: 6px;
  background: var(--chalk); color: var(--ink);
  box-shadow: 4px 6px 0 rgba(0, 0, 0, 0.3);
  transform: rotate(-1deg);
}
.mark-where { margin: 0 0 4px; font-family: "Permanent Marker", cursive; font-size: 16px; line-height: 1.25; }
.mark-item {
  padding: 10px 12px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 800; text-align: left;
  cursor: pointer;
}
.mark-item:first-of-type { background: var(--ink); color: var(--chalk); }
.mark-toast {
  margin: 0; padding: 8px 14px;
  max-width: calc(100vw - 28px);
  border-radius: 999px;
  background: var(--ink); color: var(--chalk);
  border: 2px solid var(--jot);
  font-size: 14px; font-weight: 700;
  animation: mark-in 240ms var(--spring);
}
@keyframes mark-in { from { opacity: 0; transform: translateY(8px); } }

.marks { max-width: 560px; margin: 0 0 22px; }
.marks-title { margin: 0 0 8px; font-size: 22px; font-weight: 800; color: var(--chalk-dim); }
.marks-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.marks-row { display: grid; grid-template-columns: 1fr auto; align-items: stretch; border-radius: 6px; background: var(--c6); color: var(--ink); box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.25); }
.marks-row:nth-child(3n + 2) { background: var(--c4); }
.marks-row:nth-child(3n) { background: var(--c0); }
.marks-go { display: grid; gap: 1px; min-width: 0; padding: 10px 12px; color: inherit; text-decoration: none; }
.marks-page { font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }
.marks-label { font-family: "Permanent Marker", cursive; font-size: 18px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marks-when { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.marks-x { width: 46px; border: 0; border-left: 2px dashed rgba(28, 20, 64, 0.3); background: transparent; color: var(--ink); font-size: 22px; font-weight: 800; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .mark-btn, .mark-btn.pop, .mark-toast { animation: none; transition: none; }
}

/* ---- tap-to-open definitions in chapter text (js/sisk.js linkify) ---- */

.xtip {
  display: inline;
  margin: 0; padding: 0;
  border: 0; border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  text-decoration: underline dotted;
  text-decoration-color: var(--pc, var(--wall));
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
  cursor: help;
  -webkit-tap-highlight-color: transparent;
}
.xtip[aria-expanded="true"] { background: rgba(255, 225, 77, 0.55); border-radius: 3px; }

.tipbox {
  position: absolute; z-index: 900;
  padding: 12px 14px 12px;
  border-radius: 6px;
  background: var(--jot);
  color: var(--ink);
  font-size: 15px; line-height: 1.4;
  box-shadow: 4px 6px 0 rgba(0, 0, 0, 0.28);
  animation: tip-in 200ms var(--spring);
}
.tipbox::before {
  content: ""; position: absolute; top: -7px; left: calc(var(--arrow, 50%) - 7px);
  width: 14px; height: 14px; background: var(--jot); transform: rotate(45deg);
}
.tipbox.is-above::before { top: auto; bottom: -7px; }
.tipbox-term { display: block; position: relative; font-family: "Permanent Marker", cursive; font-size: 19px; font-weight: 400; line-height: 1.15; }
.tipbox p { position: relative; margin: 6px 0 0; }
.tipbox-go { display: inline-block; position: relative; margin-top: 8px; color: var(--wall); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.tipbox-go::after { content: " \2192"; }
@keyframes tip-in { from { opacity: 0; transform: translateY(6px) scale(0.96); } }
@media (prefers-reduced-motion: reduce) { .tipbox { animation: none; } }

/* swipe to answer (SISK.swipe): sideways drags are ours, vertical ones still scroll */
.swipeable { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.mini-card.swipeable { transition: background-color 260ms, translate 220ms ease-out, rotate 220ms ease-out; }
.mini-card.swipeable.dragging { transition: background-color 260ms; }
.swipeable.lean-right { outline: 4px solid var(--c2); outline-offset: 4px; }
.swipeable.lean-left { outline: 4px solid var(--c1); outline-offset: 4px; }
.lesson-body.swipeable, .swipeable:not(.flash):not(.mini-card) { -webkit-user-select: auto; user-select: auto; }

/* a small world map with a pin (SISK.pinMap); the land takes the colour of the text around it */
.pin-map {
  position: relative;
  display: block;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 360 / 142;
  margin: 4px auto 0;
  border-radius: 8px;
  background: color-mix(in srgb, currentColor 7%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 16%, transparent);
  overflow: hidden;
}
.pin-land {
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0.3;
  -webkit-mask: url(../img/world.svg) 0 0 / 100% 100% no-repeat;
  mask: url(../img/world.svg) 0 0 / 100% 100% no-repeat;
}
.pin-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: #e8243c;
  box-shadow: 0 0 0 1px #fff8ec;
}
.pin-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1.5px solid #e8243c;
  animation: pin-ping 1.6s ease-out 2 both;
}
@keyframes pin-ping {
  from { transform: scale(0.4); opacity: 1; }
  to   { transform: scale(1.8); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .pin-dot::after { animation: none; opacity: 0; } }
/* a country outline beside the world map (SISK.pinMap with a shape) */
.geo {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin: 6px auto 0;
}
.geo-shape {
  flex: 0 0 34%;
  width: 34%;
  aspect-ratio: 6 / 5;
  object-fit: contain;
  animation: geo-in .5s var(--spring) both;
}
.geo .pin-map { flex: 1; margin: 0; min-width: 0; }
@keyframes geo-in { from { transform: scale(.6) rotate(-8deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .geo-shape { animation: none; } }
.flash .side .geo { flex: none; max-width: 300px; }
.flash .side img.geo-shape { width: 40%; flex-basis: 40%; max-width: none; aspect-ratio: 6 / 5; object-fit: contain; border: 0; border-radius: 0; box-shadow: none; }
.flash .side .pin-map { max-width: 200px; flex: none; }
.flash .side .geo .pin-map { flex: 1 1 0; width: auto; max-width: none; }
.lesson-card .pin-map { max-width: 220px; margin: 8px 0 0; }
.card .pin-map { margin: 10px 0 0; }
.capitals-page .deck { height: 380px; }
