/* Home page only. */

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 40px;
  padding: clamp(20px, 3vw, 40px) 24px clamp(24px, 3vw, 40px) 76px;
}
.hero__text {
  flex: 1 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hero h1 {
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
}
.hero__small {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey);
}
.hero__big {
  display: block;
  font-size: clamp(30px, 4.2vw, 56px);
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero__intro {
  font-size: clamp(16px, 1.3vw, 19px);
  max-width: 640px;
}
.hero__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Each section has a sticky icon in the 60px strip on the left. */
.home-section {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  animation: rise-in 0.8s var(--ease) backwards;
}
@supports (animation-timeline: view()) {
  #design,
  #video {
    animation: rise-in linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }
}
.section-body {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.section-link {
  display: flex;
  justify-content: flex-end;
  padding: 28px 24px;
}

/* Photo gallery: 6 columns (4 on tablets, 2 on phones). Each column holds
   4 photos stacked; the top one wipes across to reveal the next.
   Hover or tap a column to pause and widen it to the photo's full shape. */
.gallery {
  --n: 6;
  --gh: clamp(340px, 40vw, 560px);
  position: relative;
  isolation: isolate;
  display: flex;
  height: var(--gh);
  background: #111;
  overflow: hidden;
}
.gallery__col {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
  cursor: pointer;
  flex: 0 1 calc(100% / var(--n));
  transition: flex-basis 0.75s var(--ease);
  outline-offset: -3px;
}
.gallery__col img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-clip-path: inset(0 100% 0 0);
  clip-path: inset(0 100% 0 0);
  will-change: clip-path;
  z-index: 0;
}
.gallery__col img.is-under {
  -webkit-clip-path: inset(0 0 0 0);
  clip-path: inset(0 0 0 0);
  z-index: 1;
}
.gallery__col img.is-top {
  -webkit-clip-path: inset(0 0 0 0);
  clip-path: inset(0 0 0 0);
  z-index: 2;
  transition:
    -webkit-clip-path 2.2s cubic-bezier(0.65, 0, 0.25, 1),
    clip-path 2.2s cubic-bezier(0.65, 0, 0.25, 1);
}
.gallery__col img.is-instant {
  transition: none !important;
}
@media (max-width: 1100px) {
  .gallery {
    --n: 4;
  }
  .gallery__col:nth-child(n + 5) {
    display: none;
  }
}
@media (max-width: 700px) {
  .gallery {
    --n: 2;
  }
  .gallery__col:nth-child(n + 3) {
    display: none;
  }
}

/* Design tiles */
.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(max(240px, 30%), 100%), 1fr));
}
.design-grid a {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 688 / 540;
  background: #000;
  padding: clamp(24px, 10%, 44px);
  transition: filter 0.4s;
}
@media (min-width: 900px) {
  .design-grid a {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .design-grid a:not(:nth-child(3n)) {
    border-right: 1px solid var(--line);
  }
}
.design-grid a:hover {
  filter: brightness(1.15);
}
.design-grid img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  display: block;
  transition: transform 0.7s var(--ease);
}
.design-grid a:hover img {
  transform: scale(1.05);
}
.design-grid a.design-tile--bleed {
  padding: 0;
}
.design-grid a.design-tile--bleed img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
}

/* Video slider */
.video-window {
  position: relative;
  overflow: hidden;
  overscroll-behavior-x: contain;
}
.video-track {
  --vn: 2;
  display: flex;
  transition: transform 0.9s cubic-bezier(0.77, 0, 0.18, 1);
}
.video-track.no-anim {
  transition: none;
}
@media (max-width: 900px) {
  .video-track {
    --vn: 1;
  }
}
.video-item {
  flex: 0 0 calc(100% / var(--vn));
  padding: 0 4px;
  opacity: 1;
}
.video-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 16 / 9;
  padding: clamp(16px, 2vw, 28px);
  overflow: hidden;
  color: var(--white);
  background-color: #141414;
}
/* Edge-only scrim keeps top/bottom text sharp without hazing the middle of the frame. */
.video-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.52) 0%,
    rgba(0, 0, 0, 0.05) 36%,
    rgba(0, 0, 0, 0.08) 62%,
    rgba(0, 0, 0, 0.82) 100%
  );
  transition: opacity 0.35s;
}
.video-card.is-playing::before {
  opacity: 0;
}
/* The thumbnail sits behind the scrim, kept vivid and punchy on both dark and light mode. */
.video-card__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.78) contrast(1.06) saturate(1.06);
  transition:
    filter 0.4s,
    transform 0.6s;
}
.video-item.is-current .video-card__thumb,
.video-card:hover .video-card__thumb {
  filter: brightness(0.92) contrast(1.08) saturate(1.12);
}
.video-card:hover .video-card__thumb {
  transform: scale(1.03);
}
.video-card__num {
  position: absolute;
  right: -0.06em;
  bottom: -0.22em;
  z-index: 1;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: clamp(120px, 16vw, 240px);
  line-height: 1;
  color: rgba(255, 255, 255, 0.07);
}
.video-card__top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}
.video-card__bottom {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.video-card__title {
  max-width: 80%;
  font-size: clamp(20px, 2.2vw, 32px);
  font-weight: 300;
  line-height: 1.15;
}
.video-card__play {
  flex: none;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--white);
  transition:
    background-color 0.3s,
    color 0.3s;
}
.video-card:hover .video-card__play {
  background: var(--white);
  color: var(--charcoal);
}
/* In-place video player (js/player.js) */
.video-card.is-playing {
  padding: 0;
  background: #000 !important;
  display: block;
}
.video-timer {
  height: 1px;
  margin: 8px 4px 0;
  background: rgba(255, 255, 255, 0.18);
}
.video-timer div {
  height: 100%;
  width: 100%;
  background: var(--white);
  /* Grown with a stretch (scaleX, set in public/js/pages/home.js) rather than its width: a stretch needs no
     re-layout, and the bar changes every frame. */
  transform: scaleX(0);
  transform-origin: left center;
}
.video-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px 28px 4px;
}
.video-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}
.video-buttons button {
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.video-arrow {
  width: 32px;
}
.video-pip {
  width: 20px;
}
.video-pip span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6a6a6a;
  transition:
    background-color 0.3s,
    transform 0.3s;
}
.video-pip[aria-current='true'] span {
  background: var(--white);
  transform: scale(1.25);
}
.video-buttons button:hover span {
  transform: scale(1.5);
}

/* Clients */
.clients {
  padding: 56px 24px 24px 76px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}
.clients h2 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 24px;
}
.clients__list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  font-size: 18px;
}
.clients__list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  transition: opacity 0.3s;
}
.clients__list a:hover {
  opacity: 0.7;
}

body.light .hero-nav {
  background: rgba(248, 248, 246, 0.88);
}
body.light .vp__num {
  color: rgba(35, 35, 35, 0.06);
}
body.light .vp__title {
  color: rgba(35, 35, 35, 0.7);
}
body.light .video-timer {
  background: rgba(35, 35, 35, 0.14);
}
body.light .video-timer div {
  background: var(--charcoal);
}
body.light .video-buttons button {
  color: var(--charcoal);
}
body.light .video-pip span {
  background: #b8b8b8;
}
body.light .video-pip[aria-current='true'] span {
  background: var(--charcoal);
}
