@font-face {
  font-family: "m5x7";
  src: url("assets/fonts/m5x7.ttf") format("truetype");
  font-display: block;
}
@font-face {
  font-family: "Josefin Sans";
  src: url("assets/fonts/JosefinSans.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}

/* Colors sampled from the Megista logo */
:root {
  --bg: #02032b;
  --bg-deep: #01011a;
  --glow: #1d3680;
  --violet: #322275;
  --lavender: #7c79ff;
  --cyan: #27aae1;
  --text: #eef0ff;
  --muted: #9a9cc8;
  --line: rgba(124, 121, 255, 0.28);
  --panel: rgba(18, 20, 70, 0.55);
  --sans: "Josefin Sans", "Futura", "Avenir Next", "Century Gothic", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font: 400 18px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse 900px 620px at 50% 260px, rgba(29, 54, 128, 0.75), transparent 70%),
    radial-gradient(ellipse 700px 500px at 85% 1400px, rgba(50, 34, 117, 0.45), transparent 70%),
    radial-gradient(ellipse 700px 500px at 10% 2200px, rgba(29, 54, 128, 0.35), transparent 70%),
    linear-gradient(var(--bg), var(--bg-deep));
  background-color: var(--bg-deep);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
b, strong { font-weight: 600; color: #fff; }

/* Hub: the whole page is the village */
.hub {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
}
.hub h1 { margin: 0 0 12px; }
.hub-logo { width: min(250px, 60vw); height: auto; margin: 0 auto; }
.hub-frame {
  --ar: 1.7778;
  width: min(1200px, calc(100vw - 24px), calc((100vh - 280px) * var(--ar)));
  width: min(1200px, calc(100vw - 24px), calc((100svh - 280px) * var(--ar)));
  border-radius: 14px;
  padding: 6px;
  background: linear-gradient(135deg, rgba(124, 121, 255, 0.5), rgba(39, 170, 225, 0.35));
  box-shadow: 0 0 60px rgba(124, 121, 255, 0.25), 0 30px 80px rgba(1, 1, 26, 0.7);
}
#hub {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--ar);
  border-radius: 9px;
  background: #02032b;
  image-rendering: pixelated;
  touch-action: manipulation;
}
#hub:focus { outline: none; }
#hub:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.hub-hint { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.hub-hint kbd {
  display: inline-block;
  min-width: 22px;
  padding: 2px 5px 0;
  margin: 0 1px;
  font: 400 12px/1.4 var(--sans);
  color: #fff;
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 5px;
}
.hint-touch { display: none; }
@media (hover: none) {
  .hint-keys { display: none; }
  .hint-touch { display: inline; }
}
.hub-menu { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin-top: 10px; }
.hub-menu a {
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--lavender);
  text-decoration: none;
}
.hub-menu a:hover, .hub-menu a:focus-visible { color: #fff; }
.hub-copy { margin: 10px 0 0; font-size: 12px; color: rgba(154, 156, 200, 0.6); }

/* Content for the panels: readable by search engines and screen readers, hidden on screen */
.has-hub .content {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
html:not(.has-hub) .hub-frame,
html:not(.has-hub) .hub-hint { display: none; }

/* Panel that opens when you walk into a door */
.panel {
  width: min(960px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  padding: 0;
  color: var(--text);
  background: #05062e;
  border: 2px solid var(--lavender);
  border-radius: 14px;
  box-shadow: 0 0 0 6px rgba(124, 121, 255, 0.15), 0 0 80px rgba(124, 121, 255, 0.35);
}
.panel::backdrop { background: rgba(1, 1, 26, 0.75); backdrop-filter: blur(3px); }
.panel[open] { animation: panel-in 0.18s steps(4); }
@keyframes panel-in { from { transform: scale(0.92); opacity: 0; } }
.panel-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px 20px;
  background: #05062e;
  border-bottom: 1px solid var(--line);
}
.panel-title { font: 24px/1 "m5x7", monospace; letter-spacing: 2px; color: var(--cyan); }
.panel-close {
  font: 300 26px/1 var(--sans);
  color: #fff;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 38px;
  height: 34px;
  cursor: pointer;
}
.panel-close:hover { border-color: var(--lavender); }
.panel-body > .section { padding: 24px 22px 28px; max-width: none; }
.panel-body .heading { display: none; }

/* Buttons */
.buttons { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.btn {
  display: inline-block;
  font: 400 14px/1 var(--sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 16px 28px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #fff;
  text-decoration: none;
  background: rgba(124, 121, 255, 0.06);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:hover { border-color: var(--lavender); background: rgba(124, 121, 255, 0.16); }
.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #5b4bd6, var(--lavender) 55%, var(--cyan));
  box-shadow: 0 0 24px rgba(124, 121, 255, 0.35);
}
.btn-primary:hover { background: linear-gradient(135deg, #6a5ae6, #8e8bff 55%, #45bdf0); box-shadow: 0 0 36px rgba(124, 121, 255, 0.55); }
.btn.soon {
  border-color: rgba(154, 156, 200, 0.25);
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  cursor: default;
}
.btn.soon::after { content: "\00a0\00b7\00a0soon"; }

/* Sections */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 88px 24px 24px;
}
.section.narrow { max-width: 760px; }
.heading {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0 0 36px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--lavender);
}
.heading::before,
.heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.small { font-size: 15px; color: var(--muted); }

/* Game card */
.game {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 20px;
  background: var(--panel);
  border: 1px solid rgba(124, 121, 255, 0.18);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(1, 1, 26, 0.6);
}
.game-art {
  display: block;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(124, 121, 255, 0.25);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.game-art:hover { border-color: var(--cyan); box-shadow: 0 0 30px rgba(39, 170, 225, 0.3); }
.game-art img { width: 100%; height: auto; image-rendering: pixelated; }
.game-art img.smooth { image-rendering: auto; }
.status {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}
.game-title {
  margin: 10px 0 14px;
  font-size: 40px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
}
.game .buttons { justify-content: flex-start; margin-top: 24px; }
.more {
  text-align: center;
  margin: 44px 0 0;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* Contact */
.contact { text-align: center; }
.contact .buttons { margin-top: 28px; }

/* Phone */
@media (max-width: 760px) {
  body { font-size: 17px; }
  .hub { padding: 12px; }
  .hub-frame { padding: 4px; border-radius: 10px; }
  .panel-body > .section { padding: 18px 14px 22px; }
  .section { padding: 64px 16px 16px; }
  .game { grid-template-columns: 1fr; gap: 20px; padding: 14px; }
  .game-title { font-size: 32px; }
  .game .buttons { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Team */
.sub {
  margin: 56px 0 24px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cyan);
}
.team {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.member {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 16px;
  background: var(--panel);
  border: 1px solid rgba(124, 121, 255, 0.18);
  border-radius: 16px;
}
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 45%, rgba(29, 54, 128, 0.9), var(--bg-deep) 75%);
}
.avatar img { height: 46px; width: auto; filter: drop-shadow(0 0 10px rgba(124, 121, 255, 0.7)); }
.avatar img.photo { width: 100%; height: 100%; object-fit: cover; filter: none; }
.member figcaption { font-size: 15px; line-height: 1.4; color: var(--muted); }
.member figcaption b {
  display: block;
  margin-bottom: 4px;
  font-size: 19px;
  font-weight: 400;
  color: #fff;
}
@media (max-width: 760px) {
  .team { grid-template-columns: 1fr; }
  .partner { flex-direction: column; text-align: center; gap: 16px; }
}

/* Partners */
.partner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 24px 28px;
  text-decoration: none;
  background: var(--panel);
  border: 1px solid rgba(124, 121, 255, 0.18);
  border-radius: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.partner:hover { border-color: var(--cyan); box-shadow: 0 0 30px rgba(39, 170, 225, 0.2); }
.partner-logo { flex: none; width: 120px; height: auto; }
.partner-body { display: grid; gap: 8px; }
.partner-text { color: var(--muted); }
.partner-link {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}

/* Second and later game cards alternate sides */
.game + .game { margin-top: 28px; }
.game-flip { grid-template-columns: 1fr 1.25fr; }
.game-flip .game-art { order: 2; }
@media (max-width: 760px) {
  .game-flip { grid-template-columns: 1fr; }
  .game-flip .game-art { order: 0; }
}

.signature {
  margin-top: 4px;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--lavender);
}
body:has(.hub) { overflow-x: hidden; }
