/* Kraft Junction — shared mobile / touch layout */
@media (max-width: 768px) {
  .section {
    min-height: auto;
    padding: max(72px, 10vh) 5vw 8vh;
  }
  .section.compact {
    padding: max(64px, 9vh) 5vw;
  }
  .section.hero-kj,
  .section.hero-abx,
  .section.hero-films,
  .section.hero-products {
    padding-top: max(80px, 12vh);
    padding-bottom: 5vh;
  }
  .hero-kj,
  .hero-abx,
  .hero-films.hero-kj,
  .hero-products.hero-kj {
    padding-top: max(72px, 10vh);
  }
  .hero-kj > .title,
  .hero-kj > h1.title,
  .hero-abx > .title,
  .hero-films > .title,
  .hero-products > .title {
    font-size: clamp(1.65rem, 7vw, 2.5rem);
  }
  .hero-kj > .sub,
  .hero-abx > .sub,
  .hero-films > .sub,
  .hero-products > .sub {
    font-size: 0.95rem;
    text-align: left;
    text-justify: auto;
    padding: 0;
  }
  .top-link {
    top: max(12px, env(safe-area-inset-top, 0px));
    left: max(12px, env(safe-area-inset-left, 0px));
    padding: 10px 14px;
    font-size: 9px;
    gap: 8px;
  }
  .top-link .kj-logo-glass {
    display: none;
  }
  .title {
    font-size: clamp(1.85rem, 8vw, 3rem);
  }
  .title-sm {
    font-size: clamp(1.45rem, 6vw, 2.2rem);
  }
  .sub {
    font-size: 0.98rem;
    text-align: left;
    text-justify: auto;
  }
  .btn-row {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .btn-row .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
  }
  .viz-panel,
  .viz-canvas {
    min-height: 180px;
  }
  #products .product-panel,
  #creative .creative-panel,
  #films .film-panel,
  #music .music-panel,
  #audioboxx .signal-scope {
    min-height: auto;
    padding: 16px;
  }
  #homeCreativeViz,
  #homeFilmViz,
  #homeProductViz,
  #homeMusicViz,
  .signal-canvas {
    min-height: 180px;
    height: min(240px, 42vw);
  }
}

@media (max-width: 480px) {
  .section {
    padding-left: 4.5vw;
    padding-right: 4.5vw;
  }
  .chip {
    font-size: 9px;
    padding: 8px 12px;
  }
}

/* Touch devices — disable hover lift / sticky hover */
@media (hover: none) {
  .kpi:hover,
  .kj-card:hover,
  .abx-card:hover,
  .eco-block:hover,
  .pipe-step:hover,
  .spec:hover,
  .case-hero:hover,
  .eco-card:hover,
  .theia-art-card:hover,
  .film-slate:hover {
    transform: none;
  }
  .theia-art-card--popup::after {
    opacity: 0.85;
    transform: scale(1);
  }
  .btn:hover {
    transform: none;
  }
}

/* Connect form — mobile */
@media (max-width: 640px) {
  .kj-connect-section {
    padding: max(72px, 10vh) 4.5vw 6vh;
  }
  .kj-connect-panel {
    padding: 20px 16px 24px;
    border-radius: 24px;
  }
  .kj-connect-form {
    grid-template-columns: 1fr;
  }
  .kj-field input,
  .kj-field textarea,
  .kj-field select {
    font-size: 16px;
  }
  .kj-connect-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .transmit-btn,
  .kj-otp-send-btn,
  .kj-otp-verify-btn {
    width: 100%;
    max-width: none;
    justify-content: center;
  }
  .connect-note {
    max-width: none;
    text-align: center;
  }
  .signal-header {
    flex-direction: column;
    align-items: stretch;
  }
  .signal-meter {
    margin-left: 0;
    max-width: 100%;
  }
}

@media (max-width: 520px) {
  .kj-connect-hub {
    width: 100%;
    max-width: 100%;
    aspect-ratio: auto;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .connect-hub-canvas {
    display: none;
  }
  .junction-core {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    margin: 0 auto 4px;
    width: 72px;
    height: 72px;
  }
  .junction-lanes {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }
  .lane-btn {
    position: static;
    transform: none;
    width: 100%;
    min-height: 48px;
    padding: 12px 8px;
  }
  .lane-btn span {
    font-size: 8px;
    letter-spacing: 0.12em;
  }
  .lane-btn[data-lane='creative'],
  .lane-btn[data-lane='films'],
  .lane-btn[data-lane='products'],
  .lane-btn[data-lane='audioboxx'],
  .lane-btn[data-lane='talent'],
  .lane-btn[data-lane='general'] {
    left: auto;
    top: auto;
  }
}

@media (max-width: 380px) {
  .kj-otp-digit-cells {
    gap: 4px;
  }
  .kj-otp-digit-cell {
    height: 44px;
    font-size: 1.2rem;
    border-radius: 8px;
  }
  .kj-otp-digit-shell {
    max-width: 100%;
  }
  .kj-otp-step {
    grid-template-columns: 32px 1fr;
    gap: 10px;
  }
  .kj-otp-step-num {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
}

/* Poster grids */
@media (max-width: 360px) {
  .theia-art-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .theia-poster-modal-close {
    width: 44px;
    height: 44px;
    top: 8px;
    right: 8px;
  }
  .theia-poster-modal {
    padding: max(12px, env(safe-area-inset-top, 0px)) 12px 12px;
  }
}

/* Homepage-only (also safe on other pages) */
@media (max-width: 768px) {
  .site-header {
    top: max(12px, env(safe-area-inset-top, 0px));
    padding: 0 max(14px, env(safe-area-inset-left, 0px));
  }
  .hero {
    padding-top: max(88px, 14vh);
  }
  .hero h1 {
    font-size: clamp(2.2rem, 11vw, 4rem);
  }
  .sub {
    text-align: left;
    text-justify: auto;
  }
  .panel,
  .panel-tall {
    height: auto;
    min-height: 220px;
  }
  .lens,
  .product-core,
  .wave {
    display: none;
  }
  .case-block {
    height: auto;
    min-height: 280px;
    aspect-ratio: 4 / 3;
    border-radius: 24px;
  }
  .case-copy {
    bottom: 20px;
    left: 16px;
    right: 16px;
    max-width: none;
  }
  #films,
  #music {
    gap: 36px;
    padding-bottom: 8vh;
  }
}

@media (max-width: 480px) {
  .intro-line {
    word-break: normal;
    overflow-wrap: break-word;
    font-size: clamp(0.95rem, 4.2vw, 1.25rem);
    letter-spacing: 0.06em;
  }
  .intro-word {
    white-space: normal;
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-inner {
    padding-top: max(88px, 14vh);
    padding-bottom: max(32px, env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 992px) {
  .nav-backdrop {
    display: block;
  }
}
