:root {
    --color-text-primary: #333333;
    --color-text-secondary: #000000;
    --color-text-muted: #888888;
    --color-accent: #ffbe98;
    --color-white: #ffffff;
    --color-bg-body: #ffffff;
    --color-bg-light: #f5f5f5;
    --color-bg-surface: #ffffff;
    --color-border: rgba(0, 0, 0, 0.1);
    --color-header-shadow: rgba(0, 0, 0, 0.05);

    /* Updated fonts to Jost (similar to Century Gothic, full Cyrillic support) */
    --font-heading: 'Jost', 'Century Gothic', sans-serif;
    --font-body: 'Jost', 'Century Gothic', sans-serif;

    --container-width: 1200px;
    --padding-section: 80px;
    /* Increased from 60px for better whitespace */
}

body.dark-mode {
    --color-text-primary: #e0e0e0;
    --color-text-secondary: #ffffff;
    --color-text-muted: #a0a0a0;
    --color-white: #121212;
    --color-bg-body: #121212;
    --color-bg-light: #1e1e1e;
    --color-bg-surface: #1e1e1e;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-header-shadow: rgba(0, 0, 0, 0.3);
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-primary);
    line-height: 1.6;
    background-color: var(--color-bg-body);
    -webkit-font-smoothing: antialiased;
    letter-spacing: normal;
}

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

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: normal;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

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

.section__title {
    font-family: var(--font-heading);
    font-size: 36px;
    /* Slightly increased */
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.05em;
    /* Cleaner scaling */
    margin-bottom: 60px;
    font-weight: 400;
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn--outline {
    background: transparent;
    border-color: var(--color-text-primary);
    color: var(--color-text-primary);
}

.btn--outline:hover {
    background-color: var(--color-accent);
    border-color: var(--color-text-primary);
    /* Keep border or remove? Tilda kept it */
}

.btn--filled {
    background-color: var(--color-accent);
    border-color: var(--color-text-primary);
    color: var(--color-text-primary);
}

.btn--filled:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Header */
.header {
    background-color: var(--color-bg-body);
    box-shadow: 0 2px 20px var(--color-header-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 0;
    transition: all 0.3s ease;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--color-border);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s ease;
    color: var(--color-text-primary);
    margin-left: 20px;
}

.theme-toggle:hover {
    background-color: var(--color-bg-light);
    border-color: var(--color-accent);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.theme-toggle .sun-icon {
    display: none;
}

body.dark-mode .theme-toggle .moon-icon {
    display: none;
}

body.dark-mode .theme-toggle .sun-icon {
    display: block;
}

.header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Header Branding */
.header__branding {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header__logo-text {
    font-family: var(--font-heading);
    font-size: 24px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--color-text-primary);
}

.header__tagline {
    position: relative;
    height: 24px;
    /* Match logo height */
    width: 140px;
    /* Space for words */
    overflow: hidden;
    display: flex;
    align-items: center;

    /* Separator line */
    border-left: 1px solid rgba(0, 0, 0, 0.2);
    padding-left: 20px;
}

/* Разделитель логотипа в темной теме */
body.dark-mode .header__tagline {
    border-left-color: rgba(255, 255, 255, 0.3);
}

/* Тэглайн слова в темной теме */
body.dark-mode .header__tagline-word {
    color: var(--color-text-muted);
}

.header__tagline-word {
    position: absolute;
    font-family: var(--font-body);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    opacity: 0;
    animation: taglineFade 9s infinite;
    white-space: nowrap;
    font-weight: 400;
}

.header__tagline-word:nth-child(1) {
    animation-delay: 0s;
}

.header__tagline-word:nth-child(2) {
    animation-delay: 3s;
}

.header__tagline-word:nth-child(3) {
    animation-delay: 6s;
}

@keyframes taglineFade {

    0%,
    100% {
        opacity: 0;
        transform: translateY(5px);
    }

    10% {
        opacity: 1;
        transform: translateY(0);
    }

    33% {
        opacity: 1;
        transform: translateY(0);
    }

    43% {
        opacity: 0;
        transform: translateY(-5px);
    }
}

@media (max-width: 600px) {
    .header__tagline {
        display: none;
        /* Hide on mobile if too cramped, or adjust */
    }
}


.header__nav {
    display: flex;
}

.header__nav-list {
    display: flex;
    gap: 30px;
}

.header__nav-link {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    /* letter-spacing: 0.5px; Removed */
}

.header__nav-link:hover {
    color: var(--color-accent);
}

.header__burger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.header__burger span {
    width: 25px;
    height: 2px;
    background-color: var(--color-text-primary);
}

@media (max-width: 900px) {
    .header__nav {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--color-bg-body);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateY(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 90;
    }

    .header__nav.active {
        transform: translateY(0);
        display: flex;
    }

    .header__nav-list {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    .header__nav-link {
        font-size: 24px;
    }

    .header__cta {
        display: none;
    }

    .header__burger {
        display: flex;
        z-index: 100;
        position: relative;
    }

    .header__burger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .header__burger.active span:nth-child(2) {
        opacity: 0;
    }

    .header__burger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .header__burger span {
        transition: all 0.3s ease;
    }
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-text-primary);
    height: auto;
    padding-bottom: 80px;
}

.hero__bg {
    position: relative;
    height: 50vh;
    width: 100%;
    background-size: cover;
    background-position: center;
}

.hero__content {
    margin-top: -80px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.hero__avatar-wrapper {
    display: inline-block;
    padding: 5px;
    background: var(--color-bg-body);
    border-radius: 50%;
}

.hero__avatar {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
}

.hero__title {
    font-family: var(--font-heading);
    font-size: 42px;
    margin-top: 20px;
    font-weight: 300;
}

.hero__subtitle {
    font-size: 16px;
    color: #555;
    margin-top: 10px;
}

body.dark-mode .hero__subtitle {
    color: var(--color-text-muted);
}

/* Separator */
.separator-line {
    height: 1px;
    background: linear-gradient(to right, transparent, #333333, transparent);
    opacity: 0.2;
    margin: 0 auto;
    max-width: 800px;
}

body.dark-mode .separator-line {
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
}

/* About Section */
.about__content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 18px;
    font-weight: 300;
}

.about__text {
    margin-bottom: 20px;
    text-wrap: balance;
    /* Modern solution for even lines */
    max-width: 100%;
    /* Ensure it takes space */
}

/* Portfolio Grid */
.portfolio__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

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

.portfolio__item {
    position: relative;
    cursor: pointer;
}

.portfolio__item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.5s ease;
    border-radius: 4px;
}

.portfolio__item:hover img {
    transform: scale(1.03);
}

.portfolio__title {
    margin-top: 15px;
    font-family: var(--font-heading);
    font-size: 18px;
    text-align: center;
    color: var(--color-text-primary);
    font-weight: 600;
}

@media (max-width: 900px) {
    .portfolio__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio__grid--featured {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .portfolio__grid {
        grid-template-columns: 1fr;
    }
}

.portfolio__footer {
    margin-top: 60px;
    text-align: center;
}

/* Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal--delay-1 {
    transition-delay: 0.2s;
}

.reveal--delay-2 {
    transition-delay: 0.4s;
}

/* Services */
.services__table {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #e0e0e0;
}

.service-row {
    display: flex;
    padding: 40px 0;
    border-bottom: 1px solid #e0e0e0;
    gap: 40px;
}

.service-row__main {
    flex: 2;
    min-width: 250px;
}

.service-row__label {
    flex: 1;
    font-size: 12px;
    color: #999;
    /* letter-spacing: 1px; Removed */
    text-transform: uppercase;
    padding-top: 5px;
}

body.dark-mode .service-row__label {
    color: var(--color-text-muted);
}

.service-row__desc {
    flex: 3;
}

.service-row__title {
    font-family: var(--font-heading);
    font-size: 28px;
    text-transform: uppercase;
    margin-bottom: 15px;
    line-height: 1.2;
}

.service-row__price {
    font-size: 16px;
    color: #666;
    margin-bottom: 5px;
}

body.dark-mode .service-row__price {
    color: var(--color-text-muted);
}

.service-row__subprice {
    font-size: 13px;
    color: #999;
}

body.dark-mode .service-row__subprice {
    color: var(--color-text-muted);
}

.service-row__desc ul {
    list-style: none;
    margin-bottom: 20px;
}

.service-row__desc li {
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.5;
}

.service-row__link {
    display: inline-block;
    font-size: 12px;
    text-transform: uppercase;
    /* letter-spacing: 1px; Removed */
    color: var(--color-text-primary);
    font-weight: 600;
    margin-top: 10px;
}

.services__footer {
    margin-top: 60px;
    text-align: center;
    /* Or right aligned? Reference has centered button usually */
}

@media (max-width: 900px) {
    .service-row {
        flex-direction: column;
        gap: 20px;
    }

    .service-row__label {
        display: none;
        /* Hide label on mobile to save space, or keep it? Reference usually stacks. */
    }
}

/* Stages */
.stages__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.stage-item {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--color-bg-surface);
    padding: 40px;
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    border-radius: 4px;
}

.stage-item:hover {
    box-shadow: 0 15px 40px var(--color-header-shadow);
    transform: translateY(-5px);
    border-color: var(--color-accent);
}

.stage-item__number {
    font-family: var(--font-heading);
    font-size: 80px;
    color: var(--color-text-secondary);
    line-height: 1;
    opacity: 1;
    margin-bottom: 15px;
    font-weight: 700;
}

.stage-item__title {
    font-weight: 500;
    font-size: 20px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stage-item__desc ul {
    list-style: none;
    /* Remove default bullets */
    padding-left: 0;
    font-size: 15px;
    margin-bottom: 25px;
    color: #555;
    line-height: 1.6;
}

body.dark-mode .stage-item__desc ul {
    color: var(--color-text-primary);
}

.stage-item__desc li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
    /* Space for custom bullet */
}

.stage-item__desc li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
    top: 2px;
}

.stage-item__meta {
    font-size: 14px;
    color: #888;
    margin-top: auto;
    /* Push to bottom */
}

body.dark-mode .stage-item__meta {
    color: var(--color-text-muted);
}

.stage-item__meta em {
    display: block;
    font-style: normal;
    margin-bottom: 0;
    line-height: 1.4;
    color: var(--color-text-secondary);
}

/* Fix for 4th item */
.stage-item:nth-child(4) {
    grid-column: auto;
}

@media (max-width: 900px) {
    .stages__grid {
        grid-template-columns: 1fr;
    }

    .stage-item:nth-child(4) {
        grid-column: auto;
    }

    .service-card {
        flex-direction: column !important;
        /* Force stack on mobile */
        text-align: left;
    }

    .service-card__image-col {
        width: 100%;
    }
}

/* CTA Section */
.cta-section {
    text-align: center;
    background-color: var(--color-white);
    padding: 80px 0;
}

/* Footer */
.footer {
    padding: 80px 0 0;
    background-color: var(--color-bg-body);
    border-top: 1px solid var(--color-border);
    overflow: hidden;
}

.footer__top {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 80px;
}

.footer__col-title {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    color: var(--color-text-secondary);
}

.footer__col-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark-mode .footer__col-content {
    color: var(--color-text-muted);
}

.footer__link {
    transition: color 0.3s;
}

.footer__link:hover {
    color: var(--color-accent);
}

.footer__socials {
    display: flex;
    gap: 15px;
}

.social-link {
    color: var(--color-text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.social-link:hover {
    color: var(--color-accent);
}

.footer__copyright {
    margin-top: 20px;
    font-size: 10px;
    color: #999;
}

body.dark-mode .footer__copyright {
    color: var(--color-text-muted);
}

.footer__big-text {
    font-family: var(--font-heading);
    font-size: 34vw;
    /* Increased to fill width */
    line-height: 0.8;
    text-align: center;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: -0.02em;
    width: 100%;
    overflow: hidden;
    user-select: none;
    margin-bottom: -5vw;
    /* Pull bottom closer if needed, or let it sit */
    display: flex;
    /* Helps with vertical alignment/cropping */
    justify-content: center;
    align-items: flex-end;
    /* Align bottom */
}

/* Mobile Typography & Hero Adjustments */
@media (max-width: 600px) {
    .footer__top {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .footer__socials {
        justify-content: center;
    }

    .section {
        padding: 40px 0;
    }

    .section__title {
        font-size: 24px;
        margin-bottom: 40px;
    }

    .hero {
        min-height: 300px;
    }

    .hero__title {
        font-size: 28px;
    }

    .hero__subtitle {
        font-size: 14px;
    }

    .hero__avatar {
        width: 120px;
        height: 120px;
    }

    .header__logo-text {
        font-size: 20px;
    }

    .header__logo-img {
        width: 40px;
    }
}