/* Айсберг Domino Team — палитра спуска: от неба к бездне */

@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;600;800&family=Inter:wght@400;500;600&display=swap');

:root {
  /* цвета глубин задаёт DEPTH_STOPS в common.js — там они привязаны к границам секций */
  --abyss-lo: #010509;

  --ink: #f2f8fd;
  --ink-dim: rgba(242, 248, 253, 0.58);
  --prime: #4ade80;
  --diz: #f4586a;
  --glass: rgba(255, 255, 255, 0.07);
  --stroke: rgba(255, 255, 255, 0.14);
  --head: 'Unbounded', 'Segoe UI', system-ui, sans-serif;
  --body: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  position: relative;
  font-family: var(--body);
  color: var(--ink);
  background: var(--abyss-lo);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }

::selection { background: rgba(120, 200, 255, 0.35); }

/* ── зерно поверх всего ───────────────────────────────────────────────────── */

.grain {
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 6s steps(6) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 1%); }
}

/* ── шапка ────────────────────────────────────────────────────────────────── */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 16px 32px;
  backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(6, 20, 32, 0.55), rgba(6, 20, 32, 0));
  transition: background 0.5s;
}

.topbar.light {
  background: linear-gradient(to bottom, rgba(228, 242, 252, 0.6), rgba(228, 242, 252, 0));
  color: #0d2740;
}

.brand {
  font-family: var(--head);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand span { opacity: 0.5; font-weight: 400; }

.topbar nav {
  display: flex;
  gap: 22px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-left: auto;
}

.topbar nav a { opacity: 0.65; transition: opacity 0.2s; }
.topbar nav a:hover, .topbar nav a.on { opacity: 1; }

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding-left: 22px;
  border-left: 1px solid currentColor;
  border-color: rgba(255, 255, 255, 0.16);
}

.who b { font-weight: 600; }
.who a { opacity: 0.5; font-size: 12px; }
.who a:hover { opacity: 1; }

/* ── сцена с айсбергом ────────────────────────────────────────────────────── */

.scene {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
}

.scene svg {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 60px rgba(150, 215, 250, 0.15));
}

.rays {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(190deg, rgba(255, 255, 255, 0.35) 0%, transparent 45%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.2) 0%, transparent 40%);
  mix-blend-mode: overlay;
  opacity: var(--ray-opacity, 1);
  transition: opacity 0.4s;
}

.bubbles { position: fixed; inset: 0; z-index: 2; pointer-events: none; }

/* ── уровни ───────────────────────────────────────────────────────────────── */

main { position: relative; z-index: 10; }

.level {
  position: relative;
  padding: 120px clamp(20px, 6vw, 90px) 140px;
  min-height: 92vh;
}

/* фон уровней рисует один сквозной градиент на body — так айсберг проходит сквозь них */
.level[data-level="1"] { color: #0d2740; }
.level[data-level="2"] { color: #0b2338; }
.level[data-level="6"] { padding-bottom: 220px; }

/* ватерлиния между «верхушкой» и «гладью» */
.level[data-level="3"]::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(226, 248, 255, 0.95), transparent);
  box-shadow: 0 0 30px 6px rgba(180, 235, 255, 0.5);
}

.level[data-level="3"]::after {
  content: '';
  position: absolute;
  top: 3px; left: 0; right: 0;
  height: 90px;
  background: repeating-linear-gradient(
    to bottom, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 7px
  );
  opacity: 0.6;
  animation: ripple 7s linear infinite;
}

@keyframes ripple {
  from { background-position-y: 0; }
  to { background-position-y: 32px; }
}

.level-head {
  max-width: 1400px;
  margin: 0 auto 54px;
  display: flex;
  align-items: baseline;
  gap: 22px;
  flex-wrap: wrap;
}

.level-num {
  font-family: var(--head);
  font-size: clamp(56px, 11vw, 150px);
  font-weight: 800;
  line-height: 0.8;
  opacity: 0.13;
  letter-spacing: -0.04em;
}

.level-title {
  font-family: var(--head);
  font-size: clamp(24px, 3.6vw, 46px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.level-hint {
  font-size: 14px;
  opacity: 0.55;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

.level-count {
  margin-left: auto;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.4;
}

/* чем глубже — тем глуше */
.level[data-level="5"] .cards { filter: saturate(0.85); }
.level[data-level="6"] .cards { filter: saturate(0.6) brightness(0.92); }

/* ── карточки ─────────────────────────────────────────────────────────────── */

.cards {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: var(--glass);
  backdrop-filter: blur(10px);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s, border-color 0.35s;
  opacity: 0;
  transform: translateY(26px);
}

.card.in { opacity: 1; transform: none; }

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(160, 225, 255, 0.5);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.4), 0 0 40px rgba(120, 200, 255, 0.12);
}

.level[data-level="1"] .card,
.level[data-level="2"] .card {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(13, 39, 64, 0.12);
}

.level[data-level="1"] .card:hover,
.level[data-level="2"] .card:hover { box-shadow: 0 22px 50px rgba(20, 60, 90, 0.22); }

.card-media {
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
  position: relative;
}

.card-media img, .card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s;
}

.card:hover .card-media img { transform: scale(1.05); }

.card-media .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 34px;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.card-body { padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.card h3 {
  font-family: var(--head);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.01em;
}

.card p {
  font-size: 14px;
  line-height: 1.55;
  opacity: 0.66;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  opacity: 0.5;
  border-top: 1px solid var(--stroke);
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  opacity: 0.85;
  transition: background 0.2s, opacity 0.2s;
}

.tag:hover { background: rgba(160, 225, 255, 0.2); opacity: 1; }

.hidden-mark {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 3;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(244, 88, 106, 0.85);
  color: #fff;
}

/* ── прайм / диз ──────────────────────────────────────────────────────────── */

.votes { display: flex; gap: 8px; margin-left: auto; }

.vote {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.vote:hover { transform: translateY(-1px); }
.vote.prime:hover, .vote.prime.on { border-color: var(--prime); color: var(--prime); background: rgba(74, 222, 128, 0.14); }
.vote.diz:hover, .vote.diz.on { border-color: var(--diz); color: var(--diz); background: rgba(244, 88, 106, 0.14); }
.vote.big { padding: 11px 22px; font-size: 13px; }

/* ── навигация по глубине ─────────────────────────────────────────────────── */

.depth {
  position: fixed;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.depth a {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  padding: 7px 0;
  opacity: 0.35;
  transition: opacity 0.25s;
}

.depth a::after {
  content: '';
  width: 26px;
  height: 2px;
  background: currentColor;
  transition: width 0.25s;
}

.depth a:hover, .depth a.on { opacity: 1; }
.depth a.on::after { width: 46px; }
.depth a span { opacity: 0; transform: translateX(6px); transition: all 0.25s; white-space: nowrap; }
.depth a:hover span, .depth a.on span { opacity: 1; transform: none; }

/* ── общие блоки страниц ──────────────────────────────────────────────────── */

.page {
  position: relative;
  z-index: 10;
  max-width: 980px;
  margin: 0 auto;
  padding: 130px 24px 120px;
  min-height: 100vh;
}

.page.wide { max-width: 1400px; }

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, #0a2c44, #04121e 55%, #01060b);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 34px;
  transition: opacity 0.2s, gap 0.2s;
}

.back:hover { opacity: 1; gap: 12px; }

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--glass);
}

.level-badge i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
  font-style: normal;
}

h1.title {
  font-family: var(--head);
  font-size: clamp(30px, 5vw, 56px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 18px 0 14px;
}

.subtitle { font-size: 17px; line-height: 1.6; opacity: 0.62; max-width: 70ch; }

.byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  opacity: 0.5;
  margin: 26px 0;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--stroke);
}

.prose { font-size: 17px; line-height: 1.75; opacity: 0.9; white-space: pre-wrap; margin: 30px 0; }

.media-stack { display: flex; flex-direction: column; gap: 18px; margin: 34px 0; }

.media-stack img, .media-stack video, .media-stack iframe {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  display: block;
  background: #000;
}

.media-stack iframe { aspect-ratio: 16 / 9; }

.section-title {
  font-family: var(--head);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.45;
  margin: 46px 0 20px;
}

/* ── личности ─────────────────────────────────────────────────────────────── */

.dossier {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 32px;
  border-radius: 24px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  backdrop-filter: blur(12px);
}

.avatar {
  width: 128px; height: 128px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.avatar.ph {
  display: grid;
  place-items: center;
  font-family: var(--head);
  font-size: 44px;
  font-weight: 600;
  opacity: 0.5;
}

.dossier-main { flex: 1; min-width: 260px; }
.dossier-main h1 { font-family: var(--head); font-size: clamp(26px, 4vw, 42px); font-weight: 600; letter-spacing: -0.02em; }
.dossier-role { font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.45; margin-top: 6px; }
.dossier-bio { margin-top: 16px; line-height: 1.65; opacity: 0.78; white-space: pre-wrap; }

.facts { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 22px; }
.fact { font-size: 13px; }
.fact b { display: block; font-family: var(--head); font-size: 22px; font-weight: 600; }
.fact span { opacity: 0.45; letter-spacing: 0.08em; text-transform: uppercase; font-size: 11px; }

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

.person-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  transition: transform 0.3s, border-color 0.3s, background 0.3s;
}

.person-card:hover { transform: translateY(-4px); border-color: rgba(160, 225, 255, 0.45); }
.person-card .avatar { width: 60px; height: 60px; border-radius: 14px; font-size: 22px; }
.person-card h3 { font-family: var(--head); font-size: 16px; font-weight: 600; }
.person-card small { display: block; opacity: 0.45; font-size: 12px; margin-top: 4px; }

/* ── формы ────────────────────────────────────────────────────────────────── */

.form { display: flex; flex-direction: column; gap: 22px; }

.field label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 9px;
}

.field input[type=text], .field input[type=password], .field textarea, .field select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 13px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.field input:focus, .field textarea:focus, .field select:focus {
  border-color: rgba(160, 225, 255, 0.6);
  background: rgba(255, 255, 255, 0.09);
}

.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field select option { background: #0b2438; }
.hint { font-size: 12px; opacity: 0.4; margin-top: 8px; line-height: 1.5; }

.levels-pick { display: grid; gap: 10px; }

.levels-pick label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.2s;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
  opacity: 1;
}

.levels-pick label:hover { background: rgba(255, 255, 255, 0.08); }
.levels-pick input { accent-color: #7fd4ff; }
.levels-pick label.on { border-color: rgba(160, 225, 255, 0.7); background: rgba(120, 200, 255, 0.14); }
.levels-pick .lp-name { font-family: var(--head); font-weight: 600; font-size: 15px; }
.levels-pick .lp-hint { font-size: 12px; opacity: 0.45; margin-left: auto; }
.levels-pick .lp-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 14px currentColor; }

.btn {
  align-self: flex-start;
  padding: 15px 34px;
  border-radius: 999px;
  border: 1px solid rgba(160, 225, 255, 0.5);
  background: rgba(120, 200, 255, 0.15);
  font-family: var(--head);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s;
}

.btn:hover { background: rgba(120, 200, 255, 0.3); box-shadow: 0 0 30px rgba(120, 200, 255, 0.25); }
.btn:disabled { opacity: 0.45; cursor: wait; }
.btn.ghost { background: none; border-color: var(--stroke); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.07); box-shadow: none; }
.btn.danger { border-color: rgba(244, 88, 106, 0.5); background: rgba(244, 88, 106, 0.12); }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.drop {
  border: 1px dashed var(--stroke);
  border-radius: 16px;
  padding: 34px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
}

.drop:hover, .drop.over { border-color: rgba(160, 225, 255, 0.7); background: rgba(120, 200, 255, 0.08); }
.drop b { display: block; font-family: var(--head); font-size: 15px; margin-bottom: 6px; }
.drop small { opacity: 0.45; font-size: 12px; }

.previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.previews div {
  position: relative;
  width: 108px; height: 76px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--stroke);
}
.previews img, .previews video { width: 100%; height: 100%; object-fit: cover; }
.previews button {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  font-size: 13px;
}

.msg { font-size: 14px; padding: 12px 16px; border-radius: 12px; }
.msg.err { background: rgba(244, 88, 106, 0.16); border: 1px solid rgba(244, 88, 106, 0.4); }
.msg.ok { background: rgba(74, 222, 128, 0.14); border: 1px solid rgba(74, 222, 128, 0.35); }

/* ── вход ─────────────────────────────────────────────────────────────────── */

.login-wrap {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
}

.login-card {
  width: min(420px, 100%);
  padding: 44px 38px;
  border-radius: 26px;
  border: 1px solid var(--stroke);
  background: rgba(8, 24, 38, 0.6);
  backdrop-filter: blur(22px);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.login-card .brand { font-size: 13px; opacity: 0.55; }
.login-card h1 {
  font-family: var(--head);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 16px 0 10px;
}
.login-card > p { font-size: 14px; opacity: 0.5; line-height: 1.6; margin-bottom: 30px; }
.login-card .form { text-align: left; }
.login-card .btn { align-self: stretch; text-align: center; }

/* ── прочее ───────────────────────────────────────────────────────────────── */

.empty {
  max-width: 1400px;
  margin: 0 auto;
  padding: 44px;
  border-radius: 20px;
  border: 1px dashed var(--stroke);
  text-align: center;
  font-size: 14px;
  opacity: 0.4;
}

.deep-end {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 0 24px 120px;
  background: var(--abyss-lo);
  color: rgba(255, 255, 255, 0.22);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.loader {
  text-align: center;
  padding: 160px 20px;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.4;
}

@media (max-width: 720px) {
  .topbar { padding: 12px 18px; gap: 14px; flex-wrap: wrap; }
  .topbar nav { gap: 14px; font-size: 11px; }
  .who { padding-left: 12px; font-size: 12px; }
  .depth { display: none; }
  .level { padding: 90px 18px 100px; }
  .dossier { padding: 22px; gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
