/*
 * The public pages (epic 4, T4.1; the second look, 2026-11-08, research/site-design.md: "Accent light"). The owner:
 * beautiful, interesting, high-tech, little animations, simple, no complex patterns, not heavy. So: white paper and
 * system fonts; the site's colour as the light of the page (a wash at the top, the glow of the two actions, the
 * rings); one dark console for the code; every motion is CSS, composited, finite, and stopped for a visitor who asks
 * for less. Phone first (mobile.md §1). The site's colour arrives as --accent, --on-accent (text on it) and
 * --accent-text (it as text on white), all three from layout.ts, and nowhere else: another look is one setting.
 */
:root {
  color-scheme: light;
  --ink: #0f1419;
  --ink-2: #334155;
  --muted: #5b6670;
  --line: #e4e8ee;
  --soft: #f3f5f8;
  --page: #f8f9fb;
  --card: #fff;
  --night: #0b1220;
  --night-2: #141e33;
  --night-line: #26324c;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(15 20 25 / 6%), 0 10px 26px -16px rgb(15 20 25 / 24%);
  --shadow-up: 0 2px 6px rgb(15 20 25 / 7%), 0 22px 44px -18px rgb(15 20 25 / 34%);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  /* The accent's tints where the browser can mix colours; plain greys where it cannot. */
  --tint: var(--soft);
  --tint-line: var(--line);
  --glow: transparent;
  --accent-top: var(--accent);
}

@supports (color: color-mix(in srgb, red, blue)) {
  :root {
    --tint: color-mix(in oklab, var(--accent) 8%, #fff);
    --tint-line: color-mix(in oklab, var(--accent) 24%, #fff);
    --glow: color-mix(in oklab, var(--accent) 45%, transparent);
    --accent-top: color-mix(in oklab, var(--accent) 88%, #fff);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* The scrollbar's room is kept while the item popup holds the page still, so nothing under it moves sideways. */
  scrollbar-gutter: stable;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  /* A line of the site's colour across the very top, and under it the wash: the colour, faint. Painted once. */
  border-top: 3px solid var(--accent);
  background: radial-gradient(120% 420px at 50% -140px, var(--tint-line), transparent 70%) no-repeat, var(--page);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  /* One long word in a title or a review must not make the page scroll sideways. */
  overflow-wrap: anywhere;
}

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

a {
  color: inherit;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 {
  margin: 0 0 12px;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}


ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

/* ---- The frame ---- */

/* The mark and the name, under the line of the site's colour: the site says whose it is at once. */
.site-header {
  display: flex;
  align-items: center;
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: 14px 16px 6px;
  view-transition-name: header;
}

.site-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

/* The site's mark until it has a logo of its own: its first letter on its colour, as on the tab's icon. */
.site-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(140deg, var(--accent-top), var(--accent));
  border-radius: 10px;
  box-shadow: 0 6px 16px -6px var(--glow);
  color: var(--on-accent);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 16px 40px;
}

main > section,
main > .tabs,
main > .thumbs,
main > .paging {
  margin-top: 30px;
}

.site-footer {
  padding: 22px 16px 28px;
  background: #fff;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.site-footer p {
  max-width: 560px;
  margin: 0 auto 10px;
}

.site-footer nav {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.site-footer a {
  padding: 4px 0;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

.tagline {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #fff4dc;
  border: 1px solid #f6dfae;
  border-radius: 12px;
  color: #744400;
  font-size: 14px;
}

.empty {
  padding: 48px 0;
  color: var(--muted);
  text-align: center;
}

/* ---- The code from the video: a small console, the first thing on the home page ---- */

.code-form {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 16px;
  background: linear-gradient(160deg, var(--night-2), var(--night) 62%);
  border: 1px solid var(--night-line);
  border-radius: 20px;
  box-shadow: 0 22px 44px -26px rgb(2 6 23 / 75%), 0 0 0 4px var(--tint);
  color: #e2e8f0;
}

/* A prompt before the label, as in a terminal. */
.code-form label {
  grid-column: 1 / -1;
  color: #9fb0c6;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.code-form label::before {
  content: "› ";
  color: var(--accent-top);
  font-family: var(--mono);
}

.code-form input {
  width: 100%;
  min-width: 0;
  height: 54px;
  padding: 0 14px;
  background: rgb(255 255 255 / 6%);
  border: 1px solid var(--night-line);
  border-radius: 12px;
  caret-color: var(--accent-top);
  color: #fff;
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  outline: 1px solid transparent;
  outline-offset: 0;
  transition: outline-offset 0.15s var(--ease), outline-color 0.15s, background 0.15s;
}

/* The ring grows out of the field: focus says "type here" without moving anything. */
.code-form input:focus {
  background: rgb(255 255 255 / 9%);
  outline: 2px solid var(--accent-top);
  outline-offset: 3px;
}

/* "Go" is the buy button's twin: the colour means "go" all over the site. */
.code-form button {
  height: 54px;
  padding: 0 20px;
  background: linear-gradient(180deg, var(--accent-top), var(--accent));
  border: 0;
  border-radius: 12px;
  box-shadow: 0 10px 24px -10px var(--glow);
  color: var(--on-accent);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.code-form button::after {
  content: " →";
}

/* ---- Sections and cards ---- */

/* A live dot before a section's name: these are the items of the videos now. */
.featured h2,
.carousel h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.featured h2::before,
.carousel h2::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--tint);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 10px;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 8px;
}

.card {
  min-width: 0;
}

.card > a {
  position: relative;
  display: block;
  text-decoration: none;
}

/* The code said in the video, on the photo's corner, in the type of a terminal. */
.card-code {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 1px 7px;
  background: var(--night);
  border-radius: 7px;
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

.thumbs .card-code {
  top: 5px;
  left: 5px;
  padding: 0 6px;
  font-size: 11px;
}

/* A photo still on its way shows a faint tint of the site, not a grey hole. */
.card img,
.photo-missing {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: linear-gradient(135deg, var(--tint), var(--soft));
  border-radius: 12px;
}

/* A section's card is a little panel of its own: photo, name, tags, and the store's button at its foot. */
.grid > .card,
.strip > .card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 7px 7px 9px;
  background: var(--card);
  border: 1px solid rgb(15 20 25 / 6%);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.2s var(--ease);
}

/* The deeper shadow of a lifted card is laid on and faded in, never animated itself (research §2.2). */
.grid > .card::after,
.strip > .card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--shadow-up);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
  pointer-events: none;
}

.card-title {
  display: -webkit-box;
  margin-top: 8px;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.grid > .card .card-title,
.strip > .card .card-title {
  padding: 0 3px;
}

.thumbs .card-title {
  font-size: 13px;
}

.thumbs .card img {
  transition: transform 0.2s var(--ease);
}

/* A carousel: one row a thumb slides, each card stopping at the edge, the edge fading to say there is more. */
.carousel {
  position: relative;
}

.strip {
  display: grid;
  grid-auto-columns: 42%;
  grid-auto-flow: column;
  gap: 10px;
  margin-right: -16px;
  margin-left: -16px;
  padding: 2px 16px 14px;
  overflow-x: auto;
  scroll-padding: 0 16px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}

.strip::-webkit-scrollbar {
  display: none;
}

.strip > .card {
  scroll-snap-align: start;
}

.card-foot {
  margin-top: auto;
  padding-top: 8px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.grid > .card .tags,
.strip > .card .tags {
  padding: 0 3px;
}

.tag {
  padding: 1px 8px;
  background: var(--tag, var(--tint));
  border: 1px solid var(--tag, var(--tint-line));
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.tag[style] {
  color: var(--on-tag);
}

/* ---- The store's buttons: a card's, and the item page's: the colour and the light, nothing else has both ---- */

.card-buy,
.buy-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--accent-top), var(--accent));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 22%), 0 10px 22px -12px var(--glow);
  color: var(--on-accent);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 0.12s var(--ease);
}

.card-buy {
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 14px;
}

/* A carousel's card is narrower on a phone: the store's words keep one line, the arrow gives way to them. */
.strip .card-buy {
  padding-right: 6px;
  padding-left: 6px;
  font-size: 13px;
}

.strip .card-buy::after {
  content: none;
}

/* The arrow says "to the store"; under a pointer it leans that way. */
.card-buy::after,
.buy-button::after {
  content: "→";
  transition: transform 0.2s var(--ease);
}

/* A sheen that crosses the button once when a pointer comes to it (research §2.4: never a loop). */
.card-buy::before,
.buy-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgb(255 255 255 / 30%) 50%, transparent 75%);
  transform: translateX(-130%);
  pointer-events: none;
}

/* The store's official badge, as it is: not the photo square every other image of a card is. */
.card .card-buy .badge {
  width: auto;
  height: 18px;
  aspect-ratio: auto;
  background: none;
  border-radius: 0;
}

/* ---- Tabs: a row a thumb can slide ---- */

.tabs {
  display: flex;
  gap: 6px;
  margin-right: -16px;
  margin-left: -16px;
  padding: 2px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  view-transition-name: tabs;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs a,
.subcategories a {
  flex: none;
  padding: 7px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
}

/* The tab you are on: a ring of the site's colour and no fill, so its small text reads whatever the colour. */
.tabs a[aria-current="page"] {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 6px 16px -10px var(--glow);
  font-weight: 700;
}

.subcategories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.paging {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.paging a {
  padding: 9px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight: 600;
  text-decoration: none;
}

.all-items .paging {
  margin-top: 18px;
}

/* ---- The item ---- */

.breadcrumb {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb a {
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent-text);
  text-decoration: underline;
}

/* A swipe, without a script. The next photo shows at the edge, so a thumb knows there is more. */
.gallery {
  display: flex;
  gap: 8px;
  margin-right: -16px;
  margin-left: -16px;
  padding: 0 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  scrollbar-width: none;
}

.gallery::-webkit-scrollbar {
  display: none;
}

.gallery img,
.gallery .photo-missing {
  flex: 0 0 86%;
  width: 86%;
  aspect-ratio: 1;
  object-fit: cover;
  background: linear-gradient(135deg, var(--tint), var(--soft));
  border-radius: 18px;
  box-shadow: var(--shadow);
  scroll-snap-align: start;
}

.gallery img:only-child {
  flex-basis: 100%;
  width: 100%;
}

.item-info h1 {
  margin-top: 16px;
}

/* The code to say in a comment, in the type of a terminal. */
.code {
  display: inline-block;
  margin: 10px 0 0;
  padding: 2px 10px;
  background: var(--tint);
  border: 1px solid var(--tint-line);
  border-radius: 8px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.buy {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.buy-button {
  padding: 16px;
  border-radius: 14px;
  font-size: 19px;
}

/* A second store is there, and is not what the page is asking for. */
.buy-button + .buy-button {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--accent);
  color: var(--ink);
}

.share {
  margin-top: 10px;
  padding: 7px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.button-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.item-more {
  margin-top: 24px;
}

.item-more > * + * {
  margin-top: 22px;
}

/* The video: a dark screen, the play sign in the site's colour, as the code's console on the home page. */
.video {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px 18px;
  background: linear-gradient(160deg, var(--night-2), var(--night) 70%);
  border-radius: 18px;
  box-shadow: 0 18px 36px -24px rgb(2 6 23 / 70%);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.video::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 15px solid var(--accent-top);
}

.item-more iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 18px;
}

.review p,
.intro p {
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}

.pros,
.cons {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pros h2,
.cons h2 {
  margin-bottom: 6px;
  font-size: 16px;
}

.pros li,
.cons li {
  position: relative;
  padding: 3px 0 3px 28px;
  overflow-wrap: anywhere;
}

.pros li::before,
.cons li::before {
  position: absolute;
  top: 5px;
  left: 0;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.pros li::before {
  content: "+";
  background: var(--tint);
  color: var(--accent-text);
}

.cons li::before {
  content: "−";
  background: var(--soft);
  color: var(--muted);
}

.intro {
  margin-top: 8px;
  color: var(--ink-2);
}

/* Tap a photo: the whole of it (site.js). */
.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  background: #000;
  border: 0;
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop {
  background: #000;
}

.lightbox img {
  width: auto;
  max-width: 100%;
  max-height: 100%;
}

/* ---- An item over the page it was opened from (site.js; the owner, 2026-11-08): the whole screen on a phone, a
   window on a computer, the page dimmed and still behind it ---- */

html:has(.popup[open]) {
  overflow: hidden;
}

.popup {
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--page);
  border: 0;
  color: var(--ink);
}

.popup::backdrop {
  background: rgb(11 18 32 / 55%);
}

/* The cross stays in its corner while the item scrolls under it. */
.popup-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  height: 0;
  padding: 0 12px;
}

.popup-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: 12px;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.popup-body {
  padding: 16px 16px 32px;
}

.popup-body > section {
  margin-top: 30px;
}

/* ---- Wider than a phone ---- */

@media (min-width: 640px) {
  .site-header {
    padding-top: 18px;
  }

  main {
    padding-top: 14px;
  }

  .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 16px;
  }

  .thumbs {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px 12px;
  }

  .strip {
    grid-auto-columns: 210px;
    gap: 16px;
    margin-right: 0;
    margin-left: 0;
    padding: 2px 0 16px;
    scroll-padding: 0;
  }

  .card-title {
    font-size: 15px;
  }

  .thumbs .card-title {
    font-size: 14px;
  }

  .code-form {
    max-width: 500px;
  }

  .popup {
    width: min(1000px, 100% - 48px);
    height: auto;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    margin: auto;
    border-radius: 22px;
    box-shadow: 0 30px 80px -24px rgb(2 6 23 / 50%);
  }

  .popup-body {
    padding: 24px 24px 32px;
  }

  .tabs {
    flex-wrap: wrap;
    margin-right: 0;
    margin-left: 0;
    padding: 2px 0;
    overflow: visible;
  }

  h1 {
    font-size: 30px;
  }
}

@media (min-width: 900px) {
  /* Photos on the left, the button beside them and staying in view: on a big screen too, no scrolling to buy. */
  .item {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 0 40px;
    align-items: start;
  }

  .item-info {
    position: sticky;
    top: 20px;
    /* A column of its own for the whole item: the words under the photos stay left of it, so nothing slides under
       it while it holds its place (the owner's screenshots, 2026-11-08: the review ran under the button). */
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .item-info h1 {
    margin-top: 0;
  }

  /* In the popup the name keeps clear of the cross in the corner. */
  .popup .item-info h1 {
    padding-right: 48px;
  }

  .item-more {
    grid-column: 1;
    grid-row: 2;
  }

  .gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .gallery img,
  .gallery .photo-missing {
    width: 100%;
    cursor: zoom-in;
  }

  .gallery img:first-child {
    grid-column: 1 / -1;
  }

  .buy-button {
    padding: 17px;
  }
}

/* ---- Motion: CSS only, transform and opacity, finite; stopped for a visitor who asks for less (§2.3) ---- */

@keyframes live {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 4px var(--tint);
  }
  50% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes sheen {
  to {
    transform: translateX(130%);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes edge {
  entry 0% {
    opacity: 0.55;
    transform: scale(0.92);
  }
  entry 100% {
    opacity: 1;
    transform: none;
  }
  exit 0% {
    opacity: 1;
    transform: none;
  }
  exit 100% {
    opacity: 0.55;
    transform: scale(0.92);
  }
}

@keyframes progress {
  from {
    transform: scaleX(0);
  }
}

@keyframes popup-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes dim-in {
  from {
    opacity: 0;
  }
}

/* Every tap target answers the finger. */
.card-buy:active,
.buy-button:active,
.code-form button:active,
.paging a:active,
.tabs a:active,
.share:active,
.popup-close:active {
  transform: scale(0.97);
}

@media (prefers-reduced-motion: no-preference) {
  /* The dot beats three times when the page opens, then rests: under five seconds (WCAG 2.2.2). */
  .featured h2::before,
  .carousel h2::before {
    animation: live 1.4s var(--ease) 0.4s 3;
  }

  /* An item comes up over the page, once, in a quarter of a second; the page dims behind it. */
  .popup[open] {
    animation: popup-in 0.26s var(--ease);
  }

  .popup[open]::backdrop {
    animation: dim-in 0.2s ease-out;
  }

  /* From one page to the next, a cross-fade instead of a blink, the header and the tabs holding still. */
  @view-transition {
    navigation: auto;
  }

  @supports (animation-timeline: view()) {
    /* A section's cards rise into place as they scroll in; the first section's never move, so the largest photo
       is not held back (§2.5). Not the full list's: sixty timelines cost the first paint more than they give. */
    .grid > .card {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }

    main > section:first-of-type .card {
      animation: none;
    }

    /* In a carousel, the cards at its edges are a little smaller and paler, and grow as they slide in. */
    .strip > .card {
      animation: edge linear both;
      animation-timeline: view(inline);
    }
  }

  /* A line under a carousel shows how far along it the thumb is. */
  @supports (timeline-scope: --strip) {
    .carousel {
      timeline-scope: --strip;
    }

    .strip {
      scroll-timeline: --strip inline;
    }

    .carousel::after {
      content: "";
      position: absolute;
      right: 0;
      bottom: 4px;
      left: 0;
      height: 2px;
      background: var(--accent);
      border-radius: 2px;
      transform-origin: left;
      animation: progress linear both;
      animation-timeline: --strip;
    }
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .grid > .card:hover,
  .strip > .card:hover {
    transform: translateY(-3px);
  }

  .grid > .card:hover::after,
  .strip > .card:hover::after {
    opacity: 1;
  }

  .thumbs .card a:hover img {
    transform: translateY(-3px);
  }

  .card-buy:hover::after,
  .buy-button:hover::after,
  .code-form button:hover::after {
    transform: translateX(4px);
  }

  .card-buy:hover::before,
  .buy-button:hover::before {
    animation: sheen 0.8s var(--ease) both;
  }
}

@media (hover: hover) {
  .card-buy:hover,
  .buy-button:hover,
  .code-form button:hover {
    filter: brightness(1.06);
  }

  .tabs a:hover,
  .subcategories a:hover {
    border-color: var(--tint-line);
    background: var(--tint);
  }

  .popup-close:hover {
    background: var(--soft);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
