:root {
  --ink: #020617;
  --ink-1: #080d1a;
  --ink-2: #0d1424;
  --brand: #6366f1;
  --hi: #eceaff;
  --mid: #9aa1bf;
  --lo: #5e6687;
  --border: rgba(255, 255, 255, 0.08);
  --border-b: rgba(255, 255, 255, 0.12);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--hi);
  background: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Background layers */
.bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(ellipse 110% 65% at 50% -8%, rgba(124, 131, 255, 0.2) 0%, transparent 55%),
    radial-gradient(ellipse 55% 75% at 88% 28%, rgba(99, 102, 241, 0.13) 0%, transparent 50%),
    radial-gradient(ellipse 50% 65% at 10% 72%, rgba(34, 211, 238, 0.08) 0%, transparent 50%),
    linear-gradient(165deg, #060a16 0%, #020617 48%, #070c1a 100%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 100% 70% at 50% 0%, black 0%, transparent 100%);
  mask-image: radial-gradient(ellipse 100% 70% at 50% 0%, black 0%, transparent 100%);
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.03;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: 64px;
  display: flex;
  align-items: center;
  background: rgba(2, 6, 23, 0.56);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

header.scrolled {
  background: rgba(2, 6, 23, 0.82);
  border-bottom-color: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hdr-wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  mix-blend-mode: screen;
  transition: transform 0.22s var(--ease), filter 0.22s var(--ease);
}

.logo-mark img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
}

.logo:hover .logo-mark {
  transform: scale(1.05) rotate(-3deg);
  filter: drop-shadow(0 0 8px rgba(96, 85, 245, 0.6));
}

.logo-wordmark {
  font-size: 19px;
  font-weight: 700;
  line-height: 64px;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #c4b5fd, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.22s var(--ease), color 0.22s var(--ease),
    background 0.22s var(--ease), border-color 0.22s var(--ease),
    box-shadow 0.22s var(--ease);
}

.btn-nav {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.74);
}

.btn-nav:hover {
  background: rgba(255, 255, 255, 0.11);
  color: var(--hi);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-2px);
}

.btn-nav-primary {
  background: rgba(99, 102, 241, 0.2);
  color: #d4ccff;
  border-color: rgba(99, 102, 241, 0.42);
}

.btn-nav-primary:hover {
  background: rgba(99, 102, 241, 0.34);
  color: #ede9ff;
  border-color: rgba(99, 102, 241, 0.62);
  transform: translateY(-2px);
}

.btn-nav-green {
  background: rgba(34, 197, 94, 0.14);
  color: rgba(134, 239, 172, 0.95);
  border-color: rgba(34, 197, 94, 0.34);
}

.btn-nav-green:hover {
  background: rgba(34, 197, 94, 0.24);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.5);
  transform: translateY(-2px);
}

.burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  cursor: pointer;
  border: 0;
  background: none;
}

.burger span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--mid);
  transition: transform 0.22s var(--ease), opacity 0.22s var(--ease);
}

.burger.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.burger.open span:nth-child(2) {
  opacity: 0;
}

.burger.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-nav {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 899;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(2, 6, 20, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.mobile-nav.open {
  display: flex;
}

/* Main legal block */
.legal-shell {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 112px 24px 52px;
}

.legal-hero {
  margin-bottom: 20px;
}

.legal-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--mid);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-breadcrumb::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7c83ff;
  box-shadow: 0 0 8px rgba(124, 131, 255, 0.7);
}

.legal-title {
  margin: 0 0 12px;
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--mid);
  font-size: 13px;
}

.legal-meta-badge {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.15);
  color: #c4b5fd;
  font-weight: 600;
}

.legal-meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(154, 161, 191, 0.8);
}

.legal-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(13, 20, 36, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  padding: 28px 24px;
}

.legal-card h2 {
  margin: 30px 0 12px;
  font-size: clamp(19px, 2.4vw, 25px);
  line-height: 1.22;
  letter-spacing: -0.01em;
}

.legal-card h2:first-child {
  margin-top: 0;
}

.sec-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  margin-right: 10px;
  border-radius: 9px;
  border: 1px solid rgba(99, 102, 241, 0.42);
  background: rgba(99, 102, 241, 0.16);
  color: #c4b5fd;
  font-size: 14px;
  font-weight: 700;
  vertical-align: middle;
}

.legal-card p {
  margin: 0 0 13px;
  color: #e2e8ff;
  font-size: 15px;
}

.sub-num {
  color: #c4b5fd;
  font-weight: 700;
  margin-right: 6px;
}

.legal-card ul,
.legal-card ol {
  margin: 0 0 15px 0;
  padding: 0 0 0 20px;
  color: #d6ddf9;
}

.legal-card li {
  margin: 0 0 6px;
}

.legal-card strong {
  color: #f3f0ff;
}

.legal-card a {
  color: #a5b4fc;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-card a:hover {
  color: #c4b5fd;
}

.legal-operator {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(8, 13, 26, 0.72);
  padding: 18px 16px;
}

.legal-operator-title {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #e9e7ff;
}

.legal-operator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.op-field-label {
  margin-bottom: 2px;
  color: var(--mid);
  font-size: 12px;
}

.op-field-value {
  color: #dfe5ff;
  font-size: 14px;
}

.legal-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #ced5f6;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.2s var(--ease), color 0.2s var(--ease),
    background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.legal-back-btn svg {
  width: 16px;
  height: 16px;
}

.legal-back-btn:hover {
  color: var(--hi);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  background: rgba(2, 5, 14, 0.88);
  margin-top: 28px;
  padding: 36px 0 28px;
}

.footer-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto 26px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 0;
  align-items: start;
}

.footer-inner > div:first-child {
  padding-right: 56px;
}

.footer-links-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-left: 56px;
}

.footer-links-cols > div {
  padding-right: 40px;
  position: relative;
}

.footer-links-cols > div:last-child {
  padding-left: 40px;
  padding-right: 0;
}

.footer-links-cols > div:last-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 28px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.footer-logo {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 10px;
}

.footer-desc {
  margin: 0;
  max-width: 320px;
  color: var(--mid);
  font-size: 13px;
  line-height: 1.64;
}

.f-col-title {
  margin-bottom: 12px;
  color: var(--hi);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.f-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.f-links-legal {
  display: grid;
  grid-template-columns: max-content max-content;
  gap: 0;
}

.f-links-legal .f-links-col {
  padding-right: 24px;
}

.f-links-legal .f-links-col:last-child {
  border-left: 1px solid var(--border);
  padding-left: 24px;
  padding-right: 0;
}

.f-links a {
  color: var(--mid);
  font-size: 13px;
  transition: color 0.2s var(--ease);
  white-space: nowrap;
}

.f-links a:hover {
  color: var(--hi);
}

.footer-bot {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 32px 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.f-copy {
  color: var(--lo);
  font-size: 12px;
}

.f-bot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
}

.f-bot-links a {
  color: var(--lo);
  font-size: 12px;
  transition: color 0.2s var(--ease);
}

.f-bot-links a:hover {
  color: var(--mid);
}

/* Responsive */
@media (max-width: 1024px) {
  body:has(.mobile-nav.open) {
    overflow: hidden;
    touch-action: none;
  }

  nav {
    display: none;
  }

  .burger {
    display: flex;
    margin-left: auto;
  }

  .mobile-nav {
    top: 64px;
    bottom: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    gap: 8px;
    display: flex;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0s linear 0.18s;
  }

  .mobile-nav.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
  }

  .mobile-nav .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .footer-inner > div:first-child {
    padding-right: 0;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
  }

  .footer-links-cols {
    padding-left: 0;
    padding-top: 32px;
  }

  .footer-links-cols > div:last-child {
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 24px;
    margin-top: 24px;
  }

  .footer-links-cols > div:last-child::before {
    display: none;
  }
}

@media (max-width: 768px) {
  .hdr-wrap,
  .footer-inner,
  .footer-bot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .logo-wordmark {
    font-size: 17px;
    line-height: 1.15;
  }

  .btn,
  .mobile-nav .btn {
    min-height: 44px;
  }

  .mobile-nav {
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    gap: 8px;
    max-height: none;
    overflow-y: auto;
  }

  .mobile-nav .btn {
    width: 100%;
    justify-content: center;
  }

  .legal-shell {
    padding: 96px 16px 34px;
  }

  .legal-title {
    font-size: clamp(26px, 8vw, 36px);
  }

  .legal-card {
    padding: 20px 14px;
    border-radius: 14px;
  }

  .legal-operator {
    padding: 16px 12px;
  }

  .legal-operator-grid {
    grid-template-columns: 1fr;
  }

  .footer-links-cols,
  .f-links-legal {
    grid-template-columns: 1fr;
  }

  .footer-links-cols > div,
  .footer-links-cols > div:last-child {
    padding-left: 0;
    padding-right: 0;
  }

  .footer-links-cols > div + div {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }

  .f-links-legal .f-links-col {
    padding-right: 0;
  }

  .f-links-legal .f-links-col:last-child {
    border-left: 0;
    padding-left: 0;
    margin-top: 10px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
  }

  .f-links a,
  .f-bot-links a {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .f-bot-links {
    gap: 8px 12px;
  }

  .footer-bot {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 425px) {
  .hdr-wrap,
  .footer-inner,
  .footer-bot,
  .legal-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .logo-mark,
  .logo-mark img {
    width: 48px;
    height: 48px;
  }

  .logo-wordmark {
    font-size: 16px;
  }

  .legal-shell {
    padding-top: 92px;
    padding-bottom: 30px;
  }

  .legal-card {
    padding: 16px 12px;
  }
}

@media (max-width: 375px) {
  .logo-wordmark {
    font-size: 15px;
  }

  .legal-title {
    font-size: clamp(24px, 10vw, 32px);
  }

  .legal-card h2 {
    font-size: clamp(17px, 6vw, 22px);
  }
}

@media (max-width: 320px) {
  .hdr-wrap,
  .footer-inner,
  .footer-bot,
  .legal-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .logo-wordmark {
    display: none;
  }

  .legal-card p,
  .legal-card li,
  .op-field-value {
    font-size: 14px;
  }
}
