:root {
  --bg: #0f1117;
  --bg-alt: #161a23;
  --card: #1c212c;
  --border: #2a3140;
  --text: #e6e8ee;
  --text-muted: #9aa3b5;
  --accent: #f5b83d;
  --discord: #5865f2;
  --steam: #1b2838;
  --unity: #222c37;
  --radius: 12px;
  --space: 1rem;
  --header-height: 64px;
  --sidebar-width: 280px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent);
}

[hidden] {
  display: none !important;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 17, 23, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 calc(var(--space) * 1.5);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}

.logo img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.logo-text span {
  color: var(--accent);
}

.header-link {
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}

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

/* Layout */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: var(--header-height);
  align-self: start;
  height: calc(100vh - var(--header-height));
  padding: calc(var(--space) * 1.5) var(--space);
  overflow-y: auto;
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
}

.sidebar-title {
  margin: 0 0 var(--space) 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.product-nav {
  display: flex;
  flex-direction: column;
  gap: calc(var(--space) * 1.75);
}

.product-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.product-group .sidebar-title {
  margin-bottom: 0.5rem;
}

.product-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.product-nav-item:hover {
  background: var(--card);
}

.product-nav-item[aria-current="page"] {
  background: var(--card);
  border-color: var(--border);
  box-shadow: inset 3px 0 0 var(--accent);
}

.product-nav-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
}

.product-nav-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.product-nav-name {
  font-weight: 600;
}

.product-nav-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Main panel */
.main {
  min-width: 0;
  padding: calc(var(--space) * 2.5) calc(var(--space) * 3);
}

.product-panel {
  max-width: 1100px;
}

.product-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.product-panel h1 {
  margin: 0.25rem 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.15;
}

.product-description {
  max-width: 720px;
  margin: 0 0 calc(var(--space) * 1.5);
  color: var(--text-muted);
}

/* Multi-paragraph descriptions */
.product-description p {
  margin: 0 0 0.75em;
}

.product-description p:last-child {
  margin-bottom: 0;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: calc(var(--space) * 2);
}

/* Product header with optional cover image */
.product-header {
  display: flex;
  align-items: flex-start;
  gap: calc(var(--space) * 2);
}

.product-cover {
  flex-shrink: 0;
  width: 280px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Transparent logo instead of a card: no frame. keymaker_logo.png has ~230px of empty space
   above the artwork – it is cropped here (remove aspect-ratio/object-* if the file gets trimmed) */
.product-cover--logo {
  aspect-ratio: 1500 / 1050;
  object-fit: cover;
  object-position: bottom;
  border: 0;
  border-radius: 0;
}

.product-info {
  min-width: 0;
}

/* Gallery */
.gallery-main {
  position: relative;
  margin: 0 0 var(--space);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.gallery-main img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0 0 4px;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.7;
  transform: translateY(-50%);
  transition: opacity 0.15s ease, background 0.15s ease;
}

.gallery-nav:hover,
.gallery-nav:focus-visible {
  background: rgba(0, 0, 0, 0.8);
  opacity: 1;
}

.gallery-nav--prev {
  left: 0.75rem;
}

.gallery-nav--next {
  right: 0.75rem;
}

.product-nav-label .badge {
  margin-left: 0.25rem;
}

/* Unreleased products (in development): title and description dimmed in the panel */
.product-panel--soon .product-description,
.product-panel--soon h1 {
  opacity: 0.6;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.gallery-thumb {
  padding: 0;
  overflow: hidden;
  background: #000;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.gallery-thumb:hover,
.gallery-thumb:focus-visible {
  opacity: 1;
}

.gallery-thumb[aria-current="true"] {
  border-color: var(--accent);
  opacity: 1;
}

.gallery-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* Hover: lift + glow in the button's brand colour (--btn-glow, set per variant) */
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--btn-glow, rgba(255, 255, 255, 0.1));
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn--discord {
  --btn-glow: rgba(88, 101, 242, 0.45);
  background: var(--card);
  border-color: var(--discord);
}

.btn--discord:hover {
  background: var(--discord);
}

.btn--steam {
  --btn-glow: rgba(102, 192, 244, 0.3);
  background: var(--steam);
  border-color: #2a475e;
}

.btn--steam:hover {
  background: #2a475e;
  border-color: #66c0f4;
}

.btn--unity {
  --btn-glow: rgba(255, 255, 255, 0.15);
  background: var(--unity);
  border-color: #3d4a5a;
}

.btn--unity:hover {
  background: #3d4a5a;
  border-color: #8a9bb0;
}

/* Disabled: only text, background and border are muted – no opacity/filter,
   so any brand logo added to a button keeps its original colours */
.btn--disabled {
  color: #6b7385;
  background: var(--bg-alt);
  border-color: var(--border);
  cursor: not-allowed;
  pointer-events: none;
}

.btn--disabled .badge {
  background: rgba(255, 255, 255, 0.08);
}

.badge {
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Footer */
.site-footer {
  padding: calc(var(--space) * 2) 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space);
  padding: 0 calc(var(--space) * 1.5);
}

.footer-inner p {
  margin: 0;
}

/* Mobile: sidebar turns into a horizontal product bar above the main panel */
@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: var(--space);
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-title {
    display: none;
  }

  .product-nav {
    flex-direction: row;
    gap: 0.25rem;
    overflow-x: auto;
  }

  /* Categories flatten into one horizontal row on phones */
  .product-group {
    display: contents;
  }

  .product-nav-item {
    flex-shrink: 0;
  }

  .product-nav-item[aria-current="page"] {
    box-shadow: inset 0 -3px 0 var(--accent);
  }

  .main {
    padding: calc(var(--space) * 1.5) var(--space);
  }

  .product-header {
    flex-direction: column;
    gap: var(--space);
  }

  .product-cover {
    width: 100%;
    max-width: 420px;
  }

  .gallery-thumbs {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
