/* ==========================================================================
   云蔚 LIMS — Marketing site
   Light mist surface, brand teal ink, one idea per screen.
   ========================================================================== */

@font-face {
  font-family: "Yunwei Brand Rounded";
  src: url("../assets/fonts/yunwei-rounded.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+4E91, U+851A;
}

:root {
  --bg: #f5f9f8;
  --bg-raised: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.86);
  --line: rgba(15, 95, 99, 0.10);
  --line-strong: rgba(15, 95, 99, 0.20);

  --ink: #0f2a2b;
  --ink-2: #45605f;
  --ink-3: #6f8584;

  --accent: #167c80; /* logo teal */
  --accent-strong: #0f5f63;
  --accent-ink: #ffffff;
  --accent-wash: rgba(22, 124, 128, 0.07);

  --font-sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --font-brand: "Yunwei Brand Rounded", "PingFang SC", "Noto Sans SC", sans-serif;

  --container: 1200px;
  --gutter: clamp(20px, 5vw, 56px);
  --section-py: clamp(96px, 13vw, 168px);
  --radius: 14px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}

main {
  transition: opacity 0.14s linear;
}

html.is-jumping main {
  opacity: 0;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: rgba(245, 249, 248, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 68px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.yunwei-glyph {
  font-family: var(--font-brand);
  font-size: 22px;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.brand-wordmark-svg {
  height: 24px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

.nav-links a {
  font-size: 14px;
  color: var(--ink-2);
  transition: color 0.2s var(--ease);
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Pixel field toggle: a 2x2 pixel glyph that lights when on. */
.field-toggle {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.field-toggle:hover {
  border-color: var(--accent);
}

.field-toggle-glyph {
  display: grid;
  grid-template-columns: repeat(2, 5px);
  gap: 3px;
}

.field-toggle-glyph i {
  width: 5px;
  height: 5px;
  background: var(--ink-3);
  transition: background-color 0.3s var(--ease);
}

.field-toggle[aria-pressed="true"] .field-toggle-glyph i {
  background: var(--accent);
}

.field-toggle[aria-pressed="true"] .field-toggle-glyph i:nth-child(2),
.field-toggle[aria-pressed="true"] .field-toggle-glyph i:nth-child(3) {
  background: rgba(22, 124, 128, 0.4);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease),
    scale 0.15s var(--ease);
}

.btn:active {
  scale: 0.98;
}

.btn-sm {
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
}

.btn-lg {
  height: 52px;
  padding: 0 26px;
  font-size: 16px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.btn-ghost:hover {
  border-color: var(--accent);
}

.text-link {
  font-size: 14px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.text-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.field-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero .field-canvas {
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
}

/* Keeps the headline column calm without hiding the field. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 55% at 22% 52%, rgba(245, 249, 248, 0.9), rgba(245, 249, 248, 0) 70%);
}

.hero-inner {
  padding-top: 120px;
  padding-bottom: 120px;
}

.hero-kicker {
  margin: 0 0 28px;
}

.hero-title {
  margin: 0;
  font-size: clamp(48px, 8.4vw, 112px);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.035em;
}

.hero-title .accent {
  color: var(--accent);
}

.hero-sub {
  max-width: 34em;
  margin: 28px 0 0;
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.65;
  color: var(--ink-2);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 16px;
  margin-top: 44px;
}

.hero-cta .text-link {
  margin-left: 8px;
}

.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 28px;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.hero-scroll::after {
  content: "";
  width: 1px;
  height: 36px;
  background: linear-gradient(var(--accent), transparent);
}

/* --------------------------------------------------------------------------
   Sections (one idea per screen)
   -------------------------------------------------------------------------- */
.section {
  position: relative;
  padding: var(--section-py) 0;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 820px;
  margin-bottom: clamp(48px, 6vw, 80px);
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-kicker {
  margin: 0 0 20px;
  color: var(--accent);
}

.section-title {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.section-title .dim {
  color: var(--ink-3);
}

.section-sub {
  margin: 22px 0 0;
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   Product tour — one scene per screen; media rises and settles as it scrolls
   in (--p goes 0 → 1 across the scene's entry), videos play only in view.
   Media is never cropped: frames take the media's own aspect ratio.
   -------------------------------------------------------------------------- */
.tour {
  position: relative;
  border-top: 1px solid var(--line);
}

@property --p {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.scene {
  --p: 0;
  transition: --p 1s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 76px 0 36px;
}

.scene + .scene {
  border-top: 1px solid var(--line);
}

.scene.is-active {
  --p: 1;
}

.scene-head {
  max-width: 1040px;
  margin: 0 auto clamp(20px, 3vh, 36px);
  text-align: center;
  opacity: calc(0.15 + var(--p) * 0.85);
  translate: 0 calc((1 - var(--p)) * 40px);
}

.scene-kicker {
  margin: 0 0 18px;
  color: var(--accent);
}

.scene-title {
  margin: 0;
  font-size: clamp(32px, 4.2vw, 60px);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.03em;
}

.br-sm {
  display: none;
}

.scene-title .accent {
  color: var(--accent);
}

.scene-sub {
  max-width: 40em;
  margin: 18px auto 0;
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--ink-2);
}

/* Every scene fits one screen: media size follows the viewport height
   (≈400px goes to the heading, chips and padding). */
.scene-stage {
  position: relative;
  max-width: min(1080px, max(520px, calc((100svh - 420px) * 1.6)));
  margin: 0 auto;
  scale: calc(0.9 + var(--p) * 0.1);
  opacity: calc(0.25 + var(--p) * 0.75);
  transform-origin: 50% 0;
}

.scene-note {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
}

/* Browser-like frame around a 16:10 capture (1440x900 / 1600x1000). */
.frame {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 40px 110px -40px rgba(15, 95, 99, 0.28), 0 16px 40px -20px rgba(15, 42, 43, 0.22);
}

.frame-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #eef4f3;
}

.frame-note {
  margin-left: auto;
  font-size: 11.5px;
  line-height: 9px;
  color: var(--ink-3);
}

.frame-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(15, 95, 99, 0.2);
}

/* Split scenes: text on the left, a lens panel on the right that focuses on
   one part of the real screen at a time and shifts to the next. */
.scene.split .container {
  max-width: 1720px;
  padding-right: max(var(--gutter), 104px); /* room for the page rail's label */
  display: grid;
  /* a narrow text column; the video takes the rest */
  grid-template-columns: minmax(240px, 22vw) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 3vw, 56px);
}

.scene.split .scene-head {
  margin: 0;
  text-align: left;
}

.scene.split .scene-title {
  font-size: clamp(26px, 2.3vw, 40px);
}

.scene.split .scene-sub {
  margin-left: 0;
}

.scene.split .scene-stage {
  width: 100%;
  max-width: min(100%, calc((100svh - 150px) * 4 / 3));
  margin: 0 0 0 auto;
  transform-origin: 50% 50%;
}

/* the live 小蔚 above the heading of the 小蔚 / 代办 pages */
.xw-live {
  width: 84px;
  height: 84px;
  margin: 0 0 4px -10px;
}

.xw-live svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.lens-chips {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: clamp(22px, 4vh, 40px);
}

.lens-chips button {
  position: relative;
  padding: 8px 0 8px 18px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-3);
  cursor: pointer;
  transition: color 0.35s var(--ease);
}

.lens-chips button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--line-strong);
  transition: background 0.35s var(--ease);
}

.lens-chips button:hover {
  color: var(--ink-2);
}

.lens-chips button.is-on {
  color: var(--ink);
}

.lens-chips button.is-on::before {
  background: var(--accent);
}

/* the whole-lab page: the lit stop opens one sentence of its own (wide
   screens, where the steps are a column; js/lab-scene.js lights the stop) */
.step-more {
  display: none;
}

@media (min-width: 961px) {
  .lab-bridge .scene-sub {
    display: none;
  }
  .step-more {
    display: block;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    font-size: 14px;
    line-height: 1.5;
    white-space: nowrap; /* one line each, so the pinned text never shifts between stops */
    color: var(--ink-2);
    transition: max-height 0.35s var(--ease), opacity 0.35s var(--ease);
  }
  .is-on > .step-more {
    max-height: 1.5em;
    opacity: 1;
  }
}

.lens {
  position: relative;
}

/* CRM page: messaging / CRM integrations, with honest status */
.integrations {
  margin-top: clamp(18px, 3vh, 30px);
  padding-top: clamp(14px, 2.4vh, 22px);
  border-top: 1px solid var(--line);
}

.integrations-lead {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--ink-2);
}

.integrations ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.integrations li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13px;
}

.integrations b {
  font-weight: 500;
  color: var(--ink);
}

.integrations .st {
  font-size: 12px;
  color: var(--ink-2);
}

.integrations .st-ok {
  color: var(--accent);
}

.integrations .st-plan {
  color: var(--ink-3);
}

.lens-video {
  display: block;
  width: 100%;
  height: auto; /* the width/height attributes must not pin the height */
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #f3f5f5;
}

.lens-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(6, 10, 10, 0.08);
}

.lens-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.6s var(--ease);
}

/* Phones: three devices fan out as the scene settles. */
.phones {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  height: clamp(340px, calc(100svh - 360px), 600px);
  max-width: none;
  scale: 1;
}

.phone {
  margin: 0;
  height: 100%;
  aspect-ratio: 600 / 1298;
  padding: 10px;
  border-radius: 38px;
  background: #17201f;
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 90px -40px rgba(15, 95, 99, 0.35), 0 18px 40px -20px rgba(15, 42, 43, 0.3);
}

.phone img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 28px;
  background: #fff;
}

.p-mid {
  z-index: 2;
}

.p-left,
.p-right {
  height: 88%;
  z-index: 1;
}

.p-left {
  translate: calc(var(--p) * -24px + 60px) 0;
  rotate: calc(var(--p) * -6deg);
  margin-right: calc(var(--p) * 16px - 40px);
}

.p-right {
  translate: calc(var(--p) * 24px - 60px) 0;
  rotate: calc(var(--p) * 6deg);
  margin-left: calc(var(--p) * 16px - 40px);
}

/* Report pages: a stack that spreads into a row. */
.pages {
  display: flex;
  justify-content: center;
  height: clamp(300px, calc(100svh - 400px), 560px);
  max-width: none;
  scale: 1;
}

.rpage {
  margin: 0;
  height: 100%;
  aspect-ratio: 900 / 1273;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 30px 70px -30px rgba(15, 42, 43, 0.35), 0 0 0 1px rgba(15, 95, 99, 0.08);
}

.rpage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rpage + .rpage {
  margin-left: calc((1 - var(--p)) * -30% - 2%);
}

.pg-1 {
  z-index: 4;
  rotate: calc((1 - var(--p)) * -2deg);
}
.pg-2 {
  z-index: 3;
}
.pg-3 {
  z-index: 2;
}
.pg-4 {
  z-index: 1;
  rotate: calc((1 - var(--p)) * 2deg);
}

/* --------------------------------------------------------------------------
   Pages: every screen stands alone. On desktop the page snaps one screen per
   scroll (mandatory snap + snap-stop), like advancing a slide.
   -------------------------------------------------------------------------- */
.page {
  position: relative;
  min-height: 100svh;
}

.overview,
#deploy,
#contact {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#deploy,
#contact {
  padding: 84px 0 56px;
}

.overview {
  padding: 84px 0 56px;
  border-top: 1px solid var(--line);
}

.overview .section-head {
  max-width: none;
}

.overview .section-title .dim {
  color: var(--ink-3);
}

.overview .stats {
  margin-top: 0;
}

/* the demo ask: what the demo covers on the left, the button to the form on the right */
.demo-ask {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  max-width: 980px;
  margin: clamp(36px, 6vh, 64px) auto 0;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 30px 80px -40px rgba(15, 95, 99, 0.25);
}

.demo-ask-title {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.demo-ask-points {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  color: var(--ink-2);
}

.demo-ask-points li {
  position: relative;
  padding-left: 18px;
}

.demo-ask-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.demo-ask-cta {
  justify-self: end;
}

#contact .site-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 0 24px;
}

@media (min-width: 761px) and (min-height: 620px) {
  html {
    scroll-snap-type: y mandatory;
    scroll-padding-top: 0;
  }
  .page {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
  /* keep the two text-heavy pages inside one screen */
  #deploy .section-head,
  #contact .section-head {
    margin-bottom: clamp(24px, 4vh, 44px);
  }
  #deploy .plan {
    padding: clamp(22px, 3vh, 36px) clamp(24px, 3vw, 40px);
  }
  #deploy .iso {
    margin-top: 20px;
  }
  #deploy .plan-points {
    margin-top: 20px;
    gap: 14px 24px;
  }
  #deploy .plan-points li {
    padding-top: 10px;
  }
}

/* Right-hand page dots */
.page-rail {
  position: fixed;
  right: 22px;
  top: 50%;
  translate: 0 -50%;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-rail a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-3);
}

.page-rail a span {
  opacity: 0;
  translate: 6px 0;
  transition: opacity 0.25s var(--ease), translate 0.25s var(--ease);
  white-space: nowrap;
}

.page-rail:hover a span,
.page-rail a.is-on span {
  opacity: 1;
  translate: 0 0;
}

.page-rail a.is-on {
  color: var(--ink);
}

.page-rail i {
  order: 2;
  width: 6px;
  height: 6px;
  background: var(--ink-3);
  transition: background-color 0.25s var(--ease), scale 0.25s var(--ease);
}

.page-rail a.is-on i {
  background: var(--accent);
  scale: 1.5;
}

/* Devices & IoT concept board */
.iot {
  position: relative;
  max-width: min(1080px, max(560px, calc((100svh - 420px) * 1.78)));
  margin: 0 auto;
  aspect-ratio: 1000 / 560;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(ellipse 40% 50% at 50% 50%, rgba(22, 124, 128, 0.07), transparent 70%),
    var(--bg-raised);
}

.iot-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.iot-lines path {
  fill: none;
  stroke: rgba(22, 124, 128, 0.45);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.iot-lines path.planned {
  stroke: rgba(22, 124, 128, 0.25);
  stroke-dasharray: 5 6;
}

.iot-lines .pkt {
  fill: var(--accent-strong);
}

.iot-lines .pkt.planned {
  fill: rgba(22, 124, 128, 0.4);
}

.iot-node {
  position: absolute;
  width: 21%;
  translate: -50% -50%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 30px -18px rgba(15, 42, 43, 0.25);
}

.iot-node strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.iot-node .mono {
  font-size: 11px;
}

.iot-node.planned {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: none;
}

.iot-node.planned strong {
  color: var(--ink-2);
}

.n-l1 { left: 19%; top: 21.4%; }
.n-l2 { left: 19%; top: 50%; }
.n-l3 { left: 19%; top: 78.6%; }
.n-r1 { left: 81%; top: 21.4%; }
.n-r2 { left: 81%; top: 50%; }
.n-r3 { left: 81%; top: 78.6%; }

.badge {
  align-self: flex-start;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.badge.ok {
  border-color: rgba(22, 124, 128, 0.45);
  color: var(--accent);
}

.barcode {
  height: 22px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px, var(--ink) 8px 11px, transparent 11px 12px);
  opacity: 0.85;
}

.iot-core {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  gap: 2px;
  width: 15%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: radial-gradient(circle, #ffffff, #e3f1f0 70%);
  box-shadow: 0 0 50px rgba(22, 124, 128, 0.22);
  animation: core-breathe 3.6s ease-in-out infinite;
}

.iot-core-glyph {
  font-family: var(--font-brand);
  font-size: clamp(16px, 2.2vw, 26px);
  color: var(--accent);
}

@keyframes core-breathe {
  50% {
    box-shadow: 0 0 80px rgba(22, 124, 128, 0.34);
  }
}

/* Numbers */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(64px, 8vw, 104px);
  border-top: 1px solid var(--line-strong);
}

.stat {
  padding: 28px 0 0;
}

.stat + .stat {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.stat-value {
  font-size: clamp(36px, 4.4vw, 56px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink-2);
}


/* Deployment */
.deploy {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.plan {
  position: relative;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.plan-featured {
  border-color: var(--line-strong);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(22, 124, 128, 0.08), transparent 70%),
    var(--bg-card);
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
}

.plan-name {
  margin: 20px 0 8px;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.plan-desc {
  margin: 0;
  color: var(--ink-2);
}

.plan-desc code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--accent);
}

.plan-points {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 28px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.plan-points li {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.plan-points strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 600;
}

.plan-points span {
  font-size: 14px;
  color: var(--ink-2);
}

.plan-secondary {
  display: flex;
  flex-direction: column;
}

.plan-secondary .plan-name {
  margin-top: 0;
}

.plan-secondary .text-link {
  margin-top: auto;
  align-self: flex-start;
}

.plan-secondary .plan-desc + .plan-desc {
  margin: 12px 0 32px;
}

/* Isolation diagram: one stack per lab, nothing shared. */
.iso {
  display: flex;
  gap: 12px;
  margin-top: 36px;
}

.iso-lab {
  flex: 1;
  padding: 14px 14px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
}

.iso-lab .mono {
  display: block;
  margin-bottom: 10px;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iso-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.iso-row + .iso-row {
  margin-top: 6px;
}

.iso-row i {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  background: var(--accent);
}

.iso-row i.storage {
  background: rgba(22, 124, 128, 0.4);
}

/* Contact */
.contact {
  overflow: hidden;
  isolation: isolate;
}

.contact .field-canvas {
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 50%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 80% at 50% 50%, #000 20%, transparent 75%);
  opacity: 0.8;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 20px;
  max-width: 980px;
  margin: 0 auto;
}

.contact-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.2s var(--ease);
}

.contact-line:hover {
  border-color: var(--accent);
}

.contact-value {
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 600;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.contact-note {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--ink-3);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(24px, 3vw, 32px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 30px 80px -40px rgba(15, 95, 99, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field > span,
.field > legend {
  padding: 0;
  font-size: 13px;
  color: var(--ink-2);
}

.field > legend {
  margin-bottom: 8px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.field textarea {
  resize: vertical;
  min-height: 84px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-3);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(22, 124, 128, 0.12);
}

.field input[aria-invalid="true"] {
  border-color: #c0562b;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
}

.chip input {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.chip input:checked + span {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent);
}

.chip input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
}

.form-status {
  font-size: 14px;
  color: var(--ink-2);
}

.form-status.is-error {
  color: #c0562b;
}

/* a field people never see or reach; scripts that fill every input give themselves away */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Footer */
.site-footer {
  padding: 36px 0 44px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-3);
}

/* Reveal on scroll */
[data-reveal] {
  opacity: 0;
  translate: 0 24px;
  transition: opacity 0.8s var(--ease), translate 0.8s var(--ease);
}

[data-reveal].is-in {
  opacity: 1;
  translate: 0 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .nav-links {
    display: none;
  }
  .nav-actions {
    margin-left: auto;
  }
  .deploy {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }
  .stat:nth-child(n + 3) {
    margin-top: 28px;
  }
  .contact-grid,
  .demo-ask {
    grid-template-columns: 1fr;
  }
  .demo-ask-cta {
    justify-self: start;
  }
  .scene.split .container {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .scene.split .scene-stage {
    margin: 0 auto;
  }
  .lens-chips {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px 18px;
    margin-top: 16px;
  }
}

/* Short laptop screens: shrink type so each page still fits one screen */
@media (min-width: 761px) and (max-height: 860px) {
  .scene-title {
    font-size: clamp(30px, 3.6vw, 46px);
  }
  .scene-sub {
    margin-top: 10px;
    font-size: 15.5px;
  }
  #deploy .section-title,
  #contact .section-title,
  .overview .section-title {
    font-size: clamp(30px, 3.8vw, 48px);
  }
  #deploy .section-sub,
  #contact .section-sub {
    margin-top: 12px;
  }
  #deploy .iso {
    display: none;
  }
  .contact-form {
    gap: 12px;
    padding: 22px 26px;
  }
  .field textarea {
    min-height: 60px;
  }
  /* the demo ask: fields side by side, tighter spacing */
  .overview {
    padding: 76px 0 28px;
  }
  .overview .stat {
    padding-top: 20px;
  }
  .overview .stat-value {
    font-size: clamp(32px, 3.6vw, 44px);
  }
  .demo-ask {
    margin-top: 28px;
    padding: 20px 28px;
  }
  .demo-ask-points {
    margin-top: 12px;
    gap: 6px;
  }
}

@media (max-width: 1180px) {
  .page-rail {
    display: none;
  }
  .scene.split .container {
    padding-right: var(--gutter);
  }
}

@media (max-width: 760px) {
  .scene {
    min-height: auto;
    padding: 72px 0;
  }
  .page {
    min-height: auto;
  }
  .hero.page {
    min-height: 100svh;
  }
  #contact .site-footer {
    position: static;
    margin-top: 48px;
  }
  .br-sm {
    display: inline;
  }
  .scene-stage,
  .scene.split .scene-stage {
    max-width: none;
  }
  .phones {
    height: 420px;
  }
  .p-left,
  .p-right {
    display: none;
  }
  .pages {
    height: 300px;
  }
  .rpage + .rpage {
    margin-left: -18%;
  }
  .iot {
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
  }
  .iot-lines,
  .iot-core {
    display: none;
  }
  .iot {
    grid-auto-flow: column;
    grid-template-rows: repeat(3, auto);
  }
  .iot-node {
    position: static;
    width: auto;
    translate: none;
  }
}

@media (max-width: 600px) {
  .nav-inner {
    gap: 12px;
  }
  .hero {
    align-items: flex-end;
  }
  .hero-inner {
    padding-top: 300px;
    padding-bottom: 72px;
  }
  .hero-cta .btn {
    flex: 1 1 100%;
  }
  .hero-cta .text-link {
    margin: 6px auto 0;
  }
  .hero-scroll {
    display: none;
  }
  .plan-points {
    grid-template-columns: 1fr;
  }
  .iso {
    flex-direction: column;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .scene {
    --p: 1 !important;
  }
  .iot-core {
    animation: none;
  }
  [data-reveal] {
    opacity: 1;
    translate: none;
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Hero lab: a 3D diorama of the whole lab (js/lab-scene.js) on the right
   -------------------------------------------------------------------------- */
.hero-lab {
  position: absolute;
  z-index: -1;
  top: 68px;
  right: 0;
  bottom: 0;
  left: 38%;
  right: 64px; /* clear of the page rail */
  pointer-events: none;
}

/* a still of the same view shows until the 3D scene draws (or without WebGL) */
.hero-lab::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/hero-lab.webp") center / contain no-repeat;
}

.hero-lab.is-live::before {
  display: none;
}

.lab-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  touch-action: pan-y;
}

.lab-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  visibility: hidden;
}

.hero-lab.is-live .lab-labels {
  visibility: visible;
}

.lab-tag {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 10px 7px 22px;
  margin: -46px 0 0 -12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px -14px rgba(15, 42, 43, 0.35);
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--ink-2);
  white-space: nowrap;
  will-change: transform, opacity;
  opacity: 0; /* faded in and out by js/lab-scene.js */
}

.lab-tag b {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink);
}

/* the dot sits on the anchor; a short stem joins it to the card */
.lab-tag::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 124, 128, 0.18);
}


/* desktop: the lab stays fixed behind the hero and the whole-lab page while
   the camera moves; it fades out as the 小蔚 page comes in */
@media (min-width: 761px) {
  /* one fixed layer for the whole story: hero room -> lab tour -> the screen the
     product pages play on. js/lab-scene.js frames the scene into a moving box
     (--bx/--by/--bw/--bh); the mask gives that box soft edges. */
  .hero-lab {
    position: fixed;
    inset: 0 0 0 28%; /* the text column never needs the 3D */
  }
  .hero-lab::before {
    inset: 68px 64px 0 10vw; /* the lab box: from 38% of the viewport */
  }
  .lab-canvas {
    pointer-events: none;
    --fade: clamp(36px, 6vw, 90px);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent),
      linear-gradient(to bottom, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent),
      linear-gradient(to bottom, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
    mask-composite: intersect;
    -webkit-mask-size: var(--bw, 100%) var(--bh, 100%), var(--bw, 100%) var(--bh, 100%);
    mask-size: var(--bw, 100%) var(--bh, 100%), var(--bw, 100%) var(--bh, 100%);
    -webkit-mask-position: var(--bx, 0) var(--by, 0), var(--bx, 0) var(--by, 0);
    mask-position: var(--bx, 0) var(--by, 0), var(--bx, 0) var(--by, 0);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
  }
  /* the lab page: six screens of scroll (one per tour stop), text pinned */
  .lab-bridge.scene {
    display: block;
    height: 600vh;
    padding: 0;
  }
  .lab-bridge > .container {
    position: sticky;
    top: 0;
    height: 100vh;
    padding-top: 76px;
    padding-bottom: 36px;
    align-content: center;
  }
  .lab-snap {
    position: absolute;
    left: 0;
    top: calc(var(--i) * 100vh);
    width: 1px;
    height: 100vh;
    pointer-events: none;
  }
  /* product pages: the video plays on the 3D screen, so the HTML frame steps aside */
  .lab3d-screens .scene[data-screen] .scene-stage {
    opacity: 0;
  }
  .lab3d-screens .scene[data-screen],
  .lab3d-screens .lab-bridge + .scene {
    border-top-color: transparent;
  }
}

@media (min-width: 761px) and (min-height: 620px) {
  .lab-snap {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
}

.lab-bridge {
  overflow: clip; /* labels that run past the edge never widen the page */
}

.lab-bridge .lab-stage {
  min-height: 1px;
}

/* the tour stop's callout: larger than the hero tags */
.lab-call {
  padding: 9px 14px 10px 30px;
  margin: -62px 0 0 -14px;
  font-size: 13px;
  border-color: var(--line-strong);
  box-shadow: 0 14px 36px -18px rgba(15, 42, 43, 0.45);
}

.lab-call b {
  font-size: 16px;
}

.lab-call::before {
  left: 12px;
  top: 16px;
  width: 9px;
  height: 9px;
}

@media (max-width: 760px) {
  .hero-lab {
    top: 60px;
    left: 0;
    right: 0;
    bottom: auto;
    height: min(46svh, 400px);
  }
  /* on the whole-lab page the layer moves into the page's own stage */
  .hero-lab.in-stage {
    position: relative;
    z-index: 0;
    top: 0;
    height: auto;
    aspect-ratio: 4 / 3;
    background: none;
    -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 62%, transparent 100%);
    mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 62%, transparent 100%);
  }
  /* the stage holds its final size before the layer arrives, so the page
     never grows mid-scroll (a jump to a later page used to land short) */
  .lab-bridge .lab-stage {
    width: 100%;
    aspect-ratio: 4 / 3;
    margin-top: 20px;
  }
  .hero {
    align-items: flex-end;
  }
  .hero-inner {
    padding-top: calc(min(46svh, 400px) + 40px);
  }
  .lab-tag:nth-child(1),
  .lab-tag:nth-child(4),
  .lab-tag:nth-child(5) {
    display: none;
  }
  .lab-tag {
    padding: 4px 8px 5px 18px;
    margin: -36px 0 0 -10px;
    font-size: 10px;
  }
  .lab-tag b {
    font-size: 11px;
  }
  .lab-tag::before {
    left: 7px;
    top: 9px;
    width: 6px;
    height: 6px;
  }
}

