/**
 * PCSX2 — premium shell: JS hooks + motion (Tailwind handles surfaces)
 */

html {
  scroll-behavior: smooth;
}

body.site-premium {
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.anchor-target {
  scroll-margin-top: calc(4rem + 1rem);
}

@media (min-width: 768px) {
  .anchor-target {
    scroll-margin-top: calc(5rem + 1rem);
  }
}

#main-nav {
  border-bottom: 1px solid transparent;
  transition:
    background 0.35s cubic-bezier(0.33, 1, 0.68, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

#main-nav.nav-scrolled {
  background: rgba(255, 255, 255, 0.86) !important;
  border-bottom-color: rgba(24, 24, 27, 0.08) !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 8px 32px -8px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}

.nav-link {
  position: relative;
  color: #52525b;
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: #18181b;
}

.nav-link.active {
  color: #18181b !important;
  font-weight: 600;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.55s cubic-bezier(0.33, 1, 0.68, 1),
    transform 0.55s cubic-bezier(0.33, 1, 0.68, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 0.06s;
}
.reveal-delay-2 {
  transition-delay: 0.12s;
}
.reveal-delay-3 {
  transition-delay: 0.18s;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: #18181b;
  color: #fafafa;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.96);
  transition:
    opacity 0.3s cubic-bezier(0.33, 1, 0.68, 1),
    visibility 0.3s,
    transform 0.3s cubic-bezier(0.33, 1, 0.68, 1),
    background 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  background: #27272a;
  transform: translateY(-2px) scale(1);
}

/* Fixed download */
.fixed-download-btn {
  position: fixed;
  right: 1.25rem;
  top: 50%;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: -0.02em;
  color: #fafafa;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #18181b;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  transform: translateY(-50%);
  transition:
    transform 0.25s cubic-bezier(0.33, 1, 0.68, 1),
    box-shadow 0.25s ease,
    background 0.2s ease;
}

.fixed-download-btn:hover {
  color: #fafafa;
  background: #27272a;
  transform: translateY(-50%) scale(1.02);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(24, 24, 27, 0.08);
  background: #fff;
  padding: 3rem clamp(1rem, 0.55rem + 1.8vw, 2rem);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

html[lang="ja"] body.site-premium {
  font-family: "Inter", "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}
