.page-open {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(1, 11, 24, 0.78), rgba(2, 15, 31, 0.95)),
    url("../images/hero-slide-2.webp") center center / cover no-repeat;
  animation: cityPortalOpen 3.8s cubic-bezier(0.2, 0.72, 0.22, 1) forwards;
}

.page-open::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
  background-image:
    linear-gradient(rgba(126, 205, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 205, 255, 0.12) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at 50% 54%, #000 0 42%, transparent 78%);
  animation: cityPortalGrid 3.35s ease forwards;
}

.page-open::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(226, 186, 110, 0.16), transparent 29%),
    linear-gradient(90deg, rgba(2, 9, 20, 0.72), transparent 28%, transparent 72%, rgba(2, 9, 20, 0.72));
}

.city-portal {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  width: min(1050px, calc(100vw - 40px));
  padding: 40px 26px;
  text-align: center;
  text-shadow: 0 12px 38px rgba(0, 0, 0, 0.48);
  animation: cityPortalContent 3.25s ease forwards;
}

.city-portal-seal {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  border: 1px solid rgba(246, 216, 154, 0.65);
  border-radius: 22px;
  color: #f7dda8;
  background: linear-gradient(145deg, rgba(214, 170, 103, 0.22), rgba(47, 125, 246, 0.12));
  box-shadow:
    0 0 0 8px rgba(214, 170, 103, 0.05),
    0 22px 55px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: scale(0.7) rotate(-8deg);
  animation: cityPortalSeal 0.9s cubic-bezier(0.16, 0.84, 0.28, 1) 0.15s forwards;
}

.city-portal-kicker {
  margin-bottom: 10px;
  color: rgba(167, 210, 255, 0.86);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.32em;
  opacity: 0;
  animation: cityPortalFadeUp 0.8s ease 0.55s forwards;
}

.city-portal h1 {
  margin: 0;
  color: #fff;
  font-family: "Noto Serif SC", "Songti SC", "Microsoft YaHei", serif;
  font-size: clamp(38px, 6.6vw, 76px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0.08em;
  opacity: 0;
  animation: cityPortalTitle 1.1s cubic-bezier(0.16, 0.84, 0.28, 1) 0.62s forwards;
}

.city-portal-subtitle {
  margin: 17px 0 0;
  color: rgba(228, 238, 252, 0.78);
  font-size: 15px;
  letter-spacing: 0.12em;
  opacity: 0;
  animation: cityPortalFadeUp 0.9s ease 0.9s forwards;
}

.city-portal-line {
  position: relative;
  width: min(680px, 78vw);
  height: 1px;
  margin: 29px 0 25px;
  background: linear-gradient(90deg, transparent, rgba(244, 211, 146, 0.9), transparent);
  box-shadow: 0 0 18px rgba(220, 174, 96, 0.42);
  transform: scaleX(0);
  animation: cityPortalLine 1.05s ease 1.02s forwards;
}

.city-portal-line::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  border: 1px solid #f2d89f;
  border-radius: 50%;
  background: #0b2943;
  box-shadow: 0 0 16px rgba(242, 216, 159, 0.7);
  transform: translate(-50%, -50%) rotate(45deg);
}

.city-portal-cities {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  width: min(920px, 100%);
}

.city-portal-city {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 68px;
  padding: 11px 8px;
  border: 1px solid rgba(139, 198, 255, 0.22);
  border-radius: 12px;
  color: #e8f4ff;
  background: linear-gradient(145deg, rgba(7, 31, 56, 0.78), rgba(5, 20, 39, 0.7));
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: translateY(24px);
  animation: cityPortalCity 0.75s cubic-bezier(0.16, 0.84, 0.28, 1) calc(1.2s + var(--i) * 0.09s) forwards;
}

.city-portal-city::before {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  top: 0;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, rgba(246, 216, 154, 0.8), transparent);
  opacity: 0.7;
}

.city-portal-city strong {
  color: #fff;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(16px, 2vw, 23px);
  letter-spacing: 0.08em;
}

.city-portal-city small {
  color: rgba(166, 210, 250, 0.72);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.city-portal-scan {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.city-portal-scan::before {
  content: "";
  position: absolute;
  top: -20%;
  left: -32%;
  width: 24%;
  height: 150%;
  background: linear-gradient(90deg, transparent, rgba(192, 238, 255, 0.16), transparent);
  transform: rotate(17deg);
  animation: cityPortalSheen 3.1s ease-in-out infinite;
}

.page-open-skip {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(3, 17, 34, 0.36);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.page-open-skip:hover {
  color: #fff;
  border-color: rgba(255, 229, 178, 0.56);
}

body.page-opening {
  overflow: hidden;
}

@keyframes cityPortalSeal {
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes cityPortalFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cityPortalTitle {
  from { opacity: 0; transform: translateY(20px) scale(0.96); filter: blur(7px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes cityPortalLine {
  to { transform: scaleX(1); }
}

@keyframes cityPortalCity {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cityPortalGrid {
  0% { opacity: 0.12; transform: scale(1.04); }
  42% { opacity: 0.34; }
  100% { opacity: 0; transform: scale(0.98); }
}

@keyframes cityPortalSheen {
  0%, 62% { transform: translateX(-30%) rotate(17deg); opacity: 0; }
  76% { opacity: 0.85; }
  94%, 100% { transform: translateX(570%) rotate(17deg); opacity: 0; }
}

@keyframes cityPortalContent {
  0%, 78% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  100% { opacity: 0; transform: translateY(-12px) scale(1.08); filter: blur(3px); }
}

@keyframes cityPortalOpen {
  0%, 78% {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    clip-path: circle(150% at 50% 52%);
  }
  100% {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    clip-path: circle(0 at 50% 52%);
  }
}

@media (max-width: 720px) {
  .city-portal {
    width: calc(100vw - 22px);
    padding: 34px 10px;
  }

  .city-portal-seal {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    font-size: 16px;
  }

  .city-portal h1 {
    font-size: clamp(34px, 11vw, 50px);
    letter-spacing: 0.05em;
  }

  .city-portal-subtitle {
    font-size: 12px;
    letter-spacing: 0.08em;
  }

  .city-portal-line {
    margin: 23px 0 20px;
  }

  .city-portal-cities {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .city-portal-city {
    min-height: 58px;
    padding: 9px 5px;
  }

  .city-portal-city strong {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-open {
    display: none !important;
  }
}
