:root {
  --portal-night: #020817;
  --portal-cyan: #47d8ff;
  --portal-blue: #1677ff;
}

body.portal-entry-active {
  overflow: hidden;
  background: var(--portal-night);
}

.portal-entry {
  position: fixed;
  inset: 0;
  z-index: 12000;
  overflow: hidden;
  isolation: isolate;
  color: #f7fbff;
  background: linear-gradient(180deg, #020714 0%, #031027 48%, #020713 100%);
  cursor: pointer;
  transition: opacity 980ms ease, filter 980ms ease, transform 980ms cubic-bezier(0.19, 1, 0.22, 1);
}

.portal-entry.is-leaving {
  pointer-events: none;
  opacity: 0;
  filter: blur(12px) saturate(0.76);
  transform: scale(1.035);
}

.portal-entry.is-hidden { display: none; }

.portal-entry__art,
.portal-entry__shade,
.portal-entry__canvas,
.portal-entry__scan,
.portal-entry__stars {
  position: absolute;
  inset: 0;
}

.portal-entry__art {
  z-index: -5;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 58% 50%, rgba(17, 89, 180, 0.2), transparent 35%), #020714;
}

.portal-entry__art picture,
.portal-entry__art img {
  display: block;
  width: 100%;
  height: 100%;
}

.portal-entry__art img {
  object-fit: contain;
  object-position: center;
  filter: saturate(1.12) contrast(1.06) brightness(0.84);
  transform: scale(1.015);
  animation: portal-art-breathe 12s ease-in-out infinite alternate;
}

.portal-entry__canvas {
  z-index: -4;
  width: 100%;
  height: 100%;
  opacity: 0.5;
  mix-blend-mode: screen;
}

.portal-entry__shade {
  z-index: -3;
  background:
    linear-gradient(180deg, rgba(1, 5, 16, 0.72) 0%, transparent 20%, transparent 71%, rgba(1, 5, 16, 0.9) 100%),
    linear-gradient(90deg, rgba(2, 8, 24, 0.4), transparent 32%, transparent 72%, rgba(2, 8, 24, 0.42)),
    radial-gradient(circle at 51% 54%, transparent 0 23%, rgba(0, 114, 255, 0.08) 35%, transparent 57%);
}

.portal-entry__scan {
  z-index: -2;
  height: 18%;
  top: -18%;
  bottom: auto;
  opacity: 0.3;
  background: linear-gradient(180deg, transparent, rgba(96, 221, 255, 0.18), transparent);
  animation: portal-scan 8.8s linear infinite;
}

.portal-entry__stars { z-index: -1; pointer-events: none; }

.portal-entry__star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  opacity: 0.25;
  background: #fff;
  box-shadow: 0 0 12px 3px rgba(90, 218, 255, 0.72);
  animation: portal-star 3.8s ease-in-out infinite;
}

.portal-entry__star:nth-child(1) { top: 8%; left: 5%; animation-delay: 0.2s; }
.portal-entry__star:nth-child(2) { top: 13%; left: 11%; animation-delay: 1.1s; }
.portal-entry__star:nth-child(3) { top: 7%; left: 17%; animation-delay: 2.2s; }
.portal-entry__star:nth-child(4) { top: 19%; left: 8%; animation-delay: 2.8s; }
.portal-entry__star:nth-child(5) { top: 15%; left: 20%; animation-delay: 0.7s; }
.portal-entry__star:nth-child(6) { top: 25%; left: 14%; animation-delay: 1.8s; }
.portal-entry__star:nth-child(7) { top: 12%; left: 92%; animation-delay: 0.9s; }
.portal-entry__star:nth-child(8) { top: 31%; left: 88%; animation-delay: 2.5s; }
.portal-entry__star:nth-child(9) { top: 71%; left: 9%; animation-delay: 1.4s; }
.portal-entry__star:nth-child(10) { top: 63%; left: 93%; animation-delay: 3.1s; }

.portal-entry__header {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  left: clamp(22px, 4vw, 68px);
  right: clamp(22px, 4vw, 68px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.portal-entry__brand { display: flex; align-items: center; gap: 16px; min-width: 0; }

.portal-entry__logo {
  width: 94px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 6px 9px;
  border: 1px solid rgba(180, 226, 255, 0.32);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 32px rgba(57, 207, 255, 0.3);
  backdrop-filter: blur(14px);
}

.portal-entry__logo img { width: 100%; height: 100%; object-fit: contain; }
.portal-entry__brand-copy { min-width: 0; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.72); }
.portal-entry__brand-copy strong,
.portal-entry__brand-copy span { display: block; letter-spacing: 0; }
.portal-entry__brand-copy strong { font-size: 19px; line-height: 1.2; }
.portal-entry__brand-copy span { margin-top: 4px; color: rgba(222, 241, 255, 0.7); font-size: 11px; letter-spacing: 0.16em; }

.portal-entry__state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(230, 245, 255, 0.8);
  font-size: 12px;
  white-space: nowrap;
}

.portal-entry__state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #65e9ff;
  box-shadow: 0 0 14px rgba(101, 233, 255, 0.94);
  animation: portal-state 2.4s ease-in-out infinite;
}

.portal-entry__footer {
  position: absolute;
  left: clamp(22px, 4vw, 68px);
  right: clamp(22px, 4vw, 68px);
  bottom: max(26px, calc(18px + env(safe-area-inset-bottom)));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(24px, 5vw, 88px);
}

.portal-entry__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  color: #84e7ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.portal-entry__eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, #4ce0ff, transparent);
  box-shadow: 0 0 12px rgba(76, 224, 255, 0.6);
}

.portal-entry__title {
  max-width: 820px;
  margin: 0;
  font-size: clamp(30px, 4.25vw, 68px);
  font-weight: 900;
  line-height: 1.03;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 5px 28px rgba(0, 0, 0, 0.82), 0 0 38px rgba(40, 164, 255, 0.24);
}

.portal-entry__subtitle {
  max-width: 680px;
  margin: 12px 0 0;
  color: rgba(226, 241, 255, 0.76);
  font-size: clamp(13px, 1.2vw, 17px);
  line-height: 1.65;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.82);
}

.portal-entry__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.portal-entry__tag {
  padding: 7px 11px;
  border: 1px solid rgba(133, 219, 255, 0.22);
  color: rgba(226, 244, 255, 0.72);
  background: rgba(7, 28, 61, 0.48);
  font-size: 11px;
  backdrop-filter: blur(10px);
}

.portal-entry__enter {
  min-width: 206px;
  min-height: 66px;
  display: inline-grid;
  grid-template-columns: 1fr 48px;
  align-items: center;
  gap: 16px;
  padding: 8px 9px 8px 24px;
  border: 1px solid rgba(132, 226, 255, 0.5);
  border-radius: 999px;
  color: #f8fdff;
  background: linear-gradient(125deg, rgba(5, 31, 73, 0.92), rgba(13, 82, 136, 0.58)), rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 24px rgba(103, 228, 255, 0.1), 0 0 32px rgba(28, 175, 255, 0.3), 0 24px 60px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.portal-entry__enter:hover,
.portal-entry__enter:focus-visible {
  outline: none;
  border-color: rgba(203, 247, 255, 0.9);
  box-shadow: inset 0 0 26px rgba(120, 231, 255, 0.18), 0 0 44px rgba(36, 188, 255, 0.5), 0 28px 64px rgba(0, 0, 0, 0.42);
  transform: translateY(-2px);
}

.portal-entry__enter span { font-size: 17px; font-weight: 800; letter-spacing: 0; white-space: nowrap; }
.portal-entry__enter i {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #041225;
  background: radial-gradient(circle at 30% 24%, #fff 0 20%, #d5f2ff 48%, #8cb7d4 100%);
  box-shadow: inset -7px -9px 14px rgba(3, 25, 50, 0.2), 0 0 26px rgba(112, 230, 255, 0.68);
  font-style: normal;
  font-size: 23px;
  transition: transform 220ms ease;
}
.portal-entry__enter:hover i { transform: translateX(2px); }
.portal-entry__hint { margin: 10px 8px 0 0; color: rgba(207, 231, 246, 0.48); text-align: center; font-size: 10px; }

@keyframes portal-art-breathe {
  from { transform: scale(1.015); filter: saturate(1.08) contrast(1.04) brightness(0.82); }
  to { transform: scale(1.045); filter: saturate(1.18) contrast(1.08) brightness(0.9); }
}
@keyframes portal-scan {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 0.28; }
  78% { opacity: 0.2; }
  100% { transform: translateY(690%); opacity: 0; }
}
@keyframes portal-star {
  0%, 100% { opacity: 0.16; transform: scale(0.75); }
  42% { opacity: 0.92; transform: scale(1.6); }
  58% { opacity: 0.42; transform: scale(1); }
}
@keyframes portal-state {
  0%, 100% { opacity: 0.45; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1.12); }
}

@media (max-width: 720px) {
  .portal-entry__art img { object-fit: cover; object-position: center; transform: scale(1.01); }
  .portal-entry__shade {
    background: linear-gradient(180deg, rgba(1, 6, 19, 0.56) 0%, transparent 25%, transparent 55%, rgba(1, 6, 19, 0.92) 84%), radial-gradient(circle at 50% 58%, transparent 0 25%, rgba(0, 114, 255, 0.08) 48%, transparent 70%);
  }
  .portal-entry__header { top: max(18px, env(safe-area-inset-top)); left: 18px; right: 18px; }
  .portal-entry__logo { width: 78px; height: 44px; }
  .portal-entry__brand { gap: 11px; }
  .portal-entry__brand-copy strong { font-size: 15px; }
  .portal-entry__brand-copy span { display: none; }
  .portal-entry__state { font-size: 10px; }
  .portal-entry__footer { left: 18px; right: 18px; bottom: max(20px, calc(14px + env(safe-area-inset-bottom))); display: block; }
  .portal-entry__eyebrow { margin-bottom: 8px; font-size: 10px; }
  .portal-entry__title { max-width: 92%; font-size: clamp(29px, 9.6vw, 43px); line-height: 1.08; }
  .portal-entry__subtitle { max-width: 94%; margin-top: 10px; font-size: 13px; line-height: 1.55; }
  .portal-entry__tags { display: none; }
  .portal-entry__enter { width: 100%; min-height: 58px; margin-top: 18px; grid-template-columns: minmax(0, 1fr) 44px; padding-left: 22px; }
  .portal-entry__enter span { font-size: 16px; }
  .portal-entry__enter i { width: 44px; height: 44px; font-size: 21px; }
  .portal-entry__hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-entry,
  .portal-entry__art img,
  .portal-entry__scan,
  .portal-entry__star,
  .portal-entry__state,
  .portal-entry__enter,
  .portal-entry__enter i {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .portal-entry__canvas { display: none; }
}

