/* Homepage layout from the approved Shopify design. */
:root {
  --cw-home-ink: #0b1738;
  --cw-home-link: #007698;
  --cw-home-lime: #b3e400;
  --cw-home-edge: #dce6ec;
  --cw-home-inset: max(clamp(18px, 4.35vw, 64px), calc((100% - 1280px) / 2));
}

.cw-header.cw-header-light,
body.home .cw-header {
  max-width: none;
  min-height: clamp(60px, 6vw, 84px);
  padding-block: 5px;
  padding-inline: var(--cw-home-inset);
}

.cw-header.cw-header-light .wp-block-site-logo img,
body.home .cw-header .wp-block-site-logo img {
  width: clamp(150px, 16vw, 216px);
}

.cw-header.cw-header-light .wp-block-button__link,
body.home .cw-header .wp-block-button__link {
  padding: .66em .95em;
  background: #fff;
  color: var(--cw-home-ink);
  border: 1px solid #b8c9d8;
  border-radius: 7px;
}

.cw-header-light .wp-block-button__link::after,
.cw-home .cw-home-hero .wp-block-button:first-child a::after,
.cw-home .cw-home-quote .wp-block-button__link::after {
  content: " ↗";
  margin-inline-start: .4em;
}

.cw-home.cw-main {
  max-width: none;
  margin: 0;
  padding: 0;
  color: var(--cw-home-ink);
  background: #fff;
}

.cw-home > .wp-block-group { margin-block: 0; }
.cw-home :is(h1, h2, h3) { color: var(--cw-home-ink); }

.cw-home-hero {
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
  align-items: center;
  column-gap: clamp(12px, 2vw, 30px);
  min-height: clamp(360px, 40vw, 570px);
  padding-block: clamp(13px, 1.7vw, 26px);
  padding-inline: var(--cw-home-inset);
  background: linear-gradient(125deg, #f7fbfd 3%, #eff7fc 25%, #d6eaf8 72%);
}

.cw-home-hero::before {
  position: absolute;
  content: "";
  z-index: -1;
  inset: auto auto 0 0;
  width: 47%;
  height: 26%;
  background: url("homepage-hero-waves.jpg") left bottom / 100% 100% no-repeat;
  mask-image: linear-gradient(to bottom, transparent, #000 32%);
}

.cw-home-hero .cw-hero-copy { position: relative; z-index: 1; padding-block: 38px 52px; margin: 0; }
.cw-home-hero h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(2.45rem, 5.1vw, 4.55rem);
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: -.062em;
}

.cw-home-hero h1::after { display: none; }
.cw-home-hero h1 strong { color: var(--cw-home-link); font-weight: inherit; }
.cw-home-hero .cw-hero-copy > p {
  max-width: 44ch;
  margin: 16px 0 23px;
  color: var(--cw-home-ink);
  font-size: clamp(.98rem, 1.65vw, 1.3rem);
  line-height: 1.4;
}

.cw-home-hero .cw-hero-art {
  position: relative;
  z-index: 0;
  inset: auto;
  justify-self: center;
  width: 100%;
  margin: 0;
  overflow: hidden;
  mask-image: none;
  border-radius: 8px;
}

.cw-home-hero .cw-hero-art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 552 / 395;
  object-fit: cover;
  object-position: center;
}
.cw-home-hero .wp-block-buttons { gap: 10px 23px; }
.cw-home .cw-home-hero .wp-block-button:first-child a,
.cw-home .cw-home-quote .wp-block-button__link {
  padding: .75em 1.1em;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--cw-home-lime);
  color: var(--cw-home-ink);
  font-size: clamp(.84rem, 1.4vw, 1rem);
  font-weight: 750;
  line-height: 1.2;
}

.cw-home .cw-home-hero .wp-block-button:nth-child(2) a,
.cw-home .cw-work-heading .wp-block-button a {
  padding: .75em 0;
  border: 0;
  background: transparent;
  color: var(--cw-home-link);
  font-size: clamp(.84rem, 1.4vw, 1rem);
  font-weight: 730;
  line-height: 1.2;
}

.cw-home .cw-home-hero .wp-block-button:nth-child(2) a { color: var(--cw-home-ink); }
.cw-home .cw-home-hero .wp-block-button:nth-child(2) a::after { margin-inline-start: .6em; color: var(--cw-home-link); }
.cw-home .cw-work-heading .wp-block-button a::after { content: " ↗"; margin-inline-start: .4em; }

.cw-home.cw-main > :is(.cw-home-services, .cw-home-process, .cw-home-work) {
  padding: clamp(20px, 2.5vw, 37px) var(--cw-home-inset);
}

.cw-home :is(.cw-home-services, .cw-home-process, .cw-home-work) h2,
.cw-home .cw-home-quote h2,
.cw-home .cw-home-feature h2 {
  margin: 0;
  text-align: start;
  font-size: clamp(1.65rem, 3.15vw, 2.65rem);
  font-weight: 770;
  line-height: 1.1;
  letter-spacing: -.055em;
}

.cw-home .cw-section > h2::after { display: none; }
.cw-home.cw-main > :is(.cw-home-services, .cw-home-process) > h2 { margin: 0; }
.cw-home .cw-section-intro {
  display: flex;
  gap: clamp(11px, 2vw, 22px);
  align-items: baseline;
  margin: 5px 0 clamp(17px, 2.5vw, 28px);
  color: var(--cw-home-ink);
  font-size: clamp(.83rem, 1.3vw, .99rem);
  line-height: 1.4;
}

.cw-section-intro::before {
  content: "";
  flex: 0 0 clamp(23px, 4.9vw, 55px);
  height: 2px;
  background: #009dc3;
  align-self: start;
  margin-top: .55em;
}

.cw-home .cw-services { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 1.35vw, 19px); }
.cw-home .cw-card {
  box-sizing: border-box;
  position: relative;
  min-width: 0;
  min-height: clamp(168px, 18vw, 230px);
  padding: clamp(12px, 1.9vw, 24px) clamp(11px, 2.05vw, 24px) 31px;
  border: 1px solid var(--cw-home-edge);
  border-radius: 12px;
  box-shadow: none;
  background: #fafcfd;
}

.cw-home .cw-card:hover, .cw-home .cw-card:focus-within { border-color: #a9ccd8; }
.cw-home :is(.cw-card, .cw-step) .cw-icon {
  width: clamp(35px, 4.2vw, 55px);
  height: clamp(35px, 4.2vw, 55px);
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.cw-home .cw-card .cw-icon { margin: 0 0 .45rem; }
.cw-home .cw-card h3, .cw-home .cw-project h3 {
  margin: 0;
  font-size: clamp(.96rem, 1.65vw, 1.35rem);
  font-weight: 760;
  line-height: 1.15;
  letter-spacing: -.04em;
}

.cw-home :is(.cw-card, .cw-project) h3 a { color: inherit; text-decoration: none; }
.cw-home :is(.cw-card, .cw-project) h3 a:hover { color: var(--cw-home-link); }
.cw-home :is(.cw-card, .cw-project) h3 a::after {
  content: "→";
  position: absolute;
  inset: auto clamp(12px, 2vw, 26px) 10px auto;
  color: var(--cw-home-link);
  font-size: 1.16em;
  font-weight: 520;
}

.cw-home .cw-card p, .cw-home .cw-step p, .cw-home .cw-project p {
  margin: 5px 0 0;
  color: var(--cw-home-ink);
  font-size: clamp(.81rem, 1.26vw, .99rem);
  line-height: 1.28;
}

.cw-home .cw-home-feature {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(125px, .21fr) minmax(0, .79fr);
  align-items: center;
  gap: clamp(14px, 2.7vw, 38px);
  margin-inline: var(--cw-home-inset);
  padding: clamp(15px, 2vw, 28px) clamp(17px, 3.2vw, 43px);
  border-radius: 11px;
  background:
    radial-gradient(ellipse at 104% 125%, #e2f8bd 0 21%, transparent 42%),
    radial-gradient(ellipse at 97% -25%, #e1f6a0 0, transparent 24%),
    #f1f8f6;
}

.cw-home .cw-shopify-brand { margin: 0; width: min(100%, 200px); }
.cw-shopify-brand img { display: block; width: 100%; height: auto; }
.cw-home .cw-shopify-copy { margin: 0; border-inline-start: 1px solid #bdcdd2; padding-inline-start: clamp(14px, 2.55vw, 37px); }
.cw-home .cw-home-feature h2 { font-size: clamp(1.21rem, 2.32vw, 1.94rem); }
.cw-home .cw-shopify-copy > p { margin: 3px 0 12px; font-size: clamp(.83rem, 1.35vw, 1.06rem); line-height: 1.32; }
.cw-home .cw-shopify-points {
  display: flex;
  flex-wrap: wrap;
  gap: 6px clamp(8px, .92vw, 15px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cw-shopify-points li {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: clamp(.71rem, 1.08vw, .94rem);
  line-height: 1.25;
}

.cw-shopify-points li::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--cw-home-lime);
  color: #233600;
  font-size: .69rem;
  font-weight: 800;
}

.cw-home .cw-home-process { border-bottom: 1px solid var(--cw-home-edge); }
.cw-home .cw-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.cw-home .cw-step { min-width: 0; text-align: center; padding: 0 9px; }
.cw-home .cw-step + .cw-step { border-inline-start: 1px solid var(--cw-home-edge); }
.cw-home .cw-step:not(:last-child)::after { display: none; }
.cw-home .cw-step .cw-icon { float: none; margin: 0 auto .25rem; }
.cw-home .cw-step h3 {
  margin: 0;
  font-size: clamp(.9rem, 1.46vw, 1.16rem);
  font-weight: 750;
  letter-spacing: -.036em;
  text-transform: none;
}

.cw-home .cw-work-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 0 0 clamp(17px, 2.6vw, 30px);
}

.cw-home .cw-work-heading > * { margin: 0; }
.cw-home .cw-projects { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(11px, 2.25vw, 29px); }
.cw-home .cw-project {
  position: relative;
  overflow: hidden;
  border: 1px solid #e9eff2;
  border-radius: 10px;
  background: #f1f5f6;
  box-shadow: none;
  padding-bottom: 12px;
}

.cw-home .cw-project .cw-portfolio-image img { aspect-ratio: 2.05; object-fit: cover; object-position: top; }
.cw-home .cw-project h3, .cw-home .cw-project p { padding-inline: 16px 32px; }
.cw-home .cw-project h3 { padding-block: 10px 0; }

.cw-home .cw-home-quote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px clamp(18px, 3.6vw, 50px);
  margin: clamp(9px, 1.4vw, 22px) var(--cw-home-inset) clamp(30px, 4.6vw, 65px);
  padding: clamp(17px, 2.25vw, 32px) clamp(17px, 3.2vw, 43px);
  border-radius: 9px;
  background: #eaf5f2;
}

.cw-home .cw-home-quote :is(.cw-quote-copy, .wp-block-buttons) { margin: 0; }
.cw-home .cw-home-quote h2 { font-size: clamp(1.35rem, 2.48vw, 2.13rem); }
.cw-home .cw-quote-copy p { margin: 5px 0 0; font-size: clamp(.84rem, 1.35vw, 1.02rem); }

.cw-site-footer.cw-footer-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px var(--cw-home-inset);
}

.cw-site-footer.cw-footer-compact, body.home .cw-site-footer {
  background: #fff;
  color: var(--cw-home-ink);
  border-top: 1px solid var(--cw-home-edge);
}

.cw-footer-compact .wp-block-site-logo { margin: 0; }
.cw-footer-compact .wp-block-site-logo img { display: block; width: clamp(130px, 15vw, 188px); height: auto; }
.cw-footer-compact .cw-footer-links, .cw-footer-compact .cw-footer-links ul { margin: 0; }
.cw-footer-links ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px clamp(14px, 2.5vw, 37px);
  list-style: none;
  padding: 0;
}

.cw-footer-compact .cw-footer-links a, body.home .cw-site-footer :is(a, h2, p) { color: var(--cw-home-ink); }
.cw-footer-compact .cw-footer-links a { text-decoration: none; font-size: .88rem; }
.cw-footer-compact .cw-footer-links a:hover { text-decoration: underline; color: var(--cw-home-link); }

@media (max-width: 900px) {
  .cw-header.cw-header-light .wp-block-site-logo img, body.home .cw-header .wp-block-site-logo img { width: min(160px, 100%); }
}

@media (max-width: 760px) {
  .cw-home-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    min-height: 0;
    padding-block: 0 18px;
  }
  .cw-home-hero::before { display: none; }
  .cw-home-hero .cw-hero-copy { padding: 33px 0 0; }
  .cw-home-hero h1 { font-size: clamp(2rem, 8.65vw, 3.65rem); }
  .cw-home .cw-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .cw-home .cw-home-feature { grid-template-columns: 1fr; gap: 8px; }
  .cw-home .cw-shopify-brand { width: 117px; }
  .cw-home .cw-shopify-copy { padding: 0; border: 0; }
  .cw-home .cw-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 15px; }
  .cw-home .cw-step:nth-child(4) { border-inline-start: 0; }
  .cw-home .cw-projects { grid-template-columns: minmax(0, 1fr); }
  .cw-site-footer.cw-footer-compact { padding-block: 12px; }
}


/* Centre the last row while keeping all five portfolio cards equal. */
.cw-home .cw-projects-featured {
  --cw-project-gap: clamp(11px, 2.25vw, 29px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--cw-project-gap);
}

.cw-projects-featured > .cw-project {
  box-sizing: border-box;
  flex: 0 0 calc((100% - var(--cw-project-gap) * 2) / 3);
  min-width: 0;
}

.cw-home > .cw-home-work .cw-projects-featured {
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
}

.cw-home > .cw-home-work .cw-projects-featured > .cw-project {
  scroll-snap-align: start;
}

.cw-portfolio-enhanced { scrollbar-width: none; }
.cw-portfolio-enhanced::-webkit-scrollbar { display: none; }

.cw-portfolio-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  color: var(--cw-home-ink);
  font-size: .87rem;
}

.cw-portfolio-controls[hidden] { display: none; }

.cw-portfolio-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--cw-home-edge);
  border-radius: 8px;
  background: #fff;
  color: var(--cw-home-link);
  font: 1.25rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.cw-portfolio-controls button[aria-disabled="true"] {
  opacity: .46;
  cursor: default;
}

.cw-portfolio-controls button:not([aria-disabled="true"]):hover { background: #eff7fb; }

.cw-home .cw-projects-featured .cw-portfolio-image img {
  box-sizing: border-box;
  object-position: center;
}
.cw-home .cw-project-flawlessbloom .cw-portfolio-image img {
  object-fit: contain;
  background: #edf6f8;
}
.cw-home .cw-project-menocil .cw-portfolio-image img {
  object-fit: contain;
  background: #ebe7f6;
}
.cw-home .cw-project-cogniultra .cw-portfolio-image img {
  object-fit: contain;
  padding-block: 9px;
  background: #ecf5e9;
}
.cw-home .cw-project-peakerect .cw-portfolio-image img {
  object-fit: contain;
  background: #0d1210;
}

.cw-portfolio-page {
  box-sizing: border-box;
  max-width: 1440px;
  padding: clamp(26px, 4vw, 64px) var(--cw-home-inset);
}
.cw-portfolio-page > h1 {
  margin: 0 0 16px;
  color: var(--cw-home-ink);
  font-size: clamp(2rem, 4.8vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -.055em;
}
.cw-portfolio-list > h2 {
  margin: 0 0 19px;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 1.18;
}
.cw-portfolio-list .cw-projects-featured { margin-block-start: 0; }

@media (max-width: 760px) {
  .cw-projects-featured > .cw-project {
    flex-basis: calc((100% - var(--cw-project-gap)) / 2);
  }
}

@media (max-width: 520px) {
  .cw-projects-featured > .cw-project { flex-basis: 100%; }
}

/* Position the logo on the left in the theme and in saved header blocks. */
.cw-header > .cw-brand { order: 0; max-width: 100%; justify-self: start; }
.cw-header > .wp-block-navigation { order: 1; margin-inline-start: auto; }
.cw-header > .wp-block-buttons { order: 2; }
.cw-header > .cw-brand .wp-block-site-logo { max-width: 100%; }

.cw-services-menu > .wp-block-navigation__submenu-icon {
  color: var(--cw-home-link);
}

.cw-header .cw-services-menu > .wp-block-navigation-submenu__toggle {
  padding-block: 0;
  font-weight: 630;
  cursor: pointer;
}

.cw-header .wp-block-navigation .cw-services-menu > .wp-block-navigation__submenu-container > li > .wp-block-navigation-item__content {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.cw-header .cw-services-menu .wp-block-navigation-item__description {
  display: block;
  margin-top: .25em;
  color: #495d71;
  font-size: .81rem;
  font-weight: 400;
  line-height: 1.35;
}

@media (min-width: 901px) {
  .cw-header li.cw-services-menu {
    --cw-services-panel-width: min(540px, 54vw);
  }

  .cw-header .cw-services-menu.open-on-click > .wp-block-navigation-submenu__toggle {
    padding-inline: 0 1.3em;
  }

  .cw-header .cw-services-menu.open-on-click > .wp-block-navigation-submenu__toggle + .wp-block-navigation__submenu-icon {
    position: absolute;
    inset-inline-end: 0;
    margin-inline: 0;
  }

  .cw-header .wp-block-navigation .cw-services-menu > .wp-block-navigation-submenu__toggle[aria-expanded="true"] ~ .wp-block-navigation__submenu-container {
    display: grid;
    box-sizing: border-box;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    inset-inline-start: calc((100% - var(--cw-services-panel-width)) / 2);
    inset-inline-end: auto;
    width: var(--cw-services-panel-width);
  }

  .cw-header .cw-services-menu > .wp-block-navigation__submenu-container > li {
    align-items: stretch;
    min-width: 0;
  }

  .cw-header .cw-services-menu .cw-services-overview {
    grid-column: 1 / -1;
    border-top: 1px solid var(--cw-home-edge);
  }

  .cw-header .cw-services-menu > .wp-block-navigation__submenu-container a {
    border-radius: 6px;
  }
}

@media (max-width: 900px) {
  .cw-header > .wp-block-navigation { margin-inline-start: 0; }
  .cw-header .is-menu-open .cw-services-menu .wp-block-navigation-item__content { display: block; }
  .cw-header .is-menu-open .cw-services-menu.open-on-click {
    position: relative;
  }

  .cw-header .is-menu-open .cw-services-menu.open-on-click > .wp-block-navigation-submenu__toggle {
    width: 100%;
    text-align: start;
  }

  .cw-header .is-menu-open .cw-services-menu.open-on-click > .wp-block-navigation__submenu-icon {
    display: inline-flex;
    position: absolute;
    inset-block-start: 15px;
    inset-inline-end: 8px;
    pointer-events: none;
  }

  .cw-header .is-menu-open .cw-services-menu.open-on-click > button[aria-expanded="false"] ~ .wp-block-navigation__submenu-container {
    display: none;
  }
}
