/* ============================================================
   XSL Pictures — Production Board
   Источник правды: BRAND.md + tokens.css.
   Концепция: панель = съёмочный борд студии перед премьерой.
   Сигнатура: прогресс-рейл в виде киноплёнки с перфорацией.
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--xsl-void); scrollbar-color: var(--xsl-surface-2) var(--xsl-void); }

body { overflow-x: hidden; }

/* --- Слои-фактуры (BRAND.md §6) -------------------------------- */
#spores { position: fixed; inset: 0; z-index: 0; pointer-events: none; filter: blur(1px); }
.grain {
  position: fixed; inset: 0; z-index: var(--z-grain); pointer-events: none;
  opacity: 0.035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.ambient {
  position: fixed; border-radius: 50%; filter: blur(120px);
  pointer-events: none; z-index: 0;
  background: radial-gradient(circle, var(--violet-900), transparent 70%);
}
.ambient-1 { width: 700px; height: 700px; top: -240px; right: -180px; }
.ambient-2 { width: 560px; height: 560px; bottom: -200px; left: -160px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--page-pad); position: relative; z-index: 1; }

/* --- Типографика ------------------------------------------------ */
/* Tinos = метрический двойник Times/Liberation Serif из фолбэк-стека
   BRAND.md — тот же голос, что у логотипа, но гарантированно грузится */
h1, h2, h3, .display { font-family: "Tinos", var(--font-display); }

h2 {
  font-size: var(--fs-h2); line-height: var(--lh-heading);
  letter-spacing: var(--tr-heading); text-transform: uppercase;
  color: var(--text-primary);
}
.eyebrow { margin-bottom: var(--s-3); color: var(--violet-400); }
.crown { color: var(--xsl-metal); font-size: 0.9em; }

/* --- Навигация --------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: var(--z-nav);
  backdrop-filter: blur(16px);
  background: rgba(26, 26, 26, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: var(--s-4); flex-wrap: wrap; padding-top: var(--s-2); padding-bottom: var(--s-2); }
.nav-brand { display: flex; align-items: center; gap: var(--s-3); text-decoration: none; }
.nav-logo { height: 44px; width: 44px; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.nav-word { display: flex; flex-direction: column; gap: 2px; }
.nav-name {
  font-family: "Tinos", var(--font-display); font-weight: 700;
  font-size: 1rem; letter-spacing: 0.14em; color: var(--text-primary);
}
.nav-sub { font-size: 0.65rem; }
.nav-actions { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.nav-exit { color: var(--text-muted); text-decoration: none; }
.nav-exit:hover { color: var(--text-secondary); }

.bot-state { display: inline-flex; align-items: center; gap: var(--s-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-disabled); }
.dot.on { background: var(--violet-500); box-shadow: var(--glow-sm); }

/* --- Герой -------------------------------------------------------- */
.hero { padding: var(--s-9) 0 var(--s-7); text-align: center; position: relative; }
.hero::after {
  content: ''; position: absolute; inset: -60px -100vw 0;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,0.5) 100%);
  pointer-events: none; z-index: -1;
}
.hero-label { margin-bottom: var(--s-5); }
.hero-amount {
  font-size: var(--fs-display); line-height: var(--lh-display);
  letter-spacing: var(--tr-display); font-weight: 700;
}
.hero-sub { margin-top: var(--s-3); }

/* Появление героя — поставленная последовательность (§7, ≤1.8s) */
.reveal-load {
  animation: hero-in var(--d-reveal) var(--ease-out) both;
  animation-delay: var(--d, 0ms);
}
@keyframes hero-in {
  from { opacity: 0; transform: translateY(18px); filter: blur(5px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* --- СИГНАТУРА: киноплёнка-прогресс ------------------------------- */
.rail-wrap { max-width: 640px; margin: var(--s-7) auto 0; }
.rail {
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--xsl-surface); overflow: hidden;
}
.rail-holes {
  display: block; height: 10px;
  background-image: radial-gradient(rgba(229,228,226,0.28) 1.6px, transparent 2px);
  background-size: 18px 10px; background-position: 4px center; background-repeat: repeat-x;
}
.rail-track { height: 14px; background: var(--xsl-void); position: relative; border-block: 1px solid var(--line); }
.progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--violet-800), var(--violet-700));
  box-shadow: var(--glow-md);
  transition: width var(--d-cine) var(--ease-out);
}
.rail-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); margin-top: var(--s-3);
}

/* --- Статус-строка (редакторская, вместо плиток) ------------------- */
.status-strip {
  display: flex; justify-content: center; flex-wrap: wrap;
  margin-top: var(--s-8); border-block: 1px solid var(--line);
}
.ss-item {
  display: flex; flex-direction: column; gap: var(--s-2);
  padding: var(--s-5) var(--s-6); position: relative;
}
.ss-item + .ss-item::before {
  content: ''; position: absolute; left: 0; top: 25%; bottom: 25%;
  width: 1px; background: var(--line);
}
.ss-num {
  font-family: "Tinos", var(--font-display); font-weight: 700;
  font-size: var(--fs-h3); color: var(--text-primary); letter-spacing: 0.02em;
}

/* --- Секции --------------------------------------------------------- */
.section { padding: var(--s-8) 0; border-top: 1px solid var(--line); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s-5); flex-wrap: wrap; margin-bottom: var(--s-6);
}
.section > h2 { margin-bottom: var(--s-5); }

.filter-row { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.pill {
  font-family: var(--font-mono); font-size: var(--fs-utility);
  text-transform: uppercase; letter-spacing: var(--tr-utility);
  color: var(--text-muted); background: none;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 7px 14px; cursor: pointer;
  transition: color var(--d-micro) var(--ease-out), border-color var(--d-micro) var(--ease-out);
}
.pill:hover { border-color: var(--line-strong); color: var(--text-secondary); }
.pill.active { color: var(--violet-400); border-color: var(--violet-600); }
.pill-sep { width: 1px; align-self: stretch; background: var(--line-strong); margin: 0 var(--s-2); }

/* --- Карточки: кадры плёнки ----------------------------------------- */
.orders { display: flex; flex-direction: column; gap: var(--s-4); }
.card {
  display: flex; background: var(--xsl-surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color var(--d-ui) var(--ease-out), box-shadow var(--d-ui) var(--ease-out);
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--glow-sm); }
.reveal { animation: card-in var(--d-reveal) var(--ease-out) both; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(24px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.card-rail {
  flex: 0 0 18px;
  background-image: radial-gradient(rgba(229,228,226,0.22) 1.5px, transparent 2px);
  background-size: 18px 16px; background-position: center 6px; background-repeat: repeat-y;
  border-right: 1px solid var(--line);
}
.p-good .card-rail { background-color: rgba(104, 0, 255, 0.28); }
.p-mid  .card-rail { background-color: rgba(104, 0, 255, 0.10); }
.p-low  .card-rail { background-color: transparent; }

.card-body { padding: var(--s-5); flex: 1; min-width: 0; }
.card.skipped, .card.done { opacity: 0.5; }
.card.accepted { border-color: var(--violet-800); }

.card-top {
  display: flex; justify-content: space-between; gap: var(--s-4);
  align-items: baseline; margin-bottom: var(--s-3); flex-wrap: wrap;
}
.card-title {
  font-family: "Tinos", var(--font-display); font-size: 1.25rem;
  font-weight: 700; color: var(--text-primary); text-decoration: none;
  letter-spacing: 0.01em;
  transition: color var(--d-micro) var(--ease-out);
}
.card-title:hover { color: var(--violet-400); }
.card-price { font-family: "Tinos", var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--violet-300); white-space: nowrap; }
.card-higher { color: var(--text-muted); font-family: var(--font-body); font-weight: 400; font-size: var(--fs-small); }
.card-desc { color: var(--text-secondary); font-size: var(--fs-small); line-height: var(--lh-small); margin-bottom: var(--s-4); }

.verdict { display: flex; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-3); flex-wrap: wrap; }
.verdict-tag {
  font-family: var(--font-mono); font-size: var(--fs-utility);
  text-transform: uppercase; letter-spacing: var(--tr-utility);
  padding: 3px 10px; border-radius: var(--r-sm); border: 1px solid;
}
.v-good .verdict-tag { color: var(--violet-300); border-color: var(--violet-600); background: rgba(104,0,255,0.12); }
.v-mid  .verdict-tag { color: var(--text-secondary); border-color: var(--line-strong); }
.v-low  .verdict-tag { color: var(--text-muted); border-color: var(--line); }
.verdict-why { font-size: var(--fs-small); color: var(--text-muted); }

.card-meta { display: flex; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-2); }
.card-meta { font-family: var(--font-mono); font-size: var(--fs-utility); text-transform: uppercase; letter-spacing: var(--tr-utility); color: var(--text-muted); }
.status-tag { color: var(--violet-400); }
.card-actions { display: flex; gap: var(--s-3); margin-top: var(--s-4); flex-wrap: wrap; }

.empty { color: var(--text-muted); padding: var(--s-6) 0; }

/* --- Кнопки (§8) ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 32px; border-radius: var(--r-md);
  font-family: var(--font-body); font-weight: 500; font-size: var(--fs-small);
  text-transform: uppercase; letter-spacing: var(--tr-button);
  cursor: pointer; text-decoration: none; border: none;
  will-change: translate;
  transition: box-shadow var(--d-ui) var(--ease-out), background var(--d-ui) var(--ease-out),
              translate var(--d-micro) linear;
}
.btn-sm { height: 40px; padding: 0 18px; font-size: var(--fs-utility); }
.btn-primary {
  background: var(--violet-700); color: var(--text-on-violet);
  box-shadow: inset 0 0 0 1px rgba(229, 228, 226, 0.25);
}
.btn-primary:hover { box-shadow: var(--glow-md), inset 0 0 0 1px rgba(229,228,226,0.25); }
.btn-primary:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.btn-ghost {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: rgba(229, 228, 226, 0.06); }

/* --- Формы ------------------------------------------------------------- */
.input {
  height: 48px; padding: 0 var(--s-4); border-radius: var(--r-sm);
  background: var(--xsl-surface-2); color: var(--text-primary);
  border: 1px solid var(--line); font-family: var(--font-body); font-size: var(--fs-body);
  transition: border-color var(--d-micro) var(--ease-out);
}
.input::placeholder { color: var(--text-muted); }
.input:focus { outline: none; border-color: var(--violet-600); }
.done-form { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.done-form .input { flex: 1; min-width: 180px; }
.done-log { margin-top: var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); }
.done-row { display: flex; gap: var(--s-4); }
.done-amt { color: var(--violet-300); }

/* --- Логин --------------------------------------------------------------- */
.login-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--s-5);
  padding: var(--s-5); position: relative; z-index: 1;
}
.login-logo { width: 180px; height: 180px; object-fit: cover; box-shadow: 0 0 0 1px var(--line), var(--glow-sm); }
.login-form { display: flex; flex-direction: column; gap: var(--s-4); width: 100%; max-width: 360px; }
.login-error { color: var(--violet-400); font-size: var(--fs-small); }
.login-footer { margin-top: var(--s-6); }

/* --- Футер ----------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding: var(--s-6) 0; margin-top: var(--s-9); }
.footer-inner { display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }

/* --- Доступность / движение ------------------------------------------------- */
:focus-visible { outline: 2px solid var(--violet-500); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-load { animation: none; }
  .progress-fill { transition: none; }
}

/* --- Адаптив ----------------------------------------------------------------- */
@media (max-width: 900px) {
  .status-strip { justify-content: flex-start; }
  .ss-item { padding: var(--s-4) var(--s-5); }
}
@media (max-width: 768px) {
  .hero { padding: var(--s-8) 0 var(--s-6); }
  .card-rail { flex-basis: 12px; }
  .nav-inner { padding-block: var(--s-3); }
}

/* --- Максимум: корона, отсчёт, метки дней, стекло по скроллу --- */
.hero-crown {
  font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1;
  background: var(--metal-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: var(--s-4);
}
.reveal-crown { animation: crown-in var(--d-cine) var(--ease-out) both; }
@keyframes crown-in {
  from { opacity: 0; transform: scale(1.06); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}
/* металл на экране один (§6): корона металл, сумма — платина с фаской-тенью */
.hero-amount.metal {
  background: none; color: var(--text-primary);
  text-shadow: 0 1px 0 rgba(255,255,255,0.18), 0 -1px 0 rgba(0,0,0,0.6);
}
.hero-count { color: var(--violet-300); }

.rail-track { position: relative; }
.rail-days { position: absolute; inset: 0; pointer-events: none; }
.rail-days .tick {
  position: absolute; top: 2px; bottom: 2px; width: 1px;
  background: rgba(229,228,226,0.18); pointer-events: auto;
}
.rail-days .tick.past { background: rgba(229,228,226,0.34); }
.rail-days .tick.today {
  width: 3px; background: var(--violet-400);
  box-shadow: var(--glow-sm); top: 0; bottom: 0;
}
.rail-legend { font-size: 0.65rem; opacity: 0.7; }

.nav { background: transparent; backdrop-filter: none; border-bottom-color: transparent;
  transition: background var(--d-ui) var(--ease-out), border-color var(--d-ui) var(--ease-out); }
.nav.scrolled { background: rgba(26,26,26,0.72); backdrop-filter: blur(16px); border-bottom-color: var(--line); }

.section { opacity: 0; transform: translateY(24px); filter: blur(6px);
  transition: opacity var(--d-reveal) var(--ease-out), transform var(--d-reveal) var(--ease-out), filter var(--d-reveal) var(--ease-out); }
.section.in { opacity: 1; transform: none; filter: none; }
@media (prefers-reduced-motion: reduce) { .section { opacity: 1; transform: none; filter: none; transition: none; } }

/* --- Аналитика биржи --- */
.pace { display: flex; align-items: center; gap: var(--s-4); margin-bottom: var(--s-5); flex-wrap: wrap; }
.pace-tag {
  font-family: var(--font-mono); font-size: var(--fs-utility);
  text-transform: uppercase; letter-spacing: var(--tr-utility);
  padding: 6px 14px; border-radius: var(--r-sm); border: 1px solid;
}
.pace-tag.ok { color: var(--violet-300); border-color: var(--violet-600); background: rgba(104,0,255,0.12); box-shadow: var(--glow-sm); }
.pace-tag.warn { color: var(--text-primary); border-color: var(--line-strong); }
.pace-text { color: var(--text-secondary); font-size: var(--fs-small); }

.an-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4); }
.an-card {
  background: var(--xsl-surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--s-5);
  transition: border-color var(--d-ui) var(--ease-out);
}
.an-card:hover { border-color: var(--line-strong); }
.an-label { margin-bottom: var(--s-3); }
.an-big { font-family: "Tinos", var(--font-display); font-weight: 700; font-size: var(--fs-h3); color: var(--text-primary); }
.an-dim { color: var(--text-disabled); }
.an-violet { color: var(--violet-300); }
.an-card canvas { width: 100%; height: 120px; display: block; }

.kw-list { display: flex; flex-direction: column; gap: var(--s-3); }
.kw-row { display: grid; grid-template-columns: 110px 1fr 32px; align-items: center; gap: var(--s-3); }
.kw-name { font-size: var(--fs-small); color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-bar { height: 6px; background: var(--xsl-surface-2); border-radius: var(--r-sm); overflow: hidden; }
.kw-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--violet-800), var(--violet-600)); }
.kw-n { text-align: right; }
@media (max-width: 768px) { .an-grid { grid-template-columns: 1fr; } }
