/* === MASTERSKAYA SMALTA — DEMO === */
/* design-system v1.2 — rollback to native tailwind (D-013, 2026-06-13) */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f7fb;
  --bg-elev: #ffffff;
  --fg: #0f172a;
  --fg-muted: #475569;
  --fg-soft: #94a3b8;
  --border: #e2e8f0;
  --accent: #4f46e5;     /* indigo-600 */
  --accent-2: #7c3aed;   /* violet-600 */
  --accent-3: #ec4899;   /* pink-500 */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 30px 60px -20px rgba(79, 70, 229, .25);
}

html.dark {
  --bg: #0a0a14;
  --bg-soft: #0f0f1c;
  --bg-elev: #14142a;
  --fg: #f1f5f9;
  --fg-muted: #94a3b8;
  --fg-soft: #64748b;
  --border: rgba(255, 255, 255, .08);
  --accent: #818cf8;
  --accent-2: #a78bfa;
  --accent-3: #f472b6;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 30px 60px -20px rgba(167, 139, 250, .35);
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html, body { background: var(--bg); color: var(--fg); overflow-x: hidden; }
.prose, p, h1, h2, h3, .h1, .h2, .h3 { word-wrap: break-word; overflow-wrap: anywhere; }
body { font-family: 'PT Sans', system-ui, -apple-system, sans-serif; font-size: 17px; line-height: 1.55; }

h1, h2, h3, h4 { font-family: 'PT Sans', system-ui, sans-serif; font-weight: 700; letter-spacing: -0.02em; }

a { color: inherit; }

::selection { background: var(--accent); color: white; }

/* Subtle blob — больше не закрывает текст */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .25;
  pointer-events: none;
  z-index: 0;
}

html.dark .blob { opacity: .35; }

.grid-bg {
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: .5;
}
html.dark .grid-bg { opacity: 1; }

.gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  padding-bottom: 0.05em;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-lg); }

.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 32px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white; font-weight: 700; font-size: 17px;
  box-shadow: 0 10px 30px -10px rgba(79, 70, 229, .5);
  transition: transform .2s, box-shadow .2s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(79, 70, 229, .6); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 32px; border-radius: 999px;
  background: transparent; color: var(--fg);
  border: 1.5px solid var(--border); font-weight: 600; font-size: 17px;
  transition: all .2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.input {
  width: 100%; padding: 16px 20px;
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  color: var(--fg); font-size: 16px; font-family: inherit;
  transition: border-color .2s, background .2s;
}
.input:focus { outline: none; border-color: var(--accent); background: var(--bg-elev); }
.input::placeholder { color: var(--fg-soft); }

.label {
  display: block; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--fg-muted); margin-bottom: 8px;
}

/* Hero scale */
.h1 { font-size: clamp(48px, 7vw, 112px); line-height: 1.05; font-weight: 700; letter-spacing: -0.03em; padding-top: 0.05em; }
.h2 { font-size: clamp(36px, 5vw, 72px); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; padding-top: 0.05em; }
.h3 { font-size: clamp(24px, 3vw, 36px); line-height: 1.2; font-weight: 700; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--fg-muted);
  letter-spacing: .04em;
}

.container { max-width: 1400px; margin: 0 auto; position: relative; z-index: 1; }
.container-wide { max-width: 1800px; margin: 0 auto; position: relative; z-index: 1; }

/* Header */
.topbar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--fg-muted);
}
.topbar a:hover { color: var(--accent); }

.header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
}
html.dark .header { background: rgba(10, 10, 20, .85); }

.nav-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px;
  color: var(--fg-muted); font-weight: 600; font-size: 16px;
  transition: all .2s;
}
.nav-link:hover { color: var(--fg); background: var(--bg-soft); }
.nav-link.active { color: var(--accent); background: var(--bg-soft); }

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--bg-soft); border: 1px solid var(--border);
  color: var(--fg-muted); cursor: pointer; transition: all .2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .icon-light { display: inline; }
.theme-toggle .icon-dark { display: none; }
html.dark .theme-toggle .icon-light { display: none; }
html.dark .theme-toggle .icon-dark { display: inline; }

/* Footer */
.footer {
  background: var(--bg);
  padding: 0 24px 32px;
  margin-top: 80px;
}
@media (min-width: 1024px) { .footer { padding: 80px 48px 32px; } }

.footer a:hover { color: var(--accent); }

/* Logo — пазл-маска поверх градиента (как gradient-text) */
.logo {
  display: inline-block;
  width: 48px; height: 48px;
  /* фон под маской — градиент акцента темы */
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
  /* SVG используется как маска формы */
  -webkit-mask: url('logo-light.svg') center / contain no-repeat;
          mask: url('logo-light.svg') center / contain no-repeat;
  transition: transform .25s ease, background .25s ease;
}
.logo:hover { transform: translateY(-1px) scale(1.04); }

/* В тёмной теме — фирменный бордово-красный градиент */
html.dark .logo {
  background: linear-gradient(135deg, #991B1B 0%, #B91C1C 40%, #DC2626 70%, #F87171 100%);
}

/* В тёмной теме заголовки тоже становятся красными — синхронно с логотипом */
html.dark .gradient-text {
  background: linear-gradient(90deg, #DA3E4D 0%, #FF2DA3 25%, #DC2626 60%, #F87171 80%, #FB923C 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

/* Принудительный одноцветный серый (если где-то нужен) */
.logo-gray {
  background: var(--fg-soft) !important;
}


/* Misc */
.divider { height: 1px; background: var(--border); }


/* Scroll to top button */
.scroll-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 10px 30px -10px rgba(79, 70, 229, .5);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px) scale(.9);
  pointer-events: none;
  transition: opacity .25s, transform .25s, box-shadow .25s;
  z-index: 60;
  border: none;
}
.scroll-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.scroll-top:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 16px 40px -10px rgba(79, 70, 229, .6);
}
html.dark .scroll-top {
  background: linear-gradient(135deg, #B91C1C, #DC2626, #F87171);
  box-shadow: 0 10px 30px -10px rgba(220, 38, 38, .5);
}
html.dark .scroll-top:hover {
  box-shadow: 0 16px 40px -10px rgba(220, 38, 38, .6);
}
