:root {
  --bg: #111215;
  --bg-elev: #151619;
  --bg-card: #1a1b1e;
  --bg-soft: #1d2025;
  --border: #282c32;
  --text: #c3c8d2;
  --heading: #f5f5f5;
  --muted: #a9afb6;
  --accent: #858de4;
  --accent-ink: #111215;
  --radius: 12px;
  --max: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.25s;
  --dur: 0.32s;
  --dur-reveal: 0.48s;
  --dur-modal: 0.4s;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { color: var(--heading); font-weight: 600; margin: 0 0 .6em; letter-spacing: -0.02em; }
p { margin: 0; }

.container { width: min(100% - 40px, var(--max)); margin-inline: auto; }

.glow {
  pointer-events: none;
  position: fixed;
  inset: 0 auto auto 50%;
  width: 900px;
  height: 520px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(133, 141, 228, 0.16), transparent 65%);
  z-index: 0;
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(17, 18, 21, 0.78);
  border-bottom: 1px solid transparent;
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}
.logo img { display: block; }
.nav { display: flex; gap: 28px; }
.nav__link {
  position: relative;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--dur-fast) var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur) var(--ease);
  opacity: 0.9;
}
.nav__link:hover,
.nav__link.is-active { color: var(--accent); }
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }
.header__actions { display: flex; align-items: center; gap: 16px; }
.lang {
  font-size: 14px;
  font-weight: 600;
  color: var(--heading);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    filter var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    opacity var(--dur-fast) var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active {
  transform: translateY(0);
  transition-duration: 0.12s;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 8px 22px rgba(133, 141, 228, 0.22);
}
.btn-primary:active { filter: brightness(0.98); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--heading);
}
.btn-ghost:hover {
  border-color: #3a4048;
  background: rgba(255,255,255,0.03);
}
.btn-ghost:active { background: rgba(255,255,255,0.05); }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-sm { padding: 8px 12px; font-size: 13px; }

.hero {
  position: relative;
  z-index: 1;
  padding: 56px 0 24px;
  text-align: center;
}
.hero__inner { position: relative; }
.hero h1 {
  font-size: clamp(32px, 5vw, 50px);
  line-height: 1.15;
  max-width: 820px;
  margin: 0 auto 18px;
}
.hero h1 span { color: var(--accent); }
.hero__lead {
  max-width: 620px;
  margin: 0 auto 28px;
  font-size: 17px;
  color: var(--text);
}
.hero__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 48px;
}
.hero__shot {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(40, 44, 50, 0.9);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  background: #0c0d10;
}
.hero__shot img { width: 100%; height: auto; }

/* Hero fade-up on load */
.hero-anim {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp var(--dur-reveal) var(--ease) forwards;
  animation-delay: var(--hero-delay, 0ms);
}
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spark {
  position: absolute;
  color: var(--accent);
  opacity: .85;
  font-size: 14px;
  animation: pulse 3.5s ease-in-out infinite;
}
.spark-1 { top: 18px; left: 8%; animation-delay: 0s; }
.spark-2 { top: 80px; right: 12%; animation-delay: .8s; }
.spark-3 { top: 200px; left: 18%; animation-delay: 1.6s; font-size: 10px; }
@keyframes pulse {
  0%, 100% { opacity: .35; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

.features { padding: 56px 0 32px; position: relative; z-index: 1; }
.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.features__grid li {
  text-align: center;
  padding: 8px 12px;
}
.features__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--accent);
  display: grid;
  place-items: center;
}
.features h3 { font-size: 18px; margin-bottom: 8px; }
.features p { font-size: 15px; color: var(--muted); }

.eyebrow {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}
.section-lead {
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
}

.database {
  padding: 72px 0;
  position: relative;
  z-index: 1;
}
.database__inner { text-align: center; }
.database h2 {
  font-size: clamp(28px, 4vw, 40px);
  max-width: 640px;
  margin: 0 auto 14px;
}
.database .section-lead { margin: 0 auto 36px; }
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 820px;
  margin: 0 auto;
}
.stats li {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 16px;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.stats li:hover {
  border-color: #353a43;
  transform: translateY(-2px);
}
.stats strong {
  display: block;
  color: var(--heading);
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 6px;
}
.stats span { color: var(--muted); font-size: 14px; }

.panel {
  padding: 40px 0 72px;
  position: relative;
  z-index: 1;
}
.panel__grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 40px;
  align-items: center;
}
.panel h2 { font-size: clamp(28px, 4vw, 38px); }
.panel .section-lead { margin-bottom: 24px; }
.panel__list { display: grid; gap: 16px; }
.panel__list li {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.panel__list strong { display: block; color: var(--heading); margin-bottom: 4px; }
.panel__list span { color: var(--muted); font-size: 14px; }
.panel__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.panel__card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--heading);
  font-weight: 600;
}
.panel__card table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Fragment Mono", ui-monospace, monospace;
  font-size: 12px;
}
.panel__card th,
.panel__card td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(40,44,50,.8);
}
.panel__card th { color: var(--muted); font-weight: 500; font-family: Inter, sans-serif; }
.panel__card td { color: var(--heading); }
.panel__card tr:last-child td { border-bottom: 0; }

.news { padding: 24px 0 64px; position: relative; z-index: 1; }
.news h2 {
  text-align: center;
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 32px;
}
.news__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}
.news__grid li {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  width: min(100%, 360px);
  flex: 0 1 360px;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.news__grid li:hover {
  border-color: #353a43;
  transform: translateY(-3px);
}
.news__grid img {
  width: 100%;
  aspect-ratio: 310 / 157;
  object-fit: cover;
}
.news__grid time,
.news__grid h3 { padding: 0 16px; }
.news__grid time {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}
.news__grid h3 {
  font-size: 18px;
  margin: 8px 0 18px;
}

.faq { padding: 24px 0 80px; position: relative; z-index: 1; }
.faq h2 {
  text-align: center;
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 28px;
}
.faq details {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.faq summary {
  cursor: pointer;
  color: var(--heading);
  font-weight: 600;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] summary { margin-bottom: 10px; }
.faq p { color: var(--muted); font-size: 15px; }

.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 36px;
  position: relative;
  z-index: 1;
}
.footer__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
}
.footer__nav { display: flex; gap: 22px; color: var(--muted); font-size: 14px; }
.footer__nav a {
  transition: color var(--dur-fast) var(--ease);
}
.footer__nav a:hover { color: var(--accent); }
.footer__social { display: flex; gap: 12px; opacity: .85; }
.footer__copy {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

/* Scroll reveal (features / stats / news) */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--dur-reveal) var(--ease),
    transform var(--dur-reveal) var(--ease),
    border-color var(--dur) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* Administrator key modal — viewport-fixed overlay (not in document flow) */
body.modal-open { overflow: hidden; }
.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  margin: 0;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 12, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity var(--dur-modal) var(--ease);
}
.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  background: linear-gradient(180deg, #1a1b1f 0%, #151619 100%);
  border: 1px solid rgba(133, 141, 228, 0.14);
  border-radius: 20px;
  padding: 28px 26px 24px;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  opacity: 0;
  transform: scale(0.985) translateY(6px);
  transition:
    opacity var(--dur-modal) var(--ease),
    transform var(--dur-modal) var(--ease);
}
.modal.is-open .modal__backdrop { opacity: 1; }
.modal.is-open .modal__dialog {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.modal__close:hover {
  color: var(--heading);
  background: rgba(255, 255, 255, 0.05);
}
.modal__close:active { transform: scale(0.98); }
.modal__head {
  padding-right: 36px;
  margin-bottom: 22px;
}
.modal__title {
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.modal__subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.modal__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
}
.modal__input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #111215;
  color: var(--heading);
  font-family: "Fragment Mono", ui-monospace, monospace;
  font-size: 14px;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.modal__input::placeholder {
  color: #6b717a;
  letter-spacing: 0;
  font-family: Inter, system-ui, sans-serif;
}
.modal__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(133, 141, 228, 0.18);
}
.modal__input[aria-invalid="true"] {
  border-color: #d36b6b;
  box-shadow: 0 0 0 3px rgba(211, 107, 107, 0.16);
}
.modal__error {
  margin: 10px 0 0;
  color: #e07a7a;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}
.modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}
.modal__btn {
  width: 100%;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: 12px;
}
.modal__actions .btn-primary {
  box-shadow: 0 8px 20px rgba(133, 141, 228, 0.22);
}

@media (max-width: 960px) {
  .nav { display: none; }
  .features__grid,
  .news__grid,
  .stats,
  .panel__grid { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; justify-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-anim {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .spark { animation: none; opacity: 0.7; }
  .btn,
  .btn:hover,
  .btn:active,
  .nav__link,
  .nav__link::after,
  .stats li,
  .news__grid li,
  .footer__nav a,
  .modal__backdrop,
  .modal__dialog,
  .modal__close,
  .modal__input {
    transition: none !important;
    transform: none !important;
    animation: none !important;
  }
  .modal:not([hidden]) .modal__backdrop,
  .modal:not([hidden]) .modal__dialog {
    opacity: 1;
  }
  .modal:not([hidden]) .modal__dialog {
    transform: none;
  }
}
