/* Palworld Wiki - home section (landing page + /app/). Scoped under body.section-home.
   The hero glass Pal Sphere is pure CSS: radial gradients + a band + a specular gloss, floating
   in the containment void. No images, no canvas. Honors prefers-reduced-motion. */

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

body.section-home .home-hero,
body.section-home .app-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  align-items: center;
  padding: 26px 0 8px;
}

body.section-home .home-kicker {
  margin: 0 0 10px;
  font: 600 .78rem/1.4 var(--font-body);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

body.section-home .home-hero-copy h1 { margin-bottom: .4em; }

body.section-home .home-grad {
  background: linear-gradient(100deg, var(--accent), var(--el-ice) 55%, var(--el-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.section-home .home-tagline {
  max-width: 56ch;
  color: var(--ink-dim);
  font-size: 1.02rem;
}

body.section-home .home-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

/* the "iOS - coming soon" disabled pill */
body.section-home .home-soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  color: var(--ink-faint);
  font: 600 .9rem var(--font-body);
  cursor: default;
  user-select: none;
}

/* element spectrum pips */
body.section-home .home-els {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}
body.section-home .home-el {
  --el: var(--el-neutral);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--el) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--el) 42%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--el) 28%, transparent);
}
body.section-home .home-el img { display: block; }

/* ---- the CSS glass Pal Sphere ---- */

body.section-home .home-hero-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  order: -1; /* sphere above the copy on mobile */
}

body.section-home .home-sphere {
  position: relative;
  width: clamp(190px, 52vw, 300px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, .16);
  background:
    radial-gradient(circle at 33% 26%, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 50% 118%, rgba(47, 214, 190, .22), transparent 55%),
    radial-gradient(circle at 50% 45%, #17202e, #0b101b 68%, #070a12);
  box-shadow:
    0 0 60px rgba(47, 214, 190, .16),
    0 30px 80px rgba(0, 0, 0, .55),
    inset 0 0 44px rgba(10, 20, 35, .8),
    inset -14px -18px 50px rgba(0, 0, 0, .55),
    inset 10px 12px 30px rgba(255, 255, 255, .06);
  animation: home-float 7s ease-in-out infinite;
}

/* element plasma swirling behind the shell */
body.section-home .sphere-plasma {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 64%, rgba(47, 214, 190, .5), transparent 55%),
    radial-gradient(circle at 68% 36%, rgba(162, 75, 224, .38), transparent 55%),
    radial-gradient(circle at 55% 78%, rgba(55, 183, 240, .3), transparent 60%);
  filter: blur(10px);
  animation: home-plasma 9s ease-in-out infinite alternate;
}
body.section-home .sphere-plasma-b {
  inset: 20%;
  background:
    radial-gradient(circle at 60% 70%, rgba(143, 227, 255, .35), transparent 55%),
    radial-gradient(circle at 35% 35%, rgba(232, 220, 192, .16), transparent 50%);
  animation-duration: 12s;
  animation-direction: alternate-reverse;
}

/* the signature band + button */
body.section-home .sphere-band {
  position: absolute;
  left: -6%;
  right: -6%;
  top: 50%;
  height: 12.5%;
  transform: translateY(-50%);
  background: linear-gradient(180deg, #04060b, #0d1420 55%, #04060b);
  border-top: 1px solid rgba(47, 214, 190, .5);
  border-bottom: 1px solid rgba(47, 214, 190, .28);
  box-shadow: 0 0 18px rgba(47, 214, 190, .22);
  display: flex;
  align-items: center;
  justify-content: center;
}
body.section-home .sphere-button {
  position: relative;
  width: 19%;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #263140, #0a0f18 72%);
  border: 2px solid rgba(47, 214, 190, .55);
  box-shadow: 0 0 16px rgba(47, 214, 190, .4), inset 0 0 10px rgba(47, 214, 190, .25);
}
body.section-home .sphere-button::after {
  content: "";
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(191, 255, 244, .95), rgba(47, 214, 190, .35) 65%, transparent);
  filter: blur(1px);
  animation: home-pulse 3.5s ease-in-out infinite;
}

/* specular gloss */
body.section-home .sphere-gloss {
  position: absolute;
  left: 12%;
  top: 7%;
  width: 42%;
  height: 25%;
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(255, 255, 255, .48), rgba(255, 255, 255, 0) 72%);
  filter: blur(2px);
  transform: rotate(-18deg);
  pointer-events: none;
}

/* containment glow beneath the sphere */
body.section-home .sphere-shadow {
  position: absolute;
  bottom: 4%;
  left: 50%;
  width: 52%;
  height: 26px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(47, 214, 190, .3), transparent 70%);
  filter: blur(9px);
  animation: home-shadow 7s ease-in-out infinite;
}

/* orbiting anima motes: two counter-rotating box-shadow star fields */
body.section-home .hero-motes {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  pointer-events: none;
}
body.section-home .hero-motes-a {
  box-shadow:
    -138px -84px 0 0 rgba(47, 214, 190, .55),
    128px -52px 0 1px rgba(143, 227, 255, .4),
    96px 118px 0 0 rgba(47, 214, 190, .35),
    -110px 96px 0 1px rgba(162, 75, 224, .4),
    22px -150px 0 0 rgba(232, 220, 192, .35);
  animation: home-orbit 46s linear infinite;
}
body.section-home .hero-motes-b {
  box-shadow:
    150px 30px 0 0 rgba(55, 183, 240, .4),
    -152px 12px 0 1px rgba(47, 214, 190, .3),
    -48px -128px 0 0 rgba(162, 75, 224, .35),
    64px 142px 0 1px rgba(143, 227, 255, .3);
  animation: home-orbit 70s linear infinite reverse;
}

/* small variant (app band + /app/ hero) */
body.section-home .home-hero-stage--sm { min-height: 220px; }
body.section-home .home-hero-stage--sm .home-sphere { width: clamp(150px, 36vw, 200px); }
body.section-home .home-hero-stage--sm .hero-motes-a,
body.section-home .home-hero-stage--sm .hero-motes-b { transform: scale(.66); }

@keyframes home-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@keyframes home-plasma {
  from { opacity: .8; transform: rotate(0deg) scale(1); }
  to { opacity: 1; transform: rotate(14deg) scale(1.08); }
}
@keyframes home-pulse {
  0%, 100% { opacity: .85; }
  50% { opacity: 1; filter: blur(1px) brightness(1.25); }
}
@keyframes home-orbit { to { transform: rotate(360deg); } }
@keyframes home-shadow {
  0%, 100% { opacity: .8; transform: translateX(-50%) scale(1); }
  50% { opacity: .5; transform: translateX(-50%) scale(.9); }
}

/* ---- stats row ---- */

body.section-home .home-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
  margin: 28px 0 6px;
}
body.section-home .home-stat {
  padding: 14px 16px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
body.section-home .home-stat strong {
  display: block;
  font: 700 1.55rem/1.15 var(--font-head);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
body.section-home .home-stat span {
  color: var(--ink-faint);
  font-size: .8rem;
}

/* ---- portal grid ---- */

body.section-home .home-portals {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
body.section-home .home-portal {
  --el: var(--accent);
  display: flex;
  align-items: center;
  gap: 14px;
}
body.section-home .home-portal .wk-tile,
body.section-home .home-portal .wk-tile-fallback {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  font-size: 1rem;
}
body.section-home .home-portal:hover {
  border-color: color-mix(in srgb, var(--el) 50%, transparent);
  box-shadow: 0 6px 26px color-mix(in srgb, var(--el) 14%, transparent);
}
body.section-home .home-portal-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
body.section-home .home-portal-text strong {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  font-size: 1rem;
}
body.section-home .home-portal-text span {
  color: var(--ink-faint);
  font-size: .82rem;
  line-height: 1.45;
}
body.section-home .home-portal-arrow {
  margin-left: auto;
  color: var(--el);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .15s ease, transform .15s ease;
}
body.section-home .home-portal:hover .home-portal-arrow {
  opacity: .9;
  transform: translateX(0);
}

/* ---- app cross-sell band ---- */

body.section-home .home-app {
  margin-top: 44px;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid rgba(47, 214, 190, .22);
  background:
    radial-gradient(620px 320px at 92% -20%, rgba(47, 214, 190, .1), transparent 60%),
    radial-gradient(520px 320px at -8% 115%, rgba(162, 75, 224, .09), transparent 60%),
    var(--glass);
  display: grid;
  gap: 24px;
  align-items: center;
}
body.section-home .home-app ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
body.section-home .home-app li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--ink-dim);
  font-size: .92rem;
}
body.section-home .home-app li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  transform: translateY(1px);
  background: radial-gradient(circle at 35% 30%, #bffff4, var(--accent) 65%);
  box-shadow: 0 0 8px rgba(47, 214, 190, .6);
}
body.section-home .home-app li b { color: var(--ink); }
body.section-home .home-app-cta { text-align: center; }
body.section-home .home-app-cta .home-cta { justify-content: center; }
body.section-home .home-app-cta .home-hero-stage { min-height: 190px; }
body.section-home .home-app-more { margin: 12px 0 0; font-size: .88rem; }

/* ---- /app/ page ---- */

body.section-home .app-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
body.section-home .app-features {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
body.section-home .app-features h3 { margin: 0 0 6px; font-size: 1rem; }
body.section-home .app-features p {
  margin: 0;
  color: var(--ink-faint);
  font-size: .88rem;
}
body.section-home .app-cta {
  margin-top: 44px;
  text-align: center;
  padding: 34px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(500px 260px at 50% -30%, rgba(47, 214, 190, .1), transparent 65%),
    var(--glass);
}
body.section-home .app-cta p {
  max-width: 52ch;
  margin: 0 auto 16px;
  color: var(--ink-faint);
}
body.section-home .app-cta .home-cta { justify-content: center; }
body.section-home .app-legal {
  margin: 18px 0 0;
  font-size: .82rem;
  color: var(--ink-faint);
}

/* ---- responsive ---- */

@media (min-width: 720px) {
  body.section-home .home-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  body.section-home .home-hero,
  body.section-home .app-hero {
    grid-template-columns: 1.12fr .88fr;
    padding: 52px 0 26px;
  }
  body.section-home .home-hero-stage { order: 0; min-height: 380px; }
  body.section-home .home-app { grid-template-columns: 1.2fr .8fr; }
}

@media (min-width: 1100px) {
  body.section-home .home-stats { grid-template-columns: repeat(6, 1fr); }
}

/* ---- reduced motion: freeze the void ---- */

@media (prefers-reduced-motion: reduce) {
  body.section-home .home-sphere,
  body.section-home .sphere-plasma,
  body.section-home .sphere-button::after,
  body.section-home .sphere-shadow,
  body.section-home .hero-motes {
    animation: none;
  }
  body.section-home .home-portal-arrow { transition: none; }
}
