/* =========================================
   1. DESIGN SYSTEM (VARIABLES)
   ========================================= */
:root {
    /* Colors — Apple-style light */
    --bg-color: #f5f5f7;
    --surface-color: #ffffff;
    --text-main: #1d1d1f;
    --text-secondary: #6e6e73;
    --accent-color: #E8792F;
    --accent-soft: rgba(232, 121, 47, 0.12);
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.10);

    /* Typography */
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing & Layout */
    --container-width: 1200px;
    --section-padding: 120px 0;
    --gap-standard: 30px;
    --border-radius: 16px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   2. RESET & BASE STYLES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@media (pointer: fine) {
    * {
        cursor: none;
    }
}

html {
    scroll-behavior: smooth;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

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

/* =========================================
   3. TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

h1 { font-size: clamp(2.75rem, 8vw, 5rem); margin-bottom: 24px; }
h2 { font-size: clamp(2rem, 5vw, 3.25rem); margin-bottom: 40px; }
h3 { font-size: 1.5rem; margin-bottom: 15px; }

p {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 1.15rem;
    line-height: 1.7;
}

.text-subtitle {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
    display: block;
    margin-bottom: 16px;
    font-weight: 600;
}

.text-accent {
    color: var(--accent-color);
    font-weight: 600;
}

/* =========================================
   4. LAYOUT COMPONENTS
   ========================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: var(--section-padding);
}

.vh-100 {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.flex-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Smart Grid */
.grid {
    display: grid;
    gap: var(--gap-standard);
}

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.grid-auto-work {
    grid-template-columns: repeat(3, 1fr);
}

/* =========================================
   5. UI COMPONENTS (Cards, Buttons, Modals)
   ========================================= */

/* Card Base */
.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 0, 0, 0.14);
    box-shadow: var(--shadow-lg);
}

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 980px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    transition: background var(--transition-fast), transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.btn:hover {
    background: #d26a24;
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(232, 121, 47, 0.30);
}

/* Нажатое состояние во время задержки перехода (см. setupDelayedLinks в js/main.js) */
.btn.is-pressed {
    background: var(--accent-color);
    transform: scale(0.97);
    box-shadow: none;
}

/* =========================================
   6. CUSTOM CURSOR
   ========================================= */
/* Скрываем точку совсем, чтобы не перегружать интерфейс */
.cursor-dot {
    display: none;
}

/* Тонкое, изящное кольцо */
.cursor-outline {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(0, 0, 0, 0.35);
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

/* Эффект при наведении: кольцо становится чуть больше и меняет цвет на акцентный */
.cursor-hover {
    transform: translate(-50%, -50%) scale(1.5);
    border-color: var(--accent-color);
    background: var(--accent-soft);
}

/* Навигация: Glassmorphism */
.main-header {
    position: fixed; /* Всегда на виду при скролле */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 900;

    /* Эффект стекла */
    background: rgba(245, 245, 247, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);

    /* Тонкая граница снизу для разделения */
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-smooth);
}

.main-header nav {
    height: 56px; /* Компактная высота в стиле Apple */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-main);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 36px;
}

.nav-links a {
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
    font-weight: 400;
    transition: color var(--transition-fast);
}

/* Состояние при наведении */
.nav-links a:hover {
    color: var(--text-main);
}

/* Состояние активной страницы */
.nav-links a.active {
    color: var(--text-main);
    font-weight: 600;
}

/* =========================================
   7. RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    :root {
        --section-padding: 72px 0;
    }

    h1 { font-size: 2.6rem; }
    h2 { font-size: 2.1rem; }

    .grid-auto {
        grid-template-columns: 1fr;
    }
    .grid-auto-work {
        grid-template-columns: repeat(1, 1fr);
    }
    .nav-links {
        gap: 22px;
    }
    .nav-links a {
        font-size: 0.85rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .footer-class {
        min-height: 100dvh;
        padding: 0;
    }
}
/* Скрываем кастомный курсор на устройствах с сенсорным экраном (touchscreens) */
@media (pointer: coarse) {
    .cursor-outline,
    .cursor-dot {
        display: none !important;
    }
}

/* Visual CTA Section */
.visual-cta {
    padding: 120px 0; /* Твой стандартный отступ */
}

.cta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.cta-card {
    position: relative;
    height: 520px; /* Высота карточки */
    overflow: hidden;
    text-decoration: none;
    display: flex;
    align-items: flex-end; /* Контент прижат к низу */
    border-radius: var(--border-radius);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}

.cta-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 0, 0, 0.14);
    box-shadow: var(--shadow-lg);
}

.cta-card-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform var(--transition-smooth); /* Плавный зум */
    z-index: 1;
}

.cta-card:hover .cta-card-bg {
    transform: scale(1.03); /* Деликатное приближение */
}

.cta-card-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 5%, rgba(0, 0, 0, 0.15) 55%, transparent 85%);
    z-index: 2;
}

.cta-card-content {
    position: relative;
    z-index: 3;
    padding: 40px;
}

.cta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    display: block;
    margin-bottom: 10px;
}

.cta-card h3 {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 10px;
}

.cta-card p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.cta-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
}

.cta-link .arrow {
    transition: transform 0.3s ease;
    display: inline-block;
}

.cta-card:hover .cta-link .arrow {
    transform: translateX(5px); /* Стрелочка чуть едет вправо при наведении */
}

/* Mobile Fix */
@media (max-width: 768px) {
    .visual-cta { padding: 60px 0; }
    .cta-card { height: 380px; }

    /* Начальное состояние элементов (скрыты и чуть ниже) */
    .reveal {
        opacity: 0;
        transform: translateY(32px);
        transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
        will-change: transform, opacity;
    }

    /* Состояние, когда элемент "ожил" */
    .reveal.active {
        opacity: 1;
        transform: translateY(0);
    }

    .cta-card h3 {
        color: #fff;
    }
    .cta-card p {
        color: rgba(255, 255, 255, 0.8);
    }
}

/* --- Work Card Styles --- */
.work-card {
    position: relative;
    background: var(--surface-color);
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}

.work-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 0, 0, 0.14);
    box-shadow: var(--shadow-lg);
}

.card-img-wrapper {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--bg-color);
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}

.work-card:hover .card-img-wrapper img {
    transform: scale(1.04);
}

.card-info {
    padding: 22px;
}

.card-category {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent-color);
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.card-info h3 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--text-main);
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(20, 20, 22, 0.55);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(14px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--surface-color);
    max-width: 90%;
    min-height: 50vh;
    width: 90%;
    max-height: 90dvh;
    position: relative;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 1.75rem;
    line-height: 1;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.modal-body {
    flex: 1;
    display: grid;
    grid-template-columns: 2fr 1fr; /* Два столбца: фото и текст */
    overflow: hidden;
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal-text-container {
    padding: 40px;
}

.modal-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.modal-footer .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-right: 10px;
}

/* Mobile Modal */
@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
    }
    .modal-text-container {
        padding: 24px;
    }
    .modal-content {
        width: 100%;
        max-width: 100%;
    }
}

.modal-image-container {
    position: relative; /* Чтобы кнопки позиционировались относительно контейнера */
}

.modal-nav {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 5;
}

.modal-nav button {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.15rem;
    transition: var(--transition-fast);
}

.modal-nav button:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.experience-timeline {
    position: relative;
    margin: 0 auto;
    padding-left: 30px;
    border-left: 2px solid var(--border-color); /* Тонкая серая линия */
}

.experience-item {
    position: relative;
    margin-bottom: 50px;
}

/* Точка на линии */
.experience-item::before {
    content: '';
    position: absolute;
    left: -37px; /* Центрируем точку на линии */
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
}

.exp-date {
    font-size: 0.85rem;
    color: var(--accent-color);
    letter-spacing: 0.03em;
    margin-bottom: 10px;
    font-weight: 600;
}

.exp-content h3 {
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.exp-company {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.exp-content p {
    font-size: 1rem;
    max-width: 1000px;
    margin-bottom: 1rem;
}
.exp-content strong {
    font-weight: 700;
    color: var(--text-main);
}

/* =========================================
   8. ACCESSIBILITY
   ========================================= */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .cursor-outline {
        display: none !important;
    }
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}
