/* 
  spa layout
  note you should probably split this into smaller dedicated css files in the future if anything ever grows - cody
*/

:root {
  --bg-primary: #050505;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #111111;
  --bg-elevated: #1a1a1a;

  --text-primary: #ffffff;
  --text-secondary: #a3a3a3;
  --text-tertiary: #666666;

  --border-subtle: #1a1a1a;
  --border-strong: #262626;

  --accent-color: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-light: #8b5cf6;

  --danger-color: #ef4444;
  --success-color: #22c55e;

  --font-sans:
    "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --transition-fast: 150ms ease-out;
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
}
body {
  min-height: 100vh;
  overflow-x: hidden;
}

/* remove scrollbar because they are ugly */
::-webkit-scrollbar {
  display: none;
}
* {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
a,
button {
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  color: inherit;
  border: none;
  background: none;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.text-accent {
  color: var(--accent-light);
}
.text-primary {
  color: var(--text-primary);
}
.bg-elevated {
  background-color: var(--bg-secondary);
  border-top: none;
  border-bottom: none;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 6vw;
}
.page-section {
  padding: 120px 0;
}

.section-header {
  margin-bottom: 48px;
}
.section-title {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.section-desc {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* we set up the single page application layers so they sit on top of each other and fade in */
.view-layer {
  display: none;
}
.view-layer:not(.hidden) {
  display: block;
  animation: viewFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.hidden {
  display: none !important;
}

/* here is the navigation bar styling. we keep it fixed at the top and transparent until the user scrolls */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background 0.3s ease,
    backdrop-filter 0.3s ease,
    border-color 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
}
.navbar.scrolled {
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border-subtle);
}

.nav-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 6vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-logo {
  height: 28px;
  width: auto;
}
.nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 32px;
}
.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}
.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* this is the big hero section you see when you first load the site */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
  padding: 72px 32px 0 32px; /* padding-top instead of margin-top so webgl fits behind navbar */
  border-bottom: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-title {
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -0.04em;
}
.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0) translateX(-50%);
  }
  40% {
    transform: translateY(-10px) translateX(-50%);
  }
  60% {
    transform: translateY(-5px) translateX(-50%);
  }
}

/* these classes control how the product cards look in the grid layouts */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}

.product-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform var(--transition-normal),
    border-color var(--transition-fast),
    box-shadow var(--transition-normal);
  position: relative;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-color);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.15);
}

.product-media {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.product-cover,
.product-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.4s ease;
}

.product-video {
  opacity: 0;
  z-index: 1;
}

.product-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: 24px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  z-index: 2;
  border: 1px solid var(--border-subtle);
}

.product-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.product-title {
  font-size: 1.125rem;
  font-weight: 600;
  max-width: 75%;
}

.product-price {
  font-weight: 700;
  color: var(--text-primary);
}
.product-price.free {
  color: var(--success-color);
}

.product-meta {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

/* this handles the layout for the store browsing page with the sidebar on the left */
.store-container {
  display: flex;
  min-height: calc(100vh - 72px);
  padding-top: 72px;
  max-width: 1600px;
  margin: 0 auto;
}

.store-sidebar {
  width: 280px;
  padding: 40px 32px;
  border-right: none;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 32px;
}

.btn-clear {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}
.btn-clear:hover {
  color: var(--text-primary);
}

.filter-group {
  margin-bottom: 32px;
}
.filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
  position: relative;
}
.checkbox-label:hover {
  color: var(--text-primary);
}

/* Hide default inputs */
.checkbox-label input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* Custom Checkbox */
.custom-checkbox {
  height: 18px;
  width: 18px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.checkbox-label input:checked ~ .custom-checkbox {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}
.custom-checkbox::after {
  content: "";
  display: none;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}
.checkbox-label input:checked ~ .custom-checkbox::after {
  display: block;
}

/* Custom Radio */
.custom-radio {
  height: 18px;
  width: 18px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.checkbox-label input:checked ~ .custom-radio {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}
.custom-radio::after {
  content: "";
  display: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
}
.checkbox-label input:checked ~ .custom-radio::after {
  display: block;
}

.store-main {
  flex: 1;
  padding: 40px 48px;
}

.store-main-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 32px;
}

.store-title {
  font-size: 2rem;
}
.store-meta {
  color: var(--text-tertiary);
  font-size: 0.9375rem;
}

.store-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* when a user clicks on an asset, they see this detailed view page */
.detail-container {
  padding-top: 120px;
  padding-bottom: 120px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 64px;
}

.detail-media {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
}

.detail-media img,
.detail-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-category {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-light);
  font-weight: 600;
}

.detail-title {
  font-size: 2.5rem;
  line-height: 1.1;
  margin-bottom: 8px;
}

.detail-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.detail-price.free {
  color: var(--success-color);
}

.detail-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  padding: 24px 0;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

.detail-features h4 {
  margin-bottom: 12px;
  font-size: 1.125rem;
}
.detail-features ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-secondary);
}
.detail-features li::before {
  content: "✓";
  color: var(--accent-light);
  margin-right: 8px;
}

.detail-actions {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* this handles the infinite scrolling reviews marquee at the bottom of the home page */
.marquee-container {
  width: 100%;
  overflow: hidden;
  position: relative;
  white-space: nowrap;
}

.marquee-container::before,
.marquee-container::after {
  content: "";
  position: absolute;
  top: 0;
  width: 250px;
  height: 100%;
  z-index: 2;
}

.marquee-container::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-primary), transparent);
}

.marquee-container::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-primary), transparent);
}

.marquee-track {
  display: flex;
  gap: 32px;
  width: max-content;
  animation: scrollMarquee 60s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

@keyframes scrollMarquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-50% - 16px));
  }
}

.review-card {
  display: inline-flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 32px;
  width: 400px;
  white-space: normal;
  border: 1px solid var(--border-strong);
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast);
}
.review-card:hover {
  border-color: var(--accent-color);
}
.review-stars {
  color: var(--accent-light);
  margin-bottom: 16px;
  letter-spacing: 2px;
}
.review-quote {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.6;
}
.review-author {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* basic styling for the footer */
.footer {
  padding: 64px 0;
  background: transparent;
  border-top: none;
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-copy {
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

/* all the global button styles and helper classes we use across the site */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}
.btn-lg {
  padding: 16px 32px;
  font-size: 1rem;
}
.btn-sm {
  padding: 8px 16px;
  font-size: 0.8125rem;
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-discord {
  background: #5865f2;
  color: #fff;
}
.btn-discord:hover {
  background: #4752c4;
}

.btn-outline {
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}
.btn-outline:hover {
  border-color: var(--accent-color);
  background: var(--bg-elevated);
}

.btn-ghost {
  color: var(--text-secondary);
}
.btn-ghost:hover {
  color: var(--text-primary);
}

/* Button Micro-Animations */
.btn-success-state {
  background: var(--success-color) !important;
  border-color: var(--success-color) !important;
  color: #fff !important;
}
.btn-spinner {
  animation: rotate 2s linear infinite;
  width: 20px;
  height: 20px;
}
.btn-spinner .path {
  stroke: currentColor;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}
@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}
@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

.btn-danger-outline {
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
  padding: 8px 16px;
  font-size: 0.75rem;
}
.btn-danger-outline:hover {
  background: var(--danger-color);
  color: #fff;
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 48px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}

/* these styles control the popups and modals like the login screen and purchase choices */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  padding: 24px;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 40px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(10px);
  transition: transform var(--transition-fast);
}
.modal-overlay.open .modal-content {
  transform: translateY(0);
}
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 1.5rem;
  color: var(--text-secondary);
}
.modal-close:hover {
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 24px;
}
.form-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}
.form-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: inherit;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent-color);
}
.form-error {
  color: var(--danger-color);
  font-size: 0.875rem;
  margin-top: 8px;
  display: none;
}
.form-error.visible {
  display: block;
}

.lightbox-inner {
  max-width: 90vw;
  max-height: 90vh;
}
.lightbox-inner img,
.lightbox-inner video {
  max-width: 100%;
  max-height: 90vh;
  border-radius: var(--radius-md);
  object-fit: contain;
}

.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-accent);
  color: var(--text-primary);
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  z-index: 3000;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 768px) {
  .store-container {
    flex-direction: column;
  }
  .store-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 32px;
  }
  .store-main {
    padding: 32px;
  }
  .detail-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}
