/* ============================================================================
   Buh AI · marketing site styles
   Builds on assets/buhai-tokens.css
   ============================================================================ */

@import url("../assets/buhai-tokens.css");

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

/* ===== Layout ===== */
.container {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0 var(--layout-pad-desktop);
}
@media (max-width: 767px) {
  .container { padding: 0 var(--layout-pad-mobile); }
}

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; }

/* ===== Marketing type overrides (bigger than app defaults) ===== */
.m-h1     { font-size: clamp(34px, 5vw, 52px); line-height: 1.05; letter-spacing: -1.5px; font-weight: 700; color: var(--text); margin: 0; }
.m-h2     { font-size: clamp(26px, 3.6vw, 36px); line-height: 1.12; letter-spacing: -1px; font-weight: 700; color: var(--text); margin: 0; }
.m-h2-sm  { font-size: clamp(22px, 2.8vw, 28px); line-height: 1.18; letter-spacing: -0.8px; font-weight: 700; color: var(--text); margin: 0; }
.m-h3     { font-size: 20px; line-height: 1.25; letter-spacing: -0.4px; font-weight: 700; color: var(--text); margin: 0; }
.m-sub    { font-size: 17px; line-height: 1.55; color: var(--text-muted); font-weight: 400; margin: 0; }
.m-sub-sm { font-size: 15px; line-height: 1.55; color: var(--text-muted); font-weight: 400; margin: 0; }
.m-eyebrow{ display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--purple-900); background: var(--purple-light); padding: 6px 10px; border-radius: 999px; }
.m-eyebrow-dark { background: rgba(167,139,250,.18); color: #c4b5fd; }
.m-gradient {
  background: linear-gradient(90deg, #6d28d9 0%, #22d3ee 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 28px;
  border-radius: 12px;
  font-size: 16px; font-weight: 700; letter-spacing: -0.1px;
  border: 1.5px solid transparent;
  transition: transform var(--t-fast) var(--ease-default),
              opacity var(--t-fast) var(--ease-default),
              box-shadow var(--t-fast) var(--ease-default),
              background var(--t-fast) var(--ease-default),
              color var(--t-fast) var(--ease-default);
  white-space: nowrap;
}
.btn-primary {
  background: var(--purple-700); color: var(--white);
  box-shadow: 0 6px 20px rgba(109,40,217,.28);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(109,40,217,.42); opacity: .98; }
.btn-primary:active { transform: translateY(0) scale(.98); opacity: .9; }

.btn-ghost {
  background: transparent; color: var(--purple-700); border-color: var(--purple-700);
}
.btn-ghost:hover { background: var(--purple-light); transform: translateY(-2px); }

.btn-ghost-white {
  background: transparent; color: var(--white); border-color: rgba(255,255,255,.45);
}
.btn-ghost-white:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.8); transform: translateY(-2px); }

.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; border-radius: 10px; }
.btn-header { height: 36px; padding: 0 18px; font-size: 13px; font-weight: 600; border-radius: 8px; box-shadow: none; transition: opacity 150ms ease, transform 150ms ease, box-shadow 200ms ease; }
.btn-header:hover { opacity: .85; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(109,40,217,.40); }

.btn-pulse { animation: cta-pulse 2.6s ease-in-out infinite; }
@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(109,40,217,.28); }
  50%      { box-shadow: 0 8px 26px rgba(109,40,217,.50); }
}

/* ===== HEADER ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: 64px;
  background: #101028;
  transition: background 200ms ease, backdrop-filter 200ms ease, box-shadow 300ms ease;
  animation: headerDown 400ms var(--ease-default) 100ms both;
}
.site-header.is-scrolled {
  background: rgba(16,16,40,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 8px 28px rgba(0,0,0,.32);
}
@keyframes headerDown {
  from { transform: translateY(-64px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.header-inner {
  height: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.header-inner > .nav { justify-self: center; }
.header-inner > .header-cta-desktop,
.header-inner > .mobile-cta-mini,
.header-inner > .hamburger { justify-self: end; }

.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand-mark { width: 34px; height: 34px; display: block; border-radius: 9px; object-fit: cover; }
.brand-text { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; line-height: 1; }
.brand-text .ai { color: #b8b0f5; }

.nav { display: flex; align-items: center; gap: 32px; }
.nav-link {
  position: relative;
  display: inline-flex; align-items: center;
  height: 64px;
  color: rgba(255,255,255,.65);
  font-size: 14px; font-weight: 500;
  transition: color 150ms ease;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 14px;
  height: 2px; background: #6d28d9;
  transform: scaleX(0); transform-origin: center;
  transition: transform 220ms var(--ease-default);
}
.nav-link:hover { color: #fff; }
.nav-link:hover::after { transform: scaleX(.6); }
.nav-link.is-active { color: #fff; }
.nav-link.is-active::after { transform: scaleX(1); }

.hamburger {
  display: none;
  width: 40px; height: 40px;
  background: transparent; border: 0; padding: 0;
  color: #fff;
}
.hamburger svg { width: 24px; height: 24px; }

.mobile-cta-mini { display: none; }

@media (max-width: 900px) {
  .header-inner { grid-template-columns: auto 1fr auto; }
  .nav { display: none; }
  .hamburger { display: inline-flex; align-items: center; justify-content: center; order: 3; }
  .header-cta-desktop { display: none; }
  .mobile-cta-mini { display: inline-flex; justify-self: end; }
  .header-inner > .mobile-cta-mini { margin-right: 4px; }
}
@media (max-width: 767px) {
  .site-header { height: 56px; }
  .nav-link { height: 56px; }
  .header-inner { padding: 0 16px; }
}

/* Mobile drawer */
.mobile-drawer {
  visibility: hidden;
  position: fixed; left: 0; right: 0; top: 64px;
  background: #101028;
  padding: 16px 16px 32px;
  transform: translateY(-110%);
  transition: transform 300ms cubic-bezier(.4, 0, .2, 1);
  z-index: 99;
  border-bottom: 1px solid #2a2a5a;
}
@media (max-width: 767px) { .mobile-drawer { top: 56px; } }
.mobile-drawer.is-open { transform: translateY(0); visibility: visible; }

.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 98;
  opacity: 0; pointer-events: none;
  transition: opacity 300ms cubic-bezier(.4, 0, .2, 1);
}
.drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

.mobile-drawer-list { display: flex; flex-direction: column; gap: 2px; margin: 0 0 20px; padding: 0; list-style: none; }
.mobile-drawer-list a {
  display: block; padding: 16px;
  color: rgba(255,255,255,.85); font-size: 16px; font-weight: 600;
  border-radius: 10px;
  transition: background 150ms ease, color 150ms ease;
}
.mobile-drawer-list a:hover { color: #fff; background: rgba(255,255,255,.04); }
.mobile-drawer-list a.is-active { color: #fff; background: rgba(109,40,217,.18); }
.mobile-drawer .btn { width: 100%; height: 48px; font-size: 15px; }
.mobile-drawer-contacts { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.06); color: rgba(255,255,255,.5); font-size: 13px; line-height: 1.8; }
.mobile-drawer-contacts a { color: rgba(255,255,255,.8); display: block; }
.mobile-drawer-contacts a:hover { color: #fff; }

/* ===== Reveal on scroll ===== */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 500ms var(--ease-default), transform 500ms var(--ease-default); }
.reveal.is-in { opacity: 1; transform: translateY(0); }
.reveal[data-delay="100"] { transition-delay: 100ms; }
.reveal[data-delay="200"] { transition-delay: 200ms; }
.reveal[data-delay="300"] { transition-delay: 300ms; }
.reveal[data-delay="400"] { transition-delay: 400ms; }
.reveal[data-delay="500"] { transition-delay: 500ms; }

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

/* ===== Sections ===== */
section { position: relative; }

.section-pad   { padding: 96px 0; }
.section-pad-sm{ padding: 64px 0; }
@media (max-width: 767px) {
  .section-pad   { padding: 64px 0; }
  .section-pad-sm{ padding: 48px 0; }
}

/* Чередование фонов: обычные секции — белые, «альтернативные» (inline --page-bg) —
   мягкий вертикальный градиент (белый по краям → лёгкая лаванда в центре),
   чтобы переходы между блоками были плавными, без резких границ */
.section-pad:not(.section-dark) { background: #ffffff; }
.section-pad[style*="--page-bg"]:not(.section-dark) {
  background: linear-gradient(180deg, #ffffff 0%, #ece3fb 45%, #ece3fb 78%, #ffffff 100%) !important;
}

.section-dark { background: var(--bg-dark); color: #fff; }
.section-dark .m-h1, .section-dark .m-h2, .section-dark .m-h2-sm, .section-dark .m-h3 { color: #fff; }
.section-dark .m-sub { color: rgba(255,255,255,.7); }

.section-head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.section-head .m-h2 { margin-bottom: 16px; }
@media (max-width: 767px) { .section-head { margin-bottom: 40px; } }

/* ===== Card ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: transform 200ms var(--ease-default), border-color 200ms var(--ease-default), box-shadow 200ms var(--ease-default);
}
.card-hover:hover {
  transform: translateY(-4px);
  border-color: var(--purple-700);
  box-shadow: var(--shadow-lg);
}
.card-dark {
  background: var(--bg-dark); color: #fff; border-color: rgba(255,255,255,.08);
}

/* ===== Inputs ===== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.2px; }
.field input, .field select, .field textarea {
  height: 48px; padding: 0 14px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit; font-size: 15px; color: var(--text);
  transition: border-color 150ms var(--ease-default), box-shadow 150ms var(--ease-default);
}
.field textarea { height: 110px; padding: 12px 14px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--purple-700);
  box-shadow: 0 0 0 3px rgba(109,40,217,.12);
}
.field-error { color: var(--danger-fg); font-size: 12px; margin-top: 2px; min-height: 14px; }

/* ===== Badges / pills ===== */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 14px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.pill-dark {
  background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: rgba(255,255,255,.85);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple-700); }

/* ===== Utilities ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; gap: 48px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .grid-6 { grid-template-columns: 1fr; }
}

.flex-row { display: flex; gap: 16px; flex-wrap: wrap; }
.muted { color: var(--text-muted); }
.center { text-align: center; }

/* ===== Footer — tech grid ===== */
.site-footer {
  position: relative;
  background: var(--bg-dark);
  color: rgba(255,255,255,.5);
  border-top: none;
  box-shadow: none;
  overflow: hidden;
  isolation: isolate;
  padding: 0;
}
.site-footer::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 700px 350px at 0% 55%, rgba(109,40,217,.10), transparent 60%);
  pointer-events: none;
  z-index: 1;
}
.footer-grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(109,40,217,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109,40,217,.16) 1px, transparent 1px);
  background-size: 38px 38px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 110% 95% at 50% 45%, #000 62%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 110% 95% at 50% 45%, #000 62%, transparent 100%);
}
@keyframes footerGridDrift {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 40px 40px, 40px 40px; }
}
.footer-inner { position: relative; z-index: 2; padding: 64px 24px 32px; max-width: var(--layout-max); margin: 0 auto; }
@media (max-width: 767px) { .footer-inner { padding: 48px 16px 24px; } }

.footer-top {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1.1fr;
  gap: 32px;
  align-items: start;
}
.footer-top > .footer-col { min-width: 0; }
@media (max-width: 600px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px 24px; }
  .footer-top .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .footer-top { grid-template-columns: 1fr; }
}

.footer-col h4 {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: rgba(255,255,255,.55);
  margin: 0 0 16px;
}
.footer-col a {
  display: block;
  color: rgba(255,255,255,.72);
  font-size: 13px;
  padding: 6px 0;
  transition: color 150ms ease;
}
.footer-col a:hover { color: #a78bfa; }
.footer-col .ic-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
}
.footer-col .ic-row svg { width: 16px; height: 16px; color: rgba(167,139,250,.7); flex-shrink: 0; }

.footer-brand .brand { display: inline-flex; }
.footer-tagline {
  margin: 16px 0 0;
  font-size: 13px;
  color: rgba(255,255,255,.4);
  max-width: 240px;
  line-height: 1.6;
}
.footer-patent {
  display: inline-block;
  margin-top: 16px;
  padding: 4px 12px;
  background: rgba(109,40,217,.15);
  border: 1px solid rgba(109,40,217,.3);
  border-radius: 20px;
  color: #a78bfa;
  font-size: 11px;
  font-weight: 600;
}

.footer-divider {
  border-top: 1px solid rgba(255,255,255,.05);
  margin: 40px 0 24px;
}

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.footer-legal { font-size: 11px; color: rgba(255,255,255,.18); }
.footer-legal-links { display: flex; gap: 24px; }
.footer-legal-links a {
  font-size: 11px;
  color: rgba(255,255,255,.25);
  transition: color 150ms ease;
}
.footer-legal-links a:hover { color: rgba(255,255,255,.55); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .footer-grid-bg { animation: none; }
}

/* ===== Helpers ===== */
.icon-tile {
  width: 44px; height: 44px;
  background: var(--purple-light); color: var(--purple-700);
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icon-tile svg { width: 22px; height: 22px; stroke-width: 2; }

.section-dark .icon-tile {
  background: rgba(167,139,250,.18); color: #c4b5fd;
}

/* ─── Extra mobile tweaks ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .section-pad   { padding: 56px 0; }
  .section-head  { margin-bottom: 32px; }
  .m-sub         { font-size: 16px; }
}
