/* =========================================
   OSTROV — global chrome (header, navigation, modal, buttons)

   Ported from the pre-WordPress main.css. Design tokens now live in
   theme.json and are aliased in tokens.css, which must load first.
   ========================================= */

/* Site Header (Glassmorphism) */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease, border 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1440px;
    margin: 0 auto;
}

/* Logo */
.header-logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.1em;
    text-shadow: 0 0 10px rgba(var(--color-accent-rgb), 0.5);
}

.header-logo:hover {
    color: var(--color-accent);
}

/* Desktop Navigation */
.main-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--color-accent);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Right Actions Area */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.4rem 0.8rem;
}

.lang-link {
    font-family: var(--font-main);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 0.15rem 0.3rem;
}

.lang-link:hover {
    color: #fff;
}

.lang-link.active {
    color: var(--color-accent);
}

.lang-divider {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    font-weight: 500;
    user-select: none;
}


/* Mobile Toggle (Hamburger) */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 101;
}

.mobile-toggle span {
    width: 100%;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s linear;
    transform-origin: 1px;
}

/* Mobile Toggle Animation State */
.mobile-toggle.is-active span:nth-child(1) {
    transform: rotate(45deg);
}
.mobile-toggle.is-active span:nth-child(2) {
    opacity: 0;
}
.mobile-toggle.is-active span:nth-child(3) {
    transform: rotate(-45deg);
}

/* Mobile Navigation Panel */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 99;
}

.mobile-nav.is-open {
    opacity: 1;
    visibility: visible;
}

.mobile-link {
    font-size: 2rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    text-shadow: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.mobile-link:hover,
.mobile-link.active {
    color: #fff;
    text-shadow: 0 0 15px var(--color-accent);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: var(--font-main);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    background-color: #050505;
    /* Fallback */
}

/* Sticky scroll styles moved to bottom of file */

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.1;
    font-weight: 800;
    /* ExtraBold */
    margin-bottom: 1rem;
    text-transform: uppercase;
}

p,
li,
a {
    font-size: 1rem;
    font-weight: 500;
}

a {
    color: var(--color-text-main);
    text-decoration: none;
    transition: var(--transition-base);
}

/* Primary Button Style */
.btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: rgba(var(--color-accent-rgb), 0.2);
    border: 1px solid var(--color-accent);
    border-radius: 12px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 15px rgba(var(--color-accent-rgb), 0.2);
    transition: all 0.3s ease;
}

.btn-primary:focus {
    outline: none;
}

.btn-primary:hover {
    background: var(--color-accent);
    color: #fff;
    box-shadow: 0 0 25px rgba(var(--color-accent-rgb), 0.6);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 0 10px rgba(var(--color-accent-rgb), 0.4);
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-container);
}

/* Scroll-reveal animations (driven by assets/js/reveal.js) */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

/* Add this class via JS to trigger animations */
.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

/* Desktop navigation collapses into the hamburger */
@media (max-width: 1100px) {
    .main-nav {
        gap: 1.2rem;
    }

    .nav-link {
        font-size: 0.8rem;
    }
}

@media (max-width: 1024px) {
    .main-nav {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }
}

/* =========================================
   Contact Form Popup (Modal)
   ========================================= */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    padding: 3rem 2.5rem;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.popup-overlay.is-active .popup-content {
    transform: translateY(0) scale(1);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s ease;
}

.popup-close:hover {
    color: #fff;
}

.popup-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #fff;
    text-align: center;
}

.popup-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
    text-align: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    width: 100%;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    color: #fff;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: border-color 0.3s ease, background 0.3s ease;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    background: rgba(255, 255, 255, 0.1);
}

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

.form-submit {
    width: 100%;
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.form-status {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 20px;
}

.status-success {
    color: #4CAF50;
}

.status-error {
    color: #F44336;
}

/* Arithmetic anti-spam field */
.form-captcha-label {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.form-captcha-question {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--color-text-main);
    letter-spacing: 0.05em;
}

.form-captcha .form-input {
    max-width: 8rem;
}

/*
 * Spam honeypot: a field people never see but bots fill in anyway.
 *
 * Moved off-screen rather than hidden with display:none or the hidden
 * attribute — the crawlers worth catching skip fields hidden that obviously.
 * It stays out of the tab order via tabindex="-1" and out of screen readers
 * via aria-hidden on the wrapper.
 */
.ostrov-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Same treatment for labels that exist only for assistive technology. */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Floating Contact Button */
.floating-contact-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 15px rgba(var(--color-accent-rgb), 0.4), 0 0 20px rgba(var(--color-accent-rgb), 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 999; /* Выше всего контента, но под попапом */
    transition: all 0.3s ease;
    animation: float-pulse 2s infinite ease-in-out;
}

.floating-contact-btn:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 6px 20px rgba(var(--color-accent-rgb), 0.6), 0 0 30px rgba(var(--color-accent-rgb), 0.4);
    animation: none; /* Отключаем пульсацию при наведении */
}

.floating-contact-btn svg {
    width: 32px;
    height: 32px;
    transition: transform 0.3s ease;
}

.floating-contact-btn:hover svg {
    transform: scale(1.1);
}

/* Анимация пульсации для привлечения внимания */
@keyframes float-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--color-accent-rgb), 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(var(--color-accent-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--color-accent-rgb), 0);
    }
}

/* Адаптив для телефонов */
@media (max-width: 768px) {
    .header-container {
        gap: 1rem;
    }
    .header-actions {
        margin-left: auto;
    }

    .header-logo {
        font-size: 1.1rem;
    }

    .floating-contact-btn {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
    .floating-contact-btn svg {
        width: 26px;
        height: 26px;
    }
}
