:root {
  --bg: #ffffff;
  --surface: #f4f4f4;
  --chip: #f1f1f1;
  --chip-hover: #e7e7e7;
  --text: #111111;
  --muted: #8b8b8b;
  --soft: #555555;
  --line: #ebebeb;
  --danger: #d0312d;
  --radius: 10px;
  /* Layered shadow under whatever is stuck to the top once the page scrolls. */
  --bar-shadow: 0 1px 0 rgb(0 0 0 / 0.04), 0 2px 4px rgb(0 0 0 / 0.04), 0 6px 12px rgb(0 0 0 / 0.04), 0 12px 24px rgb(0 0 0 / 0.04);
  --side: 248px;
  /* Motion: strong ease-out for things entering or responding to a press. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

h1,
h2 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

h1 {
  font-size: 22px;
}

.muted {
  color: var(--muted);
}

/* ---------- shell ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--side) 1fr;
  min-height: 100dvh;
}

.side {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 20px 20px 20px 32px;
}

.side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 40px;
}

.logo {
  display: inline-flex;
  color: var(--text);
}

.mark {
  display: block;
  flex: none;
}

.me-link {
  display: inline-flex;
  border-radius: 50%;
}

/* The avatar opens the account menu (Profile, Sign out). */
.side-account summary {
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.side-account summary::-webkit-details-marker {
  display: none;
}

.side-account summary:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.side-label {
  margin: 0 0 6px;
  color: var(--muted);
}

.side-nav {
  display: grid;
  gap: 2px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  color: var(--muted);
  text-decoration: none;
}

.side-nav a:hover {
  color: var(--text);
}

.side-nav a {
  white-space: nowrap;
}

.side-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 500;
}

.side-foot {
  margin-top: auto;
  display: grid;
  gap: 16px;
  justify-items: start;
}

.side-blurb {
  margin: 0;
  max-width: 200px;
  font-weight: 500;
  line-height: 1.45;
}


.auth-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.side-small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

main {
  min-width: 0;
  padding: 0 32px 64px 8px;
}

/* ---------- pills & chips ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--chip);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, opacity 150ms ease, transform 160ms var(--ease-out);
}

.pill:active:not(:disabled) {
  transform: scale(0.97);
}

.pill:hover {
  background: var(--chip-hover);
}

.pill-ink {
  background: var(--text);
  color: var(--bg);
}

.pill-ink:hover {
  background: var(--text);
  opacity: 0.85;
}

.pill-outline {
  background: transparent;
  border-color: var(--line);
}

.pill-outline:hover {
  background: var(--chip);
}

.pill-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--line);
}

.pill-block {
  width: 100%;
  height: 44px;
  font-size: 15px;
}

.pill:disabled {
  opacity: 0.55;
  cursor: progress;
}

.icon {
  display: block;
  flex: none;
}

.icon-strong * {
  stroke-width: 2;
}

.icon-filled path {
  fill: currentColor;
}

.link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  /* Full width of the content area, so the shadow runs edge to edge; the chips still line up. */
  margin: 0 -32px 0 -8px;
  padding: 20px 32px 16px 8px;
  background: var(--bg);
  transition: box-shadow 0.2s;
}

html[data-scrolled] .toolbar {
  box-shadow: var(--bar-shadow);
  /* Shadow falls below only, not out of the ends of the bar. */
  clip-path: inset(0 0 -48px 0);
}

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--soft);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out);
}

.chip:active {
  transform: scale(0.97);
}

.chip:hover {
  background: var(--chip-hover);
  color: var(--text);
}

.chip[aria-current="true"],
.chip:has(input:checked) {
  background: var(--text);
  color: var(--bg);
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ---------- masonry grid ---------- */

.grid {
  --gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 4 240px;
  column-gap: var(--gap);
}

/* Padding, not margin: WebKit carries margins over into the next column. */
.grid li {
  break-inside: avoid;
  padding-bottom: var(--gap);
}

/* grid.js deals tiles into columns in stream order. */
.grid.is-masonry {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
  columns: auto;
}

.grid-col {
  flex: 1 1 0;
  min-width: 0;
}

.tile {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.06);
  pointer-events: none;
}

.tile > img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 120px;
}

.tile .avatar {
  position: absolute;
  left: 12px;
  bottom: 12px;
}

.badge {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgb(20 20 20 / 0.6);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: hsl(var(--h) 38% 46%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 0.9);
  overflow: hidden;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.avatar-md {
  width: 36px;
  height: 36px;
  font-size: 14px;
  box-shadow: none;
}

.avatar-lg {
  width: 72px;
  height: 72px;
  font-size: 28px;
  box-shadow: none;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 0 28px;
}

.profile-info {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.profile-info strong {
  font-size: 16px;
  font-weight: 600;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-actions form {
  display: contents;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.profile .pill:focus-within {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.empty {
  padding: 64px 0;
  color: var(--muted);
}

.page-head {
  display: grid;
  gap: 4px;
  padding: 4px 0 20px;
}

.page-head p {
  margin: 0;
}

.page-head h2 {
  font-size: 16px;
}

main > .page-head:first-child {
  padding-top: 24px;
}

.intro {
  display: none;
}

/* ---------- forms ---------- */

.form {
  display: grid;
  gap: 18px;
}

.form label {
  display: grid;
  gap: 6px;
  font-weight: 500;
}

.form small {
  font-weight: 400;
  color: var(--muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input:not([type]) {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* stops iOS zooming on focus */
}

input:focus-visible,
.pill:focus-visible,
.chip:focus-visible,
.chip:focus-within,
.tile:focus-visible,
.drop:focus-within {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

input::placeholder {
  color: var(--muted);
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

legend {
  font-weight: 500;
  padding: 0;
  margin-bottom: 8px;
}

.form .chips {
  flex-wrap: wrap;
}

.form label.chip {
  display: inline-flex;
  font-weight: 400;
}

.form .check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--text);
}

.error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
  font-weight: 500;
}

.error[hidden] {
  display: none;
}

/* ---------- auth ---------- */

.auth {
  display: grid;
  place-items: center;
  min-height: 80dvh;
  padding: 32px 0;
}

/* Log in and sign up: no sidebar column, so the form centres on the whole screen. The logo stays top left. */
.shell-auth {
  grid-template-columns: 1fr;
}

.shell-auth .side {
  position: absolute;
  top: 0;
  left: 0;
  height: auto;
}

.shell-auth main {
  padding: 0 32px;
}

.shell-auth .auth {
  min-height: 100dvh;
  padding: 0;
}

.auth .form {
  width: 100%;
  max-width: 360px;
}

.auth-head {
  display: grid;
  gap: 6px;
  margin-bottom: 6px;
}

.auth-head p {
  margin: 0;
}

.swap {
  margin: 0;
  text-align: center;
}

/* ---------- capture ---------- */

.capture {
  max-width: 520px;
}

.drop {
  position: relative;
  display: grid !important;
  place-items: center;
  min-height: 300px;
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
}

.drop:has(img:not([hidden])) {
  min-height: 0;
}

.drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  display: block;
  transition: opacity 200ms var(--ease-out);
}

@starting-style {
  .drop img {
    opacity: 0;
  }
}

.drop img[hidden],
.drop-hint[hidden] {
  display: none;
}

.drop-hint {
  display: grid;
  gap: 2px;
  justify-items: center;
  text-align: center;
  font-weight: 400;
  color: var(--muted);
}

.drop-icon {
  margin-bottom: 10px;
  color: var(--text);
}

.drop-hint strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

/* ---------- single photo ---------- */

.breadcrumb {
  padding: 20px 0 14px;
  font-size: 14px;
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  flex: none;
  min-width: 0;
  white-space: nowrap;
}

.crumb-sep {
  margin: 0 6px;
  color: var(--muted);
}

/* A long caption gives way first. */
.breadcrumb li:last-child {
  flex: 1 1 auto;
}

.breadcrumb li:last-child > * {
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb a,
.breadcrumb .crumb-text {
  color: var(--muted);
  text-decoration: none;
}

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

.breadcrumb [aria-current] {
  color: var(--text);
  font-weight: 500;
}

.photo {
  display: grid;
  gap: 24px;
}

.photo figure {
  margin: 0;
  padding: 24px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.photo figure img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(84dvh - 48px);
  margin: 0 auto;
  border-radius: 8px;
}

.photo-info {
  display: grid;
  gap: 16px;
  align-content: start;
}

.byline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.byline-text {
  display: grid;
  line-height: 1.3;
}

.byline-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.byline strong {
  font-weight: 600;
}

.caption {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.menu {
  position: relative;
}

.menu-button.is-saved {
  color: var(--text);
}

.menu-label {
  margin: 4px 12px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

a.menu-item {
  text-decoration: none;
}

.menu-item.menu-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.menu-check span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-check svg {
  flex: none;
}

.page-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.page-head-row > div {
  display: grid;
  gap: 4px;
}

.collection-form {
  max-width: 420px;
}

/* ---------- bookmarks: collections as fanned photo stacks ---------- */

.stacks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 32px 20px;
  margin: 0;
  padding: 28px 0 0;
  list-style: none;
}

.stacks-hint {
  max-width: 280px;
  margin: 20px auto 0;
  text-align: center;
}

/* No collections yet: just the New collection circle and a hint, centred on the page. */
.stacks-empty {
  display: grid;
  place-content: center;
  justify-items: center;
  min-height: 60dvh;
}

.stacks-empty .stacks {
  grid-template-columns: 160px;
  padding: 0;
}

.stack {
  display: grid;
  justify-items: center;
  gap: 2px;
  color: var(--text);
  text-align: center;
  text-decoration: none;
}

.stack-cards {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 10px;
}

.stack-card {
  position: absolute;
  inset: 10%;
  width: 80%;
  height: 80%;
  object-fit: cover;
  border: 4px solid #fff;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 6px 16px rgb(0 0 0 / 0.1);
  transition: transform 200ms var(--ease-out), opacity 300ms var(--ease-out);
}

.stack-card-0 {
  z-index: 3;
  transform: rotate(-3deg);
}

.stack-card-1 {
  z-index: 2;
  transform: translate(8%, -3%) rotate(6deg);
}

.stack-card-2 {
  z-index: 1;
  transform: translate(-8%, -2%) rotate(-10deg);
}

@media (hover: hover) and (pointer: fine) {
  .stack:hover .stack-card-1 {
    transform: translate(12%, -5%) rotate(9deg);
  }

  .stack:hover .stack-card-2 {
    transform: translate(-12%, -4%) rotate(-14deg);
  }
}

.stack-empty {
  border-style: dashed;
  border-color: var(--line);
  box-shadow: none;
}

.stack-plus {
  position: absolute;
  inset: 14%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  color: var(--soft);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.08);
}

.stack-new:hover .stack-plus {
  color: var(--text);
}

.stack-name {
  max-width: 100%;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack-new .stack-name {
  font-weight: 500;
}

.stack-meta {
  font-size: 13px;
}

.menu-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--soft);
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.menu-button::-webkit-details-marker {
  display: none;
}

.menu-button:hover,
.menu[open] .menu-button {
  background: var(--chip);
  color: var(--text);
}

.menu-button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 15;
  min-width: 200px;
  padding: 6px;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgb(0 0 0 / 0.12);
  /* Grows out of its button (menus hang off the right edge of their trigger). */
  transform-origin: top right;
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}

@starting-style {
  .menu[open] .menu-list {
    opacity: 0;
    transform: scale(0.96);
  }
}

.menu-list form {
  margin: 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover,
.menu-item:focus-visible {
  background: var(--chip);
  outline: none;
}

.menu-item-danger {
  color: var(--danger);
}

@media (min-width: 1000px) {
  .photo {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
  }

  .photo-info {
    position: sticky;
    top: 20px;
  }
}

/* ---------- FAB (phones only) ---------- */

.fab {
  display: none;
}

/* ---------- phones & small tablets ---------- */

@media (max-width: 860px) {
  .shell {
    display: block;
  }

  .side {
    position: sticky;
    top: 0;
    z-index: 10;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    padding: max(12px, env(safe-area-inset-top)) 16px 12px;
    background: var(--bg);
    transition: box-shadow 0.2s;
  }

  /* Once scrolled, a layered shadow marks the bottom of whatever is stuck to the top:
     the filter chips where a page has them, otherwise the bar itself. */
  html[data-scrolled] .side {
    box-shadow: var(--bar-shadow);
  }

  html[data-scrolled]:has(.toolbar) .side {
    box-shadow: none;
  }

  /* Flatten the sidebar into one bar: logo · nav · account. */
  .side-top {
    display: contents;
  }

  .logo {
    order: 0;
  }

  .side-nav {
    order: 1;
    display: flex;
    align-items: center;
    gap: 16px;
  }

  /* On phones the floating + button adds a photo, so the top bar keeps to Home, Mine and Bookmarks. */
  .side-nav .nav-add {
    display: none;
  }

  .side-account {
    order: 2;
    margin-left: auto;
  }

  .side-label,
  .side-foot,
  .nav-icon {
    display: none;
  }

  main {
    padding: 0 16px 112px;
  }

  .shell-auth main {
    padding: 0 16px;
  }

  .toolbar {
    /* Header height: its top padding + 30px content + 12px bottom padding, less 1px so no seam shows. */
    top: calc(max(12px, env(safe-area-inset-top)) + 41px);
    /* Full-bleed so its shadow spans the screen; chips still line up with the content. */
    margin: 0 -16px;
    padding: 8px 16px 12px;
    transition: box-shadow 0.2s;
  }

  .grid {
    --gap: 12px;
    columns: 1;
  }

  .stacks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 12px;
  }

  .stack-meta {
    font-size: 12px;
  }

  .intro {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--surface);
  }

  .intro p {
    margin: 0;
    font-weight: 500;
  }

  .fab {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 20;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--text);
    color: var(--bg);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.2);
    transition: transform 160ms var(--ease-out);
    -webkit-tap-highlight-color: transparent;
  }

  .fab:active {
    transform: scale(0.95);
  }
}

.image-details { margin-top: 16px; }
.image-details h2 { font-size: 15px; }
.image-details-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.image-details-head span { font-size: 12px; }
.image-details-head [hidden] { display: none; }
.image-details p { font-size: 12px; margin: 8px 0; }
.image-details dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; margin: 16px 0 0; font-size: 13px; }
.image-details dt { color: var(--soft); }
.image-details dd { margin: 0; overflow-wrap: anywhere; }
.palette { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.colour-swatch { border: 0; padding: 0; background: transparent; color: var(--text); font: inherit; font-size: 11px; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.colour-swatch { transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); transition-delay: calc(var(--i, 0) * 40ms); }
/* Swatches arrive once the colours are worked out: a short staggered rise instead of popping in. */
@starting-style { .colour-swatch { opacity: 0; transform: translateY(4px); } }
.colour-swatch span:first-child { transition: transform 160ms var(--ease-out); }
.colour-swatch:active span:first-child { transform: scale(0.97); }
/* Toasts are dark pills sized to their text, centred (colours are set in client/toast.tsx). */
html [data-sonner-toaster] [data-sonner-toast] {
  width: fit-content;
  max-width: 100%;
  left: 0;
  right: 0;
  margin-inline: auto;
}

.toast-swatch { display: block; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.25); }
.colour-swatch span:first-child { display: block; height: 46px; border-radius: 6px; margin-bottom: 5px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.08); }
.colour-swatch:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

/* ---------- image loading ---------- */

/* Photos fade in over their grey placeholder once loaded (the .js class and .is-loaded come from the
   page script), instead of painting in top to bottom. Without JS they show as normal. */
.js img.fade {
  transition: opacity 300ms var(--ease-out);
}

.js img.fade:not(.is-loaded) {
  opacity: 0;
}

/* ---------- reduced motion: keep the fades, drop the movement ---------- */

@media (prefers-reduced-motion: reduce) {
  .pill:active:not(:disabled),
  .chip:active,
  .fab:active,
  .colour-swatch:active span:first-child {
    transform: none;
  }

  .menu-list {
    transition: opacity 150ms var(--ease-out);
  }

  @starting-style {
    .menu[open] .menu-list {
      transform: none;
    }
    .colour-swatch {
      transform: none;
    }
  }
}
