/*
 * Petopia landing page: the app's own look (cream paper, ink outlines,
 * chunky rounded cards and buttons with a bottom lip, Nunito), and the real
 * 3D pals and screens of the game.
 */
:root {
  --cream: #fff8ee;
  --cream-deep: #fbebd6;
  --paper: #ffffff;
  --ink: #3d2a2e;
  --ink-soft: #7a6468;
  --ink-faint: #b8a8a6;
  --line: #f0dcc4;
  --coral: #ff6b6b;
  --coral-deep: #e24f57;
  --peach: #ffb38a;
  --sun: #ffc93c;
  --mint: #5ed3bc;
  --mint-deep: #2fb597;
  --grape: #8e6cf0;
  --grape-deep: #6f4fd6;
  --sky: #a9ddfb;
  --forest: #1f3d2b;
  --forest-2: #2c5a3c;
  --radius: 28px;
  --gutter: 16px;
  --max: 1120px;
  --lip: 0 5px 0 var(--ink);
  --soft-shadow: 0 14px 30px rgba(107, 63, 42, 0.14);
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 700;
  line-height: 1.55;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--grape);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Grid and flex children may shrink below their images' natural width. */
.hero .wrap > *,
.split > *,
.duel-grid > *,
.modes > *,
.pal-cards > *,
.friends > * {
  min-width: 0;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (min-width: 720px) {
  :root {
    --gutter: 28px;
  }
}

/* ---------------------------------------------------------------- type */

h1,
h2,
h3 {
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 {
  font-size: clamp(2.3rem, 6.4vw, 4.1rem);
}

h2 {
  font-size: clamp(1.85rem, 4.6vw, 3rem);
}

h3 {
  font-size: 1.3rem;
}

p {
  margin: 0;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral-deep);
}

.lead {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  color: var(--ink-soft);
  font-weight: 700;
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: var(--coral);
  color: #fff;
  font-weight: 900;
  font-size: 1.02rem;
  text-decoration: none;
  box-shadow: var(--lip);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--ink);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--ink);
}

.btn-soft {
  background: var(--paper);
  color: var(--ink);
}

.btn-grape {
  background: var(--grape);
}

.btn-mint {
  background: var(--mint);
  color: var(--ink);
}

.btn-small {
  min-height: 42px;
  padding: 8px 16px;
  font-size: 0.92rem;
  box-shadow: 0 4px 0 var(--ink);
}

.store-badge {
  display: inline-flex;
  border-radius: 14px;
  border: 3px solid var(--ink);
  box-shadow: var(--lip);
  overflow: hidden;
  transition: transform 0.12s ease;
}

.store-badge:hover {
  transform: translateY(-2px);
}

.store-badge svg {
  display: block;
  width: 168px;
  height: 56px;
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 248, 238, 0.86);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 2px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
  font-size: 1.35rem;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.site-nav {
  display: none;
  gap: 22px;
  font-weight: 900;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
}

.site-nav a:hover {
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang {
  font-weight: 900;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--ink-soft);
  border: 2px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 6px 12px;
}

@media (min-width: 900px) {
  .site-nav {
    display: flex;
  }
}

.lang-hint {
  display: none;
  background: var(--grape);
  color: #fff;
  text-align: center;
  font-weight: 900;
  padding: 8px var(--gutter);
}

.lang-hint a {
  color: #fff;
}

.lang-hint.show {
  display: block;
}

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  padding: 40px 0 56px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  right: -18vw;
  top: -12vw;
  width: 70vw;
  height: 70vw;
  max-width: 900px;
  max-height: 900px;
  border-radius: 50%;
  background: #ffe3d0;
  z-index: -1;
}

.hero .wrap {
  display: grid;
  gap: 36px;
  align-items: center;
}

@media (min-width: 960px) {
  .hero {
    padding: 64px 0 88px;
  }

  .hero .wrap {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 48px;
  }
}

.hero-copy {
  display: grid;
  gap: 20px;
}

.pill-new {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 6px 14px 6px 8px;
  font-weight: 900;
  font-size: 0.92rem;
  text-decoration: none;
}

.pill-new b {
  background: var(--grape);
  color: #fff;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.hero h1 em {
  font-style: normal;
  color: var(--coral-deep);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 900;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.hero-visual {
  position: relative;
  min-height: 320px;
}

.hero-screen {
  position: relative;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 0 var(--ink), var(--soft-shadow);
  transform: rotate(-2deg);
  background: #d3e6cb;
}

.hero-screen img {
  width: 100%;
}

.hero-screen .tag {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.float {
  position: absolute;
  filter: drop-shadow(0 12px 14px rgba(61, 42, 46, 0.18));
  animation: bob 5s ease-in-out infinite;
}

.float.a {
  width: 34%;
  right: -4%;
  top: -18%;
}

.float.b {
  width: 18%;
  left: -9%;
  top: 34%;
  animation-delay: -1.6s;
}

.float.c {
  width: 26%;
  right: 6%;
  bottom: -20%;
  animation-delay: -3s;
}

.float.sticker {
  width: 22%;
  left: -4%;
  bottom: -20%;
  animation: wiggle 2.4s ease-in-out infinite;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(-8deg);
  }
  50% {
    transform: rotate(4deg);
  }
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 4px 10px;
  font-weight: 900;
  font-size: 0.85rem;
}

/* Invite and duel banners (shown by landing.js). */
.banner {
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: var(--paper);
  padding: 16px 18px;
  display: grid;
  gap: 10px;
  box-shadow: var(--lip);
}

.banner[hidden] {
  display: none;
}

.banner.duel {
  background: #f1ebff;
}

.banner h2 {
  font-size: 1.35rem;
}

.banner .code-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.banner code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 1.2rem;
  letter-spacing: 0.2em;
  background: var(--cream);
  border: 2px dashed var(--ink-faint);
  border-radius: 12px;
  padding: 6px 12px;
}

/* ---------------------------------------------------------------- sections */

section {
  scroll-margin-top: 76px;
}

.section {
  padding: 72px 0;
}

.section-head {
  display: grid;
  gap: 12px;
  max-width: 760px;
  margin-bottom: 36px;
}

.split {
  display: grid;
  gap: 36px;
  align-items: center;
}

@media (min-width: 960px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 56px;
  }

  .split.flip > :first-child {
    order: 2;
  }
}

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

.ticks li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--ink-soft);
}

.ticks li b {
  color: var(--ink);
}

.ticks .ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 2px solid var(--line);
  font-size: 1.05rem;
}

.card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 6px 0 var(--ink);
  overflow: hidden;
}

.shot {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 0 var(--ink), var(--soft-shadow);
  background: var(--paper);
}

/* Three ways to play */
.modes {
  display: grid;
  gap: 16px;
}

@media (min-width: 760px) {
  .modes {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mode {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 22px 22px 118px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 6px 0 var(--ink);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.15s ease;
}

.mode:hover {
  transform: translateY(-3px);
}

.mode p {
  color: var(--ink-soft);
}

.mode img {
  position: absolute;
  right: 12px;
  bottom: -6px;
  width: 128px;
}

.mode .go {
  font-weight: 900;
}

.mode.drop {
  background: #ffe3de;
}

.mode.duel {
  background: #ece6ff;
}

.mode.yard {
  background: #dff5ef;
}

/* The Drop ladder */
.ladder {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px 4px;
  align-items: end;
  margin-top: 22px;
}

@media (min-width: 700px) {
  .ladder {
    grid-template-columns: repeat(12, 1fr);
  }
}

.ladder figure {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
}

.ladder figcaption {
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--ink-soft);
  white-space: nowrap;
}

.ladder .legend figcaption {
  color: #b9860a;
}

/* Pal Duel band */
.duel-band {
  background: radial-gradient(1200px 500px at 80% -10%, #3f7a4d 0%, transparent 60%), linear-gradient(180deg, var(--forest-2), var(--forest));
  color: #fff8ee;
}

.duel-band .kicker {
  color: var(--sun);
}

.duel-band .lead,
.duel-band .ticks li {
  color: #d9e9d8;
}

.duel-band .ticks li b {
  color: #fff;
}

.duel-band .ticks .ico {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.duel-band .shot {
  box-shadow: 0 6px 0 #0f2016, 0 24px 50px rgba(0, 0, 0, 0.35);
}

.stickers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 28px;
}

@media (min-width: 760px) {
  .stickers {
    grid-template-columns: repeat(8, 1fr);
  }
}

.sticker {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
  transition: transform 0.15s ease;
}

.sticker:hover {
  transform: rotate(-6deg) scale(1.06);
}

.sticker figcaption {
  font-weight: 900;
  font-size: 0.9rem;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  text-align: center;
  line-height: 1.15;
}

.titles {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x mandatory;
  margin-top: 26px;
}

.title-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 108px;
  padding: 10px 10px 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.title-chip svg {
  width: 26px;
  height: 26px;
}

.title-chip b {
  font-size: 0.86rem;
  line-height: 1.15;
}

.title-chip span {
  font-size: 0.78rem;
  color: #b9cfb8;
}

.duel-grid {
  display: grid;
  gap: 28px;
  margin-top: 40px;
  align-items: center;
}

@media (min-width: 900px) {
  .duel-grid {
    grid-template-columns: 0.8fr 1.2fr;
  }
}

/* The Yard */
.islands {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.phone {
  position: relative;
  max-width: 360px;
  margin: 0 auto;
  border: 3px solid var(--ink);
  border-radius: 44px;
  padding: 10px;
  background: var(--ink);
  box-shadow: 0 8px 0 #22171a, var(--soft-shadow);
}

.phone img {
  border-radius: 34px;
}

/* Pals */
.stages,
.colors {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-items: end;
}

.stages figure,
.colors figure,
.mosaic figure {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
}

.stages figcaption,
.colors figcaption,
.mosaic figcaption {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--ink-soft);
  text-align: center;
}

.pal-cards {
  display: grid;
  gap: 16px;
}

@media (min-width: 860px) {
  .pal-cards {
    grid-template-columns: 1fr 1fr;
  }
}

.pal-cards .card {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 6px;
  margin-top: 26px;
}

@media (min-width: 640px) {
  .mosaic {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (min-width: 980px) {
  .mosaic {
    grid-template-columns: repeat(8, 1fr);
  }
}

.mosaic small {
  display: block;
  font-size: 0.7rem;
  color: var(--ink-faint);
  font-weight: 800;
}

/* Friends */
.friends {
  display: grid;
  gap: 16px;
}

@media (min-width: 760px) {
  .friends {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1040px) {
  .friends {
    grid-template-columns: repeat(4, 1fr);
  }
}

.friends .card {
  padding: 20px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.friends .card .emoji {
  font-size: 1.8rem;
}

.friends .card p {
  color: var(--ink-soft);
}

/* FAQ */
.faq {
  display: grid;
  gap: 12px;
  max-width: 860px;
}

.faq details {
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: 0 4px 0 var(--ink);
}

.faq summary {
  cursor: pointer;
  font-weight: 900;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 1.4rem;
  line-height: 1;
  color: var(--coral-deep);
}

.faq details[open] summary::after {
  content: "–";
}

.faq details p {
  margin-top: 10px;
  color: var(--ink-soft);
}

/* Final call */
.final {
  position: relative;
  overflow: hidden;
  background: var(--coral);
  color: #fff;
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  padding: 64px 0 180px;
  text-align: center;
}

@media (min-width: 760px) {
  .final {
    padding: 80px 0 90px;
  }
}

.final h2 {
  color: #fff;
}

.final .lead {
  color: #ffe9e4;
  margin: 12px auto 26px;
  max-width: 620px;
}

.final .cta-row {
  justify-content: center;
}

.final .pal {
  position: absolute;
  bottom: -10px;
  width: 150px;
}

.final .pal.l {
  left: 2%;
}

.final .pal.r {
  right: 2%;
  width: 190px;
}

/* Footer */
.site-footer {
  padding: 36px 0 48px;
  color: var(--ink-soft);
}

.site-footer .wrap {
  display: grid;
  gap: 16px;
}

@media (min-width: 760px) {
  .site-footer .wrap {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-weight: 900;
}

.site-footer nav a {
  text-decoration: none;
}

.site-footer nav a:hover {
  color: var(--ink);
}

/* Reveal on scroll (landing.js); nothing hides without it. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .float,
  .float.sticker {
    animation: none;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.banner.egg {
  background: #fff6dc;
  border-color: #e0a800;
}
