/*
 * What We Do page.
 *
 * Figma "What We Do" is a 5468px wide artboard. From 1024px up, sizes below are
 * the Figma values multiplied by --nri-u (= 100vw / 5468), the same scale the
 * Home (New) page uses: a 1900px viewport gets Figma x 0.3475 (the 108px
 * headings render at ~37.5px, the 157px hero at ~54.6px). max() keeps text
 * readable on narrower desktops. Below 1024px the page stacks and uses fixed
 * tablet / mobile sizes.
 *
 * Body copy is set larger than the Figma scale for readability: 46 x --nri-u =
 * 16px at 1900px (Figma 36px would be 12.5px), 14px floor on narrower desktops.
 * Change the 46 in the three body rules to tune it.
 */
:root {
  --nri-u: calc(100vw / 5468);
  --nri-sans: "Helvetica Neue", Helvetica, Arial, sans-serif; }

.wwd {
  --wwd-peach: #fff5ec;
  --wwd-accent: #ffd6b9;
  --wwd-body-min: 14px;
  overflow: hidden;
  font-family: var(--nri-sans);
  color: #000;
  background: #fff; }
  .wwd *,
  .wwd *:before,
  .wwd *:after {
    box-sizing: border-box; }
  /* :where() keeps this reset at zero specificity so the single-class rules below can set margins */
  .wwd :where(h1, h2, h3, p, ul) {
    margin: 0;
    padding: 0;
    font-family: inherit; }
  .wwd :where(ul) {
    list-style: none; }
  .wwd img {
    display: block;
    max-width: none; }

/* Shared: a photo that fills its box */
.wwd-hero__img,
.wwd-mission__img,
.wwd-split__img,
.wwd-card__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; }

/* ------------------------------------------------------------------
   Hero  (mobile first)
   ------------------------------------------------------------------ */
.wwd-hero {
  /* Never taller than the screen: viewport height minus the 95px menu bar */
  --wwd-hero-max: calc(100vh - 95px);
  position: relative;
  width: 100%; /* fixed width: otherwise max-height would also shrink the width through aspect-ratio */
  aspect-ratio: 4 / 3;
  min-height: min(300px, var(--wwd-hero-max));
  max-height: var(--wwd-hero-max);
  overflow: hidden;
  background: #1b1b1b; }
  @supports (height: 100svh) {
    .wwd-hero {
      --wwd-hero-max: calc(100svh - 95px); } }
  /* Even tint so the centred headline reads on any photo */
  .wwd-hero:after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.3); }

/* Headline sits in the middle of the banner, both ways */
.wwd-hero__title {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 20px;
  left: 20px;
  transform: translateY(-50%);
  font-size: clamp(26px, 8vw, 40px);
  font-weight: 700;
  font-style: italic;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  color: #fff; }

.wwd-hero__line {
  display: block; }
  .wwd-hero__line_accent {
    color: var(--wwd-accent); }

/* ------------------------------------------------------------------
   Mission
   ------------------------------------------------------------------ */
.wwd-mission {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
  padding: 72px 24px;
  overflow: hidden;
  color: #fff;
  background: #2b2b2b; }
  .wwd-mission:before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.32); }

.wwd-mission__img {
  object-position: center bottom; }

.wwd-mission__text {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 760px;
  font-size: 18px;
  line-height: 1.5;
  text-align: center; }
  .wwd-mission__text p + p {
    margin-top: 1.5em; }

.wwd-mission__lead {
  font-weight: 700; }

/* ------------------------------------------------------------------
   Partnership + Housing: photo / text, stacked on small screens
   ------------------------------------------------------------------ */
.wwd-split {
  display: flex;
  flex-direction: column;
  margin-top: 40px; }

/* Photo always comes first when stacked (Housing lists its text first for desktop) */
.wwd-split__media {
  position: relative;
  order: -1;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #e9e4de; }

.wwd-split__body {
  padding: 32px 24px 8px; }

.wwd-split__title {
  margin-bottom: 20px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15; }

.wwd-split__content p,
.wwd-card__text p {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75; }
  .wwd-split__content p + p,
  .wwd-card__text p + p {
    margin-top: 1em; }

/* ------------------------------------------------------------------
   Our Approach in Action
   ------------------------------------------------------------------ */
.wwd-approach {
  margin-top: 48px;
  padding: 56px 20px 64px;
  background: var(--wwd-peach); }

.wwd-approach__title {
  margin-bottom: 32px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2; }

.wwd-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px; }

.wwd-card {
  min-width: 0; }

.wwd-card__link {
  display: block;
  color: inherit; }

.wwd-card__media {
  position: relative;
  display: block;
  aspect-ratio: 2466 / 1593;
  overflow: hidden;
  background: #e9dccf; }

.wwd-card__title {
  margin-top: 22px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.22; }

.wwd-card__meta {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6; }

.wwd-card__text {
  margin-top: 14px; }
  .wwd-card__text p {
    font-size: 16px; }

/* Tablet: cards in two columns, bigger type */
@media screen and (min-width: 768px) {
  .wwd-hero {
    aspect-ratio: 16 / 9; }
  .wwd-hero__title {
    right: 40px;
    left: 40px;
    font-size: clamp(34px, 6vw, 56px); }

  .wwd-mission {
    margin-top: 32px;
    padding: 110px 48px; }
  .wwd-mission__text {
    font-size: 22px; }

  .wwd-split {
    margin-top: 56px; }
  .wwd-split__body {
    padding: 44px 48px 8px; }
  .wwd-split__title {
    margin-bottom: 26px;
    font-size: 36px; }
  .wwd-split__content p,
  .wwd-card__text p {
    font-size: 18px; }

  .wwd-approach {
    margin-top: 72px;
    padding: 80px 40px 88px; }
  .wwd-approach__title {
    margin-bottom: 44px;
    font-size: 40px; }
  .wwd-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 56px 32px; }
  .wwd-card__title {
    font-size: 30px; }
  .wwd-card__meta {
    font-size: 16px; }
  .wwd-card__text p {
    font-size: 16px; } }

/* ------------------------------------------------------------------
   Desktop: the Figma artboard, scaled with --nri-u
   ------------------------------------------------------------------ */
@media screen and (min-width: 1024px) {

  /* Hero: photo 5472 x 2497, headline starts at the horizontal middle. At the Figma
     ratio it is exactly the design; on a short window it is cut to fit the screen. */
  .wwd-hero {
    aspect-ratio: 5472 / 2497;
    min-height: 0; } /* max-height from above still applies: banner + menu bar never exceed the screen */
    .wwd-hero:after {
      display: none; }
  .wwd-hero__title {
    right: auto;
    bottom: auto;
    top: min(calc(1093 * var(--nri-u)), 45%); /* Figma position; keeps the text inside if the banner is capped short */
    left: 50%;
    transform: none;
    text-align: left;
    width: calc(2601 * var(--nri-u));
    font-size: max(28px, calc(157 * var(--nri-u)));
    line-height: 1.2; }

  /* Mission: 169 below the hero, photo 5472 x 2497, text block 3245 wide, 903 down */
  .wwd-mission {
    align-items: flex-start;
    margin-top: calc(169 * var(--nri-u));
    padding: calc(903 * var(--nri-u)) 24px calc(543 * var(--nri-u));
    aspect-ratio: 5472 / 2497; }
  .wwd-mission__text {
    width: calc(3245 * var(--nri-u));
    max-width: none;
    font-size: max(16px, calc(72 * var(--nri-u)));
    line-height: 1.6277; } /* Figma 135.64% of the 1.2 natural line box */
    .wwd-mission__text p + p {
      margin-top: 1.6277em; }

  /* Partnership + Housing: two columns 2749 | 2719, copy columns 1480 wide */
  .wwd-split {
    --wwd-copy: max(calc(1480 * var(--nri-u)), 300px);
    display: grid;
    grid-template-columns: 2749fr 2719fr;
    align-items: start;
    margin-top: 0; }
  .wwd-split__media {
    order: 0; }
  .wwd-split__body {
    width: 100%;
    padding: 0; }
  .wwd-split__title {
    max-width: max(calc(1567 * var(--nri-u)), 340px);
    margin-bottom: calc(var(--wwd-gap) * var(--nri-u));
    font-size: max(26px, calc(108 * var(--nri-u)));
    line-height: 1.2222; }
  .wwd-split__content {
    max-width: var(--wwd-copy); }
  .wwd-split__content p {
    font-size: max(var(--wwd-body-min), calc(46 * var(--nri-u)));
    line-height: 1.9; }
    .wwd-split__content p + p {
      margin-top: 1.9em; }

  /* Partnership: photo 2749 x 2016 on the left, copy 608 in and 462 down.
     310 below the mission. */
  .wwd-split_partnership {
    --wwd-gap: 112;
    margin-top: calc(310 * var(--nri-u)); }
    .wwd-split_partnership .wwd-split__media {
      aspect-ratio: 2749 / 2016; }
    .wwd-split_partnership .wwd-split__body {
      padding: calc(462 * var(--nri-u)) 24px 0 calc(608 * var(--nri-u)); }

  /* Housing: copy 542 in and 477 down on the left, photo 2719 x 2016 on the right.
     628 below the partnership photo. */
  .wwd-split_housing {
    --wwd-gap: 135;
    margin-top: calc(628 * var(--nri-u)); }
    .wwd-split_housing .wwd-split__media {
      aspect-ratio: 2719 / 2016; }
    .wwd-split_housing .wwd-split__body {
      padding: calc(477 * var(--nri-u)) 24px 0 calc(542 * var(--nri-u)); }

  /* Approach: peach band 279 below the housing photo. Heading 191 in and 475 down,
     cards 2466 wide with a 149 gutter, 397 between rows, 223 at the bottom. */
  .wwd-approach {
    margin-top: calc(279 * var(--nri-u));
    padding: calc(475 * var(--nri-u)) calc(196 * var(--nri-u)) calc(223 * var(--nri-u)) calc(191 * var(--nri-u)); }
  .wwd-approach__title {
    margin-bottom: calc(266 * var(--nri-u));
    font-size: max(30px, calc(138 * var(--nri-u)));
    line-height: 1.2; }
  .wwd-cards {
    column-gap: calc(149 * var(--nri-u));
    row-gap: calc(397 * var(--nri-u)); }

  .wwd-card__title {
    margin-top: calc(96 * var(--nri-u));
    font-size: max(26px, calc(108 * var(--nri-u)));
    line-height: 1.2222; }
  .wwd-card__meta {
    margin-top: calc(39 * var(--nri-u));
    font-size: max(var(--wwd-body-min), calc(46 * var(--nri-u)));
    line-height: 1.9; }
  .wwd-card__text {
    max-width: max(calc(var(--wwd-card-copy, 1800) * var(--nri-u)), 300px);
    margin-top: calc(143 * var(--nri-u)); }
    .wwd-card__text p {
      font-size: max(var(--wwd-body-min), calc(46 * var(--nri-u)));
      line-height: 1.9; }
      .wwd-card__text p + p {
        margin-top: 1.9em; }

  /* The Figma text boxes differ in width card by card; follow them so lines wrap the same way */
  .wwd-card:nth-child(4n + 1) {
    --wwd-card-copy: 1772; }
  .wwd-card:nth-child(4n + 2) {
    --wwd-card-copy: 1896; }
  .wwd-card:nth-child(4n + 3) {
    --wwd-card-copy: 1748; }
  .wwd-card:nth-child(4n + 4) {
    --wwd-card-copy: 1480; } }

/* ------------------------------------------------------------------
   Scroll animation (js/what-we-do.js)
   The hidden start state only exists under html.wwd-js, set in the <head>, so the page
   stays fully visible without JavaScript. Same motion as the site's .out / .in classes.
   ------------------------------------------------------------------ */
html.wwd-js [data-wwd-reveal] {
  opacity: 0;
  transform: translate3d(0, 40px, 0);
  transition: transform 0.8s cubic-bezier(0.25, 0.11, 0.11, 0.82) var(--wwd-delay, 0s), opacity 0.8s ease-in-out var(--wwd-delay, 0s); }
  html.wwd-js [data-wwd-reveal].is-in {
    opacity: 1;
    transform: translate3d(0, 0, 0); }

/* Photos settle from a slight zoom. At rest they are exactly the Figma crop. */
html.wwd-js [data-wwd-media] img {
  transform: scale(1.07);
  transition: transform 1.6s cubic-bezier(0.25, 0.11, 0.11, 0.82), opacity 1s ease-in-out; }
  html.wwd-js [data-wwd-media].is-in img {
    transform: scale(1); }

/* Split and card photos also fade in over their placeholder colour (hero and mission have no fade) */
html.wwd-js .wwd-split__media img,
html.wwd-js .wwd-card__media img {
  opacity: 0; }
  html.wwd-js .wwd-split__media.is-in img,
  html.wwd-js .wwd-card__media.is-in img {
    opacity: 1; }

/* Hero headline: pure CSS, starts at first paint (no waiting for scripts or images) */
@keyframes wwd-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 24px, 0); }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0); } }

html.wwd-js .wwd-hero__line {
  animation: wwd-rise 0.55s cubic-bezier(0.25, 0.11, 0.11, 0.82) both; }
  html.wwd-js .wwd-hero__line_accent {
    animation-delay: 0.1s; }

@media (prefers-reduced-motion: reduce) {
  html.wwd-js .wwd-hero__line {
    animation: none !important; }
  html.wwd-js [data-wwd-reveal],
  html.wwd-js [data-wwd-media] img {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important; } }
