/* Главная страница — спокойный редакционный минимализм в палитре проекта */
@import url("assets/brand/palette.css");

:root {
  --ink: var(--dc-ink);
  --ink-soft: var(--dc-ink-soft);
  --muted: var(--dc-muted);
  --line: var(--dc-line);
  --line-strong: var(--dc-line-strong);
  --surface: var(--dc-surface);
  --surface-alt: var(--dc-surface-alt);
  --page: var(--dc-page);
  --accent: var(--dc-lab);
  --accent-dark: var(--dc-lab-dark);
  --accent-soft: var(--dc-lab-soft);
  --accent-line: var(--dc-lab-line);
  --teal: var(--dc-club);
  --teal-dark: var(--dc-club-dark);
  --teal-soft: var(--dc-club-soft);
  --teal-line: var(--dc-club-line);
  --rose: var(--dc-rose);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; min-width: 320px; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse 75% 420px at 50% -40px, rgba(11, 132, 139, 0.058), transparent 72%),
    var(--page);
  font: 15px/1.6 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
button, select { font: inherit; }
a:focus-visible, button:focus-visible, select:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 255, 0.82);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand-mark {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 550;
  color: var(--ink-soft);
  transition: color 0.16s ease;
}
.nav a:hover { color: var(--ink); }
.nav a.nav-lang {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}
.nav a.nav-lang:hover {
  color: var(--accent);
  border-color: #c7bcf4;
  background: var(--accent-soft);
}

/* Hero */
.hero {
  padding: 82px 0 44px;
}
.kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(32px, 4.6vw, 50px);
  line-height: 1.1;
  letter-spacing: -0.032em;
  font-weight: 750;
  color: var(--ink);
  max-width: 19ch;
}
.hero-lead {
  margin: 0 0 32px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 56ch;
  font-weight: 400;
}
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.14s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--ink);
  color: #ffffff;
  border: 1px solid var(--ink);
}
.btn-primary:hover {
  background: #2b375c;
  border-color: #2b375c;
}
.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-outline:hover {
  border-color: #b7c2da;
  background: #f6f8fd;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 4px;
  transition: color 0.15s ease;
}
.text-link:hover { color: var(--teal); }
.text-link .arr { transition: transform 0.15s ease; }
.text-link:hover .arr { transform: translateX(3px); }

.hero-meta {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
  color: var(--muted);
}
.hero-meta span.dot { opacity: 0.45; }

/* Minimalist Pair Selector Bar */
.pair-bar-wrap {
  padding: 8px 0 12px;
}
.pair-bar {
  background: var(--surface);
  border: 1px solid var(--accent-line);
  border-radius: 16px;
  padding: 20px 22px 18px;
  box-shadow: 0 14px 36px rgba(26, 35, 64, 0.038);
}
.pair-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.field select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fbfcff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.field select:hover { border-color: #b5c0d8; }
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(104, 79, 208, 0.12);
}
.pair-plus {
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
  user-select: none;
}
.pair-submit {
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.pair-submit:hover { background: var(--accent-dark); }

.pair-sub {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid #f0f2f9;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  font-size: 12.5px;
  color: var(--muted);
}
.presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}
.presets a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  transition: color 0.15s;
}
.presets a:hover { color: var(--accent); }
.random-trigger {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}
.random-trigger:hover { text-decoration: underline; }

/* Sections */
.section {
  padding: 76px 0 0;
}
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.sec-title-group {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.sec-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.sec-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.22;
  letter-spacing: -0.025em;
  font-weight: 700;
}

/* 6 Adaptations — Minimalist Typographic Grid */
.adapt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 32px;
}
.adapt-item {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.18s ease;
}
.adapt-item:hover { border-top-color: var(--ink); }
.adapt-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}
.layer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.layer-dot.survival { background: var(--rose); }
.layer-dot.performing { background: var(--teal); }
.adapt-item h3 {
  margin: 2px 0 0;
  font-size: 17px;
  line-height: 1.28;
  letter-spacing: -0.015em;
  font-weight: 680;
}
.adapt-item p {
  margin: 0;
  font-size: 13.8px;
  line-height: 1.56;
  color: var(--ink-soft);
}
.adapt-links {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12.8px;
  font-weight: 600;
}
.adapt-links a {
  text-decoration: none;
  color: var(--accent);
}
.adapt-links a:hover { text-decoration: underline; }
.adapt-links a.secondary { color: var(--muted); font-weight: 550; }
.adapt-links a.secondary:hover { color: var(--teal); }

/* 6 Library Categories — Editorial Two-Column Index */
.library-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 44px;
}
.lib-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: border-color 0.16s ease;
}
.lib-row:nth-last-child(-n+2) {
  border-bottom: 1px solid var(--line);
}
.lib-row:hover { border-top-color: var(--teal); }
.lib-row h3 {
  margin: 0 0 4px;
  font-size: 16.5px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 660;
  color: var(--ink);
  transition: color 0.15s ease;
}
.lib-row:hover h3 { color: var(--teal-dark); }
.lib-row p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.lib-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.lib-right .arr { transition: transform 0.15s ease, color 0.15s ease; }
.lib-row:hover .lib-right .arr {
  transform: translateX(3px);
  color: var(--teal);
}

/* 3 Starting Paths — Quiet Editorial Columns */
.paths-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 32px;
}
.path-col {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.path-col h3 {
  margin: 0 0 8px;
  font-size: 15.5px;
  font-weight: 680;
  letter-spacing: -0.01em;
}
.path-col p {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.56;
  color: var(--ink-soft);
}
.path-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  font-weight: 600;
}
.path-links a {
  text-decoration: none;
  color: var(--accent);
}
.path-links a:hover { text-decoration: underline; }

/* Footer */
.site-footer {
  margin-top: 88px;
  padding: 28px 0 42px;
  border-top: 1px solid var(--line);
}
.footer-note {
  margin: 0 0 22px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 72ch;
}
.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 13px;
  color: var(--muted);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.footer-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 550;
}
.footer-links a:hover { color: var(--teal); }

/* Responsive */
@media (max-width: 900px) {
  .pair-form {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .pair-plus { display: none; }
  .pair-submit { width: 100%; }
  .adapt-grid, .paths-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-list { grid-template-columns: 1fr; }
  .lib-row:nth-last-child(2) { border-bottom: 0; }
  .lib-row:last-child { border-bottom: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .header-inner { height: 62px; }
  .nav { gap: 16px; }
  .hero { padding: 52px 0 32px; }
  .hero-lead { font-size: 15.5px; }
  .section { padding-top: 56px; }
  .adapt-grid, .paths-row { grid-template-columns: 1fr; gap: 22px; }
  .site-footer { margin-top: 64px; }
}

/* Brand architecture accents (Distinctions Club / Distinctions Lab) */
.nav a.nav-lab {
  color: var(--accent-dark, #533ab8);
  font-weight: 650;
}
.pair-bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid #f0f2f9;
}
.lab-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
}
.lab-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.pair-bar-sub {
  font-size: 12.5px;
  color: var(--muted);
}

.sec-tag {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.sec-tag.lab {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

/* Two-pillar Club & Lab editorial split */
.ecosystem-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 44px;
}
.eco-col {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.eco-col.is-lab {
  border-top-color: var(--accent-line);
}
.eco-role {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.eco-col.is-lab .eco-role { color: var(--accent); }
.eco-col h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
  font-weight: 730;
}
.eco-col p {
  margin: 0;
  font-size: 14px;
  line-height: 1.62;
  color: var(--ink-soft);
}
.eco-links {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 13.5px;
  font-weight: 620;
}
.eco-links a {
  text-decoration: none;
  color: var(--accent);
}
.eco-links a:hover { text-decoration: underline; }
.eco-links a.muted-link { color: var(--ink-soft); font-weight: 550; }
.eco-links a.muted-link:hover { color: var(--ink); }

@media (max-width: 720px) {
  .ecosystem-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* Community / Discourse Editorial Strip */
.community-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 36px;
  flex-wrap: wrap;
}
.community-copy { max-width: 56ch; }
.community-copy h3 {
  margin: 0 0 6px;
  font-size: 19px;
  letter-spacing: -0.02em;
  font-weight: 720;
}
.community-copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.community-domain {
  display: inline-block;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--teal);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.community-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}

/* Split D Brand Identity refinements (Club Teal / Lab Violet) */
.brand-mark { width: 26px; height: 26px; flex-shrink: 0; }
.brand-sub-club { color: var(--teal); }
.kicker { color: var(--teal); }
.eco-col:not(.is-lab) { border-top-color: var(--teal-line); }
.eco-col:not(.is-lab) .eco-role { color: var(--teal); }
.eco-col:not(.is-lab) .eco-links a { color: var(--teal); }
.sec-tag.club {
  color: var(--teal);
  border-color: var(--teal-line);
  background: var(--teal-soft);
}

/* Mobile Portrait (< 520px) & Landscape Phones */
@media (max-width: 520px) {
  .header-inner {
    height: auto;
    padding: 10px 0;
    flex-wrap: wrap;
    gap: 8px;
  }
  .nav {
    width: 100%;
    gap: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
  }
  .nav::-webkit-scrollbar { display: none; }
}

@media (max-height: 540px) and (max-width: 1024px) and (orientation: landscape) {
  .wrap {
    padding-left: max(18px, env(safe-area-inset-left, 0px));
    padding-right: max(18px, env(safe-area-inset-right, 0px));
  }
  .header-inner { height: 52px; }
  .hero { padding: 28px 0 22px; }
}
