/* Стиль наліпок із мультяшного аватара Мартік: чорний контур, жорстка тінь, плоскі кольори. */

@font-face {
  font-family: "Rubik";
  src: url("/fonts/rubik-cyrillic.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Rubik";
  src: url("/fonts/rubik-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --ink: #0b0b16;
  --blue: #2038c8;
  --blue-deep: #121c86;
  --yellow: #ffd400;
  --play: #d90f45; /* малиново-червона кнопка відео */
  --paper: #fffdf5;
  --muted: #3c3c4c;
  --line: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --gutter: 17px;
  /* Як на Liinks: колонка 530 px, висота картки 32% її ширини, фото квадратне на всю висоту. */
  --column: 530px;
  --thumb: calc((min(100vw, var(--column)) - 2 * var(--gutter)) * 0.32);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--blue-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
}

/* Розмитий банер ITS MARTIK на весь екран. Окремий шар, бо фіксований фон не працює в Safari на iPhone. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--blue-deep) url("/img/bg.webp") center / cover no-repeat;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.page {
  max-width: var(--column);
  margin-inline: auto;
  padding-bottom: 56px;
}

/* Шапка */
.hero__banner {
  width: 100%;
  height: auto;
  border-bottom: var(--line);
}

.hero__who {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-top: -56px;
  padding-inline: var(--gutter);
}

.hero__avatar {
  flex: none;
  width: 120px;
  height: 120px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: var(--shadow);
}

.hero__name {
  margin: 0 0 4px;
  font-size: clamp(2rem, 9vw, 2.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 3px 3px 0 var(--ink);
}

.bubble {
  position: relative;
  margin: 18px var(--gutter) 0;
  padding: 14px 16px;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.35;
  background: var(--paper);
  border: var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.bubble::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 42px;
  width: 20px;
  height: 20px;
  background: var(--paper);
  border-top: var(--line);
  border-left: var(--line);
  transform: rotate(45deg) skew(8deg, 8deg);
}

/* Розділи */
.section {
  margin-top: 34px;
  padding-inline: var(--gutter);
}

.section--first {
  margin-top: 28px;
}

.tag {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 12px 7px;
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--yellow);
  background: var(--ink);
  border-radius: 8px;
  transform: rotate(-1.5deg);
}

.stack {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack > li[hidden] {
  display: none;
}

/* Спільна поведінка наліпок */
.card,
.video,
.pill {
  background: var(--paper);
  border: var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

@media (hover: hover) {
  .card:hover,
  .video:hover,
  .pill:hover {
    transform: translate(-2px, -2px) rotate(-0.5deg);
    box-shadow: 7px 7px 0 var(--ink);
  }
}

.card:active,
.video:active,
.pill:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--ink);
}

/* Картки-посилання */
.card {
  display: grid;
  grid-template-columns: var(--thumb) minmax(0, 1fr);
  min-height: var(--thumb);
  border-radius: 18px;
  overflow: hidden;
}

.card__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-right: var(--line);
}

/* Логотип у колі: лишаємо поля, щоб не обрізати кота. */
.card__media--logo {
  object-fit: contain;
  padding: 8px;
  background: #fff;
}

.card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 12px 14px;
}

.card__title {
  font-size: 1.1875rem;
  font-weight: 800;
  line-height: 1.15;
}

.card__note {
  font-size: 0.9375rem;
  line-height: 1.3;
  color: var(--muted);
}

/* Картки з мультяшною наліпкою, що виходить за край */
.card--sticker {
  overflow: visible;
}

.card__sticker {
  width: calc(var(--thumb) + 14px);
  height: calc(var(--thumb) + 14px);
  margin: -16px 0 -6px -8px;
  object-fit: contain;
  transform: rotate(-4deg);
}

.card--yellow {
  background: var(--yellow);
}

.card--yellow .card__title {
  font-size: 1.375rem;
}

/* Відео */
.video {
  display: block;
  border-radius: 18px;
  overflow: hidden;
}

.video__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--ink);
}

.video__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video__play {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 50px;
  height: 36px;
  background: var(--play);
  border: var(--line);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
}

/* Білий трикутник, як у логотипі YouTube: на червоному його видно краще за чорний. */
.video__play::before {
  content: "";
  margin-left: 3px;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent #fff;
}

.video__title {
  display: block;
  padding: 12px 14px 13px;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
  border-top: var(--line);
}

/* Співпраця */
.pill {
  display: block;
  padding: 15px 16px;
  font-size: 1.125rem;
  font-weight: 800;
  text-align: center;
  border-radius: 999px;
}

/* Сторінка 404 */
.lost {
  padding: 72px var(--gutter) 0;
  text-align: center;
}

.lost__title {
  margin: 0 0 24px;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.1;
  color: #fff;
  text-shadow: 3px 3px 0 var(--ink);
}

/* На великому екрані банер стає окремою наліпкою */
@media (min-width: 530px) {
  :root {
    --gutter: 33px;
  }

  .page {
    padding-top: 28px;
  }

  .hero__banner {
    width: calc(100% - 2 * var(--gutter));
    margin-inline: var(--gutter);
    border: var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .video,
  .pill {
    transition: none;
  }

  .card:hover,
  .video:hover,
  .pill:hover,
  .card:active,
  .video:active,
  .pill:active {
    transform: none;
  }
}
