/* ============================================
   JJUGGL.com - Styles
   Colors: #0a0e1a, #f5a623, #b388ff, #ff6b6b, #64ffda, #e8e6e1, #1e2940
   Fonts: Space Grotesk, Instrument Serif, Fira Code
   ============================================ */

:root {
    --deep-void: #0a0e1a;
    --spotlight-gold: #f5a623;
    --arc-trail: #b388ff;
    --catch-flash: #ff6b6b;
    --float-pause: #64ffda;
    --body-text: #e8e6e1;
    --subtle-divider: #1e2940;

    --font-primary: 'Space Grotesk', sans-serif;
    --font-secondary: 'Instrument Serif', serif;
    --font-accent: 'Fira Code', monospace;

    --stagger-delay: 180ms;
    --toss-easing: cubic-bezier(0.34, 1.56, 0.64, 1);
    --gravity-easing: cubic-bezier(0.55, 0, 1, 0.45);
    --hang-time: 60ms;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: var(--deep-void);
    color: var(--body-text);
    font-family: var(--font-secondary);
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
}

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

/* ---- Act: General ---- */
.act {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ============================================
   ACT 1: THE VOID
   ============================================ */
.act-void {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: var(--deep-void);
}

.spotlight {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 166, 35, 0.15) 0%, rgba(245, 166, 35, 0.05) 40%, transparent 70%);
    opacity: 0;
    animation: spotlightFadeIn 2s ease-out 0.5s forwards;
}

@keyframes spotlightFadeIn {
    to { opacity: 1; }
}

.void-domain {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.5em;
    color: var(--spotlight-gold);
    opacity: 0;
    animation: domainFadeIn 1.5s ease-out 1.5s forwards;
    z-index: 1;
    text-transform: uppercase;
}

@keyframes domainFadeIn {
    to { opacity: 1; }
}

/* ============================================
   ACT 2: THE FIRST TOSS
   ============================================ */
.act-toss {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 10vh 2rem;
}

.hero-container {
    display: flex;
    gap: 0.1em;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-letter {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(4rem, 12vw, 10rem);
    color: var(--body-text);
    display: inline-block;
    opacity: 0;
    transform: translateY(80px);
    transition: transform 0.8s var(--toss-easing), opacity 0.6s ease-out;
}

.hero-letter.tossed {
    opacity: 1;
    transform: translateY(0);
}

/* Ghost echoes for hero letters */
.hero-letter.tossed::before,
.hero-letter.tossed::after {
    content: attr(data-char);
    position: absolute;
    top: 0;
    left: 0;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: inherit;
    pointer-events: none;
}

.hero-letter.tossed::before {
    opacity: 0.15;
    transform: translateY(15px);
    color: var(--arc-trail);
    animation: ghostFade 1s ease-out forwards;
}

.hero-letter.tossed::after {
    opacity: 0.06;
    transform: translateY(30px);
    color: var(--arc-trail);
    animation: ghostFade 1.2s ease-out forwards;
}

@keyframes ghostFade {
    from { opacity: 0.4; }
    to { opacity: 0; }
}

/* Individual letter color accents on hover */
.hero-letter:nth-child(1) { --letter-accent: var(--spotlight-gold); }
.hero-letter:nth-child(2) { --letter-accent: var(--catch-flash); }
.hero-letter:nth-child(3) { --letter-accent: var(--arc-trail); }
.hero-letter:nth-child(4) { --letter-accent: var(--float-pause); }
.hero-letter:nth-child(5) { --letter-accent: var(--spotlight-gold); }
.hero-letter:nth-child(6) { --letter-accent: var(--catch-flash); }

.hero-letter:hover {
    color: var(--letter-accent);
    transition: color 0.2s ease;
}

.tagline {
    font-family: var(--font-secondary);
    font-style: italic;
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    color: var(--body-text);
    opacity: 0;
    margin-top: 2rem;
    z-index: 2;
    transition: opacity 1s ease-out 0.5s;
}

.tagline.visible {
    opacity: 0.8;
}

.arc-lines-toss {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.arc-svg {
    width: 100%;
    height: 100%;
}

.arc-path {
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease-out;
}

.arc-path-1 { stroke: var(--spotlight-gold); }
.arc-path-2 { stroke: var(--arc-trail); }
.arc-path-3 { stroke: var(--catch-flash); }

.arc-path.drawn {
    stroke-dashoffset: 0;
}

/* ============================================
   ACT 3: THE PATTERN
   ============================================ */
.act-pattern {
    min-height: 300vh;
    position: relative;
    padding: 15vh 5vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20vh;
}

.gravity-curves {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.connecting-arcs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.scroll-arc {
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1.5s ease-out;
}

.scroll-arc-1 { stroke: var(--spotlight-gold); opacity: 0.5; }
.scroll-arc-2 { stroke: var(--arc-trail); opacity: 0.5; }
.scroll-arc-3 { stroke: var(--catch-flash); opacity: 0.5; }
.scroll-arc-4 { stroke: var(--float-pause); opacity: 0.5; }
.scroll-arc-5 { stroke: var(--spotlight-gold); opacity: 0.5; }

.scroll-arc.drawn {
    stroke-dashoffset: 0;
}

/* ---- Content Pods ---- */
.content-pod {
    position: relative;
    z-index: 1;
    max-width: 560px;
    padding: 3rem 2.5rem;
    border: 1px solid var(--subtle-divider);
    border-radius: 4px;
    background: rgba(10, 14, 26, 0.85);
    opacity: 0;
    transform: translateY(100px);
    transition: opacity 0.7s ease-out, transform 0.8s var(--toss-easing);
}

.content-pod.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Cascade arrangement: alternate left/right offset for triangular feel */
.pod-1 { align-self: flex-start; margin-left: 8vw; }
.pod-2 { align-self: flex-end; margin-right: 8vw; }
.pod-3 { align-self: flex-start; margin-left: 15vw; }
.pod-4 { align-self: flex-end; margin-right: 12vw; }
.pod-5 { align-self: center; }

/* Elastic repulsion effect on hover */
.content-pod:hover {
    border-color: var(--spotlight-gold);
    box-shadow: 0 0 40px rgba(245, 166, 35, 0.08);
}

.content-pod:hover ~ .content-pod {
    transform: translateY(8px);
}

.pod-title {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: var(--body-text);
    margin-bottom: 1rem;
    position: relative;
}

.pod-text {
    font-family: var(--font-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    color: rgba(232, 230, 225, 0.8);
}

.pod-label {
    display: inline-block;
    margin-top: 1.5rem;
    font-family: var(--font-accent);
    font-size: 0.75rem;
    color: var(--float-pause);
    letter-spacing: 0.1em;
    opacity: 0.6;
}

/* ---- Orbital Dots ---- */
.orbital-dots {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 40px;
    height: 40px;
}

.orbital-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--spotlight-gold);
    top: 50%;
    left: 50%;
    margin-top: -4px;
    margin-left: -4px;
}

.dots-3 {
    animation: orbitSpin3 4s linear infinite;
}
.dots-5 {
    animation: orbitSpin5 6s linear infinite;
}
.dots-7 {
    animation: orbitSpin7 8s linear infinite;
}

.dots-3 .orbital-dot:nth-child(1) { transform: rotate(0deg) translateX(16px); background: var(--spotlight-gold); }
.dots-3 .orbital-dot:nth-child(2) { transform: rotate(120deg) translateX(16px); background: var(--arc-trail); }
.dots-3 .orbital-dot:nth-child(3) { transform: rotate(240deg) translateX(16px); background: var(--catch-flash); }

.dots-5 .orbital-dot:nth-child(1) { transform: rotate(0deg) translateX(16px); background: var(--spotlight-gold); }
.dots-5 .orbital-dot:nth-child(2) { transform: rotate(72deg) translateX(16px); background: var(--arc-trail); }
.dots-5 .orbital-dot:nth-child(3) { transform: rotate(144deg) translateX(16px); background: var(--catch-flash); }
.dots-5 .orbital-dot:nth-child(4) { transform: rotate(216deg) translateX(16px); background: var(--float-pause); }
.dots-5 .orbital-dot:nth-child(5) { transform: rotate(288deg) translateX(16px); background: var(--spotlight-gold); }

.dots-7 .orbital-dot:nth-child(1) { transform: rotate(0deg) translateX(16px); background: var(--spotlight-gold); }
.dots-7 .orbital-dot:nth-child(2) { transform: rotate(51.4deg) translateX(16px); background: var(--arc-trail); }
.dots-7 .orbital-dot:nth-child(3) { transform: rotate(102.8deg) translateX(16px); background: var(--catch-flash); }
.dots-7 .orbital-dot:nth-child(4) { transform: rotate(154.3deg) translateX(16px); background: var(--float-pause); }
.dots-7 .orbital-dot:nth-child(5) { transform: rotate(205.7deg) translateX(16px); background: var(--spotlight-gold); }
.dots-7 .orbital-dot:nth-child(6) { transform: rotate(257.1deg) translateX(16px); background: var(--arc-trail); }
.dots-7 .orbital-dot:nth-child(7) { transform: rotate(308.5deg) translateX(16px); background: var(--catch-flash); }

@keyframes orbitSpin3 {
    to { transform: rotate(360deg); }
}
@keyframes orbitSpin5 {
    to { transform: rotate(360deg); }
}
@keyframes orbitSpin7 {
    to { transform: rotate(360deg); }
}

/* ============================================
   ACT 4: THE CATCH
   ============================================ */
.act-catch {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 2rem;
    position: relative;
}

.catch-container {
    text-align: center;
    max-width: 640px;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease-out, transform 1s var(--toss-easing);
}

.catch-container.in-view {
    opacity: 1;
    transform: scale(1);
}

.hand-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 280px;
    height: 280px;
    margin-top: -140px;
    margin-left: -140px;
    pointer-events: none;
    animation: handCirclePulse 3s ease-in-out infinite;
}

.hand-circle-svg {
    width: 100%;
    height: 100%;
}

@keyframes handCirclePulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.08); opacity: 0.7; }
}

.catch-title {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--catch-flash);
    margin-bottom: 1.5rem;
}

.catch-text {
    font-family: var(--font-secondary);
    font-size: 1.15rem;
    line-height: 1.9;
    color: rgba(232, 230, 225, 0.85);
    margin-bottom: 3rem;
}

.catch-contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.contact-label {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--float-pause);
    text-transform: uppercase;
    opacity: 0.6;
}

.contact-link {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 1.2rem;
    color: var(--spotlight-gold);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.contact-link:hover {
    border-bottom-color: var(--spotlight-gold);
    color: var(--body-text);
}

/* Impact Sparks */
.impact-sparks {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 10;
}

.spark {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--catch-flash);
    animation: sparkBurst 0.8s var(--gravity-easing) forwards;
}

@keyframes sparkBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--spark-x), var(--spark-y)) scale(0);
    }
}

/* ============================================
   ACT 5: THE BOW
   ============================================ */
.act-bow {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8vh 2rem;
    border-top: 1px solid var(--subtle-divider);
}

.bow-logo {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    letter-spacing: 0.4em;
    color: var(--body-text);
    opacity: 0.6;
    animation: bowPulse 4s ease-in-out infinite;
}

@keyframes bowPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

.bow-line {
    width: 60px;
    height: 1px;
    background: var(--subtle-divider);
    margin: 2rem 0;
}

.bow-text {
    font-family: var(--font-secondary);
    font-style: italic;
    font-size: 0.95rem;
    color: rgba(232, 230, 225, 0.4);
}

/* ============================================
   ORBITAL NAVIGATION
   ============================================ */
.orbital-nav {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    width: 48px;
    height: 48px;
}

.nav-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--subtle-divider);
    background: rgba(10, 14, 26, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 101;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.nav-toggle:hover {
    border-color: var(--spotlight-gold);
}

.nav-toggle-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--spotlight-gold);
    transition: transform 0.3s ease;
}

.orbital-nav.open .nav-toggle-dot {
    transform: scale(1.3);
    background: var(--catch-flash);
}

.nav-orbit-link {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(10, 14, 26, 0.95);
    border: 1px solid var(--subtle-divider);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-accent);
    font-size: 0.6rem;
    color: var(--body-text);
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
    transition: all 0.4s var(--toss-easing);
    pointer-events: none;
    text-decoration: none;
}

.nav-orbit-link span {
    white-space: nowrap;
}

.orbital-nav.open .nav-orbit-link {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.orbital-nav.open .nav-orbit-link[data-section="void"] {
    transform: translate(-60px, -10px) scale(1);
}
.orbital-nav.open .nav-orbit-link[data-section="first-toss"] {
    transform: translate(-50px, -55px) scale(1);
}
.orbital-nav.open .nav-orbit-link[data-section="pattern"] {
    transform: translate(-15px, -85px) scale(1);
}
.orbital-nav.open .nav-orbit-link[data-section="catch"] {
    transform: translate(25px, -65px) scale(1);
}
.orbital-nav.open .nav-orbit-link[data-section="bow"] {
    transform: translate(35px, -20px) scale(1);
}

.nav-orbit-link:hover {
    border-color: var(--spotlight-gold);
    color: var(--spotlight-gold);
}

.nav-orbit-link.active {
    border-color: var(--float-pause);
    color: var(--float-pause);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .content-pod {
        max-width: 90vw;
        padding: 2rem 1.5rem;
    }

    .pod-1, .pod-2, .pod-3, .pod-4, .pod-5 {
        align-self: center;
        margin-left: 0;
        margin-right: 0;
    }

    .act-pattern {
        padding: 10vh 4vw;
        gap: 12vh;
    }

    .orbital-nav {
        bottom: 1rem;
        right: 1rem;
    }
}
