/* css/hero-flip.css */

/* --- Hero Layout --- */
.hero-interactive {
  position: relative;
  width: 100%;
  height: 650px;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-top: var(--nav-height);
  perspective: 2000px;
  background: var(--bg);
}

/* --- The Grid --- */
.tile-grid {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  display: grid;
  z-index: 1;
}

/* --- The Tile --- */
.tile {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.tile-front, .tile-back {
  position: absolute;
  width: 100%; height: 100%;
  backface-visibility: hidden;
  border: 1px solid rgba(128, 128, 128, 0.05); 
}

.tile-front {
  background-color: var(--bg);
  transform: rotateY(0deg);
}

[data-theme="light"] .tile-front {
  background-color: #fdfdfd;
}

.tile-back {
  background-repeat: no-repeat;
  background-size: cover; 
  transform: rotateY(180deg);
  filter: brightness(0.8); 
  border: 1px solid rgba(128, 128, 128, 0.05); 
}

/* --- Flip States --- */
.tile.flipped {
  transform: rotateY(180deg);
  z-index: 10;
}

/* --- Content Overlay --- */
.hero-content-layer {
  position: relative;
  z-index: 20;
  pointer-events: none; /* Click-through to grid */
  height: 100%;
  display: flex;
  align-items: center;
}

.hero-glass-card {
  pointer-events: auto;
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 3rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 580px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .hero-glass-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}