.portrait-picture,
.kapi-cover-picture {
  display: block;
  width: 100%;
  height: 100%;
}

.portrait-picture img,
.kapi-cover-picture img {
  display: block;
}

.kapi-index .index-art picture {
  display: contents;
}

.kapi-detail-sequence {
  display: block;
  width: 100%;
  margin-top: 24px;
  line-height: 0;
}

.kapi-detail-picture {
  display: block;
  width: 100%;
  content-visibility: auto;
}

.project-kapi .kapi-detail-picture .kapi-detail-board {
  margin-top: 0;
}

/* Keep every deferred image's final footprint in the layout while its file is
   waiting in the proximity queue. The restrained shimmer is the loading UI. */
img[data-image-state] {
  background-color: #151515;
}

img[data-image-state="queued"] {
  background-image: linear-gradient(105deg, #151515 0%, #151515 42%, #242424 50%, #151515 58%, #151515 100%);
  background-position: 100% 0;
  background-size: 220% 100%;
}

img[data-image-state="loading"] {
  background-image: linear-gradient(105deg, #151515 0%, #151515 42%, #2d2d2d 50%, #151515 58%, #151515 100%);
  background-position: 100% 0;
  background-size: 220% 100%;
  animation: image-loading-sweep 1.35s linear infinite;
}

img[data-image-state="loaded"] {
  background-color: transparent;
  background-image: none;
  animation: none;
}

img[data-image-state="error"] {
  background-color: #202020;
  background-image: repeating-linear-gradient(135deg, transparent 0 10px, rgba(255, 255, 255, 0.035) 10px 20px);
  animation: none;
}

.progressive-image-sequence picture[data-image-state] {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #151515;
}

.progressive-image-sequence picture[data-image-state="loaded"] {
  background: transparent;
}

.kapi-ui-design-intro-picture,
.kapi-ui-design-intro-picture img,
.kapi-project-introduction-picture,
.kapi-project-introduction-picture img,
.kapi-project-overview-frame-picture,
.kapi-project-overview-frame-picture img,
.kapi-foundation-main-flow-picture,
.kapi-foundation-main-flow-picture img,
.kapi-ai-native-case-study-picture,
.kapi-ai-native-case-study-picture img {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

.kapi-ui-design-intro-picture {
  line-height: 0;
  background: #030713;
}

.kapi-ui-design-intro-picture img {
  height: auto;
}

.kapi-project-introduction-picture,
.kapi-project-overview-frame-picture,
.kapi-foundation-main-flow-picture,
.kapi-ai-native-case-study-picture {
  margin-bottom: 18px;
  line-height: 0;
  background: #030713;
}

.kapi-project-introduction-picture img,
.kapi-project-overview-frame-picture img,
.kapi-foundation-main-flow-picture img,
.kapi-ai-native-case-study-picture img {
  height: auto;
}

.kapi-ui-design-intro-stage {
  position: relative;
  margin-bottom: 18px;
  overflow: hidden;
  background: #030713;
}

.kapi-ui-design-intro-copy {
  position: absolute;
  z-index: 2;
  top: 34%;
  left: 4.4%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: #fff;
  font-family: "Helvetica Neue", "PingFang SC", Arial, sans-serif;
  letter-spacing: .02em;
  text-align: left;
  pointer-events: none;
}

.kapi-ui-design-intro-copy strong {
  margin-bottom: clamp(22px, 3vw, 48px);
  font-size: clamp(34px, 5.2vw, 82px);
  font-weight: 700;
  line-height: 1.05;
}

.kapi-ui-design-intro-copy span {
  font-size: clamp(25px, 3.7vw, 58px);
  font-weight: 300;
  line-height: 1.18;
  letter-spacing: .035em;
}

.kapi-ui-design-intro-copy.reveal {
  opacity: 0;
  filter: blur(9px);
  transform: translate3d(0, 24px, 0);
  transition: opacity 1s cubic-bezier(.16, 1, .3, 1), filter 1s cubic-bezier(.16, 1, .3, 1), transform 1s cubic-bezier(.16, 1, .3, 1);
}

.kapi-ui-design-intro-copy.reveal.visible {
  opacity: 1;
  filter: blur(0);
  transform: none;
}

.kapi-ui-design-intro-icon {
  position: absolute;
  z-index: 2;
  top: 30%;
  left: 54%;
  display: block;
  width: clamp(120px, 17vw, 275px);
  height: auto;
  pointer-events: none;
}

.kapi-ui-design-intro-icon.reveal {
  opacity: 0;
  filter: blur(12px);
  transform: translate3d(0, 28px, 0) scale(.9);
  transition: opacity 1s .18s cubic-bezier(.16, 1, .3, 1), filter 1s .18s cubic-bezier(.16, 1, .3, 1), transform 1s .18s cubic-bezier(.16, 1, .3, 1);
}

.kapi-ui-design-intro-icon.reveal.visible {
  opacity: 1;
  filter: blur(0);
  transform: none;
}

.kapi-ui-design-intro-hand {
  position: absolute;
  z-index: 3;
  top: 41%;
  left: 49.5%;
  display: block;
  width: clamp(190px, 24vw, 390px);
  height: auto;
  pointer-events: none;
}

.kapi-ui-design-intro-hand.reveal {
  opacity: 0;
  filter: blur(10px);
  transform: translate3d(0, 34px, 0) scale(.94);
  transform-origin: 58% 0;
  transition: opacity .9s .36s cubic-bezier(.16, 1, .3, 1), filter .9s .36s cubic-bezier(.16, 1, .3, 1), transform .9s .36s cubic-bezier(.16, 1, .3, 1);
}

.kapi-ui-design-intro-hand.reveal.visible {
  opacity: 1;
  filter: blur(0);
  transform: none;
}

@media (max-width: 700px) {
  .kapi-ui-design-intro-stage {
    margin-bottom: 12px;
  }

  .kapi-project-introduction-picture,
  .kapi-project-overview-frame-picture,
  .kapi-foundation-main-flow-picture,
  .kapi-ai-native-case-study-picture {
    margin-bottom: 12px;
  }

  .kapi-ui-design-intro-copy {
    top: 33%;
    left: 5%;
  }

  .kapi-ui-design-intro-copy strong {
    margin-bottom: 12px;
    font-size: clamp(20px, 6.8vw, 34px);
  }

  .kapi-ui-design-intro-copy span {
    font-size: clamp(15px, 5vw, 25px);
  }

  .kapi-ui-design-intro-icon {
    top: 34%;
    left: 62%;
    width: clamp(72px, 24vw, 120px);
  }

  .kapi-ui-design-intro-hand {
    top: 42%;
    left: 53%;
    width: clamp(105px, 34vw, 170px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .kapi-ui-design-intro-copy.reveal,
  .kapi-ui-design-intro-copy.reveal.visible,
  .kapi-ui-design-intro-icon.reveal,
  .kapi-ui-design-intro-icon.reveal.visible,
  .kapi-ui-design-intro-hand.reveal,
  .kapi-ui-design-intro-hand.reveal.visible {
    opacity: 1;
    filter: none;
    transform: none;
    transition: none;
  }
}

.design-type-intro {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100svh;
  margin: 0;
  padding: clamp(28px, 6vw, 96px);
  overflow: hidden;
  background: #000;
  color: #fff;
  text-align: center;
  scroll-margin-top: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.direction-anchor.design-type-intro {
  scroll-margin-top: 0;
}

.design-type-intro__title {
  max-width: 100%;
  margin: 0;
  font-family: Manrope, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(28px, 5.2vw, 76px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  opacity: 0;
  transform: translate3d(0, 28px, 0) scale(.98);
  transition: opacity .72s ease, transform .9s cubic-bezier(.16, 1, .3, 1);
}

.design-type-intro.is-visible .design-type-intro__title {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

#project-robot-chess .design-type-intro__title,
#project-tob-core .design-type-intro__title {
  translate: 0 -6vh;
}

/* The fixed status capsule switches copy contrast from a lightweight estimate
   of the page pixels after the translucent glass brightens them. */
.status-chip .status-chip__main,
.status-chip .status-chip__sub,
.status-chip .capsule-direction > a {
  transition: color .24s ease;
}

.site-header .status-chip.status-glass.is-on-light-background .status-chip__main {
  color: rgba(16, 18, 20, .92);
  mix-blend-mode: normal;
}

.site-header .status-chip.status-glass.is-on-light-background .status-chip__sub {
  color: rgba(34, 37, 40, .68);
  border-left-color: rgba(28, 31, 34, .22);
  mix-blend-mode: normal;
}

.status-chip.is-on-light-background.has-directions .capsule-direction > a:not(.is-active) {
  color: rgba(28, 31, 34, .58);
}

#contact h2 {
  letter-spacing: -0.035em;
}

/* Safari/WebKit can drop transparent image layers after a filter transition.
   Keep the three Kapi hero phones on a simple opacity/transform compositor. */
.kapi-art .kapi-phone-side,
.kapi-art .kapi-phone-record,
.kapi-art .kapi-phone-side.reveal,
.kapi-art .kapi-phone-record.reveal,
.kapi-art .kapi-phone-side.reveal.visible,
.kapi-art .kapi-phone-record.reveal.visible {
  filter: none;
  -webkit-filter: none;
  will-change: opacity, transform;
}

.kapi-art .kapi-phone-side.reveal,
.kapi-art .kapi-phone-record.reveal {
  transition-property: opacity, transform;
}

.kapi-art .kapi-phone-side > img,
.kapi-art .kapi-phone-record > img {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

@keyframes image-loading-sweep {
  to { background-position: -120% 0; }
}

@media (prefers-reduced-motion: reduce) {
  img[data-image-state="loading"] {
    background-image: none;
    animation: none;
  }
}

@media (max-width: 700px) {
  .kapi-detail-sequence {
    margin-top: 12px;
  }

  .design-type-intro {
    min-height: 100svh;
    padding: 28px 22px;
  }

  .design-type-intro__title {
    font-size: clamp(28px, 8vw, 38px);
  }

  #project-robot-chess .design-type-intro__title,
  #project-tob-core .design-type-intro__title {
    translate: 0 -4svh;
  }

  .contact {
    position: relative;
  }

  .contact h2 {
    position: absolute;
    top: 50%;
    right: 6vw;
    left: 6vw;
    margin: 0;
    letter-spacing: .035em;
    transform: translateY(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .design-type-intro__title {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
