/*
 * GlossAPI consolidated theme CSS.
 * Ported from inline <style> blocks of index.html, blog.html, article.html,
 * aboutus.html. Duplicates removed.
 */

html { width: 100%; position: relative; }

body {
    background-color: #1a1625;
    color: #e2e8f0;
    overflow-x: hidden;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* ================================================================
 * Entropy / glitch effect (used in hero on home).
 * ================================================================ */
.entropy-char {
    display: inline-block;
    position: relative;
    opacity: 1;
    will-change: transform;
    margin-right: 0.15em;
}

@keyframes glitch-shake {
    0%, 92% { transform: translate(0); }
    93% { transform: translate(-2px, 1px); }
    94% { transform: translate(2px, -1px); }
    95% { transform: translate(-1px, 2px); }
    96% { transform: translate(1px, -2px); }
    97% { transform: translate(-2px, -1px); }
    98% { transform: translate(0); }
    100% { transform: translate(0); }
}

.entropy-char:nth-child(1) { animation: glitch-shake 3s infinite -0.2s; }
.entropy-char:nth-child(2) { animation: glitch-shake 4.1s infinite -3.5s; }
.entropy-char:nth-child(3) { animation: glitch-shake 2.5s infinite -1.8s; }
.entropy-char:nth-child(4) { animation: glitch-shake 3.7s infinite -0.5s; }
.entropy-char:nth-child(5) { animation: glitch-shake 5.2s infinite -4.2s; }
.entropy-char:nth-child(6) { animation: glitch-shake 2.9s infinite -2.0s; }
.entropy-char:nth-child(7) { animation: glitch-shake 4.5s infinite -1.2s; }
.entropy-char:nth-child(8) { animation: glitch-shake 3.3s infinite -2.9s; }

/* ================================================================
 * View / section transitions.
 * ================================================================ */
.view-section { display: none; opacity: 0; transition: opacity 0.4s ease-in-out; }
.view-section.active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.5s ease-out forwards;
}

/* ================================================================
 * Glass-box (the signature glass panel).
 * ================================================================ */
.glass-box {
    background: rgba(13, 8, 20, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-radius: 1rem;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s;
}

.glass-box:hover::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(139, 92, 246, 0.25), transparent 40%);
    z-index: -1;
    opacity: 1;
    transition: opacity 0.3s;
    pointer-events: none;
    transition-duration: 0s;
    border-radius: inherit;
}

.glass-box.active-dataset {
    border-width: 1px;
}

.glass-box.active-dataset::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid rgba(var(--pulse-color), 1);
    box-shadow: 0 0 15px rgba(var(--pulse-color), 0.6);
    z-index: -2;
    pointer-events: none;
    opacity: 1;
}

@keyframes simplePulse {
    0% { inset: 0px; opacity: 1; }
    100% { inset: -8px; opacity: 0; border-width: 0px; }
}

@keyframes modernPulse {
    0% { transform: scale(1); opacity: 0.8; filter: blur(0px); }
    50% { opacity: 0.4; }
    100% { transform: scale(1.1); opacity: 0; filter: blur(4px); }
}

.glass-box.active-dataset::before {}
.glass-box.active-dataset:hover::before { opacity: 1; }

/* Small shine variant. */
.glass-box.small-shine::before {
    z-index: -1 !important;
    background: radial-gradient(300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(139, 92, 246, 0.6), transparent 40%);
    padding: 3px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
}
.glass-box.small-shine:hover::before { opacity: 1; }
.glass-box.small-shine > div {
    z-index: 1;
    position: relative;
    background-color: rgba(13, 8, 20, 0.5);
    backdrop-filter: blur(10px);
}

/* Inner-outline shine for major glass containers. */
#pipeline-container::before,
#team .glass-box.rounded-3xl::before,
#graph-container::before,
.glass-box.active-dataset::before,
.glass-box.article-card::before,
.glass-box.featured-article-card::before,
.glass-box[data-theme]::before {
    z-index: -1 !important;
    background: radial-gradient(var(--shine-size, 2000px) circle at var(--mouse-x, 50%) var(--mouse-y, 50%), var(--shine-color, rgba(139, 92, 246, 0.3)), transparent 40%);
    padding: 5px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
}

.glass-box.social-btn::before {
    z-index: -1 !important;
    background: radial-gradient(var(--shine-size, 2000px) circle at var(--mouse-x, 50%) var(--mouse-y, 50%), var(--shine-color, rgba(139, 92, 246, 0.3)), transparent 40%);
    padding: 3px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
}

#pipeline-container::before { --shine-size: 2000px; }
#team .glass-box.rounded-3xl::before { --shine-size: 2000px; }
#graph-container::before { --shine-size: 800px; }
.glass-box[data-theme]::before { --shine-size: 600px; }

#team .glass-box.rounded-3xl > div,
#graph-container > div,
.glass-box[data-theme] > div,
.glass-box.social-btn > div {
    z-index: 1;
    position: relative;
    background-color: rgba(13, 8, 20, 0.5);
    backdrop-filter: blur(10px);
}

#pipeline-container > div {
    z-index: 1;
    position: relative;
    background-color: transparent !important;
    backdrop-filter: blur(10px);
}

.glass-box.active-dataset {
    border-color: rgba(var(--pulse-color), 1) !important;
    border-width: 1px;
    box-shadow: 0 0 30px rgba(var(--pulse-color), 0.3), inset 0 0 20px rgba(var(--pulse-color), 0.1);
}
.glass-box.active-dataset::after { display: none; }

#pipeline-container:hover::before,
#team .glass-box.rounded-3xl:hover::before,
#graph-container:hover::before,
.glass-box[data-theme]:hover::before,
.glass-box.active-dataset::before,
.glass-box.article-card:hover::before,
.glass-box.featured-article-card:hover::before,
.glass-box.social-btn:hover::before {
    opacity: 1;
}

#team .glass-box.rounded-3xl,
#graph-container { transition: border-color 0.3s ease; }

#team .glass-box.rounded-3xl:hover,
#graph-container:hover { border-color: rgba(139, 92, 246, 0.5); }

.glass-box.social-btn:hover {
    box-shadow: 0 0 20px var(--shine-color, rgba(139, 92, 246, 0.3));
}

/* Theme-color pulses. */
.glass-box[data-theme="purple"].active-dataset { --pulse-color: 139, 92, 246; }
.glass-box[data-theme="blue"].active-dataset { --pulse-color: 59, 130, 246; }
.glass-box[data-theme="green"].active-dataset { --pulse-color: 34, 197, 94; }
.glass-box[data-theme="pink"].active-dataset { --pulse-color: 236, 72, 153; }
.glass-box[data-theme="cyan"].active-dataset { --pulse-color: 6, 182, 212; }

.glass-box[data-theme="purple"].active-dataset h3 { color: #d8b4fe; }
.glass-box[data-theme="blue"].active-dataset h3 { color: #93c5fd; }
.glass-box[data-theme="green"].active-dataset h3 { color: #86efac; }
.glass-box[data-theme="pink"].active-dataset h3 { color: #f9a8d4; }
.glass-box[data-theme="cyan"].active-dataset h3 { color: #67e8f9; }

/* ================================================================
 * Floating navigation pill.
 * ================================================================ */
.floating-nav {
    background: rgba(13, 8, 20, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-radius: 24px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s;
    overflow: hidden;
    position: relative;
}

.floating-nav:hover {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.15);
}

.floating-nav::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(139, 92, 246, 0.25), transparent 40%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.floating-nav:hover::before { opacity: 1; transition-duration: 0s; }

.nav-link { position: relative; }
.nav-link.active { color: white; }
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #a855f7;
    box-shadow: 0 0 8px #a855f7;
    border-radius: 2px;
}

/* ================================================================
 * Hero text-gradient + decorative underlines / circles.
 * ================================================================ */
.text-gradient {
    background: linear-gradient(135deg, #fff 0%, #d8b4fe 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.circled-text { position: relative; display: inline-block; }
.circled-text::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 130%;
    height: 140%;
    transform: translate(-50%, -50%) rotate(-3deg);
    border: 2px solid rgba(139, 92, 246, 0.8);
    border-radius: 50% 70% 50% 70% / 60% 80% 60% 80%;
    z-index: -1;
    pointer-events: none;
}

.underlined-text { position: relative; display: inline-block; }
.underlined-text::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: -5%;
    width: 110%;
    height: 0.3em;
    border-bottom: 3px solid rgba(139, 92, 246, 0.8);
    border-radius: 40% 60% 40% 60% / 100%;
    transform: rotate(-1.5deg);
    pointer-events: none;
}

/* ================================================================
 * Timeline (dataset roadmap).
 * ================================================================ */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, rgba(139, 92, 246, 0.5), transparent);
    transform: translateX(-50%);
}

.timeline-node {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #0f0b16;
    border: 2px solid #8b5cf6;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    transition: all 0.3s;
}

.timeline-node.node-left { right: -8px; }
.timeline-node.node-right { left: -8px; }

.timeline-node.active-node {
    background: #d8b4fe;
    box-shadow: 0 0 20px rgba(216, 180, 254, 0.8);
    transform: translateY(-50%) scale(1.3);
    border-color: white;
}

@media (max-width: 768px) {
    .timeline-line { left: 20px; transform: translateX(-50%); }
    .roadmap-item {
        width: 100% !important;
        margin-left: 0 !important;
        padding-right: 0 !important;
        padding-left: 50px !important;
        text-align: left !important;
    }
    .timeline-node {
        left: 20px !important;
        right: auto !important;
        transform: translateX(-50%) translateY(-50%) !important;
    }
    .roadmap-container { flex-direction: column-reverse; }
    .roadmap-item.w-1\/2 { width: 100%; }
    .roadmap-item .flex { justify-content: flex-start !important; }
    #backlight-glow { display: none !important; }
}

@media (max-aspect-ratio: 1/1) {
    .roadmap-container { flex-direction: column-reverse !important; }
    .roadmap-container > div { width: 100% !important; }
}

/* ================================================================
 * Team carousel social links.
 * ================================================================ */
.team-social-link { opacity: 0.6; transition: all 0.2s; }
.team-social-link:hover {
    opacity: 1;
    transform: translateY(-2px);
    color: #d8b4fe;
}

/* ================================================================
 * Scrollbars.
 * ================================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track {
    background: #0d0a14;
    margin-inline: 2rem;
}
@media (min-width: 768px) {
    ::-webkit-scrollbar-track { margin-inline: 3rem; }
}
::-webkit-scrollbar-thumb {
    background: #c084fc;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: #a855f7; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ================================================================
 * Article hero background (used on single.php). Inline Tailwind classes
 * on the wrapper / image set width / height / opacity / position; this
 * block just fades the bottom edge of the image into the page.
 * ================================================================ */
.mask-image-gradient {
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 35%, rgba(0, 0, 0, 0) 100%);
            mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 35%, rgba(0, 0, 0, 0) 100%);
}

/* ================================================================
 * line-clamp utilities (used by blog cards).
 * ================================================================ */
.line-clamp-2,
.line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-2 { -webkit-line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; }
