/* The experiment cards, as the home page shows them, and the film viewer their Watch links open.
   The page defines the colour tokens (--glass, --glass-edge, --line, --lift, --seal, --ink, --muted, --card) and its own
   grid width; public/site/cards.js makes them work. */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 32px 28px; }
/* Each card is a pane of frosted glass laid on the page: it blurs the paper's grain beneath into a smooth, lighter surface,
   with a hairline edge, a lit top edge and a soft shadow, its preview inset like a mounted print. On hover or focus the pane
   lifts, its edge turns seal red, and the preview plays.
   Only the preview is a link, so the words stay selectable; a click anywhere else on the card follows it too. */
.card { cursor: pointer; padding: 12px 12px 8px; border-radius: 10px; background: var(--glass); -webkit-backdrop-filter: blur(10px) saturate(1.15); backdrop-filter: blur(10px) saturate(1.15);
  box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 1px var(--line), 0 1px 2px var(--lift), 0 14px 26px -18px var(--lift); transition: transform .25s ease, box-shadow .25s ease; }
.card:hover:not(:has(.links:hover)), .card:has(.thumb:focus-visible) { transform: translateY(-3px); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 1.5px var(--seal), 0 2px 4px var(--lift), 0 22px 36px -18px var(--lift); }
.thumb { position: relative; display: block; overflow: hidden; outline: none; user-select: none; border-radius: 6px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.thumb img, .thumb video { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.thumb video { position: absolute; inset: 0; height: 100%; opacity: 0; transition: opacity .3s ease; }
.thumb.live video { opacity: 1; transition: none; }
.card:hover:not(:has(.links:hover)) .name, .card:has(.thumb:focus-visible) .name { color: var(--seal); }
.top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 12px; margin-top: 14px; padding: 0 4px; }
.name { margin: 0; font-size: 23px; font-weight: 500; line-height: 1.25; transition: color .15s; }
.when { color: var(--muted); font-size: 16px; }
.what { color: var(--muted); margin: 3px 0 0; padding: 0 4px; font-size: 18px; line-height: 1.4; }
/* Each card's links: play it, watch it, earlier versions, source. Hovering them lights up only the link, not the whole card. */
.links { list-style: none; display: flex; flex-wrap: wrap; gap: 0 20px; margin: 8px 0 0; padding: 0 4px; font-size: 16.5px; cursor: auto; }
.links a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; color: var(--ink); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 calc(100% - 4px) / 0 1px no-repeat; transition: color .15s, background-size .25s ease; }
.links a:hover { color: var(--seal); background-size: 100% 1px; }
.links a:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; border-radius: 2px; }
.links .meta { color: var(--muted); font-size: 14.5px; }
.links .meta .out { width: 11px; height: 11px; margin-left: 1px; vertical-align: -1px; }   /* the link leaves the site, for the game's own */
.i { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* The film viewer: a film plays over a dimmed page, with a way to download it, and a close button in the screen's top
   right corner (clear of a phone's notch), kept out of the film's way by leaving room above it. */
.viewer { padding: 0; border: 0; background: none; max-width: none; max-height: none; overflow: visible; }
.viewer::backdrop { background: rgba(20, 16, 13, .78); backdrop-filter: blur(3px); }
.viewer video { display: block; width: auto; height: auto; max-width: min(92vw, 1100px); max-height: calc(100dvh - 170px); border-radius: 6px; background: #000; box-shadow: 0 24px 70px rgba(0, 0, 0, .45); outline: none; }
.viewer .bar { display: flex; align-items: center; gap: 18px; margin-top: 10px; color: #efe6d2; font-size: 17px; }
.viewer .vt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .bar a, .viewer .bar button { display: inline-flex; align-items: center; gap: 7px; font: inherit; color: inherit; text-decoration: none; background: none; border: 0; padding: 6px 0; cursor: pointer; }
.viewer .bar a:hover, .viewer .bar button:hover { color: #f0a08c; }
.viewer .bar :focus-visible { outline: 2px solid #f0a08c; outline-offset: 2px; border-radius: 2px; }
.viewer .bar .x { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 14px); right: calc(env(safe-area-inset-right, 0px) + 14px); justify-content: center; width: 44px; height: 44px; padding: 0;
  border-radius: 50%; background: rgba(239, 230, 210, .14); box-shadow: inset 0 0 0 1px rgba(239, 230, 210, .28); transition: background-color .15s, color .15s; }
.viewer .bar .x:hover { background: rgba(239, 230, 210, .24); }
.viewer .x .i { width: 18px; height: 18px; }
@media (max-width: 640px) and (orientation: landscape), (max-height: 480px) { .viewer video { max-height: calc(100dvh - 76px); max-width: min(92vw - 60px, 1100px); } }
html:has(.viewer[open]) { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; } .card:hover:not(:has(.links:hover)), .card:has(.thumb:focus-visible) { transform: none; }
}
