/* =====================================================================
   PROJECT LAB — страница-визитка (mobile-first)
   Шрифты PRIMESIGNALS: Unbounded (заголовки), Onest (текст, карточки, кнопки), JetBrains Mono (мелкие подписи)
   ===================================================================== */
:root {
  --bg: #080A09;
  --bg-2: #111512;
  --graphite: #191D1A;
  --text: #F4F5F2;
  --text-2: #C9CEC6;
  --muted: #929A91;
  --accent: #B6F34A;
  --accent-rgb: 182, 243, 74;
  --white-rgb: 255, 255, 255;          /* неоново-белый для световых эффектов */
  --hair: rgba(244, 245, 242, .07);
  --hair-2: rgba(244, 245, 242, .11);

  --f-display: "Unbounded", "Onest", system-ui, sans-serif;
  --f-sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --col: 440px;
  --r: 18px;
  --card-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 1px 2px rgba(0, 0, 0, .5), 0 14px 32px -20px rgba(0, 0, 0, .9);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); overflow-x: clip; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100svh; overflow-x: clip;
  background: var(--bg); color: var(--text);
  font: 400 15px/1.55 var(--f-sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid rgba(var(--accent-rgb), .8); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Фон ---------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(244,245,242,.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,245,242,.026) 1px, transparent 1px);
  background-size: 40px 40px; background-position: center top;
  -webkit-mask: radial-gradient(ellipse 60% 42% at 50% 12%, #000, transparent 80%);
          mask: radial-gradient(ellipse 60% 42% at 50% 12%, #000, transparent 80%);
}
.bg-glow {
  position: absolute; left: 50%; top: -70px; width: 520px; height: 420px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), .10), rgba(var(--accent-rgb), .025) 60%, transparent);
  animation: breathe 8s ease-in-out infinite alternate;
}
@keyframes breathe { from { opacity: .65; } to { opacity: 1; } }

/* ---------- Колонка ---------- */
.page {
  position: relative; z-index: 1;
  width: 100%; max-width: var(--col); margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}

/* ---------- Логотип ---------- */
.brand { display: flex; flex-direction: column; align-items: center; text-align: center; }
.avatar { width: 132px; aspect-ratio: 1 / 1; }
.avatar img {
  width: 100%; height: 100%;
  object-fit: contain;               /* оригинальный логотип целиком, без обрезки */
  filter: drop-shadow(0 10px 30px rgba(var(--accent-rgb), .16));
}

/* ---------- Заголовок ---------- */
.intro { text-align: center; margin: 10px 0 20px; }
.intro h2 {
  font: 600 18px/1.3 var(--f-display); letter-spacing: -.005em; color: var(--text);
  text-wrap: balance;
}
.intro h2 span { color: var(--accent); display: block; text-shadow: 0 0 24px rgba(var(--accent-rgb), .25); }

/* ---------- Карточки ---------- */
.links { display: flex; flex-direction: column; gap: 9px; }
.card {
  --mx: 50%; --my: 50%;
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 10px;
  width: 100%; padding: 12px 14px 10px;
  border-radius: var(--r);
  border: 1px solid var(--hair-2);
  background: linear-gradient(180deg, var(--graphite) 0%, var(--bg-2) 100%);
  box-shadow: var(--card-shadow);
  transition: transform .5s var(--ease), border-color .4s ease, box-shadow .5s var(--ease);
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
/* мягкий свет под пальцем/курсором */
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s ease;
  background: radial-gradient(220px circle at var(--mx) var(--my), rgba(var(--white-rgb), .05), transparent 70%);
}
.card:hover, .card:focus-visible {
  border-color: rgba(var(--white-rgb), .22);
  box-shadow: var(--card-shadow), 0 0 0 1px rgba(var(--white-rgb), .04), 0 0 30px -10px rgba(var(--white-rgb), .18);
  transform: translateY(-1px);
}
.card:hover::before, .card:focus-visible::before, .card.is-pressed::before { opacity: 1; }
.card:active, .card.is-pressed { transform: scale(.985); transition-duration: .15s; }

.card-main { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 14px; }
.card-icon {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--hair-2);
  background: rgba(8, 10, 9, .55);
  transition: border-color .35s ease;
}
.card-icon--line svg { width: 21px; height: 21px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.brand-icon { width: 24px; height: 24px; }
.brand-icon--yt { width: 26px; height: 19px; }
.brand-logo { width: 27px; height: auto; aspect-ratio: 3 / 2; object-fit: contain; } /* Pocket Option: исходные пропорции 180×120 */
.card:hover .card-icon, .card:focus-visible .card-icon { border-color: rgba(var(--white-rgb), .22); }

.card-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-title { font: 600 17px/1.25 var(--f-sans); letter-spacing: -.015em; color: var(--text); }
.card-text { font: 400 13px/1.38 var(--f-sans); color: var(--muted); }
.card:has(.tag) .card-title { padding-right: 88px; }

.tag {
  position: absolute; top: 12px; right: 12px;
  font: 500 10.5px/1 var(--f-mono); letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 7px; border-radius: 6px;
}
.tag--accent { color: var(--accent); border: 1px solid rgba(var(--accent-rgb), .3); background: rgba(var(--accent-rgb), .06); }

.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 22px; padding-top: 9px; border-top: 1px solid var(--hair);
}
.card-cta { font: 500 14px/1.2 var(--f-sans); color: var(--text-2); transition: color .3s ease; }
.card-arrow { width: 18px; height: 18px; color: var(--muted); transition: transform .45s var(--ease), color .3s ease; }
.card-arrow svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card:hover .card-cta, .card:focus-visible .card-cta { color: var(--accent); }
.card:hover .card-arrow, .card:focus-visible .card-arrow { color: var(--accent); transform: translateX(3px); }

/* статус «Скоро» для ещё не опубликованных ресурсов */
.soon {
  font: 500 10.5px/1 var(--f-mono); letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); padding: 5px 7px; border-radius: 6px; border: 1px solid var(--hair-2);
}
.card.is-soon .card-cta { color: var(--muted); }
.card.is-soon:hover .card-cta { color: var(--text-2); }

/* «В разработке»: приглушённая неактивная карточка, без зелёного акцента и перехода */
.card--dev {
  cursor: default; pointer-events: none;
  background: linear-gradient(180deg, #151816 0%, #101311 100%);
  border-color: rgba(244, 245, 242, .06); box-shadow: none;
}
.card--dev .card-main, .card--dev .card-foot { opacity: .55; filter: grayscale(1); }
.card--dev .card-icon { background: transparent; border-color: rgba(244, 245, 242, .07); }
.card--dev .card-icon--line svg { stroke: var(--muted); }
.card--dev .card-title { color: var(--muted); }
.card--dev .card-text, .card--dev .card-cta { color: rgba(146, 154, 145, .8); }
.card--dev .card-foot { border-top-color: rgba(244, 245, 242, .05); }
.soon--dev { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.soon--dev svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Неоново-белое свечение ---------- */
@property --ga { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.card-glow {
  position: absolute; inset: 0; z-index: 1; border-radius: inherit; pointer-events: none; opacity: 0;
}
/* свет, бегущий по тонкой границе */
.card-glow::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--ga),
    rgba(var(--white-rgb), 0) 0deg,
    rgba(var(--white-rgb), 0) 200deg,
    rgba(var(--white-rgb), .35) 270deg,
    rgba(var(--white-rgb), .95) 330deg,
    rgba(var(--white-rgb), 0) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  filter: drop-shadow(0 0 3px rgba(var(--white-rgb), .7));
}
/* лёгкое отражение света на фоне карточки */
.card-glow::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(var(--white-rgb), .055), transparent 60%),
    linear-gradient(180deg, rgba(var(--white-rgb), .02), transparent 40%);
}
.card.is-glow { animation: halo 2.6s ease-in-out both; }
.card.is-glow .card-glow { animation: glowFade 2.6s ease-in-out both; }
.card.is-glow .card-glow::before { animation: sweep 2.6s cubic-bezier(.45, .05, .35, 1) both; }
@keyframes glowFade { 0% { opacity: 0; } 22% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sweep { from { --ga: -40deg; } to { --ga: 320deg; } }
@keyframes halo {
  0%, 100% { box-shadow: var(--card-shadow); border-color: var(--hair-2); }
  45% { box-shadow: var(--card-shadow), 0 0 0 1px rgba(var(--white-rgb), .06), 0 0 22px -6px rgba(var(--white-rgb), .28), 0 0 56px -18px rgba(var(--white-rgb), .22); border-color: rgba(var(--white-rgb), .2); }
}
/* общий короткий импульс всех карточек */
.links.is-pulse .card:not(.card--dev) { animation: pulseHalo 1.4s ease-in-out both; }
.links.is-pulse .card-glow { animation: glowFade 1.4s ease-in-out both; }
.links.is-pulse .card-glow::before { background: rgba(var(--white-rgb), .55); }
@keyframes pulseHalo {
  0%, 100% { box-shadow: var(--card-shadow); border-color: var(--hair-2); }
  40% { box-shadow: var(--card-shadow), 0 0 18px -6px rgba(var(--white-rgb), .22), 0 0 44px -18px rgba(var(--white-rgb), .18); border-color: rgba(var(--white-rgb), .16); }
}

/* ---------- Низ ---------- */
.foot { text-align: center; margin-top: 18px; display: grid; gap: 6px; }
.foot-risk { color: var(--muted); opacity: .85; font-size: 11px; line-height: 1.5; max-width: 420px; margin: 0 auto; }
.foot-copy { font: 400 11px/1 var(--f-mono); color: rgba(146, 154, 145, .75); }

/* ---------- Уведомление ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 30;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 14px;
  background: rgba(25, 29, 26, .97); border: 1px solid rgba(var(--white-rgb), .14); color: var(--text);
  font-size: 13.5px; box-shadow: 0 12px 40px -12px rgba(0, 0, 0, .9);
  transition: opacity .3s, transform .4s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Появление ---------- */
.js .enter { opacity: 0; transform: translateY(10px); animation: enter .7s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 70ms + 60ms); }
@keyframes enter { to { opacity: 1; transform: none; } }
/* у карточек анимация появления и свечения не должны конфликтовать */
.js .card.enter.is-glow, .js .links.is-pulse .card.enter { opacity: 1; transform: none; }

/* ---------- Широкие экраны ---------- */
@media (min-width: 600px) {
  .page { padding-top: 18px; }
  .avatar { width: 148px; }
  .intro h2 { font-size: 21px; }
  .card { padding: 16px 18px 14px; }
  .tag { top: 16px; right: 18px; }
}
@media (max-width: 359px) {
  .card-main { grid-template-columns: 38px minmax(0, 1fr); gap: 12px; }
  .card-icon { width: 38px; height: 38px; }
  .card-title { font-size: 16px; }
  .intro h2 { font-size: 16.5px; }
}

/* ---------- Без анимаций по желанию пользователя ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .001ms !important; }
  .js .enter { opacity: 1; transform: none; }
  .card-glow { display: none; }
}

/* ---------- Служебные страницы ---------- */
.legal-page { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; padding: 24px 16px 64px; }
.legal-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 36px; }
.wordmark { font: 800 17px/1.1 var(--f-sans); letter-spacing: -.02em; }
.wordmark span { color: var(--accent); }
.legal-back { font: 500 13px/1 var(--f-sans); color: var(--muted); padding: 10px 0; }
.legal-back:hover { color: var(--accent); }
.legal-page h1 { font: 800 clamp(26px, 6vw, 36px)/1.15 var(--f-sans); letter-spacing: -.025em; margin-bottom: 20px; }
.legal-page h2 { font: 600 18px/1.3 var(--f-sans); letter-spacing: -.01em; margin: 32px 0 10px; }
.legal-page p, .legal-page li { color: var(--text-2); font-size: 15px; line-height: 1.65; }
.legal-page ul { list-style: disc; padding-left: 20px; margin: 0; }
.legal-page li + li { margin-top: 6px; }
.draft-note { border: 1px dashed rgba(var(--accent-rgb), .45); background: rgba(var(--accent-rgb), .04); border-radius: 14px; padding: 14px 16px; margin-bottom: 24px; }
.draft-note p { color: var(--text); }
.fill { background: rgba(var(--accent-rgb), .12); color: var(--accent); padding: 1px 6px; border-radius: 4px; font-family: var(--f-mono); font-size: .86em; }
.btn-home { display: inline-flex; align-items: center; min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid rgba(var(--accent-rgb), .45); color: var(--accent); font: 600 14px/1 var(--f-sans); margin-top: 24px; }
.btn-home:hover { background: var(--accent); color: var(--bg); }
