/* =========================================================
   Olha Tushych — portfolio styles
   Увесь вигляд сайту живе тут, в одному файлі.
   Токени в :root узяті 1-в-1 із Figma (Collection 1).
   Хочеш змінити колір/відступ/радіус — міняй тут, і це
   застосується до всіх сторінок одразу.
   ========================================================= */

:root {
  /* шрифт */
  --font: "Geologica", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* кольори (Figma) */
  --bg-0: #141316; /* основний фон */
  --bg-1: #1a191f; /* поверхня (картки) */
  --content-0: #dfe0e4; /* основний текст */
  --content-1: #bdb9c6; /* приглушений текст */
  --stroke-1: #2f293d; /* рамки */
  --accent-1: #a2abe9; /* світлий акцент */
  --accent-2: #4536a1; /* глибокий акцент (кнопки) */

  /* радіуси (Figma) */
  --r-pill: 100px;
  --r-big: 24px;

  /* відступи / ширина (Figma) */
  --space-large: 64px;
  --space-gap: 16px;
  --maxw: 1264px;
}

/* базовий скид */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background: var(--bg-0);
  color: var(--content-0);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Хедер ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-1);
  border-bottom: 1px solid var(--stroke-1);
  padding: 16px 0;
}
.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  padding: 0 64px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}
/* лого-монограма — повертає на головну */
.site-logo {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: var(--accent-2);
  color: var(--content-0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.site-logo:hover {
  filter: brightness(1.15);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}
.site-nav > a,
.site-nav__trigger {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  color: var(--content-1);
  text-decoration: none;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
}
.site-nav > a:hover,
.site-nav__trigger:hover {
  color: var(--content-0);
}
.nav-item {
  position: relative;
}
.site-nav__chevron {
  width: 16px;
  height: 16px;
  display: block;
  transition: transform 0.15s ease;
}
.site-nav__chevron svg {
  display: block;
  width: 16px;
  height: 16px;
  stroke: currentColor;
}
.site-nav__trigger[aria-expanded="true"] .site-nav__chevron {
  transform: rotate(180deg);
}
.header-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 186px;
  background: var(--bg-1);
  border: 1px solid var(--stroke-1);
  border-radius: var(--r-big);
  padding: 16px;
  display: flex;
  flex-direction: column;
  z-index: 200;
}
.header-dropdown[hidden] {
  display: none;
}
.header-dropdown a {
  font-size: 16px;
  font-weight: 600;
  color: var(--content-1);
  text-decoration: none;
  padding: 12px;
  white-space: nowrap;
}
.header-dropdown a:hover {
  color: var(--content-0);
}
.site-social {
  display: flex;
  gap: 16px;
  margin-left: auto; /* притискає соцкнопки до правого краю */
}
.social-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--stroke-1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--content-1);
}
.social-btn img {
  width: 20px;
  height: 20px;
  display: block;
}
.social-btn:hover img {
  filter: brightness(1.4); /* трохи світліше на ховері */
}

/* ---------- Герой ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 100px;
  max-width: 752px;
}

.hero__eyebrow {
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 600;
  color: var(--content-0);
}

.hero__namewrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero__name {
  font-size: clamp(48px, 12vw, 96px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--content-0);
}

.hero__sub {
  font-size: 20px;
  font-weight: 200;
  line-height: 1.5;
  color: var(--content-0);
  max-width: 46ch;
}

.hero__badge {
  width: 170px;
  height: 170px;
  flex: none;
  border-radius: 50%;
  background: var(--bg-1);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero__badge span {
  font-size: 16px;
  font-weight: 600;
  color: var(--content-0);
}

/* =========================================================
   ТЕКСТОВІ СТИЛІ (з Figma) — Geologica
   Шрифт успадковується від body. Назви = назви стилів у Figma.
   ========================================================= */
.title-1 { font-weight: 700; font-size: 96px; line-height: 1; }
.title-2 { font-weight: 600; font-size: 42px; line-height: 1.1; }
.title-3 { font-weight: 500; font-size: 32px; line-height: 1.15; }
.title-4 { font-weight: 600; font-size: 26px; line-height: 1.2; }
.title-5 { font-weight: 600; font-size: 20px; line-height: 1.25; }
.body-l  { font-weight: 200; font-size: 20px; line-height: 1.5; }
.body-m  { font-weight: 300; font-size: 16px; line-height: 1.5; }

/* =========================================================
   КОМПОНЕНТИ
   Додаємо стилі в міру того, як ти малюєш їх у Figma.
   Кожен компонент = один клас. Усі показані в styleguide.html.
   ========================================================= */

/* кнопка (фіолетова пігулка) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  padding: 12px 36px;
  border-radius: var(--r-pill);
  border: 1px solid var(--accent-2);
  background: var(--accent-2);
  color: var(--content-0);
  text-decoration: none;
  cursor: pointer;
}

/* картка (case) — прев'ю + заголовок + підзаголовок + кнопка */
.case-card {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--stroke-1);
  border-radius: var(--r-big);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
}
a.case-card:hover .case-card__title {
  text-decoration: underline;
}

.case-card__thumb {
  height: 160px;
  background: var(--stroke-1); /* заглушка, поки нема зображення */
  flex: none;
  position: relative;
}

.case-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* тег у прев'ю — верхній правий кут, відступ 16 */
.case-card__tag {
  position: absolute;
  top: 16px;
  right: 16px;
}

.case-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px; /* відступ від тексту до кнопки */
  padding: 16px;
}

.case-card__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 4px; /* бічна оптична компенсація */
}

.case-card__title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--content-0);
}

.case-card__sub {
  font-size: 16px;
  font-weight: 300;
  color: var(--content-1);
}

.case-card .btn {
  margin-top: auto; /* притискає кнопку донизу, як space-between у Figma */
  align-self: flex-start;
}

/* прев'ю зі світінням (друга картка) */
.case-card__thumb--glow {
  background: transparent;
  position: relative;
  overflow: hidden; /* іконки/світіння обрізаються прев'ю */
}

.case-card__glow {
  position: absolute;
  left: 143px;
  top: -92px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: var(--accent-1);
  opacity: 0.3;
  filter: blur(200px);
  pointer-events: none;
}
/* ілюстрація-іконка в прев'ю glow-картки (позиції з Figma) */
.case-card__art {
  position: absolute;
  z-index: 1;
  display: block;
  height: auto;
  opacity: 0.6;
  transform: rotate(15deg);
  transform-origin: center;
}

/* контактна картка (футер) — іконка-чіп + лінк */
.contact-card {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--stroke-1);
  border-radius: var(--r-big);
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.contact-card__icon {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 16px;
  background: var(--stroke-1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-card__icon img {
  width: 20px;
  height: 20px;
}
.contact-card__link {
  font-size: 20px;
  font-weight: 200;
  color: var(--content-0);
  text-decoration: none;
}
.contact-card--cv .contact-card__link {
  font-size: 26px;
  font-weight: 600;
}
/* CV — висока картка праворуч із кнопкою */
.contact-card--cv {
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
}

/* тег — світло-фіолетова плашка (напр. рік). Варіанти: filled (за замовч.) і outlined */
.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--accent-1);
  color: var(--bg-1);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.tag--outlined {
  background: transparent;
  border: 1px solid var(--accent-1);
  color: var(--accent-1);
}

/* другорядна кнопка — темна пігулка (Stroke/1) */
.btn--secondary {
  background: var(--stroke-1);
  border-color: var(--stroke-1);
}

/* article — картка статті. Фавіконка плаває в тексті (float),
   тож заголовок і текст її обтікають, як inline-символ. */
.article {
  display: block;
  width: 100%;
  max-width: 336px;
  text-decoration: none;
}
/* фавікон джерела — плаває в тексті (текст обтікає) */
.article__favicon {
  float: left;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  margin: 4px 8px 4px 0;
  object-fit: cover;
  display: block;
}
.article__title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--content-0);
  margin-bottom: 12px;
}
.article__text {
  font-size: 16px;
  font-weight: 300;
  color: var(--content-0);
  margin-bottom: 16px;
}
.article__meta {
  clear: left; /* мета йде під обтіканням */
  display: flex;
  align-items: center;
  gap: 8px;
}
.article__flag {
  width: 24px;
  height: 16px;
  border-radius: 4px;
  flex: none;
  display: block;
}
.article__readtime,
.article__source {
  font-size: 12px;
  font-weight: 200;
}
.article__readtime {
  color: var(--content-1);
}
.article__source {
  color: var(--accent-1);
  text-decoration: underline;
}
.article__dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--content-1);
  flex: none;
}
/* джерело + стрілка зовнішнього лінка */
.article__src {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.article__arrow {
  width: 14px;
  height: 14px;
  display: block;
}
.article:hover .article__title {
  text-decoration: underline;
}

/* ---------- Сторінка Articles ---------- */
.articles-hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 96px 64px;
}
.articles-hero__title {
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--content-0);
  margin-bottom: 64px;
}
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 64px;
  row-gap: 64px;
}

/* ---------- Сторінка Figma resources ---------- */
.figma-card {
  display: block;
  width: 100%;
  text-decoration: none;
}
.figma-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-big);
  background: var(--bg-1);
  overflow: hidden;
  margin-bottom: 16px;
}
.figma-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.figma-card__title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--content-0);
  margin-bottom: 8px;
  padding: 0 4px; /* бічна оптична компенсація */
}
.figma-card:hover .figma-card__title {
  text-decoration: underline;
}
.figma-card__text {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--content-1);
  padding: 0 4px; /* бічна оптична компенсація */
}

/* ---------- Сторінка Videos ---------- */
.videos-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 64px;
}
.video-card {
  flex: 0 0 336px;
  max-width: 100%;
  display: block;
  text-decoration: none;
}
.video-card--wide {
  flex-basis: 536px;
}
.video-card__cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-big);
  overflow: hidden;
  background: var(--stroke-1);
}
.video-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-card__tag {
  position: absolute;
  top: 16px;
  left: 16px;
}
.video-card__content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding: 0 4px; /* бічна оптична компенсація */
}
.video-card__title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--content-0);
}
.video-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.video-card:hover .video-card__title {
  text-decoration: underline;
}

/* ---------- Сторінка кейса ---------- */
.case-hero {
  background: var(--bg-0);
  padding: 80px 0;
}
.case-hero__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 64px;
  display: flex;
  gap: 112px;
  align-items: flex-start;
}
.case-hero__main {
  flex: 0 1 560px;
}
.case-hero__year {
  margin-bottom: 24px;
}
.case-hero__title {
  font-size: clamp(40px, 8vw, 72px); /* розмір H1 кейса з Figma (72px) */
  font-weight: 700;
  line-height: 1.15;
  color: var(--content-0);
}
.case-hero__desc {
  flex: 0 1 464px;
  font-size: 20px;
  font-weight: 200;
  line-height: 1.5;
  color: var(--content-0);
}

.case-cover {
  max-width: 1136px;
  margin: 0 auto;
  border-radius: var(--r-big);
  overflow: hidden;
}
.case-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.case-info {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.info-point {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 48px;
}
.info-point__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--content-1);
}
.info-point__text {
  font-size: 16px;
  font-weight: 300;
  color: var(--content-0);
}
.info-point__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.case-body {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}
.case-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.case-row__title {
  flex: 0 0 464px;
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--content-0);
}
.case-row__text {
  flex: 1;
  max-width: 656px;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--content-0);
}
.case-row__text ul {
  margin: 12px 0 0;
  padding-left: 1.25em;
}
.case-row__text li {
  margin-top: 6px;
}
.case-row__text li::marker {
  color: var(--content-1);
}

/* кастомний блок: фічі (скрін + текст) */
.case-features {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.case-feature {
  display: flex;
  gap: 64px;
  align-items: center;
}
.case-feature__media {
  flex: 0 0 512px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.case-feature__media img {
  width: 100%;
  height: auto;
  display: block;
}
.case-feature__text {
  flex: 0 1 560px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.case-feature__title {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--content-0);
}
.case-feature__desc {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--content-0);
}

/* кастомний блок: Bonus (центрований заголовок + велика картинка) */
.case-bonus {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.case-bonus__head {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.case-bonus__title {
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--content-0);
}
.case-bonus__subtitle {
  font-size: 20px;
  font-weight: 200;
  color: var(--content-1);
}
.case-bonus__media {
  border-radius: var(--r-big);
  overflow: hidden;
}
.case-bonus__media img {
  width: 100%;
  height: auto;
  display: block;
}

/* Client як зовнішній лінк (акцент + стрілка) */
.info-point__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-1);
  text-decoration: underline;
}
.info-point__link img {
  width: 14px;
  height: 14px;
  display: block;
}

/* кастомний блок: вбудований прототип */
.case-proto {
  padding: 64px 0;
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.case-proto__head {
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: 0 64px;
}
/* ембед — від краю до краю, без падінгів/радіусів/обводки */
.case-proto__frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-1);
}
.case-proto__frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.case-proto__fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  text-align: center;
}
.case-proto__fallback p {
  font-size: 20px;
  font-weight: 200;
  color: var(--content-1);
}

/* кастомний блок: вбудовані матеріали (дошка, таблиця) */
.case-embeds {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}
.embed-row {
  display: flex;
  gap: 64px;
  align-items: center;
}
.embed-row__text {
  flex: 0 0 560px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.embed-row__title {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--content-0);
}
.embed-row__desc {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--content-0);
}
.embed-frame {
  flex: 0 0 512px;
  aspect-ratio: 512 / 377;
  border-radius: var(--r-big);
  overflow: hidden;
  background: var(--bg-1);
  border: 1px solid var(--stroke-1);
}
.embed-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.embed-row--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
}
.embed-row--stack .embed-row__text {
  flex: 0 0 auto;
  max-width: 560px;
}
.embed-row--stack .embed-frame {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 1136 / 631;
}

/* ---------- Кейс: стат-блоки ---------- */
.case-stats {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px;
}
.case-stats__title {
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--content-0);
  margin-bottom: 64px;
}
.case-stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 64px;
  align-items: start;
}
.case-stats__grid--3 {
  grid-template-columns: repeat(3, 1fr);
}
.case-stat__title {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--content-0);
  margin-bottom: 16px;
}
.case-stat__text {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--content-0);
}
.case-stat__text + .case-stat__text {
  margin-top: 16px;
}

/* ---------- Кейс: промо-картка ---------- */
.case-promo {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 64px;
}
.case-promo__card {
  position: relative;
  overflow: hidden;
  background: var(--bg-1);
  border: 1px solid var(--stroke-1);
  border-radius: var(--r-big);
  padding: 36px;
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 220px;
}
.case-promo__glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: var(--accent-1);
  opacity: 0.3;
  filter: blur(120px);
  right: -40px;
  top: -60px;
  pointer-events: none;
}
.case-promo__text {
  position: relative;
  z-index: 1;
  flex: 0 1 532px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.case-promo__title {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--content-0);
}
.case-promo__title--lg {
  font-size: clamp(32px, 5vw, 42px);
  line-height: 1.1;
}
.case-promo__desc {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--content-0);
}
.case-promo__media {
  position: relative;
  z-index: 1;
  margin-left: auto;
  flex: 0 0 auto;
}
.case-promo__media img {
  display: block;
  max-width: 100%;
  max-height: 280px;
  height: auto;
  border-radius: var(--r-big);
}

/* підпункти у фіче-тексті */
.feat-item + .feat-item {
  margin-top: 24px;
}
.feat-item__label {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--content-0);
}
.feat-item__text {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--content-0);
  margin-top: 4px;
}

/* фіче-рядок з медіа праворуч */
.case-feature--reverse {
  flex-direction: row-reverse;
}

/* ---------- Кейс: showcase (заголовок+теги+текст, далі зображення+мініатюри) ---------- */
.case-showcase {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px;
}
.case-showcase__head {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
}
.case-showcase__head-left {
  flex: 0 0 560px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.case-showcase__title {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--content-0);
}
.case-showcase__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.case-showcase__desc {
  flex: 0 1 560px;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--content-0);
}
.case-showcase__img {
  width: 100%;
  aspect-ratio: 1136 / 808;
  border-radius: var(--r-big);
  overflow: hidden;
  background: var(--stroke-1);
}
.case-showcase__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.case-showcase__thumbs {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}
.case-showcase__thumb {
  width: 135px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--stroke-1);
  flex: none;
  padding: 0;
  border: 0;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.case-showcase__thumb.is-active {
  opacity: 0.4;
}
.case-showcase__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Кейс: before / after ---------- */
.ba-block {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px;
}
.ba-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
}
.ba-labels span {
  font-size: 32px;
  font-weight: 500;
  color: var(--content-0);
}
/* інтерактивний слайдер (тягни ручку) */
.ba-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 1136 / 639;
  border-radius: var(--r-big);
  overflow: hidden;
  user-select: none;
  touch-action: none;
}
.ba-slider img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.ba-slider__after {
  clip-path: inset(0 0 0 var(--split, 50%));
}
.ba-slider__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split, 50%);
  width: 4px;
  background: var(--accent-2);
  transform: translateX(-2px);
  pointer-events: none;
}
.ba-slider__knob {
  position: absolute;
  top: 50%;
  left: var(--split, 50%);
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-2);
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--content-0);
  cursor: ew-resize;
  z-index: 2;
}
.ba-slider__knob svg {
  width: 24px;
  height: 24px;
}
/* статичне порівняння (дві картинки поряд) */
.ba-pair-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}
.ba-pair-grid img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--r-big);
}

/* ---------- Кейс: мобільна галерея ---------- */
.case-mobile {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px;
}
.case-mobile__title {
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--content-0);
  margin-bottom: 64px;
}
.case-mobile__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 64px;
}
.case-mobile__grid img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--r-big);
}

/* ---------- Кейс: широкий блок (центрований текст + велике зображення) ---------- */
.case-wide {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px;
}
.case-wide__head {
  max-width: 560px;
  margin: 0 auto 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.case-wide__title {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--content-0);
}
.case-wide__desc {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--content-0);
}
.case-wide__img {
  width: 100%;
  border-radius: var(--r-big);
  overflow: hidden;
}
.case-wide__img img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- Кейс: потік фаз зі стрілками ---------- */
.phase-flow {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.phase {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.phase__img {
  width: 100%;
  aspect-ratio: 232 / 160;
  border-radius: var(--r-big);
  overflow: hidden;
}
.phase__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.phase__label {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--content-0);
}
.phase-flow__arrow {
  flex: none;
  margin-top: 64px;
  color: var(--content-1);
}
.phase-flow__arrow svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* ---------- Кейс: маркі скріншотів ---------- */
.shot-img {
  height: 213px;
  width: auto;
  flex: none;
  display: block;
  margin-right: 32px;
  border-radius: 12px;
}

/* картка зі світінням: контент притиснутий донизу, проміжок 24 */
.case-card--glow .case-card__body {
  justify-content: flex-end;
  gap: 24px;
}
.case-card--glow .case-card__body .btn {
  margin-top: 0;
}

/* =========================================================
   РОЗКЛАДКА СТОРІНКИ
   ========================================================= */

/* секція: центрована колонка з падингом 64 */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px;
}

.section__title {
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--content-0);
  margin-bottom: 64px;
}

/* сітка карток: 3 колонки */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
/* варіант: картки розтягуються на весь доступний простір
   (порожні колонки згортаються, тож 2 картки заповнюють рядок) */
.card-grid--stretch {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* About: 2 колонки, рядки з більшим проміжком */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 64px;
  row-gap: 64px;
}
.about-cert {
  grid-column: 3;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.about-cert img {
  max-width: 100%;
  max-height: 300px;
  height: auto;
  display: block;
}

.paragraph {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.paragraph__title {
  font-size: 26px;
  font-weight: 600;
  color: var(--content-0);
}
.paragraph__text {
  font-size: 16px;
  font-weight: 300;
  color: var(--content-0);
}

/* логобар — безкінечна каруселя (marquee) */
.logo-row {
  position: relative;
  max-width: var(--maxw); /* у межах контентної колонки, не на всю ширину екрана */
  margin: 0 auto;
  padding: 32px 0;
  overflow: hidden;
}
/* згасання по краях — лого зникають у фон */
.logo-row::before,
.logo-row::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 64px;
  z-index: 2;
  pointer-events: none;
}
.logo-row::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-0), transparent);
}
.logo-row::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-0), transparent);
}
.marquee {
  overflow: hidden;
}
.marquee__track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: marquee 30s linear infinite;
}
.logo-img {
  height: 56px;
  width: auto;
  flex: none;
  display: block;
  margin-right: 48px; /* проміжок на елементі — для безшовного циклу */
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
}

/* стрічка скріншотів кейса — окрема поведінка: пауза по ховеру,
   клік по зображенню відкриває його збільшено в попапі (lightbox) */
.shots-row {
  position: relative;
  padding: 32px 0;
  overflow: hidden;
}
.shots-row::before,
.shots-row::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 64px;
  z-index: 2;
  pointer-events: none;
}
.shots-row::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-0), transparent);
}
.shots-row::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-0), transparent);
}
.shots-row .marquee:hover .marquee__track {
  animation-play-state: paused; /* пауза при наведенні */
}
.shots-row .shot-img {
  cursor: zoom-in;
}

/* лайтбокс — попап зі збільшеним зображенням */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(10, 9, 12, 0.85);
}
.lightbox[hidden] {
  display: none;
}
.lightbox__img {
  max-width: 92vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: var(--r-big);
  display: block;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.lightbox__close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-1);
  border: 1px solid var(--stroke-1);
  color: var(--content-0);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Writing: 3 колонки, широка картка на 2 */
.writing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.span-2 {
  grid-column: span 2;
}

/* All projects: категорії */
.categories {
  display: flex;
  flex-direction: column;
  gap: 64px;
}
.category {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.category__title {
  font-size: 32px;
  font-weight: 500;
  color: var(--content-1);
}

/* Contact: 2 колонки × 3 рядки — CV праворуч на всю висоту */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: auto;
  gap: 16px;
}
.contact-card--cv {
  grid-column: 2;
  grid-row: 1 / span 3;
}

/* футер (Контакт): збільшений нижній відступ */
footer.section {
  padding-bottom: 120px;
}

/* ---------- Адаптив ---------- */
@media (max-width: 1024px) {
  .card-grid,
  .writing-grid,
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 32px;
  }
  .case-info {
    grid-template-columns: repeat(2, 1fr);
  }
  .case-feature {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
  .case-feature__media,
  .case-feature__text {
    flex-basis: auto;
    width: 100%;
  }
  .embed-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
  .embed-row__text {
    flex-basis: auto;
    max-width: 560px;
  }
  .embed-frame {
    flex-basis: auto;
    width: 100%;
  }
  .case-stats__grid,
  .case-stats__grid--3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
  .case-promo__card {
    flex-direction: column;
    align-items: flex-start;
  }
  .case-promo__media {
    margin-left: 0;
    width: 100%;
  }
  .case-promo__media img {
    max-height: none;
    width: 100%;
  }
  .case-feature--reverse {
    flex-direction: column;
  }
  .case-showcase__head {
    flex-direction: column;
    gap: 24px;
  }
  .case-showcase__head-left,
  .case-showcase__desc {
    flex-basis: auto;
  }
}

@media (max-width: 640px) {
  .section,
  .hero {
    padding: 40px 20px;
  }
  .logo-row {
    padding: 24px 0;
  }
  .site-header__inner {
    padding: 0 20px;
  }
  .site-nav {
    gap: 16px;
  }
  .hero {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 32px;
    min-height: 0;
  }
  .hero__text {
    gap: 40px;
  }
  .card-grid,
  .writing-grid,
  .about-grid,
  .contact-grid,
  .logo-row {
    grid-template-columns: 1fr;
  }
  .about-cert {
    grid-column: auto;
    grid-row: auto;
  }
  .span-2 {
    grid-column: span 1;
  }
  .contact-card--cv {
    grid-column: auto;
    grid-row: auto;
  }
  .articles-grid {
    grid-template-columns: 1fr;
  }
  .articles-hero {
    padding: 56px 20px;
  }
  .video-card,
  .video-card--wide {
    flex-basis: 100%;
  }
  .case-hero {
    padding: 48px 0;
  }
  .case-hero__inner {
    flex-direction: column;
    gap: 32px;
    padding: 0 20px;
  }
  .case-info {
    grid-template-columns: 1fr;
    padding: 40px 20px;
  }
  .info-point {
    padding-right: 0;
  }
  .case-body {
    padding: 40px 20px;
    gap: 40px;
  }
  .case-row {
    flex-direction: column;
    gap: 8px;
  }
  .case-row__title {
    flex-basis: auto;
  }
  .case-features,
  .case-bonus,
  .case-embeds,
  .case-stats,
  .case-showcase,
  .ba-block,
  .case-mobile,
  .case-wide,
  .phase-flow {
    padding: 40px 20px;
  }
  .phase-flow {
    flex-direction: column;
  }
  .phase-flow__arrow {
    margin-top: 0;
    align-self: center;
    transform: rotate(90deg);
  }
  .ba-labels span {
    font-size: 26px;
  }
  .ba-pair-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .case-mobile__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .case-proto {
    padding: 40px 0;
  }
  .case-proto__head {
    padding: 0 20px;
  }
  .case-promo {
    padding: 0 20px;
  }
  .case-stats__grid,
  .case-stats__grid--3 {
    grid-template-columns: 1fr;
  }
}
