:root {
  --header-height: 72px;
  --accent: #ffffff;
  --transition: all 0.4s ease-in-out;
}

/* ---------- Global consistency & symmetry reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
img, svg, video, canvas { max-width: 100%; height: auto; display: block; }

/* ---------------- BASIC STYLES ---------------- */
html {
  background: #0a0a0a;
  height: 100%;
  margin: 0;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Poppins', sans-serif;
  color: #fff;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  background: #0a0a0a "url(background jester.png)";
  padding-top: var(--header-height);
  display: flex;
  flex-direction: column;
  text-align: center;
  position: relative;
}

/* ---------------- NAVBAR ---------------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: rgba(43, 41, 41, 0.242);
  backdrop-filter: blur(10px);
  z-index: 999;
  animation: slideDown 1s ease forwards;
}

.logo {
  width: 50px;
  height: 50px;
  border-radius: 25%;
  transition: var(--transition);
}
.logo:hover { transform: rotate(15deg) scale(1.1); }

.brand {
  font-weight: 999;
  font-size: 22px;
  color: var(--accent);
  letter-spacing: 5px;
  transition: var(--transition);
}
.brand:hover { text-shadow: 0 0 10px var(--accent); }

.nav-center a {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  margin: 0 12px;
  transition: var(--transition);
}
.nav-center a:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

.nav-right {
  display: flex;
  gap: 10px;
  align-items: center;
}
.nav-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  transition: var(--transition);
}
.nav-logo:hover {
  transform: scale(1.15) rotate(8deg);
  box-shadow: 0 0 10px var(--accent);
}

/* ---------------- MENU MOBILE ---------------- */
.menu-toggle {
  display: none;
  width: 40px;
  height: 34px;
  flex-direction: column;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}
.menu-toggle:hover { background: rgba(254, 247, 247, 0.753); }

.menu-toggle .bar {
  width: 26px;
  height: 3px;
  background: rgb(255, 255, 255);
  border-radius: 3px;
  transition: var(--transition);
}
.menu-toggle.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.active .bar:nth-child(2) { opacity: 0; }
.menu-toggle.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed;
  top: calc(var(--header-height) + 8px);
  right: 10px;
  background: rgba(0,0,0,0.9);
  padding: 12px;
  border-radius: 10px;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.4s ease forwards;
}
.mobile-menu.show { display: flex; }
.mobile-menu a { color: #fff; font-weight: 700; text-decoration: none; }
/* social group in mobile menu */
.mobile-socials { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 8px; }
.mobile-social img { width: 40px; height: 40px; border-radius: 8px; }

/* ===== MOBILE SOCIAL STRIP (outside hamburger) ===== */
/* row inside navbar */
.nav-social-row { display: none; gap: 14px; margin-left: 12px; }
.nav-social-row .social-item { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; position: relative; }
.nav-social-row .social-item img { width: 32px; height: 32px; border-radius: 7px; }
.nav-social-row .social-item::before,
.nav-social-row .social-item::after { content: '{'; color: #fff; font-weight: 900; font-size: 22px; position: absolute; opacity: 0.95; }
.nav-social-row .social-item::after { content: '}'; right: -8px; }
.nav-social-row .social-item::before { left: -8px; }

/* ---------------- HERO SECTION ---------------- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeUp 1.2s ease forwards;
  min-height: 100vh;
  position: relative;
  background-image: url('background jester.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
  margin-top: calc(-1 * var(--header-height));
  padding-top: var(--header-height);
}

/* === CURVED TEXT: turun sedikit menggunakan translateY tanpa merusak animasi ===
   Default turun 20px; di layar kecil turun 12px. Jika Anda ingin angka lain,
   ubah --curved-offset di :root atau di media query di bawah.
*/
:root {
  --curved-offset: 20px;
}

.curved-text {
  width: clamp(320px, 90vw, 1000px);
  max-width: 95vw;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.5));
  /* Tidak lagi memakai 'fadeIn' global agar transform translateY tetap terjaga.
     Kita menggunakan animasi khusus yang mempertahankan translateY(...) */
  transform: translateY(var(--curved-offset)) scale(1);
  opacity: 0;
  animation: fadeIn-curved 1.2s ease forwards 0.5s;
}

/* 💡 TEKS UTAMA DENGAN EFEK NEON BERWARNA */
.main-text {
    transform: translateY(18px);
    transform-origin: center;
  /* Scale with the smaller viewport dimension so it works on odd aspect ratios */
  font-size: clamp(28px, 18vmin, 120px);
  fill: #ff9d00;
  stroke: #16a400;
  stroke-width: 2px;
  filter: drop-shadow(0 0 8px #ffd500) drop-shadow(0 0 20px #ff0048);
  animation: flickerColor 4s infinite ease-in-out;
}

/* TEKS SUB */
.subtext {
  font-size: clamp(14px, 6vmin, 32px);
  fill: white;
}

/* KARAKTER */
.karakter {
  width: 260px;
  margin-top: 20px;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeUp 1.3s ease forwards 1.2s;
}
.karakter:hover { transform: scale(1.05) rotate(-3deg); }

/* ---------------- FOOTER ---------------- */
.footer {
  background: rgba(0,0,0,0.4);
  padding: 15px 10px;
  backdrop-filter: blur(8px);
  animation: fadeIn 1s ease forwards 1.5s;
}
.footer-title {
  font-weight: 900;
  color: var(--accent);
  font-size: 18px;
  animation: flickerColor 5s infinite;
}
.footer-links, .footer-copy { font-size: 14px; }

/* ---------------- ANIMATIONS ---------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Animasi khusus untuk curved-text yang mempertahankan translateY offset */
@keyframes fadeIn-curved {
  from {
    opacity: 0;
    transform: translateY(var(--curved-offset)) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(var(--curved-offset)) scale(1);
  }
}

/* 🌈 ANIMASI LAMPU NEON BERKEDIP + WARNA BERGANTI */
@keyframes flickerColor {
  0%, 19%, 21%, 23%, 25%, 53%, 57%, 100% {
    opacity: 1;
    filter: drop-shadow(0 0 8px #ffd500) drop-shadow(0 0 25px #ff0048);
  }
  20%, 24%, 55% {
    opacity: 0.6;
    filter: drop-shadow(0 0 3px #ff0048);
  }
  60% {
    opacity: 1;
    filter: drop-shadow(0 0 12px #00cb1e) drop-shadow(0 0 35px #00ffea);
  }
  80% {
    opacity: 0.9;
    filter: drop-shadow(0 0 14px #3212a4) drop-shadow(0 0 35px #00ffa1);
  }
  90% {
    opacity: 1;
    filter: drop-shadow(0 0 14px #ffd500) drop-shadow(0 0 40px #ff0048);
  }
}
:root { --x-offset: 0px; }


/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 900px) {
  .nav-center { display: none; }
  .menu-toggle { display: flex; }
  /* kecilkan offset sedikit di layar kecil supaya tidak kebesaran */
  :root { --curved-offset: 12px; --header-height: 100px; }
  /* beri ruang ekstra untuk baris sosial di bawah */
  .navbar { align-items: flex-start; padding-top: 8px; padding-bottom: 12px; }
  /* hide social icons on the right; moved into mobile menu */
  .nav-right .social { display: none; }
  /* show social row inside navbar, pinned bottom center */
  .nav-social-row { display: flex; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); margin-left: 0; pointer-events: auto; }
  .nav-social-row .social-item { width: 32px; height: 32px; }
  .nav-social-row .social-item img { width: 24px; height: 24px; }
  /* remove curly brackets on small screens */
  .nav-social-row .social-item::before, .nav-social-row .social-item::after { content: none; }
  
  /* Responsive hero section - background scales down instead of cropping */
  .hero {
    background-size: contain;
    background-position: center center;
    min-height: 70vh;
  }
  
  /* Ensure about section moves up properly on medium screens */
  .about-section {
    padding-top: 80px;
  }
  
  /* Scale down character on medium screens */
  .karakter {
    width: 200px;
  }
  
  /* Scale down navbar logo on medium screens */
  .logo {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 600px) {
  .hero {
    background-size: contain;
    background-position: center center;
    min-height: 60vh;
  }
  
  /* Ensure about section moves up properly on small screens */
  .about-section {
    padding-top: 60px;
  }
  
  /* Scale down character on small screens */
  .karakter {
    width: 150px;
  }
  
  /* Scale down navbar logo on small screens */
  .logo {
    width: 35px;
    height: 35px;
  }
}
:root { --x-offset: 0px; }
:root {
  --x-offset: 0px;
  --x-rotate: -12deg; /* tambahkan ini */
}


#x-img {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transform: translateY(var(--x-offset)) rotate(var(--x-rotate));
  transition: transform 0.25s ease;
}

#x-img {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transform: translateY(var(--x-offset)) !important;
  transition: transform 0.18s ease;
}

/* ===== Jester Circus - Dark Theme Styles (About Section) ===== */
.about-section {
  position: relative;
  background: linear-gradient(180deg, #0a0a0a 0%, #1a0a1a 50%, #0a0a1a 100%);
  padding: 100px 20px 0px;
  overflow: visible;
  min-height: auto;
  z-index: 1;
}


/* Ensure sections participate in normal flow across all screens */
.about-section, .memes-section {
  display: block;
  width: 100%;
}

/* ===== Memes Section (matches About style) ===== */
.memes-section {
  position: relative;
  background: linear-gradient(180deg, #0a0a0a 0%, #1a0a1a 50%, #0a0a1a 100%);
  padding: 100px 20px 120px;
  margin-top: 0;
  z-index: 2;
  isolation: isolate;
}

.meme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.meme-card {
  padding: 0;
  display: block;
}
.meme-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 16px;
}

@media (max-width: 768px) {
  .memes-section {
    margin-top: 0;
    padding-top: 80px;
  }
}

/* ===== Footer (matches Memes section style) ===== */
.site-footer {
  background: linear-gradient(180deg, #0a0a0a 0%, #1a0a1a 50%, #0a0a1a 100%);
  padding: 32px 20px 56px; /* smaller footer section height */
}
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}
.footer-brand { display: flex; gap: 20px; align-items: center; justify-content: center; margin-bottom: 30px; }
.footer-logo { width: 96px; height: 96px; border-radius: 14px; }
.footer-title { font-weight: 900; color: #ffd700; letter-spacing: 5px; font-size: 44px; text-shadow: 0 0 18px rgba(255,215,0,0.85); }
.footer-nav { display: flex; gap: 30px; justify-content: center; margin-bottom: 20px; }
.footer-nav a { color: #fff; text-decoration: none; font-weight: 900; font-size: 24px; }
.footer-nav a:hover { color: #ffd700; }
.footer-copy { font-size: 14px; color: #aaa; }

.circus-tent-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 150px;
  background: repeating-linear-gradient(90deg, #ffffff 0px, #ffffff 40px, #1a1a1a 40px, #1a1a1a 80px);
  clip-path: polygon(0 0, 100% 0, 90% 100%, 10% 100%);
  opacity: 0.8;
  z-index: 1;
}

.spotlight { position: absolute; top: -50%; width: 300px; height: 600px; background: radial-gradient(ellipse at center, rgba(255,215,0,0.3) 0%, rgba(255,215,0,0.1) 40%, transparent 70%); filter: blur(20px); animation: spotlight-sweep 8s ease-in-out infinite; z-index: 0; }
.spotlight-left { left: 10%; animation-delay: 0s; }
.spotlight-right { right: 10%; animation-delay: 4s; }
@keyframes spotlight-sweep { 0%, 100% { transform: rotate(-15deg); } 50% { transform: rotate(15deg); } }

.about-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  z-index: 2;
}
.section-header { text-align: center; margin-bottom: 60px; display: flex; align-items: center; justify-content: center; gap: 20px; }
/* extra gap above the about title only */
.about-section .section-header { margin-top: 40px; }
.header-bracket { font-size: 60px; font-weight: bold; color: #ffd700; text-shadow: 0 0 20px rgba(255,215,0,0.6); animation: pulse-glow 2s ease-in-out infinite; }
.section-title { font-size: 48px; font-weight: 900; background: linear-gradient(135deg, #ffd700 0%, #ff6b6b 50%, #ffd700 100%); background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: gradient-shift 3s ease infinite; letter-spacing: 4px; text-transform: uppercase; }
@keyframes pulse-glow { 0%, 100% { text-shadow: 0 0 20px rgba(255,215,0,0.6); } 50% { text-shadow: 0 0 40px rgba(255,215,0,0.9), 0 0 60px rgba(255,215,0,0.6); } }
@keyframes gradient-shift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.about-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-bottom: 60px; }
.about-card { background: linear-gradient(145deg, #1a1a1a, #0d0d0d); border: 2px solid transparent; border-radius: 20px; padding: 40px 30px; position: relative; overflow: hidden; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.about-card::before { content: ''; position: absolute; top: -2px; left: -2px; right: -2px; bottom: -2px; background: linear-gradient(45deg, #ffffff, #ffffff, #ffffff, #ffffff); background-size: 300% 300%; border-radius: 20px; z-index: -1; opacity: 0; transition: opacity 0.4s ease; animation: border-glow 4s ease infinite; }
.about-card:hover::before { opacity: 1; }
.about-card:hover { transform: translateY(-10px) scale(1.02); box-shadow: 0 20px 50px rgba(255,215,0,0.3); }
@keyframes border-glow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.card-icon { font-size: 60px; margin-bottom: 20px; animation: bounce-icon 2s ease-in-out infinite; display: inline-block; }
.card-1 .card-icon { animation-delay: 0s; } .card-2 .card-icon { animation-delay: 0.3s; } .card-3 .card-icon { animation-delay: 0.6s; }
@keyframes bounce-icon { 0%, 100% { transform: translateY(0) rotate(0deg); } 25% { transform: translateY(-15px) rotate(-5deg); } 75% { transform: translateY(-5px) rotate(5deg); } }

.card-title { font-size: 22px; font-weight: 800; color: #ffd700; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 2px; }
.card-text { font-size: 16px; line-height: 1.8; color: #cccccc; font-weight: 300; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; margin-bottom: 50px; padding: 40px; background: rgba(139,0,0,0.1); border-radius: 20px; border: 1px solid rgba(255,215,0,0.2); }
.about-section .stats-row { margin-top: 30px; margin-bottom: 60px; position: static; }
.stat-item { text-align: center; padding: 20px; position: relative; }
.stat-item::after { content: '★'; position: absolute; top: -10px; right: -10px; color: #ffd700; font-size: 24px; animation: rotate-star 3s linear infinite; }
@keyframes rotate-star { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.stat-number { font-size: 48px; font-weight: 900; background: linear-gradient(135deg, #ffd700, #ffffff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 10px; text-shadow: 0 0 30px rgba(255,215,0,0.5); }
.stat-label { font-size: 14px; color: #999; text-transform: uppercase; letter-spacing: 2px; font-weight: 600; }

.cta-box { text-align: center; padding: 50px; background: radial-gradient(circle, rgba(139,0,0,0.3), transparent); border-radius: 20px; border: 2px dashed rgba(255,215,0,0.3); }
.cta-box { max-width: 920px; margin: 0 auto; }
.cta-text { font-size: 24px; color: #ffd700; margin-bottom: 30px; font-weight: 600; text-shadow: 0 0 10px rgba(255,215,0,0.5); }
.cta-button { position: relative; display: inline-block; padding: 20px 60px; background: linear-gradient(135deg, #ffffff, #ffffff); color: #ffd700; text-decoration: none; font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: 3px; border-radius: 50px; overflow: hidden; transition: all 0.3s ease; box-shadow: 0 10px 30px rgba(255, 255, 255, 0.5); border: 2px solid #ffd700; }
.cta-button:hover { transform: scale(1.05); box-shadow: 0 15px 50px rgba(255,215,0,0.6); }
.button-text { position: relative; z-index: 2; }
.button-shine { position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); transition: left 0.5s ease; }
.cta-button:hover .button-shine { left: 100%; }

.circus-confetti { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.confetti { position: absolute; width: 10px; height: 10px; background: #ffd700; animation: confetti-fall 8s linear infinite; opacity: 0.7; }
.confetti:nth-child(1) { left: 10%; animation-delay: 0s; background: #ffd700; }
.confetti:nth-child(2) { left: 30%; animation-delay: 2s; background: #ff6b6b; }
.confetti:nth-child(3) { left: 50%; animation-delay: 4s; background: #8b0000; }
.confetti:nth-child(4) { left: 70%; animation-delay: 1s; background: #ffd700; }
.confetti:nth-child(5) { left: 85%; animation-delay: 3s; background: #ff6b6b; }
.confetti:nth-child(6) { left: 95%; animation-delay: 5s; background: #8b0000; }
@keyframes confetti-fall { 0% { transform: translateY(-100px) rotate(0deg); opacity: 1; } 100% { transform: translateY(100vh) rotate(720deg); opacity: 0; } }

@media (max-width: 768px) {
  .section-title { font-size: 32px; }
  .header-bracket { font-size: 40px; }
  .about-content { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; padding: 20px; }
  .cta-text { font-size: 20px; }
  .cta-button { padding: 15px 40px; font-size: 16px; }
  /* prevent left side clipping on small screens */
  .about-section { padding-left: 24px; padding-right: 24px; }
  .about-section .section-header { padding-left: 6px; padding-right: 6px; }
}
/* Remove previous hard overrides; rely on clamps above for proportional scaling */

/* ===== INFINITE MEME SCROLL (SEAMLESS LOOP) ===== */
.memes-section {.memes-section {
  background: #000; /* warna hitam pekat */
  padding: 50px 0;
  overflow: hidden;
  text-align: center;
}
}

.section-title {
  color: rgb(0, 0, 0);
  font-size: 36px;
  font-weight: 900;
  margin-bottom: 30px;
  font-family: 'Poppins', sans-serif;
}

.meme-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: scrollRight 40s linear infinite;
}

.meme-card {
  flex: 0 0 auto;
  width: 220px;
  height: 260px;
  border-radius: 16px;
  overflow: hidden;
  background: #000000;
}

.meme-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* animasi berjalan dari kiri ke kanan */
@keyframes scrollRight {
  0% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(0%);
  }
}

/* pause saat hover */
.meme-track:hover {
  animation-play-state: paused;
}
