/* Caspian Nexus — softened slate gradients */

:root {
    --grey-975: #171a21;
    --grey-925: #1e222b;
    --grey-875: #262c38;
    --grey-800: #323848;
    --grey-650: #4f5869;
    --grey-500: #6f7a8c;
    --grey-400: #9ca8b8;
    --grey-300: #ced4dc;
    --grey-150: #e8ebf0;
    --grey-50: #f4f6f9;
    --white: #fafbfc;
    --accent: #5e6a7d;
    --accent-hover: #6f7c90;
    --glow-muted: rgba(120, 140, 170, 0.12);
    --glow-soft: rgba(95, 110, 145, 0.18);
    --border: rgba(255, 255, 255, 0.09);
    --shadow: rgba(0, 0, 0, 0.28);
    --font-sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --sidebar-w: 280px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--grey-300);
    background:
        radial-gradient(ellipse 100% 120% at 0% 0%, var(--glow-soft) 0%, transparent 50%),
        radial-gradient(ellipse 90% 80% at 100% 35%, var(--glow-muted) 0%, transparent 45%),
        linear-gradient(165deg, #1c2029 0%, var(--grey-975) 38%, #14171d 100%);
    -webkit-font-smoothing: antialiased;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* —— Sidebar —— */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 200;
    width: var(--sidebar-w);
    height: 100vh;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 45%),
        linear-gradient(200deg, #232836 0%, var(--grey-925) 42%, var(--grey-975) 100%);
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 24px var(--shadow);
    transform: translateX(0);
    transition: transform 0.3s var(--ease);
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem 1.25rem 1.5rem;
}

.logo-container {
    width: calc(100% + 2.5rem);
    margin: -0.25rem -1.25rem 1.35rem -1.25rem;
    padding: 1.15rem 1.35rem 1.25rem;
    border-radius: 0 0 14px 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 28%),
        linear-gradient(168deg, #f6f8fc 0%, #eef2f9 42%, #ffffff 100%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-top: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        0 16px 36px rgba(15, 18, 28, 0.28),
        0 0 0 1px rgba(0, 0, 0, 0.04);
}

.logo-image {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: 96px;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
    filter: contrast(1.02);
}

.logo-image--compact {
    width: auto;
    max-width: min(300px, calc(100vw - 118px));
    max-height: 68px;
    padding: 0.62rem 0.9rem 0.7rem;
    border-radius: 12px;
    background:
        linear-gradient(168deg, #f6f8fc 0%, #eef2f9 50%, #ffffff 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 6px 20px rgba(15, 18, 28, 0.2);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--grey-400);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    user-select: none;
}

.nav-item:hover,
.nav-item:focus-visible {
    color: var(--grey-150);
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.nav-item.active {
    color: var(--white);
    background: linear-gradient(90deg, rgba(74, 86, 108, 0.35) 0%, transparent 92%);
    border-left: 3px solid var(--grey-500);
    padding-left: calc(0.85rem - 3px);
}

/* —— Mobile header —— */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 150;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: calc(0.3rem + env(safe-area-inset-top, 0px)) 1rem 0.45rem;
    min-height: 0;
    box-sizing: border-box;
    background: linear-gradient(180deg, var(--grey-925) 0%, rgba(26, 30, 38, 0.98) 100%);
    border-bottom: 1px solid var(--border);
}

.mobile-header-logo {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.mobile-header-logo img {
    display: block;
    margin-left: 0;
    margin-right: 0;
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: background 0.2s;
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0 auto;
    background: var(--grey-300);
    border-radius: 1px;
    transition: transform 0.25s var(--ease), opacity 0.2s;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 180;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

.sidebar-backdrop.is-visible {
    display: block;
    opacity: 1;
}

/* —— Main content —— */
.content-stage {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    background:
        radial-gradient(ellipse 130% 85% at 50% -12%, rgba(95, 115, 155, 0.2) 0%, rgba(40, 50, 75, 0.06) 38%, transparent 58%),
        radial-gradient(ellipse 85% 65% at 100% 15%, rgba(55, 72, 108, 0.14) 0%, transparent 48%),
        radial-gradient(ellipse 95% 75% at 0% 90%, rgba(42, 55, 82, 0.13) 0%, transparent 52%),
        radial-gradient(ellipse 70% 55% at 78% 70%, rgba(28, 36, 55, 0.18) 0%, transparent 50%),
        linear-gradient(
            168deg,
            #1e2431 0%,
            #1a1f2c 18%,
            #171b26 36%,
            #151922 55%,
            #13171e 74%,
            #161b24 100%
        );
}

.section {
    display: none;
    min-height: 100vh;
    padding: 3.5rem 3rem 4rem;
    animation: fadeIn 0.45s var(--ease);
}

.section.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.section-content {
    width: 100%;
    max-width: 640px;
}

.home-hero {
    max-width: 720px;
    text-align: center;
}

.hero-title {
    margin: 0 0 0.35rem;
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--white);
}

.hero-subtitle {
    margin: 0 0 1.25rem;
    font-size: clamp(1.1rem, 2.2vw, 1.35rem);
    font-weight: 500;
    color: var(--grey-400);
}

.divider {
    width: 72px;
    height: 3px;
    margin: 0 auto 1.75rem;
    background: linear-gradient(90deg, transparent, var(--grey-400), rgba(120, 130, 150, 0.5), var(--grey-400), transparent);
    border-radius: 2px;
}

.home-hero .divider {
    margin-left: auto;
    margin-right: auto;
}

.divider-contact {
    margin: 2.5rem 0;
}

.hero-description p {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    color: var(--grey-300);
}

.hero-description .subtitle {
    margin-top: 1.25rem;
    font-size: 0.95rem;
    font-style: italic;
    color: var(--grey-400);
}

.section-content h2 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.65rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.02em;
}

.section-content > .subtitle {
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--grey-500);
}

.section-content > p:not(.subtitle) {
    margin: 0;
    font-size: 1.05rem;
    color: var(--grey-300);
}

/* —— Contact address —— */
.contact-address {
    margin: 1.5rem 0 0;
    font-style: normal;
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--grey-300);
}

.contact-address p {
    margin: 0.35rem 0;
}

.contact-company {
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--white);
    margin-bottom: 0.75rem !important;
}

.contact-label {
    display: inline-block;
    min-width: 5.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--grey-500);
    margin-right: 0.5rem;
    vertical-align: top;
}

/* —— Form —— */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--grey-400);
}

.form-group input,
.form-group textarea {
    padding: 0.75rem 0.9rem;
    font: inherit;
    color: var(--grey-150);
    background: var(--grey-925);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--grey-650);
}

.form-group input:hover,
.form-group textarea:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--grey-500);
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.2);
}

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

.form-error-banner {
    margin: 0 0 1.25rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    color: #f0cfc4;
    background: rgba(180, 90, 70, 0.18);
    border: 1px solid rgba(220, 120, 100, 0.28);
}

.form-group-captcha .captcha-question {
    font-weight: 700;
    color: var(--grey-300);
}

.captcha-input {
    max-width: 120px;
}

.contact-form button[type="submit"] {
    margin-top: 0.5rem;
    padding: 0.85rem 1.75rem;
    align-self: flex-start;
    font: inherit;
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--white);
    background: linear-gradient(155deg, #5c6b82 0%, var(--grey-800) 45%, var(--grey-975) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.contact-form button[type="submit"]:hover {
    background: linear-gradient(180deg, var(--accent-hover) 0%, var(--grey-800) 100%);
}

.contact-form button[type="submit"]:active {
    transform: translateY(1px);
}

/* —— Toast —— */
.success-toast {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(10, 11, 13, 0.72);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--ease), visibility 0.35s;
}

.success-toast.is-visible {
    opacity: 1;
    visibility: visible;
}

.success-toast-inner {
    max-width: 400px;
    width: 100%;
    padding: 2rem 1.75rem;
    background: var(--grey-925);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 24px 48px var(--shadow);
    text-align: center;
}

.success-toast-inner p {
    margin: 0 0 0.75rem;
    color: var(--grey-150);
}

.success-toast-btn {
    margin-top: 1rem;
    padding: 0.6rem 1.5rem;
    font: inherit;
    font-weight: 600;
    color: var(--white);
    background: var(--grey-650);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.success-toast-btn:hover {
    background: var(--accent-hover);
}

@media (max-width: 960px) {
    :root {
        --mobile-header-band: 7rem;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .mobile-header {
        display: flex;
    }

    .mobile-header-logo {
        flex: 0 1 auto;
    }

    .hamburger {
        align-self: center;
        flex-shrink: 0;
    }

    .logo-image--compact {
        max-width: min(360px, calc(100vw - 100px));
        max-height: 84px;
        padding: 0.35rem 0.58rem;
    }

    .content-stage {
        margin-left: 0;
        padding-top: calc(var(--mobile-header-band) + env(safe-area-inset-top, 0px));
    }

    .section {
        padding: 2rem 1.25rem 3rem;
        min-height: calc(
            100vh - var(--mobile-header-band) -
                env(safe-area-inset-top, 0px)
        );
    }

    .sidebar-backdrop.is-visible {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .section {
        animation: none;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
