:root { --purple: #4B0082; --ink: #1A1A1A; --muted: #595959; --page: #FAF8FC; --line: #E4DDEC; }
* { box-sizing: border-box; }
html { background: var(--page); scroll-padding-top: 80px; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; }
a { color: var(--purple); }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Header */
.bar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 24px; padding: 0 16px; background: var(--purple); color: #fff; }
.bar a, .bar button, .here { color: #fff; }
.bar :focus-visible { outline-color: #fff; outline-offset: -3px; }
.bar a, .here { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.bar-top, .bar-actions { display: flex; align-items: center; gap: 8px 16px; }
.brand { font-weight: 700; text-decoration: none; margin-left: -8px; }
.bar button { min-height: 44px; min-width: 44px; padding: 0 12px; background: none; border: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.total { font-size: 15px; white-space: nowrap; }
.share-status { font-size: 15px; white-space: nowrap; }
.share-status:empty { display: none; }
.bar nav ul { display: flex; margin: 0; padding: 0; list-style: none; }
.here { font-weight: 700; }

/* Tiles */
.grid { display: grid; grid-template-columns: 1fr; gap: 20px; max-width: 1280px; margin: 0 auto; padding: 16px; list-style: none; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; padding: 24px; } }
.tile { display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); text-decoration: none; overflow: hidden; transition: transform .12s ease, box-shadow .12s ease; }
.tile:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--purple); }
.tile:focus-visible { outline-offset: 3px; }
.name { display: block; padding: 7px 12px; background: var(--purple); color: #fff; font-size: 15px; font-weight: 700; }
.frame { display: block; aspect-ratio: 4 / 3; background: #fff; }
.frame img, .noimg { display: block; width: 100%; height: 100%; object-fit: cover; }
.noimg { background: #000; }
.summary { display: block; padding: 12px 12px 0; }
.meta { display: block; padding: 6px 12px 0; color: var(--muted); font-size: 14px; }
.tile::after { content: ""; display: block; height: 12px; }

/* Random on a phone: one tile per screen, swipe between them. */
.arrows { display: none; }
@media (max-width: 699.98px) {
  #carousel { display: flex; gap: 0; padding: 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  #carousel::-webkit-scrollbar { display: none; }
  #carousel li { flex: 0 0 100%; padding: 16px; scroll-snap-align: center; scroll-snap-stop: always; }
  .arrows { display: flex; justify-content: center; gap: 16px; padding: 0 16px 16px; }
  .arrows button { width: 72px; height: 48px; background: var(--purple); color: #fff; border: 0; border-radius: 4px; font-size: 22px; cursor: pointer; }
  .arrows button:focus-visible { outline-offset: 3px; }
}

/* Categories */
.cats { max-width: 46em; margin: 0 auto; padding: 16px; }
.cats h1 { font-size: 28px; margin: 8px 0 12px; }
.jumps { display: flex; flex-wrap: wrap; gap: 0 16px; margin: 0 0 8px; padding: 0; list-style: none; }
.jumps a { display: inline-flex; align-items: center; min-height: 44px; }
.cats h2 { font-size: 22px; margin: 32px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--purple); }
.lines { margin: 0; padding: 0; list-style: none; }
.lines li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.lines a { font-weight: 700; padding: 11px 0; }
.line-summary { color: var(--muted); }
.lines small { color: var(--muted); font-size: 14px; white-space: nowrap; }

/* Footer */
footer { max-width: 40em; margin: 0 auto; padding: 32px 16px 48px; color: var(--ink); text-align: center; }
footer a { padding: 11px 0; }
footer p { margin: 0; }

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