.hero-blog-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 16px;
    padding: 6px 10px;
    border: 1px solid var(--brand-red);
    background: var(--brand-red);
    color: var(--white);
    font-size: 0.72rem;
    line-height: 1;
    letter-spacing: 0.04em;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition-fast);
}
.hero-blog-badge:hover,
.hero-blog-badge:focus-visible {
    background: var(--white);
    color: var(--brand-red);
}
.hero-blog-badge:focus-visible {
    outline: 3px solid var(--black);
    outline-offset: 3px;
}

.btn-strict {
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 25px 30px;
    background: var(--white);
    color: var(--black);
    border: var(--border);
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.btn-strict::after {
    content: "";
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: var(--brand-red);
    transition: var(--transition-slow);
    z-index: 1;
}

.btn-strict:hover::after { left: 0; }
.btn-strict:hover { color: var(--white); border-color: var(--brand-red); }
.btn-strict span { position: relative; z-index: 2; }

.arrow-icon {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 23px;
    transition: var(--transition-fast);
}
.arrow-icon img {
    width: 42px;
    height: 23px;
    display: block;
    transition: var(--transition-fast);
}
.btn-strict:hover .arrow-icon { transform: translateX(10px); }
.btn-strict:hover .arrow-icon img { filter: invert(1); }

/* --- БЛОК 1: HERO --- */
.hero {
    display: grid;
    grid-template-columns: 1.55fr 1.25fr;
    grid-template-rows: auto auto;
    border-bottom: var(--border);
}

.hero-title-box {
    grid-column: 1 / 3;
    padding: 6vw 4vw;
    border-bottom: var(--border);
}

.hero-desc-box {
    padding: 4vw;
    border-right: var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.hero-copy {
    margin: 0;
    color: var(--black);
    font-family: 'Inter Tight', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: normal;
    text-wrap: pretty;
    hyphens: none;
    word-break: normal;
    overflow-wrap: normal;
}
.hero-lead-wrap {
    max-width: min(100%, 90ch);
}
.hero-lead-wrap + .hero-copy {
    margin-top: 20px;
}
.hero-cta {
    margin-top: 40px;
}
.hero-services {
    margin-top: 32px;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
    font-family: 'Inter Tight', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: normal;
    color: var(--black);
}
.hero-services li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.hero-services li::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--black);
    flex-shrink: 0;
    margin-top: 0.45em;
}

.hero-photo-box {
    position: relative;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    min-height: 0;
}

.hero-photo-box::before {
    content: ""; position: absolute; top: 20px; left: 20px; width: 15px; height: 15px; border: var(--border-thick);
}
.hero-photo-box::after {
    content: "[ IMAGE_SLOT // PROFILE ]"; font-family: 'JetBrains Mono'; font-size: 0.8rem; color: var(--gray-light);
}
.hero-photo-box.has-photo::before,
.hero-photo-box.has-photo::after {
    display: none;
}
.hero-photo-picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: opacity var(--transition-slow);
}
.hero-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.hero-photo-picture.is-hover {
    opacity: 0;
}
.hero-photo-box.has-hover-photo:hover .hero-photo-picture.is-default {
    opacity: 0;
}
.hero-photo-box.has-hover-photo:hover .hero-photo-picture.is-hover.is-loaded {
    opacity: 1;
}

/* --- БЛОК 2: МАНИФЕСТ --- */
.manifesto {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: var(--border);
}

.manifesto-left { padding: 6vw 4vw; background: var(--black); color: var(--white); }
.manifesto-left h2 { color: var(--white); }

.manifesto-right { padding: 6vw 4vw; display: flex; flex-direction: column; justify-content: center; }
.manifesto-right p {
    margin: 0;
    color: var(--black);
    font-family: 'Inter Tight', sans-serif;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: normal;
}
.manifesto-right p + p { margin-top: 20px; }

/* --- БЛОК 3: УСЛУГИ --- */
.services-header { padding: 4vw; border-bottom: var(--border); }

.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); }

.service-col {
    padding: 4vw 2vw; border-right: var(--border); border-bottom: var(--border);
    transition: var(--transition-fast); position: relative; background: var(--white);
}
.service-col:last-child { border-right: none; }

.service-col:hover { background: var(--black); color: var(--white); }
.service-col:hover p { color: var(--gray-light); }
.service-col:hover .mono-text { color: var(--white); }

.service-num { display: inline-block; margin-bottom: 40px; border: 1px solid currentColor; padding: 5px 10px; }

.service-icon-box {
    position: absolute; top: 2vw; right: 2vw; font-family: 'JetBrains Mono'; font-size: 1.5rem; transition: var(--transition-fast);
}
.service-col:hover .service-icon-box { transform: rotate(45deg); }

/* --- БЛОК 4: ПОРТФОЛИО (НОВАЯ АСИММЕТРИЧНАЯ СЕТКА) --- */
.portfolio-header { padding: 4vw; border-bottom: var(--border); }

.portfolio-bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 колонки */
}

.ptf-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-bottom: var(--border);
    border-right: var(--border);
    text-decoration: none;
    color: var(--black);
    transition: var(--transition-fast);
}

/* Задаем асимметрию: Чередуем широкие и&nbsp;узкие карточки */
.ptf-card:nth-child(1) { grid-column: span 2; }
.ptf-card:nth-child(2) { grid-column: span 1; border-right: none; }
.ptf-card:nth-child(3) { grid-column: span 1; }
.ptf-card:nth-child(4) { grid-column: span 2; border-right: none; }
.ptf-card:nth-child(5) { grid-column: span 2; }
.ptf-card:nth-child(6) { grid-column: span 1; border-right: none; }

/* Эффект наведения на&nbsp;всю карточку */
.ptf-card:hover {
    background: var(--black);
    color: var(--white);
}

/* Место под&nbsp;картинку */
.ptf-img-slot {
    width: 100%;
    aspect-ratio: 16 / 9; /* Пропорция картинки */
    background: var(--bg-color);
    border-bottom: var(--border);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    overflow: hidden;
}
.ptf-img-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ptf-img-slot picture {
    width: 100%;
    height: 100%;
    display: block;
}
.ptf-img-slot.has-image::before,
.ptf-img-slot.has-image::after {
    display: none;
}

.ptf-img-slot::after {
    content: "[ IMG_DATA ]";
    font-family: 'JetBrains Mono';
    font-size: 0.8rem;
    color: var(--gray-light);
    transition: var(--transition-fast);
}

/* Декоративный крестик в&nbsp;углу картинки */
.ptf-img-slot::before {
    content: "+";
    position: absolute;
    top: 20px; right: 20px;
    font-family: 'JetBrains Mono';
    font-size: 1.5rem;
    color: var(--black);
    transition: var(--transition-fast);
    z-index: 2;
}

/* Инверсия картинки при&nbsp;наведении */
.ptf-card:hover .ptf-img-slot {
    background: var(--gray-dark);
    border-bottom-color: var(--white);
}
.ptf-card:hover .ptf-img-slot::before {
    color: var(--white);
    transform: rotate(45deg); /* Крестик превращается в&nbsp;Х */
}
.ptf-card:hover .ptf-img-slot::after { color: var(--gray-dark); }

/* Текстовая часть карточки */
.ptf-info {
    padding: 30px 3vw;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Чтобы текст тянулся вниз, если карточка высокая */
}

.ptf-title {
    font-size: clamp(1.5rem, 2vw, 2.5rem);
    margin: 15px 0 10px 0;
    line-height: 1;
}

.ptf-desc {
    font-size: 1rem;
    color: var(--gray-dark);
    transition: var(--transition-fast);
}

.ptf-card:hover .ptf-desc { color: var(--gray-light); }
.ptf-card:hover .mono-text { color: var(--gray-light); }

/* --- БЛОК 5: СТАНДАРТЫ --- */
.info-panel { display: grid; grid-template-columns: 1fr 1fr; }
.info-left { padding: 6vw 4vw; border-right: var(--border); }
.info-right { padding: 6vw 4vw; background: var(--bg-color); position: relative; }

.info-right::before {
    content: ""; position: absolute; top:0; left:0; width:100%; height:100%;
    background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0,0,0,0.03) 10px, rgba(0,0,0,0.03) 20px);
    z-index: 0; pointer-events: none;
}
.info-content { position: relative; z-index: 1; }
.info-certs {
    margin-top: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.info-certs img {
    width: 100%;
    height: auto;
    border: var(--border);
    display: block;
}
.info-certs picture {
    display: block;
}
.info-video { margin-top: 32px; }
.embed-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--white);
    border: 1px solid #d8d8d8;
    border-radius: 10px;
}
.embed-frame iframe {
    position: absolute;
    width: calc(100% + 2px);
    height: calc(100% + 2px);
    inset: -1px;
    border: 0;
}
.video-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    background: var(--black);
    border: 0;
    cursor: pointer;
}
.video-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-slow);
}
.video-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(13, 13, 13, 0.06);
    transition: background var(--transition-fast);
}
.video-preview-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    color: var(--white);
    background: var(--brand-red);
    border: 2px solid var(--white);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}
.video-preview-icon::before {
    content: "";
    width: 0;
    height: 0;
    margin-left: 5px;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 17px solid currentColor;
}
.video-preview:hover img { transform: scale(1.015); }
.video-preview:hover::after { background: rgba(13, 13, 13, 0.16); }
.video-preview:hover .video-preview-icon {
    color: var(--brand-red);
    background: var(--white);
    transform: translate(-50%, -50%) scale(1.06);
}
.video-preview:focus-visible {
    outline: 3px solid var(--brand-red);
    outline-offset: -5px;
}
/* --- АДАПТИВНОСТЬ ДЛЯ&nbsp;ПЛАНШЕТОВ --- */
@media (max-width: 1024px) {
    .hero { display: flex; flex-direction: column; }
    .hero-title-box, .hero-desc-box, .hero-photo-box { width: 100%; }
    .hero-desc-box { border-right: none; border-bottom: var(--border); }
    .hero-photo-box { min-height: 0; aspect-ratio: 1 / 1; border-bottom: var(--border); }

    .manifesto { grid-template-columns: 1fr; }
    .info-panel { grid-template-columns: 1fr; }
    .info-left { border-right: none; border-bottom: var(--border); }

    /* Сетка портфолио в&nbsp;2 колонки на&nbsp;планшете */
    .portfolio-bento { grid-template-columns: repeat(2, 1fr); }
    .ptf-card { grid-column: span 1 !important; border-right: var(--border) !important; }
    .ptf-card:nth-child(even) { border-right: none !important; }
}

/* --- АДАПТИВНОСТЬ ДЛЯ&nbsp;МОБИЛОК --- */
@media (max-width: 768px) {
    .btn-strict { padding: 20px 25px; font-size: 1.1rem; white-space: nowrap; }

    .services-grid { grid-template-columns: 1fr; }
    .service-col { border-right: none; }

    /* Сетка портфолио в&nbsp;1 колонку на&nbsp;мобилках */
    .portfolio-bento { grid-template-columns: 1fr; }
    .ptf-card { border-right: none !important; }
    .info-certs { grid-template-columns: 1fr; }
    .hero-services { gap: 10px; }
}
