/* Site styles.

   Every color, font, size, and space comes from css/tokens.css. Do not write
   a color, a font name, or a pixel value here; add or change a token instead.
   The only fixed numbers are screen-width breakpoints (variables can't be used
   there) and the 1px box that hides text meant for screen readers only.

   Layers, from weakest to strongest:
     reset      undo browser defaults
     base       plain elements: body, headings, links, focus
     layout     page structure: container, sections, grids
     components header, hero, gauges, articles, search, footer, and so on
     utilities  single-purpose helpers */

@layer reset, base, layout, components, utilities;

/* ============================== reset ============================== */

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

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

  body,
  h1,
  h2,
  h3,
  h4,
  p,
  figure,
  blockquote,
  dl,
  dd,
  ul,
  ol {
    margin: 0;
  }

  ul[role="list"],
  ol[role="list"] {
    padding: 0;
    list-style: none;
  }

  img,
  picture,
  video,
  svg {
    display: block;
    max-inline-size: 100%;
  }

  img,
  video {
    block-size: auto;
  }

  input,
  button,
  textarea,
  select {
    font: inherit;
    color: inherit;
  }

  button {
    cursor: pointer;
  }
}

/* ============================== base ============================== */

@layer base {
  html {
    /* Keeps headings clear of the sticky header when jumping to a section. */
    scroll-padding-top: calc(var(--header-height) + var(--space-4));
    scroll-behavior: smooth;
  }

  body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-text);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
    -webkit-font-smoothing: antialiased;
    /* A very long word or web address wraps instead of pushing the page wide. */
    overflow-wrap: anywhere;
  }

  h1,
  h2,
  h3,
  h4 {
    font-family: var(--font-display);
    font-weight: var(--weight-display);
    line-height: var(--leading-snug);
    letter-spacing: var(--tracking-display);
    word-spacing: var(--word-space-display);
    text-wrap: balance;
  }

  h1 {
    font-size: var(--text-5xl);
    line-height: var(--leading-tight);
  }

  h2 {
    font-size: var(--text-3xl);
    line-height: var(--leading-tight);
  }

  h3 {
    font-size: var(--text-xl);
  }

  h4 {
    font-size: var(--text-lg);
  }

  p,
  li,
  dd {
    max-inline-size: var(--measure);
  }

  a {
    color: inherit;
    text-decoration-thickness: from-font;
    text-underline-offset: 0.2em;
  }

  a:hover {
    text-decoration-thickness: var(--border-width-strong);
  }

  strong {
    font-weight: var(--weight-bold);
  }

  /* One visible focus style for everything that can be focused. */
  :focus-visible {
    outline: var(--focus-width) solid var(--color-focus);
    outline-offset: var(--focus-offset);
  }

  ::selection {
    background: var(--color-accent);
    color: var(--color-on-accent);
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      transition-duration: 0.01ms !important;
    }
  }
}

/* ============================== layout ============================== */

@layer layout {
  .container {
    inline-size: 100%;
    max-inline-size: var(--content-max);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }

  .section {
    padding-block: var(--space-section);
  }

  .section--tight {
    padding-block-start: var(--space-6);
  }

  .section > .container > h2 {
    margin-block-end: var(--space-6);
  }

  .section > .container > h2:has(+ .lead) {
    margin-block-end: var(--space-3);
  }

  .section-foot {
    margin-block-start: var(--space-7);
  }

  .container--article {
    max-inline-size: calc(var(--content-article) + 2 * var(--gutter));
  }

  .container--text {
    max-inline-size: calc(var(--content-read) + 2 * var(--gutter));
  }

  /* Vertical rhythm for a run of text. */
  .flow > * + * {
    margin-block-start: var(--space-5);
  }

  .split {
    display: grid;
    gap: var(--space-7);
    align-items: center;
  }

  @media (min-width: 56em) {
    .split {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: var(--space-9);
    }
  }

  /* The footer sits at the bottom of the window on a short page. */
  body {
    display: flex;
    flex-direction: column;
    min-block-size: 100svh;
  }

  main {
    flex: 1 0 auto;
  }
}

/* ============================== components ============================== */

@layer components {
  /* ---------- Skip link ---------- */

  .skip-link {
    position: absolute;
    inset-block-start: var(--space-3);
    inset-inline-start: var(--space-3);
    z-index: 100;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-button);
    background: var(--color-bg);
    color: var(--color-text);
    transform: translateY(-300%);
  }

  .skip-link:focus {
    transform: none;
  }

  /* ---------- Small text styles ---------- */

  .eyebrow {
    margin-block-end: var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    color: var(--color-muted);
  }

  .lead {
    font-size: var(--text-lg);
    color: var(--color-muted);
  }

  /* ---------- Buttons ---------- */

  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-block-size: var(--target-min);
    padding: var(--space-3) var(--space-5);
    border: var(--border-width-strong) solid var(--color-accent);
    border-radius: var(--radius-button);
    background: var(--color-accent);
    color: var(--color-on-accent);
    font-size: var(--text-base);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    text-align: center;
    text-decoration: none;
    transition:
      background-color var(--duration-fast) var(--ease-out),
      border-color var(--duration-fast) var(--ease-out),
      color var(--duration-fast) var(--ease-out);
  }

  .button:hover {
    border-color: var(--color-accent-hover);
    background: var(--color-accent-hover);
  }

  .button--secondary {
    border-color: currentColor;
    background: transparent;
    color: var(--color-text);
  }

  .button--secondary:hover {
    border-color: var(--color-text);
    background: var(--color-text);
    color: var(--color-bg);
  }

  .button-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
  }

  /* ---------- Header and navigation ---------- */

  .site-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 50;
    background: var(--color-header-bg);
    color: var(--color-header-text);
  }

  .site-header__inner {
    padding-block: var(--space-2);
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: var(--space-5);
    min-block-size: var(--header-height);
  }

  .logo {
    flex: none;
    margin-inline-end: auto;
  }

  .logo img {
    inline-size: var(--logo-width);
  }

  .nav-toggle {
    min-block-size: var(--target-min);
    padding: var(--space-2) var(--space-4);
    border: var(--border-width) solid var(--color-border-strong);
    border-radius: var(--radius-button);
    background: transparent;
    font-weight: var(--weight-medium);
  }

  /* On phones the links sit behind the Menu button. For visitors without
     JavaScript, css/no-js.css shows the links and hides the button. */
  .site-nav {
    display: none;
    position: absolute;
    inset-block-start: 100%;
    inset-inline-end: var(--gutter);
    z-index: 1;
    inline-size: min(var(--menu-width), calc(100% - 2 * var(--gutter)));
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-card);
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
  }

  .site-header.is-open .site-nav {
    display: block;
  }

  .site-nav a {
    display: flex;
    align-items: center;
    min-block-size: var(--target-min);
    font-weight: var(--weight-medium);
    text-decoration: none;
  }

  .site-nav a:hover,
  .site-nav a[aria-current="page"] {
    text-decoration: underline;
    text-decoration-color: var(--color-needle);
    text-decoration-thickness: var(--border-width-strong);
  }

  @media (min-width: 60em) {
    .nav-toggle {
      display: none;
    }

    .site-nav {
      display: block;
      position: static;
      inline-size: auto;
      padding: 0;
      background: none;
      box-shadow: none;
    }

    .site-nav ul {
      display: flex;
      gap: var(--space-6);
    }
  }

  /* ---------- Fuel gauge (fills up as you read an article) ---------- */

  .fuel {
    flex: none;
    inline-size: var(--fuel-width);
  }

  .fuel svg {
    inline-size: 100%;
    overflow: visible;
  }

  .fuel path {
    fill: none;
    stroke: var(--color-muted);
    stroke-width: 4;
  }

  .fuel .fuel__low,
  .fuel .fuel__needle path {
    stroke: var(--color-needle);
  }

  .fuel .fuel__needle path {
    stroke-linecap: round;
  }

  .fuel circle,
  .fuel text {
    fill: var(--color-text);
  }

  .fuel text {
    font-family: var(--font-display);
    font-weight: var(--weight-display);
    font-size: var(--text-base);
  }

  /* ---------- Home: the car in the garage ---------- */

  .garage {
    position: relative;
    overflow: clip;
    padding-block: var(--space-6) var(--space-7);
    background:
      radial-gradient(ellipse 46% 44% at 50% 66%, var(--color-glow), var(--color-clear)),
      radial-gradient(ellipse 80% 75% at 50% 40%, var(--color-wall), var(--color-clear));
  }

  .garage__words {
    display: grid;
    justify-items: center;
    gap: var(--space-5);
    text-align: center;
  }

  .search {
    display: flex;
    gap: var(--space-2);
    inline-size: 100%;
    max-inline-size: var(--search-max);
  }

  .search input,
  .field input {
    min-inline-size: 0;
    inline-size: 100%;
    min-block-size: var(--field-height);
    padding: var(--space-3) var(--space-4);
    border: var(--border-width) solid var(--color-border-strong);
    border-radius: var(--radius-input);
    background: var(--color-surface);
  }

  .search input::placeholder {
    color: var(--color-muted);
    opacity: 1;
  }

  .search .button {
    flex: none;
  }

  .ride {
    position: relative;
    inline-size: min(100%, var(--ride-max));
    margin: var(--space-6) auto 0;
  }

  .garage__go {
    max-inline-size: none;
    margin-block-start: var(--space-6);
    padding-inline: var(--gutter);
    text-align: center;
  }

  /* Home: the search at the bottom */
  .section--find {
    background:
      radial-gradient(ellipse 60% 90% at 50% 100%, var(--color-glow), var(--color-clear)),
      var(--color-bg);
    text-align: center;
  }

  .section--find .search {
    margin-inline: auto;
  }

  .ride__car {
    position: relative;
    inline-size: 100%;
  }

  /* The light pooled on the floor in front of the car. */
  .ride__lights {
    position: absolute;
    inset: 0;
    mix-blend-mode: screen;
    pointer-events: none;
  }

  .ride__lights::after {
    content: "";
    position: absolute;
    inset-block: 88% -12%;
    inset-inline: 0;
    background:
      radial-gradient(ellipse closest-side at 25% 50%, var(--color-beam-soft), var(--color-clear)),
      radial-gradient(ellipse closest-side at 75% 50%, var(--color-beam-soft), var(--color-clear));
  }

  .ride__lights span {
    position: absolute;
    inset-block-start: 59.7%;
    inset-inline-start: 23.6%;
    inline-size: 38%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle closest-side, var(--color-beam-core) 10%, var(--color-beam) 22%, var(--color-beam-soft) 46%, var(--color-clear));
    transform: translate(-50%, -50%);
  }

  .ride__lights span + span {
    inset-inline-start: 76.4%;
  }

  .ride__smoke {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  /* Cartoon puffs in the same style as the car's own smoke. */
  .ride__smoke span {
    position: absolute;
    inset-block-end: 2%;
    inset-inline-start: 4%;
    inline-size: 20%;
    aspect-ratio: 11 / 10;
    background: url("/images/puff.svg") center / contain no-repeat;
    opacity: 0;
  }

  .ride__smoke span:nth-child(even) {
    inset-inline-start: 76%;
  }

  .ride__smoke span:nth-child(n + 3) {
    inset-block-end: 24%;
  }

  .ride__smoke span:nth-child(n + 5) {
    inset-block-end: 46%;
    inline-size: 15%;
  }

  /* The wake-up plays once, and only for visitors who welcome motion.
     Without it, the car is simply parked with its lights on. */
  @media (prefers-reduced-motion: no-preference) {
    .ride__car {
      animation: car-wake var(--duration-wake) linear both;
    }

    .ride__lights {
      animation: lights-on var(--duration-wake) linear both;
    }

    .ride__smoke span {
      animation: smoke-left var(--duration-smoke) calc(var(--duration-wake) * 0.4) var(--ease-out) both;
    }

    .ride__smoke span:nth-child(even) {
      animation-name: smoke-right;
    }

    .ride__smoke span:nth-child(n + 3) {
      animation-delay: calc(var(--duration-wake) * 0.55);
    }

    .ride__smoke span:nth-child(n + 5) {
      animation-delay: calc(var(--duration-wake) * 0.75);
    }
  }

  /* Dark, then the engine catches, shakes the car, and settles. */
  @keyframes car-wake {
    0%,
    24% {
      opacity: 0.4;
      transform: none;
    }

    28%,
    36%,
    44%,
    52% {
      transform: translate(0.12%, -0.3%);
    }

    32%,
    40%,
    48%,
    56% {
      transform: translate(-0.12%, 0.1%);
    }

    40% {
      opacity: 0.6;
    }

    62% {
      opacity: 1;
      transform: none;
    }

    100% {
      opacity: 1;
      transform: none;
    }
  }

  /* One short dim, then a steady rise. Never more than one blink. */
  @keyframes lights-on {
    0%,
    40% {
      opacity: 0;
    }

    46% {
      opacity: 0.6;
    }

    52% {
      opacity: 0.25;
    }

    72%,
    100% {
      opacity: 1;
    }
  }

  @keyframes smoke-left {
    0% {
      opacity: 0;
      transform: translate(45%, 10%) scale(0.5);
    }

    12%,
    45% {
      opacity: 0.95;
    }

    100% {
      opacity: 0;
      transform: translate(-85%, -75%) rotate(-24deg) scale(1.5);
    }
  }

  @keyframes smoke-right {
    0% {
      opacity: 0;
      transform: translate(-45%, 10%) scale(0.5);
    }

    12%,
    45% {
      opacity: 0.95;
    }

    100% {
      opacity: 0;
      transform: translate(85%, -75%) rotate(24deg) scale(1.5);
    }
  }

  /* ---------- Articles: the dashboard ---------- */

  .section--dash {
    padding-block-start: var(--space-8);
    background: var(--color-surface);
  }

  .section--dash .finder__count {
    margin-block-end: var(--space-6);
  }

  /* The search box stands out from the lighter panel behind them. */
  .section--dash input {
    background: var(--color-bg);
  }

  .dash {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5) var(--space-4);
    margin-block-start: var(--space-6);
  }

  @media (min-width: 40em) and (max-width: 63.99em) {
    /* Tablets: three, four, three. */
    .dash {
      grid-template-columns: repeat(12, minmax(0, 1fr));
      gap: var(--space-7) var(--space-5);
    }

    .dash li {
      grid-column: span 4;
    }

    .dash li:nth-child(n + 4):nth-child(-n + 7) {
      grid-column: span 3;
    }
  }

  @media (min-width: 64em) {
    .dash {
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: var(--space-7) var(--space-6);
    }
  }

  .dial {
    display: grid;
    justify-items: center;
    text-align: center;
    text-decoration: none;
  }

  .dial svg {
    inline-size: 100%;
    margin-block-end: var(--space-4);
    border-radius: 50%;
    background: var(--chrome);
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--duration-fast) var(--ease-out);
  }

  @media (max-width: 39.99em) {
    .dial svg {
      inline-size: var(--dial-phone);
      margin-block-end: var(--space-2);
    }
  }

  .dial__rim {
    fill: none;
  }

  .dial__face {
    fill: var(--color-dial);
    transition: fill var(--duration-fast) var(--ease-out);
  }

  .dial__ticks {
    stroke: var(--color-text);
    stroke-width: 2;
  }

  .dial text {
    fill: var(--color-text);
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: var(--weight-display);
    text-anchor: middle;
  }

  .dial__needle {
    fill: var(--color-needle);
    transform-box: view-box;
    transform-origin: center;
  }

  .dial__hub {
    fill: var(--color-border-strong);
  }

  .dial__name {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-display);
    line-height: var(--leading-snug);
  }

  .dial__count {
    color: var(--color-muted);
    font-size: var(--text-sm);
  }

  .dial:hover .dial__name {
    text-decoration: underline;
    text-decoration-color: var(--color-needle);
  }

  .dial:hover .dial__face {
    fill: var(--color-wall);
  }

  /* ---------- Home: Car won't start? ---------- */

  .section--start {
    background: var(--color-accent-hover);
  }

  .section--start .button {
    border-color: var(--color-text);
    background: var(--color-text);
    color: var(--color-bg);
  }

  .section--start .button:hover {
    border-color: var(--color-bg);
    background: var(--color-bg);
    color: var(--color-text);
  }

  .start {
    display: grid;
    gap: var(--space-6);
  }

  .start h2 {
    margin-block-end: var(--space-5);
  }

  .start__list {
    display: grid;
    gap: var(--space-4);
  }

  .start__list a {
    display: flex;
    align-items: center;
    min-block-size: var(--target-min);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--weight-display);
    line-height: var(--leading-snug);
    text-decoration: none;
  }

  .start__list a:hover {
    text-decoration: underline;
  }

  @media (min-width: 56em) {
    .start {
      grid-template-columns: 2fr 3fr;
      gap: var(--space-8);
      align-items: center;
    }
  }

  /* ---------- Article cards ---------- */

  .stories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(var(--story-min), 100%), 1fr));
    gap: var(--space-7) var(--space-6);
  }

  .story {
    position: relative;
  }

  .story__photo {
    overflow: hidden;
    margin-block-end: var(--space-4);
    border-radius: var(--radius-image);
    background: var(--color-surface);
    aspect-ratio: var(--ratio-card);
  }

  .story__photo img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out);
  }

  .story__photo picture {
    block-size: 100%;
  }

  .story__photo .no-photo {
    padding: var(--space-6);
    object-fit: contain;
  }

  .story__topics,
  .story__meta {
    color: var(--color-muted);
    font-size: var(--text-sm);
  }

  .story__title {
    margin-block: var(--space-1) var(--space-2);
    font-size: var(--text-xl);
  }

  .story__title a {
    text-decoration: none;
  }

  /* The whole card can be tapped. */
  .story__title a::after {
    content: "";
    position: absolute;
    inset: 0;
  }

  .story:hover .story__title a {
    text-decoration: underline;
    text-decoration-color: var(--color-needle);
  }

  @media (prefers-reduced-motion: no-preference) {
    .story:hover .story__photo img:not(.no-photo) {
      transform: scale(1.03);
    }
  }

  .photo-frame {
    overflow: hidden;
    border-radius: var(--radius-image);
  }

  .photo-frame img {
    inline-size: 100%;
    aspect-ratio: var(--ratio-card);
    object-fit: cover;
  }

  .section--about {
    background: var(--color-surface);
  }

  .section--about .pullquote {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-display);
    line-height: var(--leading-snug);
  }

  /* ---------- Article list, search, and topic pages ---------- */

  .page-head {
    padding-block: var(--space-7) var(--space-5);
  }

  .page-head h1 + * {
    margin-block-start: var(--space-5);
  }

  .page-head p + p {
    margin-block-start: var(--space-5);
  }

  .finder {
    max-inline-size: var(--search-max);
  }

  .finder__count {
    margin-block-start: var(--space-5);
    color: var(--color-muted);
  }

  .finder__none {
    font-size: var(--text-lg);
  }

  .field label {
    display: block;
    margin-block-end: var(--space-2);
    font-weight: var(--weight-medium);
  }

  /* ---------- Recommended: product cards ---------- */

  .disclosure.disclosure--dark {
    max-inline-size: var(--content-article);
    background: var(--color-surface);
  }

  /* On phones the list wraps, so every group is easy to see and tap. */
  .jumps {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .jumps a {
    display: inline-flex;
    align-items: center;
    min-block-size: var(--target-min);
    padding: var(--space-2) var(--space-4);
    border: var(--border-width) solid var(--color-border-strong);
    border-radius: var(--radius-button);
    font-weight: var(--weight-medium);
    line-height: var(--leading-snug);
    text-decoration: none;
  }

  .jumps a:hover {
    border-color: var(--color-text);
    background: var(--color-surface);
  }

  .section--picks {
    padding-block: var(--space-7);
  }

  .section--picks .lead {
    margin-block-end: var(--space-6);
  }

  .picks {
    display: grid;
    gap: var(--space-5);
  }

  .pick {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-inline-size: none;
    border-radius: var(--radius-card);
    background: var(--color-surface);
  }

  .pick__photo {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: var(--ratio-card);
  }

  /* The card clips anything outside it, so the ring goes inside. */
  .pick__photo:focus-visible {
    outline-offset: calc(-1 * var(--focus-width));
  }

  .pick__photo img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out);
  }

  .pick__photo picture {
    block-size: 100%;
  }

  .pick__label {
    position: absolute;
    inset-block-end: var(--space-3);
    inset-inline-start: var(--space-3);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-button);
    background: var(--color-bg);
    font-size: var(--text-sm);
    line-height: var(--leading-snug);
  }

  .pick__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-5);
  }

  .pick__badge {
    margin-block-end: var(--space-1);
    color: var(--color-focus);
    font-weight: var(--weight-bold);
  }

  .pick__why {
    margin-block: var(--space-3) var(--space-5);
  }

  .pick__why p + p {
    margin-block-start: var(--space-3);
  }

  /* Buttons line up along the bottom of each row. */
  .pick .button {
    inline-size: 100%;
    margin-block-start: auto;
  }

  @media (min-width: 40em) {
    .picks {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pick .button {
      inline-size: auto;
    }

    .pick--big,
    .picks:not(.picks--two) .pick:last-child {
      grid-column: 1 / -1;
    }
  }

  @media (min-width: 40em) and (max-width: 63.99em) {
    /* Tablets: the first card is side by side. */
    .pick--big {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pick--big .pick__photo {
      aspect-ratio: auto;
    }

    .pick--big .pick__photo img {
      position: absolute;
      inset: 0;
    }
  }

  @media (min-width: 64em) {
    .picks:not(.picks--two) {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .picks:not(.picks--two) .pick:last-child {
      grid-column: auto;
    }

    .pick--big {
      display: grid;
      grid-template-columns: 3fr 2fr;
    }

    /* The photo fills its side of the card. */
    .pick--big .pick__photo {
      aspect-ratio: auto;
    }

    .pick--big .pick__photo img {
      position: absolute;
      inset: 0;
    }

    .pick--big .button {
      margin-block-start: 0;
    }

    .pick--big .pick__body {
      padding: var(--space-7);
    }

    .pick--big h3 {
      font-size: var(--text-2xl);
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    .pick__photo:hover img {
      transform: scale(1.03);
    }
  }

  .section--about figcaption {
    margin-block-start: var(--space-3);
    color: var(--color-muted);
    font-size: var(--text-sm);
  }

  /* ---------- An article ---------- */

  .article__head {
    padding-block: var(--space-7);
  }

  .article__head:has(+ .paper .article__photo) {
    padding-block-end: calc(var(--photo-overlap) + var(--space-6));
  }

  .article__head h1 {
    font-size: var(--text-4xl);
  }

  .tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
    margin-block-end: var(--space-3);
  }

  .tag {
    display: inline-flex;
    align-items: center;
    min-block-size: var(--target-small);
    font-weight: var(--weight-bold);
  }

  .article__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-5);
    max-inline-size: none;
    margin-block-start: var(--space-5);
    color: var(--color-muted);
    font-size: var(--text-sm);
  }

  .paper {
    padding-block: var(--space-7) var(--space-9);
    background: var(--color-paper);
    color: var(--color-ink);
    color-scheme: light;
  }

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

  .article__photo {
    margin-block: calc(-1 * (var(--photo-overlap) + var(--space-7))) var(--space-7);
  }

  .article__photo img {
    inline-size: 100%;
    max-block-size: var(--article-photo-max);
    border-radius: var(--radius-image);
    object-fit: cover;
  }

  .article__credit {
    margin-block-start: var(--space-2);
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
  }

  .disclosure {
    max-inline-size: none;
    margin-block-end: var(--space-6);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-card);
    background: var(--color-paper-deep);
    font-size: var(--text-sm);
  }

  /* Reading text. It starts with phones: big letters, roomy lines, and more
     space above a heading than below it, so each heading stays with its
     section. Lines stay near 65 letters on bigger screens. */
  .prose {
    font-size: var(--text-read);
    line-height: var(--leading-read);
  }

  .prose > * + * {
    margin-block-start: var(--read-gap);
  }

  .prose :is(p, li) {
    max-inline-size: none;
    text-wrap: pretty;
  }

  .prose > :is(h2, h3, h4, h5, h6) {
    margin-block-start: var(--read-section);
    letter-spacing: var(--tracking-read);
  }

  .prose > :is(h2, h3, h4, h5, h6) + * {
    margin-block-start: var(--space-3);
  }

  /* Pictures and videos get extra room. */
  .prose > * + :is(figure, .table-scroll),
  .prose > :is(figure, .table-scroll) + :not(h2, h3, h4, h5, h6) {
    margin-block-start: var(--read-media);
  }

  .prose > :first-child {
    margin-block-start: 0;
  }

  .prose h2 {
    font-size: var(--text-2xl);
    line-height: var(--leading-heading);
  }

  .prose :is(h3, h4) {
    font-size: var(--text-xl);
  }

  .prose :is(h5, h6) {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: var(--weight-display);
  }

  .prose a {
    color: var(--color-ink-link);
  }

  .prose :is(ul, ol) {
    padding-inline-start: var(--space-5);
  }

  .prose li + li,
  .prose li > :is(ul, ol) {
    margin-block-start: var(--space-2);
  }

  .prose li::marker {
    color: var(--color-ink-link);
    font-weight: var(--weight-bold);
  }

  .prose figure > picture img,
  .prose p > picture img {
    max-inline-size: 100%;
    max-block-size: var(--read-photo-max);
    inline-size: auto;
    border-radius: var(--radius-image);
  }

  .prose figcaption {
    margin-block-start: var(--space-2);
    color: var(--color-ink-muted);
    font-size: var(--text-sm);
  }

  .prose blockquote {
    margin-block: var(--space-7);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--weight-display);
    line-height: var(--leading-snug);
    color: var(--color-ink-link);
  }

  .prose blockquote cite {
    display: block;
    margin-block-start: var(--space-3);
    color: var(--color-ink-muted);
    font-family: var(--font-text);
    font-size: var(--text-sm);
    font-style: normal;
    font-weight: var(--weight-regular);
  }

  .prose hr {
    margin-block: var(--space-7);
    border: 0;
    border-block-start: var(--border-width) solid var(--color-ink-border);
  }

  .video {
    display: block;
    inline-size: 100%;
    block-size: auto;
    border: 0;
    border-radius: var(--radius-image);
    background: var(--color-ink);
    aspect-ratio: var(--ratio-video);
  }

  /* Wide tables scroll sideways inside their own box, never the page. */
  .table-scroll {
    overflow-x: auto;
  }

  .prose table {
    inline-size: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    overflow-wrap: normal;
  }

  .prose :is(th, td) {
    padding: var(--space-3);
    border-block-end: var(--border-width) solid var(--color-ink-border);
    text-align: start;
    vertical-align: top;
  }

  .prose thead,
  .prose th {
    background: var(--color-paper-deep);
  }

  /* ---------- Footer ---------- */

  .site-footer {
    padding-block: var(--space-7) var(--space-6);
    color: var(--color-muted);
  }

  /* A chrome bumper across the top of the footer. */
  .site-footer::before {
    content: "";
    display: block;
    block-size: var(--space-1);
    margin-block-start: calc(-1 * var(--space-7));
    margin-block-end: var(--space-7);
    background: var(--chrome-bar);
  }

  .site-footer__grid {
    display: grid;
    gap: var(--space-6);
  }

  .site-footer__name {
    color: var(--color-text);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--weight-display);
  }

  .site-footer nav ul {
    display: grid;
    gap: var(--space-1);
  }

  .site-footer nav a {
    display: inline-flex;
    align-items: center;
    min-block-size: var(--target-min);
    text-decoration: none;
  }

  .site-footer nav a:hover {
    text-decoration: underline;
  }

  .site-footer__base {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-2) var(--space-6);
    margin-block-start: var(--space-6);
    font-size: var(--text-sm);
  }

  @media (min-width: 48em) {
    .site-footer__grid {
      grid-template-columns: 1fr auto;
    }

    .site-footer nav ul {
      grid-template-columns: repeat(2, auto);
      column-gap: var(--space-7);
    }
  }
}

/* ============================== utilities ============================== */

@layer utilities {
  .visually-hidden {
    position: absolute !important;
    inline-size: 1px;
    block-size: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .keep {
    white-space: nowrap;
  }

  [hidden] {
    display: none !important;
  }
}
