/* =========================================================
   Фаза — design boost (layered over styles.css)
   Stronger atmosphere, type, motion — same brand DNA
   ========================================================= */

:root {
  --ink: #04110e;
  --ink-soft: #243a32;
  --paper: #e6f0e9;
  --paper-2: #cfe0d6;
  --font-body: "Manrope", "Outfit", sans-serif;
  --lime: #d8ff3c;
  --lime-soft: #c2f24a;
  --teal: #0a7568;
  --teal-deep: #043f38;
  --glass: rgba(255, 255, 255, 0.42);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --shadow: 0 18px 48px rgba(4, 17, 14, 0.14);
  --shadow-lift: 0 26px 64px rgba(4, 17, 14, 0.18);
  --radius: 20px;
  --aurora-a: rgba(216, 255, 60, 0.52);
  --aurora-b: rgba(10, 117, 104, 0.42);
  --bg-spot-1: rgba(216, 255, 60, 0.38);
  --bg-spot-2: rgba(10, 117, 104, 0.28);
  --orbit-opacity: 0.72;
}

/* —— richer atmosphere —— */
body {
  background:
    radial-gradient(900px 560px at 100% 0%, var(--bg-spot-2), transparent 48%),
    radial-gradient(700px 500px at 78% 100%, var(--bg-spot-3), transparent 55%),
    radial-gradient(480px 380px at 12% 78%, var(--bg-spot-4), transparent 60%),
    linear-gradient(
      168deg,
      var(--bg-base-1) 0%,
      var(--bg-base-1) 24%,
      var(--bg-base-2) 54%,
      var(--bg-base-2) 70%,
      var(--bg-base-3) 100%
    );
  letter-spacing: -0.011em;
}

body::before {
  background-size: 72px 72px;
  opacity: 0.9;
  mask-image: radial-gradient(ellipse at 48% 22%, #000 8%, transparent 70%);
}

.noise {
  opacity: 0.085;
}

.vignette {
  background:
    radial-gradient(ellipse at 50% 30%, transparent 30%, rgba(4, 17, 14, 0.14) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, transparent 22%, transparent 68%, rgba(4, 17, 14, 0.08) 100%);
}

.aurora-blob {
  filter: blur(80px);
  opacity: 0.62;
}

/* brand equalizer removed — see design-signal.css (phase-sync) */

/* —— brand / type —— */
.brand {
  font-size: clamp(3.4rem, 10vw, 7rem);
  letter-spacing: -0.075em;
  line-height: 0.8;
  width: fit-content;
  max-width: 100%;
  background: linear-gradient(
    118deg,
    #04110e 8%,
    #043f38 32%,
    #0a7568 48%,
    #04110e 62%,
    #163d32 88%
  );
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: none;
}

.brand::before {
  content: none;
}

.welcome-wrap .brand {
  font-size: clamp(4rem, 14vw, 8.2rem);
}

.welcome-wrap {
  max-width: 44rem;
  padding-bottom: max(3.5rem, env(safe-area-inset-bottom));
}

.welcome-wrap h1,
.hero h1 {
  font-variation-settings: "opsz" 72;
  font-weight: 700;
}

.welcome-wrap h1 {
  font-size: clamp(1.65rem, 3.8vw, 2.65rem);
  max-width: 16ch;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.welcome-wrap .lead,
.hero-copy .lead {
  font-size: 1.05rem;
  line-height: 1.5;
  color: color-mix(in srgb, var(--ink-soft) 92%, var(--teal));
  max-width: 34ch;
}

/* —— welcome orbit cinematic —— */
.welcome-orbit {
  left: 62%;
  top: 40%;
  width: min(100vw, 820px);
  height: min(100vw, 820px);
  transform: translate(-38%, -48%);
}

.welcome-core {
  width: min(26vw, 176px);
  height: min(26vw, 176px);
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.65), transparent 40%),
    radial-gradient(circle at 50% 58%, #0a7568, #032822 68%, #010908);
  box-shadow:
    0 0 0 18px rgba(10, 117, 104, 0.08),
    0 0 0 36px rgba(216, 255, 60, 0.06),
    0 36px 70px rgba(4, 17, 14, 0.28);
}

.welcome-ring.wr-1 {
  border-width: 1.5px;
  border-color: rgba(10, 117, 104, 0.22);
}

.welcome-ring.wr-2 {
  border-color: rgba(216, 255, 60, 0.38);
}

.welcome-waveband {
  bottom: 10%;
  opacity: 0.55;
  filter: drop-shadow(0 8px 24px rgba(10, 117, 104, 0.15));
}

/* —— landing hero —— */
.hero {
  padding-bottom: clamp(1.6rem, 4.5vh, 3.2rem);
}

.hero-visual {
  /* soft fade only — no hard mid-screen edge / white stripe */
  mask-image: linear-gradient(180deg, #000 0%, #000 72%, rgba(0, 0, 0, 0.35) 90%, transparent 100%);
}

.hero-visual::after {
  display: none;
}

.orbit-stage {
  transform: scale(1.12);
}

.phase-core {
  width: min(48vw, 280px);
  height: min(48vw, 280px);
  filter: drop-shadow(0 28px 50px rgba(4, 17, 14, 0.18));
}

.light-rays {
  filter: blur(32px) saturate(1.05);
}

/* —— header / chrome —— */
.logo-word {
  font-size: 1.45rem;
  letter-spacing: -0.06em;
}

.logo-mark {
  filter: drop-shadow(0 8px 18px color-mix(in srgb, var(--teal) 35%, transparent));
}

.top-link,
.step-pill {
  border-radius: 12px;
  border-color: rgba(4, 17, 14, 0.1);
  background: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.invite-fab {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(10, 117, 104, 0.18);
  font-weight: 800;
}

body.coop-on .invite-fab,
.invite-fab.is-active,
.invite-fab:hover {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--lime) 52%, #fff),
    rgba(255, 255, 255, 0.88)
  );
  border-color: color-mix(in srgb, var(--teal) 42%, transparent);
}

/* —— buttons —— */
.btn {
  border-radius: 14px;
  letter-spacing: -0.015em;
}

.btn-primary {
  background:
    linear-gradient(155deg, #1a332b 0%, #04110e 48%, #020a08 100%);
  color: var(--lime);
  box-shadow:
    0 18px 42px rgba(4, 17, 14, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
  background: linear-gradient(155deg, #0a7568, #032822);
  color: #fff;
  box-shadow: 0 22px 50px rgba(4, 63, 56, 0.4);
}

.btn-cta {
  min-width: 11.5rem;
  padding: 1.12rem 2rem;
  font-size: 1.02rem;
}

.btn-relation {
  border-radius: 14px;
  font-weight: 700;
}

.relation-actions {
  gap: 0.7rem;
}

/* —— probe plaque —— */
.btn-probe {
  border-radius: 16px;
  border-width: 1.5px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(18px) saturate(1.2);
  padding: 1.2rem 1.35rem 1.3rem;
  box-shadow: none;
}

.probe-title {
  font-size: 1.28rem;
  letter-spacing: -0.035em;
}

.probe-badge {
  letter-spacing: 0.14em;
}

/* —— how / setup —— */
.eyebrow {
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--teal-deep);
}

.how-wrap h2,
.setup-wrap h2,
.modes-wrap h2,
.pay-wrap h2 {
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.how-steps li {
  border-radius: 18px;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.38));
  border-left-width: 4px;
}

.how-num {
  font-size: 1.55rem;
  background: linear-gradient(180deg, var(--teal), var(--teal-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.person-panel {
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.4));
  border-color: rgba(4, 17, 14, 0.1);
}

.person-panel:focus-within {
  border-color: color-mix(in srgb, var(--teal) 55%, transparent);
  box-shadow: 0 16px 40px rgba(10, 117, 104, 0.12);
}

.person-link span {
  background: linear-gradient(90deg, transparent, var(--teal), var(--lime), var(--teal), transparent);
  height: 2px;
}

/* —— mode cards —— */
.mode-card {
  border-radius: 22px;
  background: linear-gradient(168deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.42));
  border-color: rgba(4, 17, 14, 0.1);
}

.mode-card:hover {
  transform: translateY(-10px);
  border-color: color-mix(in srgb, var(--teal) 50%, transparent);
}

.mode-card.is-pro {
  background: linear-gradient(168deg, rgba(216, 255, 60, 0.34), rgba(255, 255, 255, 0.7));
}

.mode-price {
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.mode-tag {
  letter-spacing: 0.14em;
}

/* —— quiz —— */
.quiz-stage {
  max-width: 720px;
}

.q-cat {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  font-weight: 800;
  color: var(--teal-deep);
  text-transform: uppercase;
}

.q-text {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.6vw, 2.15rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 0.4rem 0 1.35rem;
}

.progress-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(4, 17, 14, 0.08);
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, var(--teal-deep), var(--teal), var(--lime));
  box-shadow: 0 0 16px rgba(216, 255, 60, 0.45);
}

.who-badge {
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(4, 17, 14, 0.1);
}

.option {
  border-radius: 16px;
  border: 1.5px solid rgba(4, 17, 14, 0.1);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42));
  backdrop-filter: blur(12px);
  padding: 1.05rem 1.15rem 1.05rem 3.1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  box-shadow: 0 10px 28px rgba(4, 17, 14, 0.05);
  transition:
    transform 0.3s var(--ease-spring),
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.3s ease;
}

.option::before {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(10, 117, 104, 0.1);
  color: var(--teal-deep);
  border: 1px solid rgba(10, 117, 104, 0.12);
}

.option:hover {
  transform: translateY(-3px) translateX(4px);
  border-color: color-mix(in srgb, var(--teal) 45%, transparent);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 36px rgba(10, 117, 104, 0.12);
}

.option.is-picked {
  border-color: transparent;
  background: linear-gradient(145deg, #0a7568, #04110e);
  color: var(--lime);
  box-shadow: 0 18px 40px rgba(4, 17, 14, 0.28);
}

.option.is-picked::before {
  background: rgba(216, 255, 60, 0.2);
  color: var(--lime);
  border-color: rgba(216, 255, 60, 0.35);
}

/* —— handoff / remote —— */
.handoff-wrap h2,
.remote-wait-wrap h2 {
  font-family: var(--font-display);
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.kb-help-btn {
  border-radius: 12px;
  background: #04110e;
  color: var(--lime);
}

.invite-modal-card,
.kb-modal-card {
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(230, 240, 233, 0.92));
  border: 1px solid rgba(4, 17, 14, 0.1);
}

.handoff-orb,
.handoff-core,
.remote-wait-orb {
  filter: none;
  opacity: 1;
}

.handoff-core-glow {
  filter: blur(14px);
}

/* —— results —— */
.score-hero {
  gap: 1.75rem;
  align-items: center;
}

.score-ring-wrap {
  filter: drop-shadow(0 0 calc(16px + var(--ring-fill, 0.5) * 28px) var(--ring-glow, rgba(255, 92, 138, 0.35)));
}

.score-ring-wrap::before {
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--ring-color, #ff5c8a) calc(14% + var(--ring-fill, 0.5) * 32%), transparent),
    transparent 68%
  );
}

.score-num span {
  font-family: var(--font-brand);
  font-weight: 800;
  letter-spacing: -0.06em;
}

.score-copy h2 {
  font-size: clamp(1.8rem, 4.2vw, 2.6rem);
  letter-spacing: -0.04em;
}

.pair-line {
  font-weight: 700;
  color: var(--teal-deep);
  letter-spacing: -0.01em;
}

.cat-row {
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4));
  border: 1px solid rgba(4, 17, 14, 0.08);
  padding: 0.95rem 1.1rem;
}

.cat-fill {
  background: linear-gradient(90deg, var(--teal), var(--lime));
}

/* —— context —— */
.context-q {
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4));
}

.context-option {
  border-radius: 14px;
}

.context-option:has(input:checked) {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 10%, white);
}

/* —— view motion —— */
@keyframes viewIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.view.is-active {
  animation: viewIn 0.75s var(--ease) both;
}

/* —— mobile —— */
@media (max-width: 820px) {
  .welcome-orbit {
    left: 50%;
    top: 26%;
    width: min(130vw, 460px);
    height: min(130vw, 460px);
    transform: translate(-50%, -50%);
  }

  .welcome-wrap .brand {
    font-size: clamp(3.6rem, 18vw, 5rem);
  }

  .welcome-wrap h1 {
    font-size: clamp(1.5rem, 6.5vw, 2rem);
  }

  .orbit-stage {
    transform: none !important;
  }

  .phase-core {
    width: min(38vw, 150px);
    height: min(38vw, 150px);
  }

  .option {
    padding-left: 2.9rem;
  }

  body::after {
    display: none;
  }
}

/* themed brand + chosen glints (must stay last — overrides base .brand) */
@keyframes brandThemeGlint {
  0%,
  100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes chosenTextGlint {
  0%,
  100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes pickedShineSweep {
  0%,
  55%,
  100% {
    transform: translateX(-140%) skewX(-12deg);
    opacity: 0;
  }
  62% { opacity: 0.85; }
  78% {
    transform: translateX(140%) skewX(-12deg);
    opacity: 0;
  }
}

body.theme-couple .brand,
body.theme-friends .brand,
body.theme-family .brand {
  animation: brandThemeGlint 5.5s ease-in-out infinite;
  filter: none;
}

body.theme-couple .brand {
  background: linear-gradient(
    105deg,
    #5c1828 0%,
    #d9486c 28%,
    #e8899e 42%,
    #c23a5a 58%,
    #3a0f1c 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.theme-couple .brand::before {
  content: none;
}

body.theme-friends .brand {
  background: linear-gradient(
    105deg,
    #5c4010 0%,
    #d4a017 28%,
    #e8c45a 42%,
    #c47f12 58%,
    #2a2208 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.theme-friends .brand::before {
  content: none;
}

body.theme-family .brand {
  background: linear-gradient(
    105deg,
    #152a44 0%,
    #2b6cb0 28%,
    #6b9fd4 42%,
    #2563eb 58%,
    #0b1a2e 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.theme-family .brand::before {
  content: none;
}

.relation-actions .btn.is-picked-relation {
  position: relative;
  overflow: visible;
}

.relation-actions .btn.is-picked-relation > span {
  position: relative;
  z-index: 2;
}

.btn-chosen {
  overflow: hidden;
}

.btn-chosen .chosen-label {
  position: relative;
  z-index: 2;
  display: inline-block;
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: chosenTextGlint 2.2s ease-in-out infinite;
}

body.theme-couple .btn-chosen {
  background: linear-gradient(145deg, #ff4d6d, #e0113a 55%, #9b1234);
  box-shadow:
    0 16px 40px rgba(224, 17, 58, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body.theme-couple .btn-chosen .chosen-label {
  background-image: linear-gradient(
    105deg,
    #fff 10%,
    #ffe0e8 35%,
    #fff 50%,
    #ffb3c6 70%,
    #fff 90%
  );
}

body.theme-couple .btn-chosen .btn-shine {
  background: linear-gradient(110deg, transparent 22%, rgba(255, 255, 255, 0.65), transparent 78%);
  animation-duration: 2.2s;
}

body.theme-friends .btn-chosen {
  background: linear-gradient(145deg, #ffb020, #f97316 55%, #c2410c);
  box-shadow:
    0 16px 40px rgba(249, 115, 22, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body.theme-friends .btn-chosen .chosen-label {
  background-image: linear-gradient(
    105deg,
    #fff 10%,
    #fff3c4 35%,
    #fff 50%,
    #ffe566 70%,
    #fff 90%
  );
}

body.theme-friends .btn-chosen .btn-shine {
  background: linear-gradient(110deg, transparent 22%, rgba(255, 255, 255, 0.7), transparent 78%);
  animation-duration: 2.2s;
}

body.theme-family .btn-chosen {
  background: linear-gradient(145deg, #60a5fa, #2563eb 55%, #1e3a8a);
  box-shadow:
    0 16px 40px rgba(37, 99, 235, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body.theme-family .btn-chosen .chosen-label {
  background-image: linear-gradient(
    105deg,
    #fff 10%,
    #dbeafe 35%,
    #fff 50%,
    #93c5fd 70%,
    #fff 90%
  );
}

body.theme-family .btn-chosen .btn-shine {
  background: linear-gradient(110deg, transparent 22%, rgba(255, 255, 255, 0.7), transparent 78%);
  animation-duration: 2.2s;
}

@media (prefers-reduced-motion: reduce) {
  .welcome-core,
  .aurora-blob,
  body.theme-couple .brand,
  body.theme-friends .brand,
  body.theme-family .brand,
  .btn-chosen .chosen-label,
  .relation-actions .btn.is-picked-relation::after {
    animation: none !important;
  }
}
