/* ============================================================
   PIKMO Games — Component Library
   Nav, Footer, Buttons, Cards, Badges, Forms, etc.
   ============================================================ */

/* =======================================
   NAVIGATION
   ======================================= */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: var(--z-sticky);
  background: var(--clr-nav-bg);
  border-bottom: 1px solid var(--clr-border);
  box-shadow: 0 1px 8px var(--clr-shadow);
  transition: border-color var(--dur-base), background-color var(--dur-slow) var(--ease),
              box-shadow var(--dur-base) var(--ease);
}

.site-nav--scrolled {
  box-shadow: 0 2px 16px var(--clr-shadow-md);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding-inline: var(--container-pad);
  max-width: var(--container-xl);
  margin-inline: auto;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo__img {
  height: 44px;
  width: auto;
}

.nav-logo__wordmark {
  font-family: var(--font-heading);
  font-weight: var(--weight-extrabold);
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-snug);
  color: var(--clr-text);
  line-height: 1;
}

.nav-logo__wordmark span {
  color: var(--clr-secondary);
}

/* Desktop nav links */
.nav-links {
  display: none;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
  padding: 0;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
}

.nav-links a {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--clr-text-secondary);
  border-radius: var(--radius-md);
  transition: color var(--dur-fast), background var(--dur-fast);
}

.nav-links a:hover {
  color: var(--clr-text);
  background: var(--clr-surface-2);
}

.nav-links a[aria-current="page"] {
  color: var(--clr-primary);
  background: var(--clr-surface-2);
}

/* Nav actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  color: var(--clr-text-secondary);
  transition: color var(--dur-fast), background var(--dur-fast);
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--clr-text);
  background: var(--clr-surface-2);
}

.theme-toggle svg { width: 18px; height: 18px; }

.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun  { display: block; }

[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }

/* Language toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  min-height: 44px;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--clr-text-secondary);
  text-decoration: none;
  transition: color var(--dur-fast), border-color var(--dur-fast), background var(--dur-fast);
}

.lang-toggle:hover {
  color: var(--clr-primary);
  border-color: var(--clr-primary);
  background: var(--clr-surface);
}

/* Mobile hamburger */
.nav-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  color: var(--clr-text);
  cursor: pointer;
  transition: background var(--dur-fast);
}

.nav-hamburger:hover { background: var(--clr-surface-2); }
.nav-hamburger svg { width: 22px; height: 22px; }

@media (min-width: 768px) {
  .nav-hamburger { display: none; }
}

/* Mobile drawer: a floating panel under the nav with a dimmed page behind it.
   The scrim is a huge box-shadow clipped at the top edge, so it never covers the nav bar
   and fades in together with the panel. */
.nav-drawer {
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  max-height: calc(100dvh - var(--nav-height));
  background: var(--clr-nav-bg);
  border-bottom: 3px solid var(--clr-primary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28), 0 0 0 100vmax rgba(8, 12, 20, 0.55);
  clip-path: inset(0 -100vmax -100vmax -100vmax);
  z-index: var(--z-overlay);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--sp-2) var(--container-pad) var(--sp-6);
  will-change: transform, opacity;
  /* closed state: hide after the fade-out finishes */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 180ms var(--ease-out),
              transform 180ms var(--ease-out),
              visibility 0s linear 180ms;
}

.nav-drawer.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 240ms var(--ease-out),
              transform 280ms var(--ease-out),
              visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
  .nav-drawer, .nav-drawer.is-open { transition: none; transform: none; }
}

.nav-drawer__links {
  list-style: none;
  padding: 0;
  margin-bottom: var(--sp-6);
}

.nav-drawer__links a {
  display: block;
  padding: var(--sp-4) 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--clr-text);
  border-bottom: 1px solid var(--clr-border-light);
  transition: color var(--dur-fast);
}

.nav-drawer__links a:hover { color: var(--clr-primary); }
.nav-drawer__links a[aria-current="page"] {
  color: var(--clr-primary);
  font-weight: var(--weight-semibold);
}
.nav-drawer__links li:last-child a { border-bottom: 0; }

.nav-drawer__actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-4);
}

/* Body offset for fixed nav */
.nav-offset {
  padding-top: var(--nav-height);
}

/* =======================================
   FOOTER
   ======================================= */
.site-footer {
  background: var(--clr-bg-alt);
  border-top: 1px solid var(--clr-border);
  padding-block: var(--sp-16) var(--sp-8);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  gap: var(--sp-10);
  margin-bottom: var(--sp-12);
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: var(--sp-12); }
}

.footer-brand__logo {
  height: 44px;
  width: auto;
  margin-bottom: var(--sp-4);
}

.footer-brand__name {
  font-family: var(--font-heading);
  font-weight: var(--weight-extrabold);
  font-size: var(--text-xl);
  color: var(--clr-text);
  margin-bottom: var(--sp-2);
}

.footer-brand__name span { color: var(--clr-secondary); }

.footer-brand__tagline {
  font-size: var(--text-sm);
  color: var(--clr-text-tertiary);
  font-style: italic;
  margin-bottom: var(--sp-4);
}

.footer-brand__desc {
  font-size: var(--text-sm);
  color: var(--clr-text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 30ch;
}

.footer-col__title {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--clr-text-tertiary);
  margin-bottom: var(--sp-4);
}

.footer-col__links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.footer-col__links a {
  font-size: var(--text-sm);
  color: var(--clr-text-secondary);
  transition: color var(--dur-fast);
}

.footer-col__links a:hover { color: var(--clr-primary); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--clr-border-light);
}

.footer-copyright {
  font-size: var(--text-xs);
  color: var(--clr-text-tertiary);
}

.footer-legal-links {
  display: flex;
  gap: var(--sp-4);
  list-style: none;
  padding: 0;
  flex-wrap: wrap;
}

.footer-legal-links a {
  font-size: var(--text-xs);
  color: var(--clr-text-tertiary);
}

.footer-legal-links a:hover { color: var(--clr-text-secondary); }

/* =======================================
   BUTTONS
   ======================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.65em 1.4em;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-snug);
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

.btn:active { transform: scale(0.97); }
.btn:focus-visible {
  outline: 2px solid var(--clr-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px var(--clr-focus-ring);
}

.btn--primary {
  background: var(--clr-primary);
  color: #fff;
  border-color: var(--clr-primary);
}

.btn--primary:hover {
  background: var(--clr-primary-hover);
  border-color: var(--clr-primary-hover);
  color: #fff;
  box-shadow: 0 4px 16px rgba(29, 61, 92, 0.3);
}

.btn--secondary {
  background: var(--clr-secondary);
  color: #fff;
  border-color: var(--clr-secondary);
}

.btn--secondary:hover {
  background: var(--clr-secondary-hover);
  border-color: var(--clr-secondary-hover);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--clr-text);
  border-color: var(--clr-border);
}

.btn--ghost:hover {
  background: var(--clr-surface-2);
  border-color: var(--clr-primary);
  color: var(--clr-primary);
}

.btn--outline-primary {
  background: transparent;
  color: var(--clr-primary);
  border-color: var(--clr-primary);
}

.btn--outline-primary:hover {
  background: var(--clr-primary);
  color: #fff;
}

.btn--sm {
  font-size: var(--text-xs);
  padding: 0.5em 1.1em;
}

.btn--lg {
  font-size: var(--text-base);
  padding: 0.8em 1.8em;
  border-radius: var(--radius-lg);
}

.btn--icon {
  padding: 0.65em;
  border-radius: var(--radius-md);
}

.btn svg {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

/* Store buttons */
.btn--store {
  background: var(--clr-text);
  color: var(--clr-bg);
  border-color: var(--clr-text);
  gap: var(--sp-3);
  padding: 0.6em 1.3em;
}

.btn--store:hover {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: #fff;
  box-shadow: 0 4px 16px var(--clr-shadow-md);
}

.btn--store svg { width: 20px; height: 20px; flex-shrink: 0; }

.btn--store-label { display: flex; flex-direction: column; text-align: left; }
.btn--store-label small {
  font-size: 0.65em;
  font-weight: var(--weight-normal);
  opacity: 0.75;
  line-height: 1;
}
.btn--store-label strong {
  font-size: 1em;
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  color: inherit;
}

/* =======================================
   BADGES / STATUS PILLS
   ======================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.2em 0.75em;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  line-height: 1.4;
}

.badge--soon {
  background: var(--clr-status-soon-bg);
  color: var(--clr-status-soon-text);
}

.badge--released {
  background: var(--clr-status-release-bg);
  color: var(--clr-status-release-text);
}

.badge--dev {
  background: var(--clr-status-dev-bg);
  color: var(--clr-status-dev-text);
}

.badge--draft {
  background: var(--clr-status-draft-bg);
  color: var(--clr-status-draft-text);
}

.badge--primary {
  background: var(--clr-primary);
  color: #fff;
}

.badge--secondary {
  background: var(--clr-secondary);
  color: #fff;
}

.badge--teal {
  background: rgba(47, 184, 166, 0.15);
  color: var(--clr-secondary);
}

.badge--pill-dot::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
  opacity: 0.7;
}

/* =======================================
   PRODUCT CARDS
   ======================================= */
.product-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base);
  text-decoration: none;
  color: inherit;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--clr-shadow-md);
  border-color: var(--clr-secondary);
}

.product-card:focus-visible {
  outline: 2px solid var(--clr-focus);
  outline-offset: 2px;
}

.product-card__media {
  aspect-ratio: 16 / 9;
  background: var(--clr-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-card__icon-wrap {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 4px 20px var(--clr-shadow-md);
}

.product-card__icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fallback icon illustration */
.product-card__icon-fallback {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--font-heading);
  font-weight: var(--weight-extrabold);
  font-size: var(--text-2xl);
  letter-spacing: var(--tracking-tight);
}

.product-card__badge {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
}

.product-card__body {
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--sp-2);
}

.product-card__name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--clr-text);
  line-height: var(--leading-tight);
}

.product-card__type {
  font-size: var(--text-xs);
  color: var(--clr-text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  font-weight: var(--weight-medium);
}

.product-card__desc {
  font-size: var(--text-sm);
  color: var(--clr-text-secondary);
  line-height: var(--leading-relaxed);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: none;
  flex: 1;
}

.product-card__platforms {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-2);
}

.product-card__platform {
  font-size: var(--text-xs);
  color: var(--clr-text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.product-card__arrow {
  position: absolute;
  bottom: var(--sp-5);
  right: var(--sp-5);
  color: var(--clr-text-tertiary);
  transition: color var(--dur-fast), transform var(--dur-fast);
}

.product-card:hover .product-card__arrow {
  color: var(--clr-primary);
  transform: translate(3px, -3px);
}

/* =======================================
   FEATURE / INFO CARDS
   ======================================= */
.info-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.info-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: rgba(47, 184, 166, 0.12);
  color: var(--clr-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-card__icon svg { width: 22px; height: 22px; }

.info-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--clr-text);
}

.info-card__text {
  font-size: var(--text-sm);
  color: var(--clr-text-secondary);
  line-height: var(--leading-relaxed);
  max-width: none;
}

/* =======================================
   NOTICE / ALERT BOXES
   ======================================= */
.notice {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-lg);
  border-left: 4px solid;
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
}

.notice--info {
  background: rgba(37, 99, 235, 0.07);
  border-color: var(--clr-info);
  color: var(--clr-info);
}

.notice--warning {
  background: rgba(217, 119, 6, 0.07);
  border-color: var(--clr-warning);
  color: var(--clr-warning);
}

.notice--draft {
  background: rgba(156, 163, 175, 0.12);
  border-color: var(--clr-text-tertiary);
  color: var(--clr-text-tertiary);
}

.notice svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }

.notice__body { font-size: var(--text-sm); color: var(--clr-text-secondary); }
.notice__body strong { font-weight: var(--weight-semibold); color: var(--clr-text); }

/* =======================================
   EMPTY STATE
   ======================================= */
.empty-state {
  text-align: center;
  padding: var(--sp-16) var(--sp-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}

.empty-state__icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--clr-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text-tertiary);
}

.empty-state__icon svg { width: 36px; height: 36px; }

.empty-state__title {
  font-size: var(--text-xl);
  color: var(--clr-text);
  margin: 0;
}

.empty-state__text {
  font-size: var(--text-sm);
  color: var(--clr-text-secondary);
  max-width: 36ch;
  margin: 0;
}

/* =======================================
   PLATFORM ICON TAGS
   ======================================= */
.platform-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  background: var(--clr-surface-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--clr-text-secondary);
  border: 1px solid var(--clr-border-light);
}

.platform-tag svg { width: 14px; height: 14px; }

/* =======================================
   SUPPORT / CONTACT SECTION
   ======================================= */
.contact-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-2xl);
  padding: var(--sp-10);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.contact-card__email {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--clr-primary);
  text-decoration: none;
  word-break: break-all;
}

.contact-card__email:hover {
  color: var(--clr-secondary);
}

.contact-card__email svg { width: 20px; height: 20px; flex-shrink: 0; }

/* =======================================
   HERO GEOMETRIC DECORATION
   ======================================= */
.hero-geo {
  position: absolute;
  pointer-events: none;
  user-select: none;
}

/* =======================================
   PRODUCT DETAIL: SCREENSHOTS
   ======================================= */
.screenshot-gallery {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--clr-border) transparent;
  padding-bottom: var(--sp-2);
  scroll-snap-type: x mandatory;
}

.screenshot-gallery img {
  height: 420px;
  width: auto;
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px var(--clr-shadow-md);
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* =======================================
   ANIMATIONS
   ======================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-32px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Intersection observer animation trigger */
.animate-on-enter {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-enter) var(--ease-out),
              transform var(--dur-enter) var(--ease-out);
}

.animate-on-enter.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-enter.delay-1 { transition-delay: 100ms; }
.animate-on-enter.delay-2 { transition-delay: 200ms; }
.animate-on-enter.delay-3 { transition-delay: 300ms; }
.animate-on-enter.delay-4 { transition-delay: 400ms; }

@media (prefers-reduced-motion: reduce) {
  .animate-on-enter {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Theme-aware logo: both variants are in the markup, CSS shows the matching one. */
.logo--dark { display: none; }
[data-theme="dark"] .logo--light { display: none; }
[data-theme="dark"] .logo--dark { display: inline-block; }
