@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap');

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

:root {
  --bg: #EAF4FF;
  --text: #16304F;
  --muted: #4F78A6;
  --subtle: #BFD6EE;
  --stone: #2F6FB2;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--sans);
  background: linear-gradient(180deg, #f4f9ff 0%, var(--bg) 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 12vh 24px 8vh;
}

.hero {
  text-align: center;
  max-width: 520px;
  animation: fadeUp 0.8s ease both;
}

.site-title {
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.divider {
  width: 48px;
  height: 1px;
  background: var(--stone);
  margin: 2.5rem auto;
  animation: fadeUp 0.8s ease 0.15s both;
}

.tagline {
  font-size: 1.05rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  animation: fadeUp 0.8s ease 0.25s both;
}

.games {
  list-style: none;
  width: 100%;
  max-width: 440px;
  margin-top: 4rem;
  animation: fadeUp 0.8s ease 0.35s both;
}

.games li {
  border-bottom: 1px solid var(--subtle);
}

.games li:last-child {
  border-bottom: none;
}

.game-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.6rem 0;
  text-decoration: none;
  color: var(--text);
  transition: color 0.25s ease;
}

.game-link:hover {
  color: var(--muted);
}

.game-name {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1.1;
}

.game-arrow {
  font-size: 1.2rem;
  color: var(--stone);
  transition: transform 0.25s ease, color 0.25s ease;
  flex-shrink: 0;
}

.game-link:hover .game-arrow {
  transform: translateX(3px);
  color: var(--muted);
}

.footer {
  margin-top: auto;
  padding-top: 6rem;
  text-align: center;
  animation: fadeUp 0.8s ease 0.45s both;
}

.footer-row {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
}

.footer-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.25s ease;
}

.footer-link:hover {
  color: var(--text);
}

.copyright {
  color: var(--muted);
  font-size: 0.82rem;
}

.enso {
  display: block;
  width: 36px;
  height: 36px;
  margin: 1.25rem auto 0;
  opacity: 0.18;
}

.dialog {
  border: none;
  padding: 0;
  max-width: 480px;
  width: calc(100% - 48px);
  background: transparent;
  color: var(--text);
  margin: auto;
}

.dialog::backdrop {
  background: rgba(45, 42, 38, 0.25);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.dialog-inner {
  background: var(--bg);
  border: 1px solid var(--subtle);
  padding: 2.5rem 2rem 2rem;
  position: relative;
}

.dialog-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--stone);
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  transition: color 0.2s ease;
}

.dialog-close:hover {
  color: var(--text);
}

.dialog-title {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.dialog-inner p {
  max-width: 52ch;
  margin-bottom: 1rem;
  color: var(--muted);
  line-height: 1.7;
}

.dialog-inner p:last-child {
  margin-bottom: 0;
}

.dialog-inner a {
  color: inherit;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .divider,
  .tagline,
  .games,
  .footer {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .game-link:hover .game-arrow {
    transform: none;
  }

  .footer-link {
    transition: none;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 8vh 20px 6vh;
  }

  .games {
    margin-top: 3rem;
  }

  .game-link {
    padding: 1.3rem 0;
  }
}
