/*
Theme Name:  TOONHUB
Theme URI:   https://toonhub.example.com
Author:      TOONHUB
Description: Full-viewport character figurine carousel hero.
Version:     1.0.0
License:     GNU General Public License v2 or later
Text Domain: toonhub
*/

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Wrapper ────────────────────────────────────────────────────────────── */
#th-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* background-color set by JS on init */
  transition: background-color 650ms cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
}

#th-inner {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* ── Grain overlay ──────────────────────────────────────────────────────── */
#th-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  background-repeat: repeat;
  opacity: 0.4;
}

/* ── Ghost text ─────────────────────────────────────────────────────────── */
#th-ghost {
  position: absolute;
  left: 0;
  right: 0;
  top: 18%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

#th-ghost span {
  font-family: 'Anton', sans-serif;
  font-size: clamp(90px, 28vw, 380px);
  font-weight: 900;
  color: white;
  opacity: 1;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* ── Brand label ────────────────────────────────────────────────────────── */
#th-brand {
  position: absolute;
  top: 24px;
  left: 32px; /* updated by JS on mobile */
  z-index: 60;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: white;
  opacity: 0.9;
  letter-spacing: 0.18em;
}

/* ── Carousel container ─────────────────────────────────────────────────── */
#th-carousel {
  position: absolute;
  inset: 0;
  z-index: 3;
}

/* ── Carousel items ─────────────────────────────────────────────────────── */
.th-item {
  position: absolute;
  aspect-ratio: 0.6 / 1;
  transition:
    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),
    left       650ms cubic-bezier(0.4, 0, 0.2, 1),
    bottom     650ms cubic-bezier(0.4, 0, 0.2, 1),
    height     650ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, filter, opacity;
}

.th-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* ── Bottom-left block ──────────────────────────────────────────────────── */
#th-bottom-left {
  position: absolute;
  bottom: 80px;
  left: 96px;
  z-index: 60;
  max-width: 320px;
}

#th-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
  font-size: 22px;
  color: white;
  opacity: 0.95;
}

#th-desc {
  font-size: 14px;
  color: white;
  opacity: 0.85;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ── Nav buttons ────────────────────────────────────────────────────────── */
#th-nav {
  display: flex;
  gap: 12px;
}

.th-nav-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: transparent;
  border: 2px solid white;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 150ms, background-color 150ms;
  padding: 0;
  outline: none;
  flex-shrink: 0;
}

.th-nav-btn:hover {
  transform: scale(1.08);
  background-color: rgba(255, 255, 255, 0.12);
}

.th-nav-btn svg {
  display: block;
}

/* ── Bottom-right discover link ─────────────────────────────────────────── */
#th-discover {
  position: absolute;
  bottom: 80px;
  right: 40px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Anton', sans-serif;
  font-size: clamp(20px, 4vw, 56px);
  font-weight: 400;
  color: white;
  opacity: 0.95;
  letter-spacing: -0.02em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity 200ms;
}

#th-discover:hover {
  opacity: 1;
}

#th-discover-arrow {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

/* ── Mobile overrides (< 640px) ─────────────────────────────────────────── */
@media (max-width: 639px) {
  #th-brand        { left: 16px; }
  #th-bottom-left  { bottom: 24px; left: 16px; }
  #th-title        { font-size: 16px; margin-bottom: 8px; }
  #th-desc         { display: none; }
  .th-nav-btn      { width: 48px; height: 48px; }
  #th-discover     { bottom: 24px; right: 16px; gap: 6px; }
  #th-discover-arrow { width: 20px; height: 20px; }
}
