/* Keep the original angled ribbon on desktop. */
.sp-package-recommendation {
  transform: translate(25%, -25%) rotate(45deg);
  padding: 6px 56px;
}

.hero-main-box,
.hero-inner-box {
  background-image: var(--hero-bg);
}

/* The desktop composition starts at the theme's lg breakpoint (1024px). */
@media (max-width: 1023px) {
  body {
    --sp-page-gutter: clamp(0.875rem, 3vw, 1.5rem);
    --sp-section-gap: clamp(3.5rem, 8vw, 6rem);
    --sp-card-gap: clamp(0.875rem, 2.5vw, 1.5rem);
    --sp-section-title: clamp(1.75rem, 4.8vw, 2.5rem);
  }

  .sp-content-copy,
  .sp-footer-links > div {
    min-width: 0;
  }

  #mobile-menu-panel .mobile-menu-content {
    max-height: 100dvh;
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  #mobile-menu-panel .nav-menu > li > a {
    min-height: 44px;
    white-space: normal;
  }

  #mobile-menu-close-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .hero-home-box,
  .hero-main-box,
  .hero-inner-box,
  .sp-journal-hero,
  #creativity-section > .container,
  #banner-section > .container,
  #footer-section .footer-bg {
    width: calc(100% - 2 * var(--sp-page-gutter));
  }

  #hero-section h1 {
    font-size: clamp(1.875rem, 5.5vw, 3.25rem);
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .hero-home-box {
    min-height: 0;
    padding: clamp(1.75rem, 5vw, 3.25rem) clamp(0.75rem, 3vw, 1.5rem) 0;
  }

  .hero-home-box .hero-title-block {
    margin: 0 auto clamp(1.25rem, 4vw, 2rem);
    max-width: 38rem;
  }

  .hero-cta-row {
    gap: 0.625rem;
    margin-top: 1.25rem;
  }

  .hero-cta-row a {
    flex: 1 1 8rem;
    max-width: 13rem;
    min-height: 44px;
    height: auto;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    border-radius: 999px;
  }

  .hero-cta-row .primary-button {
    box-shadow: 0 6px 16px rgba(55, 172, 171, 0.28);
  }

  .hero-cta-row .light-button {
    box-shadow: none;
    background: transparent;
    border: 1.5px solid rgba(55, 172, 171, 0.45);
  }

  .hero-home-box .hero-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
    max-width: 48rem;
  }

  .hero-home-box .hero-card {
    min-width: 0;
    min-height: clamp(5.75rem, 16vw, 7rem);
    padding: 0.625rem 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 1.25rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  }

  .hero-home-box .hero-card p {
    position: relative;
    z-index: 1;
    font-size: 0.875rem;
    line-height: 1.25;
  }

  .hero-home-box .hero-card img {
    max-width: 76%;
    max-height: 56%;
    bottom: 0;
    width: auto;
    object-fit: contain;
  }

  .hero-home-box .hero-main-image {
    position: relative;
    inset: auto;
    transform: none;
    width: min(100%, 27rem);
    margin: clamp(0.75rem, 2vw, 1.25rem) auto 0;
  }

  .hero-main-box {
    padding-top: clamp(1.75rem, 5vw, 3.25rem);
  }

  .hero-main-box > div {
    max-width: 38rem;
  }

  .hero-inner-box {
    --sp-hero-art-height: clamp(17rem, 51vw, 26rem);
    justify-content: flex-start;
    min-height: 0;
    padding-top: clamp(1.75rem, 5vw, 3.25rem);
    padding-bottom: var(--sp-hero-art-height);
    background-image:
      var(--hero-bg),
      linear-gradient(160deg, rgba(255, 150, 150, 0.30), rgba(255, 240, 240, 0.25) 45%, rgba(109, 210, 192, 0.28)) !important;
    background-repeat: no-repeat;
    background-size: auto calc(var(--sp-hero-art-height) + 1rem), 100% 100%;
    background-position: 88% calc(100% + 1rem), 0 0;
  }

  .hero-inner-box > div {
    max-width: 100%;
  }

  .hero-inner-box ul {
    max-width: 100%;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .hero-inner-box ul li {
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
    line-height: 1.3;
  }

  .hero-inner-box > div > div img {
    flex: none;
  }

  #services-section,
  #creativity-section,
  #why-choose-section,
  #brand-comparison-section,
  #service-includes-section,
  .content-block-section {
    margin-bottom: var(--sp-section-gap);
  }

  .sp-services-intro,
  .sp-impact-intro,
  .sp-testimonials-intro {
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  }

  .sp-services-intro h2,
  .sp-impact-intro h2,
  .sp-testimonials-intro h2,
  #service-includes-section h2,
  .sp-content-copy h2 {
    font-size: var(--sp-section-title);
    line-height: 1.15;
    text-wrap: balance;
  }

  .sp-services-intro p,
  .sp-testimonials-intro p,
  .sp-impact-intro p {
    font-size: clamp(1rem, 2.2vw, 1.125rem);
    line-height: 1.55;
  }

  .sp-services-grid,
  .sp-impact-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-card-gap);
    margin-bottom: clamp(1.25rem, 4vw, 2rem);
  }

  .sp-service-card {
    grid-column: auto;
    min-width: 0;
  }

  .sp-service-art,
  .sp-impact-art {
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    aspect-ratio: 16 / 10;
  }

  .sp-service-art {
    min-width: 0;
    max-height: 13rem;
    padding: 0.75rem;
  }

  .sp-service-art img,
  .sp-impact-art img {
    max-height: 100%;
    object-fit: contain;
  }

  .sp-service-content {
    flex: 1 1 auto;
    gap: 0.875rem;
    padding: 0.875rem clamp(0.875rem, 2vw, 1.25rem) 1rem;
  }

  .sp-service-content h3 {
    margin-bottom: 0.5rem;
    font-size: clamp(1.25rem, 2.6vw, 1.5rem);
    line-height: 1.2;
  }

  .sp-service-content p {
    font-size: 0.9375rem;
  }

  .sp-service-link {
    width: 3.5rem;
    height: 2.75rem;
    border-radius: 0.875rem;
  }

  .sp-service-link svg {
    width: 1.375rem;
  }

  #creativity-section > .container {
    padding: clamp(1.5rem, 4vw, 3rem) clamp(0.75rem, 3vw, 1.5rem);
  }

  .sp-impact-grid {
    margin-bottom: 0;
  }

  .sp-impact-card {
    min-width: 0;
    border-radius: 1.5rem;
    box-shadow: 0 12px 36px rgba(255, 113, 112, 0.16);
  }

  .sp-impact-art {
    max-height: 14rem;
    margin-top: 0;
  }

  #why-choose-section .grid > div {
    min-height: 0;
    padding: clamp(1rem, 3vw, 1.5rem);
  }

  #about-section .container > .flex,
  .sp-content-layout {
    gap: clamp(1.25rem, 4vw, 2.5rem);
  }

  #contact-section .grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #contact-section .space-y-12 > :not([hidden]) ~ :not([hidden]) {
    margin-top: var(--sp-card-gap);
  }

  #contact-section .space-y-12 .flex-1 {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .sp-content-copy {
    gap: 1rem;
  }

  .sp-content-media {
    max-width: 38rem;
    margin-inline: auto;
  }

  .sp-content-media img {
    width: 100%;
    height: auto;
  }

  .sp-includes-row {
    flex-flow: row wrap;
    justify-content: center;
    gap: 0.625rem;
  }

  .sp-includes-rule {
    display: none;
  }

  .sp-includes-item {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
  }

  .sp-includes-item > :is(a, span) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0.6rem 0.9rem;
    font-size: 0.9375rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  #service-includes-section h2 {
    margin-bottom: 1.5rem;
  }

  #service-includes-section .sp-includes-heading {
    margin-bottom: 0;
  }

  #service-includes-section .sp-includes-group {
    margin-bottom: 0.625rem;
  }

  #portfolio-filters,
  #package-filters {
    gap: 0.5rem;
  }

  .portfolio-filter-btn,
  .package-filter-btn {
    max-width: 100%;
    min-height: 44px;
    padding-inline: 0.75rem;
    overflow-wrap: anywhere;
  }

  #portfolio-section #portfolio-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-card-gap);
  }

  #portfolio-grid .portfolio-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: clamp(14rem, 59vw, 19rem);
    height: auto;
  }

  .sp-portfolio-card-content {
    flex: 1 0 auto;
    height: auto;
    min-width: 0;
    padding: clamp(1rem, 2.6vw, 1.5rem);
    overflow-wrap: anywhere;
  }

  .sp-portfolio-card-content h3 {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  }

  .sp-portfolio-card-content img {
    max-width: 100%;
    object-fit: contain;
    object-position: left;
  }

  #packages-grid .sp-package-card {
    min-width: 0;
  }

  #packages-grid .sp-package-recommendation {
    position: static;
    align-self: flex-start;
    margin-bottom: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    transform: none;
  }

  .sp-package-price {
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    font-size: clamp(1.75rem, 5.5vw, 2.5rem);
    overflow-wrap: anywhere;
  }

  .sp-package-price > span:last-child {
    margin: 0;
    font-size: 0.9375rem;
  }

  .sp-package-card li svg {
    flex: none;
  }

  .sp-banner-layout {
    gap: 1rem;
    min-height: 0;
    padding: clamp(1.25rem, 4vw, 2.5rem);
  }

  .sp-banner-heading {
    order: 0;
    transform: none;
  }

  .sp-banner-art {
    order: 1;
    position: relative;
    inset: auto;
    display: grid;
    place-items: center;
    height: auto;
    margin-inline: auto;
  }

  .sp-banner-art img {
    position: static;
    width: min(100%, 17rem);
    height: auto;
    max-height: 13rem;
    transform: none;
  }

  .sp-banner-actions {
    order: 2;
    margin-top: 0;
  }

  .sp-banner-actions a {
    min-height: 44px;
    max-width: 100%;
    text-align: center;
    white-space: normal;
  }

  .sp-journal-hero,
  .sp-journal-layout {
    min-height: 0;
  }

  .sp-journal-layout {
    gap: 1.5rem;
    padding: clamp(1.25rem, 5vw, 3rem);
  }

  .sp-journal-art {
    height: auto;
    aspect-ratio: 1.4;
  }

  .sp-journal-art-label {
    bottom: 0;
    padding: 0.4rem 0.55rem;
    font-size: 0.625rem;
    letter-spacing: 0.08em;
    white-space: normal;
  }

  .sp-article-hero > .relative {
    padding: clamp(1.25rem, 5vw, 3rem);
  }

  .sp-article-hero h1 {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .content {
    overflow-wrap: anywhere;
  }

  .content :is(.wp-block-table, pre) {
    max-width: 100%;
    overflow-x: auto;
  }

  .content iframe {
    max-width: 100%;
  }

  .sp-testimonials-card {
    padding: clamp(0.875rem, 3vw, 1.5rem);
  }

  .sp-footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .sp-footer-brand {
    grid-column: auto;
  }

  .sp-footer-links {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1rem, 3vw, 1.75rem);
    overflow-wrap: anywhere;
  }

  .sp-footer-divider {
    display: none;
  }

  .sp-footer-links h2 {
    margin-bottom: 0.5rem;
  }

  #wizard-modal [data-wizard-panel] {
    max-height: calc(100dvh - 2rem);
    border-radius: 1.5rem;
    overscroll-behavior: contain;
  }

  #wizard-modal .js-wizard-close {
    top: 0.5rem;
    right: 0.5rem;
  }

  #wizard-modal .sp-wizard-content {
    min-height: 0;
    padding-top: 3.5rem;
  }
}

@media (min-width: 560px) and (max-width: 1023px) {
  .hero-home-box .hero-cards-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sp-services-grid,
  #portfolio-section #portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sp-footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sp-footer-contact {
    grid-column: 1 / -1;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .sp-impact-grid,
  .sp-footer-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sp-footer-contact {
    grid-column: auto;
  }
}

@media (width < 768px) {
  .hero-main-box {
    background-image: var(--sp-hero-bg-mobile, var(--hero-bg)) !important;
  }

  .hero-inner-box {
    background-image:
      var(--sp-hero-bg-mobile, var(--hero-bg)),
      linear-gradient(160deg, rgba(255, 150, 150, 0.30), rgba(255, 240, 240, 0.25) 45%, rgba(109, 210, 192, 0.28)) !important;
  }
}
