@import url("tokens.css");
@import url("site.css");

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Hero uses absolute header overlay */
.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(18px + var(--safe-top)) clamp(16px, 4vw, 40px) 0;
  pointer-events: none;
  background: transparent;
  border: none;
  backdrop-filter: none;
}

.site-header .logo,
.site-header .site-nav {
  pointer-events: auto;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent);
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-muted);
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--ink);
}

.hero {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: end start;
  overflow: hidden;
  padding: calc(96px + var(--safe-top)) clamp(16px, 5vw, 48px)
    calc(48px + var(--safe-bottom));
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(168, 213, 206, 0.55), transparent 55%),
    radial-gradient(ellipse 70% 50% at 15% 80%, rgba(184, 201, 217, 0.7), transparent 50%),
    linear-gradient(165deg, #dce6f0 0%, var(--bg) 45%, #d2dde8 100%);
}

.hero-visual {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-visual canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 34rem;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 10vw, 6.5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin-bottom: 1.1rem;
  color: var(--ink);
}

.brand em {
  font-style: normal;
  color: var(--accent);
}

.hero-lead {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-bottom: 0.65rem;
}

.hero-support {
  font-size: 1.05rem;
  color: var(--ink-muted);
  line-height: 1.5;
  max-width: 28rem;
  margin-bottom: 1.75rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.35rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--ink);
  color: var(--surface);
  box-shadow: 0 10px 28px var(--shadow-strong);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.85);
}

.games {
  padding: clamp(64px, 10vw, 112px) clamp(16px, 5vw, 48px) calc(48px + var(--safe-bottom));
  background: var(--surface);
}

.section-inner {
  max-width: var(--max-content);
  margin: 0 auto;
}

.section-head {
  max-width: 40rem;
  margin-bottom: clamp(24px, 4vw, 36px);
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.section-head p {
  color: var(--ink-muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.game-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.game-grid-empty {
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.5;
  padding: 8px 0;
}

.game-grid-empty code {
  font-size: 0.9em;
  color: var(--ink);
}

@media (min-width: 640px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .game-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

.game-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.35rem 1.35rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--surface-elevated);
  border: 1px solid rgba(21, 38, 54, 0.06);
  box-shadow: 0 8px 30px var(--shadow);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}

.game-card:hover,
.game-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px var(--shadow-strong);
}

.game-card-accent {
  width: 42px;
  height: 6px;
  border-radius: 999px;
  margin-bottom: 1.1rem;
  background: var(--card-accent, var(--accent));
}

.game-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
}

.game-card p {
  color: var(--ink-muted);
  line-height: 1.45;
  flex-grow: 1;
  margin-bottom: 1.25rem;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 1.1rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.game-score {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 1rem;
  min-height: 1.25em;
}

.game-score strong {
  color: var(--ink);
}

.play-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent);
}

.play-link svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s var(--ease-out);
}

.game-card:hover .play-link svg,
.game-card:focus-within .play-link svg {
  transform: translateX(3px);
}

.site-footer {
  padding: 28px clamp(16px, 5vw, 48px) calc(28px + var(--safe-bottom));
  background: var(--bg-deep);
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.footer-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.footer-links a,
.footer-inner a {
  font-weight: 600;
  color: var(--ink);
}

.footer-links a:hover,
.footer-inner a:hover {
  color: var(--accent);
}
