/* Latest work — infinite horizontal carousel for the home page
   "Recent work" section. One 16:9 card at a time, full width of the
   column, so nothing is ever cropped at the left or right edge.

   Palette and faces are the site's existing tokens; the accent is
   --color-minium (#b23a1e), kept distinct from the #e2661f CTA orange
   so the two never compete. */

/* Poppins Medium, self-hosted so there is no external request at runtime. */
@font-face {
  font-family: "RD Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/rd-poppins-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2122, U+2212, U+FEFF, U+FFFD;
}

.rd-carousel {
  --gap: 16px;
  --radius: 24px;
  --minium: #b23a1e;
  --line: #cbc8bf;

  position: relative;
  margin: 16px 0 2px;
  -webkit-user-select: none;
  user-select: none;
}

/* Full-bleed frame: width, height and the negative margin that breaks it out
   of the column are set from JS, so cards are clipped at the screen edges. */
.rd-carousel__viewport {
  position: relative;
  width: 100%;
  height: 1px; /* replaced from JS */
  overflow: hidden;
  touch-action: pan-y;
}

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

.rd-card {
  position: absolute;
  top: 0;
  /* left and width are set from JS: the card is inset by the column gutter
     inside the full-bleed frame. */
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #d8d4cb;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
  transition: transform 460ms cubic-bezier(0.22, 1, 0.36, 1);
}

.rd-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.rd-card__veil {
  position: absolute;
  inset: 0;
  /* Tightened to the small centred label, so more of the photograph stays
     open around it. */
  background:
    radial-gradient(46% 30% at 50% 50%, rgba(15, 12, 8, 0.62), rgba(15, 12, 8, 0) 78%),
    linear-gradient(to top,
      rgba(15, 12, 8, 0.32) 0%,
      rgba(15, 12, 8, 0.1) 46%,
      rgba(15, 12, 8, 0.06) 72%,
      rgba(15, 12, 8, 0.2) 100%);
  pointer-events: none;
}

/* The project name, alone, in the centre of the card. */
.rd-card__plate {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  text-align: center;
}

.rd-card__name {
  margin: 0;
  font-family: "RD Poppins", Poppins, var(--font-body), system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(13px, 3.6vw, 16px);
  line-height: 1.25;
  /* Uppercase needs the extra tracking to stay readable at this size. */
  letter-spacing: 0.2em;
  text-indent: 0.2em; /* offsets the trailing letter-space, keeps it centred */
  text-transform: uppercase;
  color: #fff;
  text-wrap: balance;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

.rd-card:focus-visible {
  outline: 2px solid var(--minium);
  outline-offset: -4px;
}

/* --- dots ------------------------------------------------------------ */

.rd-carousel__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
}

/* 44px tap target around a small mark. */
.rd-dot {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  width: 30px;
  height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.rd-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
  transition: background-color 300ms ease, width 300ms ease;
}

.rd-dot[aria-pressed="true"]::before {
  width: 20px;
  border-radius: 4px;
  background: var(--minium);
}

.rd-dot:focus-visible {
  outline: 2px solid var(--minium);
  outline-offset: -8px;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .rd-card,
  .rd-dot::before {
    transition: none;
  }
}
