/* CSS reset (modernized) */
* { box-sizing: border-box; }
html, body { height: 100%; }
body, h1, h2, h3, p, ul, li, figure, figcaption, blockquote, dl, dd { margin: 0; }
ul[role='list'], ol[role='list'] { list-style: none; }
img, picture { max-width: 100%; display: block; }
input, button, textarea, select { font: inherit; }

:root {
  --bg: #0a0a0a;
  --bg-elev: #141414;
  --text: #ececec;
  --muted: #a9a9b2;
  --primary: #f6c453; /* warm sand tone */
  --primary-contrast: #201a0f;
  --border: #242424;
  --card: #16181c;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --bg-elev: #fff8ee;
    --text: #191919;
    --muted: #4b5563;
    --primary: #c48a24;
    --primary-contrast: #fff6e5;
    --border: #e6decf;
    --card: #ffffff;
    --shadow: 0 6px 20px rgba(0,0,0,.08);
  }
}

/* Explicit theme override via class */
.theme-dark {
  --bg: #0b0c0f;
  --bg-elev: #12141a;
  --text: #e6e7eb;
  --muted: #a1a6b0;
  --primary: #5b8cff;
  --primary-contrast: #06112e;
  --border: #242834;
  --card: #151823;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(91,140,255,.15), transparent 60%),
              radial-gradient(800px 400px at -10% 10%, rgba(139,92,246,.12), transparent 60%),
              var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(1.2) blur(8px);
  background-color: color-mix(in oklab, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .2px;
}

.logo-img { height: 36px; width: auto; display: block; object-fit: contain; image-rendering: -webkit-optimize-contrast; }
.logo-text { font-size: 18px; white-space: nowrap; }
.logo-img-dark { display: none; }
.theme-dark .logo-img-light { display: none; }
.theme-dark .logo-img-dark { display: block; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 6px;
  border-radius: 8px;
}
.nav-toggle .bar { display:block; width:24px; height:2px; background: var(--text); margin:5px 0; border-radius:1px; }

.nav-menu { display: flex; align-items: center; gap: 18px; }
.nav-menu a { color: inherit; text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.nav-menu a:hover { background: var(--bg-elev); }

.nav-item-dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 0;
  box-shadow: var(--shadow);
  min-width: 180px;
  z-index: 10;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.nav-item-dropdown:hover .dropdown-menu,
.nav-item-dropdown.open .dropdown-menu,
.nav-item-dropdown .dropdown-menu:hover {
  display: flex;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Bridge the gap between toggle and menu to prevent hover loss */
.nav-item-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 8px;
  background: transparent;
  pointer-events: auto;
  display: none;
}

.nav-item-dropdown:hover::after {
  display: block;
}

.dropdown-menu a {
  padding: 8px 18px;
  border-radius: 0;
}

.dropdown-toggle::after {
  content: ' ▼';
  font-size: 0.8em;
  margin-left: 5px;
  transition: transform 0.2s ease;
  display: inline-block;
}

.nav-item-dropdown.open .dropdown-toggle::after {
  transform: rotate(180deg);
}

.theme-toggle { border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); padding: 8px 10px; border-radius: 10px; cursor: pointer; }

@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .nav-menu { position: absolute; right: 4%; top: 60px; display: none; flex-direction: column; background: var(--bg-elev); border:1px solid var(--border); border-radius: 12px; padding: 10px; box-shadow: var(--shadow); }
  .nav-menu.open { display: flex; }
  .nav-menu .nav-item-dropdown {
    width: 100%;
  }
  .nav-menu .dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--border);
    border-radius: 0;
    padding: 0 0 0 10px;
    margin-left: 10px;
    background: transparent;
    opacity: 1;
    pointer-events: auto;
  }
  .nav-menu .dropdown-toggle::after {
    content: ' ▸';
  }
  .nav-menu .nav-item-dropdown.open .dropdown-toggle::after {
    transform: rotate(90deg);
  }
}

.hero {
  padding: 96px 0 56px;
}

.hero-inner { text-align: center; }
.hero h1 { font-size: clamp(32px, 5vw, 56px); line-height: 1.1; letter-spacing: -.5px; }
.hero p { margin-top: 12px; font-size: clamp(16px, 2.4vw, 20px); color: var(--muted); }
.actions { margin-top: 22px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.button { display:inline-flex; align-items:center; justify-content:center; padding: 10px 16px; border-radius: 12px; border:1px solid var(--border); color: var(--text); text-decoration:none; background: var(--bg-elev); box-shadow: var(--shadow); }
.button.primary { background: linear-gradient(135deg, var(--primary), color-mix(in oklab, var(--primary) 70%, #ffd89c)); color: #1a1205; border-color: transparent; }
.button:hover { transform: translateY(-1px); transition: transform .15s ease; }

.section { padding: 64px 0; }
.section.alt { background: var(--bg-elev); }
.section.full-bleed { padding: 0 0 64px; }
.section.full-bleed .container { width: 100%; max-width: none; margin: 0; padding: 0; }

.grid.features { margin-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .grid.features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid.features { grid-template-columns: 1fr; } }

/* Distributors grid */
.distributors-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.distributor-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 200px;
  box-sizing: border-box;
}

.distributor-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.distributor-logo {
  width: 100%;
  max-width: 180px;
  max-height: 120px;
  height: auto;
  object-fit: contain;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.distributor-name {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  text-align: center;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .distributors-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .distributors-grid {
    grid-template-columns: 1fr;
  }
}

/* Static games grid - 3x2 layout */
.static-games-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.static-games-grid .featured {
  grid-column: span 2;
}

.static-games-grid .card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.static-games-grid .featured .card-img {
  aspect-ratio: 2 / 1;
}

@media (max-width: 900px) {
  .static-games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .static-games-grid .featured {
    grid-column: span 2;
  }
  .static-games-grid .featured .card-img {
    aspect-ratio: 2 / 1;
  }
}

@media (max-width: 620px) {
  .static-games-grid {
    grid-template-columns: 1fr;
  }
  .static-games-grid .featured {
    grid-column: span 1;
  }
}

.card { 
  background: var(--card); 
  border: 1px solid var(--border); 
  border-radius: 16px; 
  padding: 18px; 
  box-shadow: var(--shadow); 
  display: flex; 
  flex-direction: column;
  height: 100%;
}
.card a { 
  display: flex; 
  flex-direction: column; 
  height: 100%; 
}
.card a:has(> .card-img) {
  display: block;
  height: auto;
}
.card a:has(> .card-img) .card-img {
  transition: transform .2s ease;
}
.card a:has(> .card-img):hover .card-img {
  transform: scale(1.02);
}
.card a.button {
  display: inline-block;
  height: auto;
  align-self: flex-start;
  margin-top: auto;
}
.card-img { 
  width: 100%; 
  aspect-ratio: 1; 
  object-fit: cover; 
  border-radius: 12px; 
  margin-bottom: 12px; 
  border: 1px solid var(--border); 
  background: var(--bg-elev); 
  flex-shrink: 0;
}
.card-img.expansion-img {
  aspect-ratio: 1 / 2;
  object-fit: contain;
  background: transparent;
  border: none;
}
.card h3 { 
  margin-bottom: 8px; 
  font-size: 18px; 
  flex-shrink: 0;
}
.card p { 
  color: var(--muted); 
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  flex-grow: 0;
}

.gallery-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 720px) { .gallery-grid { grid-template-columns: 1fr; } }
.gallery-item { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
.gallery-img { width: 100%; height: auto; border-radius: 12px; display: block; transition: transform .2s ease; }
.carousel.pano .gallery-img { width: 100%; height: 100%; object-fit: cover; object-position: center; border-radius: 0; border: 0; display: block; }
.carousel.pano .gallery-item { width: 100%; height: 100%; }
.gallery-item:hover .gallery-img { transform: scale(1.02); }
.gallery-item.static:hover .gallery-img { transform: none; }
.gallery-item figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }

/* Carousel */
.carousel { position: relative; margin-top: 18px; overflow: hidden; }
.section.full-bleed { padding: 0; margin: 0; }
.section.full-bleed .carousel { width: 100vw; margin: 0; position: relative; left: 0; transform: none; }
.carousel-viewport { overflow: hidden; border-radius: 16px; border: 1px solid var(--border); background: var(--bg-elev); position: relative; z-index: 1; width: 100%; }
.carousel.pano .carousel-viewport { aspect-ratio: 2953 / 1093; max-height: min(78vh, 910px); border: 0; background: transparent; border-radius: 0; width: 100vw; }
.carousel-track { display: flex; transition: transform .9s ease-in-out; will-change: transform; margin: 0; padding: 0; }
.carousel-slide { flex: 0 0 100%; width: 100%; min-width: 100%; max-width: 100%; padding: 12px; box-sizing: border-box; }
.carousel.pano .carousel-slide { padding: 0; flex-shrink: 0; width: 100%; height: 100%; }
.carousel.pano .gallery-item { padding: 0; background: transparent; border: 0; box-shadow: none; width: 100%; height: 100%; margin: 0; display: block; }
.carousel.pano .gallery-caption { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; text-align: center; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); background: transparent; color: var(--text); border: 0; width: 44px; height: 44px; border-radius: 0; display: grid; place-items: center; cursor: pointer; box-shadow: none; z-index: 2; font-size: 28px; line-height: 1; }
.carousel-btn:hover { transform: translateY(-50%) scale(1.05); }
.carousel-btn.prev { left: -6px; }
.carousel-btn.next { right: -6px; }
.carousel.pano .carousel-btn.prev { left: 6px; }
.carousel.pano .carousel-btn.next { right: 6px; }
.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.carousel-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--border); border: 0; padding: 0; }
.carousel-dot[aria-selected="true"] { background: var(--primary); }

@media (max-width: 720px) {
  .carousel-btn.prev { left: 6px; }
  .carousel-btn.next { right: 6px; }
  .carousel.pano .carousel-viewport { max-height: 55vh; }
}
.contact-form { display: grid; gap: 12px; }
.contact-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .contact-form .form-row { grid-template-columns: 1fr; } }
.contact-form label span { display:block; margin-bottom:6px; color: var(--muted); }
.contact-form input, .contact-form textarea { width:100%; padding:10px 12px; border-radius: 10px; border:1px solid var(--border); background: var(--bg-elev); color: var(--text); }

.site-footer { border-top: 1px solid var(--border); background: var(--bg-elev); }
.footer-inner { display:flex; align-items:center; justify-content:space-between; padding: 20px 0; }
.back-to-top { color: inherit; text-decoration: none; }

/* Game page image gallery */
.game-gallery { 
  display: grid; 
  grid-template-columns: 2fr 1fr; 
  grid-template-rows: 1fr 1fr;
  gap: 12px; 
  margin-top: 24px; 
  width: 100%;
  max-width: 100%;
}
.game-gallery-main { 
  grid-row: 1 / 3; 
  aspect-ratio: 1; 
  width: 100%;
  min-width: 0;
}
/* Thumbs take no part in sizing: the main image alone sets the gallery height,
   so swapping or loading a thumb can't resize the grid */
.game-gallery-thumb { 
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}
.game-gallery-thumb img {
  position: absolute;
  inset: 0;
}
.game-gallery img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  border-radius: 12px; 
  border: 1px solid var(--border);
  display: block;
}
@media (max-width: 900px) {
  .game-gallery { 
    grid-template-columns: 2fr 1fr; 
    gap: 10px;
  }
}
@media (max-width: 720px) {
  .game-gallery { 
    grid-template-columns: 1fr; 
    gap: 12px;
  }
  .game-gallery-main { 
    grid-row: 1; 
  }
  .game-gallery-thumb {
    aspect-ratio: 1;
  }
}
@media (max-width: 480px) {
  .game-gallery {
    gap: 8px;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}


/* Press kit */
.press-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.press-chips a { padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; color: inherit; text-decoration: none; font-size: 14px; background: var(--card); }
.press-chips a:hover { border-color: var(--primary); }
.press-title { color: inherit; text-decoration: none; }
.press-title:hover { text-decoration: underline; }
.press-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.press-item { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.press-item.press-banner { grid-column: 1 / -1; }
.press-preview { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg-elev); border: 1px solid var(--border); }
.press-banner .press-preview { aspect-ratio: 2953 / 1093; }
.press-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.press-item figcaption { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.press-item figcaption span { color: var(--muted); font-size: 13px; }
.press-item .button { align-self: flex-start; margin-top: auto; }
.press-cta { text-align: center; }
.press-cta a { color: var(--primary); font-weight: 600; }
.press-on-dark .press-preview { background: #0b0c0f; }
