:root {
  color-scheme: dark;
  --bg: #071014;
  --panel: #0d181d;
  --panel-strong: #101c21;
  --text: #ecf7f4;
  --muted: #9eb1b1;
  --line: rgba(236, 247, 244, 0.13);
  --green: #32d7a4;
  --cyan: #5dd7f0;
  --amber: #e9a84a;
  --shadow: rgba(0, 0, 0, 0.34);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

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

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 16px clamp(20px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 20, 0.82);
  backdrop-filter: blur(18px);
  transition: background 220ms ease, border-color 220ms ease, min-height 220ms ease;
}

.site-header.is-scrolled {
  min-height: 62px;
  border-bottom-color: rgba(50, 215, 164, 0.24);
  background: rgba(7, 16, 20, 0.94);
}

.brand,
nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  gap: 10px;
  font-weight: 760;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(50, 215, 164, 0.5);
  border-radius: 8px;
  background: #0e201d;
  color: var(--green);
  box-shadow: 0 0 0 rgba(50, 215, 164, 0);
  transition: box-shadow 240ms ease, transform 240ms var(--ease);
}

.brand:hover .brand-mark {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(50, 215, 164, 0.28);
}

nav a {
  position: relative;
  color: var(--muted);
  font-size: 14px;
}

nav a::after {
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 1px;
  background: var(--green);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms var(--ease);
}

nav a:hover {
  color: var(--text);
}

nav a:hover::after {
  transform: scaleX(1);
}

.hero {
  position: relative;
  display: grid;
  min-height: 92vh;
  align-items: center;
  overflow: hidden;
  padding: 120px clamp(20px, 5vw, 72px) 64px;
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: heroDrift 18s var(--ease) infinite alternate;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(7, 16, 20, 0.97) 0%, rgba(7, 16, 20, 0.82) 38%, rgba(7, 16, 20, 0.4) 78%),
    linear-gradient(180deg, rgba(7, 16, 20, 0.16) 0%, rgba(7, 16, 20, 0.9) 100%);
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.62fr);
  align-items: center;
  gap: clamp(28px, 5vw, 78px);
  width: min(1240px, 100%);
}

.hero-content {
  width: min(720px, 100%);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 6.4vw, 78px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy {
  width: min(620px, 100%);
  margin: 28px 0 0;
  color: #c7d6d5;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.58;
}

:lang(zh-CN) .hero-copy,
:lang(zh-CN) .section-heading p:not(.eyebrow),
:lang(zh-CN) .feature-card p,
:lang(zh-CN) .workflow-step p,
:lang(zh-CN) .security-list p {
  line-height: 1.78;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  position: relative;
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 720;
  transform: translateY(0);
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms var(--ease),
    background 220ms ease;
}

.button span {
  position: relative;
  z-index: 2;
}

.button::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  content: "";
  transform: translateX(-120%);
  transition: transform 520ms var(--ease);
}

.button:hover {
  transform: translateY(-2px);
}

.button:hover::before {
  transform: translateX(120%);
}

.button.primary {
  background: var(--green);
  color: #05100d;
  box-shadow: 0 16px 34px rgba(50, 215, 164, 0.22);
}

.button.secondary {
  border: 1px solid var(--line);
  background: rgba(236, 247, 244, 0.06);
}

.button.secondary:hover {
  border-color: rgba(93, 215, 240, 0.42);
  background: rgba(236, 247, 244, 0.1);
}

.control-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(236, 247, 244, 0.14);
  border-radius: 8px;
  background: rgba(9, 19, 24, 0.72);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(18px);
}

.control-panel::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(236, 247, 244, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 247, 244, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  content: "";
  mask-image: linear-gradient(180deg, black, transparent 88%);
  opacity: 0.72;
}

.panel-top,
.flow-stage,
.panel-metrics,
.event-feed {
  position: relative;
  z-index: 2;
}

.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  color: #cfe0dd;
  font-size: 14px;
}

.panel-top div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(50, 215, 164, 0.52);
  animation: pulseDot 1.8s ease-out infinite;
}

.flow-stage {
  display: grid;
  grid-template-columns: 66px minmax(48px, 1fr) 74px minmax(48px, 1fr) 70px;
  min-height: 176px;
  align-items: center;
  padding: 20px;
}

.node {
  display: grid;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(236, 247, 244, 0.16);
  border-radius: 8px;
  background: rgba(236, 247, 244, 0.065);
  color: #dbe9e7;
  font-size: 13px;
  font-weight: 760;
}

.gateway-node {
  border-color: rgba(50, 215, 164, 0.56);
  background: rgba(50, 215, 164, 0.13);
  color: var(--green);
}

.flow-line {
  position: relative;
  height: 2px;
  background: rgba(236, 247, 244, 0.14);
}

.packet {
  position: absolute;
  top: 50%;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(93, 215, 240, 0.76);
  transform: translate(-50%, -50%);
  animation: packetFlow 2.8s linear infinite;
}

.packet-b,
.packet-e {
  animation-delay: 0.8s;
  background: var(--green);
}

.packet-c {
  animation-delay: 1.7s;
  background: var(--amber);
}

.packet-d {
  animation-delay: 0.25s;
}

.panel-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.panel-metrics div {
  padding: 16px;
  border-right: 1px solid var(--line);
}

.panel-metrics div:last-child {
  border-right: 0;
}

.panel-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.panel-metrics strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 20px;
}

.event-feed {
  display: grid;
  gap: 8px;
  padding: 16px 20px 20px;
}

.event-feed p {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #b8cbc8;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.event-feed p span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--green);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #091318;
}

.metrics div {
  min-height: 126px;
  padding: 28px clamp(20px, 5vw, 64px);
  border-right: 1px solid var(--line);
  transition: background 220ms ease;
}

.metrics div:hover {
  background: rgba(236, 247, 244, 0.035);
}

.metrics div:last-child {
  border-right: 0;
}

.metrics strong {
  display: block;
  color: var(--text);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
}

.metrics span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.section {
  padding: 88px clamp(20px, 5vw, 72px);
}

.section-heading {
  width: min(760px, 100%);
  margin-bottom: 34px;
}

.section-heading p:not(.eyebrow) {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  position: relative;
  min-height: 258px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--panel);
  box-shadow: 0 20px 50px var(--shadow);
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 260ms var(--ease),
    background 220ms ease;
}

.feature-card::after {
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(50, 215, 164, 0.72), transparent);
  content: "";
  opacity: 0;
  transition: opacity 220ms ease;
}

.feature-card:hover {
  border-color: rgba(50, 215, 164, 0.32);
  background: #102126;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
  transform: translateY(-6px);
}

.feature-card:hover::after {
  opacity: 1;
}

.feature-icon {
  display: inline-flex;
  min-width: 58px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(93, 215, 240, 0.36);
  border-radius: 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 760;
}

h3 {
  margin: 26px 0 10px;
  font-size: 21px;
}

.feature-card p,
.security-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.workflow-section {
  border-top: 1px solid var(--line);
  background: #081217;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(236, 247, 244, 0.035);
}

.workflow-step {
  position: relative;
  min-height: 220px;
  padding: 24px;
  border-right: 1px solid var(--line);
  transition: background 220ms ease;
}

.workflow-step::after {
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: 42px;
  height: 1px;
  background: var(--green);
  content: "";
  opacity: 0.3;
  transform: scaleX(0.55);
  transform-origin: right;
  transition: transform 240ms var(--ease), opacity 240ms ease;
}

.workflow-step:hover {
  background: rgba(236, 247, 244, 0.038);
}

.workflow-step:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

.workflow-step:last-child {
  border-right: 0;
}

.workflow-step span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: rgba(50, 215, 164, 0.14);
  color: var(--green);
  font-size: 13px;
  font-weight: 780;
}

.workflow-step h3 {
  margin-top: 32px;
}

.workflow-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 48px;
  border-top: 1px solid var(--line);
  background: var(--panel-strong);
}

.security-list {
  display: grid;
  gap: 14px;
}

.security-list div {
  border-left: 3px solid var(--amber);
  padding: 22px;
  background: rgba(236, 247, 244, 0.04);
  transition: border-color 220ms ease, background 220ms ease, transform 240ms var(--ease);
}

.security-list div:hover {
  border-left-color: var(--green);
  background: rgba(236, 247, 244, 0.07);
  transform: translateX(4px);
}

.security-list h3 {
  margin-top: 0;
}

.contact-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 64px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  background: #0b171b;
}

.contact-band h2 {
  max-width: 720px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes heroDrift {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.045) translate3d(-10px, -8px, 0);
  }
}

@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 0 rgba(50, 215, 164, 0.52);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(50, 215, 164, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(50, 215, 164, 0);
  }
}

@keyframes packetFlow {
  from {
    left: 0;
    opacity: 0;
  }

  12%,
  88% {
    opacity: 1;
  }

  to {
    left: 100%;
    opacity: 0;
  }
}

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

  .control-panel {
    width: min(620px, 100%);
  }
}

@media (max-width: 820px) {
  .site-header {
    position: absolute;
    min-height: 64px;
  }

  nav {
    display: none;
  }

  .hero {
    min-height: 88vh;
    padding-top: 106px;
  }

  .control-panel {
    display: none;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(7, 16, 20, 0.96) 0%, rgba(7, 16, 20, 0.7) 100%),
      linear-gradient(180deg, rgba(7, 16, 20, 0.15) 0%, rgba(7, 16, 20, 0.9) 100%);
  }

  .metrics,
  .feature-grid,
  .workflow,
  .split-section {
    grid-template-columns: 1fr;
  }

  .metrics div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metrics div:last-child {
    border-bottom: 0;
  }

  .workflow-step {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workflow-step:last-child {
    border-bottom: 0;
  }

  .contact-band,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 460px) {
  h1 {
    font-size: 38px;
  }

  .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Language toggle button (EN/ZH) */
.lang-toggle {
  margin-left: 0.75rem;
  padding: 0.35rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1;
  color: inherit;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.lang-toggle:hover {
  background: rgba(46, 216, 163, 0.18);
  border-color: rgba(46, 216, 163, 0.55);
  transform: translateY(-1px);
}
.lang-toggle:active {
  transform: translateY(0);
}

/* ICP filing notice (China / zh only) */
.icp-beian {
  color: inherit;
  opacity: 0.6;
  text-decoration: none;
  font-size: 0.85em;
  transition: opacity 0.2s ease;
}
.icp-beian:hover {
  opacity: 1;
  text-decoration: underline;
}
