/* ===== Tokens ===== */
:root {
  --bg: #17171b;
  --bg-grad-a: #23232b;
  --bg-grad-b: #111114;
  --text: #f5f5f7;
  --muted: #86868b;
  --line: rgba(255, 255, 255, 0.10);
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --accent: #ff6a00;
  --accent-soft: rgba(255, 106, 0, 0.16);
  --maxw: 680px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: "Inter", -apple-system, "SF Pro Display", BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  background-image: radial-gradient(140% 90% at 50% -10%, var(--bg-grad-a) 0%, var(--bg) 52%, var(--bg-grad-b) 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

/* ===== Animated background: графит + перелив + звёздная пыль ===== */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

/* перелив — медленно дрейфующие цветные пятна, цвет дышит на hue-rotate */
.bg-aurora {
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(38% 34% at 24% 20%, rgba(255, 106, 0, 0.24), transparent 60%),
    radial-gradient(42% 38% at 80% 14%, rgba(99, 102, 241, 0.20), transparent 62%),
    radial-gradient(48% 44% at 62% 82%, rgba(20, 160, 168, 0.17), transparent 62%),
    radial-gradient(40% 40% at 14% 78%, rgba(168, 85, 247, 0.16), transparent 62%);
  filter: blur(70px) saturate(1.15) hue-rotate(var(--hue, 0deg));
  animation: drift 36s ease-in-out infinite alternate;
  will-change: transform, filter;
}

/* звёздная пыль — потолок Rolls-Royce */
.bg-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1px 1px at 32% 62%, rgba(255,255,255,0.40), transparent),
    radial-gradient(1px 1px at 58% 28%, rgba(255,255,255,0.50), transparent),
    radial-gradient(1px 1px at 76% 72%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 88% 40%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1px 1px at 46% 88%, rgba(255,255,255,0.30), transparent),
    radial-gradient(1.5px 1.5px at 20% 80%, rgba(255,255,255,0.30), transparent),
    radial-gradient(1.5px 1.5px at 68% 12%, rgba(255,255,255,0.28), transparent);
  background-size: 320px 320px;
  background-repeat: repeat;
  opacity: 0.6;
  animation: twinkle 7s ease-in-out infinite alternate;
}

/* свечение, идущее за курсором */
.bg-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 620px;
  height: 620px;
  margin: -310px 0 0 -310px;
  background: radial-gradient(closest-side, rgba(255, 106, 0, 0.16), transparent 70%);
  transform: translate3d(var(--mx, 50vw), var(--my, 28vh), 0);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* фонарик в темноте: гасим страницу, под курсором/пальцем расступается яркий круг света */
.flashlight {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background:
    radial-gradient(circle 280px at var(--mx, 50vw) var(--my, 38vh),
      rgba(255, 244, 228, 0.12) 0%,
      rgba(255, 244, 228, 0) 14%,
      rgba(6, 6, 8, 0) 26%,
      rgba(6, 6, 8, 0.82) 80%,
      rgba(4, 4, 6, 0.90) 100%);
}

@keyframes drift {
  0%   { transform: translate3d(-3%, -2%, 0) scale(1.05); }
  50%  { transform: translate3d(3%, 2%, 0) scale(1.16); }
  100% { transform: translate3d(-2%, 3%, 0) scale(1.08); }
}
@keyframes twinkle {
  0%   { opacity: 0.35; }
  100% { opacity: 0.70; }
}

/* ===== Layout ===== */
.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(72px, 16vh, 160px) 24px 64px;
  padding-bottom: max(64px, env(safe-area-inset-bottom));
}

section { margin-top: clamp(64px, 12vh, 120px); }

.section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}

/* ===== Hero ===== */
.pill {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--surface);
  backdrop-filter: blur(8px);
}

.name {
  margin-top: 28px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

.tagline {
  margin-top: 14px;
  font-size: clamp(40px, 11vw, 68px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.accent {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

.lede {
  margin-top: 24px;
  font-size: clamp(17px, 4.6vw, 20px);
  color: var(--muted);
  max-width: 30ch;
}

/* ===== About ===== */
.about p { font-size: clamp(18px, 5vw, 22px); letter-spacing: -0.01em; }
.about p + p { margin-top: 16px; }
.about .muted { color: var(--muted); font-size: clamp(16px, 4.4vw, 19px); }

/* ===== Cases ===== */
.case-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.case {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 20px 22px;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
}
.case:hover { background: var(--surface-hover); border-color: rgba(255,255,255,0.18); }
.case-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.case p { color: var(--text); font-size: 16px; }

/* ===== Socials ===== */
.social-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.social {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 16px 18px;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.35s var(--ease);
}
.social svg { width: 22px; height: 22px; fill: currentColor; flex-shrink: 0; }
.social:hover {
  background: var(--surface-hover);
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-2px);
}
.social:active { transform: translateY(0); }

/* ===== CTA ===== */
.cta { text-align: center; }
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  font-size: 17px;
  padding: 16px 28px;
  border-radius: 100px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), filter 0.3s var(--ease);
  box-shadow: 0 8px 40px -8px var(--accent-soft);
}
.cta-btn svg { width: 20px; height: 20px; }
.cta-btn:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 14px 50px -6px rgba(255,106,0,0.35); }
.cta-btn:active { transform: translateY(0); }
.cta-note { margin-top: 16px; color: var(--muted); font-size: 15px; }

/* ===== Footer ===== */
.footer {
  margin-top: clamp(80px, 14vh, 140px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

/* ===== Reveal animation (progressive enhancement: прячем только при .js) ===== */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .social:hover, .cta-btn:hover { transform: none; }
  .bg-aurora, .bg-stars { animation: none; }
  .bg-glow { transition: none; }
}

/* ===== Larger screens ===== */
@media (min-width: 560px) {
  .social-grid { grid-template-columns: repeat(3, 1fr); }
}
