/* TRIPPIN - Psychedelic Landing Page */
:root {
    --purple: #8B5CF6;
    --purple-light: #A78BFA;
    --fuchsia: #D946EF;
    --pink: #EC4899;
    --teal: #06B6D4;
    --lavender: #C4B5FD;
    --cosmic-1: #1e1b4b;
    --cosmic-2: #312e81;
    --cosmic-3: #4c1d95;
    --cosmic-4: #6d28d9;
    --cosmic-5: #7c3aed;
    --glow: rgba(168, 85, 247, 0.4);
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Space Grotesk', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
}

/* Дегенеративный кастомный курсор — гриб по лору */
body, body * {
    cursor: none !important;
}

@media (hover: none) {
    body, body * { cursor: auto !important; }
    .custom-cursor { display: none !important; }
}

.custom-cursor {
    position: fixed;
    width: 32px;
    height: 32px;
    pointer-events: none;
    z-index: 99999;
    font-size: 28px;
    line-height: 1;
    text-align: center;
    filter: drop-shadow(0 0 4px rgba(217, 70, 239, 0.6));
    transform: translate(-50%, -50%);
    transition: transform 0.08s ease-out;
}

.custom-cursor.is-hover { transform: translate(-50%, -50%) scale(1.3); }

/* Cosmic Background */
.bg-cosmic {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(167, 139, 250, 0.3), transparent),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(236, 72, 153, 0.2), transparent),
        radial-gradient(ellipse 50% 30% at 20% 80%, rgba(6, 182, 212, 0.15), transparent),
        linear-gradient(180deg, var(--cosmic-1) 0%, var(--cosmic-2) 25%, var(--cosmic-3) 50%, var(--cosmic-4) 75%, var(--cosmic-5) 100%);
    opacity: 0.95;
}

/* Grid overlay - purple glow */
.grid-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: 
        linear-gradient(rgba(167, 139, 250, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(167, 139, 250, 0.06) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Sparkles effect - subtle, doesn't add haze */
.sparkles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(236,72,153,0.5), transparent),
        radial-gradient(2px 2px at 90px 40px, rgba(168,85,247,0.5), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(6,182,212,0.4), transparent);
    background-size: 200px 150px;
    animation: sparkle 4s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Floating trippy icons */
.floating-icons {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.float-icon {
    position: absolute;
    color: var(--fuchsia);
    animation: float-up 8s ease-in-out infinite;
}

@keyframes float-up {
    0% { transform: translateY(0) rotate(0deg); opacity: 0.1; }
    50% { transform: translateY(-400px) rotate(180deg); opacity: 0.2; }
    100% { transform: translateY(-800px) rotate(360deg); opacity: 0; }
}

/* Title */
.title {
    font-family: var(--font-mono);
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.05em;
    margin-top: 2rem;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.title-main { color: #faf5ff; }
.title-accent { 
    color: var(--fuchsia);
    text-shadow: 0 0 15px rgba(217, 70, 239, 0.4);
}

/* Subtitle */
.subtitle {
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    max-width: 32rem;
    margin-top: 1rem;
    letter-spacing: 0.02em;
}

/* Hero */
.hero-wrap {
    margin-top: 2.5rem;
    transform: rotate(-2deg);
    cursor: pointer;
    position: relative;
}

/* Rotating rainbow ring — всегда активна */
.hero-wrap::before {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #ff0080, #ff8000, #80ff00, #00ff80, #0080ff, #8000ff, #ff0080);
    -webkit-mask: radial-gradient(circle, transparent calc(100% - 8px), #fff 100%);
    mask: radial-gradient(circle, transparent calc(100% - 8px), #fff 100%);
    opacity: 1;
    animation: spin-rainbow 1.5s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes spin-rainbow {
    to { transform: rotate(360deg); }
}

.hero-frame {
    position: relative;
    z-index: 1;
    width: clamp(12rem, 40vw, 18rem);
    height: clamp(12rem, 40vw, 18rem);
    border-radius: 50%;
    border: 4px solid var(--purple-light);
    box-shadow: 
        6px 6px 0 var(--purple),
        0 0 40px rgba(168, 85, 247, 0.3);
    overflow: hidden;
    background: linear-gradient(135deg, var(--cosmic-3), var(--cosmic-4));
    animation: frame-pulse 2s ease-in-out infinite alternate;
}

@keyframes frame-pulse {
    from { transform: scale(1) rotate(-2deg); }
    to { transform: scale(1.05) rotate(2deg); }
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: hue-trip 3s linear infinite;
}

@keyframes hue-trip {
    0% { filter: hue-rotate(0deg) saturate(1.2); }
    25% { filter: hue-rotate(90deg) saturate(1.5); }
    50% { filter: hue-rotate(180deg) saturate(1.2); }
    75% { filter: hue-rotate(270deg) saturate(1.5); }
    100% { filter: hue-rotate(360deg) saturate(1.2); }
}

.hero-badge {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    z-index: 2;
    background: linear-gradient(135deg, var(--fuchsia), var(--pink));
    color: white;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border: 2px solid var(--purple-light);
    border-radius: 0.375rem;
    box-shadow: 2px 2px 0 var(--purple);
    transform: rotate(8deg);
}

/* Section */
.section {
    margin-top: 2.5rem;
    width: 100%;
    max-width: 28rem;
}

.section:has(.section-header) { max-width: 48rem; }
.gallery { max-width: 64rem; }

/* Trip Meter */
.trip-meter {
    background: rgba(30, 27, 75, 0.6);
    border: 3px solid var(--purple-light);
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 4px 4px 0 var(--purple), 0 0 20px rgba(168, 85, 247, 0.2);
}

/* Blaster mode - 100% golden flash, всё видно */
.trip-meter-wrap.is-blasting .trip-meter {
    animation: meter-gold-glow 0.5s ease-in-out infinite alternate;
}

.trip-meter-wrap.is-blasting .trip-meter-fill {
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #fbbf24) !important;
    animation: meter-gold-pulse 0.5s ease-in-out infinite alternate;
}

.trip-meter-wrap.is-blasting .trip-value {
    color: #fbbf24 !important;
    animation: meter-gold-flash 0.5s ease-in-out infinite alternate;
}

.trip-meter-wrap.is-blasting .trip-meter-label {
    color: #fbbf24 !important;
    font-weight: 800;
    animation: meter-gold-flash 0.5s ease-in-out infinite alternate;
}

@keyframes meter-gold-glow {
    0% {
        box-shadow: 4px 4px 0 #b45309, 0 0 25px rgba(251, 191, 36, 0.6), 0 0 40px rgba(245, 158, 11, 0.4);
        border-color: #fbbf24;
    }
    100% {
        box-shadow: 6px 6px 0 #f59e0b, 0 0 45px rgba(251, 191, 36, 0.95), 0 0 70px rgba(245, 158, 11, 0.7);
        border-color: #fcd34d;
    }
}

@keyframes meter-gold-pulse {
    0% {
        filter: brightness(1.1) drop-shadow(0 0 8px rgba(251, 191, 36, 0.8));
    }
    100% {
        filter: brightness(1.4) drop-shadow(0 0 18px rgba(251, 191, 36, 1));
    }
}

@keyframes meter-gold-flash {
    0% {
        opacity: 1;
        text-shadow: 0 0 12px rgba(251, 191, 36, 0.9);
    }
    100% {
        opacity: 1;
        text-shadow: 0 0 25px rgba(251, 191, 36, 1), 0 0 40px rgba(245, 158, 11, 0.8);
    }
}

.trip-meter-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.trip-value { color: var(--fuchsia); font-weight: 700; }

.trip-meter-bar {
    position: relative;
    height: 1.5rem;
    background: rgba(0,0,0,0.3);
    border: 2px solid var(--purple);
    border-radius: 0.375rem;
    overflow: hidden;
}

.trip-meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--purple), var(--fuchsia));
    border-radius: 0.25rem;
    transition: width 0.1s ease;
}

.trip-meter-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* Contract */
.contract-wrap {
    margin-top: 2rem;
}

.contract-label {
    display: block;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
}

.contract-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(30, 27, 75, 0.5);
    border: 3px solid var(--purple);
    border-radius: 0.5rem;
    box-shadow: 4px 4px 0 var(--purple);
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all 0.2s;
}

.contract-btn:hover { background: rgba(76, 29, 149, 0.4); }
.contract-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--purple); }

.contract-copy {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--fuchsia);
    font-weight: 700;
}

.copy-text { display: none; }
@media (min-width: 640px) { .copy-text { display: inline; } }

/* Links */
.links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(30, 27, 75, 0.6);
    color: #faf5ff;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 3px solid var(--purple);
    border-radius: 0.5rem;
    box-shadow: 4px 4px 0 var(--purple);
    text-decoration: none;
    transition: all 0.2s;
}

.link-btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--purple); }

.link-btn-primary {
    background: linear-gradient(135deg, var(--fuchsia), var(--pink));
    border-color: var(--purple-light);
    color: white;
}

.link-btn-primary:hover { box-shadow: 6px 6px 0 var(--purple), 0 0 20px rgba(217, 70, 239, 0.5); }

/* About Card */
.about-card {
    margin-top: 4rem;
    max-width: 42rem;
}

.about-card .card-badge {
    position: relative;
    top: 1rem;
    left: 1.5rem;
}

.card-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--fuchsia), var(--pink));
    color: white;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border: 2px solid var(--purple-light);
    border-radius: 0.5rem;
    box-shadow: 2px 2px 0 var(--purple);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.about-card > .card-content {
    background: rgba(30, 27, 75, 0.7);
    border: 3px solid var(--purple);
    border-radius: 0.5rem;
    box-shadow: 6px 6px 0 var(--purple);
    padding: 2rem;
    margin-top: 0.5rem;
}

.card-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.card-icon {
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    background: rgba(168, 85, 247, 0.2);
    border: 2px solid var(--purple);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card-content h2 {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: #faf5ff;
    margin-bottom: 0.75rem;
}

.card-content p {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.6;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tags span {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    background: rgba(168, 85, 247, 0.2);
    color: var(--lavender);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 0.25rem;
}

/* Meme Generator */
.meme-gen {
    margin-top: 4rem;
    max-width: 48rem;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--fuchsia), var(--pink));
    color: white;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border: 2px solid var(--purple-light);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.section-header h2 {
    font-family: var(--font-mono);
    font-size: clamp(1.5rem, 4vw, 1.875rem);
    color: #faf5ff;
}

.section-header .accent { color: var(--fuchsia); }
.section-header p { color: rgba(255,255,255,0.5); font-size: 0.875rem; margin-top: 0.5rem; }

.meme-form {
    background: rgba(30, 27, 75, 0.7);
    border: 3px solid var(--purple);
    border-radius: 0.5rem;
    box-shadow: 6px 6px 0 var(--purple);
    padding: 1.25rem;
}

.meme-form label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.meme-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    background: rgba(0,0,0,0.3);
    border: 2px solid var(--purple);
    border-radius: 0.5rem;
    color: #faf5ff;
    margin-bottom: 1rem;
}

.meme-form input::placeholder { color: rgba(255,255,255,0.4); }
.meme-form input:focus { outline: none; box-shadow: 0 0 0 2px var(--fuchsia); }

.btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--fuchsia), var(--pink));
    color: white;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 3px solid var(--purple-light);
    border-radius: 0.5rem;
    box-shadow: 4px 4px 0 var(--purple);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--purple);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Generation status — под баром генерации */
.gen-status {
    display: none;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(30, 27, 75, 0.8);
    border: 2px solid var(--fuchsia);
    border-radius: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: rgba(255,255,255,0.9);
}

.gen-status.is-open {
    display: flex;
}

.gen-status .gen-spinner {
    font-size: 1.5rem;
    animation: gen-spin 1.5s ease-in-out infinite;
}

@keyframes gen-spin {
    0%, 100% { transform: rotate(-15deg) scale(1); filter: hue-rotate(0deg); }
    50% { transform: rotate(15deg) scale(1.2); filter: hue-rotate(90deg); }
}

/* Gallery - scattered grid */
.gallery {
    margin-top: 4rem;
    max-width: 64rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2rem;
    position: relative;
    min-height: 400px;
}

@media (max-width: 768px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

.gallery-item {
    cursor: pointer;
    border: 3px solid var(--purple);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 4px 4px 0 var(--purple);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    transform: rotate(var(--item-rot, 0deg));
}

.gallery-item:hover {
    transform: scale(1.05) rotate(0deg);
    box-shadow: 6px 6px 0 var(--fuchsia), 0 0 20px rgba(217, 70, 239, 0.4);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 1;
}

/* Popup Gallery */
.gallery-popup {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 10, 35, 0.97);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-popup.is-open {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    max-width: 90vw;
    max-height: 85vh;
    position: relative;
    padding: 3rem;
}

.popup-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 0.5rem;
    border: 4px solid var(--purple-light);
    box-shadow: 
        8px 8px 0 var(--purple),
        0 0 80px rgba(217, 70, 239, 0.3);
    animation: popup-zoom 0.4s ease;
}

@keyframes popup-zoom {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.popup-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border: 3px solid var(--purple);
    background: rgba(30, 27, 75, 0.9);
    color: var(--lavender);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
}

.popup-close:hover {
    background: var(--fuchsia);
    color: white;
    transform: rotate(90deg);
}

.popup-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border: 3px solid var(--purple);
    background: rgba(30, 27, 75, 0.8);
    color: var(--lavender);
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
}

.popup-nav:hover {
    background: var(--fuchsia);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.popup-prev { left: 1rem; }
.popup-next { right: 1rem; }

.popup-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--lavender);
    background: rgba(30, 27, 75, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 2px solid var(--purple);
}

/* Footer */
.footer-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 4rem;
    color: rgba(255,255,255,0.3);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.footer-tag svg { flex-shrink: 0; }

/* Marquee */
.marquee {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    z-index: 50;
    background: var(--cosmic-1);
    border-top: 3px solid var(--fuchsia);
    padding: 0.5rem 0;
    overflow: hidden;
}

.marquee-inner {
    display: flex;
    width: max-content;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--fuchsia);
    letter-spacing: 0.05em;
    white-space: nowrap;
    animation: marquee 20s linear infinite;
}

.marquee-content {
    flex-shrink: 0;
    padding-right: 3rem;
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Layout - main uses flex but we don't have Tailwind */
.min-h-screen {
    min-height: 100vh;
}

.main-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem 6rem;
}

/* Blast effects - falling mushrooms & lightning at 100% */
.blast-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.blast-item {
  position: absolute;
  top: -50px;
  animation: blast-fall linear forwards;
  filter: drop-shadow(0 0 4px rgba(217, 70, 239, 0.8));
  opacity: 0.9;
}

@keyframes blast-fall {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 0.95;
  }
  100% {
    transform: translateY(100vh) rotate(720deg) scale(1.2);
    opacity: 0.6;
  }
}

/* Utils */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
