/* css/hero-flip.css */

/* --- Header Button Tweak --- */
.nav-link {
  font-size: 0.95rem; 
  font-weight: 500; 
  color: var(--muted); 
  transition: color 0.2s;
  margin-right: 0.5rem;
}
.nav-link:hover { color: var(--fg); }

/* Make the header button slightly smaller to fit nicely */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

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

/* --- 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;
  /* Complex transition: 
     Transform happens fast (0.6s).
     But if we remove the class, we can control speed via JS or separate class. 
  */
  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;
  /* Tiny border to separate tiles visually */
  border: 1px solid rgba(128, 128, 128, 0.05); 
}

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

.tile-back {
  /* No background-image here! JS handles it. */
  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; /* Bring above neighbors */
}

/* --- 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;
  /* Use the RGB variable inside rgba */
  background: rgba(var(--bg-rgb), 0.85);
  /* Fallback for hex vars if specific RGBA not available in main CSS: */
  background: rgba(10, 10, 10, 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);
}

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

/* --- Header Button Tweaks --- */

/* Small Button Variant for Navbar */
.btn-sm {
  padding: 0.4rem 0.9rem; /* Compact padding */
  font-size: 0.85rem;     /* Slightly smaller text */
  height: 38px;           /* Consistent height */
  white-space: nowrap;    /* Prevent text wrapping */
}

/* Adjust the outline button to match the header background if needed */
header .btn-outline {
  border-color: var(--border);
  background: transparent;
}
header .btn-outline:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}

/* Mobile Tweak: On very small screens, reduce padding or hide one button */
@media (max-width: 500px) {
  .btn-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
  /* Optional: Hide 'My Expertise' on super small phones to prevent breaking */
  /* header .btn-outline { display: none; } */ 
}