:root {
  --bg: #0b0c0f;
  --bg-2: #12141a;
  --card: #171a21;
  --line: rgba(250, 236, 210, 0.1);
  --text: #f4efe4;
  --muted: #9a907c;
  --accent: #e4a31a;
  --accent-2: #f2c45a;
  --danger: #e07060;
  --ok: #7cbc7a;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(228, 163, 26, 0.06), transparent 50%),
    radial-gradient(800px 400px at 100% 0%, rgba(80, 110, 160, 0.08), transparent 45%),
    var(--bg);
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; }

.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.narrow { width: min(640px, calc(100% - 40px)); }

.top {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(11, 12, 15, 0.78);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 72px;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #1a1203; font-weight: 700;
}
.logo { flex-shrink: 0; white-space: nowrap; }
.logo-text { font-size: 18px; letter-spacing: 0.04em; font-weight: 650; }
.logo-dot { color: var(--muted); }

.search { flex: 1; }
.search input {
  width: 100%; height: 42px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-2);
  color: var(--text); padding: 0 16px; font: inherit;
}
.nav { display: flex; align-items: center; justify-content: flex-end; gap: 10px 12px; flex-wrap: wrap; max-width: 420px; }
.nav a { color: var(--text); text-decoration: none; }
.who { color: var(--accent-2) !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn-accent { background: var(--accent); color: #1a1203; border-color: var(--accent); font-weight: 600; }
.btn-ghost { background: transparent; }
.btn-wide { width: 100%; }
.linkish { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; }
.inline { display: inline; margin: 0; }

.hero { padding: 56px 0 24px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent); font-size: 12px; margin: 0 0 10px; }
.hero h1, .page h1, .model-side h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.15; margin: 0 0 14px; font-weight: 650; }
.lead { max-width: 640px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 28px 0 16px; }
.section-head h2 { margin: 0; font-size: 22px; }
.section-head p { color: var(--muted); margin: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 22px 18px;
  padding-bottom: 72px;
}
.card {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  color: var(--text);
  text-decoration: none;
  box-shadow: none;
}
.card:hover { text-decoration: none; }
.card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #14161c;
  overflow: hidden;
  border-radius: 12px;
}
.card-media img, .card-media video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.card-still, .card-motion { position: absolute; inset: 0; }
.card-motion { opacity: 0; transition: opacity 0.2s ease; }
.card.has-motion:hover .card-motion,
.card.has-motion:focus-visible .card-motion,
.card.has-motion.is-playing .card-motion,
.card.has-motion:not(:has(.card-still)) .card-motion { opacity: 1; }
.card.has-motion:hover .card-still,
.card.has-motion:focus-visible .card-still,
.card.has-motion.is-playing .card-still { opacity: 0; }
.card.has-motion .card-media::after {
  content: "▶";
  position: absolute; right: 8px; bottom: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.45); color: #fff;
  font-size: 9px; line-height: 22px; text-align: center;
  pointer-events: none;
}
.card.has-motion:hover .card-media::after,
.card.has-motion.is-playing .card-media::after { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .card-motion { display: none; }
  .card.has-motion .card-media::after { display: none; }
}
.card-ph { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.card-ph.tall { min-height: 360px; border-radius: 12px; background: #14161c; }
.card-body { padding: 10px 2px 0; }
.card-body h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.muted { color: var(--muted); }

.page { padding: 40px 0 72px; }
.form { display: grid; gap: 14px; margin: 24px 0; }
.form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.form input, .form textarea, .form select {
  width: 100%; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: inherit; padding: 12px 14px;
}
.form textarea { resize: vertical; }

.model {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 36px;
  padding: 36px 0 80px;
}
.gallery-main {
  border-radius: 20px; overflow: hidden; background: var(--card);
  border: 1px solid var(--line); min-height: 320px;
}
.gallery-main img, .gallery-main video { width: 100%; height: auto; display: block; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: none; cursor: pointer; width: 72px; }
.thumb img { width: 72px; height: 54px; object-fit: cover; }
.thumb-play { display: grid; place-items: center; width: 72px; height: 54px; color: var(--text); }
.intro-box { margin: 28px 0 8px; }
.intro-box h2, .page h2 { font-size: 18px; margin: 28px 0 8px; }
.intro-form { margin-top: 10px; }
.magnet-box { display: grid; gap: 10px; margin: 22px 0; }
.tiny { font-size: 13px; margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.prose { color: #ddd6c6; }
.prose h2 { font-size: 22px; margin-top: 28px; }
.by { color: var(--muted); }

.flash { margin-top: 16px; padding: 12px 16px; border-radius: 12px; }
.flash-err { background: rgba(224, 112, 96, 0.15); color: #ffc8c0; }
.flash-ok { background: rgba(124, 188, 122, 0.15); color: #c8efc6; }
.empty { padding: 40px 0 80px; }

.versions { margin: 32px 0 12px; }
.versions h2 { font-size: 18px; margin: 0 0 8px; }
.ver {
  margin: 12px 0; padding: 14px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--bg-2);
}
.ver-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ver-log { margin: 8px 0; }
.ver-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.pill {
  font-size: 12px; border-radius: 999px; padding: 2px 8px;
  background: rgba(228, 163, 26, 0.18); color: var(--accent-2);
}
.pill-warn { background: rgba(224, 112, 96, 0.16); color: #ffc8c0; }
.versions-arch { margin: 20px 0 40px; color: var(--muted); }
.versions-arch summary { cursor: pointer; }
.check { display: flex !important; flex-direction: row; align-items: center; gap: 10px; }
.check input { width: auto; }

.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.author-head { margin-bottom: 28px; }

@media (max-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
  }
  .card-body { padding: 8px 0 0; }
  .card-body h3 { font-size: 14px; }
}

@media (max-width: 960px) {
  .top-inner {
    grid-template-columns: auto auto;
    padding: 12px 0;
  }
  .search { grid-column: 1 / -1; order: 3; }
  .nav { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
  .model { grid-template-columns: 1fr; }
  .hero { padding-top: 28px; }
}
