:root {
  --bg: #fdf8e4;
  --text: #1f2328;
  --muted: #656d76;
  --accent: #2f6feb;
  --border: #e8e0c4;
  --max-width: 680px;

  /* Width of each tiled side area; tiles.js sets this to fit the window */
  --board-width: 0px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --text: #e6e8eb;
    --muted: #9aa3ad;
    --accent: #6ea8fe;
    --border: #2a2f36;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.65;
  /* Keep page content clear of the side boards */
  padding: 0 var(--board-width);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Main content */
main {
  padding: 5rem 0 3rem;
}

h1 {
  font-size: 2.2rem;
  line-height: 1.2;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.4rem;
  margin-top: 2.5rem;
}

a {
  color: var(--accent);
}

.muted {
  color: var(--muted);
}

.intro {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.headshot {
  display: block;
  width: 260px;
  height: 325px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 8px;
}

/* Stack photo above the name on narrow (phone) screens */
@media (max-width: 600px) {
  .intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}

footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
}

footer a {
  color: var(--muted);
}

/* Game-board side borders */
.board {
  position: fixed;
  top: 0;
  bottom: 0;
  width: var(--board-width);
  overflow: hidden;
}

.board svg {
  display: block;
  width: 100%;
  height: 100%;
}

.board-left {
  left: 0;
}

.board-right {
  right: 0;
}

/* Penrose rhombs. Each tile is drawn slightly smaller than its spot, so the
   background shows through as the gaps between tiles (see tileGap in tiles.js).
   Each tile is placed with a CSS transform, which animates during a shuffle. */
.tile {
  --move: transform 1.4s cubic-bezier(0.65, 0, 0.35, 1) var(--move-delay, 0s);
  fill: var(--tile-color);
  transform-box: view-box;
  transform-origin: 0 0;
  transition: fill 1.5s ease, var(--move); /* fill: fade-out speed after the cursor leaves */
}

/* Lighter shade that fades in over the whole tile on hover */
.tile:hover {
  fill: var(--tile-light);
  transition: fill 0.4s ease, var(--move); /* fill: fade-in speed */
}

/* Tiles that don't fit the new pattern fly away and can't be hovered */
.tile.leaving {
  pointer-events: none;
}

/* Shuffle button (two arrows in a circle) */
.shuffle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.shuffle-button:hover,
.shuffle-button:focus-visible {
  color: var(--text);
  border-color: var(--muted);
  background: rgba(0, 0, 0, 0.04);
}

.shuffle-button svg {
  width: 28px;
  height: 28px;
}

.shuffle-button.spinning svg {
  animation: spin 0.7s ease;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

