* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

.bg-video {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 105%;
  min-height: 105%;
  object-fit: cover;
  z-index: -1;
}

.grid {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
}

.cell {
  border: 1px solid rgba(255, 255, 255, 0.15);
  perspective: 1000px;
  cursor: pointer;
  position: relative;
  contain: layout style;
  will-change: transform;
  background: transparent;
}

.cell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  transition: opacity 0.4s 0.1s;
  z-index: -1;
}

.cell.flipped::before {
  opacity: 1;
}


.cell-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  transform-style: preserve-3d;
  will-change: transform;
  transform: translateZ(0);
}

.cell.flipped .cell-inner {
  transform: rotateX(180deg);
}

.cell-front,
.cell-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
}

.cell-front {
  background: transparent;
}

.cell-back {
  background-color: white;
  background-size: cover;
  background-position: center;
  transform: rotateX(180deg) translateZ(0);
}

/* Optimize during animation */
.cell.animating .cell-back {
  image-rendering: optimizeSpeed;
  box-shadow: none;
}

.cell-back.contain {
  background-size: contain;
  background-repeat: no-repeat;
  background-color: black;
}

/* Navigation buttons */
.cell.static {
  cursor: pointer;
}

.cell.static .cell-front,
.cell.static .cell-back {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.cell.static .cell-front {
  color: white;
}

.cell.static .cell-back {
  background: rgba(255, 255, 255, 0.5);
  color: black;
}

.cell.static:hover {
  opacity: 0.9;
}

.logo .cell-front,
.logo .cell-back {
  flex-direction: column;
  gap: 8px;
}

.logo .cell-front img,
.logo .cell-back img {
  max-width: 70%;
  max-height: 55%;
  object-fit: contain;
}

.logo .cell-back img {
  filter: invert(1);
}

.contact-label {
  font-size: 0.7rem;
}

/* Contact flip tiles */
.cell.contact-flip {
  border-color: rgba(255, 255, 255, 0.15);
}

.cell-back.contact-back {
  background: white;
}

/* Fade out animation for closing */
.cell.fading .cell-inner {
  transition: opacity 0.4s ease;
  opacity: 0;
}

/* Contact panel overlay */
.contact-panel {
  position: fixed;
  top: 20vh;
  left: 0;
  width: 100vw;
  height: 60vh;
  background: white;
  z-index: 100;
  padding: 50px 80px;
  box-sizing: border-box;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  color: black;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact-panel.open {
  opacity: 1;
  visibility: visible;
}

.contact-header {
  margin-bottom: 0;
}

.contact-header h1 {
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 15px 0;
  letter-spacing: 0.05em;
}

.contact-header .tagline {
  font-size: 1rem;
  line-height: 1.6;
  color: #333;
  margin: 0;
  max-width: 700px;
}

.contact-grid {
  display: flex;
  gap: 100px;
}

.contact-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 8px 0;
}

.contact-section p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
  color: #333;
}

.contact-section a {
  color: black;
  text-decoration: none;
}

.contact-section a:hover {
  text-decoration: underline;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px;
}

.team-member h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 10px 0;
}

.team-member p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
  color: #333;
}

/* Detail panel overlay */
.detail-panel {
  position: fixed;
  top: 20vh;
  left: 0;
  width: 100vw;
  height: 60vh;
  background: white;
  z-index: 100;
  box-sizing: border-box;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  display: flex;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.detail-panel.open {
  opacity: 1;
  visibility: visible;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2rem;
  color: #333;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  padding: 5px 10px;
  transition: opacity 0.2s ease;
}

.close-btn:hover {
  opacity: 0.6;
}

.detail-video {
  width: 60%;
  height: 100%;
  background-color: #000;
  position: relative;
}

.detail-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.detail-info {
  width: 40%;
  padding: 40px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.detail-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 10px 0;
  color: black;
}

.detail-category {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
  margin: 0 0 20px 0;
}

.detail-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #333;
  margin: 0;
}

