/**
 * Portal 3D — HUD (yumuşak cam, düşük parıltı)
 * Google Fonts: Syne + DM Sans
 */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Syne:wght@500;600;700&display=swap");

body.page-portal {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background: #010108;
}

.portal-main {
  min-height: 100vh !important;
  height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
}

.portal-3d {
  position: fixed;
  inset: 0;
  z-index: 1;
  font-family: "DM Sans", system-ui, sans-serif;
  isolation: isolate;
}

.portal-3d__canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.portal-3d__vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.45) 100%),
    linear-gradient(180deg, rgba(16, 20, 36, 0.26) 0%, transparent 40%, rgba(0, 0, 0, 0.28) 100%);
}

.portal-3d__shine {
  position: absolute;
  inset: -20% -10%;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  mix-blend-mode: screen;
  background:
    radial-gradient(circle at 20% 25%, rgba(116, 139, 255, 0.32), transparent 38%),
    radial-gradient(circle at 78% 70%, rgba(255, 127, 220, 0.2), transparent 34%),
    radial-gradient(circle at 50% 50%, rgba(134, 200, 255, 0.09), transparent 40%);
  animation: portalAurora 14s ease-in-out infinite alternate;
}

.portal-3d.is-ready .portal-3d__vignette {
  opacity: 1;
}

.portal-3d.is-ready .portal-3d__shine {
  opacity: 0.4;
}

.portal-3d::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: soft-light;
  background-image: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0) 24%,
    rgba(255, 255, 255, 0.06) 45%,
    rgba(255, 255, 255, 0) 68%,
    rgba(255, 255, 255, 0.08) 100%
  );
  background-size: 220% 220%;
  animation: portalSheen 18s linear infinite;
}

.portal-3d__labels {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: auto;
  overflow: hidden;
}

.portal-3d__label {
  padding: 8px 16px;
  border-radius: 999px;
  font-family: "DM Sans", sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.94);
  background: linear-gradient(
    135deg,
    rgba(12, 18, 40, 0.88) 0%,
    rgba(6, 10, 28, 0.75) 100%
  );
  border: 1px solid rgba(100, 120, 140, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 4px 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
  transition:
    border-color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-3d__label.is-hover {
  border-color: rgba(180, 200, 220, 0.65);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 6px 28px rgba(0, 0, 0, 0.55);
  transform: scale(1.08);
}

.portal-3d__hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  /* Safe-area: Android Chrome / iOS Safari üst çentik alanına girip tıklanmasın. */
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  padding-left: calc(22px + env(safe-area-inset-left, 0px));
  padding-right: calc(22px + env(safe-area-inset-right, 0px));
  padding-bottom: 16px;
  pointer-events: auto;
  background: linear-gradient(
    180deg,
    rgba(2, 4, 14, 0.82) 0%,
    rgba(2, 4, 14, 0.35) 70%,
    transparent 100%
  );
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.portal-3d__hud a,
.portal-3d__hud button {
  pointer-events: auto;
}

.portal-3d__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.95);
}

.portal-3d__brand img {
  height: 24px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.portal-3d__brand span {
  font-family: "Syne", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(160, 168, 188, 0.85);
}

.portal-3d__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-3d__btn {
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: linear-gradient(180deg, #ffffff 0%, #e8eef8 100%);
  color: #060a12;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(100, 200, 255, 0.12),
    0 8px 32px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s, box-shadow 0.25s, filter 0.25s;
}

.portal-3d__btn:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.45);
}

.portal-3d__hint-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  pointer-events: none;
  padding: 20px 16px 22px;
  background: linear-gradient(0deg, rgba(1, 2, 10, 0.75) 0%, transparent 100%);
}

.portal-3d__hint {
  margin: 0 auto;
  max-width: 520px;
  text-align: center;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.6;
}

.portal-3d__hint-line {
  width: min(200px, 40vw);
  height: 1px;
  margin: 0 auto 12px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(120, 130, 150, 0.5),
    transparent
  );
}

.portal-3d__loading {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, #0a1020 0%, #010108 70%);
  color: rgba(200, 220, 255, 0.9);
  font-family: "Syne", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  transition: opacity 0.65s ease, visibility 0.65s ease;
}

.portal-3d__loading-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(100, 180, 255, 0.2);
  border-top-color: rgba(160, 220, 255, 0.95);
  animation: portalSpin 0.9s linear infinite;
}

.portal-3d__loading.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes portalSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes portalAurora {
  0% {
    transform: translate3d(-1.5%, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(1.5%, -1%, 0) scale(1.04);
  }
}

@keyframes portalSheen {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 140% 50%;
  }
}

.portal-3d__noscript {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 24px;
  background: #010108;
  color: #e8ecff;
  overflow: auto;
  font-family: "DM Sans", sans-serif;
}

.portal-3d__noscript a {
  color: #7dd3fc;
}

@media (prefers-reduced-motion: reduce) {
  .portal-3d__label {
    transition: none;
  }
  .portal-3d__loading-ring {
    animation: none;
    border-top-color: rgba(160, 220, 255, 0.5);
  }
}

@media (pointer: coarse), (max-width: 900px) {
  .portal-3d__hud {
    border-bottom: 0;
  }
  .portal-3d__shine,
  .portal-3d::before {
    display: none;
  }
  .portal-3d__labels,
  .portal-3d__label {
    pointer-events: none;
  }
}
