/* ======== Глобальні стилі ======== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #F5F7FA;
    color: #2C2F33;
    line-height: 1.6;
}

/* Контейнер */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ======== Хедер ======== */
.header {
    background-color: #ffffff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.header__logo {
    font-family: 'Fira Code', monospace;
    font-weight: 600;
    font-size: 1.4rem;
    color: #0D6EFD;
}

.header__nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.header__nav a {
    text-decoration: none;
    color: #2C2F33;
    font-weight: 500;
    position: relative;
}

.header__nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -3px;
    left: 0;
    background-color: #0D6EFD;
    transition: width 0.3s ease;
}

.header__nav a:hover::after {
    width: 100%;
}

/* ======== Футер ======== */
.footer {
    background-color: #2C2F33;
    color: #ffffff;
    padding: 2rem 0;
}

.footer__container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.footer__logo {
    font-family: 'Fira Code', monospace;
    font-size: 1.4rem;
    font-weight: 600;
}

.footer__col h4 {
    margin-bottom: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
}

.footer__col ul {
    list-style: none;
}

.footer__col ul li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer__col a {
    text-decoration: none;
    color: #ffffff;
    transition: color 0.3s;
}

.footer__col a:hover {
    color: #0D6EFD;
}

/* ======== HERO ======== */
.hero {
    position: relative;
    padding: 5rem 0 3.5rem;
    overflow: hidden;
    background: radial-gradient(1200px 600px at 20% -10%, rgba(13,110,253,0.12), transparent 60%),
                radial-gradient(900px 500px at 90% 10%, rgba(13,110,253,0.10), transparent 60%);
}

.hero__bg-grid {
    --size: 28px;
    position: absolute;
    inset: 0;
    background: 
      linear-gradient(to right, rgba(44,47,51,0.06) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(44,47,51,0.06) 1px, transparent 1px);
    background-size: var(--size) var(--size);
    mask-image: radial-gradient(80% 65% at 50% 0%, #000 60%, transparent 100%);
    pointer-events: none;
}

.hero__container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    align-items: center;
}

@media (max-width: 900px) {
    .hero__container { grid-template-columns: 1fr; }
    .hero__visual { order: -1; }
}

.hero__eyebrow {
    display: inline-block;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: #0D6EFD;
    background: rgba(13,110,253,0.08);
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.9rem;
}

.hero__title {
    font-size: clamp(1.9rem, 4.5vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.8rem;
}

.hero__title-highlight {
    display: inline-block;
    position: relative;
    padding: 0 .2rem;
}
.hero__title-highlight::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0.2rem;
    height: 0.5rem;
    background: linear-gradient(90deg, rgba(13,110,253,0.18), rgba(13,110,253,0.38));
    border-radius: 6px;
    transform-origin: left center;
    transform: scaleX(0);
}

.hero__subtitle {
    color: #4b4f56;
    max-width: 50ch;
    margin-bottom: 1.4rem;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
    border: 1px solid transparent;
    will-change: transform;
}
.button--primary {
    background: #0D6EFD;
    color: #fff;
    box-shadow: 0 8px 24px rgba(13,110,253,0.25);
}
.button--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(13,110,253,0.3);
}
.button--ghost {
    background: transparent;
    color: #2C2F33;
    border-color: rgba(44,47,51,0.15);
}
.button--ghost:hover {
    background: rgba(13,110,253,0.08);
    border-color: rgba(13,110,253,0.3);
}

.hero__cta { display: flex; gap: 0.8rem; flex-wrap: wrap; }

.hero__features {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.1rem;
    list-style: none;
}
.hero__features-item {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .7rem;
    border: 1px dashed rgba(44,47,51,0.2);
    border-radius: 10px;
    font-size: .95rem;
    background: #fff;
}

.hero__visual {
    position: relative;
    display: grid;
    place-items: center;
}
.hero__image {
    width: 100%;
    max-width: 520px;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    background: #fff;
}

/* Декоративные «чипы» */
.hero__chip {
    position: absolute;
    display: grid;
    place-items: center;
    width: 56px; height: 56px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(44,47,51,0.12);
    box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}
.hero__chip--one { top: 8%; left: 6%; }
.hero__chip--two { bottom: 12%; right: 10%; }
.hero__chip--three { top: 48%; right: -12px; }

.prefers-reduced-motion .hero__chip,
.prefers-reduced-motion .hero__title-highlight::after { 
    animation: none !important;
    transition: none !important;
}

/* ======== COURSES ======== */
.courses { padding: 3.5rem 0; }
.courses__header { margin-bottom: 1.5rem; }
.courses__title {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  margin-bottom: .3rem;
  font-weight: 700;
}
.courses__subtitle { color: #4b4f56; max-width: 60ch; }

.courses__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.2rem;
}
@media (min-width: 680px) {
  .courses__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .courses__grid { grid-template-columns: repeat(4, 1fr); }
}

.courses-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #fff;
  border: 1px solid rgba(44,47,51,0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  will-change: transform;
  opacity: 0; transform: translateY(10px); /* початковий стан для IO-анімації */
}
.courses-card.is-visible {
  opacity: 1; transform: none;
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease, opacity .28s ease;
}
.courses-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(13,110,253,0.12);
  border-color: rgba(13,110,253,0.3);
}

.courses-card__media {
  position: relative;
  aspect-ratio: 16/10;
  background: linear-gradient(180deg, rgba(13,110,253,0.05), transparent);
}
.courses-card__media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.courses-card__icon {
  position: absolute;
  right: 10px; bottom: 10px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(44,47,51,0.12);
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}

.courses-card__body { padding: 1rem; }
.courses-card__title { font-size: 1.1rem; margin-bottom: .35rem; font-weight: 700; }
.courses-card__text { color: #4b4f56; }

.courses-card__badges {
  display: flex; flex-wrap: wrap; gap: .4rem;
  list-style: none; margin-top: .8rem;
}
.badge {
  font-size: .85rem; font-weight: 600;
  padding: .35rem .5rem;
  border-radius: 999px;
  background: rgba(13,110,253,0.08);
  color: #0D6EFD;
  border: 1px solid rgba(13,110,253,0.18);
}
.badge--neutral {
  background: rgba(44,47,51,0.06);
  color: #2C2F33;
  border-color: rgba(44,47,51,0.12);
}

.courses-card__footer {
  display: flex; gap: .6rem; flex-wrap: wrap;
  padding: 0 1rem 1rem;
}

/* ======== MENTORS ======== */
.mentors { padding: 3.5rem 0; }
.mentors__header { margin-bottom: 1.5rem; }
.mentors__title { font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 700; margin-bottom: .3rem; }
.mentors__subtitle { color: #4b4f56; max-width: 60ch; }

.mentors__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 680px) { .mentors__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .mentors__grid { grid-template-columns: repeat(4, 1fr); } }

.mentor-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #fff;
  border: 1px solid rgba(44,47,51,0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  will-change: transform;
  opacity: 0; transform: translateY(10px); /* для IO */
}
.mentor-card.is-visible {
  opacity: 1; transform: none;
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease, opacity .28s ease;
}
.mentor-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(13,110,253,0.12);
  border-color: rgba(13,110,253,0.3);
}

.mentor-card__media {
  aspect-ratio: 1/1;
  background: linear-gradient(180deg, rgba(13,110,253,0.06), transparent);
}
.mentor-card__media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.mentor-card__body { padding: 1rem; }
.mentor-card__name { font-size: 1.05rem; font-weight: 700; }
.mentor-card__role { color: #4b4f56; margin-bottom: .6rem; }

.mentor-card__tags {
  display: flex; flex-wrap: wrap; gap: .4rem;
  list-style: none; margin-bottom: .7rem;
}
.mentor-card__tags li {
  font-size: .85rem; font-weight: 600;
  padding: .3rem .5rem; border-radius: 999px;
  background: rgba(13,110,253,0.08);
  color: #0D6EFD; border: 1px solid rgba(13,110,253,0.18);
}

.mentor-card__bullets { list-style: none; display: grid; gap: .35rem; color: #2C2F33; }
.mentor-card__bullets i { width: 18px; height: 18px; vertical-align: -3px; margin-right: .3rem; }

.mentor-card__footer { display: flex; gap: .6rem; flex-wrap: wrap; padding: 0 1rem 1rem; }

/* Ефект легкого «нахилу» при русі курсора */
[data-tilt] { transform-style: preserve-3d; }
[data-tilt].tilt {
  transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-2px);
}

/* ======== REVIEWS ======== */
.reviews { padding: 3.5rem 0; }
.reviews__header { margin-bottom: 1.2rem; }
.reviews__title { font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 700; margin-bottom: .3rem; }
.reviews__subtitle { color: #4b4f56; max-width: 60ch; }

.reviews__viewport {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(13,110,253,0.05), transparent 30%);
  padding: 0.6rem 0;
}
.reviews__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 88%;
  gap: 0.8rem;
  padding: 0.4rem 0.6rem 1rem;
  transform: translateX(0);
  transition: transform .35s ease;
}
@media (min-width: 680px) { .reviews__track { grid-auto-columns: 48%; } }
@media (min-width: 1024px) { .reviews__track { grid-auto-columns: 24%; } }

.review-card {
  background: #fff;
  border: 1px solid rgba(44,47,51,0.08);
  border-radius: 16px;
  padding: 1rem;
  display: grid;
  gap: .7rem;
  opacity: 0; transform: translateY(10px);
}
.review-card.is-visible { opacity: 1; transform: none; transition: opacity .28s ease, transform .28s ease; }

.review-card__top { display: flex; align-items: center; gap: .7rem; }
.review-card__avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #fff;
  border: 1px solid rgba(44,47,51,0.12);
}
.review-card__name { font-weight: 700; font-size: 1rem; }
.review-card__meta { color: #4b4f56; font-size: .9rem; }
.review-card__text { color: #2C2F33; }
.review-card__badges { display: flex; gap: .4rem; list-style: none; flex-wrap: wrap; }
.review-card__footer { display: flex; }

.reviews__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  border: 1px solid rgba(44,47,51,0.12);
  width: 40px; height: 40px; border-radius: 10px; background: #fff;
  display: grid; place-items: center;
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.reviews__nav:hover { transform: translateY(calc(-50% - 2px)); box-shadow: 0 10px 24px rgba(13,110,253,0.12); border-color: rgba(13,110,253,0.3); }
.reviews__nav--prev { left: 8px; }
.reviews__nav--next { right: 8px; }

/* ======== FAQ ======== */
.faq { padding: 3.5rem 0; }
.faq__header { margin-bottom: 1.2rem; }
.faq__title { font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 700; margin-bottom: .3rem; }
.faq__subtitle { color: #4b4f56; max-width: 60ch; }

.faq__list { display: grid; gap: .6rem; }
.faq-item {
  background: #fff;
  border: 1px solid rgba(44,47,51,0.12);
  border-radius: 14px;
  padding: .2rem .4rem;
  overflow: hidden;
  opacity: 0; transform: translateY(10px);
}
.faq-item.is-visible { opacity: 1; transform: none; transition: opacity .28s ease, transform .28s ease; }

.faq-item__summary {
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  padding: .8rem;
  cursor: pointer; user-select: none;
}
.faq-item__summary::-webkit-details-marker { display: none; }
.faq-item[open] .faq-item__summary i { transform: rotate(45deg); transition: transform .2s ease; }
.faq-item__content { padding: 0 .8rem .9rem; color: #2C2F33; }

/* ======== CONTACT ======== */
.contact { padding: 3.5rem 0; }
.contact__header { margin-bottom: 1.2rem; }
.contact__title { font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 700; margin-bottom: .3rem; }
.contact__subtitle { color: #4b4f56; max-width: 60ch; }

.contact-form {
  background: #fff;
  border: 1px solid rgba(44,47,51,0.12);
  border-radius: 16px;
  padding: 1rem;
  display: grid;
  gap: .9rem;
}
@media (min-width: 720px) {
  .contact-form { padding: 1.2rem; }
}

.contact-form__row { display: grid; gap: .35rem; }
.contact-form__label { font-weight: 600; }

.contact-form__field {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: .5rem;
  background: #FDFDFE;
  border: 1px solid rgba(44,47,51,0.12);
  border-radius: 12px;
  padding: .6rem .7rem;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.contact-form__field:focus-within {
  border-color: rgba(13,110,253,0.4);
  box-shadow: 0 0 0 4px rgba(13,110,253,0.12);
  background: #fff;
}
.contact-form__field input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  color: #2C2F33;
}
.contact-form__field input::placeholder { color: #8a8f96; }

.contact-form__captcha {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: .6rem;
  align-items: center;
}
.contact-form__captcha-task {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .55rem .7rem;
  border-radius: 10px;
  background: rgba(13,110,253,0.08);
  color: #0D6EFD;
  border: 1px solid rgba(13,110,253,0.18);
  font-weight: 700;
  min-height: 44px;
}

.contact-form__checkbox {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: .6rem;
  align-items: start;
}
.contact-form__checkbox input { appearance: none; width: 18px; height: 18px; border: 1.5px solid rgba(44,47,51,0.5); border-radius: 4px; position: relative; cursor: pointer; }
.contact-form__checkbox input:checked { background: #0D6EFD; border-color: #0D6EFD; }
.contact-form__checkbox input:checked::after { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/16px 16px no-repeat; }
.contact-form__checkbox span { display: none; } /* декоративный placeholder для BEM-сетки */

.contact-form__actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .2rem; }

.contact-form__error {
  color: #b42318;
  font-size: .9rem;
  min-height: 1em;
}

.contact-form__success {
  display: grid;
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
  gap: .5rem;
  margin-top: .6rem;
  background: #ECFDF3;
  color: #027A48;
  border: 1px solid #A6F4C5;
  border-radius: 12px;
  padding: .7rem .8rem;
}

/* ======== COOKIE POPUP ======== */
.cookie {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1200;
  padding: .8rem 0;
  backdrop-filter: saturate(140%) blur(2px);
}
.cookie[hidden] { display: none !important; }

.cookie__container {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .8rem;
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(44,47,51,0.12);
  border-radius: 14px;
  padding: .8rem;
  box-shadow: 0 16px 36px rgba(0,0,0,0.08);
}
.cookie__text {
  display: grid;
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
  gap: .6rem;
  color: #2C2F33;
}
.cookie__text a { color: #0D6EFD; text-decoration: none; border-bottom: 1px dashed rgba(13,110,253,0.4); }
.cookie__text a:hover { border-bottom-color: transparent; }

.cookie__btn { white-space: nowrap; }

/* ======== СТИЛИ ДЛЯ ТЕКСТОВЫХ СТРАНИЦ (privacy.html и др.) ======== */
/* Базовая обертка под точную структуру из ТЗ */
.pages { padding: 3rem 0; }
.pages .container { max-width: 860px; }
.pages h1 {
  font-size: clamp(1.6rem, 3.8vw, 2.2rem);
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 700;
}
.pages p {
  margin: .8rem 0;
  color: #2C2F33;
}
.pages h2 {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  margin-top: 1.4rem;
  margin-bottom: .6rem;
  font-weight: 700;
}
.pages ul {
  margin: .6rem 0 .8rem 1.2rem;
  display: grid;
  gap: .35rem;
}
.pages li { color: #2C2F33; }
.pages li strong { font-weight: 700; }
.pages a {
  color: #0D6EFD;
  text-decoration: none;
  border-bottom: 1px dashed rgba(13,110,253,0.4);
}
.pages a:hover { border-bottom-color: transparent; }

/* Адаптивная типографика и отступы */
@media (max-width: 640px) {
  .pages { padding: 2rem 0; }
}

/* Глобально скрывать любые элементы с атрибутом hidden */
[hidden] { display: none !important; }

/* Капча: на узких экранах поле ответа шире */
@media (max-width: 420px) {
  .contact-form__captcha {
    grid-template-columns: 1fr 100px;
  }
  .contact-form__captcha input { min-width: 0; }
}

/* Убрать спиннеры у number в WebKit (чтобы не «прыгало») */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
