/* ============================================================
   EGO—ONE · «самиздат»: чёрный, бумага, сухой красный, моно.
   Без градиентов, глоу и прочей нейронной позолоты.
   ============================================================ */
:root {
  --bg: #0d0d0c;
  --panel: #141312;
  --panel2: #191817;
  --line: #262523;
  --line-hard: #3a3835;
  --text: #eae7e0;
  --muted: #8f8b83;
  --red: #e5382e;
  --orange: #ff6b00;
  --green: #6fbf73;
  --f-display: "Oswald", "Arial Narrow", sans-serif;
  --f-mono: "IBM Plex Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--red); color: var(--bg); }
a { color: inherit; }
.mono { font-family: var(--f-mono); }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 800px; }
.muted { color: var(--muted); }

h1, h2 {
  font-family: var(--f-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: 1.02;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); margin-bottom: 18px; }
.overline { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.hl { background: var(--red); color: var(--bg); padding: 0 12px 2px; }

/* ---------- верхняя строка-тикер ---------- */
.ticker {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding: 6px 24px; white-space: nowrap; overflow: hidden;
}

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 2px solid var(--line-hard);
}
.head-in { display: flex; align-items: center; gap: 30px; height: 64px; }
.logo {
  font-family: var(--f-display); font-weight: 700; font-size: 26px;
  letter-spacing: .04em; text-decoration: none;
}
.logo .dash { color: var(--red); }
.head-nav { display: flex; gap: 4px; margin-left: auto; }
.head-nav a {
  color: var(--muted); text-decoration: none;
  font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase;
  padding: 8px 12px;
}
.head-nav a:hover { color: var(--bg); background: var(--text); }
.head-right { display: flex; gap: 8px; align-items: center; }
.tag {
  font-family: var(--f-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  text-decoration: none; padding: 7px 12px; border: 1px solid var(--line-hard);
}
.tag-ok { color: var(--green); border-color: rgba(111, 191, 115, .4); }
.tag-warn { color: var(--orange); border-color: rgba(255, 107, 0, .4); }

/* ---------- кнопки: прямоугольные, моно ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--red); color: #fff; border: 0; cursor: pointer;
  font-family: var(--f-mono); font-weight: 600; font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 13px 22px; text-decoration: none;
  transition: background .12s, color .12s;
}
.btn:hover { background: var(--orange); color: var(--bg); }
.btn-small { padding: 8px 14px; font-size: 12px; }
.btn-wide { width: 100%; }
.btn-ghost { background: transparent; border: 1px solid var(--line-hard); color: var(--text); }
.btn-ghost:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.mini-btn {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  font-family: var(--f-mono); font-size: 11.5px; text-transform: uppercase;
  padding: 5px 10px; cursor: pointer; text-decoration: none; display: inline-block;
}
.mini-btn:hover { color: var(--text); border-color: var(--line-hard); }
.mini-btn.danger { color: var(--red); }

/* ---------- hero ---------- */
.hero {
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.012) 3px 4px);
}
.hero-grid {
  display: grid; grid-template-columns: 1.35fr .65fr;
  gap: 40px; align-items: center; padding-top: 72px; padding-bottom: 64px;
}
.hero h1 { margin: 14px 0 20px; }
.lead { font-size: 17.5px; color: #c9c5cf; max-width: 34em; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }

.hero-side { position: relative; }
.stats-box {
  font-size: 13px; line-height: 1.75;
  color: var(--muted);
  border: 1px solid var(--line-hard);
  padding: 14px 18px;
  white-space: pre;
  overflow-x: auto;
}
.sticker {
  position: absolute; top: -14px; right: -10px;
  background: var(--orange); color: var(--bg);
  font-size: 12px; font-weight: 600; letter-spacing: .1em;
  padding: 5px 12px;
  transform: rotate(5deg);
}

/* ---------- секции ---------- */
.section { padding: 64px 0 24px; }

/* ---------- каталог: строки ---------- */
.catalog-head { display: flex; align-items: baseline; gap: 22px; flex-wrap: wrap; margin-bottom: 16px; }
.catalog-head h2 { margin: 0; }
.count { font-size: 12px; color: var(--muted); margin-left: 10px; }
.chips { display: flex; }
.chip {
  padding: 7px 16px; color: var(--muted); text-decoration: none; font-size: 12px;
  text-transform: uppercase; letter-spacing: .06em;
  border: 1px solid var(--line); border-left: 0;
}
.chip:first-child { border-left: 1px solid var(--line); }
.chip:hover { color: var(--text); }
.chip.on { background: var(--red); color: #fff; border-color: var(--red); }

.plist { border-top: 2px solid var(--line-hard); }
.prow {
  display: grid;
  grid-template-columns: 44px 128px 1fr auto 40px;
  gap: 18px; align-items: center;
  padding: 14px 6px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  position: relative;
  transition: background .12s;
}
.prow::before {
  content: ""; position: absolute; left: -6px; top: 0; bottom: 0; width: 3px;
  background: var(--red); opacity: 0; transition: opacity .12s;
}
.prow:hover { background: var(--panel); }
.prow:hover::before { opacity: 1; }
.pnum { color: var(--muted); font-size: 12px; }
.pthumb { width: 128px; aspect-ratio: 16/9; overflow: hidden; background: var(--panel2); border: 1px solid var(--line); }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(.4) contrast(1.05); transition: filter .15s; }
.prow:hover .pthumb img { filter: none; }
.pthumb-fb { display: grid; place-items: center; width: 100%; height: 100%; font-family: var(--f-display); font-size: 26px; color: var(--line-hard); }
.pmain { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ptitle { font-family: var(--f-display); font-weight: 600; font-size: 21px; text-transform: uppercase; letter-spacing: .02em; }
.ptag { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmeta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ptype { color: var(--orange); }
.parr { font-size: 18px; color: var(--muted); text-align: right; }
.prow:hover .parr { color: var(--red); }
.empty { border: 1px dashed var(--line-hard); padding: 34px; text-align: center; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ---------- как это работает ---------- */
.how { border-top: 1px solid var(--line); }
.two-col { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; align-items: start; }
.how-steps p { color: var(--muted); margin-bottom: 12px; font-size: 14px; }
.how-steps b { color: var(--red); font-weight: 600; margin-right: 6px; }

/* ---------- страница продукта ---------- */
.back { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; text-decoration: none; display: inline-block; margin-bottom: 16px; color: var(--muted); }
.back:hover { color: var(--text); }
.product-head { margin-bottom: 8px; }
.product-head .lead { margin-top: 8px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin: 26px 0; }
.g-item { background: var(--panel); border: 1px solid var(--line); }
.g-item img, .g-item video { width: 100%; display: block; max-height: 480px; object-fit: cover; background: #000; }
.g-item figcaption { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 12px; border-top: 1px solid var(--line); }
.product-body { display: grid; grid-template-columns: 1.4fr .8fr; gap: 30px; margin-top: 30px; align-items: start; }
.desc { color: #c9c5cf; border-top: 2px solid var(--line-hard); padding-top: 18px; }
.desc h2 { margin-bottom: 12px; }
.dl-box { border: 1px dashed var(--line-hard); padding: 24px; position: relative; }
.dl-box h2 { font-size: 18px; }
.dl-box .btn { margin-bottom: 8px; }
.dl-box .muted { font-size: 12.5px; font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .04em; }
.note { margin-top: 16px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.note a { color: var(--orange); }

/* ---------- авторизация/панели ---------- */
.auth-section { padding: 56px 0; }
.auth-card { max-width: 440px; margin: 0 auto; border: 1px solid var(--line-hard); padding: 32px; display: flex; flex-direction: column; gap: 14px; background: var(--panel); }
.auth-card h1 { font-size: 30px; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-family: var(--f-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.auth-card input, .form-grid input, .form-grid select, .form-grid textarea {
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
  padding: 12px 14px; font-size: 15px; outline: none; font-family: inherit; width: 100%;
}
.auth-card input:focus, .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--red); }
.form-error { color: var(--red); font-size: 13.5px; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 24px; margin-bottom: 16px; }
.panel h2 { font-size: 16px; text-transform: uppercase; letter-spacing: .05em; }
.ok-line { color: var(--green); }
.code-line {
  font-family: var(--f-mono); font-size: 20px; letter-spacing: .1em;
  border: 1px dashed var(--line-hard); padding: 12px; text-align: center; margin: 12px 0;
  cursor: pointer; user-select: all;
}
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 9px 10px; border-bottom: 2px solid var(--line-hard); }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table a { color: var(--orange); text-decoration: none; }

/* ---------- аккаунт ---------- */
.account h1 { margin-bottom: 4px; }

/* ---------- админка ---------- */
.admin-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--line-hard); margin-bottom: 22px; }
.stat-card { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 18px; }
.stat-card:last-child { border-right: 0; }
.stat-card b { display: block; font-family: var(--f-display); font-weight: 700; font-size: 30px; line-height: 1; }
.stat-card span { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat-card.hot b { color: var(--green); }
.admin-cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.form-grid { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.form-grid .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .check { flex-direction: row; align-items: center; gap: 8px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.media-item { position: relative; border: 1px solid var(--line); overflow: hidden; aspect-ratio: 16/9; background: var(--bg); }
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; }
.media-item .mv { position: absolute; left: 6px; bottom: 6px; font-family: var(--f-mono); font-size: 10px; background: var(--bg); padding: 2px 7px; color: var(--orange); text-transform: uppercase; }
.media-item form { position: absolute; top: 6px; right: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; background: var(--green); margin-right: 6px; }
.dot.off { background: var(--line-hard); }

/* ---------- footer ---------- */
.site-foot { border-top: 2px solid var(--line-hard); margin-top: 80px; padding: 18px 0 36px; }
.foot-ascii { color: var(--line-hard); font-size: 12px; overflow: hidden; }
.foot-in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.foot-in a { color: var(--orange); text-decoration: none; }

/* ---------- адаптив ---------- */
@media (max-width: 960px) {
  .hero-grid, .two-col, .product-body, .admin-cols { grid-template-columns: 1fr; }
  .head-nav { display: none; }
  .prow { grid-template-columns: 96px 1fr auto; }
  .pnum, .parr { display: none; }
  .pthumb { width: 96px; }
  .ticker { font-size: 10px; }
}
