/*
 * Project overrides. Kept out of public/webflow/css so a future Webflow sync does not
 * wipe them. Loaded after the Webflow stylesheets (see BaseLayout.astro).
 */

/* /for-investors: left-align the hero text block to the container's content edge. */
.about-section.investors .blog-section-title-wrap.center {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}
.about-section.investors .about-short-text {
  margin-left: 0;
  margin-right: 0;
}

/* Homepage blog section: card images in full colour, as on the article pages. */
.home-blog .image-2 {
  filter: none;
}

/* Desktop: the three cards sit centred as a group (equal gaps, symmetric margins). */
@media (min-width: 992px) {
  .home-blog .take-listing {
    justify-content: safe center;
  }
}

/*
 * Homepage "Many disciplines. One studio." tiles: 3D flip cards (see /js/service-flip.js),
 * modelled on codepen.io/travisw/pen/VGzGye. Both faces show the same photo, unblurred and
 * the right way round; only the text differs. The title sits at the same height on both
 * faces (--tile-title-top), so it stays put while the card turns; on the back the
 * one-liner slides up and fades in under it.
 */
.home-services .flip-card {
  container-type: inline-size;
  perspective: 1000px;
  overflow: visible;
  cursor: pointer;
  outline-offset: 4px;
  -webkit-tap-highlight-color: transparent;
  --tile-pad: 6cqw;
  /* Title ends just below the rule-of-thirds line (client): 70% down. Lower than ~70% and
     the two-line one-liners (Series, Brand Films, Advisory) reach the tile's bottom edge. */
  --tile-title-top: 70%;
  /* 1.2s (was 0.7s): client asked for half a second slower, smooth start and finish. */
  --tile-flip: 1.2s cubic-bezier(0.65, 0, 0.35, 1);
}
.home-services .flip-inner {
  position: relative;
  display: grid;
  transform-style: preserve-3d;
  transition: transform var(--tile-flip);
}
.home-services .flip-face {
  grid-area: 1 / 1;
  position: relative;
  aspect-ratio: 16 / 9;
  container-type: inline-size;
  /* No overflow clipping here: it would flatten the 3D depth of the text. */
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.home-services .flip-front > img,
.home-services .flip-back-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* In a 3D (preserve-3d) face, backface-visibility on the face does not hide its children,
   so every layer hides itself when it faces away; otherwise the two faces' photos fight. */
.home-services .flip-face > img,
.home-services .flip-front .div-block-8,
.home-services .flip-glass {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.home-services .flip-back {
  transform: rotateY(180deg);
}
/* Same bottom shade on both faces (Webflow's front gradient), so text stays readable. */
.home-services .flip-front .div-block-8,
.home-services .flip-glass {
  position: absolute;
  inset: 0;
  height: auto;
  padding: 0;
  display: block;
  background: linear-gradient(rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.8));
  transform-style: preserve-3d;
}
/* Text floats in front of the photo, as in the CodePen (translateZ + slight scale-down). */
.home-services .flip-front .text-block-5,
.home-services .flip-title,
.home-services .flip-line {
  position: absolute;
  left: var(--tile-pad);
  right: var(--tile-pad);
  margin: 0;
  color: #fff;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
/* Titles: 25% smaller than before (was clamp(22px, 9cqw, 40px)); identical on both faces.
   The h3 carries the position (Webflow's reveal-1 animation writes inline transforms on
   the front h3), and its inner element carries the 3D float. */
.home-services .flip-front .text-block-5,
.home-services .flip-title {
  top: var(--tile-title-top);
  display: block;
  transform-style: preserve-3d;
  font-family: var(--font-family--oswald);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  font-size: clamp(16.5px, 6.75cqw, 30px);
  white-space: nowrap;
}
.home-services .flip-front .text-block-5 > div,
.home-services .flip-title > span {
  display: block;
  transform: translateY(-100%) translateZ(40px) scale(0.94);
  transform-origin: left bottom;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.home-services .flip-line {
  top: calc(var(--tile-title-top) + 2cqw);
  font-family: var(--font-family--mulish);
  font-weight: 300;
  line-height: 1.3;
  font-size: clamp(11px, 4.6cqw, 24px);
  transform: translateZ(40px) scale(0.94) translateY(1.2em);
  transform-origin: left top;
  opacity: 0;
  transition: opacity 0.7s ease, transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.home-services .flip-card.is-flipped .flip-inner,
.home-services .flip-card:focus-visible .flip-inner {
  transform: rotateY(180deg);
}
.home-services .flip-card.is-flipped .flip-line,
.home-services .flip-card:focus-visible .flip-line {
  opacity: 1;
  transform: translateZ(40px) scale(0.94);
  transition-delay: 0.55s;
}
@media (hover: hover) {
  .home-services .flip-card:hover .flip-inner {
    transform: rotateY(180deg);
  }
  .home-services .flip-card:hover .flip-line {
    opacity: 1;
    transform: translateZ(40px) scale(0.94);
    transition-delay: 0.55s;
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-services .flip-inner,
  .home-services .flip-card.is-flipped .flip-inner,
  .home-services .flip-card:focus-visible .flip-inner,
  .home-services .flip-card:hover .flip-inner {
    transform: none;
    transition: none;
  }
  .home-services .flip-back {
    transform: none;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .home-services .flip-card.is-flipped .flip-back,
  .home-services .flip-card:focus-visible .flip-back {
    opacity: 1;
  }
  @media (hover: hover) {
    .home-services .flip-card:hover .flip-back {
      opacity: 1;
    }
  }
  .home-services .flip-line {
    transition: none;
  }
}

/*
 * Homepage "A Development-First Studio": centred like a document, all Oswald.
 */
.dev-first {
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  align-items: center;
  text-align: center;
}
.dev-first .div-block-31 {
  justify-content: center;
  align-items: center;
  width: 100%;
  text-align: center;
}
.dev-first > div {
  width: 100%;
}
/*
 * Sizes follow the client's deck (heading 45 : bold line 25 : paragraph 22 : last line 25),
 * scaled with the viewport: --df-h is the heading size, the rest keep the deck's ratios.
 */
.dev-first {
  --df-h: clamp(30px, 3.9vw, 56px);
}
/* Heading: same size as the other section headings (Webflow's .text-block-2: 60px,
   48px under 768px, 40px under 480px), so it matches "Many disciplines. One studio.". */
.dev-first .text-block-2 {
  text-align: center;
}
/* Smallest phones (~320px): "DEVELOPMENT-FIRST" is one word and is ~299px wide at 40px,
   so it would break mid-word; shrink just enough to keep it whole. */
@media screen and (max-width: 479px) {
  .dev-first .text-block-2 { font-size: min(40px, 11.5vw); }
}
/* Holds the bold line and the last line (25/45 of the heading). */
.dev-first .text-block-3 {
  text-align: center;
  font-family: var(--font-family--oswald);
  font-weight: 400;
  font-size: calc(var(--df-h) * 0.556);
  letter-spacing: 0;
}
.dev-first .bold-text-4 {
  font-family: var(--font-family--oswald);
  font-weight: 600;
}
/* Paragraph: same face and size as the founder bio (.text-block-7): Mulish Light,
   22px, 20px under 992px, 18px under 480px. */
.dev-first .dev-first-body {
  font-family: var(--font-family--mulish);
  font-weight: 300;
  font-style: normal;
  font-size: 22px;
}
@media screen and (max-width: 991px) {
  .dev-first .dev-first-body { font-size: 20px; }
}
@media screen and (max-width: 479px) {
  .dev-first .dev-first-body { font-size: 18px; }
}
/* Phones: "PLATFORM AGNOSTIC. FORMAT AGNOSTIC. OPPORTUNITY OBSESSED." on one line. */
@media screen and (max-width: 767px) {
  .dev-first .dev-first-tagline {
    display: inline-block;
    white-space: nowrap;
    font-size: min(1em, 3.55vw);
  }
}

/* "Inviting your voice to our story" (and the other call-to-action titles): same size as
   the section headings, e.g. "Things we think about between takes". */
.cta-section .section-title {
  font-size: 60px;
  line-height: var(--line-height--line-height-m);
  letter-spacing: -3px;
}
@media screen and (max-width: 767px) {
  .cta-section .section-title { font-size: 48px; }
}
@media screen and (max-width: 479px) {
  .cta-section .section-title { font-size: 40px; letter-spacing: -2px; }
}

/* Founder heading: on phones "THE FOUNDER," / "SONALI DATTA" on two lines. */
.founder-heading .founder-name { white-space: nowrap; }
.founder-heading .founder-br { display: none; }
@media (max-width: 767px) {
  .founder-heading .founder-br { display: inline; }
}

/*
 * /for-investors: hero text sits higher in the dark area, and the blurred bracket frame is
 * static behind it (no cursor tracking; see the .investors guard in site-animations.js).
 */
.about-section.investors .blog-section-title-wrap.center {
  flex: none; /* hug the text so the frame can too */
  width: fit-content;
  max-width: 100%;
  --inv-pad-top: 25vh; /* was 40vh: up by 15% of the viewport height */
  padding-top: var(--inv-pad-top);
}
.about-section.investors .about-shape-wrap {
  display: block;
  position: absolute;
  /* The wrap's padding-top is empty space, so start the frame below it. */
  inset: calc(var(--inv-pad-top, 0px) - 28px) -32px -28px -32px;
  transform: none !important;
  pointer-events: none;
}
.about-section.investors .about-inner-shape {
  width: 100%;
  height: 100%;
  padding: 0;
}
@media screen and (max-width: 767px) {
  .about-section.investors .about-shape-wrap {
    inset: calc(var(--inv-pad-top, 0px) - 20px) -10px -20px -10px;
  }
  .about-section.investors .blog-section-title-wrap.center {
    --inv-pad-top: 0px;
    top: -280px; /* section is 600px tall here: lifts the block into the dark area under the navbar */
  }
}

/* Service tiles: the Webflow template fixes .div-block-6 at 360px tall on small screens,
   which left a black gap under the 16:9 images. Let the tile size to its 16:9 face. */
.home-services .div-block-6.flip-card {
  height: auto;
  min-height: 0;
}
.home-services .div-block-5 {
  grid-auto-rows: auto;
  grid-template-rows: none;
}
