/* Interactive-section responsive ownership: Sec04 Works and Sec05 Depth. */

@media (max-width: 1519px) {
  .site-home .works-watermark-left-top,
  .site-home .works-watermark-left-bottom,
  .site-home .works-watermark-right-top {
    display: none;
  }
}

@media (max-width: 1200px) {
  body.site-home #works,
  body.site-home #depth {
    height: auto;
    overflow-x: clip;
  }

  .site-home .works-watermark-left-top,
  .site-home .works-watermark-left-bottom,
  .site-home .works-watermark-right-top {
    display: none;
  }

  body.site-home .works-pin,
  body.site-home .depth-pin {
    position: static;
    height: auto;
    min-height: 0;
    padding-block: clamp(48px, 7vw, 80px);
  }

  body.site-home[data-view="sec04"] .works-pin {
    position: relative;
    top: 0;
    height: auto;
    min-height: calc(100vh - 64px);
    padding: 24px 0 32px;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .site-home .works-grid {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    gap: 24px;
  }

  .site-home .works-nav-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 12px;
    height: auto;
    min-width: 0;
  }

  .site-home .works-grid[data-inline-mode="true"] .works-nav-list {
    display: none;
  }

  .site-home .works-inline-stack {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .site-home .works-inline-stack > .work-nav-card {
    margin-bottom: 12px;
    scroll-margin-top: 80px;
  }

  .site-home .works-inline-slot {
    height: 0;
    overflow: hidden;
    transition: height 320ms cubic-bezier(0.22, 1, 0.36, 1), margin-bottom 320ms ease;
  }

  .site-home .works-inline-slot[data-open="true"] {
    margin-bottom: 12px;
  }

  .site-home .works-inline-stack > .work-nav-card[data-expanded="true"] {
    border-bottom-color: rgba(0, 136, 255, 0.9);
  }

  .site-home .works-inline-stack > .work-nav-card[data-expanded="true"] .card-arrow {
    transform: rotate(90deg);
  }

  .site-home .work-nav-card,
  .site-home .work-stage-main,
  .site-home .work-info-left,
  .site-home .work-info-text {
    min-width: 0;
  }

  .site-home .card-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .site-home .card-meta-row { gap: 8px; }
  .site-home .meta-case { flex-shrink: 0; white-space: nowrap; }
  .site-home .meta-category { min-width: 0; text-align: right; }
  .site-home .card-title-row { gap: 8px; }
  .site-home .card-arrow { flex-shrink: 0; }

  .site-home .work-stage-main {
    height: auto;
  }

  .site-home .work-stage-viewport {
    flex: none;
    height: clamp(280px, 43vw, 440px);
    min-height: 0;
  }

  .site-home .work-stage-info {
    height: auto;
    min-height: 68px;
    gap: 12px;
    flex-wrap: wrap;
  }

  .site-home .depth-layout-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .site-home .depth-left-col,
  .site-home .depth-right-col {
    min-width: 0;
  }
}

@media (max-width: 960px) {
  /* 中窄版優先保留案例敘事與輪播控制，避免周邊 telemetry 侵入內容安全區。 */
  .site-home .viewport-telemetry-left,
  .site-home .viewport-telemetry-right {
    display: none;
  }

  .site-home .depth-watermark-left-bottom,
  .site-home .depth-watermark-right-bottom {
    display: none;
  }

  .site-home .assembly-canvas-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 14px;
    width: 100%;
    max-width: none;
    height: auto;
    aspect-ratio: auto;
    margin-top: 20px;
  }

  .site-home .assembly-radar-svg,
  .site-home .assembly-hub {
    display: none;
  }

  .site-home .assembly-canvas-box .cap-node {
    --node-scale: 1;
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    opacity: 1;
    transform: none;
  }

  html[data-section-motion="autoplay"][data-section-motion-ready]
    body.site-home:not([data-view])
    .assembly-canvas-box
    .cap-node[data-on="0"] {
    opacity: 0.55;
    transform: translate3d(0, 8px, 0);
  }

  html[data-section-motion="autoplay"][data-section-motion-ready]
    body.site-home:not([data-view])
    .assembly-canvas-box
    .cap-node[data-on="0"]
    .cap-diamond-badge {
    border-color: rgba(0, 153, 255, 0.28);
    box-shadow: 0 0 4px rgba(0, 150, 255, 0.12);
  }

  html[data-section-motion="autoplay"][data-section-motion-ready]
    body.site-home:not([data-view])
    .assembly-canvas-box
    .cap-node[data-on="1"] {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  .site-home .assembly-canvas-box .cap-diamond-badge {
    position: relative;
    inset: auto;
    order: 0;
  }
  .site-home .assembly-canvas-box .cap-pill-card {
    position: relative;
    inset: auto;
    transform: none;
    order: 1;
    flex: 1;
    min-width: 0;
    min-height: 60px;
    justify-content: center;
    white-space: normal;
  }

  .site-home .cap-name { overflow-wrap: anywhere; }
}

@media (max-width: 880px) {
  .site-home .works-nav-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .site-home .why-doway-cards {
    grid-auto-rows: auto;
  }

  .site-home .assembly-canvas-box {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  /* Sec05 merges each icon and label into one compact capability card. */
  .site-home .assembly-canvas-box .cap-node {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 16px;
    min-height: 76px;
    padding: 10px 11px;
    box-sizing: border-box;
    border: 1px solid rgba(0, 150, 255, 0.38);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 6px 18px rgba(0, 50, 150, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .site-home .assembly-canvas-box .cap-diamond-badge {
    width: 34px;
    height: 34px;
    margin: 0;
  }

  .site-home .assembly-canvas-box .cap-icon {
    width: 16px;
    height: 16px;
  }

  .site-home .assembly-canvas-box .cap-pill-card {
    min-height: 0;
    padding: 0;
    align-items: flex-start;
    justify-content: center;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    text-align: left;
  }

  .site-home .assembly-canvas-box .cap-corner-tl,
  .site-home .assembly-canvas-box .cap-corner-tr,
  .site-home .assembly-canvas-box .cap-corner-bl,
  .site-home .assembly-canvas-box .cap-corner-br {
    display: none;
  }

  .site-home .assembly-canvas-box .cap-tag {
    font-size: 9.5px;
    line-height: 1.2;
  }

  .site-home .assembly-canvas-box .cap-name {
    font-size: 12px;
    line-height: 1.28;
    overflow-wrap: normal;
  }

  .site-home .depth-eyebrow-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .site-home .depth-eyebrow-code,
  .site-home .depth-intensity-badge {
    white-space: nowrap;
  }

  .site-home .work-stage-viewport {
    height: 280px;
  }

  .site-home .stage-slides-container {
    padding-inline: 0;
  }

  .site-home .stage-media-stack::after {
    background: linear-gradient(
      0deg,
      rgba(235, 244, 251, 0.96) 0%,
      rgba(235, 244, 251, 0.84) 34%,
      rgba(235, 244, 251, 0.42) 58%,
      rgba(235, 244, 251, 0.06) 100%
    );
    box-shadow: inset 0 -30px 54px rgba(211, 229, 242, 0.18);
  }

  .site-home .work-frame-media img {
    object-position: 58% center;
  }

  .site-home .work-frame-copy {
    top: auto;
    right: 58px;
    bottom: 70px;
    left: 18px;
    width: auto;
    transform: none;
  }

  .site-home .work-frame-copy .slide-frame-tag {
    margin-bottom: 7px;
    font-size: 9px;
    letter-spacing: 0.1em;
  }

  .site-home .slide-main-title {
    font-size: clamp(20px, 6vw, 25px);
    margin-bottom: 6px;
    line-height: 1.18;
  }

  .site-home .work-frame-copy .slide-sub-desc {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 11.5px;
    line-height: 1.45;
  }

  .site-home .work-stage-info {
    padding: 14px 16px;
  }

  .site-home .work-info-right {
    width: 100%;
    justify-content: flex-end;
  }

  html[lang="en"] .site-home #works .works-head-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  html[lang="en"] .site-home #works .works-status-block {
    align-self: flex-end;
  }
}

@media (max-width: 340px) {
  .site-home .assembly-canvas-box {
    gap: 8px;
  }

  .site-home .assembly-canvas-box .cap-node {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 14px;
    min-height: 78px;
    padding: 8px;
  }

  .site-home .assembly-canvas-box .cap-diamond-badge {
    width: 30px;
    height: 30px;
  }

  .site-home .assembly-canvas-box .cap-icon {
    width: 14px;
    height: 14px;
  }

  .site-home .assembly-canvas-box .cap-tag {
    font-size: 7px;
    letter-spacing: 0.08em;
  }

  .site-home .assembly-canvas-box .cap-name {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-home .works-inline-slot { transition: none; }
}
