/* Start Building (coded) */

.sb-resources.section,
.sb-involved.section {
  padding-top: clamp(48px, 8vw, 128px);
  padding-bottom: clamp(48px, 8vw, 128px);
}

.sb-hero.section {
  background: var(--brand-white);
}

.sb-hero {
  --hero-min-height: 90vh;
  --hero-body-max: 41ch;
  --hero-copy-col: 440px;
  --hero-media-max: 820px;
  --hero-desktop-gap: clamp(8px, 1vw, 16px);
}

.sb-hero.section--fullvh {
  min-height: var(--hero-min-height);
  padding-top: var(--header-bottom);
  box-sizing: border-box;
  display: block;
}

.sb-hero__inner {
  min-height: calc(var(--hero-min-height) - var(--header-bottom));
  display: grid;
  align-items: center;
}

.sb-hero__grid {
  display: grid;
  gap: clamp(24px, 4vw, 72px);
  align-items: center;
}

.sb-hero__copy {
  width: 100%;
  max-width: 58ch;
}

.sb-hero__title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.08;
  font-size: clamp(25px, min(9.38vw, 4dvh), 39px);
}

.sb-hero__body {
  margin: 16px 0 0 0;
  max-width: 48ch;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.sb-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.sb-icon-btn {
  padding-left: 31px;
}

.sb-icon-btn > [class^="icon-"] {
  display: inline-block;
  height: 0.9em;
  width: auto;
  max-height: 100%;
  margin-right: 4px;
  background-color: currentColor;
  transform: scale(1.3);
  transform-origin: left center;
  vertical-align: -0.1em;
  flex: 0 0 auto;
}

.sb-icon-btn .icon-add-project {
  aspect-ratio: 1.377551;
  -webkit-mask: url("../../img/start-building/add-project.svg") no-repeat center / contain;
  mask: url("../../img/start-building/add-project.svg") no-repeat center / contain;
}

.sb-icon-btn .icon-immunefi {
  aspect-ratio: 1.16129;
  -webkit-mask: url("../../img/start-building/immunefi.svg") no-repeat center / contain;
  mask: url("../../img/start-building/immunefi.svg") no-repeat center / contain;
}

.sb-icon-btn .icon-remedy {
  aspect-ratio: 1;
  -webkit-mask: url("../../img/start-building/remedy.svg") no-repeat center / contain;
  mask: url("../../img/start-building/remedy.svg") no-repeat center / contain;
}

.sb-hero__media {
  margin: 0;
}

.sb-hero__media--mobile {
  width: min(100%, 420px);
  margin: 0 auto;
}

.sb-hero__media--desktop {
  display: none;
}

.sb-hero__video {
  display: block;
  width: 100%;
  height: auto;
}

.sb-hero__media--mobile .sb-hero__video {
  object-fit: cover;
}

.sb-section-copy {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.sb-section-title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(20px, 1.6vw + 9px, 31px);
  line-height: 1.15;
  text-align: center;
}

.sb-section-text {
  margin: 16px auto 0;
  max-width: 68ch;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
}

.sb-section-text sup {
  font-size: 0.55em;
  line-height: 0;
  position: relative;
  top: -0.4em;
}

.sb-resources.section {
  background: var(--brand-gray-100);
  --sb-card-max: 250px;
  --sb-card-media-max: 125px;
  --sb-card-gap: 24px;
}

.sb-resources__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: calc((var(--sb-card-max) * 2) + var(--sb-card-gap));
  gap: var(--sb-card-gap);
  margin: clamp(24px, 3vw, 40px) auto 0;
}

.sb-resource-card {
  appearance: none;
  container-type: inline-size;
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.05);
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: clamp(14px, 2vw, 18px);
  border-radius: 24px;
  background: var(--brand-white);
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transform: translateY(0);
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sb-resource-card:hover,
.sb-resource-card:focus-visible {
  transform: translateY(-4px);
}

.sb-resource-card__media {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sb-resource-card__video {
  display: block;
  width: 50%;
  width: min(50cqi, var(--sb-card-media-max));
  max-width: 100%;
  height: auto;
  object-fit: contain;
  transform: scale(1);
  transition: transform 460ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sb-resource-card:hover .sb-resource-card__video,
.sb-resource-card:focus-visible .sb-resource-card__video {
  transform: translateY(-1px) scale(1.035);
}

.sb-resource-card__title {
  margin: 12px 0 0 0;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.25;
  transform: translateY(-24px);
}

.sb-resource-card__title sup {
  font-size: 0.55em;
  line-height: 0;
  position: relative;
  top: -0.4em;
}

.sb-resources__cta,
.sb-involved__actions {
  margin-top: clamp(24px, 3vw, 40px);
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sb-involved.section {
  background: var(--brand-white);
}

.sb-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sb-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sb-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.58);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.sb-modal__dialog {
  position: relative;
  width: min(100%, 960px);
  padding: clamp(24px, 4vw, 40px);
  border-radius: 30px;
  background: var(--brand-white);
  box-shadow: 0 28px 90px rgba(17, 17, 17, 0.22);
}

.sb-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  border: 0;
  border-radius: 9999px;
  background: var(--brand-black);
  color: var(--brand-white);
  font-family: var(--font-heading);
  font-size: 14px;
  line-height: 1;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.sb-modal__close:hover,
.sb-modal__close:focus-visible {
  background: var(--brand-green);
  color: var(--brand-black);
  transform: translateY(-2px);
}

.sb-modal__title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(20px, 1.6vw + 9px, 31px);
  line-height: 1.15;
}

.sb-modal__intro {
  margin: 16px 0 0 0;
  max-width: 60ch;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.sb-modal__grid {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
  margin-top: clamp(24px, 3vw, 32px);
}

.sb-modal-card {
  background: var(--brand-gray-100);
  border-radius: 24px;
  padding: clamp(20px, 3vw, 28px);
}

.sb-modal-card__eyebrow {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sb-modal-card__title {
  margin: 10px 0 0 0;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(18px, 1.2vw + 10px, 25px);
  line-height: 1.15;
}

.sb-modal-card__body {
  margin: 12px 0 0 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.reveal-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 840ms cubic-bezier(0.22, 1, 0.36, 1), transform 840ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.is-in {
  opacity: 1;
  transform: none;
}

.sb-hero .reveal-up {
  opacity: 1;
  transform: none;
}

@keyframes sbHeroReveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .sb-hero .sb-hero__title.reveal-up,
  .sb-hero .sb-hero__body.reveal-up,
  .sb-hero .sb-hero__actions.reveal-up {
    animation-name: sbHeroReveal;
    animation-duration: 840ms;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: both;
  }

  .sb-hero .sb-hero__title.reveal-up { animation-delay: 0ms; }
  .sb-hero .sb-hero__body.reveal-up { animation-delay: 160ms; }
  .sb-hero .sb-hero__actions.reveal-up { animation-delay: 320ms; }
}

html.sb-modal-open,
body.sb-modal-open {
  overflow: hidden !important;
}

@media (min-width: 981px) {
  .sb-resources.section,
  .sb-involved.section {
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .sb-resource-card {
    filter: drop-shadow(0 0 0 rgba(17, 17, 17, 0));
    transition:
      transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
      filter 520ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, filter;
  }

  .sb-resource-card:hover,
  .sb-resource-card:focus-visible {
    filter: drop-shadow(0 16px 30px rgba(17, 17, 17, 0.11));
  }

  .sb-hero__grid {
    gap: var(--hero-desktop-gap);
    grid-template-columns: minmax(0, var(--hero-copy-col)) minmax(0, 1fr);
  }

  .sb-hero__title {
    font-size: clamp(30px, min(11.25vw, 4.8dvh), 46.5px);
  }

  .sb-hero__body {
    max-width: var(--hero-body-max);
  }

  .sb-hero__media--mobile {
    display: none;
  }

  .sb-hero__media--desktop {
    display: block;
    justify-self: end;
    width: min(100%, var(--hero-media-max));
  }

  .sb-hero__media--desktop .sb-hero__video {
    object-fit: contain;
  }

  .sb-resources__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: calc((var(--sb-card-max) * 3) + (var(--sb-card-gap) * 2));
  }

  .sb-modal__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .start-building-standalone {
    --gutter: 48px;
    overflow-x: clip;
  }

  .sb-resources.section {
    --sb-card-gap: 16px;
  }

  .sb-hero.section.section--fullvh {
    min-height: auto !important;
    display: block !important;
    align-items: initial !important;
    padding-top: clamp(48px, 8vw, 128px);
  }

  .sb-hero.section {
    padding-bottom: clamp(48px, 8vw, 128px);
  }

  .sb-hero__inner {
    max-width: 100%;
    min-height: 0;
    display: block;
  }

  .sb-hero__grid {
    justify-items: center;
  }

  .sb-hero__copy {
    text-align: center;
    margin: 0 auto;
  }

  .sb-hero__title {
    text-align: center;
    font-size: 22px !important;
    line-height: 1.2;
  }

  .sb-hero__body {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .sb-hero__actions {
    justify-content: center;
  }

  .sb-hero__media--mobile {
    width: min(100%, 416px);
    margin: 0 auto;
  }

  .sb-hero__media--desktop {
    display: none !important;
  }

  .sb-involved__actions {
    flex-direction: column;
    align-items: center;
  }

  .sb-involved__actions .btn {
    width: 100%;
    max-width: 360px;
  }

  .sb-resource-card__title {
    transform: translateY(-16px);
  }

  .sb-modal {
    padding: 16px;
  }

  .sb-modal__dialog {
    padding-top: 72px;
  }

  .sb-modal__close {
    top: 16px;
    right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-up {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .sb-resource-card,
  .sb-resource-card__video,
  .sb-modal,
  .sb-modal__close {
    transition: none !important;
  }

  .sb-resource-card:hover,
  .sb-resource-card:focus-visible,
  .sb-modal__close:hover,
  .sb-modal__close:focus-visible {
    transform: none !important;
  }
}
