/* Responsive refinements retain the original full-width composition. */
html[data-brand="calypso"] :is(button, a, input, label) {
  touch-action: manipulation;
}

html[data-brand="calypso"] :is(button, a, input):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

html[data-brand="calypso"] .c-header_inner {
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
}

html[data-brand="calypso"] :is(.c-header_left, .c-header_nav_list, .c-header_nav_item) {
  min-inline-size: 0;
  flex-shrink: 0;
}

html[data-brand="calypso"] .c-header_nav_dropdown {
  overscroll-behavior: contain;
  padding-block-end: env(safe-area-inset-bottom);
}

html[data-brand="calypso"] :is(.c-footer_grid > *, .c-hero-product_content_inner, .demo-checkout__product) {
  min-inline-size: 0;
}

html[data-brand="calypso"] main .u-heading-huge {
  overflow-wrap: anywhere;
  text-wrap: balance;
}

html[data-brand="calypso"] :is(.calypso-product-purchase input, .c-newsletter_form_input) {
  font-size: max(1rem, 16px);
}

html[data-brand="calypso"] .calypso-colours span {
  display: flex;
  align-items: center;
  min-block-size: 44px;
}

html[data-brand="calypso"] .calypso-product-purchase {
  min-inline-size: 0;
}

html[data-brand="calypso"] .calypso-add-to-cart {
  min-inline-size: 0;
  overflow-wrap: break-word;
}

html[data-brand="calypso"] .c-cart {
  inline-size: min(500px, 100%);
  max-inline-size: 100vw;
  max-block-size: 100dvh;
}

html[data-brand="calypso"] .c-cart_inner {
  flex: 1;
  min-block-size: 0;
}

html[data-brand="calypso"] .c-cart_scrollable {
  flex: 1;
  min-block-size: 0;
  overscroll-behavior: contain;
}

html[data-brand="calypso"] .c-cart_bottom {
  flex: 0 0 auto;
  padding-block-end: max(var(--cart-gap), env(safe-area-inset-bottom));
}

html[data-brand="calypso"] .c-cart_line_content {
  min-inline-size: 0;
  gap: 8px;
}

html[data-brand="calypso"] .c-cart_line_content_primary {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

html[data-brand="calypso"] .c-cart_line_content_primary .u-heading-h4 {
  font-size: clamp(1.5rem, 4vw, 2.3rem);
}

html[data-brand="calypso"] .c-cart_line_content_secondary {
  flex-shrink: 0;
  white-space: nowrap;
}

html[data-brand="calypso"] .c-cart_line_visual {
  block-size: 150px;
}

html[data-brand="calypso"] .c-cart_line_visual img {
  block-size: calc(100% - 44px);
}

html[data-brand="calypso"] .c-cart_quantity {
  padding: 0;
  gap: 0;
  min-block-size: 44px;
}

html[data-brand="calypso"] .c-cart_quantity_button {
  --button-size: 36px;
  inline-size: 36px;
  block-size: 44px;
}

html[data-brand="calypso"] .c-cart_quantity_button::before,
html[data-brand="calypso"] .c-cart_quantity_button.-plus::after {
  inset: 50% auto auto 50%;
  width: 12px;
  height: 1px;
  transform: translate(-50%, -50%);
}

html[data-brand="calypso"] .c-cart_quantity_button.-plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

html[data-brand="calypso"] .c-cart_line_content_secondary button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 36px;
  min-block-size: 44px;
}

html[data-brand="calypso"] .c-cart_action {
  inline-size: 100%;
}

html[data-brand="calypso"] .c-cart_action .c-button {
  white-space: normal;
  font-size: clamp(1.7rem, 6vw, 2.5rem);
}

html[data-brand="calypso"] .c-footer_nav :is(a, button) {
  display: inline-flex;
  align-items: center;
  min-block-size: 28px;
}

html[data-brand="calypso"] .c-footer_grid_item.-copyright {
  white-space: normal;
}

html[data-brand="calypso"] .c-footer {
  padding-block-end: max(clamp(1rem, .9rem + .48vw, 1.5rem), env(safe-area-inset-bottom));
}

html[data-brand="calypso"] .demo-checkout__summary > a:not(.demo-checkout__button) {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
}

html[data-brand="calypso"] .demo-checkout__quantity button {
  min-inline-size: 44px;
  min-block-size: 44px;
}

html[data-brand="calypso"] :is(.demo-checkout__confirmation, .demo-checkout__product) {
  overflow-wrap: anywhere;
}

html[data-brand="calypso"] #cc-main :is(.pm, .cm) {
  max-inline-size: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right));
}

html[data-brand="calypso"] #cc-main .pm__body {
  overscroll-behavior: contain;
}

html[data-brand="calypso"] #cc-main .pm__footer {
  padding-block-end: max(1em, env(safe-area-inset-bottom));
}

@media (max-width: 999px) {
  html[data-brand="calypso"] {
    --header-logo-width: 156px;
  }
}

@media (max-width: 380px) {
  html[data-brand="calypso"] {
    --header-logo-width: calc(clamp(80px, 28vw, 106px) + 16px);
  }
  html[data-brand="calypso"] .c-header_logo .svg-logo {
    --icon-width: clamp(80px, 28vw, 106px);
  }
  html[data-brand="calypso"] .c-header_nav_button.-menu {
    width: 48px;
    padding-inline: 8px;
  }
  html[data-brand="calypso"] .c-header_nav_link {
    padding-inline: 10px;
  }
  html[data-brand="calypso"] .c-header_nav_button_burger {
    width: 32px;
  }
  html[data-brand="calypso"] main .u-heading-huge {
    font-size: clamp(2.75rem, 14vw, 3.8rem);
  }
  html[data-brand="calypso"] .c-cart_line {
    --cart-gap: 12px;
  }
  html[data-brand="calypso"] .c-cart_line_visual {
    inline-size: 96px;
    block-size: 132px;
  }
  html[data-brand="calypso"] .c-cart_line_content {
    flex-direction: column;
  }
  html[data-brand="calypso"] .c-cart_line_content_secondary {
    flex-direction: row-reverse;
    align-items: center;
  }
}

@media (max-height: 540px) {
  html[data-brand="calypso"] .c-cart {
    top: 0;
    height: 100dvh;
  }
  html[data-brand="calypso"].is-announcement-banner-hidden .c-cart {
    top: var(--announcement-banner-height, 0px);
  }
  html[data-brand="calypso"] .c-cart_inner_container {
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  html[data-brand="calypso"] .c-cart_scrollable {
    overflow: visible;
  }
  html[data-brand="calypso"] .c-cart_header {
    padding-block: 8px;
  }
  html[data-brand="calypso"] .c-cart_bottom {
    display: block;
  }
}

@media (pointer: coarse) {
  html[data-brand="calypso"] .c-footer_nav :is(a, button) {
    min-block-size: 44px;
  }
  html[data-brand="calypso"] .c-newsletter_form_button {
    min-block-size: 44px;
  }
}

@media (hover: none) {
  html[data-brand="calypso"] .c-jump-rope_cta_button_wrap:hover .c-button_label_inner:first-child {
    opacity: 1;
  }
}

html[data-brand="calypso"].is-safari:not(.is-stop-animations) .c-jump-rope {
  display: block;
}

html[data-brand="calypso"] .c-jump-rope {
  z-index: 100;
}

html[data-brand="calypso"].has-menu-open .c-jump-rope {
  z-index: 99;
}

/* Keep the complete CALYPSO wordmark and its seal on one line on mobile. */
@media (max-width: 999px) {
  html[data-brand="calypso"] .c-hero-home_fold_logo_icon:has(.svg-logo-mobile) {
    display: none;
  }
  html[data-brand="calypso"] .c-hero-home_fold_logo_icon .svg-logo {
    display: block;
    height: auto;
    max-height: none;
  }
  html[data-brand="calypso"] .c-hero-home_fold {
    aspect-ratio: auto;
  }
  html[data-brand="calypso"] [data-calypso-cutout="hero-1"] {
    position: relative;
    inset: auto;
    width: min(64%, 320px);
    margin: 24px auto 32px;
  }
}

html[data-brand="calypso"] .calypso-orbit {
  display: none;
}

/* Mobile sections follow their content; the original desktop staging stays intact. */
@media (max-width: 999px) {
  html[data-brand="calypso"] .c-hero-home {
    aspect-ratio: auto;
  }
  html[data-brand="calypso"] .c-hero-home_content {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 0;
    gap: 24px;
    padding-block: 32px 128px; /* Room for the sticky catalogue button and tilted labels. */
  }
  html[data-brand="calypso"] .c-hero-home_content_title {
    flex: none;
  }
  html[data-brand="calypso"] .c-hero-home_content [data-calypso-cutout="hero-3"] {
    position: relative;
    inset: auto;
    width: min(72%, 320px);
    order: 1;
    margin-block: 12px;
    transform: none !important;
  }
  html[data-brand="calypso"] .c-hero-home_content [data-calypso-cutout] img {
    transform: none !important;
  }
  html[data-brand="calypso"] .c-hero-home_content_text {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px 24px;
    order: 2;
  }
  html[data-brand="calypso"] .c-hero-home_content_text_label {
    position: static;
    transform: none !important;
  }
  html[data-brand="calypso"] .c-hero-home_content_text_label_rotate {
    transform: none !important;
  }

  html[data-brand="calypso"] .calypso-orbit {
    display: block;
    padding: 24px 16px;
  }
  html[data-brand="calypso"] .calypso-orbit .c-spiral_container {
    width: min(100%, 560px);
    margin: 0 auto;
  }
  html[data-brand="calypso"] .calypso-orbit .c-spiral_inner {
    animation: none;
    transform: none;
  }
  html[data-brand="calypso"] .calypso-orbit .c-spiral_scale {
    transform: none;
  }
  html[data-brand="calypso"] .calypso-orbit .c-spiral_visual {
    top: 10%;
    height: 62%;
    animation: none;
    transform: none;
  }

  html[data-brand="calypso"] .c-prefooter_background_inner {
    transform: none !important;
  }
  html[data-brand="calypso"] .c-prefooter_inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    justify-items: center;
    gap: 16px 12px;
    aspect-ratio: auto;
    padding-block: 32px;
  }
  html[data-brand="calypso"] .c-prefooter_inner [data-calypso-cutout] {
    position: relative;
    inset: auto;
    width: min(94%, 260px);
    transform: none !important;
  }
  html[data-brand="calypso"] .c-prefooter_inner [data-calypso-cutout] img {
    transform: none !important;
  }
  html[data-brand="calypso"] .c-prefooter_inner [data-calypso-cutout="prefooter-1"] {
    grid-area: 1 / 1;
  }
  html[data-brand="calypso"] .c-prefooter_inner [data-calypso-cutout="prefooter-2"] {
    grid-area: 1 / 2;
  }
  html[data-brand="calypso"] .c-prefooter_text {
    position: static;
    transform: none !important;
  }
  html[data-brand="calypso"] .c-prefooter_text.-text-1 {
    grid-area: 2 / 1;
  }
  html[data-brand="calypso"] .c-prefooter_text.-text-2 {
    grid-area: 2 / 2;
  }
  html[data-brand="calypso"] .c-prefooter_title {
    grid-area: 3 / 1 / auto / -1;
    margin: 16px 0 0;
    font-size: clamp(4rem, 23vw, 7rem);
    line-height: .95;
  }
}

@keyframes calypso-orbit-turn {
  to { transform: rotate(360deg); }
}

@media (max-width: 999px) and (prefers-reduced-motion: no-preference) {
  html[data-brand="calypso"]:not(.is-stop-animations) .calypso-orbit .c-spiral_inner {
    animation: calypso-orbit-turn 24s linear infinite paused;
  }
  html[data-brand="calypso"]:not(.is-stop-animations) .calypso-orbit.is-inview .c-spiral_inner {
    animation-play-state: running;
  }
}
