:root {
  --bg-deep: #0f241c;
  --bg-mid: #1a3a2e;
  --bg-soft: #e8efe9;
  --surface: #f7faf7;
  --card: #ffffff;
  --ink: #142018;
  --ink-muted: #5a6b60;
  --line: rgba(20, 32, 24, 0.12);
  --brand: #1f6b4a;
  --brand-deep: #145239;
  --accent: #c45c26;
  --focus: #2a8f64;
  --shadow: 0 10px 28px rgba(15, 36, 28, 0.1);
  --radius: 14px;
  --font: "Manrope", sans-serif;
  --display: "Syne", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(42, 143, 100, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(196, 92, 38, 0.12), transparent 50%),
    linear-gradient(165deg, #dfeae3 0%, var(--bg-soft) 45%, #d5e2d9 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(20, 32, 24, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 32, 24, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 90%);
}

.page {
  position: relative;
  width: min(1440px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
  animation: page-in 0.7s ease-out both;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  padding: 1.25rem 1.5rem;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 247, 0.75));
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.logo {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 20px rgba(31, 107, 74, 0.35);
  animation: logo-pulse 3.2s ease-in-out infinite;
}

@keyframes logo-pulse {
  0%,
  100% {
    box-shadow: 0 8px 20px rgba(31, 107, 74, 0.35);
  }
  50% {
    box-shadow: 0 10px 28px rgba(31, 107, 74, 0.5);
  }
}

.brand-name {
  margin: 0 0 0.15rem;
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
}

.brand-text h1 {
  margin: 0;
  max-width: none;
  white-space: nowrap;
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.8vw, 1.45rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.header-focus {
  margin: 0;
  max-width: none;
  text-align: right;
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}

.map {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  grid-template-rows: auto auto auto;
  gap: 0.85rem 1.5rem;
  padding: 1rem 1rem 1.25rem 1.5rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
  overflow: visible;
}

.rail {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--bg-mid), var(--bg-deep));
  color: #e7f3ec;
}

.rail-control {
  grid-column: 1;
  grid-row: 1;
}

.rail-value {
  grid-column: 1;
  grid-row: 2;
  background: linear-gradient(180deg, #245a8a, #1a3f63);
}

.rail-support {
  grid-column: 1;
  grid-row: 3;
}

.rail-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.value-group {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

.value-group .band {
  grid-column: auto;
  margin: 0;
  grid-template-columns: 52px 1fr;
  gap: 0.65rem;
  padding: 0.45rem 0.5rem 0.45rem 0.25rem;
  align-items: stretch;
}

.band {
  grid-column: 2;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0.85rem;
  align-items: stretch;
  padding: 0.85rem 0.85rem 0.95rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  animation: band-in 0.55s ease-out both;
  overflow: visible;
}

.band-control,
.band-support {
  grid-template-columns: 1fr;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.band-control {
  grid-row: 1;
  animation-delay: 0.05s;
}

.band-strategy { animation-delay: 0.12s; }
.band-ops { animation-delay: 0.19s; }

.band-support {
  grid-row: 3;
  animation-delay: 0.26s;
}

@keyframes band-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.value-group .card {
  min-height: 78px;
  padding: 0.55rem 0.65rem 0.6rem;
}

.band-strategy .card {
  min-height: 103px;
}

.value-group .card h3 {
  margin-bottom: 0.25rem;
  font-size: 0.76rem;
}

.value-group .card .role {
  font-size: 0.68rem;
}

.band-title-slot {
  position: relative;
  width: 52px;
  min-height: 0;
  align-self: stretch;
}

.band-title {
  margin: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--brand-deep);
}

/* Одинаковый шрифт у обеих вертикальных подписей */
.value-group .band-title.band-title--vertical {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0.4rem 0.2rem;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(36, 90, 138, 0.14), rgba(36, 90, 138, 0.06));
  border: 1px solid rgba(36, 90, 138, 0.2);
  color: #1a3f63;
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 700;
  font-style: normal;
  line-height: 1.25;
  letter-spacing: 0.05em;
  text-transform: none;
  text-align: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  overflow: hidden;
  white-space: normal;
}

.band-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: stretch;
  width: 100%;
}

.band-cards--ops .card {
  flex: 1 1 calc(16.66% - 0.65rem);
  min-width: 140px;
}

.band-support-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  padding: 0.65rem;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(31, 107, 74, 0.06), rgba(31, 107, 74, 0.02));
  border: 1px solid rgba(31, 107, 74, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.band-cards--support {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
}

.card {
  position: relative;
  flex: 1 1 180px;
  min-width: 150px;
  min-height: 108px;
  padding: 0.85rem 0.9rem 1rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid rgba(20, 32, 24, 0.08);
  box-shadow: 0 4px 14px rgba(15, 36, 28, 0.06);
  cursor: default;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.band-cards--support > .card {
  flex: unset;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 118px;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(31, 107, 74, 0.35);
  box-shadow: 0 14px 28px rgba(15, 36, 28, 0.14);
  z-index: 3;
  outline: none;
}

.card--focus {
  border-color: rgba(42, 143, 100, 0.45);
  background:
    linear-gradient(180deg, #ffffff 0%, #f0faf4 100%);
  box-shadow: 0 6px 18px rgba(31, 107, 74, 0.12);
}

/* Холдинг: замороженные блоки без tooltip и hover */
.card--holding {
  background: linear-gradient(180deg, #e9ece8 0%, #dde3de 100%);
  border-color: rgba(20, 32, 24, 0.1);
  box-shadow: none;
  color: #4a564e;
  cursor: default;
  pointer-events: none;
  opacity: 0.92;
}

.card--holding .code {
  color: #6a7a70;
}

.card--holding .role {
  color: #7a877f;
}

.card--holding:hover,
.card--holding:focus-visible {
  transform: none;
  border-color: rgba(20, 32, 24, 0.1);
  box-shadow: none;
}

.card--holding::before,
.card--holding::after {
  content: none !important;
  display: none !important;
}

.card h3 {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.card .code {
  color: var(--brand);
  font-weight: 800;
}

.card .role {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-muted);
}

/* Всплывающая подсказка */
.tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  z-index: 40;
  width: min(280px, 72vw);
  padding: 0.85rem 0.9rem 0.95rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(20, 32, 24, 0.12);
  box-shadow: 0 16px 36px rgba(15, 36, 28, 0.18);
  color: var(--ink);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
}

/* Клювик вниз — на карточку */
.tip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-top-color: #fff;
  filter: drop-shadow(0 2px 1px rgba(15, 36, 28, 0.08));
}

.tip::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 10px solid transparent;
  border-top-color: rgba(20, 32, 24, 0.12);
  margin-top: 0;
}

.card:hover .tip,
.card:focus-visible .tip,
.card:focus-within .tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.tip__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(20, 32, 24, 0.08);
}

.tip__photo {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background:
    linear-gradient(145deg, #d7e4dc, #eef3ef);
  border: 2px dashed rgba(31, 107, 74, 0.35);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.tip__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tip__name {
  margin: 0;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.tip__title {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-deep);
}

.tip__list {
  margin: 0;
  padding: 0 0 0 1.05rem;
  display: grid;
  gap: 0.28rem;
}

.tip__list li {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-muted);
}

.band-cards,
.band-support-group,
.value-group {
  overflow: visible;
}

.card:hover,
.card:focus-visible,
.card:focus-within {
  z-index: 30;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 0 0.35rem;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.admin-link {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-deep);
  text-decoration: none;
  white-space: nowrap;
}

.admin-link:hover {
  text-decoration: underline;
}

.card--clickable {
  cursor: pointer;
}

@media (max-width: 1100px) {
  .band-cards--support {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .band {
    grid-template-columns: 120px 1fr;
  }
}

@media (max-width: 800px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-focus {
    text-align: left;
    max-width: none;
  }

  .map {
    grid-template-columns: 1fr;
    padding: 0.85rem;
  }

  .rail {
    min-height: 42px;
    border-radius: 12px;
  }

  .rail-value,
  .rail-support,
  .rail-control {
    grid-column: 1;
    grid-row: auto;
  }

  .value-group,
  .band-control,
  .band-support {
    grid-column: 1;
    grid-row: auto;
  }

  .rail-label {
    writing-mode: horizontal-tb;
    transform: none;
    letter-spacing: 0.08em;
  }

  .band {
    grid-column: 1;
    grid-template-columns: 1fr;
  }

  .value-group .band {
    grid-template-columns: 1fr;
  }

  .band-title-slot {
    width: auto;
    min-height: 36px;
  }

  .value-group .band-title.band-title--vertical {
    position: relative;
    inset: auto;
    width: auto;
    height: auto;
    writing-mode: horizontal-tb;
    transform: none;
    letter-spacing: 0.05em;
    padding: 0.45rem 0.7rem;
    font-size: 0.7rem;
    overflow: visible;
  }

  .band-cards--ops .card,
  .band-cards .card {
    flex: 1 1 100%;
  }

  .band-cards--support {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
