.page-home {
  --home-container: min(calc(100% - 2rem), 68rem);
  --home-section-space: clamp(1.625rem, 2.75vw, 2.625rem);
  min-width: 0;
  background: #f7f3ed;
}

.home-hero {
  min-height: clamp(39rem, 59vw, 53rem);
  display: grid;
  align-items: center;
  overflow: hidden;
  background-color: #478f80;
  background-image: url("/assets/common/brand/homepage-hero.png");
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: cover;
  color: #fff;
}

.home-hero__inner {
  width: var(--home-container);
  margin-inline: auto;
  display: flex;
  justify-content: flex-end;
}

.home-hero__copy {
  width: min(51%, 38rem);
  padding: clamp(1.35rem, 2.4vw, 2rem);
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 1.25rem;
  background: rgb(31 91 78 / 44%);
  -webkit-backdrop-filter: blur(.7rem) saturate(115%);
  backdrop-filter: blur(.7rem) saturate(115%);
  box-shadow: 0 .75rem 2.5rem rgb(18 54 46 / 12%);
  text-shadow: 0 .08em .45em rgb(10 48 40 / 18%);
}

.home-hero h1 {
  max-width: 12ch;
  margin: 0 0 1.4rem;
  font-size: clamp(3.3rem, 5.3vw, 5.4rem);
  line-height: .98;
  letter-spacing: -.045em;
}

.home-hero p {
  margin: 0;
  font-size: clamp(1.05rem, 1.45vw, 1.32rem);
  line-height: 1.48;
}

.home-hero p + p { margin-top: 1.25rem; }
.home-hero__invitation { font-weight: 750; }
.home-hero a { font-weight: 750; text-decoration-thickness: .08em; }

@media (max-width: 64rem) {
  .home-hero {
    min-height: 43rem;
    align-items: end;
    padding-block: 3rem;
    background-position: 16% bottom;
    background-size: auto 100%;
  }

  .home-hero__inner { justify-content: flex-end; }
  .home-hero__copy {
    width: min(66%, 34rem);
    background: rgb(45 111 95 / 63%);
  }

  .home-hero h1 { font-size: clamp(2.8rem, 7vw, 4.3rem); }
}

@media (max-width: 40rem) {
  .page-home { --home-container: min(100% - 1.25rem, 75rem); --home-section-space: 1.5rem; }
  .home-hero {
    min-height: 43rem;
    padding-block: 1rem;
    background-position: 8% bottom;
    background-size: auto 100%;
  }

  .home-hero__inner { align-self: end; }
  .home-hero__copy {
    width: 100%;
    padding: 1.15rem;
    border-radius: 1rem;
    background: rgb(45 111 95 / 68%);
  }

  .home-hero h1 { margin-bottom: .85rem; font-size: clamp(2.55rem, 13vw, 3.25rem); }
  .home-hero p { font-size: .98rem; line-height: 1.42; }
  .home-hero p + p { margin-top: .8rem; }
}

@media (max-width: 26.625rem) {
  .home-hero { min-height: 40.625rem; background-size: auto 43rem; }
}

.home-content,
.home-team-section {
  width: var(--home-container);
  margin-inline: auto;
  padding-block: var(--home-section-space);
}

.home-page h2 {
  margin: 0 0 clamp(2rem, 4vw, 3.25rem);
  color: #1a1a1a;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -.035em;
}

.home-participation h2 { max-width: 19ch; }
.home-copy { max-width: 54rem; }
.home-copy p { margin: 0 0 1.25rem; font-size: clamp(1rem, 1.25vw, 1.12rem); }
.home-participation h2 {
  position: relative;
  padding-left: clamp(1rem, 2vw, 1.4rem);
}
.home-participation h2::before {
  content: "";
  position: absolute;
  inset: .08em auto .08em 0;
  width: .28rem;
  border-radius: 999px;
  background: #4e8d9a;
}
.home-copy p:first-child { max-width: 42rem; color: #205346; font-size: clamp(1.2rem, 1.7vw, 1.45rem); font-weight: 720; }
.home-copy strong { font-weight: 750; }
.home-copy__emphasis { color: #202a27; font-weight: 750; }
.home-copy__emphasis--center { max-width: 48rem; margin-inline: auto !important; text-align: center; }
.home-copy p:last-child { margin-bottom: 0; }
.home-copy a { color: #2d6f5f; font-weight: 700; }

.home-leagues { background: #dcebdc; }
.home-leagues__inner {
  width: var(--home-container);
  margin-inline: auto;
  padding-block: var(--home-section-space);
}
.home-leagues p { max-width: 62rem; margin: 0; color: #244c42; font-size: clamp(1.12rem, 1.55vw, 1.28rem); line-height: 1.6; }

.home-schedule > ol { margin: 0; padding: 0; border-block: 1px solid rgb(32 83 70 / 14%); list-style: none; }
.home-schedule__day { display: grid; grid-template-columns: 7rem minmax(0, 1fr); align-items: start; gap: clamp(1.25rem, 3vw, 2.5rem); padding-block: 1.25rem; }
.home-schedule__day + .home-schedule__day { border-top: 1px solid rgb(32 83 70 / 11%); }
.home-schedule__day-label { display: inline-flex; align-items: center; gap: .65rem; padding-top: .45rem; color: #2d6f5f; font-size: 1.12rem; white-space: nowrap; }
.home-schedule__events { display: flex; flex-wrap: wrap; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.home-schedule__event { min-height: 2.4rem; display: inline-flex; align-items: center; gap: .55rem; padding: .48rem .72rem; border: 1px solid rgb(32 83 70 / 12%); border-radius: .72rem; background: rgb(255 255 255 / 58%); color: #263b35; font-size: .96rem; line-height: 1.35; }
.home-schedule__event time { flex: 0 0 auto; padding: .18rem .42rem; border-radius: .45rem; background: #dcebdc; color: #205346; font-size: .82rem; font-weight: 800; white-space: nowrap; }

.home-partners { padding-top: var(--home-section-space); }
.home-page .home-partners > .dl-kicker { margin: 0 0 .75rem; color: #d8682d; font-size: .75rem; font-weight: 850; line-height: normal; letter-spacing: .12em; text-transform: uppercase; }
.home-partners ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; column-gap: clamp(1.5rem, 4vw, 3rem); row-gap: clamp(.75rem, 2vw, 1.5rem); margin: 0; padding: 0; list-style: none; }
.home-partners li { min-width: 0; height: 8.5rem; }
.home-partners a,
.home-partners li > div { width: 100%; height: 100%; display: grid; place-items: center; padding: 1.25rem; }
.home-partners img { width: auto; height: auto; max-width: min(78%, 10rem); max-height: 5rem; object-fit: contain; }

.main-organizers-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.main-card { overflow: hidden; display: flex; flex-direction: column; border-radius: 1.25rem; background: #fff; box-shadow: 0 .25rem 1.25rem rgb(0 0 0 / 6%); opacity: 0; transform: translateY(1.875rem); transition: transform .4s cubic-bezier(.175,.885,.32,1), box-shadow .4s ease, opacity .4s ease; }
.main-card.visible { opacity: 1; transform: translateY(0); }
.main-card:hover { transform: translateY(-.375rem); box-shadow: 0 1.125rem 2.5rem rgb(0 0 0 / 12%); }
.main-card-photo { aspect-ratio: 1; overflow: hidden; background: #f4f4f4; }
.main-card-photo picture { display: block; width: 100%; height: 100%; }
.main-card-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .6s ease; }
.main-card:hover .main-card-photo img { transform: scale(1.05); }
.main-card-body { flex: 1; display: flex; flex-direction: column; padding: 1.375rem 1.5rem 1.75rem; background: linear-gradient(180deg,#fff 0%,#fafbfc 100%); }
.main-card-role { align-self: flex-start; position: relative; overflow: hidden; margin-bottom: 1rem; padding: .5rem 1rem; border-radius: 1.5rem; background: linear-gradient(135deg,#2c3e50,#34495e); color: #fff; font-size: .75rem; font-weight: 600; letter-spacing: .056rem; text-transform: uppercase; }
.main-card-role::before { display: none; }
.main-card-name { margin: 0 0 .75rem; color: #1a1a1a; font-size: 1.25rem; line-height: 1.25; letter-spacing: -.019rem; }
.main-card-lastname { display: block; margin-bottom: .13rem; }
.main-card-firstname { display: block; font-size: .82em; font-weight: 400; opacity: .75; }
.main-card-bio { flex: 1; margin: 0; color: #555; font-size: .875rem; line-height: 1.6; }

.home-team-section h2 { text-align: center; }
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.875rem; }
.team-card { position: relative; aspect-ratio: 1; overflow: hidden; display: block; border-radius: 1rem; color: inherit; text-decoration: none; box-shadow: 0 .25rem 1.25rem rgb(0 0 0 / 8%); opacity: 0; transform: translateY(1.875rem); transition: all .4s cubic-bezier(.175,.885,.32,1.275); }
.team-card.visible { opacity: 1; transform: translateY(0); }
.team-card:hover { transform: translateY(-.5rem) scale(1.02); box-shadow: 0 1.25rem 2.5rem rgb(0 0 0 / 15%); }
.team-card-photo,
.team-card-photo picture { display: block; width: 100%; height: 100%; }
.team-card-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform .6s ease; }
.team-card:hover img { transform: scale(1.08); }
.team-card-overlay { position: absolute; inset: auto 0 0; padding: 3.75rem 1.25rem 1.25rem; background: linear-gradient(to top,rgb(0 0 0 / 85%) 0%,rgb(0 0 0 / 40%) 60%,transparent 100%); color: #fff; transition: opacity .3s ease, padding .3s ease; }
.team-card:hover .team-card-overlay { padding-bottom: 1.56rem; }
.team-card-name { margin: 0; font-size: .875rem; line-height: 1.4; text-shadow: 0 1px 3px rgb(0 0 0 / 30%); }
.team-card-lastname { --team-card-lastname-size: 1.06rem; display: block; margin-bottom: .13rem; font-size: var(--team-card-lastname-size); font-weight: 700; }
.team-card-firstname,
.team-card-patronymic { display: inline; font-size: .94rem; opacity: .95; }
.team-card-patronymic::before { content: " "; }
.team-card-hover { position: absolute; bottom: 1.56rem; left: 50%; z-index: 2; display: flex; align-items: center; gap: .5rem; padding: .69rem 1.625rem; transform: translateX(-50%) translateY(.625rem) scale(.92); border: 1px solid rgb(255 255 255 / 35%); border-radius: 3rem; background: linear-gradient(135deg,rgb(255 255 255 / 25%),rgb(255 255 255 / 12%)); color: #fff; font-size: .875rem; font-weight: 600; letter-spacing: .019rem; white-space: nowrap; opacity: 0; pointer-events: none; -webkit-backdrop-filter: blur(.875rem) saturate(180%); backdrop-filter: blur(.875rem) saturate(180%); box-shadow: inset 0 1px 1px rgb(255 255 255 / 30%),0 .5rem 2rem rgb(0 0 0 / 15%); transition: opacity .3s ease, transform .3s ease; }
.team-card-hover::after { content: "→"; transition: transform .3s ease; }
.team-card:hover .team-card-hover { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.team-card:hover .team-card-hover::after { transform: translateX(.19rem); }
.team-card:hover .team-card-overlay { opacity: 0; }

.popup-overlay { position: fixed; inset: 0; z-index: 9999; display: none; overflow-y: auto; box-sizing: border-box; padding: 1.25rem; background: rgb(0 0 0 / 80%); opacity: 0; transition: opacity .3s ease; }
.popup-overlay.active { display: flex; align-items: center; justify-content: center; opacity: 1; }
.popup-container { position: relative; overflow: hidden; width: 100%; max-width: 59.375rem; max-height: 90vh; display: flex; flex-direction: column; border-radius: 1rem; background: #fff; box-shadow: 0 1.56rem 5rem rgb(0 0 0 / 40%); opacity: 0; transform: translateY(-1.875rem); transition: all .3s ease; }
.popup-overlay.active .popup-container { opacity: 1; transform: translateY(0); }
.popup-close { position: absolute; top: 1.25rem; right: 1.25rem; z-index: 10; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / 95%); color: #333; font-size: 1.5rem; box-shadow: 0 .13rem .5rem rgb(0 0 0 / 15%); transition: all .2s; }
.popup-close:hover { background: #fff; transform: rotate(90deg) scale(1.1); box-shadow: 0 .25rem .75rem rgb(0 0 0 / 20%); }
.popup-content { flex: 1; display: flex; overflow: hidden; }
.popup-photo { flex: 0 0 28.125rem; height: 28.125rem; overflow: hidden; background: #f4f4f4; }
.popup-photo picture { display: block; width: 100%; height: 100%; }
.popup-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.popup-text { flex: 1; overflow-y: auto; display: flex; flex-direction: column; justify-content: center; padding: 3.125rem 2.8rem; background: linear-gradient(135deg,#f8f9fa,#fff); }
.popup-name { margin: 0 0 1.56rem; color: #1a1a1a; font-size: 2rem; line-height: 1.2; letter-spacing: -.03rem; }
.popup-lastname { display: block; margin-bottom: .38rem; }
.popup-firstname { display: block; font-size: .82em; font-weight: 400; opacity: .85; }
.popup-bio { margin: 0; color: #444; font-size: 1.06rem; line-height: 1.8; }

@media (max-width: 64rem) {
  .team-grid { grid-template-columns: repeat(3,1fr); gap: 1.56rem; }
  .home-partners ul { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 56.25rem) {
  .popup-container { max-width: 31.25rem; max-height: 95vh; }
  .popup-content { flex-direction: column; }
  .popup-photo { flex: none; width: 100%; height: auto; max-height: 20rem; aspect-ratio: 1; }
  .popup-photo img { object-position: center 20%; }
  .popup-text { padding: 1.875rem 1.56rem; }
  .popup-name { margin-bottom: 1.125rem; font-size: 1.625rem; }
  .popup-bio { font-size: .94rem; line-height: 1.7; }
}

@media (max-width: 47.9375rem) {
  .home-schedule__day { grid-template-columns: 1fr; gap: .65rem; padding-block: 1rem; }
  .home-schedule__day-label { padding-top: 0; }
  .home-partners ul { grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 1rem; row-gap: .5rem; }
  .main-organizers-grid { max-width: 22.5rem; margin-inline: auto; grid-template-columns: 1fr; gap: 1.25rem; }
  .main-card:nth-child(1) { order: 2; }
  .main-card:nth-child(2) { order: 1; }
  .main-card:nth-child(3) { order: 3; }
  .main-card-body { padding: 1.125rem 1.25rem 1.5rem; }
  .main-card-name { font-size: 1.19rem; }
  .main-card-bio { font-size: .81rem; }
  .main-card-role { padding: .44rem .875rem; font-size: .69rem; }
  .team-grid { grid-template-columns: repeat(2,1fr); gap: .94rem; }
  .team-card { aspect-ratio: auto; min-width: 0; display: grid; grid-template-columns: 4.375rem minmax(0,1fr) 2rem; align-items: center; padding: 0; border-radius: .75rem; background: #fff; box-shadow: 0 .13rem .75rem rgb(0 0 0 / 6%); }
  .team-card:hover { transform: translateX(.31rem); box-shadow: 0 .25rem 1.25rem rgb(0 0 0 / 10%); }
  .team-card-photo { width: 4.375rem; height: 4.375rem; align-self: center; }
  .team-card-photo img { border-radius: .5rem 0 0 .5rem; }
  .team-card:hover img { transform: none; }
  .team-card-overlay { position: static; min-width: 0; padding: .62rem .5rem .62rem .72rem; background: none; color: #1a1a1a; }
  .team-card-name { overflow: visible; font-size: .875rem; line-height: 1.25; text-shadow: none; }
  .team-card-lastname { --team-card-lastname-size: .875rem; overflow: visible; display: block; max-width: 100%; margin-bottom: .18rem; font-size: var(--team-card-lastname-size); white-space: nowrap; }
  .team-card-lastname.is-wrapped { white-space: normal; overflow-wrap: anywhere; }
  .team-card-firstname,
  .team-card-patronymic { display: block; overflow: visible; font-size: .75rem; white-space: normal; overflow-wrap: anywhere; opacity: .85; }
  .team-card-patronymic::before { content: ""; }
  .team-card-hover { position: static; width: 2rem; height: 100%; min-height: 2.75rem; padding: 0 .25rem 0 0; justify-content: center; border: 0; border-left: 1px solid rgb(26 26 26 / 7%); border-radius: 0; background: transparent; font-size: 0; opacity: 1; transform: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .team-card-hover::after { color: #666; font-size: 1.25rem; font-weight: 600; }
  .team-card:hover .team-card-overlay { opacity: 1; }
}

@media (max-width: 30rem) {
  .home-page h2 { font-size: 1.8rem; }
  .home-partners a,
  .home-partners li > div { padding: 1rem; }
  .home-partners li { height: 7rem; }
  .home-partners img { max-width: 78%; max-height: 4.25rem; }
  .popup-overlay { padding: .6rem; }
  .popup-photo { max-height: 16.25rem; }
  .popup-text { padding: 1.25rem 1.125rem; }
  .popup-name { margin-bottom: .875rem; font-size: 1.375rem; }
  .popup-bio { font-size: .875rem; line-height: 1.6; }
  .popup-close { top: .94rem; right: .94rem; width: 2.5rem; height: 2.5rem; font-size: 1.375rem; }
  .team-grid { gap: .75rem; }
  .team-card { grid-template-columns: 3.75rem minmax(0,1fr) 1.75rem; }
  .team-card-photo { width: 3.75rem; height: 3.75rem; }
  .team-card-overlay { padding: .5rem .3rem .5rem .5rem; }
  .team-card-hover { width: 1.75rem; padding-right: .25rem; }
}

@media (max-width: 23.75rem) {
  .team-grid { grid-template-columns: 1fr; }
}

/* Keep the third-package card size on large desktops; spread cards across the block. */
@media (min-width: 1440px) {
  .home-main-organizers .main-organizers-grid {
    grid-template-columns: repeat(3,calc(27.5% - 1.546875rem - 2.2px));
    justify-content: space-between;
  }
}
