/* Homepage layout (sketch pages 1–3) */

/* Banners with characters either side */
.banner { padding: 5rem 0; text-align: center; overflow: clip; }
.banner--lovable { background: var(--paper); border-block: 1px solid var(--line); }
.banner--extra { background: var(--teal); color: #fff; }
.banner--extra .banner__copy .lead { color: rgba(255, 255, 255, 0.85); }
.banner--extra .btn { background: var(--cream); color: var(--charcoal); border-color: var(--cream); }
.banner--extra .btn--ghost { background: transparent; color: #fff; border-color: #fff; }
.banner .wrap { display: grid; grid-template-columns: 1fr 2.2fr 1fr; align-items: center; gap: 2rem; }
.banner__copy .lead { font-size: 1.3rem; max-width: 36ch; margin: 0 auto 2rem; color: var(--charcoal-soft); }
.banner .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.banner--welcome h1 { font-size: clamp(3rem, 6.5vw, 5.6rem); }

.pals { position: relative; height: 300px; }
.pals img {
  position: absolute;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 6px solid var(--paper);
  box-shadow: 0 18px 36px -18px rgba(43, 43, 46, 0.45);
}
.pals img:nth-child(1) { width: 190px; height: 190px; top: 0; }
.pals img:nth-child(2) { width: 140px; height: 140px; bottom: 0; }
.pals--left img:nth-child(1) { left: 0; }
.pals--left img:nth-child(2) { right: 0; }
.pals--right img:nth-child(1) { right: 0; }
.pals--right img:nth-child(2) { left: 0; }

/* Lovables / Extralovables split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.split__tile {
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.2s ease;
}
.split__tile:hover { transform: translateY(-4px); }
.split__tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
.split__tile > div { padding: 2.2rem 2.4rem 2.6rem; }
.split__tile h3 { font-size: clamp(2.2rem, 4vw, 3.2rem); }
.split__tile p { font-size: 1.2rem; }
.split__tile .more { font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.split__tile--lovable { background: var(--sage); }
.split__tile--extra { background: var(--charcoal); color: var(--cream); }

/* Carousels */
.rail-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 2.5rem; }
.rail-head h2 { margin: 0; }
.rail-nav { display: flex; gap: 0.6rem; flex: none; }
.rail-nav button {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid var(--charcoal);
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.rail-nav button:hover { background: var(--charcoal); color: var(--cream); }
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 4rem) / 3);
  gap: 2rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 0.5rem;
}
.rail::-webkit-scrollbar { display: none; }
.rail--four { grid-auto-columns: calc((100% - 6rem) / 4); }
.rail > * { scroll-snap-align: start; min-width: 0; }
.tile { text-decoration: none; display: block; }
.tile .thumb { border-radius: var(--radius); overflow: hidden; }
.tile .thumb img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform 0.4s ease; }
.tile:hover .thumb img { transform: scale(1.05); }
.tile h3 { margin: 1.1rem 0 0; }
.thumb--sound { aspect-ratio: 4 / 5; display: grid; place-items: center; background: var(--pink); color: #fff; }
.card--soon .thumb { aspect-ratio: 5 / 7; display: grid; place-items: center; background: var(--paper); border: 2px dashed var(--line); font: 700 6rem var(--display); color: var(--rose); }
.card--soon .price { font-size: 1rem; color: var(--charcoal-soft); }

/* Four perks */
.perks--four .wrap { grid-template-columns: repeat(4, 1fr); }
.perks--four .perk { padding: 2.4rem 1.6rem; }
.perks--four .perk strong { font-size: 1.4rem; }

/* Freebie */
.freebie { background: var(--rose); padding: 6rem 0; }
.freebie__card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  background: var(--cream);
  border-radius: calc(var(--radius) + 8px);
  padding: 4rem 4.5rem;
  box-shadow: 0 30px 60px -40px rgba(43, 43, 46, 0.5);
}
.freebie__visual { position: relative; padding: 1rem 2rem 4.5rem 0; }
.postcard {
  width: 82%;
  background: var(--paper);
  padding: 14px 14px 16px;
  border-radius: 8px;
  transform: rotate(-4deg);
  box-shadow: 0 24px 44px -24px rgba(43, 43, 46, 0.55);
}
.postcard img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: center 30%; border-radius: 4px; }
.postcard span { display: block; margin-top: 0.7rem; font: italic 700 1.15rem var(--display); text-align: center; }
.sticker {
  position: absolute;
  top: -0.5rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font: 700 1.45rem/1 var(--display);
  text-align: center;
  transform: rotate(12deg);
  box-shadow: 0 12px 24px -12px rgba(232, 85, 143, 0.8);
}
.player {
  position: absolute;
  left: 12%;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--paper);
  border-radius: 999px;
  padding: 0.55rem 1.4rem 0.55rem 0.55rem;
  box-shadow: 0 18px 36px -20px rgba(43, 43, 46, 0.55);
}
.player > div { flex: 1; min-width: 0; }
.player strong { display: block; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.25rem; }
.play {
  flex: none;
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 0;
  background: var(--charcoal);
  color: var(--cream);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.15s ease;
}
.play:hover, .playing .play { background: var(--pink); }
.wave { display: flex; align-items: center; gap: 3px; height: 22px; }
.wave i { flex: 1; background: var(--line); border-radius: 2px; height: 35%; }
.wave i:nth-child(3n) { height: 70%; } .wave i:nth-child(4n) { height: 100%; } .wave i:nth-child(5n+1) { height: 55%; }
.wave i:nth-child(-n+7) { background: var(--pink); }
.playing .wave i { animation: bounce 0.9s ease-in-out infinite alternate; }
.playing .wave i:nth-child(odd) { animation-delay: -0.45s; }
@keyframes bounce { to { transform: scaleY(0.4); } }
.time { font-size: 0.9rem; font-weight: 500; color: var(--charcoal-soft); }
.freebie__offer h2 { font-size: clamp(2.2rem, 3.6vw, 3.2rem); }
.freebie__offer p { font-size: 1.2rem; color: var(--charcoal-soft); max-width: 40ch; }
.freebie__offer small { display: block; margin-top: 0.8rem; font-size: 0.9rem; color: var(--charcoal-soft); padding-left: 1.4rem; }
.signup--pill {
  display: flex;
  gap: 0.4rem;
  margin-top: 1.6rem;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem;
  max-width: 520px;
}
.signup--pill:focus-within { border-color: var(--charcoal); }
.signup--pill input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0.8rem 1.1rem; font: 1.05rem var(--body); outline: none; }
.signup--pill .btn { flex: none; padding: 0.9rem 1.6rem; }

/* Footer nav */
.site-footer--home { padding-top: 3.5rem; }
.foot-nav { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 3rem; }
.foot-nav a { font: 700 clamp(1.4rem, 2.6vw, 2.2rem) var(--display); border-bottom: 3px solid transparent; padding-bottom: 0.2rem; }
.foot-nav a[aria-current="page"], .foot-nav a:hover { border-color: var(--pink); color: var(--cream); }

/* Responsive */
@media (max-width: 1100px) {
  .banner .wrap { grid-template-columns: 1fr; }
  .pals { display: none; }
  .banner__copy { order: -1; }
  .freebie__card { grid-template-columns: 1fr; gap: 3rem; padding: 3rem; }
  .freebie__visual { max-width: 520px; }
  .perks--four .wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .perks--four .wrap { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .freebie { padding: 3.5rem 0; }
  .freebie__card { padding: 2rem 1.4rem; border-radius: var(--radius); }
  .rail, .rail--four { grid-auto-columns: 75%; gap: 1rem; }
  .rail-nav button { width: 46px; height: 46px; }
  .banner { padding: 3.5rem 0; }
  .signup--pill { flex-direction: column; border-radius: 22px; }
  .signup--pill .btn { justify-content: center; }
  .freebie__offer small { padding-left: 0; }
  .foot-nav { justify-content: flex-start; gap: 1rem 2rem; }
}

/* New friends carousel */
.friends { overflow: hidden; }
.friends .hint { display: flex; align-items: center; gap: 0.5rem; margin: 0.8rem 0 0; font-size: 1rem; font-weight: 500; color: var(--charcoal-soft); }
.rail-nav button:disabled { opacity: 0.3; cursor: default; }
.rail-nav button:disabled:hover { background: transparent; color: var(--charcoal); }
.rail:focus-visible { outline: 3px solid var(--pink); outline-offset: 6px; border-radius: var(--radius); }
.rail.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.rail.is-dragging * { pointer-events: none; }
.rail--bleed {
  --gutter: max(24px, (100% - var(--wrap)) / 2);
  grid-auto-columns: clamp(270px, 24vw, 330px);
  gap: 1.5rem;
  padding: 0.75rem var(--gutter) 1.5rem;
  scroll-padding-inline: var(--gutter);
  cursor: grab;
  user-select: none;
}

.friend {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.friend:hover { transform: translateY(-6px); box-shadow: 0 26px 44px -28px rgba(43, 43, 46, 0.55); }
.friend__img { position: relative; display: block; background: var(--bg); overflow: hidden; }
.friend__img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform 0.5s ease; }
.friend:hover .friend__img img { transform: scale(1.06) rotate(-1deg); }
.friend .tag { top: 0.9rem; left: 0.9rem; font-size: 0.75rem; }
.friend__info { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.3rem 1.4rem 1.4rem; flex: 1; }
.friend h3 { font-size: 1.6rem; margin: 0 0 0.25rem; }
.friend h3 a { text-decoration: none; }
.friend p { font-size: 0.95rem; line-height: 1.35; color: var(--charcoal-soft); margin: 0; }
.friend__buy { display: flex; align-items: center; gap: 0.7rem; flex: none; }
.friend .price { font-weight: 700; font-size: 1.1rem; color: var(--teal); }
.add {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 0;
  background: var(--charcoal);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.add:hover { background: var(--pink); transform: scale(1.08); }
.add .tick { display: none; }
.add.is-added { background: var(--teal); }
.add.is-added .plus { display: none; }
.add.is-added .tick { display: block; }
.cart.bump b { animation: bump 0.4s ease; }
@keyframes bump { 50% { transform: scale(1.4); } }

.friend--soon { background: var(--charcoal); color: var(--cream); border-color: var(--charcoal); }
.friend--soon .friend__img { background: var(--charcoal); }
.friend--soon .friend__img img { filter: blur(22px) grayscale(1) brightness(0.7); transform: scale(1.2); }
.friend--soon:hover .friend__img img { transform: scale(1.25); }
.mystery { position: absolute; inset: 0; display: grid; place-items: center; font: 700 7rem var(--display); color: var(--rose); }
.friend--soon p { color: rgba(251, 246, 239, 0.7); }
.friend--soon .friend__info { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
.friend__link { flex: none; font-weight: 700; color: var(--rose); text-decoration: none; white-space: nowrap; }
.friend__link:hover { color: #fff; }

.friend--all {
  justify-content: flex-end;
  padding: 2rem;
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
  text-decoration: none;
}
.friend--all .eyebrow { color: #fff; opacity: 0.85; margin-bottom: 0.4rem; }
.friend--all strong { font: 700 2.6rem/1.05 var(--display); letter-spacing: -0.02em; }
.friend--all .arrow {
  margin-top: 1.6rem;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #fff;
  color: var(--pink);
  display: grid; place-items: center;
  font-size: 1.6rem;
  transition: transform 0.25s ease;
}
.friend--all:hover .arrow { transform: translateX(8px); }

.rail-progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 1.5rem; }
.rail-progress span { display: block; height: 100%; background: var(--charcoal); border-radius: 2px; transition: width 0.2s ease; }

@media (max-width: 980px) {
  .rail--bleed { grid-auto-columns: 74%; gap: 1rem; }
  .friends .rail-nav { display: none; }
  .friend h3 { font-size: 1.4rem; }
}
@media (hover: none) { .friend:hover { transform: none; box-shadow: none; } }

/* Hero characters: fixed to the viewport; the sections below scroll up over them */
main > section:first-child .pals {
  position: fixed;
  top: 11.5rem;
  width: 260px;
  height: 270px;
  z-index: 0;
}
main > section:first-child .pals--left  { left:  calc((100vw - min(var(--wrap), 100vw - 48px)) / 2); }
main > section:first-child .pals--right { right: calc((100vw - min(var(--wrap), 100vw - 48px)) / 2); }
/* the pals no longer take a grid cell, so keep the copy in the middle column */
main > section:first-child .banner__copy,
main > section:first-child .quote { grid-column: 2; }
/* every later section must be opaque and sit above the pinned images */
:where(main > section:not(:first-child)) { position: relative; z-index: 1; background-color: var(--cream); }
