* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-black: #000000;
    --primary-white: #ffffff;
    --accent-red: #DC2626;
    --accent-blue: #2563EB;
    --dark-gray: #111111;
    --light-gray: #999999;
    --text-gray: #cccccc;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--primary-white);
    overflow-x: hidden;
    background: #0a0a0a;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Prevent horizontal scroll */
html {
    overflow-x: hidden;
    width: 100%;
}

/* Animated gradient background */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0f1f 25%, #0f0f2a 50%, #1f0f1a 75%, #0a0a0a 100%);
    z-index: -2;
}

.gradient-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.gradient-overlay::before,
.gradient-overlay::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
    max-width: 100vw;
}

.gradient-overlay::before {
    width: 800px;
    height: 800px;
    background: var(--accent-blue);
    top: -200px;
    left: -200px;
}

.gradient-overlay::after {
    width: 600px;
    height: 600px;
    background: var(--accent-red);
    bottom: -100px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -50px) scale(1.1); }
    50% { transform: translate(-30px, 30px) scale(0.9); }
    75% { transform: translate(30px, 50px) scale(1.05); }
}

/* Grid pattern overlay */
.grid-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 39px,
        rgba(255, 255, 255, 0.03) 39px,
        rgba(255, 255, 255, 0.03) 40px
    ),
    repeating-linear-gradient(
        90deg,
        transparent,
        transparent 39px,
        rgba(255, 255, 255, 0.03) 39px,
        rgba(255, 255, 255, 0.03) 40px
    );
    z-index: -1;
}

/* Neural Network Canvas */
#neural-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    max-width: 100vw;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 4rem 2rem 2rem 2rem;
    position: relative;
    background: rgba(0, 0, 0, 0.6);
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
}

.hero-image {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-image img {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    filter: contrast(1.1);
}

.hero-image::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% + 40px);
    max-width: 440px;
    height: calc(100% - 60px);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
    pointer-events: none;
}

.hero-caption {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-gray);
    font-style: italic;
    width: 100%;
    max-width: 400px;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

.hero-content .counter {
    font-size: 1.5rem;
    color: var(--accent-red);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease 0.2s forwards;
}

.hero-content .bio {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 1s ease 0.4s forwards;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease 0.6s forwards;
    width: 100%;
}

.cta-button {
    padding: 1rem 2rem;
    border: 2px solid var(--primary-white);
    background: transparent;
    color: var(--primary-white);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex: 1;
    text-align: center;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-red));
    z-index: -1;
    opacity: 0;
    animation: fadeInGradient 1s ease 1.2s forwards;
}

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

.cta-button:hover {
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(37, 99, 235, 0.3);
}

.contact-emails {
    margin-top: 3rem;
    display: flex;
    gap: 3rem;
    justify-content: center;
    opacity: 0;
    animation: fadeInUp 1s ease 0.8s forwards;
}

.email-item {
    position: relative;
    text-align: center;
}

.email-item a {
    color: var(--primary-white);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
    padding-bottom: 15px;
}

.email-item a:hover {
    color: var(--accent-blue);
    transform: translateY(-2px);
}

.email-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-red));
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* About Section */
.about {
    padding: 5rem 2rem;
    background: rgba(17, 17, 17, 0.8);
    position: relative;
}

/* Hide mobile image by default */
.mobile-image {
    display: none !important;
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.section-title span {
    position: relative;
    display: inline-block;
}

.section-title span::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-red));
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    height: 400px;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.about-image img.active {
    opacity: 1;
}

.about-image:hover img {
    transform: none;
}

.about-text {
    font-size: 1.1rem;
    color: var(--text-gray);
    line-height: 1.8;
}

.about-text h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-white);
}

.about-text p {
    margin-bottom: 1rem;
}

/* Authority Logos */
.authority-logos {
    padding: 2rem;
    background: rgba(10, 10, 10, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.logos-container {
    display: flex;
    align-items: center;
    gap: 3rem;
    animation: scrollLogos 30s linear infinite;
    width: fit-content;
}

.logos-container:hover {
    animation-play-state: paused;
}

@keyframes scrollLogos {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.logo-item {
    padding: 1rem 2rem;
    background: rgba(51, 51, 51, 0.5);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    filter: grayscale(100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    flex-shrink: 0;
    min-width: 200px;
}

.logo-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.logo-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.3) 0%, transparent 70%);
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.logo-item:hover {
    filter: grayscale(0%);
    transform: translateY(-5px);
    border-color: var(--accent-blue);
}

.logo-item:hover::before {
    width: 100%;
    height: 100%;
}

/* Services Section */
.services {
    padding: 5rem 2rem;
    background: rgba(0, 0, 0, 0.7);
    position: relative;
}

.services-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.service-card {
    background: rgba(26, 26, 26, 0.8);
    padding: 3rem;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card.primary {
    border: 2px solid var(--accent-red);
}

.service-card.secondary {
    border: 2px solid var(--accent-blue);
}

.service-card.tertiary {
    border: 2px solid transparent;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.8) 0%, rgba(26, 26, 26, 0.8) 100%), 
                linear-gradient(135deg, var(--accent-red) 0%, var(--accent-blue) 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.service-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    transform: rotate(45deg);
    transition: all 0.5s ease;
    opacity: 0;
}

.service-card:hover::before {
    opacity: 1;
    transform: rotate(45deg) translate(20%, 20%);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-gray);
    line-height: 1.6;
}

.sub-services {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.sub-service-card {
    background: rgba(26, 26, 26, 0.6);
    padding: 2rem;
    border: 1px solid rgba(102, 102, 102, 0.5);
    border-radius: 5px;
    text-align: center;
    transition: all 0.3s ease;
}

.sub-service-card:hover {
    border-color: var(--primary-white);
    background: rgba(26, 26, 26, 0.9);
}

/* Publications Section */
.publications {
    padding: 5rem 2rem;
    background: rgba(0, 0, 0, 0.6);
    position: relative;
}

.publications-grid {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.publication-card {
    background: rgba(26, 26, 26, 0.8);
    border-radius: 10px;
    padding: 2rem;
    border: 1px solid rgba(102, 102, 102, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.publication-cover {
    width: 100%;
    height: 300px;
    background: #333;
    border-radius: 5px;
    margin-bottom: 1rem;
    opacity: 0.9;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--light-gray);
    overflow: hidden;
}

.publication-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #1a1a1a;
}

.publication-card:hover .publication-cover {
    opacity: 1;
}

.publication-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.publication-author {
    color: var(--light-gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.publication-card .read-more {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.publication-card:hover .read-more {
    color: var(--accent-red);
    transform: translateX(5px);
}

/* Speaking Timeline */
.speaking {
    padding: 5rem 2rem;
    background: rgba(0, 0, 0, 0.5);
    position: relative;
    min-height: auto;
    overflow: hidden;
}

.speaking-container {
    max-width: 1200px;
    margin: 0 auto;
}

.events-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 2rem 0;
}

.events-track {
    display: flex;
    gap: 1.5rem;
    padding: 0 1.5rem;
    margin-bottom: 1.5rem;
}

.events-track.left-to-right {
    animation: scrollLeft 50s linear infinite;
}

.events-track.right-to-left {
    animation: scrollRight 50s linear infinite;
}

.events-track:hover {
    animation-play-state: paused;
}

@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
}
}

@keyframes scrollRight {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

.event-card {
    background: rgba(26, 26, 26, 0.8);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 350px;
    flex-shrink: 0;
}

.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-blue), var(--accent-red));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.event-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.event-card:hover::before {
    opacity: 1;
}

.event-date {
    color: var(--accent-blue);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.event-name {
    color: var(--primary-white);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.event-location {
    color: var(--light-gray);
    font-size: 0.9rem;
}

.events-grid-static {
    display: none;
}

/* Show static grid on mobile */
@media (max-width: 768px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0 1rem;
    }

    .cta-button {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        text-align: center;
        padding: 1rem !important;
        font-size: 1rem !important;
    }

    #chase-intro .about-content {
        grid-template-columns: 1fr;
    }

    #chase-intro .hero-image {
        margin: 0 auto 2rem auto;
    }

    /* Show mobile meet contact button */
    .mobile-meet-contact-btn {
        display: inline-block !important;
    }

    /* Style the meet line on mobile */
    .meet-line {
        display: flex !important;
    }

    /* Remove the block display from meet-text on mobile */
    #chase-intro h2 .meet-text {
        display: inline !important;
        margin-bottom: 0 !important;
    }

    /* Make CHASE HARDY fit on one line on mobile */
    #chase-intro h2 span[style*="color: var(--accent-blue)"] {
        font-size: 2.2rem !important;
    }

    /* Remove flexbox from body to fix positioning issues */
    body {
        display: block !important;
        position: relative;
    }

    /* Use CSS Grid for reordering instead */
    #chase-intro { order: -2; }
    .hero { order: -1; }

    /* Move Meet Chase Hardy to top using absolute positioning */
    #chase-intro {
        position: relative;
    }

    /* Use JavaScript for reordering on mobile */

    /* Make hero section less crowded on mobile */
    .hero {
        padding: 5rem 1rem 2rem 1rem;
    }

    .hero-content h1 {
        font-size: 1.8rem !important;
        margin-bottom: 1rem !important;
    }

    .hero-content > p:first-of-type {
        font-size: 1.1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .hero-content > div[style*="display: grid"] {
        margin: 2rem 0 !important;
        gap: 1.5rem !important;
    }

    .hero-content > div[style*="display: grid"] > div {
        padding: 1.5rem 1rem !important;
    }

    .hero-content > div[style*="display: grid"] > div h3 {
        font-size: 1.8rem !important;
    }

    .hero-content > div[style*="display: grid"] > div p {
        font-size: 0.9rem !important;
    }

    .hero-content h2 {
        font-size: 1.3rem !important;
        margin: 1.5rem 0 1rem !important;
    }

    .hero-content .cta-buttons {
        margin-top: 1.5rem !important;
    }

    .hero-content > p:last-child {
        font-size: 0.85rem !important;
        margin-top: 1rem !important;
    }

    /* Meet Chase Hardy mobile layout */
    #chase-intro {
        padding-top: 3rem !important; /* Add space at top when first */
    }

    #chase-intro .about-content {
        display: block;
    }

    #chase-intro h2 span {
        display: block;
    }

    #chase-intro h2 {
        line-height: 1.2;
    }

    #chase-intro h2 .meet-text {
        display: block;
        margin-bottom: 0.2rem;
    }

    /* Show mobile image, hide desktop image */
    #chase-intro .mobile-image {
        display: block !important;
    }

    #chase-intro .desktop-image {
        display: none !important;
    }

    /* Fix stat boxes on mobile */
    #chase-intro .about-text > div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    #chase-intro .about-text > div[style*="display: flex"] > div {
        flex: none !important;
        width: 100% !important;
        padding: 1.2rem !important;
        min-height: 100px;
    }

    /* Prevent overflow on all sections */
    section {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .logos-container {
        padding: 0 1rem;
        gap: 1rem;
        animation-duration: 20s;
    }

    .logo-item {
        padding: 0.75rem 1rem;
        min-width: 150px;
        height: 60px;
    }

    .about-content {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }

    .about-text {
        padding: 0;
    }

    .services-container,
    .publications-container,
    .speaking-container,
    .tech-guide-container {
        padding: 0 1rem;
    }

    .services-grid,
    .sub-services {
        grid-template-columns: 1fr;
    }

    .publications-grid {
        grid-template-columns: 1fr;
        padding: 0;
    }

    .events-carousel {
        display: none;
    }

    .events-grid-static {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-height: 600px;
        overflow-y: auto;
        padding: 1rem;
    }

    .events-grid-static::-webkit-scrollbar {
        width: 6px;
    }

    .events-grid-static::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
    }

    .events-grid-static::-webkit-scrollbar-thumb {
        background: var(--accent-blue);
        border-radius: 3px;
    }

    .event-card {
        min-width: 280px;
        max-width: 90vw;
    }

    .about-image {
        height: 300px;
    }

    .footer-content {
        padding: 0 1rem;
    }

    .footer-button {
        width: 100%;
        max-width: 300px;
    }

    /* Ensure neural canvas doesn't cause overflow */
    #neural-canvas {
        max-width: 100vw;
    }

    /* Fix gradient overlays */
    .gradient-overlay::before,
    .gradient-overlay::after {
        max-width: 100vw;
    }

    /* Tech guide mobile adjustments */
    .tech-card.wide > div[style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .tech-card.wide span[style*="font-size: 1.5rem"] {
        display: none;
    }
}

/* Footer */
footer {
    padding: 4rem 2rem;
    background: rgba(17, 17, 17, 0.85);
    text-align: center;
    position: relative;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-cta {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.footer-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.footer-button {
    padding: 1rem 2rem;
    text-decoration: none;
    color: var(--primary-white);
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-white);
    background: transparent;
    position: relative;
    overflow: hidden;
}

.footer-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-red));
    z-index: -1;
    opacity: 0;
    animation: fadeInGradient 1s ease 0.5s forwards;
}

.footer-button.red {
    background: transparent;
}

.footer-button.blue {
    background: transparent;
}

.footer-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(37, 99, 235, 0.3);
    border-color: transparent;
}

.footer-info {
    color: var(--light-gray);
    font-size: 0.9rem;
}

/* Tech Guide Section */
.tech-guide {
    padding: 5rem 2rem;
    background: rgba(0, 0, 0, 0.7);
    position: relative;
}

.tech-guide-container {
    max-width: 1200px;
    margin: 0 auto;
}

.tech-recommendations {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.tech-card {
    background: rgba(26, 26, 26, 0.8);
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    width: 100%;
    cursor: pointer;
}

a.tech-card {
    text-decoration: none;
    color: inherit;
}

.tech-card.wide {
    /* No special styling needed since all cards are full width */
}

.tech-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: rgba(26, 26, 26, 0.95);
}

.tech-card img {
    filter: brightness(0.9);
    transition: filter 0.3s ease;
}

.tech-card:hover img {
    filter: brightness(1.1);
}

.tech-card.wide a[href*="lexisnexis"]:hover,
.tech-card.wide a[href*="westlaw"]:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.tech-card h3 {
    color: var(--primary-white);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.tech-model {
    color: var(--accent-blue);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.tech-use {
    color: var(--text-gray);
    line-height: 1.6;
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    backdrop-filter: blur(5px);
    box-sizing: border-box;
}

.modal-overlay.show {
    display: flex;
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 2px solid var(--primary-white);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
}

.modal-close::before,
.modal-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: var(--primary-white);
}

.modal-close::before {
    transform: rotate(45deg);
}

.modal-close::after {
    transform: rotate(-45deg);
}

.modal-close:hover {
    transform: rotate(90deg);
    border-color: var(--accent-red);
}

.modal-close:hover::before,
.modal-close:hover::after {
    background: var(--accent-red);
}

/* Form Container in Modal */
.form-container {
    max-width: min(600px, 90vw);
    width: 100%;
    background: rgba(26, 26, 26, 0.95);
    border-radius: 10px;
    padding: 2rem;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: modalFadeIn 0.5s ease forwards;
    max-height: calc(100vh - 2rem);
    margin: 1rem auto;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.form-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    transform: rotate(45deg);
    transition: all 0.5s ease;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

.form-container:hover::before {
    opacity: 1;
    transform: rotate(45deg) translate(10%, 10%);
}

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.form-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.form-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-red));
}

.form-subtitle {
    color: var(--text-gray);
    margin-top: 1.5rem;
    font-size: 1.1rem;
}

/* Form Fields */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-white);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: var(--primary-white);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Glowing border effect */
.form-input:focus,
.form-textarea:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.5);
    border-image: linear-gradient(90deg, var(--accent-red), var(--accent-blue)) 1;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

/* Initial glow on first input */
.form-input.initial-glow {
    background: rgba(0, 0, 0, 0.5);
    border-image: linear-gradient(90deg, var(--accent-red), var(--accent-blue)) 1;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.2);
}

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

/* Submit Button */
.form-submit {
    width: 100%;
    padding: 1.2rem 2rem;
    border: 2px solid var(--primary-white);
    background: transparent;
    color: var(--primary-white);
    border-radius: 5px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 2rem;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-red));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-submit:hover::before {
    opacity: 1;
}

.form-submit:hover {
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(37, 99, 235, 0.3);
}

/* Loading State */
.form-submit.loading {
    color: transparent;
    pointer-events: none;
}

.form-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid var(--primary-white);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s ease infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Success Message */
.success-message {
    display: none;
    text-align: center;
    padding: 1.5rem;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid var(--accent-blue);
    border-radius: 5px;
    margin-top: 1.5rem;
    animation: fadeInUp 0.5s ease;
}

.success-message.show {
    display: block;
}

/* Mobile Modal Adjustments */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 1rem;
        width: 100vw;
        height: 100vh;
        box-sizing: border-box;
    }

    .form-container {
        padding: 1.5rem;
        margin: 0.5rem auto;
        max-height: calc(100vh - 1rem);
        overflow-y: auto;
        overflow-x: hidden;
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
        border-radius: 8px;
        position: relative;
    }

    /* Hide the decorative before element on mobile */
    .form-container::before {
        display: none;
    }

    .form-header {
        margin-bottom: 1.5rem;
    }

    .form-title {
        font-size: 1.5rem;
        word-wrap: break-word;
    }

    .form-subtitle {
        font-size: 1rem;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-input,
    .form-textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem;
        width: 100%;
        max-width: 100%;
    }

    .form-textarea {
        min-height: 100px;
    }

    .form-submit {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        margin-top: 1.5rem;
    }

    .modal-close {
        top: 0.75rem;
        right: 0.75rem;
        position: fixed;
        width: 35px;
        height: 35px;
    }

    /* Prevent horizontal scroll */
    body.modal-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        max-width: 100% !important;
        touch-action: none;
    }

    /* Additional prevention for iOS */
    html.modal-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }

    /* Ensure form elements don't cause overflow */
    .modal-overlay * {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Fix for the disclaimer text */
    .form-container p {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Additional zoom-friendly adjustments */
@media (max-width: 480px), (max-height: 600px) {
    .modal-overlay {
        padding: 0.25rem;
        align-items: flex-start;
        padding-top: 0.5rem;
    }

    .form-container {
        padding: 1rem;
        margin: 0.25rem auto;
        max-height: calc(100vh - 0.5rem);
        width: calc(100vw - 0.5rem);
        max-width: calc(100vw - 0.5rem);
        border-radius: 6px;
    }

    .form-title {
        font-size: 1.25rem;
    }

    .form-subtitle {
        font-size: 0.9rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-input,
    .form-textarea {
        padding: 0.75rem;
        font-size: 16px;
    }

    .form-textarea {
        min-height: 80px;
    }

    .form-submit {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
        margin-top: 1rem;
    }

    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 30px;
        height: 30px;
    }

    .modal-close::before,
    .modal-close::after {
        width: 16px;
    }
}

/* Extra compact for very high zoom levels */
@media (max-width: 360px), (max-height: 480px) {
    .form-container {
        padding: 0.75rem;
        margin: 0.125rem auto;
        max-height: calc(100vh - 0.25rem);
        width: calc(100vw - 0.25rem);
        max-width: calc(100vw - 0.25rem);
    }

    .form-header {
        margin-bottom: 1rem;
    }

    .form-title {
        font-size: 1.125rem;
    }

    .form-subtitle {
        font-size: 0.875rem;
    }

    .form-group {
        margin-bottom: 0.875rem;
    }

    .form-input,
    .form-textarea {
        padding: 0.625rem;
    }

    .form-textarea {
        min-height: 70px;
    }
}