:root {
  color-scheme: light;
  --ink: #20221f;
  --muted: #63685f;
  --paper: #f3f1e8;
  --line: rgba(32, 34, 31, .14);
  --green: #527a57;
  --blue: #486d91;
  --red: #b64a3b;
  --gold: #d8ae55;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 20%, rgba(82, 122, 87, .18), transparent 30%),
    linear-gradient(135deg, rgba(70, 104, 124, .16), transparent 42%),
    linear-gradient(315deg, rgba(182, 74, 59, .14), transparent 45%),
    var(--paper);
}

.portal {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(24px, 5vw, 42px);
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow,
.card-copy span,
.card-copy em,
.intro {
  margin: 0;
  color: var(--muted);
}

h1 {
  margin: 4px 0 0;
  font-size: clamp(42px, 9vw, 88px);
  line-height: .95;
  letter-spacing: 0;
}

.intro {
  max-width: 280px;
  font-size: 18px;
  line-height: 1.65;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card {
  min-height: 440px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  color: inherit;
  text-decoration: none;
  background: #fffaf0;
  box-shadow: 0 14px 34px rgba(32, 35, 31, .12);
  transition: transform .16s ease, box-shadow .16s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 22px 42px rgba(32, 35, 31, .18);
  outline: none;
}

.card-copy {
  display: grid;
  gap: 9px;
}

.card-copy strong {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1;
}

.snake {
  border-top: 8px solid var(--green);
}

.tetris {
  border-top: 8px solid var(--blue);
}

.klotski {
  border-top: 8px solid var(--red);
}

.preview {
  position: relative;
  min-height: 250px;
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #2c2b26;
}

.snake-preview {
  background:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px),
    #223129;
  background-size: 28px 28px;
}

.snake-preview span,
.snake-preview i {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.snake-preview span {
  background: var(--green);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .22);
}

.snake-preview span:nth-child(1) { left: 56px; top: 84px; }
.snake-preview span:nth-child(2) { left: 84px; top: 84px; }
.snake-preview span:nth-child(3) { left: 112px; top: 84px; }
.snake-preview span:nth-child(4) { left: 112px; top: 112px; }

.snake-preview i {
  right: 58px;
  bottom: 62px;
  background: var(--red);
}

.tetris-preview {
  background:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px),
    #202a34;
  background-size: 30px 30px;
}

.tetris-preview span {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  background: var(--blue);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .28), 0 5px 12px rgba(0, 0, 0, .22);
}

.tetris-preview span:nth-child(1) { left: 74px; top: 54px; background: var(--gold); }
.tetris-preview span:nth-child(2) { left: 104px; top: 54px; background: var(--gold); }
.tetris-preview span:nth-child(3) { left: 104px; top: 84px; background: var(--gold); }
.tetris-preview span:nth-child(4) { right: 72px; bottom: 62px; }
.tetris-preview span:nth-child(5) { right: 102px; bottom: 62px; }

.klotski-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 5px;
  padding: 14px;
  background: #3a2b23;
}

.klotski-preview b,
.klotski-preview span,
.klotski-preview i {
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #fff9ec;
  font-style: normal;
  font-size: 18px;
  background: var(--green);
}

.klotski-preview b {
  grid-column: 2 / span 2;
  grid-row: 1 / span 2;
  background: var(--red);
}

.klotski-preview span:nth-of-type(1) {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.klotski-preview span:nth-of-type(2) {
  grid-column: 4;
  grid-row: 1 / span 2;
}

.klotski-preview i:nth-of-type(1) {
  grid-column: 2 / span 2;
  grid-row: 3;
  background: var(--blue);
}

.klotski-preview i:nth-of-type(2) {
  grid-column: 2;
  grid-row: 5;
  background: #8a6046;
}

@media (max-width: 820px) {
  .hero {
    display: grid;
    align-items: start;
  }

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

  .card {
    min-height: 360px;
  }

  .preview {
    min-height: 210px;
  }
}
