:root {
    --void: #000000;
    --text: #e0ddd5;
    --whisper: #888888;
    --dim: #2a2a2a;
    --font: 'Cormorant Garamond', 'Georgia', serif;
}

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

html, body {
    height: 100%;
}

body {
    background: var(--void);
    color: var(--text);
    font-family: var(--font);
    overflow: hidden;
    cursor: crosshair;
    -webkit-font-smoothing: antialiased;
}

/* ─── Холст-поверхность ─── */
#surface {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* ─── Контейнер глубины ─── */
.depth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    perspective: 800px;
}

/* ─── Общий слой ─── */
.layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: scale(0.85) translateZ(-150px);
    transition:
        opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1),
        transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    will-change: transform, opacity;
}

.layer.active {
    opacity: 1;
    transform: scale(1) translateZ(0);
    pointer-events: auto;
}

.layer.behind {
    opacity: 0;
    transform: scale(1.15) translateZ(100px);
    pointer-events: none;
}

.layer__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* ─── Заголовок ─── */
.title {
    font-size: clamp(52px, 11vw, 140px);
    font-weight: 300;
    letter-spacing: 0.35em;
    text-transform: lowercase;
    line-height: 1;
    color: var(--text);
    /* Reveal-анимация при загрузке */
    animation: titleReveal 2.5s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.title .char {
    display: inline-block;
    animation: breathe 6s ease-in-out infinite;
    animation-delay: var(--d);
}

@keyframes breathe {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(-2.5px);
        opacity: 0.65;
    }
}

@keyframes titleReveal {
    from {
        opacity: 0;
        transform: translateY(40px);
        filter: blur(12px);
        letter-spacing: 0.6em;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
        letter-spacing: 0.35em;
    }
}

/* ─── Шёпот (подзаголовок) ─── */
.whisper {
    font-size: clamp(13px, 1.8vw, 18px);
    font-weight: 300;
    font-style: italic;
    color: var(--whisper);
    letter-spacing: 0.18em;
    animation: whisperReveal 2s ease 1.2s both;
}

@keyframes whisperReveal {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Подсказка скролла ─── */
.scroll-hint {
    position: absolute;
    bottom: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    animation: hintAppear 1s ease 3.5s forwards;
    transition: opacity 0.6s ease;
}

.scroll-hint span {
    font-size: 10px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--whisper);
}

.scroll-hint__line {
    width: 1px;
    height: 36px;
    background: linear-gradient(to bottom, var(--whisper), transparent);
    animation: linePulse 2.5s ease-in-out infinite;
}

@keyframes hintAppear {
    to { opacity: 1; }
}

@keyframes linePulse {
    0%, 100% {
        transform: scaleY(1);
        opacity: 0.4;
    }
    50% {
        transform: scaleY(1.6);
        opacity: 0.8;
    }
}

/* ─── Слой 1: Ссылки ─── */
.links {
    display: flex;
    align-items: center;
    gap: 36px;
    margin-bottom: 50px;
}

.links a {
    color: var(--whisper);
    text-decoration: none;
    font-size: 17px;
    font-weight: 300;
    letter-spacing: 0.25em;
    text-transform: lowercase;
    position: relative;
    transition: color 0.6s ease;
    padding-bottom: 3px;
}

.links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.links a:hover {
    color: var(--text);
}

.links a:hover::after {
    width: 100%;
}

.links__dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--whisper);
    opacity: 0.7;
}

/* ─── Календарь коммитов (custom render) ─── */
.contributions {
    display: flex;
    gap: 3px;
    opacity: 0.85;
    transition: opacity 0.6s ease;
    max-width: 90vw;
    overflow: hidden;
    padding: 4px 0;
}

.contributions:hover {
    opacity: 1;
}

.contrib-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.contrib-cell {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contrib-cell:hover {
    transform: scale(1.6);
}

.contrib-cell.l0 { background: rgba(255, 255, 255, 0.04); }
.contrib-cell.l1 { background: rgba(78, 204, 163, 0.18); }
.contrib-cell.l2 { background: rgba(78, 204, 163, 0.38); }
.contrib-cell.l3 { background: rgba(78, 204, 163, 0.6); }
.contrib-cell.l4 {
    background: rgba(78, 204, 163, 0.85);
    box-shadow: 0 0 6px rgba(78, 204, 163, 0.3);
}

/* ─── Мобильная адаптация ─── */
@media (max-width: 768px) {
    body {
        cursor: default;
    }

    .title {
        letter-spacing: 0.2em;
    }

    @keyframes titleReveal {
        from {
            opacity: 0;
            transform: translateY(30px);
            filter: blur(8px);
            letter-spacing: 0.4em;
        }
        to {
            opacity: 1;
            transform: translateY(0);
            filter: blur(0);
            letter-spacing: 0.2em;
        }
    }

    .links {
        flex-direction: column;
        gap: 24px;
    }

    .links__dot {
        display: none;
    }

    .scroll-hint {
        bottom: 30px;
    }
}
