:root {
    --primary: #D90429;
    --black: #000000;
    --bg: #FCFCFC;
    --white: #FFFFFF;
    --text: #1A1A1A;
    --text-muted: #666666;
    --border: #EAEAEA;
    --card-shadow: 0 15px 45px rgba(0, 0, 0, 0.05);
    --font-main: 'Inter', sans-serif;
    --font-head: 'Outfit', sans-serif;
    --nav-bg: rgba(255, 255, 255, 0.95);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--text);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* Splash Screen */
#splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    transition: opacity 1.5s cubic-bezier(0.19, 1, 0.22, 1);
}

#splash-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.splash-content {
    text-align: center;
    position: relative;
    z-index: 2;
    background: var(--white);
    padding: 40px;
}

.splash-gif {
    width: 140px;
    height: 140px;
    margin-bottom: 20px;
}

.qai-logo {
    font-family: var(--font-head);
    font-size: 5rem;
    font-weight: 800;
    color: var(--black);
    letter-spacing: -3px;
}

.red-streak {
    width: 0;
    height: 6px;
    background: var(--primary);
    margin: 10px auto;
    border-radius: 3px;
}

.branding-text {
    font-family: var(--font-head);
    font-size: 1.2rem;
    margin-top: 10px;
    opacity: 0;
    transform: translateY(10px);
}

/* Navigation */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 1000;
}

.nav-branding {
    display: flex;
    align-items: center;
    gap: 15px;
    line-height: 1.1;
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-small {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--primary);
    line-height: 1;
}

.logo-tagline {
    font-family: var(--font-head);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#menu-toggle {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--black);
    cursor: pointer;
}

#nav-links {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: var(--white);
    list-style: none;
    display: none;
    flex-direction: column;
    padding: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

#nav-links.open {
    display: flex;
    animation: slideDown 0.4s forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#nav-links li {
    padding: 15px 30px;
    text-align: center;
}

.nav-item {
    text-decoration: none;
    color: var(--black);
    font-weight: 600;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 5px;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(-50%);
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 100%;
}

/* Side Decorations */
.side-deco {
    position: fixed;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--border), transparent);
    z-index: -1;
}

.side-deco.left {
    left: 2%;
}

.side-deco.right {
    right: 2%;
}

/* App Core */
#app {
    width: 100%;
    height: 100vh;
    padding-top: 80px;
    overflow-y: auto;
    scroll-behavior: smooth;
    background: var(--bg);
}

.page {
    display: none;
    padding: 40px 5%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.page.active {
    display: block;
    animation: pageIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

#offerings.page {
    padding-top: 5px;
    height: calc(100vh - 80px);
    align-items: center;
}

#offerings.page.active {
    display: flex;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Canvas */
.section-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.3;
}

/* Technology Awesome */
.tech-grid-awesome {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.tech-item-awesome {
    background: var(--white);
    padding: 40px;
    border-radius: 30px;
    text-align: left;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.tech-item-awesome::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(217, 4, 41, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s;
}

.tech-item-awesome:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
}

.tech-item-awesome:hover::before {
    opacity: 1;
}

.tech-icon-wrap {
    width: 60px;
    height: 60px;
    background: #F8F8F8;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 25px;
    transition: transform 0.5s;
}

.tech-item-awesome:hover .tech-icon-wrap {
    transform: rotateY(360deg) scale(1.1);
    background: var(--primary);
    color: var(--white);
}

.tech-item-awesome h3 {
    font-family: var(--font-head);
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.tech-item-awesome p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.section-header.centered-header {
    text-align: center;
}

.legal-footer {
    text-align: center;
    padding: 60px 0 20px;
    border-top: 1px solid var(--border);
    margin-top: 80px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Story Section */
.story-block {
    background: var(--white);
    padding: 60px 40px;
    border-radius: 30px;
    box-shadow: var(--card-shadow);
    max-width: 1200px;
    margin: 0 auto;
}

.story-tag {
    color: var(--primary);
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 4px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    margin-bottom: 20px;
}

.story-block h2 {
    font-family: var(--font-head);
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 40px;
    line-height: 1.1;
}

.team-synergy-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 50px;
}

.team-synergy-icon img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--border);
    margin-bottom: 10px;
}

.icon-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.story-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.story-p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 30px;
}

.story-highlight {
    font-size: 1.6rem;
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--black);
    line-height: 1.3;
    padding: 30px;
    background: #F9F9F9;
    border-left: 6px solid var(--primary);
    border-radius: 0 15px 15px 0;
    margin: 40px 0;
}

/* Seamless Horizontal Cinematic Lifecycle */
.marquee-outer-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.marquee-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--black);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.marquee-nav-btn:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(217, 4, 41, 0.3);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.marquee-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    padding: 20px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.marquee-wrapper::-webkit-scrollbar {
    display: none;
}

.cinematic-container.marquee-content {
    display: flex;
    flex-direction: row;
    gap: 80px;
    width: max-content;
    padding: 0 40px;
    /* Animation removed - handled in script.js */
}

.cinematic-container.marquee-content:hover {
    animation-play-state: paused;
}

@keyframes marqueeAuto {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.lifecycle-scene-cinematic {
    flex-shrink: 0;
    width: 85vw;
    max-width: 1200px;
    height: 75vh;
    max-height: 800px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 60px;
    position: relative;
    padding: 60px 80px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(30px);
    border-radius: 40px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.5s;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.02);
}

.scene-left {
    flex: 1;
    max-width: 450px;
    text-align: left;
}

.scene-right {
    flex: 1.2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.scene-index {
    font-family: var(--font-head);
    font-size: 10rem;
    font-weight: 900;
    color: var(--accent);
    opacity: 0.05;
    position: absolute;
    top: -20px;
    left: 40px;
    line-height: 1;
    pointer-events: none;
}

.lifecycle-scene-cinematic h2 {
    font-family: var(--font-head);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 25px;
    color: var(--black);
    position: relative;
}

.lifecycle-scene-cinematic h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 80px;
    height: 6px;
    background: var(--accent);
    border-radius: 3px;
}

.scene-text {
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.depth-tags-cinematic {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.depth-tags-cinematic span {
    background: var(--white);
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--black);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: all 0.3s;
}

.lifecycle-scene-cinematic:hover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.6);
}

.lifecycle-scene-cinematic:hover .depth-tags-cinematic span {
    background: var(--accent);
    color: var(--white);
    transform: scale(1.05);
}

@media (max-width: 1200px) {
    .lifecycle-scene-cinematic {
        flex-direction: column;
        height: auto;
        padding: 50px 30px;
        max-height: none;
        width: 85vw;
    }

    .scene-left,
    .scene-right {
        max-width: 100%;
        width: 100%;
    }

    .scene-index {
        font-size: 6rem;
        top: 10px;
        left: 10px;
    }

    .lifecycle-scene-cinematic h2 {
        font-size: 2.2rem;
    }
}

/* Cinematic Contact Form */
.contact-form-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 40px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.05);
    animation: brandingIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.cinematic-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 15px 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.6);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 15px rgba(217, 4, 41, 0.1);
}

.submit-btn-cinematic {
    padding: 20px;
    background: var(--black);
    color: var(--white);
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.submit-btn-cinematic:hover {
    background: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(217, 4, 41, 0.4);
}

.form-note {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Mobile Expansion Logic */
.mobile-expand-btn {
    display: none;
}

@media (max-width: 768px) {
    .marquee-nav-btn {
        display: none;
    }

    .marquee-wrapper {
        padding: 5px 0;
        overflow-y: visible;
        /* Allow expansion to be seen */
    }

    .cinematic-container.marquee-content {
        gap: 20px;
        align-items: flex-start;
        /* Don't center vertically so they expand downwards */
    }

    .lifecycle-scene-cinematic {
        width: 88vw;
        height: auto;
        min-height: 200px;
        padding: 25px;
        border-radius: 20px;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 15px;
        transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .scene-left {
        max-width: 100%;
        position: relative;
    }

    .scene-text {
        font-size: 0.95rem;
        margin-top: 10px;
        color: var(--text-muted);
    }

    .scene-right {
        display: none;
        /* Hidden by default on mobile */
        width: 100%;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }

    .lifecycle-scene-cinematic.expanded .scene-right {
        display: block;
    }

    .mobile-expand-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 15px;
        background: rgba(0, 0, 0, 0.05);
        border: none;
        padding: 8px 15px;
        border-radius: 10px;
        font-family: var(--font-head);
        font-weight: 700;
        font-size: 0.8rem;
        color: var(--black);
        cursor: pointer;
    }

    .lifecycle-scene-cinematic.expanded .mobile-expand-btn i {
        transform: rotate(45deg);
        /* Plus becomes an X */
    }

    .lifecycle-scene-cinematic h2 {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }

    .lifecycle-scene-cinematic h2::after {
        display: none;
    }

    .depth-tags-cinematic {
        gap: 6px;
    }

    .depth-tags-cinematic span {
        padding: 5px 10px;
        font-size: 0.7rem;
    }

    .scene-index {
        font-size: 3rem;
        opacity: 0.1;
        top: -10px;
        right: 10px;
        left: auto;
    }

    #offerings.page {
        height: auto;
        min-height: 100vh;
        padding-top: 100px;
    }

    .form-row {
        flex-direction: column;
    }

    .contact-form-container {
        padding: 25px;
        border-radius: 30px;
    }
}

/* Industries Compact */
.industries-compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.ind-mini-card {
    background: var(--white);
    padding: 30px;
    border-radius: 25px;
    text-align: center;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
    transition: all 0.4s;
}

.ind-mini-card:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.ind-mini-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.ind-mini-card h3 {
    font-family: var(--font-head);
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.ind-mini-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Desktop Overrides */
@media (min-width: 1024px) {
    #menu-toggle {
        display: none;
    }

    #nav-links {
        position: static;
        display: flex;
        flex-direction: row;
        width: auto;
        background: none;
        box-shadow: none;
        padding: 0;
    }

    #nav-links li {
        padding: 0 20px;
    }

    .nav-item {
        font-size: 1rem;
        color: var(--text);
        position: relative;
    }

    .nav-item:hover {
        color: var(--primary);
    }

    .story-grid {
        grid-template-columns: 1fr 1fr;
    }

    .offerings-fancier-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ind-content {
        flex-direction: row;
    }

    .ind-info {
        padding: 80px 100px;
    }

    .ind-card-full:nth-child(even) .ind-content {
        flex-direction: row-reverse;
    }

    .side-deco {
        width: 1px;
    }
}

/* Splash Animations */
@keyframes streak {
    from {
        width: 0;
    }

    to {
        width: 140px;
    }
}

@keyframes brandingIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.streak-active {
    animation: streak 1s forwards cubic-bezier(0.19, 1, 0.22, 1);
}

.branding-active {
    animation: brandingIn 0.8s forwards 0.5s;
}