/* ============ Mana Potion Studios ============ */

:root {
  --bg: #0b0d14;
  --bg-soft: #11141f;
  --bg-card: #161a28;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8eaf2;
  --text-dim: #9aa1b5;
  --ember: #ff7a3c;
  --ember-soft: #ffb185;
  --violet: #8b7bff;
  --radius: 16px;
  --container: 1180px;
  --font-display: "Sora", sans-serif;
  --font-body: "Inter", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.35rem; font-weight: 700; }

a { color: inherit; text-decoration: none; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.center { text-align: center; margin-top: 48px; }

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ember);
  margin-bottom: 14px;
}

.gradient-text {
  background: linear-gradient(92deg, var(--ember) 0%, var(--ember-soft) 50%, var(--violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-sub { color: var(--text-dim); max-width: 560px; margin-top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(92deg, var(--ember), #ff5e3c);
  color: #1a0e06;
  box-shadow: 0 8px 30px rgba(255, 122, 60, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(255, 122, 60, 0.45); }
.btn-ghost {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}
.btn-ghost:hover { border-color: var(--ember); color: var(--ember-soft); transform: translateY(-2px); }
.btn-small { padding: 10px 20px; font-size: 0.85rem; }

.text-link { color: var(--ember-soft); font-weight: 600; font-size: 0.9rem; }
.text-link:hover { color: var(--ember); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(11, 13, 20, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; display: inline-flex; align-items: center; gap: 9px; }
.logo-word { white-space: nowrap; }
.logo-mark { height: 34px; width: auto; flex: none; }
.logo-accent { color: var(--text-dim); font-weight: 600; }

.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a { font-weight: 500; font-size: 0.95rem; color: var(--text-dim); transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active { color: var(--ember-soft); }

.nav-toggle { display: none; background: none; border: none; flex-direction: column; gap: 5px; padding: 8px; cursor: pointer; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(85svh, 760px);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  transform: scale(1.05);
  animation: heroDrift 24s ease-in-out infinite alternate;
}
@keyframes heroDrift {
  from { transform: scale(1.05) translateY(0); }
  to { transform: scale(1.12) translateY(-12px); }
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 13, 20, 0.55) 0%, rgba(11, 13, 20, 0.35) 40%, var(--bg) 100%),
    radial-gradient(ellipse at 20% 80%, rgba(11, 13, 20, 0.6), transparent 60%);
}
.hero-content { position: relative; z-index: 2; max-width: 760px; padding-top: 72px; }
.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-top: 10px;
}
.hero-content .eyebrow { text-shadow: 0 2px 12px rgba(0,0,0,0.6); }
.hero-sub { font-size: 1.15rem; color: #c9cede; max-width: 540px; margin: 22px 0 34px; text-shadow: 0 2px 16px rgba(0,0,0,0.5); }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-stores { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 22px; font-size: 0.9rem; color: var(--text-dim); text-shadow: 0 2px 12px rgba(0,0,0,0.6); }
.hero-stores a { color: var(--text); font-weight: 600; border-bottom: 1px solid rgba(255, 177, 133, 0.4); transition: color 0.2s, border-color 0.2s; }
.hero-stores a:hover { color: var(--ember-soft); border-color: var(--ember-soft); }

/* ---------- Featured ---------- */
.featured { padding: 64px 0; }
.section-head { margin-bottom: 40px; }
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 122, 60, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.feature-card--large { grid-column: 1 / -1; flex-direction: row; }
.feature-card--large .feature-media { flex: 1.4; }
.feature-card--large .feature-body { flex: 1; align-self: center; }

.feature-media { overflow: hidden; display: block; }
.feature-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  aspect-ratio: 16 / 9;
  transition: transform 0.5s ease;
}
.feature-card:hover .feature-media img { transform: scale(1.05); }
.feature-body { padding: 28px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.feature-body p { color: var(--text-dim); font-size: 0.95rem; }
.feature-body h3 a:hover { color: var(--ember-soft); }

/* ---------- Tags ---------- */
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(139, 123, 255, 0.12);
  color: #b6abff;
  border: 1px solid rgba(139, 123, 255, 0.25);
}
.tag-status {
  background: rgba(80, 200, 120, 0.12);
  color: #7fe0a2;
  border-color: rgba(80, 200, 120, 0.3);
}
.tag-status--soon {
  background: rgba(255, 122, 60, 0.12);
  color: var(--ember-soft);
  border-color: rgba(255, 122, 60, 0.35);
}

/* ---------- About ---------- */
.about { padding: 72px 0; background: var(--bg-soft); border-block: 1px solid var(--line); overflow-x: clip; }
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center; }
.about-text p { color: var(--text-dim); margin-top: 18px; }
.about-text strong { color: var(--text); }
.about-values { list-style: none; margin-top: 26px; display: grid; gap: 12px; }
.about-values li {
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.about-media { display: grid; gap: 20px; }
.about-media img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.about-media img:last-child { transform: translateX(28px); }

/* ---------- CTA ---------- */
.cta { padding: 80px 0; text-align: center; position: relative; overflow: hidden; }
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 120%, rgba(255, 122, 60, 0.16), transparent);
  pointer-events: none;
}
.cta-inner { position: relative; }
.cta p { color: var(--text-dim); margin: 14px 0 32px; }
.cta .hero-actions { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0; background: var(--bg-soft); }
.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer .logo-mark { height: 40px; }
/* Single featured game: don't stretch one card across the whole grid */
.feature-card--flip { flex-direction: row-reverse; }
.feature-note { color: var(--text-dim); font-size: 0.9rem; margin-top: 10px; }
.feature-note strong { color: var(--ember-soft); }

/* Screenshots under the cover image */
/* On desktop the thumbnails stretch to fill whatever height the text column leaves */
.game-shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  flex: 1 1 0;
  min-height: 240px;
}
.game-shots img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, opacity 0.2s ease;
}
/* An odd one out spans the full width instead of leaving a hole */
.game-shots img:last-child:nth-child(odd) { grid-column: 1 / -1; }
.game-shots img:hover { border-color: rgba(255, 122, 60, 0.6); }
.game-gallery img { cursor: zoom-in; }

/* Lightbox */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(5, 6, 10, 0.92); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox-figure { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lightbox-img {
  max-width: min(92vw, 1600px);
  max-height: calc(100dvh - 120px);
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  user-select: none;
}
.lightbox-caption { color: var(--text-dim); font-size: 0.88rem; text-align: center; max-width: 80vw; }
.lightbox-count { color: var(--ember-soft); font-weight: 600; margin-right: 8px; }
.lightbox-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(22, 26, 40, 0.8);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.lightbox-btn:hover, .lightbox-btn:focus-visible { border-color: var(--ember); color: var(--ember-soft); background: rgba(22, 26, 40, 0.95); }
.lightbox-btn:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-btn svg { width: 22px; height: 22px; }
body.lightbox-open { overflow: hidden; }

@media (max-width: 720px) {
  .lightbox-img { max-width: 100vw; border-radius: 0; }
  .lightbox-btn { width: 44px; height: 44px; }
  .lightbox-prev, .lightbox-next { top: auto; bottom: 20px; transform: none; }
  .lightbox-close { top: 12px; right: 12px; }
  .lightbox-figure { padding-bottom: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.visible { transition: none !important; transform: none !important; opacity: 1 !important; }
}

.footer-tag { color: var(--text-dim); font-size: 0.85rem; margin-top: 6px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--text-dim); font-size: 0.9rem; }
.footer-links a:hover { color: var(--ember-soft); }
.footer-copy { color: var(--text-dim); font-size: 0.8rem; }

/* ---------- Games page ---------- */
.page-hero { padding: 108px 0 36px; text-align: center; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.page-hero .eyebrow { margin-bottom: 8px; }
.page-hero .section-sub { margin: 8px auto 0; }

.filter-bar { display: flex; gap: 10px; justify-content: center; margin-top: 32px; }
.filter-btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-btn:hover { border-color: var(--ember); color: var(--text); }
.filter-btn.active {
  background: linear-gradient(92deg, var(--ember), #ff5e3c);
  color: #1a0e06;
  border-color: transparent;
}

.games-list { display: grid; gap: 56px; padding-bottom: 60px; }
.game-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  scroll-margin-top: 100px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.game-row:hover { border-color: rgba(255, 122, 60, 0.35); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4); }
.game-row--flip .game-gallery { order: 2; }
.game-row.hidden { display: none; }

.game-gallery { display: flex; flex-direction: column; }
.game-media { position: relative; overflow: hidden; aspect-ratio: 16 / 9; flex: none; }
.game-media--wide { aspect-ratio: 920 / 430; }
.game-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; transition: transform 0.5s ease; }
.game-row:hover .game-media img { transform: scale(1.04); }

.game-info { padding: 40px 44px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.game-info h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.game-info > p { color: var(--text-dim); font-size: 0.95rem; }

.game-meta { list-style: none; display: grid; gap: 6px; font-size: 0.88rem; color: var(--text-dim); margin-top: 4px; }
.game-meta strong { color: var(--text); display: inline-block; min-width: 100px; }
.game-actions { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-bg { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .featured-grid { grid-template-columns: 1fr; }
  .feature-card--large { flex-direction: column; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-media img:last-child { transform: none; }
  .game-row, .game-row--flip { grid-template-columns: minmax(0, 1fr); }
  .game-row--flip .game-gallery { order: 0; }
  .game-media { width: 100%; min-height: 240px; aspect-ratio: 16 / 9; position: relative; }
  .game-shots { flex: none; min-height: 0; grid-auto-rows: auto; }
  .game-shots img { height: auto; aspect-ratio: 16 / 9; }
  .game-media--wide { min-height: 0; aspect-ratio: 920 / 430; }
  .game-info { padding: 28px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(11, 13, 20, 0.97);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-links.open { max-height: 320px; }
  .nav-links li { width: 100%; text-align: center; }
  .nav-links a { display: block; padding: 16px; }
}
