@font-face {
  font-family: "Bowlby One";
  src: url("/assets/fonts/bowlby-one-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Next";
  src: url("/assets/fonts/ahn-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --blue: #2a2fe8;
  --ink: #14123a;
  --paper: #f4f2ff;
  --sheet: #ffffff;
  --yellow: #ffd338;
  --orange: #ff6b2c;
  --pink: #ff8fc7;
  --green: #1fbf8a;
  --muted: #575578;
  --display: "Bowlby One", "Arial Black", Impact, sans-serif;
  --body: "Atkinson Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --edge: clamp(1rem, 5vw, 4.5rem);
  --measure: 38rem;
  /* The band at the top of each page takes the colour of what the page is about. */
  --tone: var(--ink);
  --on: #ffffff;
}

body.home, body.cat-ai { --tone: var(--blue); --on: #ffffff; }
body.cat-web { --tone: var(--orange); --on: var(--ink); }
body.cat-work { --tone: var(--yellow); --on: var(--ink); }
body.cat-design { --tone: var(--pink); --on: var(--ink); }
body.cat-reach { --tone: var(--green); --on: var(--ink); }
body.cat-more { --tone: var(--ink); --on: #ffffff; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.5;
}

a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; box-shadow: 0 0 0 3px var(--ink); border-radius: 4px; }

.skip { position: absolute; left: var(--edge); top: -5rem; z-index: 5; background: var(--yellow); color: var(--ink); font-weight: 700; padding: 0.5rem 0.75rem; }
.skip:focus { top: 0.5rem; }

/* Anything with a hard shadow can be pressed, and it sinks when you press it. */
.press {
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}
a.press:hover, .card:hover { transform: translate(2px, 2px); box-shadow: 4px 4px 0 var(--ink); }
a.press:active, .card:active { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--ink); }

/* Band and header */

.band { background: var(--tone); color: var(--on); padding-bottom: clamp(2.5rem, 7vh, 4.5rem); }

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 1.1rem var(--edge);
  min-height: 4.25rem;
}
.home .top { justify-content: flex-end; }
.top nav, .foot nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.top a { color: inherit; font-weight: 650; }

.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; font-family: var(--display); font-size: 1.2rem; line-height: 1; }
.brand .emblem { width: 2.1rem; height: 2.1rem; }

/* The name is the hero */

.hero, .tool-head { padding: 0 var(--edge); }

.mark {
  margin: clamp(1rem, 5vh, 3rem) 0 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.4rem, 11.6vw, 14rem);
  line-height: 0.9;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.mark .l1, .mark .l2 { display: block; white-space: nowrap; }
.mark .l2 { color: var(--yellow); }
.mark .emblem { width: 0.86em; height: 0.86em; vertical-align: -0.12em; margin-left: 0.04em; overflow: visible; }

.emblem .ring { opacity: 0; transform-origin: 56px 56px; }
.emblem .disc { transform-origin: 56px 56px; }
.mark .emblem .cursor { animation: cursor-in 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 250ms both; }
.mark .emblem .disc { animation: disc-press 320ms ease-out 1150ms both; }
.mark .emblem .ring { animation: ring-out 700ms ease-out 1200ms both; }

@keyframes cursor-in { from { transform: translate(70px, 60px); opacity: 0; } 30% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes disc-press { 0% { transform: scale(1); } 45% { transform: scale(0.9); } 100% { transform: scale(1); } }
@keyframes ring-out { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(1.5); } }

.tag { max-width: 40rem; margin: clamp(1.25rem, 3vh, 2rem) 0 0; font-size: clamp(1.125rem, 1.6vw, 1.4rem); line-height: 1.4; font-weight: 500; }

/* Search */

.ask {
  display: flex;
  align-items: stretch;
  max-width: 52rem;
  margin: clamp(1.5rem, 4vh, 2.5rem) 0 0;
  background: var(--sheet);
  color: var(--ink);
  border-radius: 1rem;
  overflow: hidden;
  font-size: clamp(1.125rem, 1.9vw, 1.5rem);
}
.ask:focus-within { box-shadow: 6px 6px 0 var(--yellow); }
.ask label { display: flex; align-items: center; padding: 0 0.1rem 0 1.1rem; font-family: var(--display); white-space: nowrap; }
.ask input {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 1rem 0.6rem;
  -webkit-appearance: none;
  appearance: none;
}
.ask input::placeholder { color: var(--muted); opacity: 0.75; }
.ask input:focus, .ask input:focus-visible { outline: none; box-shadow: none; }
.ask input::-webkit-search-cancel-button { -webkit-appearance: none; }
.ask button {
  font-family: var(--display);
  font-size: 0.85em;
  color: var(--ink);
  background: var(--yellow);
  border: 0;
  border-left: 3px solid var(--ink);
  padding: 0 1.4rem;
  cursor: pointer;
}
.ask button:hover { background: var(--orange); }

.status { max-width: 52rem; margin: 1.5rem 0 0; font-weight: 700; }
.status:empty { display: none; }

mark { background: var(--yellow); color: inherit; padding: 0 0.08em; border-radius: 2px; }

/* Tutorial rows */

.tuts {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  max-width: 56rem;
  background: var(--sheet);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 1rem;
  overflow: hidden;
}
.tuts:empty { display: none; }

.tut { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 1rem; }
.tuts .tut { padding: 0 1rem 0 0; border-top: 2px solid var(--ink); }
.tuts .tut:first-child { border-top: 0; }
.tuts .tut:hover { background: #fff6cf; }

.tut-link { position: relative; display: block; color: var(--ink); text-decoration: none; font-weight: 650; overflow-wrap: anywhere; }
.tuts .tut-link { padding: 0.8rem 0 0.8rem 3.4rem; }

/* Play disc */
.tut-link::before {
  content: "";
  position: absolute;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid var(--ink);
}
.tut-link::after {
  content: "";
  position: absolute;
  border-left: 0.6rem solid #fff;
  border-top: 0.38rem solid transparent;
  border-bottom: 0.38rem solid transparent;
}
.tuts .tut-link::before { left: 1rem; top: 0.72rem; }
.tuts .tut-link::after { left: 1.62rem; top: 1.2rem; }

.dur { color: var(--muted); font-size: 0.9375rem; font-weight: 600; white-space: nowrap; }

.tut.playing { background: var(--sheet); }
.tuts .tut.playing { background: #fff6cf; }
.tut.playing > .tut-link::before { background: var(--orange); }

.player { grid-column: 1 / -1; padding: 0 0 1rem 1rem; }
.player .frame { position: relative; aspect-ratio: 16 / 9; background: var(--ink); border: 3px solid var(--ink); border-radius: 0.75rem; overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .bar { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; margin: 0.75rem 0 0; font-size: 0.9375rem; font-weight: 650; }
.player button { font: inherit; color: var(--blue); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }

/* How it works */

.steps { background: var(--yellow); border-block: 3px solid var(--ink); padding: 1.75rem var(--edge); }
.steps ol { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.25rem 2.5rem; max-width: 76rem; }
.steps li { counter-increment: step; position: relative; padding-left: 3.4rem; min-height: 2.6rem; line-height: 1.35; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--display);
  font-size: 1.15rem;
  display: grid;
  place-items: center;
}
.steps strong { display: block; font-family: var(--display); font-weight: 400; font-size: 1.2rem; }

/* Tool mosaic */

.tools { padding: clamp(3rem, 8vh, 5rem) var(--edge) 0; }
.tools h2, .list h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.9rem, 4.4vw, 3.4rem); line-height: 1; letter-spacing: -0.01em; margin: 0; }
.sub { max-width: var(--measure); margin: 0.75rem 0 0; color: var(--muted); font-weight: 500; }

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; margin: 1.5rem 0 1rem; padding: 0; font-size: 0.9375rem; font-weight: 650; }
.legend li { display: flex; align-items: center; gap: 0.45rem; }
.legend .sw { width: 1rem; height: 1rem; border: 2px solid var(--ink); border-radius: 3px; background: var(--c); }

.c-ai { --c: var(--blue); --ct: #ffffff; }
.c-web { --c: var(--orange); --ct: var(--ink); }
.c-work { --c: var(--yellow); --ct: var(--ink); }
.c-design { --c: var(--pink); --ct: var(--ink); }
.c-reach { --c: var(--green); --ct: var(--ink); }
.c-more { --c: var(--ink); --ct: #ffffff; }

.mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.6rem; max-width: 84rem; }

.blk {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 6rem;
  padding: 0.7rem 0.8rem;
  background: var(--c);
  color: var(--ct);
  border: 3px solid var(--ink);
  border-radius: 0.6rem;
  text-decoration: none;
  overflow: hidden;
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}
.blk:hover, .blk:focus-visible { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); z-index: 2; }
.blk .nm { font-family: var(--display); font-size: 1.2rem; line-height: 1; overflow-wrap: anywhere; }
.blk .n { font-weight: 750; font-size: 0.9375rem; line-height: 1; }

@media (min-width: 70rem) {
  .mosaic { display: block; position: relative; container-type: inline-size; aspect-ratio: 1600 / 900; }
  .blk {
    position: absolute;
    left: calc(var(--x) + 4px);
    top: calc(var(--y) + 4px);
    width: calc(var(--w) - 8px);
    height: calc(var(--h) - 8px);
    min-height: 0;
    gap: 0;
    padding: clamp(5px, 0.7cqw, 14px);
    font-size: max(calc(var(--f) * 1cqw), 11px);
  }
  .blk .nm { font-size: 1em; line-height: 0.98; overflow-wrap: normal; }
  .blk .n { font-size: clamp(12px, 0.4em, 20px); }
  .blk.sm { padding: 5px 6px; font-size: max(calc(var(--f) * 1cqw), 10px); }
  .blk.sm .nm { font-family: var(--body); font-weight: 750; line-height: 1.05; letter-spacing: -0.025em; overflow-wrap: anywhere; }
  .blk.sm .w, .blk.nw .w { display: none; }
}

/* Tool page */

.crumb { margin: clamp(0.5rem, 3vh, 2rem) 0 0.75rem; font-weight: 650; }
.crumb a { color: inherit; }

.tool-head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.8rem, 9vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.page .tool-head h1 { margin-top: clamp(1rem, 5vh, 3rem); font-size: clamp(2.4rem, 7vw, 6rem); }
.tool-head .kind { display: block; font-size: 0.42em; line-height: 1.1; letter-spacing: 0; }

.visit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin: 1.75rem 0 0; }
.visit { display: inline-block; background: var(--sheet); color: var(--ink); font-family: var(--display); font-size: 1.05rem; text-decoration: none; padding: 0.7rem 1.2rem; border-radius: 0.75rem; }
.aff { font-size: 0.9375rem; font-weight: 600; }

.list { padding: clamp(2.5rem, 7vh, 4rem) var(--edge) 0; }

/* Title cards for the most watched tutorials */

.cards { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.5rem; max-width: 72rem; }

.card {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--cc, var(--blue));
  color: var(--cf, #fff);
  border: 3px solid var(--ink);
  border-radius: 1rem;
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}
.card:nth-child(6n + 2) { --cc: var(--yellow); --cf: var(--ink); }
.card:nth-child(6n + 3) { --cc: var(--orange); --cf: var(--ink); }
.card:nth-child(6n + 4) { --cc: var(--pink); --cf: var(--ink); }
.card:nth-child(6n + 5) { --cc: var(--green); --cf: var(--ink); }
.card:nth-child(6n + 6) { --cc: var(--ink); --cf: #fff; }

/* The title is clamped to three lines; its ::before stretches over the whole card so all of it is clickable. */
.card:not(.playing) .tut-link {
  position: static;
  margin: 1rem 1.1rem 0;
  color: inherit;
  font-weight: 800;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.18;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}
.card:not(.playing) .tut-link::before { inset: 0; width: auto; height: auto; border: 0; border-radius: 0.8rem; background: none; }
.card:not(.playing) .tut-link::after { content: none; }
.card:not(.playing)::before {
  content: "";
  position: absolute;
  left: 1rem;
  bottom: 0.9rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--sheet);
  border: 2px solid var(--ink);
  pointer-events: none;
}
.card:not(.playing)::after {
  content: "";
  position: absolute;
  left: 1.82rem;
  bottom: 1.52rem;
  border-left: 0.72rem solid var(--ink);
  border-top: 0.46rem solid transparent;
  border-bottom: 0.46rem solid transparent;
  pointer-events: none;
}
.card .dur { position: absolute; right: 1rem; bottom: 1.25rem; color: inherit; font-weight: 750; pointer-events: none; }

.card.playing { grid-column: 1 / -1; aspect-ratio: auto; transform: none; box-shadow: 6px 6px 0 var(--ink); --cc: var(--sheet); --cf: var(--ink); padding: 1rem; }
.card.playing .tut-link { padding: 0.15rem 0 1rem 2.6rem; font-weight: 800; }
.card.playing .tut-link::before { left: 0; top: 0; }
.card.playing .tut-link::after { left: 0.62rem; top: 0.48rem; }
.card.playing .dur { display: none; }
.card.playing .player { padding: 0; }

/* Text pages */

.prose { padding: clamp(2rem, 6vh, 3.5rem) var(--edge) 0; max-width: calc(var(--measure) + 2 * var(--edge)); }
.prose p { margin: 0 0 1.1rem; }

/* Footer */

.foot { margin-top: clamp(4rem, 12vh, 7rem); padding: 2.5rem var(--edge) 3rem; background: var(--ink); color: #dcd9f5; font-size: 0.9375rem; }
.foot a { color: #fff; }
.foot p { max-width: var(--measure); margin: 0 0 0.9rem; }
.foot nav { margin-bottom: 0.9rem; }
.foot .foot-name { font-family: var(--display); font-size: 1.5rem; color: var(--yellow); line-height: 1; margin-bottom: 1.1rem; }
.foot .fine { font-size: 0.875rem; }

@media (max-width: 34rem) {
  body { font-size: 1.0625rem; }
  .ask { flex-wrap: wrap; }
  .ask label { padding-top: 0.8rem; flex-basis: 100%; }
  .ask input { padding: 0.5rem 1.1rem 0.9rem; flex-basis: 100%; }
  .ask button { flex-basis: 100%; border-left: 0; border-top: 3px solid var(--ink); padding: 0.8rem; }
  .tuts .tut { column-gap: 0.6rem; padding-right: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .press, .blk, .card { transition: none; }
  .mark .emblem .cursor, .mark .emblem .disc, .mark .emblem .ring { animation: none; }
}
