/* 1. Colors and base typography */
@import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;600;700;800&family=Space+Grotesk:wght@400;600&display=swap");
:root {
  --bg: #030d16;
  --mint: #a4ffdc;
  --gold: #ffe0a1;
  --text: #edf7f7;
  --muted: #9bb6bd;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Be Vietnam Pro", Arial, sans-serif;
}
button {
  font: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: wait;
}
button:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 5px;
}
h1,
h2,
p {
  margin: 0;
}
em {
  font-style: normal;
  color: var(--mint);
}
i {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px #70facc;
}
[hidden] {
  display: none !important;
}

/* 2. Single-screen hero and title */
.hero {
  position: relative;
  min-height: 740px;
  height: 100svh;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 48%, #08303d66, transparent 60%);
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(#2f687c0a 1px, transparent 1px),
    linear-gradient(90deg, #2f687c0a 1px, transparent 1px);
  background-size: 64px 64px;
}
.hero-heading {
  position: relative;
  z-index: 25;
  text-align: center;
  padding: clamp(30px, 6vh, 75px) 15px 0;
  pointer-events: none;
}
h1 {
  font-size: clamp(36px, 4.6vw, 73px);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.25;
}
h1 em {
  background: linear-gradient(110deg, #d5fff2, #58d8c3);
  background-clip: text;
  color: transparent;
}
.launch {
  font-size: 12px;
  letter-spacing: 1.6px;
  color: #afcec5;
  margin-top: 24px;
}
.launch i {
  margin-right: 8px;
}
.launch span {
  border-left: 1px solid #385456;
  margin-left: 15px;
  padding-left: 15px;
  color: #dfc88f;
}

/* 3. Globe, orbiting flags and hover information */
.stage {
  position: absolute;
  top: 18%;
  height: 57%;
  width: 100%;
  isolation: isolate;
}
canvas,
.server-layer {
  width: 100%;
  height: 90%;
}
canvas {
  display: block;
}
.server-layer,
.orbit-trails {
  position: absolute;
  inset: 0;
}
.orbit-trails {
  pointer-events: none;
}
.server-card {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border: 1px solid #43667588;
  background: linear-gradient(115deg, #102b38ed, #061823ed);
  border-radius: 7px;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  box-shadow: 0 10px 30px #0005;
  will-change: transform;
}
.server-card img {
  width: 37px;
  height: 25px;
  object-fit: cover;
  border-radius: 3px;
}
.server-card strong {
  display: block;
  font:
    600 12px "Space Grotesk",
    sans-serif;
  letter-spacing: 0.5px;
}
.server-card small {
  display: block;
  font-size: 10px;
  letter-spacing: 1px;
  color: #8bdcca;
  margin-top: 6px;
}
.server-card small i {
  width: 4px;
  height: 4px;
  margin-right: 5px;
}
.server-card:hover,
.server-card:focus-visible,
.server-card.selected {
  border-color: #70dfc5;
  box-shadow: 0 0 30px #42dbc433;
}
.server-info {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  padding: 12px;
  background: #0b202c;
  border: 1px solid #327464;
  border-radius: 5px;
  font-size: 11px;
  line-height: 1.9;
  color: #abd9d0;
  pointer-events: none;
}
.server-info em {
  display: block;
  font-size: 10px;
  color: #7da1ae;
}
.server-card:hover .server-info,
.server-card:focus-visible .server-info,
.server-card.selected .server-info {
  display: block;
}
.coordinate {
  position: absolute;
  top: 55%;
  font:
    10px/2 "Space Grotesk",
    sans-serif;
  letter-spacing: 1.4px;
  color: #6395a0;
}
.coordinate.left {
  left: 5%;
}
.coordinate.right {
  right: 5%;
  text-align: right;
}
.coordinate span {
  color: #526f7b;
}

/* 4. Two benefit panels and central merge button */
.hero-action {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: 4%;
  transform: translateX(-50%);
  width: min(1260px, 90%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px minmax(0, 1fr);
  gap: clamp(18px, 3vw, 48px);
  align-items: center;
}
.hero-benefits {
  text-align: left;
  border: 1px solid #538d7d;
  border-radius: 9px;
  padding: 18px 22px;
  background: linear-gradient(125deg, #10382eed, #081f28f5);
  box-shadow:
    0 12px 40px #0004,
    inset 0 1px #b5ffe923;
}
.benefits-gold {
  border-color: #9a8150;
  background: linear-gradient(125deg, #302b1eed, #131e24f5);
}
.benefits-kicker {
  font:
    600 15px "Space Grotesk",
    sans-serif;
  letter-spacing: 2px;
  color: #b0edda;
  margin-bottom: 10px;
}
.benefits-gold .benefits-kicker {
  color: #e3c58b;
}
.benefit-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px 14px;
  padding: 9px 0;
}
.benefit-row > div {
  display: contents;
}
.benefit-row + .benefit-row {
  border-top: 1px solid #96b8ad30;
}
.benefit-row > strong {
  font:
    600 clamp(32px, 3.1vw, 46px)/1.1 "Space Grotesk",
    sans-serif;
  color: var(--mint);
  letter-spacing: -2px;
  min-width: 72px;
}
.benefits-gold .benefit-row > strong {
  color: var(--gold);
}
.benefit-row > strong span {
  font-size: 23px;
  letter-spacing: -1px;
}
.benefit-row h2 {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}
.benefit-row p {
  grid-column: 1 / -1;
  font-size: 12px;
  line-height: 1.5;
  color: #bdd1cd;
  margin: 0;
}
.hero-action-center {
  text-align: center;
}
.network-status {
  font:
    10px "Space Grotesk",
    sans-serif;
  letter-spacing: 1px;
  color: #9abec6;
  margin-bottom: 17px;
}
.network-status i {
  margin-right: 7px;
}
.network-status strong {
  color: #8ee5cb;
}
.primary {
  min-width: 275px;
  min-height: 62px;
  padding: 18px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  border: 1px solid #b6f9da;
  background: linear-gradient(110deg, #b3f6d7, #69dfc7);
  color: #073a37;
  border-radius: 5px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  box-shadow: 0 0 30px #56e8bf22;
  transition: box-shadow 0.25s;
}
.primary:hover {
  box-shadow: 0 0 45px #56e8bf66;
}
.button-symbol {
  font-size: 22px;
}
.button-copy {
  font-size: 22px;
}
.button-line {
  width: 18px;
  height: 1px;
  background: #1b6e61;
}
.action-caption {
  font-size: 12px;
  color: #8badb6;
  margin-top: 17px;
  line-height: 1.7;
}

/* 5. Merge status; no full-screen loading overlay */
.merge-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 17px;
  text-align: center;
  opacity: 0;
  z-index: 30;
  text-shadow: 0 2px 12px #001219;
}
.merging .merge-overlay,
.merged .merge-overlay {
  opacity: 1;
}
.merge-label {
  font:
    12px "Space Grotesk",
    sans-serif;
  letter-spacing: 2px;
  color: #c0ffe5;
}
.merge-title {
  font:
    600 clamp(22px, 3vw, 42px) "Space Grotesk",
    sans-serif;
  color: #e0fff2;
  max-width: 85%;
}
.merge-list {
  font:
    11px/1.8 "Space Grotesk",
    sans-serif;
  max-width: 450px;
  color: #9ad0bc;
}
.merging .hero-heading,
.merged .hero-heading {
  opacity: 0.4;
}
.merged .coordinate {
  opacity: 0;
}
.notice {
  padding: 20px;
  text-align: center;
}

/* 6. Tablet and mobile */
@media (max-height: 850px) and (min-width: 901px) {
  .hero-heading {
    padding-top: 30px;
  }
  h1 {
    font-size: 48px;
  }
  .stage {
    top: 17%;
    height: 53%;
  }
  .hero-benefits {
    padding: 12px 16px;
  }
  .benefit-row > strong {
    font-size: 36px;
  }
}
@media (max-width: 1100px) {
  .coordinate {
    display: none;
  }
}
@media (min-width: 1700px) {
  .hero-action {
    width: 1440px;
    grid-template-columns: 1fr 340px 1fr;
  }
  .hero-benefits {
    padding: 22px 28px;
  }
  .benefit-row h2 {
    font-size: 17px;
  }
  .benefit-row p {
    font-size: 14px;
  }
  .benefit-row > strong {
    font-size: 54px;
    min-width: 90px;
  }
}
@media (min-width: 901px) and (max-width: 1050px) {
  .hero-action {
    width: 94%;
    gap: 14px;
    grid-template-columns: 1fr 250px 1fr;
  }
  .primary {
    min-width: 245px;
    font-size: 12px;
  }
  .hero-benefits {
    padding: 12px;
  }
  .benefit-row {
    gap: 10px;
  }
  .benefit-row > strong {
    min-width: 55px;
    font-size: 32px;
  }
  .benefit-row h2 {
    font-size: 12px;
  }
}
/* Mobile uses three flow rows: heading, flexible globe, benefits + CTA.
   The globe gives up space first; benefit descriptions are never hidden. */
@media (max-width: 900px) {
  .hero {
    height: 100svh;
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: max(10px, env(safe-area-inset-top)) 12px
      max(10px, env(safe-area-inset-bottom));
    gap: 6px;
  }
  .hero-heading {
    padding: 0;
  }
  h1 {
    font-size: clamp(56px, 7.2vw, 44px);
    letter-spacing: -1.4px;
  }
  .launch {
    font-size: 22px;
    letter-spacing: 0.5px;
    margin-top: 10px;
  }
  .launch span {
    margin-left: 7px;
    padding-left: 7px;
  }
  .stage {
    position: relative;
    top: auto;
    width: 100%;
    height: 100%;
    min-height: 0;
  }
  .stage > canvas {
    position: absolute;
    inset: 0;
  }
  .hero-action {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
  }
  .hero-action-center {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .hero-benefits {
    padding: 10px;
  }
  .benefits-kicker {
    font-size: 17px;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    min-height: 24px;
  }
  .benefit-row {
    gap: 5px 8px;
    padding: 8px 0;
  }
  .benefit-row > strong {
    font-size: 32px;
    min-width: 0;
    letter-spacing: -1.5px;
  }
  .benefit-row > strong span {
    font-size: 17px;
  }
  .benefit-row h2 {
    font-size: 12px;
    line-height: 1.3;
    min-height: 0;
  }
  .benefit-row p {
    display: block;
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: break-word;
  }
  .network-status {
    margin-bottom: 8px;
    font-size: 9px;
  }
  .primary {
    min-width: 0;
    width: min(100%, 340px);
    min-height: 46px;
    padding: 10px 15px;
    font-size: 13px;
  }
  .action-caption {
    font-size: 10px;
    line-height: 1.4;
    margin-top: 6px;
  }
  .server-card {
    flex-direction: column;
    text-align: center;
    gap: 4px;
    padding: 6px 4px;
    width: 112px;
  }
  .server-card strong {
    font-size: 10px;
  }
  .server-card small {
    font-size: 8px;
    margin-top: 3px;
  }
  .server-card img {
    width: 26px;
    height: 17px;
  }
  .server-card span {
    white-space: normal;
  }
  .server-info {
    left: 50%;
    transform: translateX(-50%);
    width: 145px;
  }
  .merge-label {
    font-size: 10px;
  }
  .merge-title {
    font-size: 24px;
  }
  .merge-list {
    max-width: 260px;
    font-size: 10px;
  }
}
@media (max-width: 380px) {
  .hero {
    padding-inline: 9px;
  }
  .hero-benefits {
    padding: 8px;
  }
  .hero-action {
    gap: 8px;
  }
  .benefit-row {
    column-gap: 6px;
  }
  .benefit-row > strong {
    font-size: 28px;
  }
  .benefit-row h2 {
    font-size: 11px;
  }
  .benefit-row p {
    font-size: 11px;
  }
}
@media (max-width: 900px) and (max-height: 620px) {
  .hero {
    gap: 3px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  h1 {
    font-size: 26px;
  }
  .launch {
    margin-top: 5px;
  }
  .benefits-kicker {
    min-height: 0;
    margin-bottom: 3px;
  }
  .benefit-row {
    padding: 5px 0;
  }
  .hero-action {
    row-gap: 7px;
  }
  .primary {
    min-height: 42px;
    padding: 8px 14px;
  }
}
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .hero {
    grid-template-columns: minmax(180px, 1fr) minmax(350px, 1.4fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
  }
  .hero-heading {
    grid-column: 1 / -1;
  }
  .stage {
    grid-column: 1;
    grid-row: 2;
  }
  .hero-action {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
  }
  .benefits-kicker {
    font-size: 8px;
  }
  .benefit-row h2,
  .benefit-row p {
    font-size: 10px;
  }
  .benefit-row > strong {
    font-size: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}

/* Mobile: nút kết nối nằm trên hai ô tính năng */
@media (max-width: 900px) {
  .hero-action-center {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .benefits-gold {
    grid-column: 1;
    grid-row: 2;
  }

  .benefits-mint {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 900px) {
  /* Sau tiêu đề: địa cầu chiếm ít hơn, nội dung chiếm nhiều hơn */
  .hero {
    grid-template-rows:
      auto
      minmax(0, 0.8fr)
      minmax(min-content, 1.2fr);
  }

  .stage {
    height: 100%;
    min-height: 0;
  }

  /* Nút phía trên, hai ô tính năng phía dưới */
  .hero-action {
    height: 100%;
    grid-template-rows: auto minmax(min-content, 1fr);
    align-items: stretch;
    gap: 8px;
  }

  .hero-action-center {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .benefits-gold {
    grid-column: 1;
    grid-row: 2;
  }

  .benefits-mint {
    grid-column: 2;
    grid-row: 2;
  }

  /* Tăng độ nổi bật của nội dung */
  .hero-benefits {
    padding: 12px 10px;
  }

  .benefits-kicker {
    font-size: 17px;
    line-height: 1.3;
    min-height: 0;
  }

  .benefit-row > strong {
    font-size: 34px;
  }

  .benefit-row h2 {
    font-size: 12px;
    line-height: 1.35;
  }

  .benefit-row p {
    font-size: 13px;
    line-height: 1.45;
  }
}

/* Nút kết nối lớn, màu vàng công nghệ — chỉ desktop */
@media (min-width: 901px) {
  /* Nới cột giữa để nút lớn không đè hai ô nội dung */
  .hero-action {
    grid-template-columns:
      minmax(0, 1fr)
      clamp(300px, 26vw, 400px)
      minmax(0, 1fr);
    column-gap: clamp(16px, 2vw, 32px);
  }

  .hero-action-center .primary {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    width: 100%;
    min-width: 0;
    min-height: 104px;
    padding: 24px 18px;
    gap: 14px;

    font-size: clamp(19px, 1.6vw, 25px);
    font-weight: 800;
    letter-spacing: 1px;
    color: #302006;

    background: linear-gradient(115deg, #fff0ad 0%, #ffd56a 45%, #edac30 100%);

    border: 1px solid #fff1bb;
    border-radius: 8px;

    box-shadow:
      0 0 24px rgba(255, 193, 64, 0.3),
      0 0 55px rgba(255, 174, 35, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.75);

    transition:
      transform 0.25s ease,
      box-shadow 0.25s ease;
  }

  /* Giữ chữ trên một hàng */
  .hero-action-center .button-copy {
    position: relative;
    z-index: 1;
    white-space: nowrap;
  }

  .hero-action-center .button-symbol {
    font-size: 28px;
    color: #664006;
  }

  .hero-action-center .button-line {
    width: 22px;
    flex-shrink: 0;
    background: #80520a;
  }

  /* Vệt sáng quét nhẹ qua nút */
  .hero-action-center .primary::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;

    background: linear-gradient(
      110deg,
      transparent 30%,
      rgba(255, 255, 255, 0.6) 50%,
      transparent 70%
    );

    transform: translateX(-150%);
    animation: gold-button-scan 4s ease-in-out infinite;
  }

  .hero-action-center .primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow:
      0 0 35px rgba(255, 193, 64, 0.5),
      0 0 75px rgba(255, 174, 35, 0.2),
      inset 0 1px 0 #fff5d1;
  }

  .hero-action-center .primary:focus-visible {
    outline: 2px solid #fff1bb;
    outline-offset: 5px;
  }
}

@keyframes gold-button-scan {
  0%,
  55% {
    transform: translateX(-150%);
  }
  85%,
  100% {
    transform: translateX(150%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-action-center .primary::before {
    animation: none;
  }
}
@media (min-width: 901px) {
  .hero-action-center .primary {
    color: #15352e;
    background: linear-gradient(
      90deg,
      #ffe59a 0%,
      #ffd369 35%,
      #d4e9a1 55%,
      #92ebc9 75%,
      #56d8bd 100%
    );
    border-color: #d7f4c5;
    box-shadow:
      -12px 0 30px rgba(255, 205, 95, 0.22),
      12px 0 30px rgba(86, 216, 189, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.65);
  }

  .hero-action-center .button-symbol {
    color: #645018;
  }

  .hero-action-center .button-line {
    background: #246b59;
  }

  .hero-action-center .primary:hover:not(:disabled) {
    box-shadow:
      -15px 0 40px rgba(255, 205, 95, 0.35),
      15px 0 40px rgba(86, 216, 189, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }
}

@media (min-width: 901px) {
  .hero-action-center {
    align-self: start;
    margin-top: 0;
    padding-top: 0;
  }

  .hero-action-center .network-status {
    margin-top: 0;
    margin-bottom: 12px;
  }
}