:root {
  color-scheme: light dark;
  --bg: #0f1117;
  --card: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.14);
  --text: #f5f7fb;
  --muted: #aeb6c8;
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --button: #ffffff;
  --button-text: #11131a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124, 92, 255, 0.32), transparent 32rem),
    radial-gradient(circle at top right, rgba(0, 212, 255, 0.22), transparent 28rem),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

header {
  position: relative;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 1.2rem;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  box-shadow: 0 18px 50px rgba(124, 92, 255, 0.35);
}

nav {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

nav a:hover {
  color: var(--text);
}

.menu-toggle {
  display: none;
  border: none;
  background: transparent;
  width: 18px;
  height: 18px;
  padding: 0;
  margin-left: 18px;
  cursor: pointer;
  place-items: center;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle span + span {
  margin-top: 5px;
}

header.nav-open .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

header.nav-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

header.nav-open .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 42px;
  align-items: center;
}

h1 {
  font-size: clamp(3rem, 7vw, 6.6rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  margin: 0;
  max-width: 760px;
}

.hero-quote {
  margin: 30px 0 0;
  max-width: 680px;
}

.hero-quote blockquote {
  margin: 0;
  padding: 24px 28px;
  border-left: 4px solid rgba(124, 92, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.05rem;
  line-height: 1.7;
  letter-spacing: 0.01em;
  border-radius: 18px;
}

.hero-quote figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
  text-align: right;
}

.gradient {
  background: linear-gradient(135deg, #fff, #bfc8ff 46%, #8beaff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.65;
  max-width: 640px;
  margin: 26px 0 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 16px;
  font-weight: 750;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.primary {
  background: var(--button);
  color: var(--button-text);
}

.secondary {
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.showcase {
  position: relative;
  min-height: 440px;
  display: grid;
  place-items: center;
}

.device {
  width: min(330px, 80vw);
  min-height: 420px;
  border-radius: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.08);
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.42);
  padding: 22px;
  backdrop-filter: blur(18px);
  transform: rotate(3deg);
}

.screen {
  min-height: 376px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.24), transparent 8rem),
    linear-gradient(145deg, rgba(124, 92, 255, 0.75), rgba(0, 212, 255, 0.42));
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.game-frame {
  position: relative;
  width: 100%;
  height: 100%;
}

#space-invaders-game {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0;
  background: #04090d;
  box-shadow: inset 0 0 0 1px rgba(160, 255, 127, 0.08);
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity 0.24s ease;
  pointer-events: none;
}

#space-invaders-game.active {
  opacity: 1;
  pointer-events: auto;
}

.game-start-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 9, 13, 0.55);
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.game-start-overlay button {
  position: relative;
  pointer-events: auto;
  border: none;
  background: rgba(12, 18, 24, 0.95);
  color: #bfffa2;
  border-radius: 999px;
  padding: 14px 32px;
  font: 700 0.95rem Inter, ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: transform 0.16s ease, background 0.16s ease;
  overflow: hidden;
  z-index: 1;
}

.game-start-overlay button::before {
  content: '';
  position: absolute;
  inset: -75px;
  border-radius: 999px;
  background: conic-gradient(
    from 0deg,
    #ff4d4d,
    #ffb84d,
    #fff14d,
    #7dff5e,
    #4dd7ff,
    #d14dff,
    #ff4d4d
  );
  animation: rainbow-spin 3s linear infinite;
  z-index: -2;
}

.game-start-overlay button::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: rgba(12, 18, 24, 0.95);
  z-index: -1;
}

.game-start-overlay button:hover {
  transform: translateY(-2px);
}

@keyframes rainbow-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.app-icon {
  width: 78px;
  height: 78px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  color: #11131a;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 900;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.screen h2 {
  margin: 0;
  font-size: 2.15rem;
  line-height: 1;
  letter-spacing: -0.05em;
}

.screen p {
  color: rgba(255, 255, 255, 0.78);
  margin: 12px 0 0;
  font-size: 1rem;
}

.page-heading {
  margin-bottom: 42px;
}

.page-heading h1 {
  font-size: clamp(3rem, 7vw, 5.4rem);
}

.page-heading p {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.65;
  max-width: 620px;
  margin: 22px 0 0;
}

.app-list {
  display: grid;
  gap: 14px;
  max-width: 920px;
}

.app-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  border: 1px solid var(--card-border);
  background: var(--card);
  border-radius: 22px;
  padding: 22px 24px;
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.14);
}

.app-row h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.app-row p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.app-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.app-meta span {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

.app-meta .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d0ffd8;
  font-size: 0.78rem;
  white-space: nowrap;
}

.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 700;
  font-size: 0.92rem;
}

.download:hover {
  background: rgba(255, 255, 255, 0.16);
}

.exception-card,
.trace-card {
  border: 1px solid var(--card-border);
  background: var(--card);
  border-radius: 28px;
  padding: 24px;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  max-width: 760px;
}

.exception-title,
.trace-title {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

.trace-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.trace-meta span {
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

pre {
  margin: 0;
  overflow-x: auto;
  padding: 18px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

code {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
}

.inline-code {
  color: #d7ffe2;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.1em 0.45em;
  font-family: Consolas, ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 0.9rem;
  line-height: 1.4;
}

footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 40px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 850px) {
  .menu-toggle {
    display: grid;
  }

  nav {
    position: absolute;
    inset: 100% auto auto 0;
    width: min(100%, calc(100vw - 40px));
    margin: 0 20px;
    padding: 18px 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: rgba(15, 18, 27, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 24px 24px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 10;
  }

  header.nav-open nav {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  nav a {
    padding: 16px 22px;
    color: var(--text);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  nav a:first-child {
    border-top: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .showcase {
    min-height: 360px;
  }

  .device {
    min-height: 360px;
  }

  .screen {
    min-height: 316px;
  }
}

@media (max-width: 700px) {
  .app-row {
    grid-template-columns: 1fr;
  }

  .app-meta {
    justify-content: space-between;
  }
}
