.market-carousel {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 3;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  background: #0a1a28;
  box-shadow: 0 8px 28px var(--shadow);
  color: #fff;
}

.market-carousel__track,
.market-slide {
  width: 100%;
  height: 100%;
}

.market-slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .45s ease, visibility .45s ease;
}

.market-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.market-slide__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  transform: scale(1.01);
}

.market-slide__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 15, 26, .96) 0%, rgba(4, 15, 26, .86) 36%, rgba(4, 15, 26, .32) 68%, rgba(4, 15, 26, .08) 100%),
    linear-gradient(0deg, rgba(4, 15, 26, .35), transparent 42%);
}

.market-slide__content {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(64%, 700px);
  height: 100%;
  padding: clamp(1.5rem, 3vw, 2.75rem);
  padding-right: 1rem;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.market-slide__eyebrow {
  margin: 0 0 .55rem;
  color: #58e57a;
  font-size: clamp(.65rem, .8vw, .78rem);
  font-weight: 800;
  letter-spacing: .13em;
}

.market-slide h1,
.market-slide h2 {
  max-width: 680px;
  margin: 0;
  color: #fff;
  font-size: clamp(1.75rem, 2.8vw, 3rem);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.market-slide__lead {
  max-width: 610px;
  margin: .75rem 0 0;
  color: rgba(238, 246, 253, .78);
  font-size: clamp(.84rem, 1.05vw, 1rem);
  line-height: 1.55;
}

.market-slide__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1.1rem;
}

.market-button {
  display: inline-flex;
  min-height: 36px;
  padding: .48rem .85rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(154, 201, 230, .42);
  border-radius: .55rem;
  background: rgba(9, 30, 46, .72);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: .76rem;
  font-weight: 750;
  line-height: 1.2;
  backdrop-filter: blur(8px);
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.market-button:hover {
  border-color: rgba(255, 255, 255, .7);
  background: rgba(18, 52, 76, .9);
}

.market-button:active {
  transform: translateY(1px);
}

.market-button--primary {
  border-color: #43dc69;
  background: #43dc69;
  color: #071b10;
}

.market-button--primary:hover {
  border-color: #68eb87;
  background: #68eb87;
}

.market-carousel__navigation {
  position: absolute;
  z-index: 4;
  right: clamp(1rem, 2vw, 1.6rem);
  bottom: clamp(.8rem, 1.5vw, 1.15rem);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.carousel-arrow {
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: rgba(5, 20, 32, .58);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(7px);
}

.carousel-arrow:hover {
  background: rgba(17, 52, 75, .9);
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.carousel-dots button {
  width: .42rem;
  height: .42rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(226, 241, 250, .65);
  cursor: pointer;
  transition: width .2s ease, background .2s ease;
}

.carousel-dots button[aria-selected='true'] {
  width: 1.35rem;
  background: #43dc69;
  animation: carousel-dot-pulse 6s linear;
}

@keyframes carousel-dot-pulse {
  0% { opacity: .55; }
  12%, 100% { opacity: 1; }
}

@media (max-width: 800px) {
  .market-carousel {
    height: auto;
    aspect-ratio: 16 / 7;
  }

  .market-slide__content {
    width: 78%;
  }
}

@media (max-width: 620px) {
  .market-carousel {
    height: 360px;
    aspect-ratio: auto;
    border-radius: .9rem;
  }

  .market-slide__shade {
    background: linear-gradient(90deg, rgba(4, 15, 26, .96), rgba(4, 15, 26, .55));
  }

  .market-slide__content {
    width: 100%;
    padding: 1.5rem 1.35rem 5.2rem;
  }

  .market-slide h1,
  .market-slide h2 {
    max-width: 500px;
    font-size: clamp(1.75rem, 8vw, 2.3rem);
  }

  .market-slide__lead {
    max-width: 92%;
    font-size: .84rem;
  }

  .market-button {
    min-height: 34px;
    padding: .45rem .75rem;
    font-size: .72rem;
  }

  .market-carousel__navigation {
    right: 1.25rem;
    bottom: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .market-slide {
    transition: none;
  }

  .carousel-dots button[aria-selected='true'] {
    animation: none;
  }
}

/* Статьи открываются по постоянным якорным ссылкам под каруселью. */
.home-articles { display: grid; gap: 1.5rem; margin-top: 2rem; scroll-margin-top: var(--home-anchor-offset, 150px); }
.home-articles .section-heading { margin: 0; }
.home-article { min-width: 0; scroll-margin-top: var(--home-anchor-offset, 150px); }
.home-article header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: 1.25rem; }
.home-article h2 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.8rem); }
.home-article-link { color: var(--text-muted); font-size: .8rem; }
.home-article-link:hover { color: var(--accent); }
.home-article-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }

/* Slides retain their desktop artwork; phone height follows real text content. */
@media (max-width: 1024px) {
  .market-carousel { aspect-ratio: auto; min-height: 380px; }
}
@media (max-width: 767px) {
  .market-carousel { height: auto; min-height: 0; }
  .market-carousel__track { display: grid; height: auto; }
  .market-slide { position: relative; inset: auto; grid-area: 1 / 1; height: auto; }
  .market-slide__content { width: 100%; height: 100%; padding: 28px 24px 88px; justify-content: flex-start; }
  .market-slide__image { height: 100%; object-position: 65% center; }
  .market-slide__lead { max-width: 100%; font-size: 16px; }
  .page-content .market-slide h1, .page-content .market-slide h2 { font-size: clamp(28px, 7vw, 36px); }
  .market-slide__actions { width: 100%; flex-wrap: wrap; }
  .market-button { min-height: 48px; font-size: 14px; padding: 12px 16px; text-align: center; }
  .market-carousel__navigation { gap: 2px; right: 16px; left: 16px; justify-content: center; }
  .market-carousel__navigation button { min-width: 44px; min-height: 44px; }
  .carousel-dots { gap: 0; }
  .carousel-dots button, .carousel-dots button[aria-selected='true'] { display: grid; place-items: center; width: 44px; height: 44px; background: transparent; animation: none; }
  .carousel-dots button::after { content: ''; width: 7px; height: 7px; border-radius: 8px; background: rgba(226, 241, 250, .65); }
  .carousel-dots button[aria-selected='true']::after { width: 22px; background: #43dc69; }
}
@media (max-width: 480px) {
  .market-slide__content { padding: 24px 20px 84px; }
  .market-slide__actions { flex-direction: column; align-items: stretch; }
  .market-slide__actions .market-button { width: 100%; }
}

/* Высота следует содержимому активного слайда; количество кнопок не ограничено. */
.market-carousel { height: auto; aspect-ratio: auto; min-height: 380px; }
.market-carousel__track { display: grid; height: auto; min-height: inherit; }
.market-slide { position: relative; inset: auto; grid-area: 1 / 1; height: auto; min-height: inherit; }
.market-slide:not(.is-active) { display: none; }
.market-slide__content { height: auto; min-height: inherit; padding-bottom: 84px; overflow-wrap: anywhere; }
.market-slide__lead { white-space: pre-wrap; }
.page-content .market-slide__image { height: 100%; object-fit: cover; }
.market-button { max-width: 100%; overflow-wrap: anywhere; }
.market-carousel__navigation { max-width: calc(100% - 32px); }
.carousel-arrow { flex: 0 0 auto; }
.carousel-dots { min-width: 0; max-width: min(55vw, 480px); overflow-x: auto; padding: 8px 2px; scrollbar-width: thin; }
.carousel-dots button { flex: 0 0 auto; }
@media (max-width: 767px) {
  .market-carousel { min-height: 320px; }
  .carousel-dots { max-width: calc(100% - 96px); }
}

/* Compact introduction uses the same surfaces and controls as the homepage. */
.home-intro { display:grid; gap:20px; width:100%; max-width:1040px; margin:24px auto 0; }
.home-intro h2 { margin:0; font-size:clamp(20px, 2vw, 26px); line-height:1.25; letter-spacing:-.025em; }
.home-how.surface, .home-free.surface { padding:24px; }
.home-steps { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:18px; padding:0; margin:22px 0; list-style:none; }
.home-steps li { min-width:0; padding:16px; border:1px solid var(--border); border-radius:.8rem; background:var(--surface); transition:background .2s, transform .2s; }
.home-step-icon { position:relative; display:grid; place-items:center; width:42px; height:42px; margin-bottom:14px; border-radius:12px; color:var(--accent); background:var(--accent-soft); }
.home-step-icon svg { width:25px; height:25px; }
.home-step-icon b { position:absolute; top:-5px; right:-6px; display:grid; place-items:center; width:19px; height:19px; border:2px solid var(--surface); border-radius:50%; background:var(--accent); color:var(--on-accent); font-size:11px; line-height:1; }
.home-steps h3 { margin:0 0 6px; font-size:16px; line-height:1.3; }
.home-steps p { margin:0; color:var(--text-muted); font-size:14px; line-height:1.55; }
.home-how-action { gap:14px; min-height:44px; }
.home-free.surface { display:flex; align-items:center; gap:24px; }
.home-free-copy { flex:1; min-width:0; }
.home-free-copy .eyebrow { margin:0 0 8px; }
.home-free-copy > p:last-child { margin:12px 0 0; color:var(--text-muted); font-size:14px; line-height:1.6; }
.home-free-action { flex:0 0 auto; min-height:46px; gap:10px; text-align:center; }
.home-free h2 { overflow-wrap:anywhere; }
@media (hover:hover) and (pointer:fine) { .home-steps li:hover { background:var(--surface-hover); transform:translateY(-2px); } }
@media (max-width:767px) {
  .home-intro { gap:14px; margin-top:18px; }
  .home-how.surface, .home-free.surface { padding:18px; }
  .home-steps { grid-template-columns:minmax(0,1fr); gap:0; margin:14px 0; }
  .home-steps li { display:grid; grid-template-columns:36px minmax(0,1fr); align-items:start; gap:12px; padding:12px 0; border:0; border-radius:0; background:transparent; }
  .home-steps li + li { border-top:1px solid var(--border); }
  .home-step-icon { width:36px; height:36px; margin:0; border-radius:10px; }
  .home-step-icon svg { width:22px; height:22px; }
  .home-steps h3 { margin-bottom:4px; font-size:15px; }
  .home-how-action { width:100%; min-height:46px; }
  .home-free.surface { flex-direction:column; align-items:stretch; gap:16px; }
  .home-free-action { width:100%; }

}
@media (prefers-reduced-motion:reduce) { .home-steps li { transition:none; transform:none !important; } }
