/* cards.css: the project cards (Felix, 12/5).

   Two kinds of card, one file:
   - fc-block: a Selected work on the Landing. A 16:9 video, the white circle (fc-badge) and the glass caption
     (fc-caption) that show under the mouse; with a mouse the circle becomes the pointer (fc-cursor, js/cards.js).
     Below it, in the page, the title and the tag row (fc-tags).
   - fc-tile: a small card in the archive grid that the AI guide's filter shows (All or a topic). A picture,
     a title (fc-tile-title) and the kind of work (fc-tile-kind). The guide builds these (js/guide.js).
   Both grow their picture by --fc-zoom under the mouse.

   Until 12/5 these rules sat in the Landing's markup: the same card rules six times (one copy per card, left from
   the Semplice code blocks), and the tag and skill pill rules beside them with the global rules of the pages they
   were first drawn in (* and body resets). Those copies are gone; this is the one place for the cards.
   The skill pills under the Landing intro are not cards: they are in site.css (Landing section).
*/

:root {
  --fc-zoom: 1.03;   /* how much a card's picture grows under the mouse */
}


/* ---- Selected work: fc-block ---------------------------------------------------------------------
   All blocks: full width, 16:9. Badge (top right) and caption (bottom left) are drawn against a 1300px
   reference width: they shrink with a narrower block and never grow past design size on a wider one. */
.fc-block {
  --px: min(1px, 100cqw / 1300);   /* 1 design px */
  --gap: calc(20 * var(--px));     /* corner inset */

  container-type: inline-size;
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer;
  font: 400 16px/1.2 'Roboto', sans-serif;
  text-decoration: none;
  transition: border-radius 0.6s ease;
}

.fc-block:hover { border-radius: 20px; }

/* Video fills the 16:9 box; wider sources get cropped left/right, centred */
.fc-block video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.fc-block:hover video { transform: scale(var(--fc-zoom)); }

.fc-badge,
.fc-caption {
  position: absolute;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.fc-block:hover .fc-badge,
.fc-block:hover .fc-caption,
.fc-block:focus-visible .fc-badge,
.fc-block:focus-visible .fc-caption { opacity: 1; }

/* With a mouse the circle leaves its corner and becomes the pointer (Felix, 12/5): js/cards.js puts .fc-mouse on
   <html> once a mouse moves, and .is-cursor on the card under it. Keyboard focus keeps the circle in its corner. */
.fc-mouse .fc-block:hover .fc-badge,
.fc-block.is-cursor .fc-badge { opacity: 0; }
.fc-block.is-cursor { cursor: none; }

/* White circle: top right */
.fc-badge {
  top: var(--gap);
  right: var(--gap);
  width: calc(100 * var(--px));
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-size: calc(16 * var(--px));
  text-align: center;
  white-space: nowrap;
  transform: rotate(15deg);
}

/* Glass caption: bottom left. The same glass as the AI guide's bar (Felix, 12/5): the recipe is in site.css
   (--fc-glass-*). Size and corners as before; the dark glass needs no text shadow. */
.fc-caption {
  left: var(--gap);
  bottom: var(--gap);
  box-sizing: border-box;
  width: calc(594 * var(--px));
  min-height: calc(78 * var(--px));
  padding: calc(16 * var(--px)) calc(19 * var(--px));
  border: 1px solid var(--fc-glass-edge);
  border-radius: calc(10 * var(--px));
  background: var(--fc-glass-sheen), var(--fc-glass-tint);
  -webkit-backdrop-filter: var(--fc-glass-blur);
  backdrop-filter: var(--fc-glass-blur);
  box-shadow: var(--fc-glass-shadow);
  color: #fff;
  font-size: max(13px, calc(16 * var(--px)));
  line-height: 2;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .fc-caption { background: var(--fc-glass-solid); }
}

@media (prefers-reduced-transparency: reduce) {
  .fc-caption { background: var(--fc-glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* The circle as the pointer: one element for the page (js/cards.js moves it to the mouse). Above everything,
   never in the mouse's way, free to hang over the card's edge. It looks like the corner badge: same size against
   the card's width (--px, set from the card), font, colour and tilt. It grows in where the mouse enters and shrinks
   away where it leaves. */
.fc-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  width: 0;
  height: 0;
  pointer-events: none;
}

.fc-cursor-face {
  position: absolute;
  left: calc(-50 * var(--px, 1px));
  top: calc(-50 * var(--px, 1px));
  width: calc(100 * var(--px, 1px));
  height: calc(100 * var(--px, 1px));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font: 400 calc(16 * var(--px, 1px))/1.2 'Roboto', sans-serif;
  letter-spacing: normal;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transform: rotate(15deg) scale(0.4);
  transition: transform 0.2s ease-in, opacity 0.2s ease-in;           /* going */
}

.fc-cursor.is-on .fc-cursor-face {
  opacity: 1;
  transform: rotate(15deg) scale(1);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease-out;   /* coming: a small overshoot */
}

@media (prefers-reduced-motion: reduce) {
  .fc-cursor-face,
  .fc-cursor.is-on .fc-cursor-face { transition: none; }
}

/* Mobile / tablet: no hover layers, no circle. Safari shows them too since 12/5 (the original code hid them there). */
@media (max-width: 1024px) {
  .fc-badge,
  .fc-caption,
  .fc-cursor { display: none; }
}


/* ---- The tag row under a Selected work's title -----------------------------------------------------
   Tags read as #tags, not buttons (Felix, 12/4). The award stays a gold badge. */
.fc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.fc-tag,
.fc-award {
  display: flex;
  align-items: center;
  font-family: 'Cousine', monospace;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.fc-tag {
  padding: 5px 0;
  color: #fff;
  font-size: 14px;
  opacity: 0.7;
}

.fc-tag::before { content: "#"; margin-right: 1px; }

/* Award: gold border, faint gold fill and a trophy, the same as the award cards in the case studies */
.fc-award {
  gap: 6px;
  padding: 5px 18px;
  border: 0.75px solid #FFD300;
  border-radius: 50px;
  background: linear-gradient(180deg, rgba(255, 211, 0, .16), rgba(255, 211, 0, .05));
  color: #FFD300;
  font-size: 12px;
}

.fc-award svg {
  flex: none;
  display: block;
  width: 12px;
  height: 12px;
}


/* ---- Small card: fc-tile (the archive grid of the guide's filter) ----------------------------------- */
.fc-tile {
  display: block;
  color: #EDEDED !important;          /* over the page's link colours */
  text-decoration: none !important;
}

.fc-tile-media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #1B1B1B;
}

.fc-tile-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.2s;
}

.fc-tile:hover .fc-tile-media img { transform: scale(var(--fc-zoom)); opacity: 0.85; }

.fc-tile-title {
  margin-top: 12px;
  font-family: "Montserrat-BoldItalic", "Montserrat Bold", "Montserrat", sans-serif;
  font-size: 18px;
  line-height: 24px;
}

.fc-tile-kind {
  margin-top: 4px;
  color: #8A8A8A;
  font-family: "Cousine", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 18px;
  text-transform: uppercase;
}
