:root {
  --bg: #0a0e1a;
  --bg-alt: #0d1322;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-border: rgba(255, 255, 255, 0.08);
  --text: #e8edf7;
  --text-dim: #9aa7c0;
  --accent: #00d4ff;
  --accent-soft: rgba(0, 212, 255, 0.12);
  --accent-2: #3d7bff;
  --radius: 14px;
  --font: "Inter", "Noto Sans SC", -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html.preload-lang body { visibility: hidden; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  overflow-x: hidden;
}

body.lang-zh { font-family: "Noto Sans SC", "Inter", -apple-system, sans-serif; }

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

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(10, 14, 26, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.scrolled { border-bottom-color: var(--surface-border); }
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
}
.brand-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
  transition: transform 0.2s ease;
}
.brand:hover .brand-mark {
  transform: scale(1.08);
}
.brand-name {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}
.brand-cn {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  display: none;
  margin-left: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  white-space: nowrap;
}
body.lang-zh .brand-cn {
  display: inline-block;
}
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a {
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.lang-toggle {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.lang-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-burger span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #06101f;
  box-shadow: 0 4px 24px rgba(0, 212, 255, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0, 212, 255, 0.5); }
.btn-ghost {
  border: 1px solid var(--surface-border);
  color: var(--text);
  background: var(--surface);
}
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn-small { padding: 8px 20px; font-size: 0.87rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-glow {
  position: absolute;
  top: 20%; left: 50%;
  width: 720px; height: 720px;
  transform: translate(-50%, -30%);
  background: radial-gradient(circle, rgba(0, 212, 255, 0.14), transparent 65%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; max-width: 960px; }
.hero-title {
  font-size: clamp(2rem, 5.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  background: linear-gradient(115deg, #ffffff 30%, var(--accent) 75%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
  min-height: 1.22em;
  white-space: nowrap;
}
body:not(.lang-zh) .hero-title {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
}

.hero-sub {
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--text-dim);
  max-width: 900px;
  margin: 0 auto 40px;
  min-height: 4em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hero-sub-line {
  margin: 0 0 6px;
}
body:not(.lang-zh) .hero-sub {
  max-width: 1100px;
  font-size: 1.05rem;
}
body:not(.lang-zh) .hero-sub-line {
  white-space: nowrap;
}
.hero-sub-line:last-child {
  margin-bottom: 0;
}
.hero-ctas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 140px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

/* ---------- Stats ---------- */
.stats { border-block: 1px solid var(--surface-border); background: var(--bg-alt); }
.stats-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 44px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.stat-num {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 800;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 0.85rem; color: var(--text-dim); margin-top: 6px; }

/* ---------- Sections ---------- */
.section { padding: 110px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 64px; }
.eyebrow {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.01em; }
.h2-cn { margin-left: 14px; font-size: 0.65em; color: var(--text-dim); font-weight: 600; display: none; }
body.lang-zh .h2-cn { display: inline-block; }
.section-lead { color: var(--text-dim); margin-top: 18px; font-size: 1.05rem; }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.card-grid-2 { grid-template-columns: repeat(2, 1fr); max-width: 860px; margin: 0 auto; }
.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 30px 26px;
  backdrop-filter: blur(8px);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}
.card-icon {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 16px;
}
.card h3 { font-size: 1.06rem; font-weight: 700; margin-bottom: 10px; }
.card p { font-size: 0.92rem; color: var(--text-dim); }

/* ---------- Use cases ---------- */
.usecases { margin-top: 80px; }
.usecases-title { text-align: center; font-size: 1.3rem; font-weight: 700; margin-bottom: 36px; }
.usecase-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.usecase {
  border-top: 2px solid var(--accent);
  padding-top: 18px;
}
.usecase h4 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.usecase p { font-size: 0.9rem; color: var(--text-dim); }

/* ---------- Validation ---------- */
.validation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.v-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 34px 28px;
  transition: transform 0.25s, border-color 0.25s;
}
.v-card:hover { transform: translateY(-5px); border-color: rgba(0, 212, 255, 0.4); }
.v-num {
  font-size: 2.1rem;
  font-weight: 800;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}
.v-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.v-card p { font-size: 0.92rem; color: var(--text-dim); }

/* ---------- Coming soon ---------- */
.card-soon { position: relative; }
.soon-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, 0.35);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 16px;
}

/* ---------- Team ---------- */
.team-card {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 48px 40px;
}
.team-card p {
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 36px;
}

.team-orgs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.org-card {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 24px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
}

.org-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 212, 255, 0.1);
}

.org-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  padding: 3px 12px;
  border-radius: 99px;
  margin-bottom: 16px;
}

.org-badge-support {
  color: #00E676;
  background: rgba(0, 230, 118, 0.08);
  border-color: rgba(0, 230, 118, 0.25);
}

.org-card-highlight {
  border-color: rgba(0, 230, 118, 0.18);
  background: linear-gradient(180deg, rgba(0, 230, 118, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
}

.org-card-highlight:hover {
  border-color: rgba(0, 230, 118, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), 0 0 24px rgba(0, 230, 118, 0.12);
}

.org-logo-wrapper {
  height: 68px;
  width: 100%;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.org-logo-img {
  max-height: 58px;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.polyu-img {
  filter: brightness(1.15) drop-shadow(0 2px 10px rgba(143, 19, 41, 0.4));
}

.hku-img {
  filter: brightness(1.1) drop-shadow(0 2px 10px rgba(0, 122, 61, 0.4));
}

.slowmist-img {
  filter: brightness(1.1) drop-shadow(0 2px 10px rgba(0, 230, 118, 0.4));
}

.org-card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.org-card-link .org-name {
  color: var(--text);
}

/* ---------- Partners ---------- */
.partners-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 320px));
  gap: 20px;
  justify-content: center;
}

.width-img {
  filter: brightness(1.4) drop-shadow(0 2px 10px rgba(13, 79, 211, 0.4));
}

.alloyx-img {
  filter: brightness(1.1) drop-shadow(0 2px 10px rgba(255, 171, 46, 0.4));
}

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

.org-card:hover .org-logo-img {
  transform: scale(1.1);
}

.org-name {
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--text);
  line-height: 1.35;
}

.org-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.3;
}

@media (max-width: 860px) {
  .team-orgs-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .team-card {
    padding: 36px 20px;
  }
}

/* ---------- Contact ---------- */
.contact-card {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  background: linear-gradient(140deg, rgba(0, 212, 255, 0.1), rgba(61, 123, 255, 0.08));
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: var(--radius);
  padding: 60px 44px;
}
.contact-card p { color: var(--text-dim); margin: 16px 0 30px; }
.contact-mail {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}
.contact-mail:hover { border-bottom-color: var(--accent); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--surface-border); padding: 34px 0; }
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-meta { display: flex; gap: 22px; align-items: center; color: var(--text-dim); font-size: 0.88rem; }
.footer-meta a { color: var(--text-dim); transition: color 0.2s; }
.footer-meta a:hover { color: var(--accent); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .usecase-row { grid-template-columns: repeat(2, 1fr); }
  .validation-grid { grid-template-columns: 1fr; max-width: 640px; margin: 0 auto; }
  .stats-inner { grid-template-columns: repeat(3, 1fr); row-gap: 34px; }
}
@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: 60px; right: 0; left: 0;
    flex-direction: column;
    background: rgba(10, 14, 26, 0.97);
    padding: 22px 24px;
    gap: 18px;
    border-bottom: 1px solid var(--surface-border);
    transform: translateY(-140%);
    transition: transform 0.3s;
  }
  .nav-links.open { transform: none; }
  .nav-burger { display: flex; }
  .nav-actions .btn-small { display: none; }
  .card-grid, .card-grid-2 { grid-template-columns: 1fr; }
  .usecase-row { grid-template-columns: 1fr; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 80px 0; }

  .hero-title {
    white-space: normal;
    font-size: clamp(1.8rem, 6vw, 2.4rem) !important;
  }
  .hero-sub-line {
    white-space: normal !important;
  }
}
