:root {
  --ink: #f4f6f8;
  --muted: rgba(244, 246, 248, 0.72);
  --line: rgba(255, 255, 255, 0.18);
  --glass: rgba(18, 22, 28, 0.55);
  --glass-border: rgba(255, 255, 255, 0.22);
  --continue: #6b7280;
  --continue-hover: #7c8491;
  --primary: #00e676;
  --font-display: "Syne", "Vazirmatn", system-ui, sans-serif;
  --font-body: "Vazirmatn", "IBM Plex Sans", system-ui, sans-serif;
  --font-latin: "IBM Plex Sans", "Vazirmatn", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  height: 100dvh;
  margin: 0;
  overflow: hidden !important;
}

body.gate {
  color: var(--ink);
  font-family: var(--font-body);
  overflow: hidden !important;
  background: #0a0c10;
  overscroll-behavior: none;
}

body[dir="ltr"] {
  font-family: var(--font-latin);
}

#app {
  min-height: 100%;
}

body.gate #app {
  min-height: 100dvh;
}

button,
input {
  font: inherit;
}

/* —— Full-bleed photo wall (reference style) —— */
.wall {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 3px;
  background: #000;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

.wall__cell {
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.wall__cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.88) saturate(1.45) contrast(1.08);
  transform: scale(1.02);
  transition: transform 8s ease, filter 0.4s ease;
}

.wall__cell:nth-child(odd) img {
  animation: ken 18s ease-in-out infinite alternate;
}

.wall__cell:nth-child(even) img {
  animation: ken-rev 22s ease-in-out infinite alternate;
}

.wall__cell span {
  position: absolute;
  inset-inline-start: 10px;
  bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

.wall__dim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 60% 55% at 50% 45%,
      rgba(0, 40, 30, 0.12),
      rgba(0, 0, 0, 0.38) 62%,
      rgba(0, 0, 0, 0.58)
    ),
    linear-gradient(
      135deg,
      rgba(0, 230, 118, 0.08),
      transparent 40%,
      rgba(0, 188, 212, 0.07)
    );
}

@keyframes ken {
  from { transform: scale(1.02) translate(0, 0); }
  to { transform: scale(1.08) translate(-1.2%, 1%); }
}

@keyframes ken-rev {
  from { transform: scale(1.05) translate(0, 0); }
  to { transform: scale(1.02) translate(1%, -0.8%); }
}

.gate__top {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  pointer-events: none;
}

.gate__top .lang,
.gate__top .lang-switch,
.gate__logo {
  pointer-events: auto;
}

.lang-switch {
  display: flex;
  align-items: center;
}

.lang-select {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.32rem 1.6rem 0.32rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
  max-width: 9.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23fff' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
}

body.ltr .lang-select {
  background-position: right 0.45rem center;
  padding: 0.32rem 1.6rem 0.32rem 0.55rem;
}

body.rtl .lang-select {
  background-position: left 0.45rem center;
  padding: 0.32rem 0.55rem 0.32rem 1.6rem;
}

.lang-select option {
  color: #111;
  background: #fff;
}

.gate__logo {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.gate__logo em {
  font-style: normal;
  color: var(--primary);
}

.gate__langs {
  display: flex;
  gap: 0.3rem;
}

.lang {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.28rem 0.5rem;
  cursor: pointer;
  border-radius: 6px;
}

.lang[aria-pressed="true"] {
  background: #fff;
  color: #111;
  border-color: #fff;
}

.gate__main {
  position: relative;
  z-index: 3;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: 0.75rem;
  overflow: hidden;
}

/* —— Glass modal —— */
.modal {
  width: min(100%, 360px);
  max-height: min(92dvh, 640px);
  padding: 1.25rem 1.2rem 1.1rem;
  border-radius: 22px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 0.65rem;
  text-align: center;
  animation: modal-in 0.55s ease both;
  overflow: auto;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal__icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 0.15rem;
  border-radius: 20px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 35% 30%, rgba(0, 230, 118, 0.35), transparent 55%),
    radial-gradient(circle at 70% 75%, rgba(0, 188, 212, 0.28), transparent 50%),
    rgba(8, 12, 18, 0.85);
  border: 1px solid rgba(0, 230, 118, 0.45);
  box-shadow:
    0 0 0 1px rgba(0, 188, 212, 0.15),
    0 10px 28px rgba(0, 230, 118, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.modal__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal__title {
  margin: 0;
  font-size: clamp(1.15rem, 3.5vw, 1.35rem);
  font-weight: 700;
  line-height: 1.45;
  color: #fff;
}

.modal__blurb {
  margin: -0.15rem 0 0.15rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  line-height: 1.55;
  text-align: center;
}

.modal__apps {
  margin-top: 0.15rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  gap: 0.45rem;
}

.modal__apps-label {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
  text-transform: none;
}

.modal__apps-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.modal__social {
  display: grid;
  gap: 0.55rem;
}

.google-host {
  min-height: 42px;
  display: flex;
  justify-content: center;
}

.google-host[hidden] {
  display: none !important;
}

.google-host iframe {
  max-width: 100% !important;
}

.social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.social:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.social:active {
  transform: scale(0.985);
}

.social__icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.social__icon svg {
  display: block;
}

.social--google {
  background: #fff;
  color: #1f1f1f;
}

.social--apple {
  background: #111;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.social--apple:hover {
  background: #000;
}

.social[hidden] {
  display: none !important;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.store-btn svg {
  flex: 0 0 auto;
}

.store-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(0, 230, 118, 0.45);
}

.store-btn--direct {
  grid-column: 1 / -1;
  border-color: rgba(0, 230, 118, 0.35);
  color: var(--primary);
}

.modal__or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.modal__or::before,
.modal__or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.22);
}

.modal__form {
  display: grid;
  gap: 0.55rem;
}

.modal__form input {
  width: 100%;
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 0.7rem 1.1rem;
  outline: none;
  text-align: center;
}

.modal__form input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.modal__form input:focus {
  border-color: rgba(255, 255, 255, 0.45);
}

.modal__error {
  margin: 0;
  min-height: 1.1em;
  color: #ff8a80;
  font-size: 0.8rem;
}

.modal__continue {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--continue);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

.modal__continue:hover {
  background: var(--continue-hover);
}

.modal__continue:disabled {
  opacity: 0.65;
  cursor: wait;
}

.modal__guest {
  appearance: none;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.35rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.modal__guest:hover {
  color: #fff;
}

/* privacy fallback */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem;
  overflow: auto;
  height: auto;
  color: #eaf0f5;
  background: #0b0f14;
}

@media (max-width: 900px) {
  .wall {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
  }
}

@media (max-width: 520px) {
  .modal {
    width: min(100%, 340px);
    padding: 1.35rem 1.15rem 1.2rem;
  }
  .wall__cell span {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wall__cell img {
    animation: none !important;
  }
  .modal {
    animation: none !important;
  }
}
