* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Gravity",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: #151515;
  color: #e0e0e0;
  line-height: 1.6;
}

/* ===== BACKGROUND CODE (Hidden Behind Screen) ===== */
#code-background {
  position: fixed;
  top: 10rem;
  left: 2rem;
  width: auto;
  height: auto;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
  padding: 0;
  overflow: hidden;
  max-width: 50%;
  max-height: 50%;
}

.code-display {
  position: relative;
  width: auto;
  height: auto;
}

#code-text {
  color: #2d5a3d;
  font-family: "Courier New", monospace;
  font-size: 1.2rem;
  line-height: 1.4;
  white-space: pre;
  text-align: left;
  transition: opacity 0.5s ease;
  padding: 0;
  margin: 0;
}

/* Cursor animation */
.cursor {
  display: inline-block;
  width: 0.8rem;
  height: 2rem;
  background-color: #547c55;
  margin-left: 0.2rem;
  animation: blink 1s infinite;
  vertical-align: middle;
  opacity: 0.7;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

/* Content above background */
header,
.main-content,
footer {
  position: relative;
  z-index: 1;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-top: 1rem;
  padding: 2rem 5rem;
}

/* ===== FEATURES SECTION ===== */
.features-section {
  padding: 8rem 0;
  margin-top: 4rem;
  position: relative;
  z-index: 1;
}

.features-container {
  max-width: 120rem;
  margin: 0 auto;
}

.features-header {
  text-align: center;
  margin-bottom: 5rem;
}

.features-header h2 {
  font-size: 3.5rem;
  color: #ffffed;
  font-weight: 400;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.features-subtitle {
  font-size: 1.5rem;
  color: #e0e0e0;
  font-weight: 300;
  line-height: 1.6;
  opacity: 0.8;
  max-width: 70rem;
  margin: 0 auto;
}

/* Features Grid 3x2 */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 110rem;
  margin: 0 auto;
}

.feature-card {
  border-radius: 1.2rem;
  padding: 2.5rem 2rem;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  min-height: 22rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-card-1 {
  background-color: #3a3a3a;
}

.feature-card-2 {
  background-color: #637a7f;
}

.feature-card:hover {
  transform: translateY(-0.5rem);
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.3);
}

.feature-card-1:hover {
  background-color: #444;
}

.feature-card-2:hover {
  background-color: #769399;
}

.feature-icon {
  width: 7rem;
  height: 7rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.feature-title {
  font-size: 2.2rem;
  color: #ffffed;
  font-weight: 400;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.feature-description {
  font-size: 1.5rem;
  color: #e0e0e0;
  line-height: 1.5;
  font-weight: 300;
  opacity: 0.9;
}

/* ===== LECTURE & AI SECTION ===== */
.lecture-ai-section {
  padding: 8rem 0 12rem 0;
  margin-top: 6rem;
  position: relative;
  z-index: 1;
  overflow: hidden; /* скрывает соседние слайды */
}

.lecture-ai-container {
  display: flex;
  position: relative;
  transition: transform 0.6s ease-in-out;
  transform: translateX(0);
  width: 100%;
}

.lecture-ai-slide {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 4rem;
  width: 100%;
  min-width: 100%;
  flex-shrink: 0;
  pointer-events: auto;
  padding: 0 12rem;
  position: relative;
  min-height: 50vh;
  box-sizing: border-box;
}

.slide-number-top {
  position: absolute;
  bottom: 5rem;
  left: 12rem;
  font-family:
    "Gravity",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 5.4rem;
  color: #a0c7cf;
  font-weight: bold;
  letter-spacing: 0.1rem;
  z-index: 100;
  display: block;
}

.slide-number {
  font-family:
    "Gravity",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 1.2rem;
  color: #a0c7cf;
  font-weight: 300;
  margin-bottom: 0.5rem;
  letter-spacing: 0.1rem;
}

.lecture-title,
.ai-title {
  font-family:
    "Gravity",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 2.2rem;
  color: #ffffed;
  font-weight: 400;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.lecture-description,
.ai-description {
  font-family:
    "Gravity",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 1.5rem;
  color: #e0e0e0;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  font-weight: 300;
}

.lecture-list,
.ai-list {
  list-style: none;
}

.lecture-list li,
.ai-list li {
  font-family:
    "Gravity",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 1.4rem;
  color: #e0e0e0;
  line-height: 2;
  margin-bottom: 0.5rem;
  padding-left: 3.5rem;
  position: relative;
  display: flex;
  align-items: flex-start;
}

.lecture-list .check-icon,
.ai-list .check-icon {
  position: absolute;
  left: 0;
  top: 0.2rem;
  color: #ffffed;
  font-size: 1.8rem;
  font-weight: bold;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lecture-block,
.ai-block {
  flex: 1;
  padding: 0;
}

/* Carousel Section within Slides */
.lecture-ai-slide .carousel-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex: 0.8;
  min-width: 200px;
}

.carousel-item {
  font-family:
    "Gravity",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 3rem;
  color: #ffffed;
  font-weight: 300;
  line-height: 1;
}

.carousel-icon {
  width: 8rem;
  height: 8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
  opacity: 1;
  transform: scale(1);
}

.carousel-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(100%);
}

/* Bottom Carousel Buttons - Under Carousel Section */
.carousel-buttons-wrapper {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1.5rem;
  z-index: 100;
  width: auto;
}

.carousel-btn {
  width: 5rem;
  height: 5rem;
  border-radius: 0.8rem;
  background-color: #a0c7cf;
  color: #151515;
  border: none;
  font-size: 2.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 300;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.carousel-btn:hover {
  background-color: #6b8ea3;
  transform: translateY(-0.3rem);
  box-shadow: 0 0.8rem 2rem rgba(69, 99, 119, 0.4);
}

.carousel-btn:active {
  transform: translateY(-0.1rem);
}

/* ===== LANGUAGES SECTION ===== */
.languages-section {
  padding: 8rem 0;
  margin-top: 6rem;
  position: relative;
  z-index: 1;
}

.languages-container {
  max-width: 130rem;
  margin: 0 auto;
  padding: 0 2rem;
}

.languages-header {
  text-align: center;
  margin-bottom: 5rem;
}

.languages-header h2 {
  font-size: 3.5rem;
  color: #ffffed;
  font-weight: 400;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.languages-subtitle {
  font-size: 1.5rem;
  color: #e0e0e0;
  font-weight: 300;
  line-height: 1.6;
  opacity: 0.8;
}

.languages-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.language-card {
  background-color: #3a3a3a;
  border-radius: 1rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 15rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.language-card:nth-child(2n) {
  background-color: #637a7f;
}

.language-card:hover {
  transform: translateY(-0.5rem);
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.3);
}

.language-card:nth-child(2n):hover {
  background-color: #769399;
}

.language-card:nth-child(2n-1):hover {
  background-color: #444;
}

.language-icon {
  width: 5rem;
  height: 5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.language-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.language-name {
  font-size: 1.8rem;
  color: #ffffed;
  font-weight: 400;
  line-height: 1.3;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
  .main-content {
    padding: 2rem 3rem;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .languages-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  .lecture-ai-container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .carousel-section {
    order: 2;
  }

  .lecture-block {
    order: 1;
  }

  .ai-block {
    order: 3;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 2rem 1.5rem;
  }

  .features-section {
    padding: 4rem 0;
    margin-top: 2rem;
  }

  .languages-section {
    padding: 4rem 0;
    margin-top: 2rem;
  }

  .lecture-ai-section {
    padding: 4rem 0;
    margin-top: 2rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .features-header h2 {
    font-size: 2.5rem;
  }

  .feature-card {
    min-height: 18rem;
    padding: 2rem;
  }

  .feature-icon {
    width: 5rem;
    height: 5rem;
  }

  .feature-title {
    font-size: 1.8rem;
  }

  .feature-description {
    font-size: 1.3rem;
  }

  .languages-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .languages-header h2 {
    font-size: 2.5rem;
  }

  .language-card {
    padding: 2rem 1.5rem;
    min-height: 13rem;
  }

  .language-icon {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1rem;
  }

  .language-name {
    font-size: 1.5rem;
  }

  .lecture-ai-container {
    gap: 2rem;
    padding: 0 1.5rem;
  }

  .lecture-title,
  .ai-title {
    font-size: 1.8rem;
  }

  .lecture-description,
  .ai-description {
    font-size: 1.3rem;
  }

  .lecture-list li,
  .ai-list li {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 1.5rem;
  }

  .features-header h2 {
    font-size: 2rem;
  }

  .features-subtitle {
    font-size: 1.2rem;
  }

  .feature-card {
    padding: 1.5rem 1rem;
    min-height: 16rem;
  }

  .feature-icon {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1rem;
  }

  .feature-title {
    font-size: 1.5rem;
  }

  .feature-description {
    font-size: 1.2rem;
  }

  .languages-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .languages-header h2 {
    font-size: 2rem;
  }

  .languages-subtitle {
    font-size: 1.2rem;
  }

  .language-card {
    padding: 1.5rem 1rem;
    min-height: 12rem;
  }

  .language-icon {
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 0.75rem;
  }

  .language-name {
    font-size: 1.3rem;
  }

  .lecture-ai-container {
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .lecture-title,
  .ai-title {
    font-size: 1.6rem;
  }

  .lecture-description,
  .ai-description {
    font-size: 1.1rem;
  }

  .lecture-list li,
  .ai-list li {
    font-size: 1rem;
    padding-left: 2.5rem;
  }

  .carousel-item {
    font-size: 2rem;
  }

  .carousel-icon {
    width: 6rem;
    height: 6rem;
  }

  .carousel-btn {
    width: 4rem;
    height: 4rem;
    font-size: 2rem;
  }
}

/* ===== UTILITY CLASSES ===== */
.scroll-top {
  position: fixed;
  bottom: 5rem;
  right: 5rem;
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  background-color: #333;
  color: white;
  border: none;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s,
    visibility 0.3s;
  z-index: 1000;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}
