:root {
    --bg: #fdfcf9;
    --text-primary: #1a1a1a;
    --text-secondary: #6b6b6b;
    --accent: #000000;
    
    --gap-xl: 180px;
    --gap-lg: 100px;
    --gap-md: 60px;
    
    --font-display: 'Rubik', sans-serif;
    --font-body: 'Rubik', sans-serif;
}

/* --- Base & Texture --- */

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

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Grainy Paper Texture Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('https://www.transparenttextures.com/patterns/paper-fibers.png');
    opacity: 0.15;
    pointer-events: none;
    z-index: 9999;
}

/* --- Hero --- */

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0;
}

.hero-avatar {
    width: clamp(300px, 50vw, 600px);
    height: auto;
    object-fit: contain;
    margin-bottom: clamp(80px, 10vw, 120px); /* Significantly increased gap */
    margin-top: 0;
    /* Mask: Solid at top, fades on sides and bottom */
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%), 
                        linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%), 
                linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
    filter: saturate(0.9);
    transition: all 0.8s ease;
}

.hero-avatar:hover {
    filter: saturate(1.1);
}

.hero-quote {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 500;
    font-style: italic;
    line-height: 1.4;
    text-align: center;
    max-width: 30ch;
    margin: 0 auto;
    color: var(--text-primary);
}

.highlight {
    color: var(--text-primary);
    display: inline-block;
    font-size: 2em;
    font-weight: 800;
    font-style: normal;
    line-height: 1.1;
    margin-bottom: 0.4em; /* Increased gap below "Я вижу" */
    letter-spacing: -0.04em;
    position: relative;
}

#starsCanvas {
    position: absolute;
    top: -50%;
    left: -10%;
    width: 120%;
    height: 200%;
    z-index: -1;
    pointer-events: none;
}

.highlight-text {
    position: relative;
    z-index: 2;
}

.hero-signature-img {
    height: clamp(100px, 12vw, 160px);
    width: auto;
    margin-top: 40px;
    opacity: 0.9;
    mix-blend-mode: multiply; /* Ensures it blends well with paper texture */
    transition: opacity 0.3s ease;
}

.hero-signature-img:hover {
    opacity: 1;
}

/* --- Project List (Vertical Gallery) --- */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.projects-section {
    padding-bottom: var(--gap-xl);
}

.section-label {
    padding: 140px 0 100px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.section-label::before,
.section-label::after {
    content: "";
    height: 1px;
    width: 60px;
    background: rgba(0,0,0,0.1);
}

.project-item {
    display: flex;
    align-items: center;
    gap: 8vw;
    margin-bottom: var(--gap-xl);
}

.project-item:nth-child(even) {
    flex-direction: row-reverse;
}

.project-info {
    flex: 1;
}

.project-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--text-secondary);
    margin-bottom: 20px;
    display: block;
}

.project-name {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 0.9;
    margin-bottom: 30px;
}

.project-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 40ch;
    line-height: 1.6;
}

.project-visual {
    flex: 1.2;
    aspect-ratio: 16/10;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.08);
}

.project-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    transition: all 0.8s ease;
}

.project-item:hover img {
    filter: grayscale(0);
    transform: scale(1.02);
}

/* --- Reveal --- */

[data-reveal] {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Footer --- */

.footer {
    background: #000;
    color: #fff;
    padding: 140px 0 80px;
    text-align: center;
}

.footer-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 15vw, 12rem);
    margin-bottom: 40px;
    letter-spacing: -0.05em;
}

.footer a {
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid #fff;
    padding-bottom: 2px;
}

.serif-italic {
    font-family: var(--font-serif);
    font-style: italic;
}

@media (max-width: 900px) {
    .project-item, .project-item:nth-child(even) {
        flex-direction: column;
        align-items: flex-start;
        gap: 40px;
        margin-bottom: var(--gap-lg);
    }
    .project-visual {
        width: 100%;
        order: -1;
    }
    /* Mobile scroll-active state */
    .project-item.is-active .project-visual img {
        filter: grayscale(0);
        transform: scale(1.02);
    }
}
