/* Shared UI styles for Atlantis static pages */

/* Animated background */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    --orb-opacity: 0.6;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    isolation: isolate;
}

.animated-background::before,
.animated-background::after,
.animated-background > .blur-orb {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: var(--orb-opacity, 0.6);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

body:not(.effects-ready) .animated-background::before,
body:not(.effects-ready) .animated-background::after,
body:not(.effects-ready) .animated-background > .blur-orb {
    opacity: 0;
}

body:not(.effects-ready) .nav,
body:not(.effects-ready) .mobile-drawer,
body:not(.effects-ready) .mobile-drawer-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.effects-ready .animated-background::before,
body.effects-ready .animated-background::after,
body.effects-ready .animated-background > .blur-orb {
    animation: orbFadeIn 1.2s ease-out;
}

.animated-background::before {
    width: 600px;
    height: 600px;
    background: rgba(52, 120, 247, 0.25);
    top: var(--bg-blue-y, 20%);
    left: var(--bg-blue-x, 50%);
    transform: translate(-50%, -50%) translateZ(0);
}

.animated-background::after {
    width: 500px;
    height: 500px;
    background: rgba(88, 86, 214, 0.15);
    top: var(--bg-purple-y, 10%);
    right: calc(100% - var(--bg-purple-x, 80%) - 250px);
}

.blur-orb {
    width: 400px;
    height: 400px;
    background: rgba(255, 55, 95, 0.12);
    bottom: 20%;
    left: 15%;
}

@keyframes orbFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: var(--orb-opacity, 0.6);
    }
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 max(env(safe-area-inset-right), 22px);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #f5f5f7;
    font-size: 21px;
    font-weight: 600;
    outline: none;
}

.nav-brand:focus,
.nav-brand:active {
    outline: none;
}

.nav-brand img {
    width: 24px;
    height: 24px;
}

.nav-brand-text {
    background: linear-gradient(45deg,
        var(--atlantis-primary, #3478f7) 0%,
        var(--atlantis-secondary, #5856D6) 50%,
        var(--atlantis-accent, #FF375F) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(52, 120, 247, 0.3);
    animation: gradientGlow 3s ease-in-out infinite alternate;
}

@keyframes gradientGlow {
    0% {
        filter: brightness(1) drop-shadow(0 0 5px rgba(52, 120, 247, 0.3));
    }
    100% {
        filter: brightness(1.2) drop-shadow(0 0 15px rgba(52, 120, 247, 0.6));
    }
}

.nav-brand-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    font-style: italic;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-left: auto;
    margin-right: 16px;
}

.nav-links a {
    color: rgba(245, 245, 247, 0.8);
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
    outline: none;
}

.nav-links a:hover {
    color: #ffffff;
    transform: scale(1.1);
}

.nav-links a.active {
    color: #3478f7;
}

.nav-cta {
    background: #3478f7;
    color: white;
    padding: 6px 14px;
    border-radius: 18px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s, opacity 0.2s, transform 0.2s;
}

.nav-cta:hover {
    background: #2968e6;
}

.nav-cta--sticky {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.nav-cta--sticky.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #f5f5f7;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    outline: none;
    order: -1;
    margin-right: 16px;
    margin-left: -10px;
}

.menu-toggle:focus,
.menu-toggle:active {
    outline: none;
    border: none;
}

.mobile-drawer-overlay {
    position: fixed;
    top: 44px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 998;
}

.mobile-drawer-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer {
    position: fixed;
    top: 44px;
    left: -250px;
    width: 250px;
    height: calc(100vh - 44px);
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    transition: left 0.3s ease;
    z-index: 999;
    padding: 20px;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.mobile-drawer.open {
    left: 0;
}

.mobile-drawer a {
    display: block;
    color: rgba(245, 245, 247, 0.8);
    text-decoration: none;
    font-size: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    outline: none;
}

.mobile-drawer a.active {
    color: #3478f7;
}

.mobile-drawer a:hover {
    color: #ffffff;
}

/* Footer */
.footer {
    padding: 60px 20px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.5);
}

.footer-content {
    max-width: 980px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 40px;
}

.footer-brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(45deg,
        var(--atlantis-primary, #3478f7) 0%,
        var(--atlantis-secondary, #5856D6) 50%,
        var(--atlantis-accent, #FF375F) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(52, 120, 247, 0.3);
    animation: gradientGlow 3s ease-in-out infinite alternate;
}

.footer-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: rgba(245, 245, 247, 0.6);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(245, 245, 247, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    outline: none;
}

.footer-links a:hover {
    color: #3478f7;
}

.footer-bottom {
    max-width: 980px;
    margin: 0 auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-legal {
    font-size: 12px;
    color: rgba(245, 245, 247, 0.4);
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-links a {
    color: rgba(245, 245, 247, 0.5);
    transition: color 0.2s;
}

.social-links a:hover {
    color: #3478f7;
}

@media (max-width: 768px) {
    .animated-background {
        --orb-opacity: 0.8;
    }

    .animated-background::before,
    .animated-background::after,
    .blur-orb {
        filter: blur(55px);
    }

    .animated-background::before {
        width: 280px;
        height: 280px;
        background: rgba(52, 120, 247, 0.35);
    }

    .animated-background::after {
        width: 220px;
        height: 220px;
        background: rgba(88, 86, 214, 0.25);
    }

    .blur-orb {
        width: 180px;
        height: 180px;
        background: rgba(255, 55, 95, 0.22);
    }

    .nav {
        padding: 0 22px;
    }

    .nav-brand {
        margin-right: auto;
    }

    .nav-links {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .nav-cta {
        display: inline-block;
        order: 2;
        margin-right: -10px;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 12px;
    }

    .footer-brand {
        display: none;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* Contact modal */
body.contact-modal-open {
    overflow: hidden;
}

.contact-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(44px + 48px) 20px 48px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 2000;
}

.contact-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.contact-modal {
    width: min(720px, 100%);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 28px 28px 22px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateY(10px) scale(0.98);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    max-height: calc(100vh - 44px - 80px);
    overflow: auto;
}

.contact-modal-overlay.is-open .contact-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.contact-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.contact-modal-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #f5f5f7;
}

.contact-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(245, 245, 247, 0.8);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.contact-modal-close:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.24);
    transform: scale(1.02);
}

.contact-modal-close:active {
    transform: scale(0.98);
}

.contact-modal-subtitle {
    margin: 0 0 18px 0;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(245, 245, 247, 0.7);
}

.contact-modal-form {
    display: grid;
    gap: 14px;
}

.contact-modal-field {
    display: grid;
    gap: 8px;
}

.contact-modal-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(245, 245, 247, 0.9);
}

.contact-modal-input,
.contact-modal-textarea {
    width: 100%;
    padding: 14px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #f5f5f7;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.contact-modal-textarea {
    resize: vertical;
    min-height: 140px;
}

.contact-modal-input:focus,
.contact-modal-textarea:focus {
    outline: none;
    border-color: rgba(52, 120, 247, 0.7);
    background: rgba(52, 120, 247, 0.1);
}

.contact-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
}

.contact-modal-status {
    min-height: 18px;
    font-size: 13px;
    color: rgba(245, 245, 247, 0.65);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.contact-modal-status.is-error {
    color: rgba(255, 55, 95, 0.9);
}

.contact-modal-status.is-success {
    color: rgba(52, 199, 89, 0.95);
}

.contact-modal-status-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: none;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20fill='black'%20d='M20.285%206.709a1%201%200%200%201%200%201.414l-9.192%209.192a1%201%200%200%201-1.414%200L3.715%2011.35a1%201%200%201%201%201.414-1.414l4.121%204.12%208.485-8.484a1%201%200%200%201%201.414%200z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20fill='black'%20d='M20.285%206.709a1%201%200%200%201%200%201.414l-9.192%209.192a1%201%200%200%201-1.414%200L3.715%2011.35a1%201%200%201%201%201.414-1.414l4.121%204.12%208.485-8.484a1%201%200%200%201%201.414%200z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.contact-modal-status.is-success .contact-modal-status-icon {
    display: inline-block;
}

.contact-modal-status-text:empty {
    display: none;
}

.contact-modal-send {
    width: 100%;
    border-radius: 999px;
    padding: 12px 18px;
    border: 1px solid rgba(52, 120, 247, 0.45);
    background: rgba(52, 120, 247, 0.18);
    color: rgba(245, 245, 247, 0.95);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.contact-modal-send:hover {
    transform: translateY(-1px);
    background: rgba(52, 120, 247, 0.26);
    border-color: rgba(52, 120, 247, 0.6);
}

.contact-modal-send:active {
    transform: translateY(0);
}

.contact-modal-send[disabled] {
    opacity: 0.55;
    cursor: default;
    transform: none;
}

@media (max-width: 520px) {
    .contact-modal-overlay {
        padding: calc(44px + 32px) 16px 32px;
    }

    .contact-modal {
        padding: 22px 18px 18px;
        border-radius: 18px;
    }

    .contact-modal-title {
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contact-modal-overlay,
    .contact-modal {
        transition: none;
    }
}
