/* Libre Franklin is used under the SIL Open Font License 1.1; its text is fonts/OFL.txt. */
@font-face {
  font-family: "Libre Franklin";
  src: url("../fonts/LibreFranklin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* colours */
  --ground: oklch(15% 0 0);
  --raised: oklch(20.5% 0 0);
  --line: oklch(100% 0 0 / 0.16);
  --line-strong: oklch(100% 0 0 / 0.5);
  --text: oklch(96% 0 0);
  --muted: oklch(74% 0 0);

  --font: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;

  /* spacing */
  --gutter: clamp(20px, 4.5vw, 64px);
  --gap: clamp(16px, 2.2vw, 32px);
  --section: clamp(80px, 9vw, 128px);
  --block: clamp(32px, 4vw, 48px);

  /* type sizes */
  --t-display: clamp(4rem, 17.4vw, 9.75rem);
  --t-title: clamp(2.25rem, 5vw, 4rem);
  --t-name: 1.5rem;
  --t-body: clamp(1.0625rem, 0.35vw + 1rem, 1.25rem);
  --t-small: 0.9375rem;
}

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

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 var(--t-body) / 1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
b, strong { font-weight: 700; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }

.wrap {
  max-width: calc(1312px + 2 * var(--gutter));
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 8px 16px;
  background: var(--text);
  color: var(--ground);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 8px; }

/* ---------- top bar ---------- */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding-top: 24px;
  padding-bottom: 24px;
}
.bar__name {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.bar nav { display: flex; gap: 32px; }
.bar nav a {
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}
.bar nav a:hover { color: var(--text); }

/* ---------- welcome ---------- */
.hero { padding-top: clamp(24px, 3.4vw, 48px); }
.hero h1 {
  font-weight: 900;
  font-size: var(--t-display);
  line-height: 0.9;
  letter-spacing: -0.045em;
  margin-left: -0.025em;
}
.hero__lead {
  margin-top: clamp(24px, 3vw, 40px);
  max-width: 32em;
  font-size: clamp(1.125rem, 2.1vw, 1.875rem);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.hero__note {
  margin-top: clamp(16px, 1.6vw, 24px);
  max-width: 46em;
  font-size: clamp(0.9375rem, 0.3vw + 0.875rem, 1.125rem);
  line-height: 1.5;
  text-wrap: pretty;
}
.hero__note b, .hero__sig { font-weight: 800; }
.hero__sig { white-space: nowrap; }
.next {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gap);
  margin-top: clamp(32px, 4vw, 48px);
}
.next li {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.next__do {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  font-weight: 800;
  font-size: var(--t-name);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.next__n { color: var(--muted); font-weight: 500; }
.next__arrow { font-weight: 500; transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1); }
a.next__do:hover .next__arrow { transform: translateY(4px); }
.next p {
  margin-top: 8px;
  max-width: 22em;
  color: var(--muted);
}

/* ---------- sections ---------- */
.section { padding-top: var(--section); }
.hero + .section { padding-top: clamp(64px, 6.5vw, 96px); }
.section__head { margin-bottom: var(--block); }
.section h2 {
  font-weight: 800;
  font-size: var(--t-title);
  line-height: 1;
  letter-spacing: -0.035em;
  margin-left: -0.03em;
}
.section__lead {
  margin-top: 16px;
  max-width: 36em;
  color: var(--muted);
  text-wrap: balance;
}
.name {
  font-weight: 800;
  font-size: var(--t-name);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.small { font-size: var(--t-small); line-height: 1.5; color: var(--muted); }
.small a:hover, .section__lead a:hover, .version__head a:hover, .hero__note a:hover, .more a:hover, .fix a:hover { color: var(--text); }

/* ---------- four looks ---------- */
.looks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}
.look {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}
.look img {
  width: 100%;
  outline: 1px solid var(--line);
  outline-offset: -1px;
  transition: outline-color 0.2s;
}
.look__thumb { margin-top: 8px; }
.look .name { margin-top: 20px; }
.look p { margin-top: 8px; color: var(--muted); }
.look__open {
  margin-top: auto;
  padding-top: 16px;
  font-size: var(--t-small);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
.look:hover img, .look:focus-visible img { outline-color: var(--line-strong); }
/* other thumbnail ideas: one thin row under the four looks */
.others {
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.others__row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}
.others__row img {
  width: 100%;
  outline: 1px solid var(--line);
  outline-offset: -1px;
}
.others__row--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.others__row p { margin-top: 8px; font-size: var(--t-small); line-height: 1.4; color: var(--muted); }
.others__row b { display: block; color: var(--text); }
.others__note { margin-top: 20px; max-width: 48em; }
.echo { margin-top: 12px; max-width: 36em; color: var(--muted); }
.ask {
  margin-top: clamp(40px, 5vw, 64px);
  max-width: 21em;
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  line-height: 1.3;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

/* ---------- listen ---------- */
.version + .version { margin-top: 48px; }
.version__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  margin-bottom: 16px;
}
.version__head p { color: var(--muted); }
.players {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.player {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  column-gap: 24px;
  align-items: center;
  padding: 24px;
  background: var(--raised);
}
.player__btn {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--text);
  color: var(--ground);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.player__btn:hover { transform: scale(1.05); }
.player__btn:active { transform: scale(0.97); }
.player__btn svg { width: 28px; height: 28px; fill: currentColor; }
.player__btn[hidden] { display: none; }
.player .icon-pause { display: none; }
.player.is-playing .icon-play { display: none; }
.player.is-playing .icon-pause { display: block; }
.player p { margin-top: 4px; color: var(--muted); }
.player__meter {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}
.player__meter[hidden] { display: none; }
.player__bar {
  flex: 1;
  height: 4px;
  background: var(--line);
  overflow: hidden;
}
.player__fill {
  display: block;
  height: 100%;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s linear;
}
.player__time {
  min-width: 5.6em;
  text-align: right;
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.player audio {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 16px;
}
.player.is-ready audio { display: none; }
.credit { margin-top: 24px; max-width: 38em; }

/* ---------- Episode 11 ---------- */
.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.film video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: oklch(8% 0 0);
  outline: 1px solid var(--line);
  outline-offset: -1px;
}
.film figcaption { margin-top: 16px; }
.film figcaption p { margin-top: 4px; max-width: 30em; color: var(--muted); }
video::cue {
  font-family: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  color: oklch(98% 0 0);
  background: oklch(8% 0 0 / 0.78);
}

.short {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: start;
  margin-top: clamp(56px, 7vw, 96px);
}
.short video {
  grid-column: span 3;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: oklch(8% 0 0);
  outline: 1px solid var(--line);
  outline-offset: -1px;
}
.short__say { grid-column: 4 / span 7; max-width: 34em; }
.short__say .sub { margin-top: 0; margin-bottom: 0; }
.short__say p { margin-top: 12px; color: var(--muted); }

.sub {
  margin-top: clamp(56px, 7vw, 96px);
  margin-bottom: 24px;
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.fixes { border-top: 1px solid var(--line); }
.fix {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 12px;
  align-items: first baseline;
  padding-top: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.fix .name { grid-column: span 3; }
.fix__what { grid-column: span 4; }
.fix__how { grid-column: span 5; }
.fix__n { color: var(--muted); font-weight: 500; margin-right: 0.5em; }
.fix__figure {
  font-weight: 800;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.fix p + p { margin-top: 6px; }
.fix__what p:not(.fix__figure), .fix__how p { color: var(--muted); }
.fix__how summary {
  width: fit-content;
  cursor: pointer;
  font-size: var(--t-small);
  font-weight: 700;
}
.fix__how summary:hover { text-decoration: underline; text-underline-offset: 0.22em; }
.fix__how p { margin-top: 8px; }

.more { margin-top: 24px; }
.more summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 600;
  font-size: var(--t-small);
}
.more summary:hover { text-decoration: underline; text-underline-offset: 0.22em; }
.more pre {
  margin: 16px 0 0;
  padding: 16px;
  overflow-x: auto;
  background: var(--raised);
  font: 0.8125rem / 1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  white-space: pre;
}
.more p { margin-top: 12px; max-width: 48em; }

/* ---------- run the show, ideas ---------- */
.sub__lead {
  margin: -8px 0 24px;
  max-width: 36em;
  color: var(--muted);
  text-wrap: pretty;
}
.lines { border-top: 1px solid var(--line); }
.line {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 8px;
  align-items: first baseline;
  padding-top: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.line__name { grid-column: span 3; }
.line__n { margin-right: 0.5em; color: var(--muted); font-weight: 500; }
.line__body { grid-column: span 6; }
.line__body p { color: var(--muted); }
.line__body p + p { margin-top: 8px; }
.line__body b { color: var(--text); }
.line__side { grid-column: span 3; }
.line__side p + p { margin-top: 6px; }
.fold { border-bottom: 1px solid var(--line); }
.fold:first-child { border-top: 1px solid var(--line); }
.fold > summary {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: first baseline;
  padding-top: 24px;
  padding-bottom: 26px;
  cursor: pointer;
  list-style: none;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold__name {
  grid-column: span 5;
  font-weight: 800;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.fold__say { grid-column: span 6; color: var(--muted); }
.fold__mark {
  grid-column: span 1;
  justify-self: end;
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1;
}
.fold__mark::before { content: "+"; }
.fold[open] > summary .fold__mark::before { content: "\2212"; }
.fold > summary:hover .fold__name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.16em; }
.fold__body { padding-top: 8px; padding-bottom: 40px; }
.fold__body .sub__lead { margin-top: 0; }
.line__time {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.line a:hover, .cols a:hover, .terms a:hover { color: var(--text); }
code {
  font: 0.875em / 1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--text);
}
.cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--gap);
  border-top: 1px solid var(--line);
}
.cols li {
  padding-top: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.cols p { margin-top: 8px; max-width: 30em; color: var(--muted); }
.terms {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  column-gap: var(--gap);
  row-gap: 12px;
  margin: 16px 0 0;
  max-width: 60em;
}
.terms dt { font-weight: 700; }
.terms dd { margin: 0; color: var(--muted); }

/* ---------- a whole section that opens, and a fold that follows other content ---------- */
.block > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--gap);
  align-items: first baseline;
  padding-bottom: var(--block);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  list-style: none;
}
.block > summary::-webkit-details-marker { display: none; }
.block > summary .section__lead, .block__say { display: block; grid-column: 1; }
.block__say { margin-top: 12px; max-width: 36em; font-weight: 600; }
.block > summary .fold__mark { grid-column: 2; grid-row: 1; font-size: clamp(2rem, 4vw, 3rem); }
.block[open] > summary { border-bottom-color: transparent; }
.block[open] > summary .fold__mark::before { content: "\2212"; }
.block[open] > summary .block__say { display: none; }
.block > summary:hover h2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.12em; }
.folds--below { margin-top: clamp(56px, 7vw, 96px); }

/* ---------- short notes, each with the source it comes from ---------- */
.notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}
.notes p {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.notes b { color: var(--text); }
.notes + .folds { margin-top: var(--block); }
.fold__part { margin: 40px 0 24px; max-width: 36em; color: var(--muted); }
.fold__part:first-child { margin-top: 0; }
.fold__part b { color: var(--text); }
/* the layout drawn, beside its rules */
.guide {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 24px;
  align-items: start;
}
.guide img {
  grid-column: span 7;
  width: 100%;
  outline: 1px solid var(--line);
  outline-offset: -1px;
}
.rules { grid-column: span 5; border-top: 1px solid var(--line); }
.rules li {
  display: grid;
  grid-template-columns: 1.6em minmax(0, 1fr);
  padding-top: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.rules .line__n { margin-right: 0; }
.src { font-size: var(--t-small); }
.notes a:hover { color: var(--text); }
.cols + .folds { margin-top: -1px; }
.cols .small { margin-top: 6px; }
.hero__note p + p { margin-top: 8px; }

/* ---------- still to come, footer ---------- */
.soon { border-top: 1px solid var(--line); }
.soon li {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 4px;
  align-items: first baseline;
  padding-top: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.soon li .name { grid-column: span 3; }
.soon li p { grid-column: 4 / span 8; max-width: 36em; color: var(--muted); }

.foot {
  margin-top: var(--section);
  padding-top: 32px;
  padding-bottom: 48px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
}

/* ---------- narrower screens ---------- */
@media (max-width: 1079px) {
  .looks { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 48px; }
  .short video { grid-column: span 4; }
  .short__say { grid-column: 5 / span 8; }
}
@media (max-width: 1079px) {
  .next { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
}
@media (max-width: 899px) {
  .fix, .soon li, .line { grid-template-columns: 1fr; }
  .fix .name, .fix__what, .fix__how, .soon li .name, .soon li p,
  .line__name, .line__body, .line__side { grid-column: auto; }
  .cols, .terms, .notes, .guide { grid-template-columns: 1fr; }
  .notes { row-gap: 16px; }
  .guide img, .rules { grid-column: auto; }
  .fold > summary { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .fold__name { grid-column: 1; }
  .fold__mark { grid-column: 2; grid-row: 1; }
  .fold__say { grid-column: 1 / -1; }
  .terms { row-gap: 4px; }
  .terms dd { margin-bottom: 12px; }
}
@media (max-width: 799px) {
  .players, .pair { grid-template-columns: 1fr; }
  .pair { row-gap: 40px; }
  .short { grid-template-columns: 1fr; row-gap: 24px; }
  .short video, .short__say { grid-column: auto; }
  .short video { max-width: 360px; }
}
@media (max-width: 719px) {
  /* the menu stays at the top of the screen, and shows the same four steps as the list under the welcome */
  .bar {
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
    background: var(--ground);
    border-bottom: 1px solid var(--line);
  }
  .bar__name { display: none; }
  .bar nav {
    flex: 1;
    justify-content: space-between;
    gap: 12px;
    white-space: nowrap;
  }
  .bar nav a { padding-top: 14px; padding-bottom: 14px; }
  .section, .fold, .others, #theme, #top { scroll-margin-top: 64px; }
  .hero { padding-top: 20px; }
  .next { row-gap: 0; margin-top: 24px; }
  .next li { position: relative; padding-top: 12px; padding-bottom: 12px; }
  .next__do { gap: 0.45em; font-size: 1.125rem; }
  .next__do::after { content: ""; position: absolute; inset: 0; }
  .next__arrow { display: none; }
  .next p { margin-top: 2px; font-size: var(--t-small); line-height: 1.45; }
}
@media (max-width: 599px) {
  /* each look as one strip: cover and thumbnail side by side at the same height */
  .looks { grid-template-columns: 1fr; row-gap: 40px; }
  .look { display: grid; grid-template-columns: 9fr 16fr; column-gap: 8px; }
  .look__thumb { margin-top: 0; }
  .look .name, .look p, .look__open { grid-column: 1 / -1; }
  .look .name { margin-top: 16px; }
  .look__open { padding-top: 12px; }
  .others__row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 8px; }
  .player { column-gap: 16px; padding: 20px; }
  .player__btn { width: 64px; height: 64px; }
}
@media (max-width: 359px) {
  .bar__more { display: none; }
}

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