/* ============================================
   MAIN.CSS — Дизайн-система Светланы Рогозинской
   ============================================ */

/* === RESET === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto; /* Lenis handles smooth scroll */
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    color: var(--text-primary);
    background-color: var(--bg-dark);
    line-height: 1.7;
    overflow-x: hidden;
    cursor: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: none;
}

button {
    cursor: none;
    border: none;
    background: none;
    font-family: inherit;
    color: inherit;
}

ul, ol {
    list-style: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    cursor: none;
}

/* === CSS VARIABLES === */
:root {
    /* Colors */
    --primary-red: #8B0000;
    --primary-red-light: #B22222;
    --primary-red-dark: #5C0000;
    --accent-gold: #D4AF37;
    --accent-gold-light: #F0D060;
    --accent-gold-dark: #B8860B;
    --bg-dark: #0A0A0F;
    --bg-dark-2: #0F0F18;
    --bg-card: #1A1020;
    --bg-card-hover: #241530;
    --text-primary: #F5F0E8;
    --text-secondary: #B0A8A0;
    --text-muted: #6A6060;
    --border-subtle: rgba(212, 175, 55, 0.15);
    --border-active: rgba(212, 175, 55, 0.4);

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #8B0000 0%, #4A0E0E 50%, #1A0020 100%);
    --gradient-gold: linear-gradient(135deg, #D4AF37, #B8860B);
    --gradient-card: linear-gradient(180deg, rgba(26, 16, 32, 0.8), rgba(10, 10, 15, 0.95));
    --gradient-overlay: linear-gradient(180deg, transparent 0%, rgba(10, 10, 15, 0.7) 50%, var(--bg-dark) 100%);
    --gradient-red-glow: radial-gradient(ellipse at center, rgba(139, 0, 0, 0.3) 0%, transparent 70%);

    /* Shadows & Glows */
    --glow-gold: 0 0 30px rgba(212, 175, 55, 0.3);
    --glow-gold-strong: 0 0 60px rgba(212, 175, 55, 0.5);
    --glow-red: 0 0 40px rgba(139, 0, 0, 0.4);
    --glow-red-strong: 0 0 80px rgba(139, 0, 0, 0.6);
    --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-elevated: 0 40px 80px rgba(0, 0, 0, 0.7);

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-accent: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;

    /* Spacing */
    --section-padding: clamp(60px, 10vw, 120px);
    --container-width: 1200px;
    --container-padding: clamp(20px, 5vw, 60px);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-slow: 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Z-index layers */
    --z-cursor: 10000;
    --z-navigation: 1000;
    --z-overlay: 900;
    --z-modal: 800;
    --z-content: 10;
    --z-background: 1;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 1px;
}

h1 {
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 900;
    letter-spacing: 3px;
}

h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 2px;
}

h3 {
    font-size: clamp(1.4rem, 3vw, 2rem);
}

h4 {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
}

.accent-text {
    font-family: var(--font-accent);
    font-size: 1.1rem;
    font-weight: 300;
    font-style: italic;
    letter-spacing: 1px;
}

.gold-text {
    color: var(--accent-gold);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.red-text {
    color: var(--primary-red-light);
    text-shadow: 0 0 20px rgba(178, 34, 34, 0.4);
}

/* === LAYOUT === */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.container--wide {
    max-width: 1400px;
}

.container--narrow {
    max-width: 800px;
}

section {
    padding: var(--section-padding) 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: clamp(40px, 6vw, 80px);
}

.section-header h2 {
    margin-bottom: 16px;
}

.section-header .subtitle {
    font-family: var(--font-accent);
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-secondary);
    font-style: italic;
}

.section-divider {
    width: 60px;
    height: 2px;
    background: var(--gradient-gold);
    margin: 24px auto;
    border-radius: 2px;
}

/* Grid system */
.grid {
    display: grid;
    gap: clamp(20px, 3vw, 40px);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* Flex utilities */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-column { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: 12px; }
.gap-md { gap: 24px; }
.gap-lg { gap: 40px; }

/* === FULLSCREEN SECTION === */
.fullscreen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* === SELECTION === */
::selection {
    background: var(--primary-red);
    color: var(--text-primary);
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-red-light);
}

/* === PAGE TRANSITION OVERLAY === */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
}

.page-transition.active {
    pointer-events: all;
}

.page-transition .star-loader {
    width: 60px;
    height: 60px;
    opacity: 0;
}

/* === LOADING SCREEN === */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-screen .logo-loader {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 8px;
    animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: brightness(1); opacity: 0.7; }
    50% { filter: brightness(1.3); opacity: 1; }
}

.loading-screen .loading-bar {
    width: 120px;
    height: 2px;
    background: rgba(212, 175, 55, 0.2);
    margin-top: 30px;
    border-radius: 2px;
    overflow: hidden;
}

.loading-screen .loading-bar-fill {
    height: 100%;
    background: var(--gradient-gold);
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    body { cursor: auto; }
    a, button, input, textarea, select { cursor: auto; }

    .grid--2,
    .grid--3,
    .grid--4 { grid-template-columns: 1fr; }

    .desktop-only { display: none !important; }
}

@media (max-width: 480px) {
    :root {
        --container-padding: 16px;
    }
}

/* === VISIBILITY HELPERS === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mobile-only { display: none; }

@media (max-width: 768px) {
    .mobile-only { display: block; }
}

/* === ANIMATION UTILITY CLASSES === */
.reveal {
    opacity: 0;
    transform: translateY(60px);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
}

/* Parallax container */
.parallax-container {
    overflow: hidden;
    position: relative;
}

.parallax-bg {
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 140%;
    object-fit: cover;
}
