/* ==========================================================================
   Edit Cat — курси монтажу відео українською
   Дизайн-система. Кольори взяті з наявних промо-макетів Любомира
   (cyan #5BCEFA + orchid #B57BBA + near-black), щоб сайт не розʼїхався
   з обкладинками курсів і соцмережами.
   ========================================================================== */

:root {
  --ink: #14151a;
  --ink-soft: #1e2027;
  --cyan: #5bcefa;
  --cyan-deep: #29b6ef;
  --orchid: #b57bba;
  --white: #ffffff;
  --paper: #f4f5f7;
  --muted: #6d7280;
  --muted-dark: rgba(255, 255, 255, 0.62);
  --line: rgba(20, 21, 26, 0.12);
  --line-dark: rgba(255, 255, 255, 0.14);

  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 18px 40px -20px rgba(20, 21, 26, 0.35);

  --wrap: 1180px;
  --gap-section: clamp(4.5rem, 9vw, 8rem);

  /* Плинна типографіка — без медіа-запитів на кожен розмір */
  --h1: clamp(2.6rem, 8.5vw, 6.2rem);
  --h2: clamp(2rem, 5.4vw, 3.6rem);
  --h3: clamp(1.35rem, 2.6vw, 1.9rem);
  --lead: clamp(1.05rem, 1.7vw, 1.28rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* Липкий хедер (68px) накривав би початок секції при переході по #якір */
[id] { scroll-margin-top: 84px; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: "Montserrat", "Inter", sans-serif;
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
  text-transform: uppercase;
}

h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); letter-spacing: -0.02em; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 22px; }

.section { padding-block: var(--gap-section); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.section--dark { background: var(--ink); color: var(--white); }
.section--paper { background: var(--paper); }

/* Мітка над заголовком секції */
.eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan-deep);
  margin: 0 0 0.9rem;
}
.section--dark .eyebrow { color: var(--cyan); }

.lead { font-size: var(--lead); color: var(--muted); max-width: 62ch; }
.section--dark .lead { color: var(--muted-dark); }

/* ---------- Кнопки ---------- */
.btn {
  --btn-bg: var(--cyan);
  --btn-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 1rem 1.9rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  will-change: transform;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--btn-bg) 70%, transparent);
}
.btn:active { transform: translateY(0); }
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border: 2px solid var(--ink);
  padding: calc(1rem - 2px) calc(1.9rem - 2px);
}
.btn--ghost:hover { background: var(--ink); color: var(--white); box-shadow: none; }
.section--dark .btn--ghost { --btn-fg: var(--white); border-color: rgba(255, 255, 255, 0.5); }
.section--dark .btn--ghost:hover { background: var(--white); color: var(--ink); }
.btn--orchid { --btn-bg: var(--orchid); --btn-fg: var(--white); }
.btn--lg { font-size: 1.05rem; padding: 1.15rem 2.4rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ---------- Хедер ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-dark);
  color: var(--white);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: 1.1rem;
  text-transform: uppercase;
  flex: 0 0 auto;
}
.brand img { width: 34px; height: 34px; object-fit: contain; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 1.6rem; }
.nav a {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  transition: color 0.16s ease;
  white-space: nowrap;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--cyan); }
.nav .btn { font-size: 0.78rem; padding: 0.7rem 1.3rem; }

.burger {
  margin-left: auto;
  display: none;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  color: var(--white);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .burger { display: inline-flex; }
  .nav {
    position: fixed;
    inset: 68px 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--line-dark);
    padding: 0.5rem 22px 1.4rem;
    transform: translateY(-130%);
    transition: transform 0.28s ease;
    max-height: calc(100dvh - 68px);
    overflow-y: auto;
  }
  .nav[data-open="true"] { transform: translateY(0); }
  .nav a { padding: 0.95rem 0; border-bottom: 1px solid var(--line-dark); font-size: 0.95rem; }
  .nav .btn { margin-top: 1rem; justify-content: center; border-bottom: 0; }
}

/* ---------- Герой ---------- */
.hero {
  position: relative;
  background: var(--ink);
  color: var(--white);
  overflow: hidden;
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../img/bg-noise.webp");
  background-size: cover;
  background-position: center;
  opacity: 0.16;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  width: 60vw;
  aspect-ratio: 1;
  right: -18vw;
  top: -22vw;
  background: radial-gradient(circle, color-mix(in srgb, var(--cyan) 42%, transparent), transparent 62%);
  filter: blur(40px);
  pointer-events: none;
}
.hero > .wrap { position: relative; z-index: 1; }

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: -1; }
}

.hero h1 { margin-bottom: 1.2rem; }
.hero h1 em {
  font-style: normal;
  color: var(--cyan);
  display: block;
}
.hero__lead { font-size: var(--lead); color: var(--muted-dark); max-width: 46ch; margin-bottom: 2rem; }

.hero__media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8);
  transform: rotate(-1.6deg);
}
.hero__media img, .hero__media video { width: 100%; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  color: var(--cyan);
  margin-bottom: 1.4rem;
}
.tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
}

/* ---------- Цифри ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.section--dark .stats, .stats--dark { background: var(--line-dark); border-color: var(--line-dark); }
/* На вузьких екранах 4 показники стають 2×2. Але на сторінках курсів їх
   ТРИ — тоді 2×2 давало порожню четверту клітинку. Тому три показники
   лишаємо в один рядок (вони короткі: «39 уроків», «10 годин», «28+ учнів»). */
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats:has(> .stat:nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
  .stats:has(> .stat:nth-child(3):last-child) .stat { padding-inline: 0.7rem; }
  .stats:has(> .stat:nth-child(3):last-child) .stat__n { font-size: clamp(1.5rem, 7vw, 2.2rem); }
  .stats:has(> .stat:nth-child(3):last-child) .stat__l { font-size: 0.75rem; }
}

.stat { background: var(--white); padding: clamp(1.4rem, 3vw, 2.2rem); }
.section--dark .stat, .stats--dark .stat { background: var(--ink); }
.stat__n {
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--cyan-deep);
}
.section--dark .stat__n { color: var(--cyan); }
.stat__l {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.4;
}
.section--dark .stat__l { color: var(--muted-dark); }

/* ---------- Картки курсів ---------- */
.cards { display: grid; gap: clamp(1.4rem, 3vw, 2rem); }
.cards--2 { grid-template-columns: repeat(2, 1fr); }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .cards--2, .cards--3 { grid-template-columns: 1fr; } }

.course {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.course:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--cyan) 60%, transparent);
}
.course__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--ink); }
.course__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.45s ease;
}
.course:hover .course__media img { transform: scale(1.04); }
.course__body { padding: clamp(1.4rem, 3vw, 1.9rem); display: flex; flex-direction: column; gap: 0.85rem; flex: 1; }
.course__meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.course__facts {
  display: flex;
  gap: 1.4rem;
  padding-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.course__facts b {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink);
}
.course__body .btn { margin-top: auto; align-self: flex-start; }

/* Бейдж поверх картинки */
.badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  background: var(--cyan);
  color: var(--ink);
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
}

/* ---------- Кроки ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.2rem, 3vw, 2rem); counter-reset: s; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step {
  border-top: 3px solid var(--cyan);
  padding-top: 1.2rem;
}
.step__n {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--cyan-deep);
  margin-bottom: 0.6rem;
}
.section--dark .step__n { color: var(--cyan); }
.step h3 { margin-bottom: 0.5rem; }
.step p { color: var(--muted); font-size: 0.98rem; }
.section--dark .step p { color: var(--muted-dark); }

/* ---------- Таймлайн (про мене) ---------- */
.timeline { display: grid; gap: 0; }
.tl {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  padding: clamp(1.6rem, 3.5vw, 2.4rem) 0;
  border-top: 1px solid var(--line);
}
.section--dark .tl { border-color: var(--line-dark); }
.tl:last-child { border-bottom: 1px solid var(--line); }
.section--dark .tl:last-child { border-color: var(--line-dark); }
@media (max-width: 760px) { .tl { grid-template-columns: 1fr; gap: 0.7rem; } }
.tl__when {
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--cyan-deep);
}
.section--dark .tl__when { color: var(--cyan); }
.tl__what {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.3rem;
}
.tl p { color: var(--muted); }
.section--dark .tl p { color: var(--muted-dark); }

/* ---------- Прайс ---------- */
.price {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(1.8rem, 5vw, 3.4rem);
  position: relative;
  overflow: hidden;
}
.price::after {
  content: "";
  position: absolute;
  width: 44vw;
  aspect-ratio: 1;
  right: -14vw;
  bottom: -24vw;
  background: radial-gradient(circle, color-mix(in srgb, var(--orchid) 45%, transparent), transparent 62%);
  filter: blur(36px);
  pointer-events: none;
}
.price > * { position: relative; z-index: 1; }
@media (max-width: 860px) { .price { grid-template-columns: 1fr; } }

.price__tag { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.4rem; }
.price__n {
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: clamp(3.4rem, 9vw, 5.6rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: var(--cyan);
}
.price__cur { font-family: "Montserrat", sans-serif; font-weight: 800; font-size: 1.4rem; color: var(--muted-dark); }
.price__note { color: var(--muted-dark); font-size: 0.95rem; }
.price ul { list-style: none; margin: 0 0 1.6rem; padding: 0; display: grid; gap: 0.7rem; }
.price li { display: flex; gap: 0.7rem; align-items: flex-start; color: rgba(255, 255, 255, 0.86); font-size: 0.98rem; }
.price li::before { content: "✓"; color: var(--cyan); font-weight: 800; flex: 0 0 auto; }

/* ---------- Проза (умови) ---------- */
.prose { max-width: 74ch; }
.prose h2 { margin-bottom: 1.6rem; }
.prose h3 { font-size: 1.15rem; margin: 2rem 0 0.6rem; text-transform: none; letter-spacing: -0.01em; }
.prose p, .prose li { color: var(--muted); }
.prose ol { padding-left: 1.3rem; display: grid; gap: 1rem; }
.prose a { color: var(--cyan-deep); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- CTA-смуга ---------- */
.strip {
  background: var(--cyan);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: clamp(1.8rem, 4vw, 3rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
}
.strip h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); max-width: 22ch; }
.strip .btn { --btn-bg: var(--ink); --btn-fg: var(--white); }

/* ---------- Футер ---------- */
.footer { background: var(--ink); color: var(--white); padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; }
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line-dark);
}
@media (max-width: 780px) { .footer__grid { grid-template-columns: 1fr; gap: 2rem; } }
.footer h4 {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--cyan);
  margin-bottom: 1rem;
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.footer a { color: rgba(255, 255, 255, 0.72); font-size: 0.95rem; transition: color 0.16s ease; }
.footer a:hover { color: var(--cyan); }
.footer p { color: var(--muted-dark); font-size: 0.95rem; }

.social { display: flex; gap: 0.7rem; margin-top: 1.2rem; }
.social a {
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.social a:hover { background: var(--cyan); border-color: var(--cyan); color: var(--ink); transform: translateY(-2px); }
.social svg { width: 19px; height: 19px; fill: currentColor; }

.footer__bottom {
  padding-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- Поява при скролі ----------
   Ховаємо ТІЛЬКИ якщо є JS (клас js на <html> ставить site.js до рендеру).
   Без цього при вимкненому/зламаному JS цілі секції були б порожні —
   а текст і кнопки «Купити» мусять читатись завжди. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  /* Специфічність мусить перебити `.js .reveal`, інакше при reduce-motion
     контент лишався б схованим до відпрацювання JS. */
  .js .reveal, .reveal { opacity: 1 !important; transform: none !important; }
}
