/* ── Human Page Styles ── */
html { scroll-behavior: smooth; }

body {
  background: #f5f0e8;
  color: #1a1714;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 300;
  opacity: 0;
  min-height: 100vh;
}
body.loaded { opacity: 1; transition: opacity 300ms ease; }

/* ── Header ── */
header {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 28px 40px;
  display: flex; align-items: center; gap: 14px;
  z-index: 10; background: linear-gradient(to bottom, #f5f0e8 70%, transparent);
}
.back {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 20px; font-weight: 100;
  color: #8a8078; text-decoration: none;
  display: flex; align-items: center; gap: 6px;
  transition: color 150ms;
}
.back:hover { color: #1a1714; }
.back-sep { color: #c8c0b4; font-size: 11px; }
.logo {
  font-family: 'Cormorant Garamond', serif;
  font-style: normal; font-weight: 300;
  font-size: 17px; color: #1a1714;
}

/* ── Content ── */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 120px 40px 100px;
}

section { margin-bottom: 72px; }

/* Bio */
.bio-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px; font-weight: 300; font-style: normal;
  line-height: 1.65; color: #1a1714;
}
.bio-text em { font-style: italic; color: #5a5248; }

/* Section labels */
.section-label {
  font-size: 10px; font-weight: 400;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: #a09888; margin-bottom: 28px;
}

/* ── Books ── */
.pills-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px; font-weight: 300;
  padding: 5px 14px; border-radius: 999px;
  background: #e8e0d4; color: #4a4540;
  letter-spacing: 0.02em;
  transition: background 150ms;
}
.pill:hover { background: #ddd5c8; }
.pill-outlined {
  background: transparent;
  border: 1px solid #c8bfb4;
  color: #6a6058;
}
.pill-outlined:hover { background: #ede8df; }

/* ── Gallery Game ── */
.game-block {
  background: #131210;
  padding: 40px 32px 48px;
}
.game-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px;
}
.game-title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px; font-weight: 400; letter-spacing: 0.18em;
  text-transform: uppercase; color: #6b6560;
}
.game-link {
  font-size: 12px; font-weight: 400;
  color: #8a8078; text-decoration: none;
  letter-spacing: 0.04em; transition: color 150ms;
}
.game-link:hover { color: #f5f0e8; }

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 480px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
.card {
  aspect-ratio: 1;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: #1e1c1a;
  transition: transform 150ms;
  transform-style: preserve-3d;
}
.card:hover { transform: scale(1.02); }
.card.flipped .card-front { transform: rotateY(180deg); }
.card.flipped .card-back  { transform: rotateY(0deg); }
.card.matched { opacity: 0.6; cursor: default; }
.card.matched:hover { transform: none; }
.card.shake { animation: shake 300ms ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.card-front, .card-back {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  backface-visibility: hidden;
  transition: transform 400ms ease;
  border-radius: 6px;
}
.card-front {
  background: #1e1c1a;
  transform: rotateY(0deg);
}
.card-front .q {
  font-size: 28px; color: #3a3835;
  font-family: 'IBM Plex Sans', sans-serif; font-weight: 300;
  line-height: 1;
}
.card-front .q-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: #3a3835; margin-top: 3px;
}
.card-back {
  transform: rotateY(-180deg);
  background: #2a2825;
}
.card-back img {
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; inset: 0; border-radius: 6px;
  opacity: 0.85;
}
.card-location {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  padding: 12px 8px 8px;
  font-size: 9px; font-weight: 400; letter-spacing: 0.08em;
  color: #e8e3da; text-align: center; text-transform: uppercase;
  border-radius: 0 0 6px 6px;
}

/* Game stats */
.game-stats {
  display: flex; gap: 24px; margin-top: 20px;
  font-size: 11px; color: #6b6560; font-family: 'IBM Plex Sans', sans-serif;
  letter-spacing: 0.08em;
}
.game-stats span { color: #a09888; }

/* Win modal */
.game-modal {
  display: none; position: absolute;
  inset: 0; background: rgba(13,12,10,0.85);
  align-items: center; justify-content: center;
  border-radius: 0; z-index: 10;
}
.game-modal.show { display: flex; }
.modal-box {
  background: #1e1c1a; padding: 36px 40px;
  max-width: 340px; text-align: center;
  border-radius: 4px;
}
.modal-box h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; font-weight: 300; font-style: italic;
  color: #f5f0e8; margin-bottom: 12px;
}
.modal-box p {
  font-size: 13px; line-height: 1.6; color: #8a8078;
  font-weight: 300; margin-bottom: 24px;
}
.modal-score {
  display: flex; gap: 32px; justify-content: center;
  margin-bottom: 28px;
}
.modal-score-item { font-size: 11px; color: #6b6560; letter-spacing: 0.08em; }
.modal-score-item strong { display: block; font-size: 24px; font-weight: 300; color: #f5f0e8; margin-bottom: 2px; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.modal-actions a {
  font-size: 12px; color: #8a8078; text-decoration: underline;
  cursor: pointer; transition: color 150ms;
}
.modal-actions a:hover { color: #f5f0e8; }

.game-wrap { position: relative; }
