/* Berg Groups — белый премиум-минимализм.
   Мотив: «≡» — три полосы из E в логотипе BERG. */

:root {
  --bg:      #ffffff;
  --bg-2:    #fafafa;
  --bg-3:    #f5f5f7;
  --bg-4:    #ededf0;
  --ink:     #111113;      /* чёрные блоки-якоря */
  --ink-2:   #1c1c1f;
  --text:    #1d1d1f;
  --muted:   #6e6e73;
  --muted-2: #a1a1a6;
  --line:    rgba(0,0,0,0.08);
  --radius:  18px;
  --radius-lg: 28px;
  --nav-h:   52px;
  --accent:  #0066cc;
  --shadow-soft: 0 2px 10px rgba(0,0,0,0.04);
  --shadow-lift: 0 18px 44px rgba(0,0,0,0.12);
  --font-display: 'Unbounded', -apple-system, "Helvetica Neue", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Inter, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.47059;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

nav, main, footer { position: relative; z-index: 2; }

a { color: inherit; text-decoration: none; }
.link { color: var(--accent); font-weight: 500; }
.link:hover { text-decoration: underline; }
.mono { font-family: 'JetBrains Mono', monospace; }
.muted { color: var(--muted); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Прелоадер: три полосы «E» ── */

#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s cubic-bezier(.22,1,.36,1), visibility 0.6s;
}
#preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.pl-mark { display: flex; flex-direction: column; gap: 7px; width: 56px; }
.pl-mark span {
  height: 7px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}
#preloader.go .pl-mark span { animation: plBar 0.5s cubic-bezier(.22,1,.36,1) forwards; }
#preloader.go .pl-mark span:nth-child(2) { animation-delay: 0.12s; }
#preloader.go .pl-mark span:nth-child(3) { animation-delay: 0.24s; }
@keyframes plBar { to { transform: scaleX(1); } }

/* ── Навигация ── */

.site-nav-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-dim {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.22em;
  color: var(--muted);
}
.brand-logo { height: 14px; width: auto; display: block; }

.nav-links { display: flex; align-items: center; gap: 26px; }

.nav-link {
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--muted);
  transition: color 0.2s;
  line-height: 1;
  position: relative;
  padding: 6px 0;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); font-weight: 600; }
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ── Каркас вьюх ── */

.view {
  max-width: 1120px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 48px) 24px 96px;
  flex: 1;
}

/* ── Eyebrow ── */

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text);
  flex-shrink: 0;
  animation: dotPulse 2.2s ease-in-out infinite;
}
@keyframes dotPulse {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.2; }
}

/* ── Герой ── */

.hero { padding: 72px 0 40px; }

.hero-logo {
  width: min(760px, 94vw);
  height: auto;
  display: block;
  animation: logoReveal 1.1s cubic-bezier(.22,1,.36,1) 0.15s backwards;
}
@keyframes logoReveal {
  from { clip-path: inset(0 100% 0 0); opacity: 0.4; }
  to   { clip-path: inset(0 0 0 0); opacity: 1; }
}

.hero-title { margin-bottom: 26px; }

.hero-title-sub {
  font-family: var(--font-display);
  font-size: clamp(19px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 300;
  color: var(--muted-2);
  margin-bottom: 26px;
}

.hero-sub {
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--muted);
  max-width: 520px;
  line-height: 1.65;
}

/* ступенчатое появление вкладок */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.view:not([hidden]) .hero > *,
.view:not([hidden]) .page-head > * {
  animation: fadeUp 0.65s cubic-bezier(.22,1,.36,1) backwards;
}
.view:not([hidden]) .hero > :nth-child(2),
.view:not([hidden]) .page-head > :nth-child(2) { animation-delay: 0.12s; }
.view:not([hidden]) .hero > :nth-child(3),
.view:not([hidden]) .page-head > :nth-child(3) { animation-delay: 0.24s; }
.view:not([hidden]) .hero > :nth-child(4) { animation-delay: 0.34s; }
/* у логотипа своя анимация раскрытия */
.view:not([hidden]) .hero > .hero-title { animation: none; }

.view:not([hidden]) .feed-item,
.view:not([hidden]) .card,
.view:not([hidden]) .stage,
.view:not([hidden]) .token-card {
  animation: fadeUp 0.55s cubic-bezier(.22,1,.36,1) backwards;
}
.view:not([hidden]) :is(.feed-item, .card, .stage):nth-child(2) { animation-delay: 0.08s; }
.view:not([hidden]) :is(.feed-item, .card, .stage):nth-child(3) { animation-delay: 0.16s; }
.view:not([hidden]) :is(.feed-item, .card, .stage):nth-child(4) { animation-delay: 0.24s; }
.view:not([hidden]) :is(.feed-item, .card, .stage):nth-child(n+5) { animation-delay: 0.3s; }
.view:not([hidden]) .token-card { animation-delay: 0.2s; }

/* ── Тикер ── */

.ticker {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
  margin: 40px 0 64px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.ticker-inner {
  display: flex;
  gap: 0;
  width: max-content;
  animation: tick 30s linear infinite;
}
.ticker:hover .ticker-inner { animation-play-state: paused; }
.ticker-inner span {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  display: flex;
  align-items: center;
}
/* разделитель «≡» между пунктами */
.ticker-inner span::after {
  content: '';
  width: 15px;
  height: 11px;
  margin: 0 28px;
  background: repeating-linear-gradient(to bottom, var(--muted-2) 0 2px, transparent 2px 4.5px);
}
@keyframes tick { to { transform: translateX(-50%); } }

/* ── Заголовки секций ── */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 8px;
  margin-bottom: 26px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-head h2::before {
  content: '';
  width: 15px;
  height: 11px;
  flex-shrink: 0;
  background: repeating-linear-gradient(to bottom, var(--text) 0 2px, transparent 2px 4.5px);
}
.section-head .mono { font-size: 12px; }

/* ── Лента ── */

.feed-list { display: grid; gap: 16px; }

.feed-item {
  display: block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s;
}
.feed-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: transparent;
}

.feed-item .meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.tag {
  color: var(--text);
  border: 1px solid rgba(0,0,0,0.22);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.feed-item h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 8px;
}
.feed-item p { color: var(--muted); font-size: 14.5px; max-width: 72ch; }

/* первая новость — крупная карточка */
.feed-item.featured {
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  background: var(--bg);
  box-shadow: 0 8px 28px rgba(0,0,0,0.08);
}
.feed-item.featured h3 { font-size: clamp(22px, 3vw, 32px); }
.feed-item.featured p { font-size: 15.5px; }
.feed-item.featured:hover { box-shadow: var(--shadow-lift); }

/* ── Статья ── */

.post { max-width: 700px; margin: 16px auto 0; }

.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 36px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--text); }

.post-meta { color: var(--muted); font-size: 12px; margin-bottom: 16px; }

.post h1 {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 28px;
}

.post-body p { margin-bottom: 16px; color: #3a3a3c; }
.post-body h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  margin: 34px 0 14px;
}
.post-body a { color: var(--accent); }
.post-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  margin: 22px 0;
}
.post-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  word-break: break-all;
}

/* ── Страницы ── */

.page-head { padding: 56px 0 48px; max-width: 760px; }
.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 6.5vw, 68px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 26px;
}
.page-h1-logo { margin-bottom: 26px; }
.page-logo {
  width: min(520px, 84vw);
  height: auto;
  display: block;
}

/* ── MetaParcel ── */

.section-intro {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.65;
  max-width: 660px;
  margin-bottom: 30px;
}

.mp-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 26px; }

.btn-row-links { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 64px; font-size: 14px; }

/* рельса прогресса */
.t-rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  position: relative;
  margin-bottom: 18px;
  height: 9px;
}
.t-rail::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--line);
}
.t-node {
  position: relative;
  justify-self: center;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--muted-2);
  background: var(--bg);
}
.t-node.done { background: var(--muted-2); }
.t-node.now {
  border-color: var(--text);
  background: var(--text);
  box-shadow: 0 0 0 5px rgba(0,0,0,0.07);
  animation: dotPulse 2.2s ease-in-out infinite;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stage {
  background: var(--bg-3);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 28px 26px;
}
.stage-mark {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 14px;
}
.stage h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 10px;
}
.stage p { color: var(--muted); font-size: 14px; }

.stage-done { opacity: 0.65; }
.stage-now {
  background: var(--bg);
  border-color: var(--line);
  box-shadow: var(--shadow-lift);
}
.stage-now .stage-mark { color: var(--text); font-weight: 600; }

/* ── О нас ── */

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 56px;
}

.card {
  background: var(--bg-3);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}
.card:hover {
  background: var(--bg);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}
.card h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 10px;
}
.card p { color: var(--muted); font-size: 14px; }

.token-card {
  background: var(--bg-3);
  border-radius: var(--radius-lg);
  padding: 38px 36px;
}

.token-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.token-head h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.chain-badge {
  font-size: 11px;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 999px;
  padding: 4px 12px;
  color: var(--muted);
}

.token-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.token-facts dt {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 4px;
}
.token-facts dd { font-weight: 600; font-size: 15px; }

.contract-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
}
.contract-row code { font-size: 13px; word-break: break-all; color: var(--text); flex: 1; min-width: 200px; }
.contract-row + .contract-row { margin-top: -6px; }
.contract-row .net-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 7px;
  flex-shrink: 0;
}
.token-card .btn-row-links { margin-top: 18px; }

.copy-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.copy-btn:hover { opacity: 0.85; }

/* ── Токен BERG ── */

.token-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 56px;
}
.stat {
  border-top: 2px solid var(--text);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.net-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 56px;
}
.net-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  box-shadow: var(--shadow-soft);
}
.net-card .token-head { margin-bottom: 14px; }
.net-card .token-head h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.net-card > p { color: var(--muted); font-size: 14.5px; margin-bottom: 20px; }
.net-card .contract-row { background: var(--bg-3); border: none; }
.view:not([hidden]) .net-card,
.view:not([hidden]) .stat {
  animation: fadeUp 0.55s cubic-bezier(.22,1,.36,1) backwards;
}
.view:not([hidden]) :is(.net-card, .stat):nth-child(2) { animation-delay: 0.08s; }
.view:not([hidden]) .stat:nth-child(3) { animation-delay: 0.16s; }

@media (max-width: 860px) {
  .net-grid, .token-stats { grid-template-columns: 1fr; }
}

/* ── Футер ── */

.site-footer {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

/* ── Адаптив / доступность ── */

@media (max-width: 1000px) { .mp-grid { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 860px) {
  .timeline, .about-grid { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 24px; }
  .t-rail { display: none; }
  .ticker { margin: 28px 0 48px; }
}

@media (max-width: 560px) {
  .view { padding: calc(var(--nav-h) + 28px) 18px 64px; }
  .feed-item { padding: 22px 20px; }
  .feed-item.featured { padding: 28px 24px; }
  .mp-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 16px; }
  .token-card { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .eyebrow-dot, .t-node.now { animation: none; }
  .ticker-inner { animation: none; }
  .feed-item, .feed-item:hover, .card, .card:hover { transform: none; }
  #preloader { display: none; }
  .hero-logo { animation: none; }
  .view:not([hidden]) :is(.hero > *, .page-head > *, .feed-item, .card, .stage, .token-card, .net-card, .stat) {
    animation: none;
  }
}
