/* ─── HERO ──────────────────────────────────────────────────────────────── */
#hero {
    /* Fallback для браузеров без поддержки svh */
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 60px 80px 80px;
    position: relative;
    overflow: hidden;
}

.hero-bg-grid {
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image:
        linear-gradient(var(--border-2) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-2) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.hero-bg-word {
    position: absolute;
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-serif);
    font-size: clamp(160px, 22vw, 340px);
    font-size: max(160px, min(22vw, 340px)); /* fallback */
    font-weight: 700;
    color: transparent;
    -webkit-text-stroke: 1px var(--border-2);
    text-stroke: 1px var(--border-2);
    letter-spacing: -0.04em;
    line-height: 1;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
    /* will-change снимается после завершения параллакс-анимации через JS */
}

.hero-tag {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 28px;
    opacity: 0;
    transform: translateY(12px);
    animation: fadeUp 0.7s var(--ease-out) 0.2s forwards;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(52px, 8.5vw, 128px);
    font-size: max(52px, min(8.5vw, 128px)); /* fallback */
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    max-width: 820px;
    overflow: hidden;
}

.hero-title .line {
    display: block;
    overflow: hidden;
}

.hero-title .line-inner {
    display: block;
    transform: translateY(110%);
    animation: slideUp 0.9s var(--ease-out) forwards;
}

.hero-title .line:nth-child(1) .line-inner {
    animation-delay: 0.35s;
}

.hero-title .line:nth-child(2) .line-inner {
    animation-delay: 0.5s;
}

.hero-title .line:nth-child(3) .line-inner {
    animation-delay: 0.65s;
}

.hero-title em {
    font-style: italic;
    color: var(--accent);
}

.hero-subtitle {
    margin-top: 28px;
    font-size: 17px;
    font-weight: 300;
    color: var(--text-muted);
    max-width: 420px;
    line-height: 1.65;
    opacity: 0;
    transform: translateY(12px);
    animation: fadeUp 0.7s var(--ease-out) 0.9s forwards;
}

.hero-actions {
    margin-top: 44px;
    display: flex;
    align-items: center;
    gap: 36px;
    opacity: 0;
    transform: translateY(12px);
    animation: fadeUp 0.7s var(--ease-out) 1.1s forwards;
}

/* ─── ABOUT ─────────────────────────────────────────────────────────────── */
#about {
    padding: 130px 0 120px;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    content-visibility: auto;
    contain-intrinsic-size: 0 600px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 80px;
    align-items: start;
}

.about-left {
    padding-top: 8px;
}

.about-text {
    margin-top: 36px;
    font-size: 18px;
    font-weight: 300;
    line-height: 1.75;
    color: var(--text-muted);
    max-width: 580px;
}

.about-text strong {
    font-weight: 500;
    color: var(--text);
}

.about-divider {
    width: 48px;
    height: 2px;
    background: var(--accent);
    margin: 36px 0;
}

.about-quote {
    font-family: var(--font-serif);
    font-size: 24px;
    font-style: italic;
    font-weight: 400;
    line-height: 1.4;
    color: var(--text);
    border-left: 2px solid var(--accent);
    padding-left: 24px;
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: sticky;
    top: 100px;
}

.stat-item {
    padding: 32px 0;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.stat-item:first-child {
    border-top: 1px solid var(--border);
}

.stat-num {
    font-family: var(--font-serif);
    font-size: clamp(64px, 7vw, 96px);
    font-size: max(64px, min(7vw, 96px)); /* fallback */
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--text);
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-num .suffix {
    font-size: 0.38em;
    color: var(--accent);
    font-weight: 600;
}

.stat-label {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ─── SERVICES ──────────────────────────────────────────────────────────── */
#services {
    padding: 130px 0 120px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    content-visibility: auto;
    contain-intrinsic-size: 0 700px;
}

.services-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 64px;
    gap: 40px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.service-card {
    padding: 44px 36px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: background 0.35s;
    cursor: none;
}

.service-card::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease-out);
}

.service-card:hover {
    background: var(--surface);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-num {
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 20px;
}

.service-name {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
    color: var(--text);
}

.service-desc {
    font-size: 14px;
    font-weight: 300;
    line-height: 1.65;
    color: var(--text-muted);
    max-height: 0;
    overflow: hidden;
    transition:
        max-height 0.4s var(--ease-out),
        opacity 0.4s;
    opacity: 0;
}

.service-card:hover .service-desc {
    max-height: 120px;
    opacity: 1;
}

.service-icon-bg {
    position: absolute;
    right: 24px;
    top: 24px;
    font-family: var(--font-serif);
    font-size: 80px;
    font-weight: 700;
    color: var(--border);
    line-height: 1;
    pointer-events: none;
    transition: color 0.35s;
}

.service-card:hover .service-icon-bg {
    color: var(--border-2);
}

/* ─── PORTFOLIO ─────────────────────────────────────────────────────────── */
#portfolio {
    padding: 130px 0 0;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    overflow: hidden;
    content-visibility: auto;
    contain-intrinsic-size: 0 580px;
    position: relative;
}

.portfolio-header {
    padding: 0 60px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 60px;
    gap: 40px;
}

/* Обёртка карусели — относительно неё позиционируются стрелки */
.portfolio-wrap {
    position: relative;
}

.portfolio-scroll {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    padding: 0 60px 80px;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    -webkit-scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.portfolio-scroll::-webkit-scrollbar {
    display: none;
}

.portfolio-scroll::after {
    content: "";
    flex-shrink: 0;
    width: 60px;
}

.portfolio-card {
    flex-shrink: 0;
    width: 380px;
    height: 480px;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
    cursor: none;
}

.portfolio-card-bg {
    position: absolute;
    inset: 0;
    transition: transform 0.6s var(--ease-out);
}

.portfolio-card:hover .portfolio-card-bg {
    transform: scale(1.04);
}

.portfolio-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(14, 13, 11, 0.95) 0%,
        rgba(14, 13, 11, 0.3) 50%,
        transparent 100%
    );
    transition: background 0.4s;
}

.portfolio-card:hover .portfolio-card-overlay {
    background: linear-gradient(
        to top,
        rgba(14, 13, 11, 0.97) 0%,
        rgba(200, 146, 74, 0.15) 50%,
        rgba(200, 146, 74, 0.05) 100%
    );
}

.portfolio-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 28px;
}

.portfolio-card-tag {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

.portfolio-card-title {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text);
}

/* Portfolio gradient backgrounds */
.pg-1 {
    background: linear-gradient(135deg, #1a1208 0%, #2d1f0a 40%, #1a130a 100%);
}

.pg-2 {
    background: linear-gradient(135deg, #0e1218 0%, #1a2230 40%, #0e1018 100%);
}

.pg-3 {
    background: linear-gradient(135deg, #1a1008 0%, #2d1a08 35%, #3d2810 100%);
}

.pg-4 {
    background: linear-gradient(135deg, #141414 0%, #222222 50%, #181818 100%);
}

/* ─── PORTFOLIO NAV ARROWS ─────────────────────────────────────────── */
/* Контейнер стрелок — скрыт, используем оверлейные кнопки */
.portfolio-nav {
    display: none;
}

/* ─── PORTFOLIO OVERLAY ARROWS ──────────────────────────────────────────── */
.portfolio-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    /* поднимаем выше на половину прогресс-бара и 80px padding-bottom */
    margin-top: calc(-40px - 0.5 * 1px);
    z-index: 10;
    width: 52px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 32px;
    color: var(--text);
    background: transparent;
    transition:
        opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        color 0.25s;
    opacity: 0;
    pointer-events: none;
}

/* Показываем стрелки при hover на обёртку */
.portfolio-wrap:hover .portfolio-arrow {
    opacity: 1;
    pointer-events: auto;
}

.portfolio-arrow::before {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    z-index: -1;
}

.portfolio-arrow-prev {
    left: 0;
    background: linear-gradient(
        to right,
        rgba(14, 13, 11, 0.75) 0%,
        rgba(14, 13, 11, 0) 100%
    );
    padding-left: 16px;
    justify-content: flex-start;
    width: 80px;
}

.portfolio-arrow-next {
    right: 0;
    background: linear-gradient(
        to left,
        rgba(14, 13, 11, 0.75) 0%,
        rgba(14, 13, 11, 0) 100%
    );
    padding-right: 16px;
    justify-content: flex-end;
    width: 80px;
}

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

.portfolio-arrow:disabled {
    opacity: 0 !important;
    pointer-events: none;
}

/* Прогресс-бар автопрокрутки — внизу .portfolio-wrap */
.portfolio-progress {
    position: absolute;
    bottom: 40px;
    left: 60px;
    right: 60px;
    height: 1px;
    background: var(--border);
    pointer-events: none;
    z-index: 5;
}

.portfolio-progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width linear;
    transform-origin: left;
}

@media (max-width: 768px) {
    .portfolio-arrow {
        display: none;
    }
    .portfolio-progress {
        left: 24px;
        right: 24px;
    }
}

.pg-5 {
    background: linear-gradient(135deg, #0e1614 0%, #1a2820 50%, #0e1410 100%);
}

.pg-6 {
    background: linear-gradient(135deg, #120e08 0%, #221a0c 40%, #1a140a 100%);
}

.portfolio-card-visual {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.18;
}

.portfolio-card-visual svg {
    width: 120px;
    height: 120px;
    color: var(--accent);
}

/* ─── PROCESS ───────────────────────────────────────────────────────────── */
#process {
    padding: 130px 0 120px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    content-visibility: auto;
    contain-intrinsic-size: 0 600px;
}

.process-list {
    margin-top: 64px;
    display: flex;
    flex-direction: column;
}

.process-item {
    display: grid;
    grid-template-columns: 80px 1fr 1fr;
    align-items: center;
    gap: 40px;
    padding: 36px 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

.process-item:first-child {
    border-top: 1px solid var(--border);
}

.process-item:hover {
    background: var(--surface);
    margin: 0 -60px;
    padding: 36px 60px;
}

.process-step-num {
    font-family: var(--font-serif);
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--text-dim);
    transition: color 0.3s;
}

.process-item:hover .process-step-num {
    color: var(--accent);
}

.process-step-name {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

.process-step-desc {
    font-size: 15px;
    font-weight: 300;
    line-height: 1.65;
    color: var(--text-muted);
}

/* ─── CONTACT ───────────────────────────────────────────────────────────── */
#contact {
    padding: 130px 0 120px;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    content-visibility: auto;
    contain-intrinsic-size: 0 700px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 560px;
    gap: 100px;
    align-items: start;
}

.contact-left {
    padding-top: 8px;
}

.contact-text {
    margin-top: 28px;
    font-size: 17px;
    font-weight: 300;
    line-height: 1.75;
    color: var(--text-muted);
    max-width: 400px;
}

.contact-info {
    margin-top: 52px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.contact-info-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    min-width: 80px;
    padding-top: 2px;
}

.contact-info-val {
    font-size: 15px;
    font-weight: 300;
    color: var(--text-muted);
}

/* ─── PORTFOLIO CARD HINT ────────────────────────────────────────────────── */
.portfolio-card-hint {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-top: 10px;
    opacity: 0;
    transform: translateY(6px);
    transition:
        opacity 0.3s,
        transform 0.3s;
}
.portfolio-card:hover .portfolio-card-hint {
    opacity: 1;
    transform: translateY(0);
}

/* ─── FAQ ───────────────────────────────────────────────────────────────── */
#faq {
    padding: 120px 0 100px;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
}

.faq-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: end;
    margin-bottom: 64px;
}

.faq-subtitle {
    font-size: 17px;
    font-weight: 300;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 400px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
}

.faq-item {
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.faq-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.25s;
}

.faq-trigger:hover {
    background: none;
}

.faq-item:hover .faq-trigger {
    padding-left: 12px;
}

.faq-question {
    font-family: var(--font-serif);
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text);
    transition: color 0.25s;
}

.faq-trigger:hover .faq-question,
.faq-item.faq-open .faq-question {
    color: var(--accent);
}

.faq-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition:
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.25s,
        color 0.25s,
        background 0.25s;
}

.faq-item.faq-open .faq-icon {
    transform: rotate(180deg);
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* Анимация раскрытия */
.faq-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-item.faq-open .faq-body {
    grid-template-rows: 1fr;
}

.faq-body > * {
    overflow: hidden;
}

.faq-answer {
    font-size: 16px;
    font-weight: 300;
    line-height: 1.75;
    color: var(--text-muted);
    padding-bottom: 28px;
    padding-right: 56px;
    opacity: 0;
    transform: translateY(-8px);
    transition:
        opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.05s,
        transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.05s;
}

.faq-item.faq-open .faq-answer {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .faq-header {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 40px;
    }
    .faq-trigger {
        padding: 22px 0;
    }
    .faq-answer {
        padding-right: 0;
        padding-bottom: 22px;
    }
    .faq-item:hover .faq-trigger {
        padding-left: 0;
    }
}

/* ─── PORTFOLIO SKELETON LOADER ──────────────────────────────────────────── */
.portfolio-skeleton {
    background: var(--surface);
    position: relative;
    overflow: hidden;
    pointer-events: none;
}
.portfolio-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(200, 146, 74, 0.06) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.6s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
