/* Polska Gurom: rows of project cards, each row drifting, alternate rows in opposite directions.
   One screen, never scrolls. Nothing on it but the cards. */

@font-face {
  font-family: "Caveat PG";   /* the quote card's hand, OFL: fonts/Caveat-OFL.txt */
  src: url("/fonts/caveat-pl.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Anton PG";
  src: url("/fonts/anton-pl.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ground: #0e0e0e;
  --ink: #f2efe8;
  --red: #e63a2e;          /* the BLUZG censor bar red, its rule: BRANDS/bluzg/2_MARKETING/brand/censor-bar.md */
  --rows: 3;
  --gap: 14px;
  --radius: 6px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  /* card height: the screen split into rows, gaps above, between and below */
  --card-h: calc((100svh - (var(--rows) + 1) * var(--gap)) / var(--rows));
  --card-w: calc(var(--card-h) * 1.6);
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--ground);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.deck { height: 100%; }
.js body { overflow: hidden; }

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

/* The one control: invisible until a keyboard reaches it (WCAG 2.2.2, a way to stop motion). */
.pause {
  position: fixed; z-index: 10; top: 12px; left: 50%;
  transform: translate(-50%, -160%);
  padding: 10px 16px;
  border: 0; border-radius: 999px;
  background: var(--ink); color: var(--ground);
  font: 600 14px/1 inherit; font-family: inherit;
  cursor: pointer;
  transition: transform 200ms var(--ease-out);
}
.pause:focus-visible { transform: translate(-50%, 0); outline: 2px solid var(--red); outline-offset: 2px; }

/* ---------- Without the script: a plain grid you scroll ---------- */

.cards {
  list-style: none; margin: 0; padding: var(--gap);
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  height: 100%; overflow-y: auto;
}

/* ---------- The card ---------- */

.card {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1a1a1a;
  contain: layout paint;
}

.card a { display: block; position: absolute; inset: 0; color: inherit; text-decoration: none; }

.card img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease-out);
}

.card a:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: var(--radius); }

/* The caption: on hover or keyboard focus the picture dims and a short plain line in big
   capitals sits dead centre. Anton, the face of the POLSKA GUROM map lettering, so the hub
   speaks in one voice. Touch screens never hover, so there the cards are pictures only. */
.cap {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 6%;
  text-align: center;
  background: rgb(10 10 10 / 0.6);
  opacity: 0;
  transition: opacity 240ms var(--ease-out);
  pointer-events: none;
}
.cap-line {
  font-family: "Anton PG", Impact, "Arial Narrow", sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  font-size: calc(var(--card-h) * 0.2);
  line-height: 0.95;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-wrap: balance;
  transform: translateY(10px);
  transition: transform 320ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .card a:hover img { transform: scale(1.035); }
  .card a:hover .cap { opacity: 1; }
  .card a:hover .cap-line { transform: none; }
}
.card a:focus-visible .cap { opacity: 1; }
.card a:focus-visible .cap-line { transform: none; }
@media (hover: none) {
  .cap { display: none; }
}

/* ---------- BLUZG: the censor bar over CHUJ on his back ----------
   Measured on cards/bluzg-hero.webp (1152 x 720). Thinner than BLUZG's own rule asks (about
   half the cap height, so more of the letters shows) and tilted 3.2 degrees, because the
   painted word itself climbs to the right: the bar follows the word, so the peek stays even
   from C to J. It pulls back to the left on hover and focus: a bar never stays shut for good. */
.bar {
  position: absolute;
  left: 60.96%; width: 14.97%;
  top: 44.37%; height: 3.6%;   /* top set for a turn about the left end, not the middle */
  background: var(--red);
  transform: rotate(-3.2deg);
  transform-origin: left center;
  transition: transform 380ms var(--ease-out);
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .card--censor a:hover .bar { transform: rotate(-3.2deg) scaleX(0); }
}
.card--censor a:focus-visible .bar { transform: rotate(-3.2deg) scaleX(0); }

/* ---------- Text cards: a plain slide on paper, like the text slides of the reference deck ----
   Not links. A small label top left and the address bottom right, the line in Anton capitals
   in the middle. */
.card--text { background: #efe9dc; color: #141414; }
.note {
  position: absolute; inset: 0;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: 5% 6%;
}
.note-tag, .note-foot {
  font-size: clamp(9px, calc(var(--card-h) * 0.04), 12px);
  letter-spacing: 0.06em; text-transform: uppercase; line-height: 1;
}
.note-foot { justify-self: end; }
.note-line {
  align-self: center; justify-self: center;
  margin: 0; max-width: 18ch;
  font-family: "Anton PG", Impact, "Arial Narrow", sans-serif;
  text-transform: uppercase; text-align: center;
  font-size: calc(var(--card-h) * 0.105); line-height: 1.14;   /* room for the Polish accents above capitals */
  text-wrap: balance;
}
/* The quote card: written by hand in red marker on white paper, left aligned, like a note
   (the user, 02.12.2026, from a handwritten reference). Caveat, self-hosted, OFL. The four
   lines are set by hand. */
.card--quote { background: #d8261c; color: #efe9dc; }   /* the map red, the hand and the name in off-white (the user, 02.12.2026) */
.card--quote .note { padding: 6% 9%; }
.card--quote .note { grid-template-rows: 1fr auto; }
.card--quote .note-foot { color: inherit; }   /* the name in plain type, the same off-white as the hand */
.card--quote .note-line {
  justify-self: start;
  font-family: "Caveat PG", "Segoe Print", cursive; font-weight: 500;
  filter: url(#ink);                           /* index.html: shaky edges, uneven ink */
  text-transform: none; text-align: left;
  font-size: calc(var(--card-h) * 0.134); line-height: 1.06;
  max-width: none; white-space: nowrap;
}
figure.note { margin: 0; }
blockquote.note-line { margin: 0; }
.card--art { background: #efe9dc; }

/* ---------- Slots: placeholders for projects not ready yet ---------- */

.card--slot { background: #161616; border: 1px dashed #3a3a3a; }
.slot {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-align: center; padding: 16px;
}
.slot-name { font-size: clamp(16px, calc(var(--card-h) * 0.11), 30px); font-weight: 700; color: #6d6a64; }
.slot-note { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #4d4b47; }

/* ---------- With the script: the rows ---------- */

.js .cards { display: none; }

.rows {
  height: 100svh;
  padding: var(--gap) 0;
  display: flex; flex-direction: column; gap: var(--gap);
}

.row {
  height: var(--card-h);
  overflow: hidden;
  /* soft fade at the two screen edges */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
}

.track {
  display: flex; width: max-content; height: 100%;
  list-style: none; margin: 0; padding: 0;
  animation: drift var(--dur, 80s) linear infinite;
  animation-direction: var(--dir, normal);
  will-change: transform;
}
.track .card { width: var(--card-w); height: var(--card-h); margin-right: var(--gap); flex: none; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* Stops: pointer over a row, a finger on it, keyboard focus in it, or the pause button */
@media (hover: hover) and (pointer: fine) {
  .row:hover .track { animation-play-state: paused; }
}
.row:has(:focus-visible) .track,   /* keyboard focus only: a mouse click leaves focus on the link */
.row.held .track,
.paused .track { animation-play-state: paused; }
.row.kb .track { animation: none; }   /* keyboard in the row: back to its start, see deck.js */

/* ---------- Reduced motion: rows stand still and scroll by hand, snapping to a card ---------- */

@media (prefers-reduced-motion: reduce) {
  .track { animation: none; }
  .row {
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    -webkit-mask-image: none; mask-image: none;
    padding-left: var(--gap);
  }
  .row::-webkit-scrollbar { display: none; }
  .track .card { scroll-snap-align: start; scroll-margin-left: var(--gap); }
  .card img, .cap, .cap-line, .bar { transition: none; }
  .pause { display: none; }
}

/* ---------- Phones ---------- */

@media (max-width: 767px) {
  :root { --gap: 10px; --radius: 5px; }
}
