/* Yigo. Theme tokens use light-dark(): the page follows the OS theme unless
   <html data-theme="light|dark"> pins it (set by theme.js / the toggle).

   The look: a mosaic of tiles. The mark is a small mosaic, controls are softly rounded
   tiles rather than pills, and the home page's gallery is laid like one.

   Accessibility (WCAG 2.2 AAA): every text color has at least 7:1 contrast on
   every background it is used on, borders that show a control's edge 3:1,
   focus rings are 3px, and every control is at least 44 x 44 CSS px. */

:root {
  color-scheme: light dark;

  --bg:            light-dark(#ffffff, #0e0f11);
  --bg-raised:     light-dark(#ffffff, #1b1d20);
  --surface:       light-dark(#f3f4f6, #17191c);
  --surface-2:     light-dark(#e8eaed, #24272b);
  --border:        light-dark(#e3e5e8, #26292d);
  --border-strong: light-dark(#858b94, #686e76); /* >= 3:1 on --bg and --surface: control edges */
  --text:          light-dark(#15171a, #e8eaed);
  --text-muted:    light-dark(#474c53, #b3b9c1); /* >= 7:1 on --bg, --surface and --surface-2 */
  --text-faint:    light-dark(#4b5057, #adb3bb); /* >= 7:1 on --bg and --surface */
  --accent:        light-dark(#2856e0, #8eaaff); /* focus rings and markers: >= 3:1 */
  --link:          light-dark(#1a3fb0, #a4bcff); /* >= 7:1 */
  --link-visited:  light-dark(#4a2fa3, #c4adff);
  --scrim:         rgb(15 16 18 / 0.8); /* behind white text over photos: >= 7:1 even on a white image */
  /* Status colors (status page, admin): fixed, and always shown with an icon and words. */
  --status-good:     #0ca30c;
  --status-warning:  #fab219;
  --status-critical: #d03b3b;
  --status-neutral:  light-dark(#5b6068, #9aa0a8);
  --status-none:     light-dark(#d5d8dc, #33373c);
  /* Status page days. Validated for color-blind separation in each theme (all pairs);
     downtime bars are also shorter, so they never rely on color alone. */
  --day-working:     light-dark(#0ca30c, #2fae3a);
  --day-mixed:       light-dark(#fab219, #ffd166);
  --day-maintenance: light-dark(#5b6068, #7d838b);
  --day-down:        light-dark(#a1161b, #b71c1c);
  --shadow:        light-dark(rgb(21 23 26 / 0.07), rgb(0 0 0 / 0.45));
  --shadow-strong: light-dark(rgb(21 23 26 / 0.16), rgb(0 0 0 / 0.7));
  --hairline:      light-dark(rgb(0 0 0 / 0.06), rgb(255 255 255 / 0.06));

  /* The mosaic mark: three blues and one warm tile. */
  --logo-main:  light-dark(#2856e0, #7898fb);
  --logo-light: light-dark(#6b90ff, #b3c6ff);
  --logo-deep:  light-dark(#173596, #4564cf);
  --logo-warm:  light-dark(#e8912a, #ffc164);

  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 12px;
  --tile: 10px; /* buttons, chips and other controls: tiles, not pills */
  --gutter: 24px;
  --content: 1280px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Keeps whatever has keyboard focus clear of the sticky header. */
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* On photos, a white ring with a dark edge shows up on any image. */
.on-image:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 2px #000; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
}
.skip-link:focus { top: 12px; }

/* ---------- Brand ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.12em;
  margin: 0;
  color: var(--text);
  font-weight: 640;
  letter-spacing: -0.05em;
  line-height: 1;
}

.brand__mark { width: 0.82em; height: 0.82em; flex: none; overflow: visible; }
.brand__word { transform: translateY(-0.06em); }
.brand { gap: 0.16em; }

.brand__tile--main  { fill: var(--logo-main); }
.brand__tile--light { fill: var(--logo-light); }
.brand__tile--deep  { fill: var(--logo-deep); }
.brand__tile--warm  { fill: var(--logo-warm); }

.brand--hero  { font-size: clamp(60px, 13vw, 88px); }
.brand--small { min-height: 44px; font-size: 27px; border-radius: 8px; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
}

.topbar__inner {
  max-width: var(--content);
  min-height: 72px;
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  gap: 32px;
}

.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }

[data-view="home"] .topbar .brand,
[data-view="home"] .topbar .search { display: none; }

[data-view="results"] .topbar,
[data-view="page"] .topbar { border-bottom: 1px solid var(--border); }

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--tile);
  background: transparent;
  color: var(--text-muted);
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.icon-button:hover { background: var(--surface-2); color: var(--text); }

#theme-toggle .icon--sun { display: none; }
#theme-toggle[data-current="dark"] .icon--sun { display: block; }
#theme-toggle[data-current="dark"] .icon--moon { display: none; }

/* ---------- Search box ---------- */

.search {
  position: relative;
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 4px 0 3px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--bg-raised);
  transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.search:hover,
.search:focus-within {
  border-color: transparent;
  box-shadow: 0 1px 6px var(--shadow-strong), 0 0 0 1px var(--hairline);
}
/* The box is the focus target people look for, so it carries the ring (the input's own outline is off). */
.search:has(.search__input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

.search__submit,
.search__clear {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--tile);
  background: transparent;
  color: var(--text-muted);
}
.search__submit:hover,
.search__clear:hover { color: var(--text); background: var(--surface); }

.search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 6px 0 2px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}
.search__input::placeholder { color: var(--text-muted); opacity: 1; }
.search__input::-webkit-search-cancel-button,
.search__input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.search__clear { display: none; }
.search.has-value .search__clear { display: grid; }

.search__hint {
  margin-right: 10px;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-faint);
  font: 500 12px/18px var(--mono);
}
.search.has-value .search__hint,
.search:focus-within .search__hint { display: none; }

.search--hero { width: min(100%, 624px); }
.search--compact { flex: 1; max-width: 680px; height: 50px; }

/* Autocomplete list, under either search box. Icons line up with the box's magnifier. */
.suggest {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 40;
  margin: 0;
  padding: 6px 0;
  overflow: hidden;
  border-radius: 18px;
  background: var(--bg-raised);
  box-shadow: 0 6px 22px var(--shadow-strong), 0 0 0 1px var(--hairline);
  list-style: none;
  text-align: left;
}
.suggest__option {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  padding: 9px 20px 9px 16px;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
}
.suggest__option .icon { width: 17px; height: 17px; color: var(--text-faint); }
.suggest__option strong { font-weight: 620; }
.suggest__option:hover,
.suggest__option[aria-selected="true"] { background: var(--surface); }
/* The highlighted suggestion also gets a bar, which (unlike the tint) meets 3:1. */
.suggest__option[aria-selected="true"] { box-shadow: inset 4px 0 0 var(--accent); }
.search.has-suggestions { box-shadow: 0 1px 6px var(--shadow-strong), 0 0 0 1px var(--hairline); border-color: transparent; }

.noscript {
  margin: 0;
  padding: 12px var(--gutter);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  text-align: center;
}

/* ---------- Home ---------- */

main { flex: 1; display: flex; flex-direction: column; }

.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(24px, 13vh, 150px) 16px 72px;
  text-align: center;
}
[data-view="results"] .home { display: none; }

.home__tagline {
  margin: 18px 0 34px;
  color: var(--text-muted);
  font-size: 16px;
  letter-spacing: -0.005em;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 8px;
  max-width: 640px;
  margin-top: 26px;
}
.suggestions__label { margin-right: 2px; color: var(--text-faint); font-size: 13px; }

.chip {
  min-height: 44px;
  padding: 6px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--tile);
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.35;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.chip:hover { background: var(--surface); border-color: var(--border-strong); color: var(--text); }

.home__stats {
  margin: 30px 0 0;
  color: var(--text-faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Results ---------- */

.results {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 var(--gutter) 72px;
}
[data-view="home"] .results { display: none; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.tabs {
  display: flex;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  flex: none; /* keep each tab its full width; the row scrolls instead */
  min-width: 44px;
  min-height: 48px;
  padding: 13px 12px 14px;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-pressed="true"] { color: var(--text); font-weight: 560; }
.tab[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
}
.tab:focus-visible { outline-offset: -4px; border-radius: 8px; }
.tab__logo { width: 16px; height: 16px; margin-right: 7px; border-radius: 4px; vertical-align: -3px; }
.tab__count {
  margin-left: 6px;
  color: var(--text-faint);
  font-size: 12.5px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.view-toggle {
  display: flex;
  flex: none;
  gap: 2px;
  margin: 2px 0;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
}
.view-toggle button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
}
.view-toggle .icon { width: 19px; height: 19px; }
.view-toggle button:hover { background: var(--surface); color: var(--text); }
/* Solid fill for the chosen layout, so the state is plain without relying on a subtle tint. */
.view-toggle button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* Filters: price and sort, under the site tabs. */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 14px; }
.filter { display: inline-flex; align-items: center; gap: 10px; }
.filter__label { color: var(--text-muted); font-size: 14px; }
.filter__control { position: relative; display: inline-flex; }
.filter__control::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 15px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.filter__select {
  min-height: 44px;
  padding: 0 38px 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--tile);
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.filter__select:hover { background: var(--surface); }
.filters__note { flex-basis: 100%; margin: 0; color: var(--text-muted); font-size: 13.5px; }
.filters__note:empty { display: none; }

.card__price {
  flex: none;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 18px;
}
.card__date { flex: none; color: var(--text-muted); font-size: 12.5px; white-space: nowrap; }

.spelling:empty { display: none; }
.spelling { margin: 16px 0 -4px; font-size: 15px; }
.spelling p { margin: 0; }
.spelling a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.spelling a:hover { text-decoration-thickness: 2px; }
.spelling__main strong { font-weight: 600; font-style: italic; }
.spelling__alt { color: var(--text-muted); font-size: 14px; }
.spelling__alt a { display: inline-flex; align-items: center; min-height: 44px; }

.elsewhere:empty { display: none; }
.elsewhere {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
}
.elsewhere p { margin: 0; }
.elsewhere a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.elsewhere a:hover { text-decoration-thickness: 2px; }

.stats {
  min-height: 20px;
  margin: 14px 0 20px;
  color: var(--text-faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

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

/* ---------- Result card ---------- */

/* The title is a button whose hit area (::after) covers the whole card, so a
   click anywhere opens the Preview; the actions sit above that layer. */
.card { position: relative; display: flex; flex-direction: column; gap: 11px; border-radius: var(--radius); }
.card:has(.card__main:focus-visible) { outline: 3px solid var(--accent); outline-offset: 4px; }

.card__media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  isolation: isolate;
}
.card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 2;
  box-shadow: inset 0 0 0 1px var(--hairline);
  pointer-events: none;
}
/* The image sits above the placeholder cube, which shows only when there is no image. */
.card__media img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.card:hover .card__media img { transform: scale(1.035); }

.card__placeholder { width: 34px; height: 34px; stroke-width: 1.25; color: var(--text-faint); opacity: 0.7; }

/* A hint that the card opens a larger view (decorative: the button says so). */
.card__hint {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--scrim);
  color: #fff;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.card__hint .icon { width: 16px; height: 16px; stroke-width: 2; }
.card:hover .card__hint,
.card:has(.card__main:focus-visible) .card__hint { opacity: 1; transform: none; }

.card__body { min-width: 0; container: card-body / inline-size; }

.card__source {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12.5px;
}
.card__avatar {
  --hue: 220;
  width: 18px;
  height: 18px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: light-dark(hsl(var(--hue) 70% 93%), hsl(var(--hue) 28% 22%));
  color: light-dark(hsl(var(--hue) 55% 32%), hsl(var(--hue) 70% 80%));
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.card__avatar.has-logo { background: none; border-radius: 4px; overflow: hidden; }
.card__avatar.has-logo img { width: 100%; height: 100%; object-fit: contain; }
.card__source-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card__path { display: none; }

.card__title { margin: 5px 0 0; font-size: 15px; font-weight: 500; line-height: 1.35; letter-spacing: -0.005em; }
.card__main {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
}
.card__main:focus-visible { outline: none; } /* the whole card shows the ring */
.card__main::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: var(--radius); }
.card__title-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.card:hover .card__title-text { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 22px;
  margin: 8px 0 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
}
.card__tags:empty { display: none; }
.card__tags li {
  padding: 0 8px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 22px;
  white-space: nowrap;
}

/* "Open in Thingiverse" and "Copy link": above the card's own click layer. */
.card__actions { position: relative; z-index: 4; display: flex; gap: 8px; margin-top: 12px; }
.card__open,
.card__copy {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--tile);
  background: var(--bg-raised);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 560;
  white-space: nowrap;
  transition: background-color 0.15s var(--ease);
}
.card__open { flex: 1; min-width: 0; }
.card__open .icon, .card__copy .icon { width: 16px; height: 16px; stroke-width: 2; }
.card__open:hover, .card__copy:hover { background: var(--surface); }
.card__copy { flex: none; padding: 0; width: 44px; }
.card__copy .icon--check { display: none; }
.card__copy.is-copied .icon--link { display: none; }
.card__copy.is-copied .icon--check { display: block; color: var(--status-good); }
/* Icon-only here, so "Copied" also shows as a small label above the button. */
.card__copy-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card__copy.is-copied::after {
  content: "Copied";
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  white-space: nowrap;
}
/* Narrow cards: "Open" (the button's full name, for screen readers, stays "Open in …"). */
@container card-body (width < 236px) {
  .card__open-site { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* Wide cards (list layout): "Copy link" written out. */
@container card-body (width >= 380px) {
  .card__open { flex: none; }
  .card__copy { width: auto; padding: 0 14px; }
  .card__copy-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .card__copy.is-copied::after { content: none; }
}

/* List layout: a web-results column. */

[data-layout="list"] .results .result-list {
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  max-width: 800px;
}
[data-layout="list"] .results .card {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}
[data-layout="list"] .results .card__hint { display: none; }
[data-layout="list"] .results .card__path {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-layout="list"] .results .card__title { margin-top: 6px; font-size: 19px; font-weight: 450; line-height: 1.3; }
[data-layout="list"] .results .card__main { color: var(--link); }
[data-layout="list"] .results .card__tags { max-height: 50px; }

/* ---------- Loading, empty and error states ---------- */

.skeleton { pointer-events: none; }
.skeleton .card__media,
.skeleton .mini__media,
.skeleton__line {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.skeleton__line { height: 11px; margin-top: 10px; border-radius: 6px; }
.skeleton__line:first-child { width: 40%; margin-top: 2px; }
.skeleton__line:nth-child(2) { width: 88%; height: 13px; }
.skeleton__line:nth-child(3) { width: 62%; height: 13px; margin-top: 7px; }

@keyframes shimmer {
  from { background-position: 100% 0; }
  to   { background-position: -100% 0; }
}

.notice { max-width: 560px; padding: 36px 0 12px; }
.notice__title { margin: 0 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.notice__text { margin: 0 0 20px; color: var(--text-muted); }
.notice .suggestions { justify-content: flex-start; margin-top: 0; }
.notice__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.notice__link { display: inline-flex; align-items: center; min-height: 44px; color: var(--link); text-decoration: underline; text-underline-offset: 3px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--tile);
  background: var(--bg-raised);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.15s var(--ease);
}
.button:hover { background: var(--surface); }

/* ---------- Preview dialog ---------- */

.preview {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--bg-raised);
  color: var(--text);
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.45);
  overflow: hidden auto;
  overscroll-behavior: contain;
}
.preview::backdrop { background: rgb(8 9 11 / 0.64); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.preview[open] { animation: preview-in 0.24s var(--ease); }
@keyframes preview-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
html:has(.preview[open]) { overflow: hidden; }

.preview__hero {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  min-height: 320px;
  overflow: hidden;
  background: #0e0f11;
  isolation: isolate;
}
.preview__backdrop {
  position: absolute;
  inset: -48px;
  z-index: -1;
  background: var(--image, none) center / cover no-repeat;
  filter: blur(30px) saturate(1.2) brightness(0.62);
}
.preview__image { width: 100%; height: 100%; object-fit: contain; }
.preview__hero:not(.has-image) .preview__image { display: none; }
.preview__placeholder { position: absolute; width: 56px; height: 56px; stroke-width: 1.2; color: rgb(255 255 255 / 0.3); }
.preview__hero.has-image .preview__placeholder { display: none; }
/* The title block sits on its own scrim: solid enough under the text for 7:1 on any
   photo, fading out only above it. */
.preview__heading {
  background: linear-gradient(to top, rgb(8 9 11 / 0.92) 0%, rgb(8 9 11 / 0.84) calc(100% - 30px), rgb(8 9 11 / 0) 100%);
}

.preview__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--tile);
  background: var(--scrim);
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.preview__close:hover { background: rgb(15 16 18 / 0.94); }

.preview__heading { position: absolute; right: 0; bottom: 0; left: 0; z-index: 2; padding: 40px 32px 26px; color: #fff; }
.preview__source { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: #fff; font-size: 13.5px; }
.preview__source .card__avatar { width: 20px; height: 20px; }
.preview__title {
  display: -webkit-box;
  max-width: 24em;
  margin: 0 0 18px;
  overflow: hidden;
  font-size: clamp(22px, 3.2vw, 34px);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-shadow: 0 1px 14px rgb(0 0 0 / 0.45);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}
.preview__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.preview__actions .button { min-height: 44px; }
.preview__actions .icon { width: 17px; height: 17px; }
.button--primary { border-color: transparent; background: #fff; color: #111; font-weight: 600; }
.button--primary:hover { background: #e6e8eb; }
.button--ghost {
  border-color: rgb(255 255 255 / 0.7);
  background: rgb(255 255 255 / 0.08);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.button--ghost:hover { background: rgb(255 255 255 / 0.16); }

.preview__body { padding: 22px 32px 30px; }
.preview__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.preview__tags:empty { display: none; }
.preview__tag {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--tile);
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.preview__tag:hover { background: var(--surface-2); color: var(--text); }
.preview__note { margin: 14px 0 0; color: var(--text-faint); font-size: 13.5px; }
.preview__more { margin-top: 26px; }
.preview__more-title { margin: 0 0 14px; font-size: 16px; font-weight: 620; letter-spacing: -0.01em; }
.preview__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; margin: 0; padding: 0; list-style: none; }

.mini__button {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: inherit;
  text-align: left;
}
.mini__media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface);
}
.mini__media img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s var(--ease); }
.mini__button:hover .mini__media img { transform: scale(1.04); }
.mini__media .card__placeholder { width: 28px; height: 28px; }
.mini__title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.mini__button:hover .mini__title { text-decoration: underline; text-underline-offset: 2px; }
.mini__source { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 12px; }
.mini__source .card__avatar { width: 16px; height: 16px; font-size: 9px; }

@media (max-width: 720px) {
  .preview { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border-radius: 0; }
  .preview__hero { aspect-ratio: 4 / 3; min-height: 0; }
  .preview__heading { padding: 18px 18px 18px; }
  .preview__title { margin-bottom: 14px; font-size: 22px; }
  .preview__body { padding: 18px 18px 28px; }
  .preview__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- About page ---------- */

.page {
  width: 100%;
  max-width: calc(70ch + 2 * var(--gutter)); /* lines of at most ~80 characters */
  margin: 0 auto;
  padding: 48px var(--gutter) 80px;
}
.prose { font-size: 16px; line-height: 1.65; }
.prose h1 { margin: 0 0 16px; font-size: clamp(30px, 5vw, 38px); font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; }
.prose h2 { margin: 44px 0 10px; font-size: 20px; font-weight: 620; letter-spacing: -0.012em; scroll-margin-top: 96px; }
.prose p { margin: 0 0 1.25em; color: var(--text-muted); }
.prose h3 { margin: 32px 0 8px; font-size: 17px; font-weight: 620; letter-spacing: -0.008em; scroll-margin-top: 96px; }
.prose .lede { color: var(--text); font-size: 18px; }
.prose .updated { margin-top: -6px; font-size: 15px; }
/* "On this page" (the FAQ): a list of links, not a sentence, so each is a full 44 px target. */
.prose .toc ul { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 0 0 8px; padding: 0; list-style: none; }
.prose .toc li { margin: 0; }
.prose .toc a { display: inline-flex; align-items: center; min-height: 44px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose ul { margin: 0 0 1.25em; padding-left: 20px; color: var(--text-muted); }
.prose li { margin-bottom: 10px; }
.prose kbd {
  padding: 1px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: 500 14px/1.5 var(--mono);
}
.prose abbr[title] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.prose code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font: 13.5px/1.6 var(--mono);
  overflow-wrap: anywhere;
}
.prose pre {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow-x: auto;
}
.prose pre code { padding: 0; background: none; }

.prose .sources { padding: 0; list-style: none; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.sources li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 16px;
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.sources li:first-child { border-top: 0; }
.sources__name { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 560; }
.sources__name img { width: 22px; height: 22px; border-radius: 5px; }
.sources__how { grid-column: 1; color: var(--text-faint); font-size: 13.5px; }
.sources__count { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--text-muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- Blog (built by scripts/build-blog.mjs) ---------- */

.post-list { margin: 36px 0 0; padding: 0; list-style: none; }
.post-card { margin: 0; padding: 22px 0; border-top: 1px solid var(--border); }
.post-card:last-child { border-bottom: 1px solid var(--border); }
.prose .post-card__title { margin: 0; font-size: 21px; line-height: 1.3; }
.prose .post-card__title a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: none; }
.prose .post-card__title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.prose .post-card__meta,
.prose .post__meta { margin: 0 0 8px; color: var(--text-muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.prose .post-card__text { margin: 0; }
.prose .post__back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 8px; font-size: 15px; }
.prose .post__meta { margin-bottom: 28px; }
.prose .feed-link { display: inline-flex; align-items: center; min-height: 44px; }

/* The call to try Yigo at the end of each article, and the other articles. */
.post__try { margin: 48px 0 0; padding: 22px 24px; border: 1px solid var(--border-strong); border-radius: 12px; }
.prose .post__try h2 { margin: 0 0 6px; font-size: 18px; }
.prose .post__try p { margin: 0 0 16px; }
.prose .post__try .button { color: var(--text); text-decoration: none; }
.post__more { margin-top: 44px; }
.prose .post__more ul,
.prose .post__sources { padding: 0; list-style: none; }
.prose .post__more li,
.prose .post__sources li { margin: 0; }
.prose .post__more a,
.prose .post__sources a { display: inline-flex; align-items: center; min-height: 44px; }

/* Tables (comparisons). The box scrolls sideways on narrow screens; it takes focus so the
   keyboard can scroll it too. */
.table-scroll { margin: 0 0 1.5em; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.table-scroll:focus-visible { outline-offset: 2px; }
.prose table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.prose caption { padding: 12px 14px; color: var(--text); font-weight: 600; text-align: left; caption-side: top; }
.prose th,
.prose td { padding: 10px 14px; border-top: 1px solid var(--border); color: var(--text-muted); text-align: left; vertical-align: top; }
.prose thead th { color: var(--text); font-weight: 600; background: var(--surface); }
.prose tbody th { color: var(--text); font-weight: 600; }

/* ---------- What is Yigo? (the home page, under the gallery) ---------- */

.explore { width: 100%; max-width: var(--content); margin: 0 auto; padding: 32px var(--gutter) 64px; border-top: 1px solid var(--border); }
.explore__title { margin: 0 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.explore__text { max-width: 70ch; margin: 0 0 20px; color: var(--text-muted); line-height: 1.6; }
.explore__links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.explore__links a {
  display: grid;
  gap: 2px;
  height: 100%;
  min-height: 44px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--tile);
  color: var(--text);
}
.explore__links a:hover { background: var(--surface); }
.explore__links strong { font-weight: 620; }
.explore__links span { color: var(--text-muted); font-size: 14px; line-height: 1.45; }

/* ---------- Make (/make): picture, 3D, converter ---------- */

.page--wide { max-width: calc(980px + 2 * var(--gutter)); }
.make__intro { max-width: 70ch; }
.make__step { margin-top: 36px; padding: 24px; border: 1px solid var(--border-strong); border-radius: 14px; }
.make__title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 20px; font-weight: 620; letter-spacing: -0.012em; }
.make__number {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--tile);
  background: var(--text);
  color: var(--bg);
  font-size: 15px;
  font-weight: 650;
}
.badge { padding: 2px 10px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--text); font-size: 13px; font-weight: 600; }
.make__text { max-width: 70ch; margin: 0 0 14px; color: var(--text-muted); line-height: 1.6; }
.make__plan { max-width: 70ch; margin: 0 0 14px; padding-left: 22px; color: var(--text-muted); line-height: 1.6; }
.make__plan li { margin-bottom: 6px; }
.make__status { margin: 12px 0 0; color: var(--text); }
.make__status:empty { display: none; }
.make__note { max-width: 70ch; margin: 28px 0 0; color: var(--text-muted); }
.make__note a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.make__facts { margin: 0; color: var(--text); font-weight: 600; }

.button--accent { border-color: var(--text); background: var(--text); color: var(--bg); font-weight: 600; }
.button--accent:hover { background: var(--text); opacity: 0.9; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
label.button { cursor: pointer; }
/* The file input is hidden, so its label shows the focus ring. */
input[type="file"]:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }

.dropzone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 20px;
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
}
.dropzone.is-over { border-color: var(--accent); background: var(--surface); }
.dropzone__hint { margin: 0; color: var(--text-muted); }

.make__result { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin-top: 20px; align-items: start; }
.make__controls { display: grid; gap: 16px; align-content: start; }
.make__controls .setting { margin: 0; }
.make__controls .setting__help,
.range .setting__help { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }

/* A checkerboard behind the picture, so transparent parts show as transparent. */
.checker {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--bg) 0% 50%) 50% / 24px 24px;
}

.range label { display: block; color: var(--text); font-weight: 600; }
.range input { width: 100%; min-height: 44px; accent-color: var(--accent); }
.range input:disabled { opacity: 0.5; }

.make .field label { display: block; margin-bottom: 6px; color: var(--text); font-weight: 600; }
.make .field input {
  width: 9em;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--tile);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.formats { margin: 0; padding: 0; border: 0; }
.formats legend { margin-bottom: 8px; padding: 0; color: var(--text); font-weight: 600; }
.formats__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.format { position: relative; }
.format input { position: absolute; top: 14px; left: 12px; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.format label {
  display: grid;
  gap: 2px;
  min-height: 44px;
  height: 100%;
  padding: 10px 12px 10px 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--tile);
  cursor: pointer;
}
.format input:checked + label { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.format__name { color: var(--text); font-weight: 650; }
.format__detail { color: var(--text-muted); font-size: 13.5px; line-height: 1.45; }

.viewer { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.viewer__canvas { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; touch-action: none; }
.viewer__canvas:focus-visible { outline-offset: -4px; }
.viewer__hint { margin: 0; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 14px; }

@media (max-width: 760px) {
  .make__result { grid-template-columns: minmax(0, 1fr); }
  .make__step { padding: 18px 16px; }
}

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

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
}
.footer__note { margin: 12px 0; }
.footer__links { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 0; padding: 0; list-style: none; }
.footer__links a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent; }
.footer__links a:hover { color: var(--text); text-decoration-color: currentColor; }
.footer__links a[aria-current="page"] { color: var(--text); font-weight: 600; text-decoration-color: currentColor; }

.footer__inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: 6px var(--gutter) calc(6px + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
}

/* ---------- Settings (accessibility page) ---------- */

.setting {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 1.25em;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
}
.setting input {
  width: 24px;
  height: 24px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--accent);
}
.setting__text { flex: 1; }
/* The label is part of the checkbox's target: together they are well over 44 x 44. */
.setting label { display: block; min-height: 44px; padding-top: 1px; color: var(--text); font-weight: 600; cursor: pointer; }
.prose .setting__help { margin: 0; color: var(--text-muted); }
.setting__status { margin: -0.5em 0 1.25em; color: var(--text-muted); }

/* ---------- Status page (/status, rendered by the status Worker) ---------- */

.status-icon { width: 26px; height: 26px; flex: none; stroke-width: 2; }
.is-good > .status-icon { color: var(--status-good); }
.is-warning > .status-icon { color: var(--status-warning); }
.is-critical > .status-icon { color: var(--status-critical); }
.is-neutral > .status-icon { color: var(--status-neutral); }

.status-banner {
  display: flex;
  gap: 16px;
  margin: 8px 0 0;
  padding: 22px 24px;
  border: 2px solid var(--border-strong);
  border-radius: 16px;
  background: var(--bg-raised);
}
.status-banner.is-critical { border-color: var(--status-critical); }
.status-banner > .status-icon { width: 34px; height: 34px; }
.prose .status-banner__title { margin: 2px 0 6px; font-size: 22px; line-height: 1.3; scroll-margin-top: 96px; }
.prose .status-banner p { margin: 0 0 6px; color: var(--text); }
.prose .status-banner .status-banner__checked { margin: 10px 0 0; color: var(--text-muted); font-size: 15px; }
.prose .status-reload { margin: 12px 0 0; font-size: 15px; }
.prose .status-about { margin-top: 40px; font-size: 15px; }

.prose .status-parts,
.prose .status-incidents {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--bg-raised);
  color: var(--text);
}
.prose .status-parts li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}
.prose .status-parts li:first-child,
.prose .status-incidents li:first-child { border-top: 0; }
.status-parts__name { font-weight: 600; }
.status-parts__what { display: block; color: var(--text-muted); font-size: 14.5px; font-weight: 400; }
.status-parts__state { text-align: right; }
.prose .status-incidents li { display: flex; gap: 14px; margin: 0; padding: 14px 18px; border-top: 1px solid var(--border); }
.prose .status-incident__title { margin: 0; color: var(--text); font-weight: 600; }
.prose .status-incident__when { margin: 2px 0 0; font-size: 15px; }

.status-timeline { position: relative; margin-top: 4px; border-radius: 6px; }
.status-timeline:focus-visible { outline-offset: 6px; }
.prose .status-days { display: flex; gap: 2px; height: 40px; margin: 0; padding: 0; list-style: none; }
.prose .status-days li { flex: 1; min-width: 2px; margin: 0; border-radius: 2px; }
.status-day--working { background: var(--day-working); }
.status-day--mixed { background: var(--day-mixed); }
.status-day--maintenance { background: var(--day-maintenance); }
.status-day--down { background: var(--day-down); }
.prose .status-days li.status-day--down { align-self: flex-end; height: 60%; }
.status-day--none { box-shadow: inset 0 0 0 1px var(--border-strong); }
.prose .status-days li.is-active { outline: 2px solid var(--text); outline-offset: 2px; }
.status-timeline__ends { display: flex; justify-content: space-between; margin-top: 6px; color: var(--text-muted); font-size: 14px; }
.status-timeline__start--30 { display: none; }
.status-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: 14px 0 0; color: var(--text); font-size: 14.5px; }
.status-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.status-swatch { width: 14px; height: 14px; flex: none; border-radius: 3px; }
.status-swatch.status-day--down { height: 9px; align-self: flex-end; margin-bottom: 3px; }

/* The day read out by /uptime.js (pointer, touch or keyboard). */
.status-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  z-index: 5;
  width: max-content;
  max-width: min(340px, 100%);
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-raised);
  box-shadow: 0 6px 22px var(--shadow-strong);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.45;
}
.prose .status-tip p { margin: 0; color: var(--text); }
.prose .status-tip .status-tip__online { color: var(--text-muted); }
.prose .status-tip ul { margin: 6px 0 0; padding-left: 18px; color: var(--text); }
.prose .status-tip li { margin: 2px 0 0; }
.prose .status-hint { margin: 16px 0 0; font-size: 14px; }

.prose .status-incident__note { margin: 2px 0 0; font-size: 15px; }


@media (max-width: 600px) {
  /* On a phone, 90 bars would be too thin to see: show the last 30 days. */
  .prose .status-days li:nth-child(-n + 60) { display: none; }
  .status-timeline__start--90 { display: none; }
  .status-timeline__start--30 { display: inline; }
  .status-banner { padding: 18px; }
  .prose .status-parts li { grid-template-columns: 26px minmax(0, 1fr); }
  .status-parts__state { grid-column: 2; text-align: left; }
}

/* ---------- Maintenance notice over a page that was already open (public/maintenance.js) ---------- */

.maintenance-screen {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--text);
}
.maintenance-screen::backdrop { background: var(--bg); } /* the page underneath is hidden, not just dimmed */
html:has(.maintenance-screen[open]) { overflow: hidden; }
.maintenance-screen .simple__title:focus { outline: none; }
.maintenance-screen .simple { padding-top: clamp(40px, 14vh, 140px); }

/* ---------- Admin's maintenance banner (only the signed-in admin sees it) ---------- */

/* The status page's banner during maintenance (status/src/page.js). */
.maintenance-bar { border-bottom: 2px solid var(--text); background: var(--surface); color: var(--text); font-size: 15px; line-height: 1.5; }
.maintenance-bar p { max-width: var(--content); margin: 0 auto; padding: 12px var(--gutter); }
.admin-banner { border-bottom: 2px solid var(--text); background: var(--surface); color: var(--text); font-size: 14.5px; }
.admin-banner p { max-width: var(--content); margin: 0 auto; padding: 10px var(--gutter); }
.admin-banner a { display: inline-flex; align-items: center; min-height: 44px; margin-left: 4px; color: var(--link); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Pages the Worker renders (maintenance, admin sign-in) ---------- */

.simple {
  width: 100%;
  max-width: calc(60ch + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(40px, 12vh, 120px) var(--gutter) 72px;
  font-size: 16px;
  line-height: 1.6;
}
.simple .simple__brand { margin-bottom: 36px; color: var(--text); }
.simple__title { margin: 0 0 16px; font-size: clamp(28px, 5vw, 36px); font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; }
.simple p { margin: 0 0 1.25em; color: var(--text-muted); }
.simple .simple__lede { color: var(--text); font-size: 18px; }
.simple__link { display: inline-flex; align-items: center; min-height: 44px; color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.simple__link:hover { text-decoration-thickness: 2px; }
.simple__code { margin: 0 0 1.25em; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); font: 15px/1.5 var(--mono); }

.simple__form { display: grid; gap: 10px; margin: 8px 0 32px; }
.field__label { color: var(--text); font-weight: 600; }
.simple .field__help { margin: 0; color: var(--text-muted); font-size: 15px; }
.simple .field__error {
  margin: 0;
  padding: 10px 14px;
  border-left: 4px solid light-dark(#a1161b, #ff9a9a);
  border-radius: 4px;
  background: light-dark(#fdeced, #3a1618);
  color: light-dark(#7d0e12, #ffd5d5);
  font-weight: 560;
}
.field__input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-raised);
  font-size: 16px;
}
.field__input[aria-invalid="true"] { border: 2px solid light-dark(#a1161b, #ff9a9a); }
/* Text and date fields show the ring on any focus, including a date field's own
   parts and calendar button, which take focus inside it. */
.field__input:focus,
.field__input:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.button--solid { justify-self: start; border-color: transparent; background: var(--text); color: var(--bg); font-weight: 600; }
.button--solid:hover { background: var(--text-muted); }

/* ---------- Views: home (with its gallery), results, favorites, feed ---------- */

.gallery, .favorites, .explore { display: none; }
[data-view="home"] .gallery { display: block; }
[data-view="home"] .explore { display: block; }
[data-view="favorites"] .favorites { display: block; }
[data-view="favorites"] .home,
[data-view="favorites"] .results { display: none; }
[data-view="favorites"] .topbar { border-bottom: 1px solid var(--border); }
[data-view="feed"] .topbar,
[data-view="feed"] main,
[data-view="feed"] .footer,
[data-view="feed"] .skip-link { display: none; }

/* A shorter hero when the gallery is there, so its first row shows without scrolling. */
[data-view="home"] main:has(.gallery:not([hidden])) .home { flex: none; padding-top: clamp(24px, 9vh, 110px); padding-bottom: 44px; }

/* Top bar links: the feed and favorites. */
.topbar__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--tile);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.topbar__link:hover { background: var(--surface-2); color: var(--text); }
.topbar__link[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.topbar__link .icon { width: 19px; height: 19px; }

/* Two or three text buttons, one pressed (the gallery's Popular / Newest). */
.segmented { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border-strong); border-radius: calc(var(--tile) + 3px); }
.segmented button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--tile);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.segmented button:hover { background: var(--surface); color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* The gallery: popular models at a glance, under the search box. */
.gallery { width: 100%; max-width: var(--content); margin: 0 auto; padding: 0 var(--gutter) 72px; }
.gallery__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 24px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.gallery__title { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.gallery__feed { margin-left: auto; }
.gallery__feed .icon { width: 18px; height: 18px; }
.gallery__more { display: flex; justify-content: center; margin-top: 36px; }

/* Topic tabs, to browse by kind of model. One row that scrolls sideways when it doesn't fit
   (phones); the padding keeps focus rings inside the scrolling box. */
.topics {
  display: flex;
  gap: 8px;
  margin: -12px -6px 18px;
  padding: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.topics .chip { flex: none; white-space: nowrap; }
.topics .chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.gallery__empty { grid-column: 1 / -1; padding: 32px 0; color: var(--text-muted); }

/* Laid like a mosaic: square pictures with narrow joints, each name on its own dark strip
   (white text keeps 7:1 on any picture), and the first tile twice the size, like the big
   tile of the mark. Open and Copy link are in the preview a tile opens. */
.gallery .result-list { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-auto-flow: dense; gap: 8px; }
.gallery .card { gap: 0; overflow: hidden; border-radius: var(--radius); }
.gallery .card__media { aspect-ratio: 1; border-radius: 0; }
.gallery .card:first-child { grid-column: span 2; grid-row: span 2; }
.gallery .card__body {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  padding: 8px 12px 12px;
  background: rgb(8 9 11 / 0.84); /* solid under the text: white on it is over 7:1 even on a white picture */
  color: #fff;
}
.gallery .card__body::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 26px;
  background: linear-gradient(to top, rgb(8 9 11 / 0.84), rgb(8 9 11 / 0));
  pointer-events: none;
}
.gallery .card__source,
.gallery .card__likes,
.gallery .card__main { color: #fff; }
.gallery .card__price { border-color: rgb(255 255 255 / 0.75); color: #fff; }
.gallery .card__title { margin-top: 4px; }
.gallery .card:first-child .card__title { font-size: 19px; }
.gallery .card__tags,
.gallery .card__actions,
.gallery .skeleton .skeleton__line { display: none; }
.gallery .card:has(.card__main:focus-visible) { outline-offset: 3px; }

/* Favorites. */
.favorites { width: 100%; max-width: var(--content); margin: 0 auto; padding: 32px var(--gutter) 72px; }
.favorites__title { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.favorites__note { max-width: 70ch; margin: 8px 0 28px; color: var(--text-muted); }
.favorites__empty { max-width: 560px; }
.favorites__empty-title { margin: 0 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.favorites__empty-text { margin: 0 0 20px; color: var(--text-muted); }

/* Recommendations settings, under the favorites. */
.personal { max-width: 70ch; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.personal__title { margin: 0 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.personal__text { margin: 0 0 20px; color: var(--text-muted); }
.personal__text a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.personal .setting__help { margin: 0; color: var(--text-muted); }
.personal__summary { margin: 0 0 16px; color: var(--text); }

/* The Favorite star: filled once saved. On cards it sits on the picture, above the card's
   own click layer; it comes last in the card's keyboard order. */
.favorite[aria-pressed="true"] .icon--star { fill: currentColor; }
/* Saving flips the colors at once: a fade would pass through dark text on a dark background. */
.button.favorite { transition: none; }
.card__favorite {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--tile);
  background: var(--scrim);
  color: #fff;
  transition: background-color 0.15s var(--ease);
}
.card__favorite:hover { background: rgb(15 16 18 / 0.94); }
.card__favorite[aria-pressed="true"] { color: #ffd166; }
.card__favorite .icon { width: 20px; height: 20px; stroke-width: 1.9; }
.card__likes { flex: none; color: var(--text-muted); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.preview__actions .favorite .icon { width: 17px; height: 17px; }

/* The feed: one model per screen, snapping as it scrolls. Text sits on a dark scrim, so
   white text keeps 7:1 on any picture (as in the preview). */
html:has(.feed:not([hidden])) { overflow: hidden; }
.feed { position: fixed; inset: 0; z-index: 30; background: #0e0f11; color: #fff; }
.feed__bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  pointer-events: none;
}
.feed__bar > * { pointer-events: auto; }
.feed__list {
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.feed__list::-webkit-scrollbar { display: none; }
.feed__list:focus-visible { outline: 3px solid #fff; outline-offset: -6px; box-shadow: inset 0 0 0 8px #000; }
.feed__item { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.feed__card { position: relative; height: 100%; display: grid; place-items: center; overflow: hidden; isolation: isolate; }
.feed__card--message { background: #16181b; }
.feed__backdrop {
  position: absolute;
  inset: -48px;
  z-index: -1;
  background: var(--image, none) center / cover no-repeat;
  filter: blur(34px) saturate(1.2) brightness(0.55);
}
.feed__image { width: 100%; height: 100%; object-fit: contain; }
.feed__info {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  padding: 12px max(20px, calc((100% - 760px) / 2)) calc(28px + env(safe-area-inset-bottom, 0px));
  background: rgb(8 9 11 / 0.84); /* solid under the text: white on it is over 7:1 on any picture */
}
.feed__info::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 56px;
  background: linear-gradient(to top, rgb(8 9 11 / 0.84), rgb(8 9 11 / 0));
  pointer-events: none;
}
.feed__card--message .feed__info { position: static; background: none; padding-top: 0; }
.feed__card--message .feed__info::before { content: none; }
.feed__source { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: #fff; font-size: 14px; }
.feed__source .card__avatar { width: 20px; height: 20px; }
.feed__name { margin: 0 0 16px; font-size: clamp(22px, 5vw, 32px); font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
.feed__text { margin: -6px 0 18px; color: #fff; }
.feed__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.feed__button {
  border-color: rgb(255 255 255 / 0.7);
  background: var(--scrim);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.feed__button:hover { background: rgb(15 16 18 / 0.94); }
.feed__button[aria-pressed="true"] { border-color: transparent; background: #fff; color: #111; }
.feed__button .icon { width: 18px; height: 18px; }

/* ---------- Forced colors (Windows High Contrast and similar) ---------- */

@media (forced-colors: active) {
  .icon { stroke: CanvasText; }
  button .icon, a .icon { stroke: ButtonText; }
  .view-toggle button[aria-pressed="true"],
  .tab[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
  .tab[aria-pressed="true"]::after { background: Highlight; }
  .suggest__option[aria-selected="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
  .search:has(.search__input:focus-visible), :focus-visible, .on-image:focus-visible { outline-color: Highlight; }
  .card__hint, .preview__close { border: 1px solid ButtonText; }
  .brand__tile { forced-color-adjust: none; }
  .status-days li, .status-swatch { forced-color-adjust: none; }
  .segmented button[aria-pressed="true"], .topics .chip[aria-pressed="true"], .feed__button[aria-pressed="true"], .topbar__link[aria-current="page"] { outline: 2px solid Highlight; outline-offset: -2px; }
  .card__favorite { border: 1px solid ButtonText; }
}

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
  :root { --gutter: 16px; }

  [data-view="results"] .topbar__inner,
  [data-view="page"] .topbar__inner {
    flex-wrap: wrap;
    gap: 10px 12px;
    min-height: 0;
    padding-top: 10px;
    padding-bottom: 12px;
  }
  [data-view="results"] .topbar .search,
  [data-view="page"] .topbar .search { order: 3; flex-basis: 100%; max-width: none; }
  .page { padding-top: 32px; }
  html { scroll-padding-top: 150px; } /* the header wraps to two rows here */
  .prose h2 { scroll-margin-top: 150px; }
  .brand--small { font-size: 24px; }
  .topbar__inner { min-height: 60px; }

  .search__hint { display: none; }
  .topbar__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .topbar__link { padding: 0; }
  .gallery__feed { margin-left: 0; }
  .gallery .result-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
  .gallery .card__body { padding: 6px 10px 10px; }
  [data-view="favorites"] .topbar__inner { flex-wrap: wrap; gap: 10px 12px; min-height: 0; padding-top: 10px; padding-bottom: 12px; }
  [data-view="favorites"] .topbar .search { order: 3; flex-basis: 100%; max-width: none; }
  .home__tagline { font-size: 15px; margin-bottom: 28px; }

  .result-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 12px; }
  .card__title { font-size: 14px; }
  .card__tags { display: none; }

  [data-layout="list"] .results .card { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; }
  [data-layout="list"] .results .card__title { font-size: 16.5px; }
  [data-layout="list"] .results .card__tags { display: flex; max-height: 22px; }
}

@media (hover: none) {
  .card__hint { display: none; }
}

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