/* The blog: blog.html, post/<slug>.html and author/<slug>.html, built by
   tools/blog-pages.py. A reading layout in the site's colours and fonts,
   with no 3D scene. Fonts and tokens mirror :root in styles.css and
   legal.css; change them together. src/footer.css styles the footer. */

@font-face {
  font-family: 'General Sans';
  src: url('../assets/fonts/GeneralSans-Latin.woff2') format('woff2');
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito Sans';
  src: url('../assets/fonts/NunitoSans-Latin.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --p-clear: #f8f5ff;
  --p-soft: #f0e9ff;
  --p-subtle: #d9c6ff;
  --p-default: #994dfe;
  --p-base: #7c02fd;
  --p-strong: #5b01b9;
  --p-dark: #3c007c;
  --p-inverse: #25004b;
  --ink: #1b1030;
  --ink-2: #4a3f66;
  --n-ink: #2a2a2a;
  --n-ink-2: #6d6d6d;
  --focus: #3c007c;
  --gutter: max(16px, 4.5vw);
  /* the footer's row is 1280 wide (footer.css), so the page lines up with it */
  --wide: 1280px;
  --read: 720px;
  --radius: 24px;
  --font-head: 'General Sans', 'Nunito Sans', system-ui, sans-serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--p-clear);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

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

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 50;
  background: var(--p-base);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}
.skip:focus {
  top: 12px;
}

/* ---------- top bar: the home page's logo, and a link to the blog ---------- */

.blog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) var(--gutter) 8px;
}

.brand {
  display: inline-flex;
  align-items: flex-end;
  color: var(--p-base);
  text-decoration: none;
  border-radius: 10px;
  padding: 4px;
}
.brand-bull,
.brand-word {
  display: block;
  background: currentColor;
  -webkit-mask: var(--m) center / contain no-repeat;
  mask: var(--m) center / contain no-repeat;
}
.brand-bull {
  --m: url('../assets/img/bull.svg');
  width: 54px;
  height: 32px;
}
.brand-word {
  --m: url('../assets/img/wordmark.svg');
  width: 52px;
  height: 16px;
  margin-inline-start: -6px;
  margin-bottom: 0.5px;
  color: var(--n-ink);
}

.bar-link {
  display: inline-grid;
  place-items: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: #fff;
  color: var(--p-base);
  box-shadow: 0 3px 0 var(--p-subtle);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}
.bar-link:hover {
  background: var(--p-soft);
}
.bar-link[aria-current='page'] {
  background: var(--p-base);
  color: #fff;
  box-shadow: 0 3px 0 var(--p-dark);
}

/* ---------- index and author pages ---------- */

.blog-main {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 24px var(--gutter) 80px;
}

.page-head {
  max-width: 760px;
  margin: 24px 0 44px;
}
.eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p-base);
}
.page-head h1 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--p-inverse);
}
.lede {
  margin: 16px 0 0;
  max-width: 44ch;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.45;
  color: var(--n-ink-2);
}

/* the post cards */
.cards {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px 24px;
  margin: 0;
  padding: 0;
}
@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.cards > li {
  display: flex;
  min-width: 0;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #fff;
  border: 1px solid var(--p-soft);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--p-subtle);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 0 var(--p-subtle);
}
.card-img {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: var(--p-soft);
}
.card-img picture,
.card-img img {
  width: 100%;
  height: 100%;
}
.card-img img {
  object-fit: cover;
}
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 20px 22px 22px;
}
.tag {
  margin: 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--p-soft);
  color: var(--p-strong);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.4;
}
.card-title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--p-inverse);
}
/* The title link covers the whole card, so the card is one tap target and
   one tab stop. Its focus ring is drawn around the card. */
.card-title a {
  color: inherit;
  text-decoration: none;
}
.card-title a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}
.card-title a:focus-visible {
  outline: none;
}
.card-title a:focus-visible::after {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.card:hover .card-title a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.card-excerpt {
  margin: 0;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.meta {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}
.card .meta {
  margin-top: auto;
  padding-top: 4px;
}

/* The newest post on the index spans the row, from 900px wide with the
   image beside the text. */
@media (min-width: 640px) {
  .cards > li.is-featured {
    grid-column: 1 / -1;
  }
  .card.is-featured .card-title {
    font-size: 24px;
  }
}
@media (min-width: 900px) {
  .card.is-featured {
    flex-direction: row;
  }
  .card.is-featured .card-img {
    flex: 0 0 56%;
    aspect-ratio: auto;
    min-height: 380px;
    border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px);
  }
  .card.is-featured .card-body {
    justify-content: center;
    gap: 14px;
    padding: 40px 44px;
  }
  .card.is-featured .card-title {
    font-size: clamp(26px, 2.4vw, 34px);
    line-height: 1.15;
  }
  .card.is-featured .card-excerpt {
    font-size: 17px;
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }
  .card.is-featured .meta {
    margin-top: 6px;
  }
}

/* author pages */
.author-head .bio {
  margin-top: 16px;
  max-width: 60ch;
}
.role {
  margin: 10px 0 0;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 18px;
  color: var(--n-ink-2);
}
.profile-links {
  margin: 20px 0 0;
}
.profile-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--p-soft);
  background: #fff;
  box-shadow: 0 3px 0 var(--p-subtle);
  color: var(--p-strong);
  font-weight: 700;
  text-decoration: none;
}
.profile-links a:hover {
  background: var(--p-soft);
}
.section-title {
  margin: 0 0 24px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.25;
  color: var(--p-inverse);
}
.all-posts {
  margin: 48px 0 0;
  text-align: center;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  text-align: center;
  color: #fff;
  background: linear-gradient(180deg, #a35cff 0%, var(--p-base) 60%);
  box-shadow: 0 5px 0 var(--p-dark), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s ease;
}
.btn:hover {
  filter: brightness(1.06);
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--p-dark), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.btn-ghost {
  color: var(--p-base);
  background: #fff;
  box-shadow: 0 4px 0 var(--p-subtle), inset 0 0 0 2px var(--p-subtle);
}
.btn-ghost:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--p-subtle), inset 0 0 0 2px var(--p-subtle);
}

/* ---------- a post ---------- */

.post-main {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 8px var(--gutter) 80px;
}

.post-head {
  max-width: var(--read);
  margin: 24px auto 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.back {
  margin: 0 0 22px;
}
.back a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--p-strong);
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
}
.back a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.post-head .tag {
  margin-bottom: 14px;
}
.post-head h1 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--p-inverse);
  overflow-wrap: break-word;
  max-width: 100%;
}
.post-head .meta {
  margin-top: 18px;
  font-size: 15px;
}
.post-head .meta a {
  color: var(--p-strong);
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.post-hero {
  max-width: 960px;
  margin: 0 auto 44px;
}
.post-hero img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--p-soft);
}

/* the article text, as it was published */
.prose {
  max-width: var(--read);
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.prose p,
.prose ul,
.prose ol {
  margin: 0 0 22px;
}
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--p-inverse);
  letter-spacing: -0.01em;
  scroll-margin-top: 24px;
}
.prose h2 {
  margin: 52px 0 14px;
  font-size: clamp(24px, 2.6vw, 30px);
  line-height: 1.22;
}
.prose h3 {
  margin: 38px 0 10px;
  font-size: 22px;
  line-height: 1.3;
}
.prose h4 {
  margin: 30px 0 8px;
  font-size: 19px;
  line-height: 1.35;
}
.prose h5 {
  margin: 26px 0 8px;
  font-size: 17px;
}
.prose h6 {
  margin: 28px 0 6px;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p-strong);
}
.prose > :first-child {
  margin-top: 0;
}
.prose ul,
.prose ol {
  padding-inline-start: 1.4em;
}
.prose li {
  margin: 0 0 8px;
  padding-inline-start: 0.2em;
}
.prose li::marker {
  color: var(--p-base);
  font-weight: 700;
}
.prose li > ul,
.prose li > ol {
  margin: 8px 0 0;
}
.prose a {
  color: var(--p-strong);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(91, 1, 185, 0.35);
}
.prose a:hover {
  text-decoration-color: currentColor;
}
.prose blockquote {
  margin: 30px 0;
  padding: 18px 24px;
  border-inline-start: 4px solid var(--p-base);
  border-radius: 0 16px 16px 0;
  background: var(--p-soft);
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.45;
  color: var(--p-inverse);
}
.prose blockquote p {
  margin: 0;
}
.prose figure {
  margin: 34px 0;
}
/* Tall images are capped at most of the screen height, so a portrait
   screenshot does not fill three screens. */
.prose figure img {
  width: auto;
  max-height: min(80vh, 900px);
  margin: 0 auto;
  border-radius: 18px;
  background: var(--p-soft);
}
.prose figcaption {
  margin: 12px auto 0;
  max-width: 60ch;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* The one wide table scrolls inside its box on a phone. A soft shadow on
   an edge shows there is more to scroll to (the white covers move with the
   table and hide the shadow at either end). */
.table-wrap {
  margin: 0 0 26px;
  overflow-x: auto;
  border: 1px solid var(--p-soft);
  border-radius: 16px;
  background:
    linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, 0)) left / 40px 100% no-repeat local,
    linear-gradient(270deg, #fff 30%, rgba(255, 255, 255, 0)) right / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(37, 0, 75, 0.24), transparent) left / 16px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(37, 0, 75, 0.24), transparent) right / 16px 100% no-repeat scroll,
    #fff;
}
.prose table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: normal;
}
.prose th,
.prose td {
  padding: 12px 14px;
  text-align: start;
  vertical-align: top;
  border-bottom: 1px solid var(--p-soft);
}
.prose thead th {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--p-inverse);
}
.prose tbody tr:last-child td {
  border-bottom: 0;
}

/* a Facebook post or video from the old page, as a link */
.prose .embed a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--p-subtle);
  background: #fff;
  box-shadow: 0 3px 0 var(--p-subtle);
  color: var(--p-strong);
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}
.prose .embed a:hover {
  background: var(--p-soft);
}
.prose .embed svg {
  flex: none;
}

/* the note at the end of every post */
.launch {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: var(--read);
  margin: 64px auto 0;
  padding: 28px 36px 28px 28px;
  border: 1px solid var(--p-soft);
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff, #f6f1ff);
  box-shadow: 0 4px 0 var(--p-subtle);
}
.launch-toro {
  flex: none;
  width: 124px;
}
.launch h2 {
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--p-inverse);
}
.launch p {
  margin: 0 0 20px;
  color: var(--ink-2);
}

/* Headings break into lines of even length where the browser can. */
.page-head h1,
.post-head h1,
.card-title,
.section-title,
.launch h2 {
  text-wrap: balance;
}

/* ---------- phones ---------- */

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }
  .page-head {
    margin: 12px 0 32px;
  }
  .card-body {
    padding: 18px 18px 20px;
  }
  .card-title {
    font-size: 19px;
  }
  .post-head {
    margin-top: 12px;
  }
  .back {
    margin-bottom: 12px;
  }
  .post-hero {
    margin-bottom: 32px;
  }
  .post-hero img {
    border-radius: 18px;
  }
  .prose {
    font-size: 17px;
  }
  .prose h2 {
    margin-top: 44px;
  }
  .prose blockquote {
    padding: 14px 18px;
    font-size: 18px;
  }
  .launch {
    flex-direction: column;
    gap: 12px;
    padding: 24px 20px 28px;
    text-align: center;
  }
  .launch-toro {
    width: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .btn {
    transition: none;
  }
  .card:hover {
    transform: none;
  }
}
