/* =================================================================
   Skyline Ceramics — Living Tile Wall Hero Animation
   ================================================================= */

:root {
  --sc-navy:  #1A3A7A;
  --sc-amber: #E8820C;
  --sc-red:   #C0392B;
  --sc-slate: #5A5F6B;
  --sc-dark:  #0F1C3F;
}

/* ── Stage container — fills the full right grid column ───── */
.hero__tile-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* Ambient glow behind the wall */
.hero__tile-stage::before {
  content: '';
  position: absolute;
  inset: -40px;
  background: radial-gradient(
    ellipse at center,
    rgba(232, 130, 12, .20) 0%,
    rgba(26, 58, 122, .12) 45%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* ── Perspective wrapper (receives GSAP parallax) ─────────── */
.htw-wrap {
  width: 100%;
  height: 100%;
  perspective: 1400px;
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 4 × 4 grid ───────────────────────────────────────────── */
.htw-grid {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 8px;
  transform: rotateX(6deg) rotateY(-5deg);
  transform-style: preserve-3d;
}

/* ── Individual tile ─────────────────────────────────────── */
.htw-tile {
  position: relative;
  transform-style: preserve-3d;
  border-radius: 7px;
  transition: transform 0.65s cubic-bezier(.45, .05, .55, .95);
  cursor: default;
}

.htw-tile.flipped {
  transform: rotateY(180deg);
}

/* Shared face styles */
.htw-tile__front,
.htw-tile__back {
  position: absolute;
  inset: 0;
  border-radius: 7px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

/* ── Front face (coloured ceramic) ──────────────────────── */
.htw-tile__front {
  border: 1px solid rgba(255, 255, 255, .13);
}

.htw-tile__front.c0 { background: var(--sc-navy); }
.htw-tile__front.c1 { background: var(--sc-amber); }
.htw-tile__front.c2 { background: var(--sc-red); }
.htw-tile__front.c3 { background: var(--sc-slate); }

/* Ceramic cross-hatch texture */
.htw-tile__front::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, .04) 0px 1px,
    transparent 1px 8px
  );
  pointer-events: none;
}

/* Gloss shimmer overlay */
.htw-gloss {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, .22) 0%,
    rgba(255, 255, 255, .06) 40%,
    rgba(255, 255, 255, .00) 60%,
    rgba(255, 255, 255, .10) 100%
  );
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
}

/* ── Back face (product photo / icon) ────────────────────── */
.htw-tile__back {
  transform: rotateY(180deg);
  background: #fff;
  border: 2px solid rgba(255, 255, 255, .95);
}

/* Amber top accent strip */
.htw-tile__back::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--sc-amber);
  z-index: 3;
}

/* Product photo */
.htw-back__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
  display: none;
}

/* Icon (fallback when no photo) */
.htw-back__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: 48%;
  height: 48%;
  object-fit: contain;
  display: block;
}

/* Category label */
.htw-back__label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    to top,
    rgba(15, 28, 63, .92) 0%,
    rgba(15, 28, 63, .60) 60%,
    transparent 100%
  );
  color: #fff;
  font-size: 0.48rem;
  font-weight: 700;
  text-align: center;
  padding: 12px 3px 5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  z-index: 4;
  line-height: 1.2;
  word-break: break-word;
}

/* ── Badge ────────────────────────────────────────────────── */
.htw-badge {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: var(--sc-amber);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 7px 18px;
  border-radius: 40px;
  box-shadow: 0 4px 22px rgba(232, 130, 12, .5);
  animation: htw-badge-pulse 2.4s ease-in-out infinite;
  white-space: nowrap;
  z-index: 10;
}

@keyframes htw-badge-pulse {
  0%, 100% { box-shadow: 0 4px 22px rgba(232, 130, 12, .50); }
  50%       { box-shadow: 0 8px 32px rgba(232, 130, 12, .85); transform: translateY(-1px); }
}

/* ── Decorative floating dots ────────────────────────────── */
.htw-dot {
  position: absolute;
  border-radius: 50%;
  opacity: .45;
  animation: htw-float 3s ease-in-out infinite;
  z-index: 0;
}

.htw-dot--1 {
  width: 14px; height: 14px;
  background: var(--sc-amber);
  top: -28px; left: 12px;
}
.htw-dot--2 {
  width: 8px; height: 8px;
  background: var(--sc-red);
  top: -14px; right: 60px;
  animation-delay: .7s;
}
.htw-dot--3 {
  width: 10px; height: 10px;
  background: var(--sc-navy);
  bottom: 30px; left: -24px;
  animation-delay: 1.4s;
}

@keyframes htw-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 767px) {
  .hero__tile-stage { display: none; }
}
