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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    color: #fff;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Navigation */
.top-bar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 20px 40px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-left {
    display: flex;
    gap: 10px;
}

.top-bar p {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 10px;
    border-radius: 8px;
}

.top-bar p:hover {
    cursor: pointer;
    color: #00ffff;
    transform: translateY(-2px);
}

.top-bar p:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #00ffff, #ff00ff);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.top-bar p:hover::after {
    width: 80%;
}

/* Sidebar */
.sidebar {
    position: fixed;
    padding-left: 20px;
    top: 0;
    right: -600px;
    width: 600px;
    height: 100vh;
    background: linear-gradient(180deg, rgba(25, 15, 35, 0.92), rgba(16, 35, 29, 0.92));
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(12, 24, 34, 0.504);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1500;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.sidebar.active {
    right: 0;
}

.sidebar-header {
    font-family: "Troglodyte", Helvetica;
    font-size: 2em;
    font-weight: 400px;
    letter-spacing: 1px;
    padding: 80px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.sidebar-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #00d4ff, #66ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-btn {
    position: absolute;
    top: 30px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.sidebar-content {
    padding: 30px 20px;
    line-height: 1.6;
}

.sidebar-content h3 {
    color: #00d4ff;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.2rem;
}

.sidebar-content p {
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-content .instruction {
    margin-bottom: 30px;
}

.sidebar-content .instruction h3 {
    text-align: left;
}

.sidebar-content .instruction-image {
    width: 100%;
    border-radius: 10px;
    margin-top: 10px;
}

.sidebar-content .instagram {
  margin-top: 10px;
}

.sidebar-content .instagram a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #00ffc3;
  font-family: "Troglodyte", Helvetica;
  font-size: 1.4rem;
  letter-spacing: 2px;
  transition: color 0.3s ease;
}

.sidebar-content .instagram a:hover {
  color: #FBB3F3;
  text-decoration: underline;
}

.sidebar-content .instagram img {
  width: 18px;
  height: 18px;
}

.feature-list {
    list-style: none;
    margin: 20px 0;
}

.feature-list li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: rgba(255, 255, 255, 0.8);
}

.feature-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #00d4ff;
    font-weight: bold;
}

/* Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1400;
}

/* Video Header */
.video-header {
    position: relative;
    width: 100%;
    height: 70vh;
    overflow: hidden;
}

.video-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(0, 255, 255, 0.1) 0%,
        rgba(255, 0, 255, 0.1) 50%,
        rgba(0, 255, 255, 0.1) 100%
    );
    z-index: 2;
    pointer-events: none;
}

.video-header video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7) contrast(1.2);
}

/* Logo */
.center-logo {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    opacity: 0;
    animation: logoReveal 1.2s ease-out forwards;
}

.center-logo h1 {
    font-family: "Troglodyte", Helvetica;
    font-weight: 400;
    background: linear-gradient(90deg,rgb(53, 147, 80) 0%, rgb(138, 248, 169) 50%, rgb(53, 147, 80) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 75px;
    text-align: center;
    letter-spacing: 0;
    line-height: 65px;
}

.center-logo span {
    font-size: 90px;
    background: linear-gradient(90deg,rgb(53, 147, 80) 0%, rgb(138, 248, 169) 50%, rgb(53, 147, 80) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: glitch 0.6s infinite alternate;
} 

.center-logo h1:hover {
    animation: glitch 0.6s infinite alternate;
}

/* Buttons */
.buttons {
    margin: 20px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.create-avater-button {
    margin: 0;
    padding: 14px 24px;
    background: linear-gradient(135deg, #34a7fa, #5ce9ff, #34a7fa);
    color: #000000;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
    text-decoration: none;
    text-align: center;
    letter-spacing: 1px;
    font-family: "Troglodyte", Helvetica;
    font-weight: 500;
    font-size: 24px;
    border-radius: 50px;
    transition: all 0.4s ease;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.3);
    animation: pulse 2s infinite;
}

.create-avater-button:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 255, 255, 0.5);
    background: linear-gradient(135deg, #1890cb, #00ffff);
}

/* Dialogue generation Button */
.dialogue-button {
    margin: 0;
    padding: 14px 24px;
    background: linear-gradient(135deg, #9734fa, #d8b1ff, #8000ff);
    color: #000000;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
    text-decoration: none;
    text-align: center;
    font-family: "Troglodyte", Helvetica;
    font-weight: 500;
    font-size: 24px;
    letter-spacing: 2px;
    border-radius: 50px;
    transition: all 0.4s ease;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.3);
    animation: pulse2 2s infinite;
}

.dialogue-button:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #d8b1ff, #9734fa);
}

@font-face {
    font-family: 'Troglodyte';
    src: url('../fonts/troglodyte.eot'); /* IE 9 Compatibility Mode */
    src: url('../fonts/troglodyte.eot?#iefix') format('embedded-opentype'), /* IE < 9 */
        url('../fonts/troglodyte.woff2') format('woff2'), /* Super Modern Browsers */
        url('../fonts/troglodyte.woff') format('woff'), /* Firefox >= 3.6, any other modern browser */
        url('../fonts/troglodyte.ttf') format('truetype'), /* Safari, Android, iOS */
        url('../fonts/troglodyte.svg#troglodyte') format('svg'); /* Chrome < 4, Legacy iOS */
}

/* Animations */
@keyframes logoReveal {
    from {
        opacity: 0;
        transform: translate(-50%, -70%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -40%);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 5px 10px rgba(0, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 10px 20px rgba(0, 255, 255, 0.6);
    }
}   

@keyframes pulse2 {
    0%, 100% {
        box-shadow: 0 5px 10px rgba(136, 0, 255, 0.3);
    }
    50% {
        box-shadow: 0 10px 20px rgba(136, 0, 255, 0.6);
    }
}

/* Logo glitch effect */
@keyframes glitch {
    10% {
        transform: translate(-2px, -2px) skew(-5deg);
        filter: drop-shadow(-3px 0 #ff00ff);
    }
    20% {
        transform: translate(2px, 2px) skew(5deg);
        filter: drop-shadow(2px 0 #ffff00);
    }
    40% {
        transform: translate(1px, -1px);
        filter: drop-shadow(1px 0 #ff00ff);
    }
}

.fade-out {
    animation: fadeOutPage 0.5s forwards;
}

@keyframes fadeOutPage {
    to {
        opacity: 0;
    }
}

/* Loading Animation */
.video-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 1;
    animation: fadeOut 1s ease-out 0.5s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Glitch Effect for Text */
.center-text p {
    position: relative;
}

.center-text p::before,
.center-text p::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.center-text:hover p::before {
    animation: glitch1 0.3s ease-in-out;
    color: #ff00ff;
    z-index: -1;
}

.center-text:hover p::after {
    animation: glitch2 0.3s ease-in-out;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitch1 {
    0%, 100% { transform: translate(0); opacity: 0; }
    20% { transform: translate(-2px, 2px); opacity: 1; }
    40% { transform: translate(-2px, -2px); opacity: 1; }
    60% { transform: translate(2px, 2px); opacity: 1; }
    80% { transform: translate(2px, -2px); opacity: 1; }
}

@keyframes glitch2 {
    0%, 100% { transform: translate(0); opacity: 0; }
    20% { transform: translate(2px, -2px); opacity: 1; }
    40% { transform: translate(2px, 2px); opacity: 1; }
    60% { transform: translate(-2px, -2px); opacity: 1; }
    80% { transform: translate(-2px, 2px); opacity: 1; }
}

/* ===== УЛУЧШЕННЫЕ МЕДИА-ЗАПРОСЫ ===== */

/* Large tablets and small laptops */
@media (max-width: 1200px) {
    .top-bar {
        padding: 18px 30px;
    }
    
    .center-logo h1 {
        font-size: 65px;
        line-height: 55px;
    }
    
    .center-logo span {
        font-size: 80px;
    }
    
    .create-avater-button,
    .dialogue-button {
        font-size: 24px;
        padding: 12px 20px;
    }
}

/* Tablets */
@media (max-width: 992px) {
    .top-bar {
        padding: 15px 25px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-left, .nav-right {
        gap: 20px;
    }

    .top-bar a {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .video-header {
        height: 65vh;
    }

    .center-logo {
        bottom: 15%;
    }
    
    .center-logo h1 {
        font-size: 55px;
        line-height: 50px;
    }
    
    .center-logo span {
        font-size: 65px;
    }
    
    .buttons {
        margin-top: 20px;
        flex-direction: column;
        gap: 15px;
        width: 90%;
        max-width: 400px;
    }
    
    .create-avater-button,
    .dialogue-button {
        margin: 0;
        width: 100%;
        text-align: center;
        font-size: 24px;
        padding: 12px 20px;
        letter-spacing: 1px;
    }
}

/* Large phones */
@media (max-width: 768px) {
    .top-bar {
        padding: 15px 25px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-left, .nav-right {
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .video-header {
        height: 50vh;
    }

    .center-logo {
        bottom: 20%;
    }
    
    .center-logo h1 {
        font-size: 45px;
        line-height: 40px;
    }
    
    .center-logo span {
        font-size: 55px;
    }
    
    .buttons {
        margin-top: 20px;
        width: 95%;
        gap: 12px;
    }
    
    .create-avater-button,
    .dialogue-button {
        font-size: 16px;
        padding: 10px 18px;
    }
}

/* Phones */
@media (max-width: 576px) {
    .top-bar {
        padding: 10px 15px;
    }
    
    .nav-left, .nav-right {
        gap: 10px;
    }
    
    .top-bar a {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .video-header {
        height: auto;
        max-height: 100vh;
    }

    .video-header video {
        margin-top: 72%;
        width: 100%;
        height: auto;
    }
    
    .center-logo {
        bottom: 10%;
        width: 95%;
    }
    
    .center-logo h1 {
        font-size: 35px;
        line-height: 32px;
    }
    
    .center-logo span {
        font-size: 42px;
    }
    
    .buttons {
        margin-top: 20px;
        width: 95%;
        gap: 10px;
    }
    
    .create-avater-button,
    .dialogue-button {
        font-size: 14px;
        padding: 10px 16px;
        border-radius: 25px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .top-bar {
        padding: 8px 12px;
    }
    
    .nav-left, .nav-right {
        gap: 8px;
    }
    
    .top-bar a {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .video-header {
        height: 40vh;
    }
    
    .center-logo h1 {
        font-size: 28px;
        line-height: 26px;
    }
    
    .center-logo span {
        font-size: 32px;
    }
    
    .create-avater-button,
    .dialogue-button {
        font-size: 12px;
        padding: 8px 14px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .center-logo h1 {
        font-size: 24px;
        line-height: 22px;
    }
    
    .center-logo span {
        font-size: 28px;
    }
    
    .create-avater-button,
    .dialogue-button {
        font-size: 11px;
        padding: 7px 12px;
    }
}

/* Landscape ориентация для телефонов */
@media (max-height: 500px) and (orientation: landscape) {
    .video-header {
        height: 85vh;
    }

    .center-logo {
        bottom: 12%;
    }
    
    .center-logo h1 {
        font-size: 30px;
        line-height: 28px;
    }
    
    .center-logo span {
        font-size: 35px;
    }
    
    .buttons {
        margin-top: 20px;
        flex-direction: row;
        gap: 10px;
    }
    
    .create-avater-button,
    .dialogue-button {
        font-size: 12px;
        padding: 8px 16px;
        width: auto;
    }
}

/* Высокие экраны */
@media (min-height: 900px) {
    .video-header {
        height: 75vh;
    }
    
    .buttons {
        margin-top: 20px;
    }
}

/* Для устройств с высокой плотностью пикселей */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .top-bar a::after {
        height: 1px;
    }
}

/* Улучшения для touch устройств */
@media (hover: none) and (pointer: coarse) {
    .top-bar a:hover,
    .create-avater-button:hover,
    .dialogue-button:hover {
        transform: none;
    }
    
    .top-bar a:active,
    .create-avater-button:active,
    .dialogue-button:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
    
    .center-logo h1:hover {
        animation: none;
    }
    
    /* Увеличение области касания для кнопок */
    .top-bar a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .create-avater-button,
    .dialogue-button {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}