/*
Theme Name: Loki Circus
Theme URI: https://circus-loki.co.il
Author: Circus Loki
Description: Custom WordPress theme for קרקס לוקי featuring a cinematic 3D carousel.
Version: 1.0
Text Domain: loki
*/

/* ===== POLIN FONT ===== */
@font-face { font-family: 'Polin'; font-weight: 800; font-style: normal; font-display: swap; src: url('fonts/Polin-Extrabold.ttf') format('truetype'); }
@font-face { font-family: 'Polin'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/Polin-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Polin'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/Polin-Semibold.ttf') format('truetype'); }
@font-face { font-family: 'Polin'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/Polin-Regular.ttf') format('truetype'); }

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { direction: rtl; overflow-x: hidden; }
body { min-height: 100vh; background: #0d0d0d; font-family: 'Polin', 'Heebo', sans-serif; color: #fff; direction: rtl; overflow-x: hidden; }

/* Lock scroll during entrance animation */
body.loki-locked { overflow: hidden !important; position: fixed !important; width: 100% !important; top: 0 !important; left: 0 !important; }

/* ===== PARTICLES ===== */
#loki-particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ===== HEADER ===== */
.loki-header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
    padding: 0 40px; height: 80px;
    display: flex; align-items: center; justify-content: space-between;
    background: transparent;
    transition: background 0.4s ease, backdrop-filter 0.4s ease;
}
.loki-header.scrolled {
    background: rgba(13, 13, 13, 0.6);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}

.loki-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; flex-shrink: 0; }
.loki-logo-img { height: 45px; width: auto; object-fit: contain; }
.loki-logo-text {
    font-family: 'Polin', sans-serif; font-weight: 800; font-size: 1.6rem; letter-spacing: 0.03em;
    background: linear-gradient(135deg, #fff 0%, #c8b6ff 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.loki-logo-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c8b6ff; animation: logoPulse 2s ease-in-out infinite; }
@keyframes logoPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.7); } }

/* Nav */
.loki-nav { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 0; white-space: nowrap; flex-shrink: 1; }
.loki-nav-item { position: relative; }
.loki-nav-item > a {
    text-decoration: none; color: rgba(255, 255, 255, 0.7); font-family: 'Polin', sans-serif;
    font-weight: 400; font-size: clamp(13px, 1.1vw, 18px); padding: 28px clamp(10px, 1vw, 20px); display: block;
    position: relative; transition: color 0.3s ease; letter-spacing: 0.02em; cursor: pointer; white-space: nowrap;
}
.loki-nav-item > a::after {
    content: ''; position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%) scaleX(0);
    width: 20px; height: 2px; background: #c8b6ff; border-radius: 2px; transition: transform 0.3s ease;
}
.loki-nav-item:hover > a, .loki-nav-item.active > a { color: #fff; }
.loki-nav-item:hover > a::after, .loki-nav-item.active > a::after { transform: translateX(-50%) scaleX(1); }

/* CTA */
.loki-cta { flex-shrink: 0; }
.loki-cta a {
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
    font-family: 'Polin', sans-serif; font-weight: 700; font-size: 18px;
    color: #0d0d0d; background: #fff; padding: 14px 32px; border-radius: 50px;
    transition: all 0.3s ease; letter-spacing: 0.02em; direction: rtl;
}
.loki-cta a .cta-arrow { font-size: 1.1em; transition: transform 0.3s ease; }
.loki-cta a:hover { background: #c8b6ff; color: #0d0d0d; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(200, 182, 255, 0.3); }
.loki-cta a:hover .cta-arrow { transform: translateX(-4px); }

/* ═══════════════════════════════════
   DROPDOWNS — curtain animation
═══════════════════════════════════ */
.loki-dropdown {
    position: fixed; top: 80px; left: 0; width: 100%;
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 99; display: flex; align-items: flex-start; justify-content: center;
    padding: 40px 5%;
    pointer-events: none; visibility: hidden; direction: rtl; overflow: hidden;
    transform: translateY(-30px); opacity: 0;
    transition: transform 0.45s cubic-bezier(0.22,1,0.36,1), opacity 0.35s ease, visibility 0s 0.5s;
}
.loki-dropdown.open {
    pointer-events: auto; visibility: visible;
    transform: translateY(0); opacity: 1;
    transition: transform 0.45s cubic-bezier(0.22,1,0.36,1), opacity 0.35s ease, visibility 0s 0s;
}

.loki-dd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; max-width: 90%; width: 100%; margin: 0 auto; }
.loki-dd-card {
    text-decoration: none; color: #fff; display: flex; flex-direction: column; gap: 10px;
    opacity: 0; transform: translateY(20px); transition: opacity 0.3s ease, transform 0.3s ease;
}
.loki-dropdown.open .loki-dd-card { opacity: 1; transform: translateY(0); }
.loki-dropdown.open .loki-dd-card:nth-child(1) { transition-delay: 0.15s; }
.loki-dropdown.open .loki-dd-card:nth-child(2) { transition-delay: 0.20s; }
.loki-dropdown.open .loki-dd-card:nth-child(3) { transition-delay: 0.25s; }
.loki-dropdown.open .loki-dd-card:nth-child(4) { transition-delay: 0.30s; }
.loki-dropdown.open .loki-dd-card:nth-child(5) { transition-delay: 0.35s; }
.loki-dropdown.open .loki-dd-card:nth-child(6) { transition-delay: 0.40s; }
.loki-dd-card:hover { transform: translateY(-4px) !important; }

.loki-dd-card-img { width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, 0.05); }
.loki-dd-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.loki-dd-card:hover .loki-dd-card-img img { transform: scale(1.06); }
.loki-dd-card-name { font-family: 'Polin', sans-serif; font-weight: 600; font-size: 0.95rem; color: rgba(255, 255, 255, 0.8); text-align: center; transition: color 0.3s ease; }
.loki-dd-card:hover .loki-dd-card-name { color: #c8b6ff; }

.loki-dd-list { max-width: 90%; width: 100%; text-align: center; margin: 0 auto; }
.loki-dd-list h3 { font-family: 'Polin', sans-serif; font-weight: 800; font-size: 1.3rem; color: #c8b6ff; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid rgba(200, 182, 255, 0.15); }
.loki-dd-list ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 32px; }
.loki-dd-list li { opacity: 0; transform: translateY(20px); transition: opacity 0.3s ease, transform 0.3s ease; }
.loki-dropdown.open .loki-dd-list li { opacity: 1; transform: translateY(0); }
.loki-dropdown.open .loki-dd-list li:nth-child(1) { transition-delay: 0.15s; }
.loki-dropdown.open .loki-dd-list li:nth-child(2) { transition-delay: 0.19s; }
.loki-dropdown.open .loki-dd-list li:nth-child(3) { transition-delay: 0.23s; }
.loki-dropdown.open .loki-dd-list li:nth-child(4) { transition-delay: 0.27s; }
.loki-dropdown.open .loki-dd-list li:nth-child(5) { transition-delay: 0.31s; }
.loki-dd-list a { text-decoration: none; color: rgba(255, 255, 255, 0.6); font-family: 'Polin', sans-serif; font-weight: 600; font-size: 1.05rem; padding: 8px 16px; border-radius: 8px; transition: all 0.25s ease; display: inline-block; border: 1px solid transparent; }
.loki-dd-list a:hover { color: #fff; background: rgba(200, 182, 255, 0.1); border-color: rgba(200, 182, 255, 0.2); }

/* ===== HERO / CAROUSEL ===== */
.loki-scene { position: relative; width: 100%; height: 100vh; overflow: hidden; background: transparent; }
.loki-carousel-container { position: absolute; perspective: 2000px; width: 100%; height: 100%; left: 0; top: 0; transform-style: preserve-3d; }
#loki-ring { position: absolute; width: 100%; height: 100%; left: 50%; top: 38%; transform: translate(-50%, -50%); transform-style: preserve-3d; }

.loki-panel {
    position: absolute; width: 530px; height: 530px; left: 50%; top: 50%;
    margin-left: -265px; margin-top: -265px; border-radius: 12px; overflow: hidden;
    background-size: cover; background-position: center; background-repeat: no-repeat;
    will-change: transform, filter; user-select: none; transform-style: preserve-3d;
    opacity: 0; /* Prevent flash on load */
}
.loki-panel video { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 12px; }

.loki-vignette {
    position: absolute; width: 100%; height: 100%; top: 0; left: 0;
    background: linear-gradient(to right, rgba(13,13,13,1) 0%, rgba(13,13,13,0.7) 10%, rgba(13,13,13,0) 30%, rgba(13,13,13,0) 70%, rgba(13,13,13,0.7) 90%, rgba(13,13,13,1) 100%);
    pointer-events: none; z-index: 10;
}

/* ===== HERO TITLE ===== */
.loki-hero-title { position: absolute; bottom: 22%; left: 0; width: 100%; text-align: center; z-index: 20; pointer-events: none; }
.loki-hero-title h1 { font-family: 'Polin', sans-serif; font-weight: 800; font-size: clamp(2rem, 5vw, 4.5rem); letter-spacing: 0.02em; line-height: 0.95; opacity: 0; will-change: transform; display: inline-block; }
.loki-hero-title h1 .loki-line { display: block; color: #fff; -webkit-mask-image: linear-gradient(180deg, rgba(255,255,255,1) 50%, rgba(255,255,255,0) 181.25%); mask-image: linear-gradient(180deg, rgba(255,255,255,1) 50%, rgba(255,255,255,0) 181.25%); }
.loki-hero-title h1 .loki-char { display: inline-block; will-change: transform; }

/* ===== HERO SUBTITLE ===== */
.loki-hero-subtitle { position: absolute; bottom: 17%; left: 0; width: 100%; text-align: center; z-index: 20; pointer-events: none; opacity: 0; }
.loki-hero-subtitle p { font-family: 'Polin', sans-serif; font-weight: 600; font-size: clamp(1rem, 2vw, 1.5rem); color: rgba(255,255,255,0.6); letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 10px; direction: rtl; }
.loki-hero-subtitle .loki-arrow {
    display: inline-block; font-size: 1.4em;
    background: linear-gradient(135deg, #000 0%, #5CE1E6 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    animation: arrowBounce 1.6s ease-in-out infinite;
}
@keyframes arrowBounce { 0%, 100% { opacity: 0.4; transform: translateX(0); } 50% { opacity: 1; transform: translateX(8px); } }

/* ═══════════════════════════════════
   SHOW LAYER — inside hero scene
═══════════════════════════════════ */
.loki-show-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 10;
    direction: ltr;
    opacity: 0;
    pointer-events: none;
}
.loki-show-layer.active {
    pointer-events: auto;
}
.loki-show-title {
    position: absolute;
    top: 16%;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: 'Polin', sans-serif;
    font-weight: 800;
    font-size: clamp(80px, 18vw, 280px);
    background: linear-gradient(180deg, #FFF 50.14%, #000 97.82%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.02em;
    line-height: 1;
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    direction: rtl;
}
.loki-show-images {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    z-index: 4;
}
.loki-show-img {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    width: auto;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.6s ease;
}
.loki-show-img.active { opacity: 1; }
.loki-show-desc {
    position: absolute;
    bottom: 50px;
    right: 60px;
    max-width: 340px;
    z-index: 3;
    direction: rtl;
}
.loki-show-desc p {
    font-family: 'Polin', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.7;
    text-align: right;
}
.loki-show-buttons {
    position: absolute;
    bottom: 50px;
    left: 60px;
    display: flex;
    gap: 14px;
    z-index: 3;
    direction: rtl;
}

/* Infinity Gallery Slider */
.loki-gallery-track {
    position: absolute;
    top: 60%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    overflow: hidden;
    z-index: 3;
}
.loki-gallery-track::before,
.loki-gallery-track::after {
    content: '';
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}
.loki-gallery-track::before { left: 0; background: linear-gradient(to right, #0d0d0d, transparent); }
.loki-gallery-track::after { right: 0; background: linear-gradient(to left, #0d0d0d, transparent); }
.loki-gallery-inner {
    display: flex;
    gap: 12px;
    animation: galleryScroll 30s linear infinite;
    width: max-content;
}
.loki-gallery-slide {
    flex-shrink: 0;
    width: 400px;
    height: 280px;
    border-radius: 10px;
    overflow: hidden;
}
.loki-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
@keyframes galleryScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.loki-btn-primary {
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
    font-family: 'Polin', sans-serif; font-weight: 700; font-size: 18px;
    color: #0d0d0d; background: #fff; padding: 14px 32px; border-radius: 50px;
    transition: all 0.3s ease;
}
.loki-btn-primary:hover { background: #c8b6ff; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(200,182,255,0.3); }
.loki-btn-primary .cta-arrow { transition: transform 0.3s ease; }
.loki-btn-primary:hover .cta-arrow { transform: translateX(-4px); }
.loki-btn-secondary {
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
    font-family: 'Polin', sans-serif; font-weight: 600; font-size: 18px;
    color: #fff; background: transparent; padding: 14px 32px; border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.2); transition: all 0.3s ease;
}
.loki-btn-secondary:hover { border-color: #c8b6ff; color: #c8b6ff; transform: translateY(-2px); }
.loki-btn-secondary .cta-arrow { font-size: 0.8em; transition: transform 0.3s ease; }
.loki-btn-secondary:hover .cta-arrow { transform: scale(1.2); }

/* ===== DOCK ===== */
.loki-dock-wrapper { position: fixed; bottom: 0; left: 50%; transform: translate(-50%); display: flex; justify-content: center; z-index: 30; direction: ltr; }
.loki-dock { display: inline-flex; justify-content: center; align-items: flex-end; height: 40px; border-top-left-radius: 10px; border-top-right-radius: 10px; margin: 0; padding: 10px; background-color: rgba(55,66,77,0.25); list-style: none; }
.loki-dock-item { width: 40px; height: 40px; margin: 0 4px; position: relative; flex-shrink: 0; }
.loki-dock-link { display: block; height: 100%; text-decoration: none; }
.loki-dock-img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.loki-dock-label { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: 'Polin', sans-serif; font-weight: 600; font-size: 12px; color: #fff; background: rgba(0,0,0,0.75); backdrop-filter: blur(8px); padding: 4px 10px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.loki-dock-item:hover .loki-dock-label { opacity: 1; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1000px) {
    .loki-header { padding: 0 20px; height: 64px; }
    .loki-nav { display: none; }
    .loki-dropdown { display: none; }
    .loki-panel { width: 400px; height: 400px; margin-left: -200px; margin-top: -200px; }
    .loki-hero-title { bottom: 18%; }
}
@media (max-width: 600px) {
    .loki-header { padding: 0 16px; height: 56px; }
    .loki-logo-text { font-size: 1.2rem; }
    .loki-cta a { font-size: 0.85rem; padding: 10px 20px; }
    .loki-panel { width: 280px; height: 280px; margin-left: -140px; margin-top: -140px; }
    .loki-hero-title h1 { font-size: clamp(1.4rem, 6vw, 2.5rem); }
}
