/* ============ Общая основа: токены, текстуры, физика движения ============ */
:root {
  --bg: #060608;
  --ink: #f5f3f7;
  --ink-2: rgba(245, 243, 247, 0.62);
  --ink-3: rgba(245, 243, 247, 0.38);
  --line: rgba(255, 255, 255, 0.08);
  --accent: #ff2d8a;
  --accent-2: #c6ff3d;
  --sky: #6ec8ff;
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
}

html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Onest', system-ui, sans-serif;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: #fff; }

.font-display { font-family: 'Unbounded', 'Onest', sans-serif; letter-spacing: -0.04em; }
.font-script { font-family: 'Cormorant', serif; font-style: italic; font-weight: 500; letter-spacing: -0.01em; }

/* зерно плёнки — фиксированный слой, не скроллится */
.grain::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.045;
  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='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* сетчатые свечения на фоне — фиксированные */
.mesh { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.mesh i {
  position: absolute; border-radius: 9999px; filter: blur(120px); opacity: 0.28;
  animation: drift 26s var(--spring) infinite alternate;
}
.mesh i:nth-child(1) { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: var(--accent); }
.mesh i:nth-child(2) { width: 34vw; height: 34vw; right: -10vw; top: 30vh; background: var(--accent-2); opacity: 0.12; animation-duration: 32s; }
.mesh i:nth-child(3) { width: 30vw; height: 30vw; left: 30vw; bottom: -18vw; background: #7a3cff; opacity: 0.16; animation-duration: 38s; }
@keyframes drift { to { transform: translate3d(6vw, 4vh, 0) scale(1.12); } }

/* ===== Double-Bezel: внешний лоток + внутреннее ядро ===== */
.shell {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 6px;
  border-radius: 2rem;
}
.core {
  background: linear-gradient(180deg, #121216 0%, #0c0c0f 100%);
  border-radius: calc(2rem - 6px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.09), 0 30px 80px -40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  position: relative;
}
.shell-sm { border-radius: 1.4rem; padding: 4px; }
.shell-sm > .core { border-radius: calc(1.4rem - 4px); }

/* ===== Кнопки-острова ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.75rem;
  border-radius: 9999px; padding: 0.55rem 0.55rem 0.55rem 1.4rem;
  font-weight: 500; font-size: 0.92rem;
  transition: transform 0.5s var(--spring), background-color 0.5s var(--spring), color 0.5s var(--spring), box-shadow 0.5s var(--spring);
  will-change: transform;
}
.btn:active { transform: scale(0.97); }
.btn .knob {
  width: 2.2rem; height: 2.2rem; border-radius: 9999px;
  display: grid; place-items: center;
  transition: transform 0.6s var(--spring);
}
.btn:hover .knob { transform: translate(3px, -1px) scale(1.06); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 12px 40px -12px var(--accent); }
.btn-accent .knob { background: rgba(255, 255, 255, 0.18); }
.btn-lime { background: var(--accent-2); color: #0a0a0a; }
.btn-lime .knob { background: rgba(0, 0, 0, 0.1); }
.btn-ghost { background: rgba(255, 255, 255, 0.06); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost .knob { background: rgba(255, 255, 255, 0.08); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn-plain { padding: 0.75rem 1.4rem; }

.icon-btn {
  width: 2.75rem; height: 2.75rem; border-radius: 9999px;
  display: grid; place-items: center; position: relative;
  color: var(--ink);
  transition: background-color 0.5s var(--spring), transform 0.5s var(--spring);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); }
.icon-btn:active { transform: scale(0.94); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border-radius: 9999px; padding: 0.35rem 0.85rem;
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 500;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--ink-2);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 9999px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }

/* ===== Появление при скролле ===== */
.reveal {
  opacity: 0; transform: translate3d(0, 56px, 0); filter: blur(10px);
  transition: opacity 1s var(--out), transform 1.1s var(--out), filter 1s var(--out);
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; filter: blur(0); }

/* поля ввода */
.field {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.8rem 1rem;
  color: var(--ink);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.4s var(--spring), background-color 0.4s var(--spring), box-shadow 0.4s var(--spring);
}
.field::placeholder { color: var(--ink-3); }
.field:focus { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: rgba(255, 255, 255, 0.06); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
select.field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
select.field option { background: #111; }
.label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.5rem; display: block; }

/* тосты */
.toast-wrap { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 1.1rem 0.5rem 0.5rem; border-radius: 9999px;
  background: rgba(20, 20, 24, 0.82); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1); font-size: 0.88rem;
  animation: toastIn 0.7s var(--spring) both;
}
.toast .ti { width: 2rem; height: 2rem; border-radius: 9999px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.toast.out { animation: toastOut 0.5s var(--spring) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(24px) scale(0.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px) scale(0.96); } }

/* скроллбар */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 9999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
}
