/* Страницы lorrr в браузере: приглашение, главная. Как в приложении — чёрный фон, аура цвета состояния,
   плёночное зерно, Geist. Цвет ауры приходит из разметки (--aura, --aura-soft). */
@font-face {
  font-family: Geist;
  src: url("/static/geist.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #09090a;
  --ink: #f2f2f0;
  --ink2: rgba(242, 242, 240, 0.6);
  --ink3: rgba(242, 242, 240, 0.38);
  --line: rgba(255, 255, 255, 0.07);
  --on-white: #0a0a0b;
  --aura: #c9a46a;
  --aura-soft: rgba(201, 164, 106, 0.55);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100svh;
  overflow-x: hidden;
}

/* Аура: мягкое свечение за человеком, медленно дышит. */
.aura {
  position: fixed;
  left: 50%;
  top: 30%;
  width: 150vmax;
  height: 150vmax;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--aura-soft), rgba(9, 9, 10, 0) 72%);
  animation: breathe 9s var(--ease) infinite alternate;
  pointer-events: none;
}

/* Зерно поверх света: фактура плёнки, как в приложении. */
.grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.35;
  mix-blend-mode: multiply;
  pointer-events: none;
}

@keyframes breathe {
  from {
    opacity: 0.75;
    transform: translate(-50%, -50%) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .aura {
    animation: none;
  }
}

main {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 440px;
  min-height: 100svh;
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
}

.brand {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.who {
  margin: auto 0 0;
  padding-top: 48px;
  text-align: center;
  animation: rise 0.7s var(--ease) both;
}

/* Фото в кольце ауры; без фото — первая буква имени. */
.ring {
  width: 116px;
  height: 116px;
  margin: 0 auto;
  padding: 3px;
  border-radius: 50%;
  background: var(--aura);
  box-shadow: 0 0 48px var(--aura-soft), 0 0 120px var(--aura-soft);
}

.ring > * {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: #121214;
  object-fit: cover;
  font-size: 44px;
  font-weight: 300;
  color: var(--ink);
}

h1 {
  margin: 26px 0 0;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.state {
  margin: 14px 0 0;
  font-size: 15px;
  color: var(--ink2);
}

.state b {
  font-weight: 500;
  color: var(--aura);
}

.pitch {
  max-width: 34ch;
  margin: 22px auto 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink2);
  text-wrap: pretty;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 40px;
  animation: rise 0.7s 0.12s var(--ease) both;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 24px;
  border-radius: 999px;
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: transform 0.15s var(--ease), background 0.2s;
}

.btn:active {
  transform: scale(0.97);
}

.btn svg {
  flex: none;
  width: 20px;
  height: 20px;
}

.primary {
  background: var(--ink);
  color: var(--on-white);
}

.secondary {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.note {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  color: var(--ink3);
}

/* Запасной путь: код приглашения крупно (нажатие копирует) и три шага; подсвечивается после неудачного «Открыть». */
.code {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  padding: 20px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(18, 18, 20, 0.62);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: border-color 0.4s, box-shadow 0.4s;
  animation: rise 0.7s 0.24s var(--ease) both;
}

.code.lit {
  border-color: var(--aura-soft);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--aura-soft);
}

.code-title {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--ink3);
}

.code-box {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 100%;
  padding: 18px 12px 14px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s var(--ease), border-color 0.3s, background 0.3s;
}

.code-box:active {
  transform: scale(0.98);
}

.code-box.done {
  border-style: solid;
  border-color: var(--aura-soft);
  background: rgba(255, 255, 255, 0.06);
}

.code-value {
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  /* отступ слева уравновешивает разрядку после последнего знака — код ровно по центру */
  padding-left: 0.14em;
  user-select: all;
}

.code-action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--ink2);
}

.code-box.done .code-action {
  color: var(--aura);
}

.code-action svg {
  width: 16px;
  height: 16px;
}

.steps {
  margin: 0;
  padding: 2px 2px 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 6px 0 6px 34px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink2);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 5px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.only-desktop,
.only-android {
  display: none;
}

html.android .only-android {
  display: block;
}

html.desktop .only-desktop {
  display: block;
}

html.desktop .only-phone {
  display: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
