@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono-var.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans SC";
  src: url("assets/fonts/noto-sans-sc-subset.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  flex: 0 0 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--line-2);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav.open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav.open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.nav.open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.dbm-toast {
  position: fixed;
  top: 76px;
  left: 50%;
  z-index: 9999;
  max-width: min(88vw, 480px);
  padding: 16px 26px;
  text-align: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent-2);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  animation: dbm-toast 1.5s ease forwards;
}

.dbm-toast.is-error {
  border-top-color: #e26d6d;
}

.dbm-toast .t-en {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
}

.dbm-toast .t-cn {
  margin-top: 4px;
  font-family: var(--cn);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
}

@keyframes dbm-toast {
  0% {
    opacity: 0;
    transform: translate(-50%, -12px);
  }
  12%,
  80% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
}

@media (max-width: 1200px) {
  html,
  body {
    min-width: 0;
    max-width: 100%;
  }

  .nav {
    padding-inline: 24px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav .links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 49;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: 6px 24px 16px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(16, 35, 26, 0.08);
  }

  .nav.open .links {
    display: flex;
  }

  .nav .links > a,
  .nav .links .has-sub > a {
    width: 100%;
    min-height: 50px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
  }

  .nav .links .has-sub {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .nav .links .sub {
    position: static;
    display: flex;
    min-width: 0;
    padding: 0 0 8px 14px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .nav .links .sub a {
    padding: 11px 8px;
    border-bottom: 0;
  }

  .nav .right {
    margin-left: auto;
    gap: 12px;
  }

  .hero {
    height: auto;
    min-height: 100svh;
    padding-top: 96px;
    padding-bottom: 64px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 34px;
    height: auto;
  }

  .hero .meta-row {
    display: none;
  }

  .hero-radar {
    width: min(100%, 520px);
    margin-inline: auto;
  }

  .mp-hero {
    min-height: calc(100svh - 64px);
  }

  .s-product .sticky-track {
    grid-template-columns: 1fr;
  }

  .s-product .left {
    position: static;
    height: auto;
    padding: 48px var(--pad-x);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .s-product .right {
    padding: 56px var(--pad-x);
    gap: 56px;
  }

  .s-product .step {
    min-height: 0;
  }

  .s-contact .form-wrap {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .s-contact .info {
    position: static;
  }

  .footer .row {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .footer .brand {
    grid-column: 1 / -1;
  }
}

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

  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  .nav {
    padding-inline: 14px;
  }

  .nav .brand {
    min-width: 42px;
  }

  .nav .right {
    gap: 8px;
  }

  .nav .cta {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .nav .lang button {
    min-width: 34px;
    padding: 6px 9px;
  }

  .section {
    padding: 72px var(--pad-x);
  }

  .hero {
    min-height: 0;
    padding-top: 96px;
  }

  .hero h1 {
    font-size: clamp(36px, 11vw, 54px);
    overflow-wrap: anywhere;
  }

  .hero h1 .stack {
    white-space: normal;
  }

  [data-lang="cn"] .hero h1 {
    font-size: clamp(34px, 10vw, 48px);
  }

  .hero .lede {
    font-size: 13px;
  }

  .hero .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero .cta-row a {
    justify-content: center;
    min-height: 52px;
    text-align: center;
  }

  .hero-radar {
    width: min(88vw, 360px);
  }

  .hero .mold-stage canvas {
    width: 100%;
    height: auto;
  }

  .section-title,
  .mp-hero h1 {
    font-size: clamp(32px, 9vw, 52px);
    overflow-wrap: anywhere;
  }

  .s-product .right {
    padding-inline: var(--pad-x);
  }

  .s-product .step h3 {
    font-size: clamp(30px, 8vw, 48px);
    overflow-wrap: anywhere;
  }

  .s-cases .cases,
  .cust-featured,
  .cust-oem-grid,
  .mp-two {
    grid-template-columns: minmax(0, 1fr);
  }

  .s-cases .case,
  .cust-inner,
  .cust-feat,
  .cust-title,
  .cust-feat-name,
  .cust-dom-head,
  .mp-two,
  .mp-two > *,
  .mp-snapshot,
  .s-mat .section-inner > .reveal {
    min-width: 0;
    max-width: 100%;
  }

  .cust-title,
  .cust-feat-name,
  .cust-feat-cat,
  .cust-dom-eyebrow,
  .cust-dom-sub {
    overflow-wrap: anywhere;
  }

  .cust-feat-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .cust-oem-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .oem-card {
    min-width: 0;
    padding: 20px 16px;
  }

  .oem-en,
  .oem-cn {
    overflow-wrap: anywhere;
  }

  .mp-table-wrap,
  .spec-table,
  .s-mat .section-inner > .reveal,
  .mp-two > .reveal {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mp-table {
    min-width: 540px;
  }

  .mp-caption,
  .spec-foot {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .s-colors .color-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .s-contact form {
    min-width: 0;
    padding: 18px;
  }

  .s-contact form .row {
    grid-template-columns: 1fr;
  }

  .cf-turnstile,
  .cf-turnstile iframe {
    max-width: 100%;
  }

  .footer .row {
    grid-template-columns: 1fr;
  }

  .footer .brand {
    grid-column: auto;
  }
}

@supports not (overflow: clip) {
  @media (max-width: 760px) {
    html,
    body {
      overflow-x: hidden;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle span {
    transition: none;
  }
}
