/* Головна: привітання, переваги, каталог тестів */

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 72px 48px;
  padding-top: 40px;
  padding-bottom: 72px;
}
.hero__text { flex: 1 1 460px; min-width: 0; }
.hero .scribble {
  margin-bottom: 10px;
  font-size: 32px;
  line-height: 1.15;
  transform: rotate(-2deg);
  transform-origin: left;
}
.hero__title {
  margin: 0;
  font: 800 clamp(34px, 5.2vw, 64px)/1.08 var(--font-display);
  letter-spacing: -0.03em;
}
.hero__title .hl {
  display: inline-block;
  margin-top: 6px;
  padding: 0 12px;
  background: var(--lavender);
  border: var(--line);
  border-radius: 14px 24px 12px 22px / 22px 12px 24px 14px;
  transform: rotate(-1.5deg);
}
.hero__lead { max-width: 520px; margin: 24px 0 32px; font-size: 20px; }

.hero__scene { position: relative; flex: 1 1 420px; min-width: 0; height: 400px; }
.hero__board { position: absolute; inset: 60px 0 0; background: var(--lavender); }
.hero__scene .mascot { position: absolute; }
.hero__cat { left: 50%; top: 0; transform: translateX(-60%); }
.hero__dog { left: 7%; bottom: 18px; }
.hero__parrot { right: 6%; bottom: 40px; transform: scaleX(-1); }
.hero__bubble {
  position: absolute;
  right: 8%;
  top: 96px;
  max-width: 210px;
  margin: 0;
  padding: 10px 16px;
  font: 700 26px/1.1 var(--font-hand);
  background: var(--white);
  transform: rotate(3deg);
}
.hero__star { position: absolute; }
.hero__star--a { left: 10%; top: 110px; }
.hero__star--b { left: 44%; bottom: 60px; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  padding-bottom: 72px;
}
.feature {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px;
  background: var(--white);
}
.feature:nth-child(1) { transform: rotate(-0.6deg); }
.feature:nth-child(2) { transform: rotate(0.5deg); }
.feature:nth-child(3) { transform: rotate(-0.4deg); }
.feature svg { flex-shrink: 0; }
.feature h3 { margin: 0 0 4px; font: 800 18px var(--font-display); }
.feature p { margin: 0; color: var(--muted); }

.catalog { padding-bottom: 96px; scroll-margin-top: 16px; }
.catalog__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 28px;
}
.catalog__head h2 {
  margin: 0;
  font: 800 clamp(26px, 3.4vw, 40px) var(--font-display);
  letter-spacing: -0.02em;
}
/* Пошук і рівень — одна панель. */
.finder { display: flex; align-items: center; gap: 6px; min-height: 64px; margin-bottom: 24px; padding: 8px 8px 8px 20px; background: var(--white); }
.finder__search { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; }
.finder__search input { flex: 1; min-width: 0; height: 44px; font: 700 18px var(--font-body); color: var(--ink); background: none; border: 0; outline: 0; }
.finder__search input::placeholder { color: var(--muted); font-weight: 600; }
.finder:has(input:focus-visible) { outline: 3px solid var(--violet); outline-offset: 3px; }
.finder__level { flex-shrink: 0; padding-left: 8px; border-left: 2px solid rgb(31 29 26 / .15); }
.finder__toggle { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 16px; font: 800 16px var(--font-body); cursor: pointer; list-style: none; border-radius: 12px; }
.finder__toggle::-webkit-details-marker { display: none; }
.finder__toggle::after { content: ""; width: 8px; height: 8px; margin-top: -4px; border: solid var(--ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.finder__level[open] .finder__toggle::after { margin-top: 4px; transform: rotate(-135deg); }
.finder__toggle:hover { background: var(--tint-yellow); }
.finder__chosen { padding: 4px 10px; background: var(--yellow); border-radius: 8px; }
.finder__menu { right: 0; left: auto; width: 320px; max-height: 360px; overflow-y: auto; }
.finder__option { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.finder__option small { font-weight: 700; color: var(--muted); }
.finder__option[aria-pressed="true"] { background: var(--yellow); }

/* Тести — квитки (корінець з рівнем | назва й результат | дія). */
.tickets { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.ticket {
  position: relative;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 220px;
  min-height: 92px;
  background: var(--white);
  border: var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s;
}
.ticket:has(.ticket__link:hover) { transform: translate(-2px, -3px) rotate(-.4deg); }

/* Перфорація з вирізами зверху й знизу. */
.ticket__stub, .ticket__end { position: relative; display: flex; align-items: center; }
.ticket__stub { padding: 12px 18px; font: 800 13px/1.3 var(--font-display); letter-spacing: .03em; text-transform: uppercase; border-right: 2.5px dashed var(--ink); border-radius: 12px 0 0 12px; }
.ticket__stub::before, .ticket__stub::after { content: ""; position: absolute; right: -12px; width: 20px; height: 10px; background: var(--paper); border: var(--line); }
.ticket__stub::before { top: -2.5px; border-top: 0; border-radius: 0 0 12px 12px; }
.ticket__stub::after { bottom: -2.5px; border-bottom: 0; border-radius: 12px 12px 0 0; }
.ticket__stub--mint { background: var(--mint); }
.ticket__stub--lavender { background: var(--tint-lavender); }
.ticket__stub--yellow { background: var(--tint-yellow); }
.ticket__stub--peach { background: var(--tint-peach); }

.ticket__main { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; padding: 12px 24px; }
/* Місце під штамп — лише коли він є. */
.ticket__main:has(.ticket__stamp) { padding-right: 150px; }
.ticket__title { margin: 0; font: 600 18px/1.25 var(--font-display); }
.ticket__link { text-decoration: none; }
/* Увесь квиток клікабельний */
.ticket__link::after { content: ""; position: absolute; inset: 0; }
.ticket__meta { margin: 0; font-size: 15px; color: var(--muted); }
.ticket__progress { margin-left: 10px; font-weight: 800; color: var(--violet); }
.ticket__stamp {
  position: absolute;
  top: 50%;
  right: 28px;
  display: grid;
  place-items: center;
  min-width: 96px;
  min-height: 52px;
  margin-top: -26px;
  padding: 0 8px;
  font: 700 24px/1 var(--font-hand);
  color: #2F8F6B;
  border: 3px double #2F8F6B;
  border-radius: 10px;
  transform: rotate(-10deg);
}
.ticket__end { justify-content: center; padding: 12px; border-left: 2.5px dashed var(--ink); }
.ticket__cta { position: relative; z-index: 1; white-space: nowrap; }
.ticket__cta--again { gap: 6px; background: var(--mint); }

.catalog__more { margin: 28px 0 0; text-align: center; }

.catalog__empty {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--white);
}
.catalog__empty .scribble { font-size: 28px; line-height: 1.2; }

@media (max-width: 720px) {
  .hero { gap: 32px; padding-top: 10px; padding-bottom: 32px; }
  .hero__text { flex-basis: 100%; }
  .hero .scribble { font-size: 26px; margin-bottom: 4px; }
  .hero__lead { margin: 16px 0 20px; font-size: 17px; }
  .hero__cta { display: flex; width: 100%; }
  .hero__cta svg { display: none; }

  .hero__scene { flex-basis: 100%; height: 210px; }
  .hero__board { inset: 44px 0 0; }
  .hero__cat { width: 110px; height: 101px; transform: translateX(-50%); }
  .hero__dog { width: 100px; height: 92px; left: 14px; bottom: 8px; }
  .hero__parrot { width: 92px; height: 84px; right: 14px; bottom: 12px; }
  .hero__bubble, .hero__star { display: none; }

  /* У мобільному макеті блоку переваг немає */
  .features { display: none; }

  .catalog { padding-inline: 0; padding-bottom: 24px; }
  .catalog__head { display: block; margin-bottom: 20px; }
  .catalog__head h2 { margin: 0 16px 14px; font-size: 26px; }
  .finder { flex-direction: column; align-items: stretch; gap: 0; margin: 0 16px 20px; padding: 0; }
  .finder__search { padding: 4px 14px; }
  .finder__search input { font-size: 16px; }
  .finder__level { padding: 0; border-top: 2px solid rgb(31 29 26 / .1); border-left: 0; }
  .finder__toggle { justify-content: flex-start; padding: 0 14px; font-size: 15px; border-radius: 0 0 16px 16px; }
  .finder__toggle::after { margin-left: auto; }
  .finder__menu { right: -2.5px; left: -2.5px; width: auto; }

  .tickets { padding-inline: 16px; }
  .catalog__empty { margin-inline: 16px; }

  /* На телефоні квиток складається: корінець зверху, назва, дія внизу. */
  .ticket { grid-template-columns: minmax(0, 1fr); }
  .ticket__stub { padding: 8px 16px; font-size: 12px; border-right: 0; border-bottom: 2.5px dashed var(--ink); border-radius: 12px 12px 0 0; }
  .ticket__stub::before, .ticket__stub::after { display: none; }
  .ticket__main { padding: 12px 16px; }
  .ticket__main:has(.ticket__stamp) { padding-right: 112px; }
  .ticket__title { font-size: 16px; }
  .ticket__meta { font-size: 14px; }
  .ticket__progress { display: block; margin-left: 0; }
  .ticket__stamp { right: 14px; min-width: 80px; min-height: 44px; margin-top: -22px; font-size: 21px; }
  .ticket__end { justify-content: flex-start; padding: 0 16px 14px; border-left: 0; }
}
