/* BitwareLabs - Shared Styles */

:root {
    --neon-blue: #64748b;
    --bio-glow: #38bdf8;
    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --sky-500: #0ea5e9;
    --sky-400: #38bdf8;
    --sky-300: #7dd3fc;
    --sky-200: #bae6fd;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--slate-950);
    color: #e2e8f0;
    line-height: 1.6;
}

.font-mono {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* Glowing text effect */
.glow-text {
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

/* Grid background pattern */
.grid-bg {
    background-image: radial-gradient(var(--slate-800) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

/* Sleep cycle cards */
.sleep-cycle {
    border-left: 1px solid var(--slate-700);
    transition: all 0.3s ease;
}

.sleep-cycle:hover {
    border-left: 1px solid var(--sky-400);
    background: rgba(56, 189, 248, 0.03);
}

/* Timeline styling */
.timeline-item {
    position: relative;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 8px;
    height: 8px;
    background: var(--sky-500);
    border-radius: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 1.25rem;
    width: 2px;
    height: calc(100% - 0.5rem);
    background: var(--slate-700);
}

.timeline-item:last-child::after {
    display: none;
}

/* Code blocks */
.code-block {
    background: var(--slate-950);
    border: 1px solid var(--slate-800);
    border-radius: 0.5rem;
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    overflow-x: auto;
}

.code-block .comment {
    color: var(--slate-500);
}

.code-block .keyword {
    color: var(--sky-400);
}

.code-block .string {
    color: #22c55e;
}

.code-block .function {
    color: #f59e0b;
}

/* Cards */
.card {
    background: var(--slate-950);
    border: 1px solid var(--slate-800);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(56, 189, 248, 0.5);
}

/* Feature boxes */
.feature-box {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.05) 0%, transparent 100%);
    border: 1px solid var(--slate-800);
    border-radius: 0.75rem;
    padding: 2rem;
}

/* Team member cards */
.team-card {
    text-align: center;
    padding: 2rem;
}

.team-card .avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sky-500) 0%, var(--slate-700) 100%);
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
}

/* Blog cards */
.blog-card {
    background: var(--slate-900);
    border: 1px solid var(--slate-800);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: var(--sky-500);
}

.blog-card .thumbnail {
    height: 200px;
    background: linear-gradient(135deg, var(--slate-800) 0%, var(--slate-900) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form styling */
.form-input {
    width: 100%;
    background: var(--slate-900);
    border: 1px solid var(--slate-700);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: white;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--sky-500);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-input::placeholder {
    color: var(--slate-500);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--slate-300);
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--sky-500);
    color: white;
}

.btn-primary:hover {
    background: var(--sky-400);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--slate-700);
    color: var(--slate-300);
}

.btn-secondary:hover {
    border-color: var(--sky-500);
    color: var(--sky-400);
}

/* Research paper cards */
.paper-card {
    background: var(--slate-900);
    border: 1px solid var(--slate-800);
    border-radius: 0.5rem;
    padding: 1.5rem;
    position: relative;
}

.paper-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--sky-500);
    border-radius: 0.5rem 0 0 0.5rem;
}

/* Tag badges */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--slate-800);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--slate-300);
}

.tag-primary {
    background: rgba(14, 165, 233, 0.2);
    color: var(--sky-400);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.6s ease-out forwards;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--slate-900);
}

::-webkit-scrollbar-thumb {
    background: var(--slate-700);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-600);
}

/* Responsive utilities */
@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none;
    }
}

/* Page header styling */
.page-header {
    padding-top: 8rem;
    padding-bottom: 4rem;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 1rem;
}

.page-header .subtitle {
    color: var(--slate-400);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--slate-500);
    margin-bottom: 2rem;
}

.breadcrumb a {
    color: var(--slate-400);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--sky-400);
}

.breadcrumb .separator {
    color: var(--slate-700);
}

/* Section styling */
.section {
    padding: 6rem 1.5rem;
}

.section-alt {
    background: var(--slate-900);
    border-top: 1px solid var(--slate-800);
    border-bottom: 1px solid var(--slate-800);
}

/* Container */
.container {
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Prose styling for content */
.prose {
    color: var(--slate-400);
    line-height: 1.75;
}

.prose p {
    margin-bottom: 1.25rem;
}

.prose h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 500;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.prose ul, .prose ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose a {
    color: var(--sky-400);
    text-decoration: none;
}

.prose a:hover {
    text-decoration: underline;
}

.prose strong {
    color: white;
    font-weight: 600;
}

.prose em {
    color: var(--sky-200);
}

.prose blockquote {
    border-left: 4px solid var(--sky-500);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--slate-300);
}

/* Status indicators */
.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-active .status-dot {
    background: #22c55e;
}

.status-development .status-dot {
    background: #f59e0b;
}

.status-research .status-dot {
    background: var(--sky-500);
}

/* ============================================
   BACKGROUND ANIMATIONS
   ============================================ */

/* Gradient pulse breathing effect on body */
@keyframes gradient-breathe {
    0%, 100% {
        background-color: var(--slate-950);
    }
    50% {
        background-color: #030a18;
    }
}

body {
    animation: gradient-breathe 10s ease-in-out infinite;
}

/* Floating particles container */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

/* Individual particle styling */
.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--sky-400);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle linear infinite;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100px) translateX(20px);
        opacity: 0;
    }
}

/* Generate multiple particles with different delays */
.particle:nth-child(1) { left: 5%; animation-duration: 25s; animation-delay: 0s; }
.particle:nth-child(2) { left: 15%; animation-duration: 30s; animation-delay: 2s; }
.particle:nth-child(3) { left: 25%; animation-duration: 28s; animation-delay: 4s; }
.particle:nth-child(4) { left: 35%; animation-duration: 32s; animation-delay: 1s; }
.particle:nth-child(5) { left: 45%; animation-duration: 26s; animation-delay: 3s; }
.particle:nth-child(6) { left: 55%; animation-duration: 29s; animation-delay: 5s; }
.particle:nth-child(7) { left: 65%; animation-duration: 27s; animation-delay: 2.5s; }
.particle:nth-child(8) { left: 75%; animation-duration: 31s; animation-delay: 0.5s; }
.particle:nth-child(9) { left: 85%; animation-duration: 24s; animation-delay: 3.5s; }
.particle:nth-child(10) { left: 95%; animation-duration: 33s; animation-delay: 1.5s; }
.particle:nth-child(11) { left: 10%; animation-duration: 28s; animation-delay: 6s; }
.particle:nth-child(12) { left: 30%; animation-duration: 25s; animation-delay: 7s; }
.particle:nth-child(13) { left: 50%; animation-duration: 30s; animation-delay: 4.5s; }
.particle:nth-child(14) { left: 70%; animation-duration: 27s; animation-delay: 8s; }
.particle:nth-child(15) { left: 90%; animation-duration: 29s; animation-delay: 5.5s; }

/* Scan line effect for grid background */
.grid-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(56, 189, 248, 0.3) 50%,
        transparent 100%);
    animation: scan-line 12s ease-in-out infinite;
    opacity: 0;
}

@keyframes scan-line {
    0%, 90%, 100% {
        transform: translateY(-100px);
        opacity: 0;
    }
    5% {
        opacity: 0.6;
    }
    85% {
        opacity: 0.6;
    }
    95% {
        transform: translateY(600px);
        opacity: 0;
    }
}

/* ============================================
   TEXT GLITCH EFFECTS
   ============================================ */

/* Base glitch text class */
.glitch-text {
    position: relative;
    display: inline-block;
}

/* Flicker animation */
@keyframes glitch-flicker {
    0%, 100% {
        opacity: 1;
        transform: translateX(0);
    }
    5% {
        opacity: 0.8;
        transform: translateX(-2px);
    }
    10% {
        opacity: 1;
        transform: translateX(2px);
    }
    15% {
        opacity: 0.9;
        transform: translateX(0);
    }
    20%, 100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.glitch-flicker {
    animation: glitch-flicker 0.3s ease-in-out;
}

/* Glitch offset layers for chromatic effect (optional enhancement) */
@keyframes glitch-offset {
    0%, 100% {
        text-shadow: none;
    }
    25% {
        text-shadow: -2px 0 rgba(56, 189, 248, 0.5), 2px 0 rgba(248, 56, 56, 0.3);
    }
    50% {
        text-shadow: 2px 0 rgba(56, 189, 248, 0.5), -2px 0 rgba(248, 56, 56, 0.3);
    }
    75% {
        text-shadow: -1px 0 rgba(56, 189, 248, 0.3), 1px 0 rgba(248, 56, 56, 0.2);
    }
}

/* Scramble text placeholder styling */
[data-glitch="scramble"] {
    transition: color 0.1s ease;
}

[data-glitch="scramble"].scrambling {
    color: var(--sky-400);
}

/* Hover glitch trigger for navigation and interactive elements */
[data-glitch="hover"]:hover {
    animation: glitch-flicker 0.2s ease-in-out;
}

/* Ambient flicker for status badges */
.status[data-glitch="ambient"] {
    animation: ambient-flicker 8s ease-in-out infinite;
}

@keyframes ambient-flicker {
    0%, 96%, 100% {
        opacity: 1;
    }
    97% {
        opacity: 0.7;
    }
    98% {
        opacity: 1;
    }
    99% {
        opacity: 0.8;
    }
}

/* Static noise overlay (optional, applied via JS) */
.glitch-static::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(56, 189, 248, 0.03) 2px,
        rgba(56, 189, 248, 0.03) 4px
    );
    pointer-events: none;
    animation: static-scroll 0.5s steps(8) infinite;
}

@keyframes static-scroll {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-8px);
    }
}

/* ============================================
   ACCESSIBILITY: Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    body {
        animation: none;
    }

    .particle {
        animation: none;
        display: none;
    }

    .grid-bg::after {
        animation: none;
        display: none;
    }

    .glitch-flicker,
    [data-glitch="hover"]:hover,
    .status[data-glitch="ambient"] {
        animation: none;
    }

    .glitch-static::after {
        animation: none;
        display: none;
    }
}
