:root {
  --bg: #04070D;
  --fg: #EEF3F8;
  --fg-muted: #B7C4D2;
  --fg-soft: #93A3B5;
  --brand: #4499CC;
  --brand-hover: #6FB6E2;
  --brand-soft: #7FC0EA;
  --border: rgba(255, 255, 255, 0.08);
  --gutter: clamp(20px, 5vw, 72px);
  --container: 1440px;
  --font-display: 'Nunito', sans-serif;
  --font: 'Manrope', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

a {
  color: var(--brand-soft);
  text-decoration: none;
}

a:hover {
  color: var(--fg);
}

:focus-visible {
  outline: 2px solid var(--brand-soft);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Background: globe + scrim */

.globe {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.globe.is-ready {
  opacity: 1;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(4, 7, 13, 0.92) 0%, rgba(4, 7, 13, 0.55) 45%, rgba(4, 7, 13, 0) 75%);
}

@media (max-width: 819.98px) {
  .scrim {
    background:
      linear-gradient(180deg, rgba(4, 7, 13, 0.55) 0%, rgba(4, 7, 13, 0.35) 55%, rgba(4, 7, 13, 0.1) 100%),
      linear-gradient(90deg, rgba(4, 7, 13, 0.92) 0%, rgba(4, 7, 13, 0.55) 45%, rgba(4, 7, 13, 0) 75%);
  }
}

.page {
  position: relative;
  z-index: 2;
}

/* Buttons */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  font-weight: 700;
  line-height: normal;
}

button.btn {
  border: 0;
  font-family: var(--font);
  cursor: pointer;
}

.btn--primary {
  background: var(--brand);
  color: var(--bg);
}

.btn--primary:hover {
  background: var(--brand-hover);
  color: var(--bg);
}

.btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--fg);
  font-weight: 600;
}

.btn--ghost:hover {
  border-color: var(--brand);
  color: #FFFFFF;
}

.btn--sm {
  padding: 10px 18px;
  font-size: 15px;
}

.btn--lg {
  padding: 16px 28px;
  font-size: 16px;
}

.btn--xl {
  padding: 18px 30px;
  font-size: 17px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(4, 7, 13, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--container);
  margin-inline: auto;
  padding: clamp(14px, 3vw, 20px) var(--gutter);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
}

.brand img {
  display: block;
  flex: none;
  width: 28px;
  height: 28px;
}

.brand span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(19px, 4.5vw, 22px);
  letter-spacing: -0.01em;
  color: var(--brand);
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.site-nav__link {
  color: var(--fg-muted);
}

.site-nav__link:hover {
  color: #FFFFFF;
}

@media (max-width: 699.98px) {
  .site-nav__link {
    display: none;
  }
}

/* Language switcher */

.lang {
  position: relative;
}

.lang__toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  font: inherit;
  cursor: pointer;
}

.lang__toggle:hover,
.lang__toggle[aria-expanded="true"] {
  color: #FFFFFF;
}

.lang__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 168px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid rgba(68, 153, 204, 0.35);
  border-radius: 16px;
  background: #0B1422;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.lang__menu button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--fg-muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.lang__menu button:hover {
  background: rgba(68, 153, 204, 0.12);
  color: #FFFFFF;
}

.lang__menu button[aria-current="true"] {
  color: var(--brand-soft);
  font-weight: 700;
}

@media (max-width: 559.98px) {
  .lang__chevron {
    display: none;
  }
}

@media (max-width: 389.98px) {
  .site-nav {
    gap: 8px;
  }

  .lang__toggle {
    padding: 8px;
  }

  .lang__current {
    display: none;
  }

  .btn--sm {
    padding: 10px 14px;
  }
}

@media (max-width: 359.98px) {
  .brand span {
    display: none;
  }
}

/* Sections */

.section {
  max-width: var(--container);
  margin-inline: auto;
  padding: clamp(64px, 12vw, 120px) var(--gutter);
}

.section__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

/* Hero */

.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--container);
  margin-inline: auto;
  min-height: calc(100vh - 72px);
  min-height: calc(100svh - 72px);
  padding: clamp(48px, 10vw, 80px) var(--gutter) clamp(72px, 14vw, 120px);
}

.hero__title {
  margin: 0;
  max-width: 11ch;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(44px, 8vw, 112px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero__accent {
  color: var(--brand);
}

.hero__lead {
  margin: 32px 0 0;
  max-width: 34em;
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.6;
  color: var(--fg-muted);
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 44px;
}

/* Products */

.products-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 56px;
}

.products-head .section__title {
  max-width: 12ch;
}

.products-head p {
  margin: 0;
  max-width: 26em;
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-soft);
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
}

.product {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: clamp(300px, 60vw, 360px);
  padding: clamp(24px, 6vw, 36px);
  border-radius: 28px;
  background: rgba(12, 20, 32, 0.62);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: var(--fg);
  overflow: hidden;
  transition: transform .35s ease, border-color .35s ease, background .35s ease;
}

.product:hover {
  transform: translateY(-6px);
  border-color: rgba(68, 153, 204, 0.6);
  background: rgba(16, 28, 44, 0.75);
  color: var(--fg);
}

.product__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product__id {
  display: flex;
  align-items: center;
  gap: 14px;
}

.product__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #FFFFFF;
  overflow: hidden;
}

.product__logo img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.product__num {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  color: var(--brand-soft);
}

.product__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 18px;
}

.product__body {
  margin-top: auto;
}

.product__tag {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-soft);
}

.product__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 40px;
  letter-spacing: -0.02em;
}

.product__desc {
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-muted);
  text-wrap: pretty;
}

.product__domain {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--fg-soft);
}

/* About */

.about {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.about .section__title {
  text-wrap: balance;
}

.about__body {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.about__body > p {
  margin: 0;
  font-size: 19px;
  line-height: 1.7;
  color: var(--fg-muted);
  text-wrap: pretty;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.pillar {
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(12, 20, 32, 0.5);
}

.pillar h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  color: var(--fg);
}

.pillar p {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg-soft);
}

/* Contact */

.section--contact {
  padding-bottom: 0;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(36px, 6vw, 80px);
  border-radius: 36px;
  background: rgba(68, 153, 204, 0.12);
  border: 1px solid rgba(68, 153, 204, 0.35);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.cta .section__title {
  max-width: 13ch;
}

.cta p {
  margin: 18px 0 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--fg-muted);
}

/* Footer */

.site-footer {
  max-width: var(--container);
  margin-inline: auto;
  padding: 80px var(--gutter) 48px;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--fg-soft);
}

.site-footer__logo {
  display: block;
  width: auto;
  height: 48px;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.site-footer a {
  color: var(--fg-soft);
}

.site-footer a:hover {
  color: #FFFFFF;
}

/* Legal pages */

.legal {
  max-width: var(--container);
  margin-inline: auto;
  padding: clamp(40px, 8vw, 96px) var(--gutter) 0;
}

.legal__head {
  max-width: 860px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.legal__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  font-size: 15px;
  font-weight: 600;
}

.legal__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 6vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
  hyphens: auto;
  overflow-wrap: break-word;
}

.legal__lead {
  margin: 24px 0 0;
  max-width: 34em;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.6;
  color: var(--fg-muted);
  text-wrap: pretty;
}

.legal__body {
  max-width: 860px;
  padding: clamp(24px, 5vw, 56px);
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(8, 13, 22, 0.88);
  color: var(--fg-muted);
  font-size: 17px;
  line-height: 1.75;
}

.legal__body p {
  margin: 0 0 18px;
  text-wrap: pretty;
}

.legal__body h2 {
  margin: 44px 0 16px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.5;
  color: var(--brand-soft);
}

.legal__body ul {
  margin: 0 0 18px;
  padding-left: 22px;
}

.legal__body li {
  margin-bottom: 10px;
}

.legal__body li::marker {
  color: var(--brand);
}

.legal__body :is(p, ul):last-child {
  margin-bottom: 0;
}

.legal__body a:not(.btn) {
  color: var(--brand-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal__body a:not(.btn):hover {
  color: var(--fg);
}

.legal__cta {
  display: inline-flex;
  margin-top: 10px;
}

/* Contact modal */

.contact-modal {
  width: calc(100% - 24px);
  max-width: 640px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid rgba(68, 153, 204, 0.35);
  border-radius: 28px;
  background: #0B1422;
  color: var(--fg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.contact-modal[open] {
  display: flex;
  flex-direction: column;
}

.contact-modal::backdrop {
  background: rgba(2, 4, 8, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.contact-modal__head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(16px, 4vw, 24px) clamp(18px, 4vw, 28px);
  border-bottom: 1px solid var(--border);
}

.contact-modal__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.contact-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--fg);
  font-size: 20px;
  cursor: pointer;
}

.contact-modal__close:hover {
  border-color: var(--brand);
}

.contact-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(12px, 3vw, 20px);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.contact-modal__body iframe {
  display: block;
  width: 100%;
  min-height: 520px;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
}

/* CJK: full-width glyphs need em-based measures and no negative tracking */

:lang(ja) .hero__title,
:lang(zh) .hero__title {
  max-width: 8.5em;
  font-size: clamp(36px, 7vw, 96px);
  line-height: 1.15;
  letter-spacing: 0;
}

:lang(ja) .section__title,
:lang(zh) .section__title {
  max-width: 9em;
  line-height: 1.2;
  letter-spacing: 0;
}

:lang(ja) .legal__title,
:lang(zh) .legal__title {
  font-size: clamp(30px, 6vw, 72px);
  line-height: 1.2;
  letter-spacing: 0;
  word-break: normal;
}

:lang(ja) :is(h1, h2, h3) {
  line-break: strict;
  word-break: auto-phrase;
  overflow-wrap: anywhere;
}
