:root {
  --text: #1e2330;
  --muted: #626b7d;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-border: rgba(30, 35, 48, 0.1);
  --shadow: 0 20px 50px rgba(30, 35, 48, 0.12);
  --shadow-hover: 0 28px 70px rgba(30, 35, 48, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 214, 102, 0.26), transparent 34rem),
    radial-gradient(circle at top right, rgba(91, 141, 255, 0.16), transparent 34rem),
    #fafaf7;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(32px, 7vw, 74px) 0 56px;
}

.hero {
  text-align: center;
  margin: 0 auto clamp(30px, 5vw, 54px);
  max-width: 860px;
}

.logo-mark {
  display: inline-grid;
  place-items: center;
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 16px;
  border-radius: 34px;
  background: #fff;
  box-shadow: var(--shadow);
  transform: rotate(-3deg);
}

.pineapple-body {
  font-size: 55px;
  line-height: 1;
}

.pineapple-top {
  position: absolute;
  top: 6px;
  right: 13px;
  color: #ffcc3e;
  font-size: 20px;
  animation: twinkle 1.8s ease-in-out infinite;
}

.eyebrow {
  margin: 0 0 10px;
  color: #2d8f50;
  font-size: clamp(0.8rem, 2vw, 0.98rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.intro {
  max-width: 730px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2.8vw, 1.42rem);
  line-height: 1.55;
  font-weight: 700;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 2vw, 26px);
}

.app-card {
  position: relative;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 30px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.app-card::after {
  content: "Open →";
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #222837;
  font-size: 0.86rem;
  font-weight: 900;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 180ms ease, transform 180ms ease;
  box-shadow: 0 8px 22px rgba(30, 35, 48, 0.14);
}

.app-card:hover,
.app-card:focus-visible {
  transform: translateY(-8px) scale(1.015);
  border-color: rgba(30, 35, 48, 0.18);
  box-shadow: var(--shadow-hover);
  outline: none;
}

.app-card:hover::after,
.app-card:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.card-art {
  padding: 14px 14px 0;
}

.card-art svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22px;
}

.card-copy {
  padding: 18px 20px 24px;
}

.card-copy h2 {
  margin: 0 0 8px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.card-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
  font-weight: 700;
}

.shootout:hover h2,
.shootout:focus-visible h2 { color: #26762d; }
.quiz:hover h2,
.quiz:focus-visible h2 { color: #6244dc; }
.emkart:hover h2,
.emkart:focus-visible h2 { color: #db2d3e; }
.dino:hover h2,
.dino:focus-visible h2 { color: #357d39; }

@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.24) rotate(18deg); opacity: 1; }
}

@media (max-width: 1040px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 28px;
  }

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

  .logo-mark {
    width: 82px;
    height: 82px;
    border-radius: 28px;
  }

  .pineapple-body {
    font-size: 46px;
  }

  .card-copy {
    padding: 16px 18px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
