:root {
    --bg-color: #050505;
    --text-color: #ffffff;
    --accent-cyan: #00f0ff;
    --accent-purple: #7000ff;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Accessibility utilities */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--accent-cyan);
    color: var(--bg-color);
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none;
    z-index: 9999;
    border-radius: 0 0 4px 4px;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* Focus indicators for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 3px;
    border-radius: 2px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-heading);
    overflow-x: hidden;
    line-height: 1.6;
}



/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Center items vertically */
    padding: 2rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    -webkit-backdrop-filter: blur(10px);
    /* For Safari */
    backdrop-filter: blur(10px);
    background: rgba(5, 5, 5, 0.5);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    color: white;
}

.accent {
    color: var(--accent-cyan);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    /* Ensures buttons and links align vertically */
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    position: relative;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-cyan);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--accent-cyan);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.btn-primary {
    padding: 0.8rem 1.5rem;
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan) !important;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: var(--accent-cyan);
    color: var(--bg-color) !important;
    box-shadow: 0 0 15px var(--accent-cyan);
}

.btn-primary::after {
    display: none;
    /* Remove underline effect for buttons */
}


/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10%;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 600px;
    margin-top: 120px;
    /* Pushes content down past the navbar */
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
}

.glitch-wrapper {
    display: inline-block;
}

.hero-subtitle {
    font-size: 2.5rem;
    color: #888;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

.hero-graphic {
    position: relative;
    width: 45%;
    max-width: 600px;
    height: auto;
    animation: float 6s ease-in-out infinite;
    margin-top: 120px;
}

.image-slider {
    position: relative;
    width: 100%;
    /* Keep a consistent scale for the slider area */
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
}

.slider-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out, transform 1.5s ease-in-out;
    transform: scale(1.05);
    /* Slight zoom for a "moving" feel */
}

.slider-img.active {
    opacity: 1;
    transform: scale(1);
}

@media (max-width: 992px) {
    .image-slider {
        margin-top: 2rem;
    }
}

.hero-desc {
    font-size: 1.1rem;
    color: #ccc;
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
}

.btn-secondary {
    padding: 0.8rem 1.5rem;
    color: white;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

.btn-secondary:hover {
    border-color: white;
    background: white;
    color: black;
}


@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-graphic {
        animation: none;
    }
}

/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

/* Services Section */
.services {
    padding: 5rem 10%;
    background: linear-gradient(180deg, var(--bg-color) 0%, #0a0a10 100%);
    position: relative;
    z-index: 1;
}

.section-header {
    margin-bottom: 3rem;
}

.section-tag {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-size: 0.9rem;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.services h2 {
    font-size: 3rem;
    font-weight: 600;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 8px;
    transition: transform 0.3s, border-color 0.3s;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-purple);
}

.card-icon {
    width: 50px;
    height: 50px;
    background: rgba(112, 0, 255, 0.1);
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.card-icon svg {
    width: 28px;
    height: 28px;
}

.service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.service-card p {
    color: #999;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* About Section */
.about {
    padding: 5rem 10%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #050505;
    position: relative;
    z-index: 1;
}

.about-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 4rem;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
}

.about-content p {
    color: #ccc;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Contact Section */
.contact {
    padding: 5rem 10%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #08080c;
    position: relative;
    z-index: 1;
}

.contact-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 4rem;
    border-radius: 12px;
    text-align: center;
    width: 100%;
    max-width: 700px;
}

.contact h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact p {
    color: #aaa;
    margin-bottom: 2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: white;
    font-family: var(--font-mono);
    border-radius: 4px;
    outline: none;
    resize: none;
    transition: border-color 0.3s;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--accent-cyan);
}

/* Preferences Banner */
.prefs-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    width: 90%;
    max-width: 600px;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid var(--accent-purple);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 1.5rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
    opacity: 0;
    pointer-events: none;
}

.prefs-banner.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: all;
}

.prefs-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

.prefs-content p {
    font-size: 0.85rem;
    color: #ccc;
    font-family: var(--font-mono);
}

.prefs-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.prefs-buttons .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
}

.prefs-buttons .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
    color: white;
}

/* Scroll reveal */
.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Footer */
footer {
    padding: 2rem 5%;
    background: black;
    border-top: 1px solid var(--glass-border);
    position: relative;
    z-index: 1;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-content p {
    color: #888;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.footer-links {
    margin: 1rem 0;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
}

.footer-social-link {
    color: var(--accent-cyan);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: opacity 0.3s;
}

.footer-social-link:hover {
    opacity: 0.7;
}

.footer-prefs-link {
    color: #888;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-decoration: underline;
    transition: color 0.3s;
}

.footer-prefs-link:hover {
    color: #aaa;
}


/* Hamburger toggle button (hidden on desktop) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-color);
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 5%;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        background: rgba(5, 5, 5, 0.97);
        border-bottom: 1px solid var(--glass-border);
        padding: 1.5rem 5%;
        gap: 1.5rem;
    }

    .nav-links.open {
        display: flex;
    }

    .hero {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding: 120px 5% 2rem 5%;
        height: auto;
        min-height: 100vh;
    }

    .hero-content {
        margin-top: 0;
    }

    .hero-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-graphic {
        margin-top: 2rem;
        width: 100%;
        max-width: 300px;
        height: auto;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .services,
    .about,
    .contact {
        padding: 4rem 5%;
    }

    .services h2 {
        font-size: 2.2rem;
    }

    .contact-content,
    .about-content {
        padding: 2rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

/* Small phone overrides */
@media (max-width: 480px) {
    .service-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .services h2 {
        font-size: 1.8rem;
    }
}

/* --- Floating AI Chat Widget & Tooltip --- */
.chat-tooltip {
    position: fixed;
    bottom: 95px;
    /* Above the floating button */
    right: 30px;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 10px 15px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: bold;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: all 0.4s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.chat-tooltip.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.chat-tooltip span {
    cursor: pointer;
}

.close-tooltip-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.close-tooltip-btn:hover {
    color: white;
}

@media (max-width: 768px) {
    .chat-tooltip {
        bottom: 85px;
        right: 20px;
    }
}

.floating-chat-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--glass-bg);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 15px;
    border-radius: 50px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.floating-chat-btn:hover {
    background: var(--accent-cyan);
    color: var(--bg-color);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.4);
}

.floating-chat-btn svg {
    display: block;
}

.chat-btn-text {
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 0.9rem;
    display: block;
    /* Shown by default on desktop */
}

@media (max-width: 768px) {
    .floating-chat-btn {
        bottom: 20px;
        right: 20px;
        border-radius: 50%;
        /* Make it a pure circle on mobile */
        padding: 15px;
    }

    .chat-btn-text {
        display: none;
        /* Hide text on mobile to save space */
    }
}

.chat-widget {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: rgba(5, 5, 5, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.1);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.chat-widget.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

@media (max-width: 400px) {
    .chat-widget {
        width: calc(100% - 40px);
        right: 20px;
        bottom: 80px;
    }
}

.chat-widget-header {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 240, 255, 0.05);
    border-radius: 12px 12px 0 0;
}

.chat-widget-header h3 {
    font-size: 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--accent-cyan);
}

.close-chat-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.close-chat-btn:hover {
    color: white;
}

.chat-widget-messages {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.chat-widget-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-widget-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.message {
    max-width: 85%;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    line-height: 1.4;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
    word-wrap: break-word;
}

.message.assistant {
    align-self: flex-start;
    background: rgba(112, 0, 255, 0.1);
    border: 1px solid rgba(112, 0, 255, 0.3);
    border-left: 2px solid var(--accent-purple);
}

.message.user {
    align-self: flex-end;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-right: 2px solid var(--accent-cyan);
}

.message p {
    margin-bottom: 0.5rem;
}

.message p:last-child {
    margin-bottom: 0;
}

.message code {
    background: rgba(0, 0, 0, 0.5);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--accent-cyan);
}

.message pre {
    background: rgba(0, 0, 0, 0.6);
    padding: 0.8rem;
    border-radius: 5px;
    overflow-x: auto;
    margin-top: 0.5rem;
    border: 1px solid var(--glass-border);
}

.chat-widget-input {
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 12px 12px;
}

.chat-widget-input input {
    flex-grow: 1;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    color: white;
    font-family: var(--font-heading);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.3s;
    font-size: 0.9rem;
}

.chat-widget-input input:focus {
    border-color: var(--accent-cyan);
}

.chat-widget-input button {
    padding: 0.8rem;
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-widget-input button:hover {
    background: var(--accent-cyan);
    color: var(--bg-color);
}

.typing-indicator {
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    color: #888;
    font-size: 0.8rem;
    display: none;
    animation: pulse 1.5s infinite;
}