/*
 * Custom styles layered on top of Tailwind.
 */

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

/* Subtle background grain */
.bg-grain {
  background-image:
    radial-gradient(1200px 600px at 20% -10%, rgba(124,58,237,.35), transparent 60%),
    radial-gradient(900px 450px at 90% 0%, rgba(245,158,11,.22), transparent 55%),
    radial-gradient(900px 700px at 50% 120%, rgba(14,165,233,.12), transparent 60%);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: 14px;
  font-weight: 800;
  letter-spacing: .2px;
  transition: transform .15s ease, filter .15s ease, background-color .15s ease, border-color .15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
}

/* Card helpers */
.card {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 18px;
}

/* Line clamp fallback */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Homepage mood-image tiles */
.home-mood {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.02);
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
}

.home-mood::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.06), rgba(0,0,0,.24));
  pointer-events: none;
}

.home-mood img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
}
.home-mood.home-mood-flat {
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

.home-mood.home-mood-flat::after {
  background: none;
}

/* Premium polish */
::selection { background: rgba(124,58,237,.35); color: #fff; }

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:where(h1,h2,h3) {
  letter-spacing: -0.02em;
  text-wrap: balance;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(124,58,237,.16);
}

.btn {
  transition:
    transform .14s var(--ease-out),
    filter .14s var(--ease-out),
    background-color .14s var(--ease-out),
    border-color .14s var(--ease-out),
    box-shadow .14s var(--ease-out);
  will-change: transform;
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: var(--shadow-glow);
}

.btn-ghost:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 16px 40px rgba(0,0,0,.22);
}

.card {
  background: var(--card);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: .55rem .7rem;
  color: rgba(255,255,255,.78);
  transition: background-color .14s var(--ease-out), border-color .14s var(--ease-out), color .14s var(--ease-out), transform .14s var(--ease-out);
}

.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.09);
}

.nav-link[aria-current="page"] {
  color: #fff;
  background: rgba(124,58,237,.12);
  border-color: rgba(124,58,237,.24);
}

@media (prefers-reduced-motion: no-preference) {
  .btn:hover { transform: translateY(-1px); }
  .btn:active { transform: translateY(0); }
  .nav-link:hover { transform: translateY(-1px); }
  .nav-link:active { transform: translateY(0); }
}

/* Meta pills */
.meta-pill {
  display: inline-flex;
  align-items: baseline;
  gap: .45rem;
  padding: .55rem .85rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
}

.meta-pill-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.58);
}

.meta-pill-value {
  font-size: 12px;
  font-weight: 900;
  color: rgba(255,255,255,.92);
}

/* Landing chips + field helpers */
.chip-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .85rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.86);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2px;
  transition: transform .14s var(--ease-out), background-color .14s var(--ease-out), border-color .14s var(--ease-out);
}

.chip-link:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.18);
  transform: translateY(-1px);
}

.chip-link.is-active {
  background: rgba(124,58,237,.14);
  border-color: rgba(124,58,237,.28);
  color: #fff;
}

.chip-meta {
  font-size: 11px;
  color: rgba(255,255,255,.65);
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.72);
  margin-bottom: .35rem;
}

.field-control {
  width: 100%;
  background: rgba(0,0,0,.20);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: .7rem 1rem;
  font-size: 14px;
  color: var(--text);
  outline: none;
}

.field-control:focus {
  border-color: rgba(255,255,255,.20);
  box-shadow: 0 0 0 4px rgba(124,58,237,.14);
}
/* Reference-style animated rings (homepage polish) */
.ref-rings {
  position: relative;
  width: 220px;
  height: 220px;
  filter: drop-shadow(0 24px 80px rgba(0,0,0,.35));
}

.ref-ring {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 4px solid rgba(124,58,237,.55);
  background: rgba(124,58,237,.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 64px;
  color: rgba(255,255,255,.92);
  line-height: 1;
}

.ref-ring-2 {
  inset: 22px;
  border-color: rgba(124,58,237,.42);
  background: rgba(124,58,237,.10);
  opacity: .78;
}

.ref-ring-3 {
  inset: 46px;
  border-color: rgba(124,58,237,.30);
  background: rgba(124,58,237,.06);
  opacity: .58;
}

@keyframes refRingPulse {
  0%, 100% { transform: scale(1); opacity: .92; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes refRingFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.ref-ring-1 { animation: refRingPulse 6.8s var(--ease-out) infinite, refRingFloat 4.8s var(--ease-out) infinite; }
.ref-ring-2 { animation: refRingPulse 7.6s var(--ease-out) infinite reverse; }
.ref-ring-3 { animation: refRingPulse 9.2s var(--ease-out) infinite; }

/* Product page tabs (Modrinth-style) */
.product-tab {
  display: inline-flex;
  align-items: center;
  padding: .6rem 1rem;
  font-size: 13px;
  font-weight: 800;
  color: rgba(255,255,255,.6);
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  background: transparent;
  cursor: pointer;
  transition: color .14s var(--ease-out), background-color .14s var(--ease-out), border-color .14s var(--ease-out);
}

.product-tab:hover {
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.04);
}

.product-tab.is-active {
  color: #fff;
  border-bottom-color: var(--primary);
  background: rgba(124,58,237,.08);
}

/* Modrinth-style marquee rows */
.marquee-row {
  display: flex;
  gap: 1rem;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  width: 100%;
}

.marquee-row:hover .marquee-row__content {
  animation-play-state: paused !important;
}

.marquee-row__content {
  display: flex;
  flex-shrink: 0;
  gap: 1rem;
  min-width: 100%;
  animation: marquee-scroll 45s linear infinite;
}

.marquee-row--reverse .marquee-row__content {
  animation-direction: reverse;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.marquee-card {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: .75rem;
  padding: .625rem 1rem;
  border-radius: .75rem;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
  white-space: nowrap;
  min-width: 240px;
  max-width: 280px;
  transition: border-color .15s ease, background-color .15s ease;
}

.marquee-card:hover {
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
}

@media (prefers-reduced-motion) {
  .marquee-row__content { animation-play-state: paused; }
}
