/* --- Global Reset --- */
body {
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0;
    background: #fafafa;
    color: #111;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* --- Header Section --- */
.site-header {
    text-align: center;
    margin-bottom: 60px;
}

.title {
    font-size: 48px;
    margin: 0;
    font-weight: 900;
    letter-spacing: -1.5px;
    text-transform: lowercase;
}

.pronunciation {
    color: #888;
    margin-top: 8px;
    font-family: serif;
    font-style: italic;
}

.typed-wrap {
    max-width: 800px;
    margin: 25px auto;
    color: #444;
    line-height: 1.8;
    min-height: 80px;
}

/* --- THE FIX: The Square Grid --- */
.grid {
    display: grid;
    /* This defines the width of the squares */
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 15px;
}

.card {
    position: relative;
    display: block;
    /* Forces the height to match the width for a perfect square */
    aspect-ratio: 1 / 1; 
    overflow: hidden;
    background: #000;
    text-decoration: none;
    border-radius: 10px; /* Adjust 20px higher for more curve, lower for less */
}

.card img {
    width: 100%;
    height: 100%;
    /* Crops the image edges so it fills the square without stretching */
    object-fit: cover; 
    display: block;
    transition: transform 0.6s ease, opacity 0.4s ease;
}

/* --- Centered Overlay (Appears on Hover) --- */
/* Ensure the card is the reference point for the overlay */
.card {
  position: relative;
  display: block;
  overflow: hidden;
  text-decoration: none;
}

/* The overlay container */
.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  
  /* Flexbox centering magic */
  display: flex;
  align-items: center;     /* Vertical center */
  justify-content: center;  /* Horizontal center */
  
  background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Show overlay on hover */
.card:hover .card-overlay {
  opacity: 1;
}

/* Optional: Styling for the title text itself */
.card-title-center {
  color: #fff;
  padding: 10px;
  text-align: center;
  font-family: sans-serif; /* Match your site's aesthetic */
}

/* Ensure the long title fits on mobile screens */
@media (max-width: 600px) {
    .title {
        font-size: 32px; /* Scales down from 48px */
        word-wrap: break-word;
        overflow-wrap: break-word;
        letter-spacing: -1px; /* Slightly tighter spacing to save room */
    }
    
    .site-header {
        margin-bottom: 40px; /* Reduces whitespace on mobile */
    }
}