:root {
  --bg: #0b0d12;
  --bg-elevated: #12151c;
  --bg-card: #171a22;
  --border: #232733;
  --text: #eef0f4;
  --text-dim: #9198a8;
  --text-faint: #5c6376;
  --accent: #6a8dff;
  --accent-soft: rgba(106, 141, 255, 0.14);
  --radius: 14px;
  --max-width: 1240px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

img, video { max-width: 100%; display: block; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(11, 13, 18, 0.86);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin-right: auto;
}

.logo svg { flex-shrink: 0; }

.main-nav {
  display: flex;
  gap: 22px;
}

.main-nav a {
  font-size: 14px;
  color: var(--text-dim);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--text);
}

.main-nav a.active {
  border-bottom-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
  transition: border-color .15s ease, background .15s ease;
}

.btn:hover { border-color: #3a4154; background: var(--bg-elevated); }

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0d12;
}

.btn-accent:hover { background: #85a4ff; border-color: #85a4ff; }

/* ---------- Hero ---------- */

.hero {
  padding: 56px 0 28px;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  max-width: 720px;
}

.hero p {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 560px;
  margin: 0 0 26px;
}

.hero-stats {
  display: flex;
  gap: 28px;
  margin-top: 6px;
}

.hero-stats div { font-size: 13px; color: var(--text-faint); }

.hero-stats b { display: block; font-size: 20px; color: var(--text); font-weight: 700; }

/* ---------- Category chips ---------- */

.chip-row {
  position: sticky;
  top: 64px;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.chip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chip-scroll::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: all .15s ease;
}

.chip:hover { border-color: #3a4154; color: var(--text); }

.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Grid ---------- */

.gallery-section { padding: 30px 0 80px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  animation: card-in .45s ease forwards;
}

@keyframes card-in {
  to { opacity: 1; transform: translateY(0); }
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: flex-end;
  padding: 10px;
  overflow: hidden;
  transition: transform .35s ease;
}

.card:hover .thumb { transform: scale(1.035); }

.thumb-img,
.thumb-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-img { z-index: 0; }

.thumb-preview {
  z-index: 0;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}

.card.previewing .thumb-preview { opacity: 1; }
.card.previewing .thumb-img { opacity: 0; }

.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 100%);
}

.badge {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0,0,0,0.4);
  color: #fff;
  backdrop-filter: blur(4px);
}

.badge.duration { margin-left: auto; }

.thumb-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  z-index: 2;
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all .2s ease;
  z-index: 2;
}

.card:hover .play-icon { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.card-body { padding: 12px 13px 14px; }

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  gap: 8px;
}

/* ---------- Loader / sentinel ---------- */

.loader {
  display: flex;
  justify-content: center;
  padding: 40px 0;
  color: var(--text-faint);
  font-size: 13px;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
  margin-right: 10px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.end-message {
  text-align: center;
  padding: 40px 0;
  color: var(--text-faint);
  font-size: 13px;
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 10, 0.86);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal-overlay.open { display: flex; }

.modal {
  width: 100%;
  max-width: 820px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.modal video { width: 100%; background: #000; max-height: 62vh; }

.modal-info {
  padding: 16px 20px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.modal-info h3 { margin: 0 0 6px; font-size: 16px; }

.modal-info .card-meta { font-size: 12.5px; }

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
}

.modal-shell { position: relative; }

/* ---------- Simple pages ---------- */

.page-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 90px;
}

.page-content h1 {
  font-size: 30px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.page-content .lead {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 34px;
}

.page-content h2 {
  font-size: 18px;
  margin: 32px 0 10px;
}

.page-content p, .page-content li {
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.7;
}

.page-content ul { padding-left: 20px; }

/* ---------- Form ---------- */

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 20px;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text-dim);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field textarea { resize: vertical; min-height: 90px; }

.field-hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

.form-status {
  margin-top: 16px;
  font-size: 13.5px;
  padding: 10px 14px;
  border-radius: 9px;
  display: none;
}

.form-status.show { display: block; }

.form-status.success { background: rgba(90, 209, 138, 0.12); color: #7ee6ab; }

.form-status.sending { background: var(--bg-elevated); color: var(--text-dim); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 34px 0;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a { font-size: 13px; color: var(--text-dim); }

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

.footer-note { font-size: 12.5px; color: var(--text-faint); }

@media (max-width: 640px) {
  .main-nav { display: none; }
  .hero-stats { flex-wrap: wrap; }
}
