/* SkyCube Games — site styles */

@font-face {
  font-family: "Pixelify Sans";
  src: url("/assets/fonts/pixelify-sans-latin-wght.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #0c0d12;
  --bg-2: #14151c;
  --ink: #ece9e1;
  --ink-soft: #b4b2ab;
  --ink-dim: #807e78;
  --line: #2a2b33;
  --cyan: #33c0db;
  --cyan-dark: #1b7f96;
  --amber: #f2c14e;

  --starwake: #1f1626;
  --starwake-edge: #3a2847;
  --plora: #171320;
  --plora-edge: #3b2440;
  --plora-pink: #d0559f;

  --pixel: "Pixelify Sans", ui-monospace, monospace;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1100px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 64px;
}

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

html { scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: #6fd6ea; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.15; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 8px 14px; background: var(--cyan); color: #06222b; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* Small label used on the privacy and 404 pages */
.eyebrow {
  font-family: var(--pixel); font-size: 1rem; color: var(--cyan); margin-bottom: 0.5rem;
}
.accent-text { color: var(--cyan); }

.section-title {
  font-family: var(--pixel);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 1.4rem;
}

/* ---------- Buttons: flat, pixel shadow ---------- */

.btn {
  display: inline-block;
  padding: 12px 22px;
  font-family: var(--pixel); font-size: 1.15rem; font-weight: 600; line-height: 1;
  color: #06222b; background: var(--cyan);
  text-decoration: none;
  border: 2px solid #06222b;
  box-shadow: 4px 4px 0 #06222b;
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { color: #06222b; transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #06222b; }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #06222b; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink-dim); box-shadow: 4px 4px 0 #000; }
.btn-ghost:hover { color: var(--ink); box-shadow: 6px 6px 0 #000; }
.btn-primary { /* kept for older pages */ }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: #08090d;
  border-bottom: 2px solid var(--line);
}
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.wordmark { display: flex; flex-direction: column; line-height: 1; text-transform: uppercase; font-family: var(--body); }
.wordmark-main { font-weight: 800; font-size: 1rem; letter-spacing: 0.2em; }
.wordmark-sub { margin-top: 4px; font-weight: 600; font-size: 0.6rem; letter-spacing: 0.6em; color: var(--ink-soft); }

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  display: block; padding: 8px 14px;
  font-family: var(--pixel); font-size: 1.1rem;
  color: var(--ink-soft); text-decoration: none;
}
.nav-links a:hover { color: var(--ink); background: var(--bg-2); }

.nav-toggle {
  display: none; width: 44px; height: 44px;
  border: 2px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after { display: block; width: 18px; height: 2px; background: currentColor; }
.nav-toggle-bar { position: relative; }
.nav-toggle-bar::before,
.nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Featured game ---------- */

.feature {
  position: relative;
  background: var(--starwake);
  overflow: hidden;
  border-bottom: 2px solid var(--starwake-edge);
}
.feature-bg {
  position: absolute; inset: 0;
  background: url("/assets/games/starwake/starwake-banner.webp") center / cover no-repeat;
  image-rendering: pixelated;
  opacity: 0.35;
}
.feature-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--starwake) 15%, rgba(31, 22, 38, 0.55) 60%, rgba(31, 22, 38, 0.2));
}
.feature-inner {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 48px;
  padding-top: clamp(40px, 7vw, 80px); padding-bottom: clamp(40px, 7vw, 80px);
}
.feature-logo { width: min(100%, 560px); image-rendering: pixelated; }
.feature-line { max-width: 34em; margin: 26px 0 10px; font-size: 1.2rem; color: var(--ink); }
.feature-status { font-family: var(--pixel); font-size: 1.1rem; color: var(--amber); margin-bottom: 26px; }

.phone {
  width: 220px;
  padding: 10px 8px 14px;
  background: #050507;
  border: 2px solid #3a3a44;
  border-radius: 26px;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.45);
  transform: rotate(3deg);
}
.phone img { border-radius: 16px; image-rendering: pixelated; }

/* ---------- Hello ---------- */

.hello { background: var(--bg-2); border-bottom: 2px solid var(--line); }
.hello p {
  margin: 0; padding: clamp(28px, 5vw, 44px) 0;
  font-family: var(--pixel); font-size: clamp(1.25rem, 2.6vw, 1.6rem); line-height: 1.4;
  max-width: 40em;
}
.hello strong { color: var(--cyan); font-weight: 600; }

/* ---------- News ---------- */

.news { padding: clamp(44px, 7vw, 72px) 0 clamp(24px, 4vw, 40px); }
.news-list { border-top: 2px solid var(--line); }
.news-list li {
  display: grid; grid-template-columns: 9em 1fr; gap: 16px; align-items: baseline;
  padding: 14px 0; border-bottom: 2px solid var(--line);
}
.news-list time { font-family: var(--pixel); color: var(--amber); font-size: 1rem; }
.news-list p { margin: 0; color: var(--ink-soft); }

/* ---------- Games ---------- */

.games { padding-top: clamp(32px, 5vw, 56px); }
.games > .wrap .section-title { margin-bottom: 1.2rem; }

.game { border-top: 2px solid var(--line); }
.game-starwake { background: var(--starwake); border-top-color: var(--starwake-edge); }
.game-plora { background: var(--plora); border-top-color: var(--plora-edge); }

.game-inner {
  display: grid; grid-template-columns: 260px 1fr; gap: clamp(28px, 5vw, 56px);
  padding-top: clamp(40px, 6vw, 64px); padding-bottom: clamp(40px, 6vw, 64px);
}
.game-cover img {
  border: 2px solid #000;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5);
  image-rendering: pixelated;
}
.game-starwake .game-cover img { border-radius: 14px; }

.game-logo { width: min(100%, 440px); image-rendering: pixelated; }
.game-plora .game-logo { width: min(100%, 380px); }
.game-status {
  margin: 18px 0 18px;
  font-family: var(--pixel); font-size: 1.05rem; color: var(--ink-soft);
}
.tag {
  display: inline-block; margin-right: 10px; padding: 2px 10px;
  font-size: 0.95rem; color: #0c0d12;
}
.tag-soon { background: var(--amber); }
.tag-dev { background: var(--plora-pink); color: #fff; }
.game-text > p:not(.game-status) { color: var(--ink-soft); max-width: 38em; }

.shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 26px; }
.game-plora .shots { grid-template-columns: 1fr 1fr 2fr; align-items: start; }

.shot {
  display: block; width: 100%; padding: 0; cursor: zoom-in;
  background: #000; border: 2px solid #000;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
  transition: transform .1s;
}
.shot:hover { transform: translate(-2px, -2px); }
.shot img { width: 100%; image-rendering: pixelated; }
.game-starwake .shot img { aspect-ratio: 360 / 780; object-fit: cover; }
.game-plora .shot img { aspect-ratio: 2 / 3; object-fit: cover; }
.game-plora .shot-wide .shot img { aspect-ratio: 16 / 9; }

/* ---------- About ---------- */

.about { padding: clamp(48px, 7vw, 80px) 0; border-top: 2px solid var(--line); }
.about p { color: var(--ink-soft); max-width: 40em; }
.signoff { font-family: var(--pixel); color: var(--ink) !important; font-size: 1.1rem; margin-top: 1.6em; }

/* ---------- Footer ---------- */

.site-footer { background: #08090d; border-top: 2px solid var(--line); padding: 24px 0; font-size: 0.95rem; color: var(--ink-dim); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.footer-inner p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { color: var(--ink-soft); }
.footer-links a:hover { color: var(--cyan); }

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(5, 5, 8, 0.95); color: var(--ink);
}
.lightbox::backdrop { background: rgba(5, 5, 8, 0.6); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { margin: 0; padding: 64px 72px; display: grid; justify-items: center; gap: 12px; max-width: 100%; max-height: 100%; }
.lightbox img {
  max-width: min(1400px, 100%); max-height: calc(100vh - 150px);
  width: auto; height: auto; image-rendering: pixelated;
  border: 2px solid #000;
}
.lightbox figcaption { font-family: var(--pixel); color: var(--ink-soft); text-align: center; }
.lb-btn {
  position: absolute; width: 46px; height: 46px;
  border: 2px solid var(--ink-dim); background: var(--bg-2);
  color: var(--ink); font-size: 1.7rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.lb-btn:hover { border-color: var(--cyan); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---------- Legal pages ---------- */

.legal { padding: clamp(40px, 7vw, 80px) 0 clamp(64px, 9vw, 110px); }
.legal-inner { max-width: 760px; }
.legal h1 { font-family: var(--pixel); font-size: clamp(2.2rem, 5vw, 3rem); margin-bottom: 0.5rem; }
.legal h2 { font-size: 1.2rem; margin: 2.2rem 0 0.6rem; }
.legal p { color: var(--ink-soft); }
.legal-updated { font-size: 0.9rem; color: var(--ink-dim) !important; margin-bottom: 2rem; }
.legal-back { margin-top: 3rem; }

/* ---------- 404 ---------- */

.notfound { min-height: calc(100svh - var(--header-h)); display: grid; place-items: center; text-align: center; padding: var(--gutter); }
.notfound h1 { font-family: var(--pixel); font-size: clamp(4rem, 14vw, 8rem); margin-bottom: .2em; }
.notfound p { color: var(--ink-soft); margin-bottom: 2rem; }
.notfound img { margin: 0 auto 2rem; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .feature-inner { grid-template-columns: 1fr; }
  .phone { width: 170px; justify-self: center; transform: rotate(2deg); }
  .game-inner { grid-template-columns: 1fr; }
  .game-cover { max-width: 220px; }
}

@media (max-width: 640px) {
  :root { --header-h: 58px; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    padding: 4px var(--gutter) 12px;
    background: #08090d; border-bottom: 2px solid var(--line);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 2px solid var(--line); }
  .nav-links li:last-child a { border-bottom: 0; }
  .nav-links-static {
    position: static; display: flex; flex-direction: row;
    padding: 0; background: none; border: 0;
  }
  .nav-links-static a { padding: 8px 8px; border: 0; font-size: 1rem; }

  .news-list li { grid-template-columns: 1fr; gap: 2px; }

  .game-starwake .game-cover { display: none; }
  .game-plora .game-cover { max-width: 160px; }

  .shots, .game-plora .shots {
    grid-template-columns: none;
    grid-auto-flow: column; grid-auto-columns: 42%;
    overflow-x: auto; scroll-snap-type: x mandatory;
    padding-bottom: 12px;
  }
  .game-plora .shots { grid-auto-columns: 42% 42% 80%; }
  .shots li { scroll-snap-align: start; }

  .lightbox figure { padding: 70px 12px; }
  .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
  .lb-prev { left: calc(50% - 58px); }
  .lb-next { right: calc(50% - 58px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .phone { transform: none; }
}
