/* static/css/reels_studio.css */
@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Marck+Script&family=Montserrat:ital,wght@0,600;0,700;0,900;1,900&family=Playfair+Display:ital,wght@1,600;1,700&family=Rubik+Mono+One&family=Unbounded:wght@800;900&display=swap');

:root {
    --brand-primary: #F4A261;
    --brand-script: #7CE8EE;
    --scrim-alpha: 0.72;
    --s: 1; /* В превью и рендере (350x622 @ scale 3.086) = 1 */
}

.stage-1080p {
    --s: 3.085714;
}

/* Глобальный запрет на дырявую обводку в шрифте Unbounded */
* {
    -webkit-text-stroke: 0px transparent !important;
}

.bottom-gradient-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, var(--scrim-alpha)) 0%,
        rgba(0, 0, 0, calc(var(--scrim-alpha) * 0.55)) 28%,
        rgba(0, 0, 0, calc(var(--scrim-alpha) * 0.14)) 48%,
        transparent 65%
    );
}

.beauty-preview-active {
    filter: contrast(1.03) brightness(1.02) saturate(1.05);
}

.grayscale-teaser {
    filter: grayscale(100%) contrast(1.35) brightness(0.9) !important;
}

.teaser-noir-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0,0,0,0.15) 25%, rgba(0,0,0,0.78) 100%);
    pointer-events: none;
    z-index: 15;
}

/* 3D Иконки */
@keyframes floatBehindText {
    0%, 100% { transform: translate(-50%, 0px) scale(1) rotate(-8deg); }
    50% { transform: translate(-50%, calc(-7px * var(--s))) scale(1.06) rotate(4deg); }
}
.icon-behind-hero {
    position: absolute;
    left: 50%;
    top: calc(-34px * var(--s));
    width: calc(72px * var(--s));
    height: calc(72px * var(--s));
    object-fit: contain;
    filter: drop-shadow(0 calc(6px * var(--s)) calc(16px * var(--s)) rgba(0,0,0,0.85)) drop-shadow(0 0 calc(20px * var(--s)) var(--brand-primary));
    opacity: 0.92;
    z-index: 1;
    pointer-events: none;
    animation: floatBehindText 2.8s ease-in-out infinite;
}

@keyframes floatSide3D {
    0%, 100% { transform: translateY(0px) rotate(-5deg) scale(1); }
    50% { transform: translateY(calc(-6px * var(--s))) rotate(6deg) scale(1.07); }
}
.icon-side-3d {
    width: calc(44px * var(--s));
    height: calc(44px * var(--s));
    object-fit: contain;
    filter: drop-shadow(0 0 calc(14px * var(--s)) var(--brand-script)) drop-shadow(0 calc(6px * var(--s)) calc(14px * var(--s)) rgba(0,0,0,0.75));
    animation: floatSide3D 2.3s ease-in-out infinite;
}

/* Анимации текста */
@keyframes neonPulseAnim {
    0%, 100% { text-shadow: 0 0 calc(8px * var(--s)) var(--brand-primary), 0 0 calc(18px * var(--s)) var(--brand-primary), 0 calc(6px * var(--s)) calc(22px * var(--s)) rgba(0,0,0,0.92); transform: scale(1); }
    50% { text-shadow: 0 0 calc(16px * var(--s)) var(--brand-primary), 0 0 calc(32px * var(--s)) var(--brand-primary), 0 0 calc(48px * var(--s)) #ffffff; transform: scale(1.045); }
}
.anim-neon_pulse { animation: neonPulseAnim 1.4s ease-in-out infinite; }

@keyframes gradientFlowAnim {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.anim-gradient_flow {
    background: linear-gradient(270deg, var(--brand-primary), #ffffff, var(--brand-script), var(--brand-primary));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none !important;
    filter: drop-shadow(0 calc(5px * var(--s)) calc(14px * var(--s)) rgba(0,0,0,0.88));
    animation: gradientFlowAnim 3.2s ease infinite;
}

@keyframes glitchAnim {
    0%, 100% { transform: translate(0, 0) skew(0deg); }
    20% { transform: translate(calc(-2px * var(--s)), calc(1px * var(--s))) skew(-4deg); filter: hue-rotate(70deg); }
    40% { transform: translate(calc(2px * var(--s)), calc(-1px * var(--s))) skew(4deg); }
    60% { transform: translate(calc(-2px * var(--s)), calc(-1px * var(--s))); filter: hue-rotate(-70deg); }
    80% { transform: translate(calc(2px * var(--s)), calc(2px * var(--s))); }
}
.anim-glitch { animation: glitchAnim 0.45s steps(2, end) infinite; }

/* Вместо дырявого контура — плотная 3D-ступенька */
.anim-hollow_stroke {
    color: #ffffff !important;
    -webkit-text-stroke: 0px transparent !important;
    text-shadow: 0 calc(3px * var(--s)) 0 var(--brand-primary), 0 calc(10px * var(--s)) calc(24px * var(--s)) rgba(0, 0, 0, 0.85) !important;
}

.anim-glass_pill {
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(calc(12px * var(--s)));
    border: calc(1.5px * var(--s)) solid rgba(255, 255, 255, 0.38);
    padding: calc(4px * var(--s)) calc(16px * var(--s));
    border-radius: 999px;
    color: #ffffff !important;
    box-shadow: 0 calc(8px * var(--s)) calc(24px * var(--s)) rgba(0, 0, 0, 0.55), inset 0 0 calc(16px * var(--s)) rgba(242, 193, 78, 0.28);
}

/* Стартовый Хук-Тизер */
.ref-title-script {
    font-family: 'Great Vibes', 'Marck Script', cursive;
    color: var(--brand-script);
    font-size: calc(38px * var(--s));
    line-height: 0.82;
    transform: rotate(-4deg) translateY(calc(7px * var(--s)));
    text-shadow: 0 calc(4px * var(--s)) calc(16px * var(--s)) rgba(0,0,0,0.85);
    position: relative;
    z-index: 3;
}
.ref-title-main-1 {
    font-family: 'Unbounded', 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: calc(30px * var(--s));
    line-height: 1.0;
    color: #ffffff;
    text-transform: uppercase;
    text-shadow: 0 calc(8px * var(--s)) calc(24px * var(--s)) rgba(0,0,0,0.85);
    position: relative;
    z-index: 2;
}
.ref-title-main-2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: calc(24px * var(--s));
    line-height: 1.05;
    color: var(--brand-primary);
    text-transform: uppercase;
    text-shadow: 0 calc(8px * var(--s)) calc(24px * var(--s)) rgba(0,0,0,0.85);
    position: relative;
    z-index: 2;
}

/* 3 этажа кинетической типографики */
#kinetic-rig {
    position: absolute;
    left: calc(22px * var(--s));
    right: calc(54px * var(--s));
    bottom: calc(108px * var(--s));
    z-index: 35;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    pointer-events: none;
}

.tier-top-small {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: calc(13px * var(--s));
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 calc(3px * var(--s)) calc(12px * var(--s)) rgba(0,0,0,0.9);
    margin-bottom: calc(2px * var(--s));
    position: relative;
    z-index: 3;
}
.tier-hero-bold {
    font-family: 'Unbounded', 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: calc(25px * var(--s));
    line-height: 1.04;
    letter-spacing: -0.02em;
    color: var(--brand-primary);
    text-transform: uppercase;
    text-shadow: 0 calc(6px * var(--s)) calc(22px * var(--s)) rgba(0,0,0,0.92);
    position: relative;
    z-index: 2;
}
.tier-bottom-script {
    font-family: 'Great Vibes', 'Marck Script', cursive;
    font-weight: 400;
    font-size: calc(35px * var(--s));
    line-height: 0.78;
    color: var(--brand-script);
    margin-top: calc(-4px * var(--s));
    transform: rotate(-3deg) translateX(calc(6px * var(--s)));
    text-shadow: 0 calc(4px * var(--s)) calc(16px * var(--s)) rgba(0,0,0,0.95);
    position: relative;
    z-index: 4;
}
.tier-bottom-clean {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: calc(12.5px * var(--s));
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.01em;
    text-shadow: 0 calc(4px * var(--s)) calc(16px * var(--s)) rgba(0, 0, 0, 0.9);
    margin-top: calc(3px * var(--s));
    position: relative;
    z-index: 4;
}

/* ИСПРАВЛЕНО: Монолитный мягкий водяной знак на фоне без дырявых контуров */
.watermark-outline-bg {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -54%);
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: calc(64px * var(--s));
    color: rgba(244, 162, 97, 0.16);
    text-shadow: 0 0 calc(24px * var(--s)) rgba(244, 162, 97, 0.25);
    pointer-events: none;
    z-index: 1;
    letter-spacing: 0.04em;
    white-space: nowrap;
    user-select: none;
}

/* Темы оформления */
.theme-capcut .tier-hero-bold {
    background: var(--brand-primary);
    color: #000000;
    padding: calc(2px * var(--s)) calc(10px * var(--s));
    border-radius: calc(7px * var(--s));
    text-shadow: none;
}
.theme-viral .tier-hero-bold {
    font-family: 'Montserrat', sans-serif;
    font-style: italic;
    color: #00ffcc;
    text-shadow: calc(-2px * var(--s)) calc(-2px * var(--s)) 0 #000, calc(2px * var(--s)) calc(-2px * var(--s)) 0 #000, calc(-2px * var(--s)) calc(2px * var(--s)) 0 #000, calc(2px * var(--s)) calc(2px * var(--s)) 0 #000;
}
.theme-glass #unified-phrase-box {
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(calc(12px * var(--s)));
    border: calc(1px * var(--s)) solid rgba(255, 255, 255, 0.18);
    border-radius: calc(18px * var(--s));
    padding: calc(8px * var(--s)) calc(16px * var(--s));
}

/* Полноэкранные сцены — дорогой студийный темный фон */
.cinematic-fullscreen-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 45;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(36px * var(--s)) calc(24px * var(--s));
    background: radial-gradient(circle at 50% 35%, #1c2230 0%, #090b10 92%);
    box-shadow: inset 0 0 calc(65px * var(--s)) rgba(0,0,0,0.65);
}

.thought-bubble-card {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(calc(20px * var(--s)));
    border: calc(2px * var(--s)) solid rgba(255, 255, 255, 0.9);
    border-radius: calc(24px * var(--s));
    padding: calc(22px * var(--s)) calc(20px * var(--s));
    width: 100%;
    max-width: calc(295px * var(--s));
    box-shadow: 0 calc(24px * var(--s)) calc(55px * var(--s)) rgba(0,0,0,0.6), 0 0 calc(35px * var(--s)) rgba(244, 162, 97, 0.35);
    position: relative;
}
.thought-bubble-card::after {
    content: '';
    position: absolute;
    bottom: calc(-12px * var(--s));
    left: calc(36px * var(--s));
    width: calc(24px * var(--s));
    height: calc(24px * var(--s));
    background: rgba(255, 255, 255, 0.96);
    transform: rotate(45deg);
    border-bottom: calc(2px * var(--s)) solid rgba(255, 255, 255, 0.9);
    border-right: calc(2px * var(--s)) solid rgba(255, 255, 255, 0.9);
}

.bar-3d-pillar {
    position: relative;
    background: linear-gradient(180deg, var(--brand-primary) 0%, rgba(244, 162, 97, 0.25) 100%);
    border: calc(1.5px * var(--s)) solid rgba(255,255,255,0.28);
    box-shadow: 0 calc(12px * var(--s)) calc(32px * var(--s)) rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
}
