/* ==========================================================================
   v4 — mobile layout pass (≤760px)
   Loaded after style.css / v2.css / v3.css.
   Goals: no clipped cards, no sideways text, readable captions, sane rhythm.
   ========================================================================== */

@media (max-width: 760px) {
  :root {
    --pad: 18px;
  }

  html,
  body {
    overflow-x: clip;
  }

  .container {
    padding-left: var(--pad);
    padding-right: var(--pad);
    max-width: 100%;
  }

  /* ---------- type scale ---------- */
  body {
    font-size: 15px;
    line-height: 1.72;
  }

  .hero h1,
  .page-hero h1 {
    font-size: clamp(30px, 8.4vw, 40px) !important;
    line-height: 1.1 !important;
    letter-spacing: -0.03em;
  }

  .section-head h2,
  .section h2,
  .page-hero h2 {
    font-size: clamp(23px, 6.4vw, 30px) !important;
    line-height: 1.2 !important;
  }

  h3 {
    font-size: 16.5px !important;
    line-height: 1.35;
  }

  p,
  li {
    font-size: 14.8px;
  }

  /* ---------- rhythm ---------- */
  .hero {
    padding-top: 22px !important;
    padding-bottom: 30px !important;
  }

  .section {
    padding: 52px 0 !important;
  }

  .page-hero,
  .legal-page .page-hero {
    padding: 30px 0 26px !important;
  }

  /* ---------- hero: cards become a fixed 3-up row ---------- */
  .hero__inner {
    display: block !important;
  }

  .hero__copy {
    max-width: 100%;
  }

  .hero__stage.slate {
    margin: 24px 0 0 !important;
    padding-top: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: auto !important;
    display: grid !important;
    grid-template-columns: 1.55fr 1fr;
    grid-template-rows: auto 1fr 1fr;
    gap: 8px;
    align-items: stretch;
  }

  .slate__bar {
    grid-column: 1 / -1;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    height: 30px !important;
    margin: 0 0 4px;
    border-radius: 8px;
    font-size: 9.5px;
    letter-spacing: 0.06em;
    padding-left: 10px;
  }

  .slate__bar::before {
    position: static !important;
    display: inline-block;
    width: 26px;
    height: 30px;
    margin-right: 8px;
    vertical-align: middle;
  }

  .hero__stage.slate .vcard,
  .hero__stage.slate .vcard--a,
  .hero__stage.slate .vcard--b,
  .hero__stage.slate .vcard--c {
    position: static !important;
    display: block !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    aspect-ratio: 9 / 14 !important;
    margin: 0 !important;
    transform: none !important;
    box-shadow: 0 8px 20px rgba(11, 18, 32, 0.14);
  }

  .hero__stage.slate .vcard--a {
    grid-row: span 2;
    aspect-ratio: 9 / 14 !important;
  }

  .hero__stage.slate .vcard--b,
  .hero__stage.slate .vcard--c {
    aspect-ratio: 9 / 10 !important;
    align-self: stretch;
  }

  .hero__stage.slate .vcard--b {
    transform: translateY(-8px) rotate(0.5deg);
  }

  .hero__stage.slate .vcard--c {
    transform: rotate(2.5deg);
  }

  .vcard__tag {
    font-size: 9px !important;
    padding: 3px 7px;
  }

  .hero__cta {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  .hero__cta .btn {
    width: 100%;
    justify-content: center;
    padding: 13px 10px;
    font-size: 14px;
  }

  .btn {
    min-height: 46px;
  }

  /* spec sheet */
  .spec {
    grid-template-columns: 1fr !important;
    gap: 0;
    margin-top: 22px !important;
    max-width: 100%;
  }

  .spec__row {
    padding: 9px 0;
  }

  .spec__row span {
    font-size: 11px;
  }

  .spec__row b {
    font-size: 13px;
  }

  /* ---------- trust bar: 2×2 ---------- */
  .trust {
    padding: 22px 0 !important;
  }

  .trust__inner {
    display: block !important;
  }

  .trust__label {
    margin: 0 0 12px !important;
    font-size: 10.5px;
    letter-spacing: 0.14em;
  }

  .trust__stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px 14px;
    width: 100%;
  }

  .trust__stat {
    display: block !important;
    border: 0 !important;
    padding: 0 !important;
    min-width: 0;
  }

  .trust__stat b {
    display: block;
    font-size: 26px !important;
    line-height: 1.1;
    letter-spacing: -0.02em;
  }

  .trust__stat span {
    display: block;
    font-size: 11px !important;
    margin-top: 3px;
    white-space: normal !important;
    writing-mode: horizontal-tb !important;
  }

  /* ---------- film strip ---------- */
  .filmstrip {
    padding: 14px 0;
  }

  .frame {
    width: 118px !important;
    aspect-ratio: 4 / 3 !important;
  }

  .frame figcaption {
    font-size: 9px !important;
    padding: 2px 4px;
  }

  /* ---------- business cards ---------- */
  .biz {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .biz-card__media {
    min-height: 190px;
    aspect-ratio: auto !important;
  }

  /* the floating schedule pill sits at the bottom of the board: leave room so it
     never covers the last row of the mock terminal */
  .biz-card__media--board {
    padding-bottom: 58px !important;
  }

  .biz-card__media-tag {
    font-size: 10.5px !important;
    padding: 5px 10px !important;
  }

  .mini-board {
    padding: 10px !important;
    gap: 5px;
  }

  .mini-board__head {
    margin-bottom: 6px;
    font-size: 10px;
  }

  .mini-board__row {
    padding: 6px 8px !important;
    gap: 7px;
    border-radius: 8px;
  }

  .mini-board__row b,
  .mini-board__row > b,
  .mini-board__avatar {
    width: 18px;
    height: 18px;
    font-size: 10px;
    line-height: 18px;
    flex: 0 0 18px;
  }

  .mini-board__row span {
    font-size: 11px !important;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* the zh markup keeps its label in a plain <span>: let it wrap instead of clipping */
  .mini-board__row span:not(.mini-board__avatar):not(.mini-board__state) {
    font-size: 10.5px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  /* the title/caption sit in a <div>, they must wrap instead of being clipped */
  .mini-board__row div {
    min-width: 0;
  }

  .mini-board__row div > b {
    display: block;
    font-size: 10.5px !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    overflow: visible !important;
  }

  .mini-board__row div > small {
    display: block;
    margin-top: 1px;
    font-size: 9.5px !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    overflow: visible !important;
  }

  /* avatar + state keep their own box even though they are <span> too */
  .mini-board__row .mini-board__avatar {
    display: grid !important;
    place-items: center;
    width: 18px !important;
    height: 18px !important;
    padding: 0 !important;
    font-size: 9.5px !important;
    line-height: 1 !important;
    overflow: visible !important;
  }

  .mini-board__row em,
  .mini-board__row .mini-board__state {
    font-size: 9px !important;
    line-height: 1.5 !important;
    padding: 1px 5px !important;
    flex: 0 0 auto;
    white-space: nowrap !important;
    overflow: visible !important;
  }

  .biz-card__body {
    padding: 20px 18px 22px !important;
  }

  .biz-card__tags {
    gap: 6px;
  }

  .biz-card__tags span {
    font-size: 11px !important;
  }

  /* ---------- work / case wall ---------- */
  .work__bar {
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 16px;
    scrollbar-width: none;
  }

  .work__bar::-webkit-scrollbar {
    display: none;
  }

  .work__bar .filter {
    flex: 0 0 auto;
    font-size: 12px;
    padding: 8px 13px;
  }

  .work__grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .case {
    aspect-ratio: 3 / 4 !important;
    border-radius: 14px;
  }

  .case__body {
    padding: 10px 10px 11px !important;
    gap: 5px;
  }

  .case__cat {
    font-size: 9px !important;
    letter-spacing: 0.08em;
  }

  .case__title {
    font-size: 13px !important;
    line-height: 1.32 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .case__play {
    width: 30px !important;
    height: 30px !important;
    top: 8px !important;
    right: 8px !important;
  }

  .case__dur {
    font-size: 9px;
    padding: 2px 5px;
    top: 8px;
    left: 8px;
  }

  /* ---------- pricing ---------- */
  .packs {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .pack {
    padding: 20px 18px 18px !important;
  }

  .pack__price {
    font-size: 34px !important;
  }

  .price-tabs {
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  .price-tabs::-webkit-scrollbar {
    display: none;
  }

  .prow {
    grid-template-columns: 1fr auto !important;
    gap: 2px 10px !important;
    padding: 12px 14px !important;
  }

  .prow__name {
    font-size: 13.5px !important;
  }

  .prow__desc {
    grid-column: 1 / -1;
    font-size: 12px !important;
    line-height: 1.5;
  }

  .prow__price {
    font-size: 14px !important;
    text-align: right;
  }

  /* ---------- facts / about ---------- */
  .about-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .fact-list {
    width: 100%;
  }

  .fact {
    display: block !important;
    padding: 12px 0 !important;
    gap: 0 !important;
  }

  .fact dt {
    font-size: 10.5px !important;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
    color: var(--muted-2);
  }

  .fact dd {
    font-size: 14.5px !important;
    line-height: 1.55;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .map-frame {
    margin-top: 8px;
  }

  /* ---------- forms ---------- */
  .contact__grid,
  .lead,
  .contact {
    grid-template-columns: 1fr !important;
  }

  .field input,
  .field select,
  .field textarea,
  .lead input,
  .lead select,
  .lead textarea {
    font-size: 16px !important; /* stop iOS zoom on focus */
  }

  /* ---------- tuai dark page ---------- */
  .role-grid,
  .deploy-grid,
  .stat-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .stat-row b {
    font-size: 24px !important;
  }

  .stat-row span {
    font-size: 10.5px !important;
  }

  /* ---------- footer ---------- */
  .site-footer {
    padding: 40px 0 28px !important;
  }

  .footer__cols {
    grid-template-columns: 1fr 1fr !important;
    gap: 22px !important;
  }

  .footer__cols h4 {
    font-size: 10px;
  }

  .footer__cols li,
  .footer__cols a {
    font-size: 13px !important;
  }

  /* keep the float from sitting on top of body copy */
  .wa-float,
  .wa,
  [class*="whatsapp"] {
    right: 14px !important;
    bottom: 14px !important;
    width: 50px !important;
    height: 50px !important;
  }

  /* legal pages */
  .legal {
    padding: 0 !important;
  }

  .legal p,
  .legal li {
    font-size: 14.5px !important;
    line-height: 1.8;
  }

  .legal table {
    font-size: 12.5px;
  }
}

@media (max-width: 380px) {
  .hero__cta {
    grid-template-columns: 1fr;
  }

  .work__grid,
  .role-grid,
  .deploy-grid {
    grid-template-columns: 1fr !important;
  }
}




@media (max-width: 760px) {
  .fact dd { margin-left: 0 !important; }
  .fact dt { color: var(--muted-2); }
  .brand__text { max-width: 46vw; }
  .nav__actions .lang-switch { margin-right: 2px; }
}
