/* ============================================================
   BENTO GRID
   Bento grid layout, tile variants (content/glass/image/dark),
   color swatches, typography showcase, download grid,
   tile actions, scroll reveal
   ============================================================ */

.bento-section {
  padding: 40px 0 80px;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(200px, auto);
  gap: var(--gap);
}

/* Tile base styling */
.bento-tile {
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  /* Scroll reveal */
  opacity: 0;
  transform: translateY(30px);
}

.bento-tile.revealed {
  opacity: 1;
  transform: translateY(0);
}

.bento-tile:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.bento-tile.revealed:hover {
  transform: translateY(-6px);
}

/* Tile sizes */
.tile-2x2 {
  grid-column: span 2;
  grid-row: span 2;
}

.tile-2x1 {
  grid-column: span 2;
}

.tile-1x2 {
  grid-row: span 2;
}

/* Content tiles */
.tile-content {
  background: var(--white);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  display: flex;
  flex-direction: column;
}

.tile-content:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-lg);
}

/* Linked content tiles — ensure <a> tags render identically to <div> */
a.tile-content {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

/* Glass tiles */
.tile-glass {
  background: var(--glass-bg-light);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border-light);
  box-shadow: var(--shadow-md);
  padding: 32px;
  display: flex;
  flex-direction: column;
}

.tile-glass:hover {
  background: rgba(255,255,255,0.75);
  box-shadow: var(--shadow-lg);
}

/* Image tiles */
.tile-image {
  position: relative;
}

.tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,26,46,0.93) 0%, rgba(26,26,46,0.85) 30%, rgba(26,26,46,0.08) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
}

.tile-image-overlay h3 {
  font-family: var(--font-primary);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.tile-image-overlay p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.5;
  font-weight: 300;
}

/* Dark accent tiles */
.tile-dark {
  background: var(--dark-bg);
  color: var(--white);
  padding: 32px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
}

.tile-dark:hover {
  box-shadow: var(--shadow-xl);
}

/* Tile internals */
.tile-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.tile-icon-light {
  background: var(--gray-100);
  color: var(--cooper-red);
}

.tile-icon-dark {
  background: rgba(255,255,255,0.1);
  color: var(--cooper-red-light);
}

.tile-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
  margin-bottom: 8px;
}

.tile-dark .tile-label {
  color: rgba(255,255,255,0.4);
}

.tile-title {
  font-family: var(--font-primary);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--gray-900);
  line-height: 1.25;
}

.tile-dark .tile-title {
  color: var(--white);
}

.tile-desc {
  font-size: 1rem;
  color: var(--gray-500);
  line-height: 1.6;
  flex: 1;
  font-weight: 400;
}

.tile-dark .tile-desc {
  color: rgba(255,255,255,0.85);
}

/* Color palette tile */
.color-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: auto;
}

.swatch {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  border: 2px solid transparent;
}

.swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  z-index: 2;
}

.swatch-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gray-500);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.swatch:hover .swatch-label {
  opacity: 1;
}

/* Typography tile */
.typo-showcase {
  margin-top: auto;
}

.typo-sample {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
}

.typo-sample:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.typo-name {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  margin-bottom: 4px;
}

.typo-display {
  font-family: var(--font-primary);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--gray-900);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.typo-body-sample {
  font-family: var(--font-primary);
  font-size: 0.95rem;
  color: var(--gray-600);
  line-height: 1.6;
  font-weight: 300;
}

/* Download tile */
.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.download-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255,255,255,0.08);
}

.download-item:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.15);
}

.download-item-icon {
  font-size: 1.2rem;
}

.download-item-info {
  font-size: 0.78rem;
  line-height: 1.3;
}

.download-item-name {
  font-weight: 700;
  color: var(--white);
}

.download-item-size {
  color: rgba(255,255,255,0.45);
  font-weight: 300;
}

/* Tile link/action at bottom */
.tile-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cooper-red);
  margin-top: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tile-dark .tile-action {
  color: var(--cooper-red-light);
}

.tile-action:hover {
  gap: 10px;
}

/* Photo gallery tile thumbnail hover */
.tile-glass .photo-thumb {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.tile-glass .photo-thumb:hover {
  transform: scale(1.03);
}

/* ============================================================
   RESPONSIVE — Bento Grid
   ============================================================ */
@media (max-width: 1100px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tile-2x2 {
    grid-column: span 2;
    grid-row: span 1;
    min-height: 340px;
  }
  .tile-1x2 {
    grid-row: span 1;
  }
}

@media (max-width: 680px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .tile-2x2, .tile-2x1 {
    grid-column: span 1;
  }
  .download-grid {
    grid-template-columns: 1fr;
  }
  .color-swatches {
    grid-template-columns: repeat(4, 1fr);
  }
}
