/* ==========================================================================
   090 · TOONHUB (مَصنع الدُمى) — 1:1 Single-Viewport 4-Figurine Depth Carousel
   #F4845F / #6BBF7A / #E882B4 / #6EB5FF transitions · Backdrop giant text · Alpha vinyl cutouts
   ========================================================================== */

:root {
  --th-bg: #F4845F;
  --th-disp: 'Cairo', 'Readex Pro', sans-serif;
  --th-sans: 'IBM Plex Sans Arabic', 'Readex Pro', system-ui, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: #FFFFFF;
  font-family: var(--th-sans);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  letter-spacing: 0;
}

.th-stage {
  position: relative;
  width: 100vw;
  height: 100dvh;
  background-color: var(--th-bg);
  transition: background-color 650ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* Top Micro-Wordmark & Showcase Mini Pill */
.th-top-bar {
  position: absolute;
  top: 22px;
  inset-inline: 32px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.th-wordmark {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.92;
}

.th-mini-nav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 600;
}

.th-mini-nav a:hover {
  text-decoration: underline;
}

/* z-2: Giant Backdrop Display Word BEHIND Foreground Character */
.th-backdrop-word {
  position: absolute;
  top: 15%;
  inset-inline: 0;
  z-index: 2;
  text-align: center;
  font-family: var(--th-disp);
  font-size: clamp(72px, 17vw, 240px);
  font-weight: 900;
  line-height: 1;
  color: #FFFFFF;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* z-3..20: Depth-Staged 4-Figurine Carousel */
.th-figurines-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.th-fig {
  position: absolute;
  aspect-ratio: 0.72 / 1;
  object-fit: contain;
  object-position: center bottom;
  transition:
    left 650ms cubic-bezier(0.4, 0, 0.2, 1),
    height 650ms cubic-bezier(0.4, 0, 0.2, 1),
    bottom 650ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 650ms cubic-bezier(0.4, 0, 0.2, 1),
    filter 650ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 650ms cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 24px 38px rgba(0, 0, 0, 0.22));
}

/* 4 Exact Spatial Depth Roles */
.th-fig.role-front {
  z-index: 20;
  left: 50%;
  height: 76%;
  bottom: -2%;
  transform: translateX(-50%) scale(1.18);
  opacity: 1;
}

.th-fig.role-right {
  z-index: 10;
  left: 74%;
  height: 30%;
  bottom: 14%;
  transform: translateX(-50%) scale(1);
  filter: blur(2px) drop-shadow(0 12px 20px rgba(0, 0, 0, 0.16));
  opacity: 0.86;
}

.th-fig.role-left {
  z-index: 10;
  left: 26%;
  height: 30%;
  bottom: 14%;
  transform: translateX(-50%) scale(1);
  filter: blur(2px) drop-shadow(0 12px 20px rgba(0, 0, 0, 0.16));
  opacity: 0.86;
}

.th-fig.role-back {
  z-index: 5;
  left: 50%;
  height: 22%;
  bottom: 16%;
  transform: translateX(-50%) scale(0.95);
  filter: blur(4px);
  opacity: 0.75;
}

/* z-50: Vinyl Matte Grain Overlay */
.th-grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.24;
  background-image: radial-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1px);
  background-size: 4px 4px;
}

/* z-60: Bottom HUD Controls */
.th-bottom-hud {
  position: absolute;
  inset-inline: 44px;
  bottom: 38px;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.th-info-block {
  max-width: 330px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.th-char-title {
  font-size: 22px;
  font-weight: 800;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
}

.th-char-desc {
  font-size: 14px;
  line-height: 1.65;
  opacity: 0.94;
}

.th-arrows {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.th-circle-arrow {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  background: transparent;
  color: #FFFFFF;
  font-size: 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.th-circle-arrow:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.08);
}

.th-discover-cta {
  font-family: var(--th-disp);
  font-size: clamp(22px, 3.4vw, 46px);
  font-weight: 900;
  line-height: 1.05;
  background: transparent;
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.th-discover-cta:hover {
  opacity: 0.88;
}

@media (max-width: 720px) {
  .th-fig.role-right,
  .th-fig.role-left {
    opacity: 0.45;
  }
  .th-bottom-hud {
    inset-inline: 20px;
    bottom: 22px;
    flex-direction: column;
    align-items: flex-start;
  }
}
