/* =========================================================
   WEBSITES-CAROUSEL.CSS
   Shared styles for the websites showcase + the tech grid.
   ========================================================= */

/* -------------------------------------------------------------
   TECH GRID — "Technologies we use"
   ------------------------------------------------------------- */

.tech {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.tech-head {
  max-width: var(--container);
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
  text-align: center;
}

/* 2-up on phones -> 5-up from 640px.
   5 is chosen so the 10 tools form two exact rows at every size —
   no orphan box on a trailing row. */
.tech-grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(0.6rem, 1.4vw, 1rem);
  row-gap: clamp(1rem, 2vw, 1.5rem);
}

@media (min-width: 640px) {
  .tech-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Cell = logo box + caption stacked underneath it.
   The box is the bordered card; the caption sits OUTSIDE it. */
.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.tech-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 88px;
  padding: 0.75rem;
  background: var(--surface);
  border: var(--border-1);
  border-radius: var(--radius);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
              border-color 0.3s var(--ease);
}

.tech-item:hover .tech-box {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 rgba(105, 159, 71, 0.5);
  border-color: var(--green);
}

/* The logos are a mix of square icons and wide wordmarks, so cap
   BOTH dimensions and let object-fit centre them inside one box.
   That keeps every tile visually the same size regardless of the
   source aspect ratio. */
.tech-box img {
  display: block;
  margin: 0 auto;          /* belt-and-braces centring inside the flex box */
  width: auto;
  height: 34px;
  max-width: 100%;
  max-height: 34px;
  object-fit: contain;
}

/* Square app icons carry far less visual weight than a wordmark at the
   same height, so they get a larger box to read at parity. */
.tech-box--icon img {
  height: 46px;
  max-height: 46px;
}

.tech-name {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-soft);
  text-align: center;
  transition: color 0.25s var(--ease);
}

.tech-item:hover .tech-name {
  color: var(--green-dark);
}

/* -------------------------------------------------------------
   WEBSITES CAROUSEL — 9:16 website screenshot marquee
   Continuous slow auto-scroll (same pattern as the logo
   ticker): the slide set is repeated Nx and translated by
   exactly one set, so the seam is invisible.
   ========================================================= */

.wsc {
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(2rem, 4vw, 3rem);
}

/* ===== Head: title ===== */
.wsc-head {
  max-width: var(--container);
  margin: 0 auto 1.75rem;
  padding: 0 1.5rem;
}

/* ===== Bleed: full viewport width, clips overflow, soft edge fades ===== */
.wsc-bleed {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
}

/* ===== Track: continuous marquee =====
   Same trick as .ticker-track: the 20-slide set is repeated in the
   markup, so translating by exactly one set width lands on an
   identical pixel pattern -> seamless loop.
   --wsc-sets must match the repeat count in build_carousel.py. */
.wsc-track {
  display: flex;
  gap: clamp(0.9rem, 1.6vw, 1.4rem);
  width: max-content;
  margin: 0;
  padding: 0.5rem 0;
  list-style: none;
  will-change: transform;        /* own compositor layer = smooth scroll */
  backface-visibility: hidden;
  animation: wsc-scroll 90s linear infinite;
}

/* Note: deliberately does NOT pause on hover/focus — the strip is a
   continuous background motion, not something to be inspected in place. */

@keyframes wsc-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(calc(-100% / var(--wsc-sets, 4)), 0, 0); }
}

.wsc-slide {
  flex: 0 0 auto;
  width: clamp(190px, 21vw, 300px);
}

/* Respect visitors who asked for less motion: stop it dead. */
@media (prefers-reduced-motion: reduce) {
  .wsc-track { animation: none; }
}

/* ===== Card ===== */
.wsc-card {
  display: block;
  position: relative;
  background: var(--surface);
  border: var(--border-1);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.wsc-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 rgba(105, 159, 71, 0.5);
}

/* 9:16 box — the screenshot fills it exactly, no distortion */
.wsc-card picture {
  display: block;
  aspect-ratio: 9 / 16;
  background: var(--bg);
}

.wsc-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* ===== Caption ===== */
.wsc-caption {
  display: block;
  padding: 0.7rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--navy);
  border-top: 1px solid var(--border);
  transition: color 0.25s var(--ease);
}

.wsc-card:hover .wsc-caption {
  color: var(--green-dark);
}

/* Note: dot/counter styles were removed when the track became a
   continuously scrolling marquee (there is no discrete "active" slide). */

.wsc-count-sep {
  margin: 0 0.25rem;
  opacity: 0.5;
}

/* =========================================================
   GRID VARIANT (used on web-service.html)
   Same cards, laid out as a responsive grid instead of a
   scroll-snap row: 2 columns on phones, 4 on desktop.
   ========================================================= */

.wsc-grid-wrap .wsc-head {
  text-align: center;
  margin-bottom: 2rem;
}

.wsc-grid {
  /* container width, 2-up on phones by default */
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
  list-style: none;

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
}

/* 4-up on desktop */
@media (min-width: 900px) {
  .wsc-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(1rem, 1.8vw, 1.5rem);
  }
}

/* tablet: ease to 3 columns between phone and desktop */
@media (min-width: 560px) and (max-width: 899px) {
  .wsc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.wsc-cell {
  min-width: 0;          /* let images shrink inside the grid track */
}

/* Tighten captions a little in the denser grid */
.wsc-grid .wsc-caption {
  padding: 0.6rem 0.7rem;
  font-size: 0.74rem;
  text-align: center;
}

.wsc-grid .wsc-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 rgba(105, 159, 71, 0.5);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .wsc-slide { width: clamp(180px, 30vw, 250px); }
}

@media (max-width: 640px) {
  .wsc-slide { width: clamp(160px, 46vw, 210px); }
  .wsc-bleed {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 18px, #000 calc(100% - 18px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wsc-track { scroll-behavior: auto; }
  .wsc-card { transition: none; }
  .wsc-card:hover { transform: none; }
}
