.presentation-main {
    position: relative;
    z-index: 1;
    height: calc(100vh - var(--nav-h) - 1px);
}

.presentation-main.presentation-mode-gallery {
    height: auto;
    min-height: calc(100vh - var(--nav-h) - 1px);
    padding: 0 !important;
    margin: 0 !important;
}

/* ===== GALLERY MODE ===== */
.presentation-gallery {
    width: 100%;
    margin: 0;
    padding: 0;
}

.presentation-slide {
    width: 100%;
    line-height: 0; /* убираем зазор под img */
    background: #080a16;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.presentation-slide.loaded,
.presentation-slide:first-child {
    opacity: 1;
}

.presentation-slide-img {
    display: block;
    width: 100%;
    height: auto;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

/* Плейсхолдер пока картинка не загрузилась */
.presentation-slide-img.lazy {
    background: linear-gradient(90deg, #0d1020 25%, #141828 50%, #0d1020 75%);
    background-size: 200% 100%;
    animation: slide-shimmer 1.5s infinite;
    min-height: 56.25vw; /* 16:9 aspect ratio placeholder */
    max-height: 720px;
}

@keyframes slide-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.presentation-embed {
    width: 100%;
    height: 100%;
    position: relative;
}

.presentation-embed iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
}

.presentation-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-soft);
}

/* ---- Floating download button ---- */
.presentation-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 200;

    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px 12px 16px;
    max-width: 260px;

    background: linear-gradient(135deg, rgba(8,10,22,0.92) 0%, rgba(12,17,37,0.96) 100%);
    border-radius: 40px;
    text-decoration: none;
    color: var(--text);

    box-shadow:
            0 0 0 1px rgba(29,207,237,0.35),
            0 8px 32px rgba(0,0,0,0.5),
            0 0 24px rgba(29,207,237,0.08);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    transition: box-shadow .3s ease, transform .3s ease;
    animation: fab-float 3.5s ease-in-out infinite;
}

.presentation-fab:hover {
    color: var(--text);
    box-shadow:
            0 0 0 1px rgba(29,207,237,0.7),
            0 12px 40px rgba(0,0,0,0.6),
            0 0 40px rgba(29,207,237,0.18);
    animation-play-state: paused;
    transform: translateY(-4px);
}

.presentation-fab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(29,207,237,0.12);
    border: 1px solid rgba(29,207,237,0.3);
    color: var(--accent);
    flex-shrink: 0;
    transition: background .3s, border-color .3s;
}

.presentation-fab:hover .presentation-fab-icon {
    background: rgba(29,207,237,0.22);
    border-color: rgba(29,207,237,0.6);
}

.presentation-fab-label {
    font-size: 13px;
    line-height: 1.3;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[dir="rtl"] .presentation-fab {
    right: auto;
    left: 32px;
}

@keyframes fab-float {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}

@media (max-width: 600px) {
    .presentation-fab {
        bottom: 20px;
        right: 16px;
        max-width: calc(100vw - 32px);
    }
    [dir="rtl"] .presentation-fab {
        right: auto;
        left: 16px;
    }
}

/* ---- Preloader ---- */
.presentation-preloader {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(50% 50% at 50% 50%, #0C1125 0%, #080A16 100%);
    transition: opacity .6s ease, visibility .6s ease;
}

.presentation-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.preloader-bars {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 40px;
}

.preloader-bars span {
    display: block;
    width: 6px;
    height: 8px;
    border-radius: 3px;
    background: var(--accent);
    animation: bar-wave 1.2s ease-in-out infinite;
}

.preloader-bars span:nth-child(1) { animation-delay: 0s;    opacity: .4; }
.preloader-bars span:nth-child(2) { animation-delay: .15s;  opacity: .6; }
.preloader-bars span:nth-child(3) { animation-delay: .3s;   opacity: 1;  }
.preloader-bars span:nth-child(4) { animation-delay: .45s;  opacity: .6; }
.preloader-bars span:nth-child(5) { animation-delay: .6s;   opacity: .4; }

.preloader-text {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    font-family: 'Montserrat', sans-serif;
}

@keyframes bar-wave {
    0%, 100% { height: 8px;  opacity: .3; }
    50%       { height: 36px; opacity: 1;  }
}

/* Footer not needed on full-screen presentation */
.page-template-page-presentation .site-footer { display: none; }

/* Hide cursor glow ring on presentation pages */
.page-template-page-presentation #cursor-ring { display: none; }

/* ---- Email gate modal ---- */
.pres-gate-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pres-gate-overlay.open {
    opacity: 1;
}

.pres-gate-overlay.is-closing {
    opacity: 0;
}

.pres-gate-box {
    background: #0a0d1a;
    border-radius: 20px;
    width: 480px;
    max-width: 100%;
    padding: 48px 56px 52px;
    position: relative;
    isolation: isolate;
    transform: translateY(0);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.pres-gate-overlay.is-closing .pres-gate-box {
    transform: translateY(16px);
    opacity: 0;
}

/* Static gradient border */
.pres-gate-box::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(rgba(29,207,237,0.28) 0%, rgba(29,207,237,0) 100%), rgba(29,207,237,0.10);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

/* Spinning light border */
@property --pres-gate-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

@keyframes pres-gate-spin {
    to { --pres-gate-angle: 360deg; }
}

.pres-gate-box::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(
        from var(--pres-gate-angle),
        transparent 0%, transparent 28%,
        rgba(29,207,237,0.12) 33%, rgba(29,207,237,0.42) 36%,
        rgba(29,207,237,0.95) 39%, rgba(2,146,182,0.98) 43%,
        rgba(2,146,182,0.38) 46%, rgba(2,146,182,0.12) 49%,
        transparent 54%, transparent 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: .88;
    filter: drop-shadow(0 0 4px rgba(29,207,237,0.28)) drop-shadow(0 0 10px rgba(29,207,237,0.18));
    animation: pres-gate-spin 10s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.pres-gate-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #f8f9fa;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: color 0.2s;
    z-index: 2;
}

.pres-gate-close:hover { color: #1dcfed; }

.pres-gate-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: #f8f9fa;
    margin: 0 0 8px;
    line-height: 1.3;
    position: relative;
    z-index: 2;
}

.pres-gate-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
    margin: 0 0 32px;
    line-height: 1.5;
    position: relative;
    z-index: 2;
}

/* CF7 form inside modal */
.pres-gate-cf7 {
    position: relative;
    z-index: 2;
}

.pres-gate-cf7 .wpcf7 {
    width: 100%;
}

/* CF7 form inside modal */
.pres-gate-cf7 {
    position: relative;
    z-index: 2;
}

.pres-gate-cf7 .wpcf7 {
    width: 100%;
}

/* Strip <p> wrapping from CF7 — layout via .cf7-field */
.pres-gate-cf7 .wpcf7-form p {
    margin: 0;
    padding: 0;
    border: none;
}

/* .cf7-field — same as contacts */
.pres-gate-cf7 .cf7-field {
    display: flex;
    flex-direction: column;
    padding: 0 0 16px;
    border-bottom: 1px solid #9a9a9a;
    margin-bottom: 16px;
    position: relative;
}

.pres-gate-cf7 .cf7-field:focus-within {
    border-color: #1dcfed;
}

/* Label + star */
.pres-gate-cf7 .cf7-field-label {
    font-family: 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 24px;
    color: #9a9a9a;
    padding-top: 14px;
    pointer-events: none;
    user-select: none;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    transition: opacity 0.15s;
}

.pres-gate-cf7 .cf7-required-star {
    color: #ff4444;
    font-size: 12px;
    vertical-align: super;
    margin-left: 1px;
}

/* CF7 span wrapper */
.pres-gate-cf7 .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

/* Input reset */
.pres-gate-cf7 input[type="email"] {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    font-family: 'Segoe UI', sans-serif !important;
    font-size: 16px !important;
    line-height: 24px !important;
    color: #f8f9fa !important;
    padding: 14px 0 4px !important;
    width: 100% !important;
    display: block !important;
    -webkit-appearance: none !important;
}

.pres-gate-cf7 input[type="email"]::placeholder {
    color: #9a9a9a !important;
    opacity: 1 !important;
}

.pres-gate-cf7 input:-webkit-autofill,
.pres-gate-cf7 input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px #0a0d1a inset !important;
    -webkit-text-fill-color: #f8f9fa !important;
}

/* Submit */
.pres-gate-cf7 input[type="submit"] {
    display: block !important;
    width: 100% !important;
    margin-top: 8px !important;
    background: #10162a !important;
    border: 1px solid rgba(192, 212, 237, 0.85) !important;
    border-radius: 10px !important;
    padding: 14px 24px !important;
    font-family: 'Segoe UI', sans-serif !important;
    font-size: 15px !important;
    line-height: 24px !important;
    color: #f8f9fa !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    cursor: pointer !important;
    transition: background 0.2s, border-color 0.2s !important;
    position: relative !important;
}

.pres-gate-cf7 input[type="submit"]:hover {
    background: #1a2240 !important;
    border-color: rgba(29,207,237,0.6) !important;
}

.pres-gate-cf7 input[type="submit"]:disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    border-color: rgba(192, 212, 237, 0.3) !important;
}

.pres-gate-cf7 input[type="submit"].is-loading {
    cursor: default !important;
    border-color: rgba(29,207,237,0.4) !important;
    color: transparent !important;
    background-image: none !important;
}

/* Спиннер поверх кнопки через соседний псевдоэлемент — вставляем через обёртку */
.pres-gate-cf7 .wpcf7-submit-wrap {
    position: relative;
}

.pres-gate-submit-spinner {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.pres-gate-submit-spinner.visible { display: flex; }

.pres-gate-submit-spinner::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid rgba(29,207,237,0.3);
    border-top-color: #1dcfed;
    border-radius: 50%;
    animation: pres-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.pres-gate-submit-spinner::after {
    content: 'Starting download...';
    color: #f8f9fa;
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
    letter-spacing: 0.05em;
    margin-left: 10px;
    text-transform: none;
}

.pres-gate-submit-spinner--email::after {
    content: 'Sending email...';
}

@keyframes pres-spin {
    to { transform: rotate(360deg); }
}

/* Validation */
.pres-gate-cf7 .wpcf7-not-valid-tip {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.pres-gate-cf7 .wpcf7-response-output {
    font-size: 13px;
    padding: 8px 10px;
    margin: 12px 0 0;
    border-radius: 6px;
    border: none !important;
}

.pres-gate-cf7 .wpcf7-response-output[aria-hidden="true"] { display: none; }

.pres-gate-cf7 .wpcf7-spinner { display: none; }

@media (max-width: 600px) {
    .pres-gate-box {
        padding: 44px 24px 36px;
        border-radius: 14px;
    }
}

/* ---- Agree row inside presentation gate ---- */
.pres-agree-row {
    margin: 16px 0 0;
    padding: 0;
}

/* ---- Success state inside gate modal ---- */
.pres-gate-success {
    text-align: center;
    padding: 16px 0 8px;
    position: relative;
    z-index: 2;
}

.pres-gate-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.pres-gate-success-icon svg {
    filter: drop-shadow(0 0 12px rgba(29, 207, 237, 0.4));
}

.pres-gate-success-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #f8f9fa;
    margin: 0 0 28px;
}

.pres-gate-success-close {
    background: #10162a;
    border: 1px solid rgba(192, 212, 237, 0.85);
    border-radius: 10px;
    padding: 12px 48px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 24px;
    color: #f8f9fa;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.pres-gate-success-close:hover {
    background: #1a2240;
    border-color: rgba(29, 207, 237, 0.6);
}

/* ---- Terms Modal (reused from contacts) for presentation page ---- */
#presTermsModal {
    z-index: 400;
}
