/* ============================================================
   NORD-DARK ASSET STORE — style.css
   Nord palette: bg #1a1d23, surface #21262f, border #2e3440
   Accent blue: #5e81f4 | Cyan: #88c0d0 | Text: #eceff4
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:          #1a1d23;
  --surface:     #21262f;
  --surface-2:   #282e38;
  --border:      #2e3440;
  --border-2:    #3b4252;
  --text:        #eceff4;
  --text-muted:  #8b97b0;
  --accent:      #5e81f4;
  --accent-glow: rgba(94, 129, 244, 0.25);
  --cyan:        #88c0d0;
  --cyan-glow:   rgba(136, 192, 208, 0.2);
  --green:       #a3be8c;
  --yellow:      #ebcb8b;
  --red:         #bf616a;
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --transition:  0.2s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---- Shared Button ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn--primary:hover {
  background: #7291f6;
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn--outline:hover {
  background: var(--accent-glow);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-1px);
}

.btn--full {
  width: 100%;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  height: 80px;
  z-index: 100;
  background: rgba(26, 29, 35, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0;
  color: var(--text);
}

.logo-n {
  height: 38px;
  width: 60px;
  height: 60px;
  margin-right: -3px;
  display: block;
  flex-shrink: 0;
}

.logo-text {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-muted);
  line-height: 1;
  /* nudge down slightly to sit on the same baseline as the N glyph */
  padding-top: 3px;
}

.header-nav {
  display: flex;
  gap: 28px;
}

.header-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}

.header-nav a:hover {
  color: var(--text);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  text-align: center;
  padding: 90px 24px 72px;
  max-width: 760px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(94, 129, 244, 0.12);
  border: 1px solid rgba(94, 129, 244, 0.35);
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-cta {
  font-size: 0.95rem;
  padding: 13px 32px;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  padding: 8px 22px;
  border-radius: 99px;
  border: 1.5px solid var(--border-2);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition);
  letter-spacing: 0.02em;
}

.filter-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow);
}

.results-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ============================================================
   PRODUCT GRID
   ============================================================ */
.grid-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

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

/* ============================================================
   PRODUCT CARD
   ============================================================ */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(94, 129, 244, 0.2);
}

/* Full-card anchor — the entire card is the click target */
.card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

/* Play badge bottom-left of thumbnail */
.card-play-badge {
  position: absolute;
  bottom: 10px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 6px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.04em;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.product-card:hover .card-image-wrap img {
  transform: scale(1.04);
}

/* Placeholder if no image */
.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-2) 0%, #1e2430 100%);
}

.card-image-placeholder svg {
  opacity: 0.18;
}

/* Type badge top-left */
.card-type-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 11px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  z-index: 2;
}

.badge--model {
  background: rgba(94, 129, 244, 0.85);
  color: #fff;
}

.badge--addon {
  background: rgba(136, 192, 208, 0.85);
  color: #1a1d23;
}

/* Price badge top-right */
.card-price-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 2;
}

.price--free {
  background: rgba(163, 190, 140, 0.9);
  color: #1a1d23;
}

.price--paid {
  background: rgba(235, 203, 139, 0.9);
  color: #1a1d23;
}

/* Card body */
.card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.card-footer {
  margin-top: 6px;
  position: relative;
  z-index: 2;
}

.card-footer .btn {
  pointer-events: none; /* card-link handles the click */
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 24px;
  font-size: 0.95rem;
}

.hidden {
  display: none !important;
}

/* ---- Card entrance animation ---- */
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.product-card {
  animation: cardFadeIn 0.28s ease both;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: relative;
  max-width: 1200px;
  height: 80px;
  border-top: 1px solid var(--border);
  text-align: left;
  padding: 28px 24px;
  margin: 0 auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--accent);
  transition: color var(--transition);
}

.site-footer a:hover {
  color: #7291f6;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .header-nav { gap: 16px; }
  .hero { padding: 60px 20px 52px; }
  .product-grid { grid-template-columns: 1fr; }
  .filter-section, .grid-wrapper { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 400px) {
  .header-nav a:first-child { display: none; }
}

/* ============================================================
   PRODUCT PAGE  (product.html)
   ============================================================ */
.product-root {
  max-width: 1100px;
  min-height: calc(100vh - 160px);
  margin: 0 auto;
  padding: 28px 24px 80px;
  display: flex;
  flex-direction: column;
}

/* Back link */
.pp-back {
  margin-bottom: 28px;
  flex-shrink: 0;
}

.pp-layout {
  margin: auto 0;
}

.pp-back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition);
}

.pp-back-link:hover {
  color: var(--text);
}

/* Two-column layout: video left, info panel right */
.pp-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
  margin: auto 0;
}

/* ---- Left: video / image ---- */
.pp-left {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0e1016;
  border: 1px solid var(--border);
}

.pp-embed-wrap {
  position: relative;
  width: 100%;
  background: #000;
}

/* When only the iframe is showing, keep the 16/9 aspect */
.pp-embed-wrap:not(:has(.pp-gallery-panel:not([hidden]))) {
  aspect-ratio: 16 / 9;
}

.pp-embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* iframe hidden state — still needs to occupy space so wrap keeps ratio */
.pp-embed-wrap iframe[hidden] {
  display: none;
}

.pp-hero-img {
  width: 100%;
  display: block;
}

.pp-hero-placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-2) 0%, #1e2430 100%);
}

.pp-hero-placeholder .card-image-placeholder {
  width: 100%;
  height: 100%;
}

.pp-video-label {
  padding: 10px 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}

/* Video tab strip */
.pp-video-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.pp-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 99px;
  border: 1.5px solid var(--border-2);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.pp-tab:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--accent);
}

.pp-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---- Right: sticky info panel ---- */
.pp-aside {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 76px;
}

.pp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* card-type-badge is normally position:absolute inside a card —
   override it to be static when used on the product page */
.pp-badges .card-type-badge,
.pp-category-badge {
  position: static;
  display: inline-block;
}

.pp-category-badge {
  padding: 3px 11px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: rgba(139, 151, 176, 0.12);
  color: var(--text-muted);
  border: 1px solid var(--border-2);
}

.pp-title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

.pp-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.pp-price-row {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.pp-price {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pp-price--free { color: var(--green); }
.pp-price--paid { color: var(--yellow); }

.pp-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pp-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.7;
}

/* Not-found state */
.pp-not-found {
  text-align: center;
  padding: 80px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  color: var(--text-muted);
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .pp-layout {
    grid-template-columns: 1fr;
  }
  .pp-aside {
    position: static;
  }
}

@media (max-width: 640px) {
  .product-root { padding: 20px 16px 60px; }
}

/* ============================================================
   ADDON PAGE TOOL SECTIONS
   ============================================================ */

.pp-tools {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.pp-tool {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  align-items: start;
}

.pp-tool-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: block;
}

.pp-tool-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pp-tool-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.pp-tool-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .pp-tool {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   IMAGE GALLERY  (pp-gallery — inside .pp-left)
   ================================================================ */

.pp-gallery-panel {
  background: #0e1016;
}

/* Stage: main image + arrow buttons */
.pp-gallery-stage {
  position: relative;
  width: 100%;
}

.pp-gallery-track-wrap {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.pp-gallery-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.pp-gallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.pp-gallery-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.pp-gallery-slide.leaving {
  opacity: 0;
}

.pp-gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Prev / Next arrow buttons */
.pp-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border-2);
  background: rgba(14, 16, 22, 0.72);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  backdrop-filter: blur(4px);
}

.pp-gallery-arrow:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pp-gallery-arrow--prev { left: 12px; }
.pp-gallery-arrow--next { right: 12px; }

/* Fullscreen toggle button — top-right of gallery stage */
.pp-gallery-fullscreen {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1.5px solid var(--border-2);
  background: rgba(14, 16, 22, 0.72);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  backdrop-filter: blur(4px);
}

.pp-gallery-fullscreen:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pp-gallery-fullscreen.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Fullscreen overlay — applied to .pp-embed-wrap or .pp-gallery-panel */
.pp-gallery-fs {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  background: #000;
  display: block;
}

.pp-gallery-fs .pp-gallery-panel {
  width: 100%;
  height: 100%;
}

.pp-gallery-fs .pp-gallery-stage {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
}

.pp-gallery-fs .pp-gallery-track-wrap {
  aspect-ratio: auto;
  width: 100vw;
  height: 100vh;
}

.pp-gallery-fs .pp-gallery-track {
  width: 100%;
  height: 100%;
}

.pp-gallery-fs .pp-gallery-slide img {
  object-fit: contain;
}

.pp-gallery-fs .pp-gallery-arrow {
  width: 44px;
  height: 44px;
}

.pp-gallery-fs .pp-gallery-arrow--prev { left: 20px; }
.pp-gallery-fs .pp-gallery-arrow--next { right: 20px; }

@media (max-width: 640px) {
  .pp-gallery-arrow {
    width: 30px;
    height: 30px;
  }
  .pp-gallery-fs .pp-gallery-arrow {
    width: 36px;
    height: 36px;
  }
  .pp-gallery-fs .pp-gallery-arrow--prev { left: 10px; }
  .pp-gallery-fs .pp-gallery-arrow--next { right: 10px; }
}
