/* ============================================================
   tapix.club — кинематографичный lo-fi (аватар «Форма голоса»)
   палитра: тёплый янтарь окна + холодная бирюза вагона
   лёттербокс, плёночное зерно, мягкий золотой свет
   ============================================================ */

:root {
  --bg: #0c1d20;
  --bg-2: #102a2d;
  --teal: #1d4a4f;
  --teal-line: rgba(180, 220, 215, .12);
  --cream: #f1e6cf;
  --cream-dim: #b8b09c;
  --amber: #e0b066;
  --amber-bright: #f4ca80;
  --rose: #d98a6a;

  /* бренды */
  --c-tiktok: #25f4ee;
  --c-telegram: #2aabee;
  --c-discord: #8c93f2;
  --c-youtube: #ff6a6a;

  /* BUL$ Opti */
  --buls-bg: #020617;
  --buls-indigo: #6366f1;
  --buls-violet: #8b5cf6;
  --buls-blurple: #5865f2;

  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body: 'Onest', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --card-r: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px; line-height: 1.55; min-height: 100dvh; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
.mono { font-family: var(--font-mono); }
::selection { background: var(--amber); color: #2a1f10; }

/* ---------- фоновые слои ---------- */
#bg3d { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.atmo {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 78% 18%, rgba(224, 176, 102, .2), transparent 60%),
    radial-gradient(ellipse 90% 70% at 50% 115%, rgba(0, 0, 0, .55), transparent 55%),
    linear-gradient(180deg, rgba(8, 20, 22, .3), transparent 30%);
}
.grain {
  position: fixed; inset: -10%; z-index: 2; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 7s steps(8) infinite;
}
@keyframes grain-shift { 0%,100%{transform:translate(0,0)} 25%{transform:translate(-2%,2%)} 50%{transform:translate(2%,-2%)} 75%{transform:translate(-2%,-1%)} }

/* лёттербокс-полосы */
.bar { position: fixed; left: 0; right: 0; height: 22px; z-index: 6; pointer-events: none; background: #050d0e; }
.bar--top { top: 0; box-shadow: 0 1px 0 rgba(224,176,102,.12); }
.bar--bottom { bottom: 0; box-shadow: 0 -1px 0 rgba(224,176,102,.12); }

/* ---------- курсор ---------- */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; border-radius: 50%; opacity: 0; transform: translate(-50%,-50%); }
.cursor-dot { width: 6px; height: 6px; background: var(--amber-bright); }
.cursor-ring { width: 32px; height: 32px; border: 1px solid rgba(244, 202, 128, .5); transition: width .25s var(--ease-out), height .25s var(--ease-out), border-color .25s; }
body.cursor-on .cursor-dot, body.cursor-on .cursor-ring { opacity: 1; }
body.cursor-on, body.cursor-on a, body.cursor-on button { cursor: none; }
body.cursor-hover .cursor-ring { width: 50px; height: 50px; border-color: var(--amber); }

/* ---------- колонка ---------- */
.page {
  position: relative; z-index: 3; max-width: 540px; margin: 0 auto;
  padding: clamp(48px, 9vh, 92px) max(22px, env(safe-area-inset-right)) calc(54px + env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 20px;
}
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .95s var(--ease-out), transform .95s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- HERO ---------- */
.hero { text-align: center; }
.slate {
  display: inline-flex; align-items: center; gap: 8px; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cream-dim); border: 1px solid var(--teal-line); border-radius: 100px; padding: 6px 14px; margin-bottom: 24px;
}
.rec { width: 8px; height: 8px; border-radius: 50%; background: #ff5a4d; box-shadow: 0 0 10px rgba(255,90,77,.8); animation: rec-blink 1.6s steps(1) infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
.slate .tc { color: var(--amber); margin-left: 4px; }

.frame { position: relative; width: 136px; height: 136px; margin: 0 auto 22px; }
.avatar {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 10px;
  filter: saturate(1.05) contrast(1.04); box-shadow: 0 14px 40px -14px rgba(0,0,0,.8);
}
.frame-corner { position: absolute; width: 16px; height: 16px; border: 2px solid var(--amber); }
.frame-corner.tl { top: -7px; left: -7px; border-right: 0; border-bottom: 0; }
.frame-corner.tr { top: -7px; right: -7px; border-left: 0; border-bottom: 0; }
.frame-corner.bl { bottom: -7px; left: -7px; border-right: 0; border-top: 0; }
.frame-corner.br { bottom: -7px; right: -7px; border-left: 0; border-top: 0; }

.name {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(2.4rem, 11vw, 3.4rem);
  letter-spacing: .04em; line-height: 1; color: var(--cream); text-shadow: 0 0 30px rgba(224,176,102,.25);
}
.subtitle {
  margin: 16px auto 0; max-width: 30ch; font-size: 1rem; font-style: italic; color: var(--cream);
  background: rgba(5, 13, 14, .5); padding: 6px 14px; border-radius: 6px; display: inline-block;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.handle { margin-top: 12px; }
.handle .mono { color: var(--amber); font-size: .86rem; letter-spacing: .04em; }

/* ---------- STATS ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--teal-line); border-radius: var(--card-r); background: rgba(16, 42, 45, .5);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); overflow: hidden;
}
.stat { padding: 16px 6px; text-align: center; position: relative; }
.stat + .stat::before { content: ''; position: absolute; left: 0; top: 22%; height: 56%; width: 1px; background: var(--teal-line); }
.stat-num { display: block; font-size: clamp(1.05rem, 4.6vw, 1.35rem); font-weight: 700; color: var(--amber-bright); }
.stat-label { display: block; margin-top: 3px; font-size: .66rem; letter-spacing: .03em; color: var(--cream-dim); }

/* ---------- SCENES ---------- */
.scenes { display: flex; flex-direction: column; gap: 11px; }
.scene {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-radius: var(--card-r); text-decoration: none; color: var(--cream);
  border: 1px solid var(--teal-line); background: rgba(16, 42, 45, .45);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: transform .35s var(--ease-out), border-color .3s, box-shadow .3s, background .3s;
}
.scene:hover { transform: translateX(4px); border-color: rgba(224, 176, 102, .4); box-shadow: 0 12px 34px -16px rgba(224,176,102,.4); background: rgba(20, 50, 53, .6); }
.scene-no { flex: 0 0 auto; font-size: .62rem; letter-spacing: .1em; color: var(--cream-dim); writing-mode: vertical-rl; transform: rotate(180deg); opacity: .7; }
.scene-icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: rgba(241, 230, 207, .06); border: 1px solid var(--teal-line); color: var(--cream); transition: transform .35s var(--ease-out), color .3s; }
.scene-icon svg { width: 21px; height: 21px; }
.scene:hover .scene-icon { transform: scale(1.06); }
.scene-body { flex: 1 1 auto; min-width: 0; }
.scene-title { display: block; font-family: var(--font-display); font-weight: 700; font-size: .94rem; }
.scene-sub { display: block; margin-top: 2px; font-size: .77rem; color: var(--cream-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-meta { flex: 0 0 auto; font-size: .78rem; color: var(--cream-dim); transition: color .3s; }
.scene[data-brand="tiktok"]:hover .scene-icon { color: var(--c-tiktok); }
.scene[data-brand="telegram"]:hover .scene-icon { color: var(--c-telegram); }
.scene[data-brand="discord"]:hover .scene-icon { color: var(--c-discord); }
.scene[data-brand="youtube"]:hover .scene-icon { color: var(--c-youtube); }
.scene:hover .scene-meta { color: var(--amber-bright); }

/* ---------- общие карточки ---------- */
.card { position: relative; border: 1px solid var(--teal-line); border-radius: var(--card-r); background: rgba(16, 42, 45, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* ---------- NOTES ---------- */
.notes { overflow: hidden; }
.notes-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--teal-line); background: rgba(5, 13, 14, .4); }
.sec-title { font-family: var(--font-display); font-weight: 700; font-size: .9rem; color: var(--amber-bright); }
.notes-tag { margin-left: auto; font-size: .66rem; color: var(--cream-dim); letter-spacing: .08em; }
.notes-body { padding: 16px 20px 18px; }
.nline { display: flex; align-items: baseline; gap: 8px; font-size: .9rem; line-height: 2; }
.nkey { color: var(--cream-dim); font-family: var(--font-mono); font-size: .82rem; flex: 1 1 auto; }
.nval { color: var(--cream); font-weight: 500; white-space: nowrap; }
.nhint { margin-top: 10px; font-size: .8rem; color: var(--amber); font-style: italic; }

/* ---------- BUL$ ---------- */
.buls { background: radial-gradient(120% 140% at 85% -20%, rgba(99,102,241,.24), transparent 55%), var(--buls-bg); border-color: rgba(99,102,241,.3); color: #e2e8f0; padding: 26px 24px 24px; overflow: hidden; }
.buls::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background-image: linear-gradient(rgba(99,102,241,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(99,102,241,.06) 1px, transparent 1px); background-size: 28px 28px; mask-image: radial-gradient(120% 100% at 50% 0%, black 30%, transparent 80%); -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, black 30%, transparent 80%); }
.buls > * { position: relative; }
.buls-tag { display: inline-block; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: #a5b4fc; border: 1px solid rgba(99,102,241,.35); background: rgba(99,102,241,.1); padding: 5px 12px; border-radius: 100px; margin-bottom: 16px; }
.buls-brand { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.5rem,6.4vw,1.9rem); line-height: 1.1; color: #fff; }
.buls-s { color: var(--buls-indigo); }
.buls-opti { background: linear-gradient(100deg, var(--buls-indigo), var(--buls-violet)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.buls-slogan { margin-top: 10px; font-family: var(--font-display); font-weight: 700; font-size: .9rem; letter-spacing: .03em; text-transform: uppercase; color: #c7d2fe; }
.buls-text { margin-top: 10px; font-size: .88rem; color: #94a3b8; line-height: 1.6; }
.buls-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.bstat { text-align: center; padding: 12px 6px; border-radius: 14px; background: rgba(11,17,33,.85); border: 1px solid rgba(99,102,241,.2); }
.bstat-num { display: block; font-weight: 700; font-size: 1.02rem; color: #fff; }
.bstat:first-child .bstat-num { color: #34d399; }
.bstat:last-child .bstat-num { color: #fcd34d; }
.bstat-label { display: block; margin-top: 2px; font-size: .64rem; letter-spacing: .04em; color: #94a3b8; }
.buls-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 18px; border-radius: 13px; font-family: var(--font-display); font-weight: 700; font-size: .78rem; letter-spacing: .04em; text-decoration: none; transition: transform .2s var(--ease-out), box-shadow .3s, background .3s, border-color .3s; }
.btn--buls { color: #fff; background: linear-gradient(120deg, var(--buls-indigo), var(--buls-violet)); box-shadow: 0 8px 28px -8px rgba(99,102,241,.55); }
.btn--buls:hover { transform: translateY(-2px); box-shadow: 0 14px 36px -8px rgba(99,102,241,.7); }
.btn--ghost { flex: 0 1 auto; color: #c7d2fe; border: 1px solid rgba(88,101,242,.45); background: rgba(88,101,242,.1); }
.btn--ghost:hover { background: rgba(88,101,242,.22); border-color: var(--buls-blurple); transform: translateY(-2px); }

/* ---------- FOOTER ---------- */
.footer { text-align: center; padding: 18px 0 8px; font-size: .8rem; color: var(--cream-dim); }
.footer-domain { font-size: .82rem; letter-spacing: .14em; color: var(--amber); margin-bottom: 8px; }
.footer-line a { color: var(--cream); text-decoration: none; border-bottom: 1px solid rgba(224,176,102,.4); display: inline-block; padding: 4px 2px; }
.footer-line a:hover { color: var(--amber-bright); }
.footer-credit { margin-top: 6px; font-size: .72rem; color: #8a8270; }
.footer-credit a { color: #a5b4fc; text-decoration: none; }

/* ---------- адаптив ---------- */
@media (max-width: 420px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3)::before { display: none; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--teal-line); }
  .scene-meta { display: none; }
  .scene-no { writing-mode: horizontal-tb; transform: none; }
  .buls-actions { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; } .reveal { opacity: 1; transform: none; }
}
