/* ---------- Кольори тем ---------- */
:root {
  --accent: #ff2d95;          /* денна тема — рожевий; нічна — зелений з тла сцени */
  --accent-glow: rgba(255, 45, 149, .7);
  --accent-ink: #ffffff;
  --bg: #f7e304;           /* жовтий з постера */
  --card: rgba(255, 255, 255, 0.82);
  --row: #ffffff;
  --row-hover: #fdf0f6;
  --text: #17121a;
  --muted: #6d6470;
  --line: rgba(23, 18, 26, 0.08);
  --shadow: 0 24px 60px -20px rgba(80, 10, 50, 0.35);
  --note: #2f4a1e;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #17201a;
  --card: rgba(24, 19, 27, 0.78);
  --row: #221b26;
  --row-hover: #22302a;
  --accent: #2f7a50;
  --accent-glow: rgba(47, 122, 80, .6);
  --text: #f5eff6;
  --muted: #a99fac;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8);
  --note: #f7e304;
  color-scheme: dark;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  transition: background-color .3s, color .3s;
}

/* Нічна тема: градієнтне тло в зелених тонах сцени. Окремий fixed-шар, бо
   background-attachment: fixed не працює в Safari на iPhone */
[data-theme="dark"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 70% 55% at 15% 5%, rgba(47, 122, 80, .45), transparent 70%),
    radial-gradient(ellipse 60% 50% at 90% 95%, rgba(247, 227, 4, .12), transparent 70%),
    radial-gradient(ellipse 55% 45% at 85% 30%, rgba(35, 92, 60, .35), transparent 70%),
    linear-gradient(165deg, #1d3326 0%, #172219 45%, #14180f 100%);
}

a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }

/* ---------- Сцена з постера в картці ---------- */
/* Показуємо нижні 75% постера: зверху там лише порожнє жовте тло */
.stage {
  position: relative;
  aspect-ratio: 1125 / 1505;
  margin: 0 -4px;
  border-radius: 24px;
  overflow: hidden;
  background: #f7e304;
  box-shadow: 0 16px 40px -16px rgba(60, 50, 0, .45);
}
/* Нічна тема: замість жовтого — зелений градієнт, світлий зверху і темний донизу */
[data-theme="dark"] .stage {
  background: linear-gradient(180deg, #7fc79a 0%, #3f8f5f 35%, #1d4a31 70%, #0c2618 100%);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .8);
}
.scene {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  aspect-ratio: 1125 / 2006;
}

.piece {
  position: absolute;
  left: var(--l);
  top: var(--t);
  width: var(--w);
  max-width: none;
  transform-origin: var(--o, 50% 100%);
  /* bloom анімує scale, sway — rotate, bob — translate, тому вони не заважають одна одній */
  animation:
    bloom 1s cubic-bezier(.2, .9, .3, 1.25) var(--d, 0s) both,
    sway var(--sd, 4s) ease-in-out calc(var(--d, 0s) + 1s) infinite,
    bob calc(var(--sd, 4s) * .7) ease-in-out calc(var(--d, 0s) + 1s) infinite alternate;
}
/* Різний темп, щоб квіти гойдалися не в унісон */
.piece:nth-child(3n)     { --sd: 3.4s; }
.piece:nth-child(3n + 1) { --sd: 4.2s; }
.piece:nth-child(3n + 2) { --sd: 4.9s; }
.piece--artist {
  transform-origin: 50% 100%;
  animation: rise 1.2s cubic-bezier(.2, .8, .2, 1) .2s both;
}
/* Колібрі прилітає справа, потім зависає в повітрі й «дрижить» крильцями */
.piece--bird {
  animation:
    bird-in 1.6s cubic-bezier(.2, .8, .3, 1) 2s both,
    bird-hover 1.4s ease-in-out 3.6s infinite alternate,
    bird-buzz .18s linear 3.6s infinite alternate;
}

@keyframes bloom {
  from { scale: 0; opacity: 0; }
  to   { scale: 1; opacity: 1; }
}
/* Гойдання в обидва боки, починаючи з 0, щоб не було ривка після розквітання */
@keyframes sway {
  0%, 100% { rotate: 0deg; }
  25%      { rotate: var(--sw, 6deg); }
  75%      { rotate: calc(var(--sw, 6deg) * -1); }
}
@keyframes bob {
  from { translate: 0 0; }
  to   { translate: 0 -3%; }
}
@keyframes rise {
  from { translate: 0 10%; opacity: 0; }
  to   { translate: 0 0; opacity: 1; }
}
@keyframes bird-in {
  from { translate: 400% -150%; opacity: 0; }
  30%  { opacity: 1; }
  to   { translate: 0 0; opacity: 1; }
}
@keyframes bird-hover {
  from { translate: 0 0; }
  to   { translate: -10% -18%; }
}
@keyframes bird-buzz {
  from { rotate: -2deg; }
  to   { rotate: 2deg; }
}

/* Ноти, що пливуть знизу вгору за карткою */
.notes {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.note {
  position: absolute;
  top: 100%;
  left: var(--x);
  font-size: var(--size);
  line-height: 1;
  color: var(--note);
  opacity: 0;
  animation: note-float var(--dur) linear var(--delay) infinite;
  /* зсув від скролу (--push задає script.js) — поверх transform з анімації */
  translate: 0 calc(var(--push, 0) * var(--depth, 1) * 1px);
  rotate: calc(var(--push, 0) * var(--depth, 1) * 0.15deg);
  will-change: transform, translate, rotate, opacity;
}
@keyframes note-float {
  0%   { transform: translate(0, 0) rotate(-12deg); opacity: 0; }
  10%  { opacity: var(--alpha); }
  50%  { transform: translate(var(--sway), -60vh) rotate(8deg); }
  90%  { opacity: var(--alpha); }
  100% { transform: translate(0, -120vh) rotate(-6deg); opacity: 0; }
}

/* ---------- Верхня панель з перемикачами ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 460px;
  margin: 0 auto;
  padding: 16px 16px 0;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
  user-select: none;
}
.switch__label { color: var(--muted); }
.switch__opt { min-width: 1.2em; text-align: center; }

.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch__track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--line);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .2s;
}
.switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform .2s;
}
.switch input:checked + .switch__track .switch__thumb { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Картка ---------- */
.card {
  max-width: 460px;
  margin: 16px auto 40px;
  padding: 28px 20px 24px;
  border-radius: 28px;
  background: var(--card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}
@media (max-width: 492px) {
  .card { margin: 16px 16px 32px; }
}

.hero { text-align: center; }
/* Логотип поверх піджака: жовтий з постера + темна тінь, щоб читався і на піджаку, і на квітах.
   Тінь — на обгортці, бо filter під mask обрізався б разом з маскою */
.hero__name {
  position: absolute;
  left: 50%;
  bottom: 9%;
  width: 64%;
  margin: 0;
  translate: -50% 0;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .55));
  animation: stamp .7s cubic-bezier(.2, .9, .3, 1.3) 2.2s both;
}
.hero__logo {
  display: block;
  aspect-ratio: 900 / 816;
  background: #f7e304;
  -webkit-mask: url(assets/logo.png) center / contain no-repeat;
  mask: url(assets/logo.png) center / contain no-repeat;
}
/* Логотип «впечатується» після того, як квіти розквітли */
@keyframes stamp {
  from { scale: 1.6; opacity: 0; }
  to   { scale: 1; opacity: 1; }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.hero__tag { margin: 14px 0 0; color: var(--muted); font-weight: 500; }

.block { margin-top: 28px; }
.block__title {
  margin: 0 0 12px;
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Іконки (SVG через mask, щоб фарбувати CSS) ---------- */
.ico {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: none;
  background: var(--brand, currentColor);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

/* ---------- Платформи ---------- */
.platforms { display: grid; gap: 8px; }
.platform {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 12px 12px 16px;
  border-radius: 16px;
  background: var(--row);
  text-decoration: none;
  font-weight: 600;
  transition: background-color .15s, transform .15s;
}
.platform:hover { background: var(--row-hover); transform: translateY(-1px); }
.platform__name { flex: 1; }
.btn {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
}

/* ---------- OLIVAN Camp (благодійність) ---------- */
/* Синьо-жовтий блок, щоб виділявся в обох темах */
.camp {
  position: relative;
  overflow: hidden;
  padding: 22px 20px 18px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(155deg, #2a6fd6 0%, #0f3f94 55%, #0a2a66 100%);
  box-shadow: 0 18px 40px -18px rgba(13, 58, 138, .75);
}
/* Тепле жовте «сонце» в кутку */
.camp::before {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -70px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 213, 0, .45), transparent 70%);
  pointer-events: none;
}
.camp > * { position: relative; }
.camp__tag {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #ffd500;
}
.camp__title {
  margin: 0;
  font-family: "Unbounded", sans-serif;
  font-weight: 800;
  font-size: 24px;
  line-height: 1.15;
}
.camp__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background: #ffd500;
  color: #0a2a66;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  box-shadow: 0 10px 24px -10px rgba(255, 213, 0, .8);
  transition: transform .15s, filter .15s;
}
.camp__btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.camp__btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.camp__note {
  margin: 10px 0 0;
  font-size: 12px;
  text-align: center;
  color: rgba(255, 255, 255, .7);
}

/* ---------- Реліз ---------- */
.release { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.release__cover { width: 72px; height: 72px; border-radius: 12px; }
.release__name { margin: 0; font-weight: 700; font-size: 18px; }
.release__artist { margin: 0; color: var(--muted); }
.player { display: block; width: 100%; border: 0; border-radius: 12px; }

/* ---------- Відео ---------- */
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Біо ---------- */
.bio p { margin: 0 0 10px; }
.bio p:last-child { margin-bottom: 0; }

/* ---------- Соцмережі ---------- */
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.block:has(.socials) .block__title { text-align: center; }
/* Яскраві кнопки акцентного кольору з білими іконками — щоб виділялися на картці */
.socials a {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 20px -8px var(--accent-glow);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.socials a:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 12px 24px -8px var(--accent-glow);
}
.socials .ico { width: 26px; height: 26px; }

/* ---------- Футер ---------- */
.footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
.footer p { margin: 0; }
/* Пошта — яскраво-рожева, щоб було видно, що її можна натиснути */
.footer a {
  color: #ff2d95;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color .15s;
}
.footer a:hover { color: #ff5aac; }
.footer__copy { margin-top: 6px !important; font-size: 12px; }

a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .notes { display: none; }
  .piece, .hero__name { animation: none !important; }
}

/* Вузькі телефони: ховаємо слово «ТЕМА», іконки ☀︎/☾ лишаються */
@media (max-width: 400px) {
  .topbar { padding-inline: 16px; gap: 8px; }
  .switch { padding: 8px 10px; gap: 6px; }
  .switch:first-child .switch__label { display: none; }
  /* Усі 5 соцмереж в один рядок */
  .socials { gap: 8px; }
  .socials a { width: 52px; height: 52px; border-radius: 15px; }
  .socials .ico { width: 24px; height: 24px; }
}
