/* Сенчоус — тёмная неоновая тема */
:root {
  --bg: #0d0e14;
  --surface: #161824;
  --surface-2: #101222;
  --purple: #a855f7;
  --lime: #c8ff00;
  --text: #e8eaf0;
  --muted: #9aa3b5;
  --dim: #8b93a7;
  --line: rgba(168, 85, 247, 0.18);
  --line-strong: rgba(168, 85, 247, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: 'SN Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.55;
  background-color: var(--bg);
  background-image:
    radial-gradient(1000px 480px at 12% -8%, rgba(168, 85, 247, 0.16), transparent 60%),
    radial-gradient(820px 420px at 92% 4%, rgba(200, 255, 0, 0.07), transparent 55%),
    radial-gradient(circle, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: auto, auto, 26px 26px;
  background-attachment: fixed;
}

img { max-width: 100%; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

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

section[id] { scroll-margin-top: 84px; }

/* ===== Шапка ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 14, 20, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.logo-mark { width: 36px; height: 36px; }
.logo-text { font-size: 17px; }
.accent { color: var(--lime); }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.nav a:hover {
  color: #fff;
  background: rgba(168, 85, 247, 0.12);
}

.nav a.active {
  color: var(--lime);
  background: rgba(200, 255, 0, 0.08);
  box-shadow: 0 0 18px rgba(200, 255, 0, 0.12);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-left: auto;
  padding: 10px;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--lime);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
}

.btn-primary {
  background: linear-gradient(120deg, #d4ff33, #a3e000);
  color: #10131c;
  box-shadow: 0 6px 24px rgba(200, 255, 0, 0.22);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(200, 255, 0, 0.32);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.btn-ghost {
  background: rgba(168, 85, 247, 0.08);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--lime);
  background: rgba(200, 255, 0, 0.08);
  transform: translateY(-2px);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; pointer-events: none; }

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
}
.blob-a {
  width: 460px; height: 460px;
  top: -120px; left: -100px;
  background: rgba(168, 85, 247, 0.4);
}
.blob-b {
  width: 380px; height: 380px;
  right: -80px; bottom: -120px;
  background: rgba(200, 255, 0, 0.16);
}

.hero-grid-lines {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 64px);
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
}

.hero-decor {
  position: absolute;
  right: 4%;
  top: 50%;
  transform: translateY(-50%);
  width: min(420px, 36vw);
  opacity: 0.9;
}

.hero-inner { position: relative; padding: 80px 0; }

.badge {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.1);
  color: #d7c2ff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-title {
  position: relative;
  margin: 18px 0 6px;
  font-size: clamp(64px, 14vw, 148px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, var(--lime) 0%, var(--purple) 78%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  width: fit-content;
}

.hero-title::before,
.hero-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  opacity: 0.55;
  mix-blend-mode: screen;
  pointer-events: none;
}
.hero-title::before {
  color: rgba(200, 255, 0, 0.5);
  transform: translate(3px, -2px);
  animation: glitch-shift 4.5s steps(2) infinite;
}
.hero-title::after {
  color: rgba(168, 85, 247, 0.55);
  transform: translate(-3px, 2px);
  animation: glitch-shift 3.8s steps(2) infinite reverse;
}

@keyframes glitch-shift {
  0%, 92%, 100% { clip-path: inset(0 0 0 0); }
  93% { clip-path: inset(12% 0 64% 0); transform: translate(6px, -2px); }
  96% { clip-path: inset(58% 0 14% 0); transform: translate(-6px, 3px); }
}

.hero-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.hero-lead {
  max-width: 620px;
  margin: 0 0 30px;
  color: #b9c0d0;
  font-size: 17.5px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ===== Секции ===== */
.section { padding: 88px 0; }

.section-alt {
  background: linear-gradient(180deg, rgba(22, 24, 36, 0.75), rgba(16, 18, 34, 0.75));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head { margin-bottom: 36px; }

.kicker {
  margin: 0 0 8px;
  color: var(--purple);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 800;
  line-height: 1.12;
}

.section-lead {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16.5px;
}

/* ===== Факты ===== */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 34px;
}

.fact-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.fact-card:hover {
  transform: translateY(-3px);
  border-color: rgba(200, 255, 0, 0.4);
  box-shadow: 0 12px 28px rgba(168, 85, 247, 0.16);
}

.fact-label {
  margin: 0 0 6px;
  color: var(--dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.fact-value { margin: 0; font-size: 18px; font-weight: 700; }
.fact-value .note {
  display: block;
  margin-top: 4px;
  color: var(--dim);
  font-size: 12.5px;
  font-weight: 400;
}

/* ===== Текст ===== */
.prose { max-width: 820px; }
.prose p {
  margin: 0 0 16px;
  color: #b9c0d0;
  font-size: 16.5px;
  line-height: 1.75;
}
.prose strong { color: var(--text); }
.prose em { color: #d7c2ff; font-style: normal; font-weight: 600; }

/* ===== Сюжет ===== */
.plot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.plot-tile {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.plot-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(200, 255, 0, 0.45);
  box-shadow: 0 14px 32px rgba(168, 85, 247, 0.2);
}

.plot-index {
  display: inline-block;
  margin-bottom: 12px;
  padding: 2px 9px;
  border-radius: 8px;
  background: rgba(200, 255, 0, 0.08);
  color: var(--lime);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
}

.plot-tile h3 { margin: 0 0 8px; font-size: 20px; }
.plot-tile p { margin: 0; color: var(--muted); font-size: 15px; }

/* ===== Персонажи ===== */
.chars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}

.char-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.char-card:hover {
  transform: translateY(-4px);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 14px 32px rgba(168, 85, 247, 0.2);
}

.char-ava {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), #6d28d9);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}
.ava-glitch { background: linear-gradient(135deg, var(--lime), #5b8c00); color: #10131c; }
.ava-sanya { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.ava-alex { background: linear-gradient(135deg, #f472b6, var(--purple)); }
.ava-freyz { background: linear-gradient(135deg, #22d3ee, #7c3aed); }
.ava-vanchik { background: linear-gradient(135deg, #fbbf24, #f97316); color: #1a1206; }

.char-body h3 { margin: 0 0 2px; font-size: 18px; }
.char-role {
  margin: 0 0 8px;
  color: var(--lime);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}
.char-body > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

/* ===== Галерея: форма ===== */
.upload-box {
  display: grid;
  gap: 14px;
  padding: 22px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
}

.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 30px 18px;
  border: 2px dashed rgba(200, 255, 0, 0.32);
  border-radius: 16px;
  background: rgba(168, 85, 247, 0.05);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.file-drop:hover,
.file-drop.dragover {
  border-color: var(--lime);
  background: rgba(200, 255, 0, 0.07);
}
.file-drop input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.file-drop-text { color: #b9c0d0; font-weight: 600; }
.file-drop-text small { color: var(--dim); font-weight: 400; }

.file-preview {
  max-width: 280px;
  max-height: 180px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  justify-self: start;
}

.upload-row { display: flex; flex-wrap: wrap; gap: 12px; }

.caption-input {
  flex: 1 1 260px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.28);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.caption-input::placeholder { color: var(--dim); }
.caption-input:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(200, 255, 0, 0.14);
}

.upload-note { margin: 0; color: var(--dim); font-size: 13px; }

/* ===== Галерея: сетка ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.g-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.g-card:hover {
  transform: translateY(-4px);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 14px 32px rgba(168, 85, 247, 0.18);
}

.g-card-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-2);
}

.g-card-body {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
}

.g-card-caption {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  word-break: break-word;
}
.g-card-caption.muted { color: var(--dim); font-weight: 400; font-style: italic; }

.g-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.g-card-date {
  color: var(--dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
}

.g-card-del {
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 123, 123, 0.35);
  background: none;
  color: #ff9c9c;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.g-card-del:hover {
  background: rgba(255, 123, 123, 0.12);
  border-color: #ff7b7b;
}

.gallery-empty,
.gallery-error {
  grid-column: 1 / -1;
  padding: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}
.gallery-error { border-color: rgba(255, 123, 123, 0.4); color: #ffb3b3; }

/* ===== Ссылки ===== */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.link-card:hover {
  transform: translateY(-3px);
  border-color: rgba(200, 255, 0, 0.45);
  box-shadow: 0 12px 28px rgba(200, 255, 0, 0.1);
}

.link-name { color: var(--text); font-weight: 700; font-size: 16px; }
.link-desc { color: var(--dim); font-size: 14px; }

/* ===== Футер ===== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 40px;
  color: var(--dim);
  font-size: 14px;
}
.footer-inner p { margin: 0 0 8px; }
.footer-sources { font-size: 12.5px; }

/* ===== Тост ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  z-index: 100;
  max-width: min(480px, 92vw);
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(200, 255, 0, 0.4);
  background: #1b1e2e;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error {
  border-color: rgba(255, 123, 123, 0.5);
  color: #ffd6d6;
}

/* ===== Адаптив ===== */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 10px 20px 14px;
    background: rgba(13, 14, 20, 0.97);
    border-bottom: 1px solid var(--line);
  }
  .site-header.nav-open .nav { display: flex; }

  .hero-decor { display: none; }
  .hero-inner { padding: 60px 0; }
  .section { padding: 64px 0; }
}

@media (max-width: 480px) {
  .container { width: min(1100px, 100% - 28px); }
  .hero-title { font-size: clamp(52px, 18vw, 88px); }
  .hero-actions .btn { flex: 1 1 100%; }
  .upload-row .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
