html {
      scroll-behavior: smooth;
}
body {
    background-color: #000;
    color: #e5e5e7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 1100px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    -ms-box-sizing: border-box;
    box-sizing: border-box;
}

.header {
    padding: 25px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #222;
}

.header .container {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -ms-flex-align: center;
    align-items: center;
}

.logo {
    font-weight: 600;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
}

.nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: -ms-flexbox;
    display: flex;
}

.nav ul li {
    margin-left: 40px;
}

.nav ul li a {
    color: #e5e5e7;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: text-shadow 0.3s ease;
}

.nav ul li a:hover, .nav ul li a:active {
    color: #e5e5e7;
    text-shadow: 0px 3px 7px white;
}

.nav ul li a.active {
    text-shadow: 0px 3px 7px white;
}

.logo a {
    transition: text-shadow 0.3s ease;
}
.logo a:hover {
    text-shadow: 0px 3px 11px white;
}

#hero {
    height: 100vh;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-pack: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    will-change: opacity;
    /*background-image: url('images/brain.jpg');*/
    z-index: 1;
}

.hero-content {
    z-index: 4;
    padding-bottom: 10vh;
}

.hero-content h1 {
    font-size: 4.5rem;
    font-weight: 600;
    letter-spacing: -2px;
    margin-bottom: 20px;
    line-height: 1.1;
}

#subtitle {
    font-size: 1.5rem;
    color: rgba(255,255,255,0.6);
    max-width: 600px;
    margin: 0 auto;
    opacity: 0;
    animation: fadeInText 1s ease-in-out 2s forwards;
}

@keyframes fadeInText {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Initial logo: Scrolls with page flow */
#initial-logo {
    position: relative;
    top: 55px;
    margin: 0 auto;
    /*position: absolute;*/
    /*left: 50%;*/
    /*top: 80%;*/
    width: 180px;
    height: auto;
    z-index: 100;
    /*transform: translate(-50%, -50%);*/
    opacity: 0;
    animation: fadeInLogo 1.5s ease-in-out 3s forwards;
    pointer-events: none;
}

/* Circuit Wrapper with fuzzy edges */
#brain-circuit-wrap {
    position: fixed;
    left: -5vw;
    bottom: -5vh;
    width: 70vw;
    height: auto;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* The fuzzy edge effect (IE11 compatible) */
#brain-circuit-wrap:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Inset black shadow to bleed inward from the edges */
    box-shadow: inset 0 0 70px 50px #000;
    z-index: 3;
}

#brain-circuit-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

@keyframes fadeInLogo {
    from { opacity: 0; }
    to { opacity: 0.3; }
}

.main-content {
    padding: 120px 0;
    position: relative;
    background-color: transparent;
    z-index: 5;
}

.section {
    padding: 100px 0;
    scroll-margin-top: 80px;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 80px auto;
}

.section-header h2 {
    font-size: 3.5rem;
    font-weight: 600;
    letter-spacing: -1.5px;
    margin-top: 0;
    margin-bottom: 20px;
}

.section-header p {
    font-size: 1.25rem;
    color: #888;
    line-height: 1.6;
}

.content-grid {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: -20px;
}

.card {
    background-color: #111;
    padding: 40px;
    border-radius: 20px;
    margin: 20px;
    -ms-box-sizing: border-box;
    box-sizing: border-box;
    border: 1px solid #222;
    background-image: radial-gradient(circle at 50% 0, rgba(128, 128, 128, 0.1), transparent 50%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.card.full-width {
    width: calc(100% - 40px);
}

.card.half-width {
     width: calc(50% - 40px);
}

 .card.third-width {
     width: calc(33.333% - 40px);
}

.card h3 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top:0;
    margin-bottom: 15px;
    color: #fff;
}

.card p {
    font-size: 1.1rem;
    color: #888;
    line-height: 1.6;
}

.cta-button {
    background-color: #fff;
    color: #000 !important;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 600 !important;
    text-decoration: none;
    /*transition: background-color 0.2s ease, transform 0.2s ease;*/
}
.cta-button, .submit-btn {
    transition: box-shadow 0.3s ease !important;
}

.cta-button:hover {
    /*background-color: #e5e5e7;*/
    /*transform: translateY(-2px);*/
    box-shadow: 0px 1px 7px white;
    text-shadow: none !important;
}

.cta-text-link {
    color: #fff !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: text-shadow 0.3s ease;
}

.cta-text-link:hover, .cta-text-link:active, .cta-text-link:visited {
    color: #fff !important;
}

.cta-text-link:hover, .cta-text-link:active {
    text-shadow: 0px 3px 7px white;
}

.demo-form-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: #111;
    padding: 40px;
    border-radius: 20px;
    border: 1px solid #222;
}

.demo-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-actions {
    grid-column: 2;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #e5e5e7;
    font-weight: 500;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: #000;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #fff;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    background-color: #fff;
    color: #000;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    /*transition: background-color 0.3s ease;*/
}

.submit-btn:hover {
    /*background-color: #e5e5e7;*/
    box-shadow: 0px 1px 7px white;
}

.footer {
    text-align: center;
    padding: 60px 0;
    border-top: 1px solid #222;
}

.footer p {
    margin: 0;
    color: #666;
}

#snackbar {
    position: fixed;
    z-index: 5;
    background-color: green;
    border-radius: 0 0 7px 7px;
    top: -43px;
    left: 5px;
    width: calc(100% - 37px);
    /*height: 23px;*/  /* Multiple line support: must be allowed to grow unrestrained. */
    padding: 10px 14px;
    line-height: 1.5;
    transition: top 0.3s ease-out;
    cursor: pointer;
}
#snackbar.error {
    background-color: darkred;
}
#snackbar.hiding {
    transition: top 0.2s ease-in;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    .header {
        padding: 15px 0;
    }
    .header .container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        position: relative;
        gap: 15px;
    }
    .logo {
        width: 100%;
        text-align: center;
    }
    .nav {
        width: 100%;
    }
    .nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    .nav ul li {
        margin: 5px 15px;
    }
    .nav ul li.cta-nav-item {
        position: absolute;
        top: -3px; /* Align with logo on mobile */
        right: 20px;
        width: auto;
        margin: 0;
    }
    .nav ul li.cta-nav-item a {
        display: inline-block;
        padding: 6px 14px;
        font-size: 0.9rem;
    }
    .hero-content h1 {
        font-size: 2.2rem;
        letter-spacing: -1px;
        word-wrap: break-word;
    }
    #subtitle {
        font-size: 1.1rem;
    }
    #initial-logo {
        width: 120px;
        top: 37px;
        /*top: 67%;*/
    }
    .section {
        padding: 60px 0;
        /*scroll-margin-top: 130px;*/
    }
    .section-header h2 {
        font-size: 2.2rem;
        word-wrap: break-word;
    }
    .content-grid {
        margin: 0;
        flex-direction: column;
    }
    .card {
        margin: 15px 0;
        width: 100%;
    }
    .card.third-width,
    .card.half-width,
    .card.full-width {
        width: 100%;
    }
    .demo-form-container {
        padding: 25px;
    }
    .demo-form {
        grid-template-columns: 1fr;
    }
    .form-actions {
        grid-column: 1;
    }
}

@media (max-width: 547px) {
    .logo {
        width: auto;
        text-align: left;
    }
}

@media (max-width: 630px) {
    #brain-circuit-wrap {
        width: 110vw;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    background: #111;
    border: 1px solid #222;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-sizing: border-box;
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}
.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
}
.close-btn:hover {
    color: #fff;
}
@media (max-width: 768px) {
    .modal-content {
        padding: 25px;
    }
}
