.section-projects .project-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    min-height: 475px;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative;
}

.card-link {
    position: absolute;
    inset: 0;
    z-index: 3;
}

.home .section-projects .project-card:hover,
.section-projects .project-card:hover {
    border-color: rgba(195, 27, 38, 0.15);
    box-shadow:
            rgba(195, 27, 38, 0) 0px 0px 0px 0px,
            rgba(195, 27, 38, 0) 0px 0px 0px 0px,
            rgba(195, 27, 38, 0) 0px 0px 0px 0px,
            rgba(195, 27, 38, 0) 0px 0px 0px 0px,
            rgba(195, 27, 38, 0.1) 0px 1px 3px 0px,
            rgba(195, 27, 38, 0.1) 0px 1px 2px -1px;
}

/* Эффект при наведении на всех страницах */
.section-projects .project-card:hover {
    transform: translateY(-4px);
}

/* На главной странице отключаем */
.home .section-projects .project-card:hover {
    transform: none;
}

.project-image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
    height: 340px;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .5s ease;
    display: block;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-image .badge {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 4px 12px;
}

.meta-badges {
    display: flex;
    grid-gap: 8px;
}

.meta-badge,
.badge {
    background: var(--color-primary);
    color: var(--color-background);
    font-size: 14px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 4px 12px;
    white-space: nowrap;
    max-height: 32px;
}

.project-info,
.project-info * {
    position: relative;
    z-index: 4;
}

.project-info {
    margin-top: auto;
    padding: 24px;
    justify-content: flex-start;
    text-align: left;
}

.home .project-info {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.project-info .type {
    text-transform: uppercase;
    font-size: 14px;
    color: var(--color-muted-foreground);
    letter-spacing: 0.35px;
    margin: 0 0 12px;
}

.project-info .h3 {
    margin: 0 0 12px;
    cursor: pointer;
    transition: color .3s ease;
}

.home .project-info .h3 {
    font-size: 16px;
}

.project-info .h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* По умолчанию (большие экраны) — показываем весь текст */
.project-info .h3,
.project-info p {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
}

/* Только на главной странице */
.home .project-card:hover .project-info .h3 {
    color: var(--color-primary);
}

/* На остальных страницах — без изменения цвета */
body:not(.home) .project-card:hover .project-info .h3 {
    color: inherit; /* или исходный цвет, например var(--color-text) */
}

.section-projects .grid-3 {
    gap: 32px;
}

.projects-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 48px;
}

/* Ограничение количества строк */
.project-info .project-excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    margin-bottom: 16px;
}

.project-info .btn {
    margin-top: auto;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 12px;
}

.project-meta .badge {
    padding: 4px 8px;
    background-color: #C4513D1A;
    color: var(--color-primary);
}

.project-meta .project-year {
    color: var(--color-muted-foreground);
}

.project-tags {
    display: flex;
    flex-wrap: nowrap;
    overflow: visible;
    gap: 8px;
    margin: 8px 0 16px;
    position: relative;
    align-items: center;
    font-size: 12px;
}
.project-tags span {
    background: var(--color-muted);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Псевдоэлемент для "+2" */
.project-tags .more {
    background: var(--color-muted);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    z-index: 5;
}

/* Всплывающий список скрытых тегов */
.project-tags .tooltip {
    display: none;
    position: absolute;
    bottom: 120%;
    left: 0;
    background: #222;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 10;
}

.project-tags .more:hover .tooltip {
    display: block;
}

.project-card .btn-ghost-accent.btn {
    width: 100%;
    height: 40px;
}

.project-details {
    text-align: left;
}

.project-details ul {
    display: inline-flex;
    list-style: none;
    padding: 4px 12px;
    margin: 0 0 16px;
    justify-content: flex-start;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-background);
    font-size: 14px;
}

.project-tags li {
    position: relative;
    padding-left: 16px;
}

.project-tags li:first-child {
    padding-left: 0;
}

.project-tags li::before {
    content: "•";
    position: absolute;
    left: 0;
}

.project-tags li:first-child::before {
    content: "";
}

.project-details h1 {
    margin: 0 0 16px;
}

.project-details h1 a {
    color: inherit;
    text-decoration: none;
    pointer-events: auto;
}

.project-details h1 a:hover,
.project-details h1 a:focus {
    color: var(--color-primary);
    text-decoration: none;
}

.project-subtitle {
    font-size: 20px;
    margin-bottom: 24px;
    color: oklab(0.999994 0.0000455678 0.0000200868 / 0.9);
}

.project-description {
    color: oklab(0.999994 0.0000455677 0.0000200868 / 0.8);
    margin-bottom: 32px;
}

.project-info-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
}

.clamp-3 {
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
    white-space: normal;
    margin-bottom: 24px;
}

.info-card {
    background: oklab(0.999994 0.0000455678 0.0000200868 / 0.1);
    padding: 16px;
    border-radius: 10px;
}
.info-label {
    font-size: 14px;
    color: oklab(0.999994 0.0000455677 0.0000200868 / 0.7);
}
.info-value {
    font-size: 16px;
    color: var(--color-background);
}

.preview-box {
    background: oklab(0.999994 0.0000455678 0.0000200868 / 0.1);
    border-radius: 16px;
    padding: 32px;
    backdrop-filter: blur(8px);
}
.preview-box img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 10px;
}
.preview-caption {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: oklab(0.999994 0.0000455677 0.0000200868 / 0.8);
}

.info-box {
    position: relative;
    display: flex;
    gap: 24px;
    padding: 24px;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    align-items: center;
    text-align: left;
    transition: all 0.3s ease;
}

.info-box:hover,
.font-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.info-icon-circle {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background-color: var(--color-primary);
    flex-shrink: 0;
    position: relative;
}

.info-icon-circle::after {
    content: "";
    position: absolute;
    left: 42%;
    top: 28%;
    width: 8px;
    height: 16px;
    border-right: 2px solid var(--color-background);
    border-bottom: 2px solid var(--color-background);
    transform: rotate(45deg);
}

.info-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.info-text {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
}
.info-text p {
    color: var(--color-foreground);
}

.info-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.info-title .h4 {
    margin: 0;
    font-size: 16px;
    color: var(--color-foreground);
}

.info-title code {
    background-color: #e8e8e8;
    color: var(--color-muted-foreground);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
}

.font-card {
    display: flex;
    gap: 24px;
    padding: 24px;
    margin: 0 0 24px;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    text-align: left;
    transition: all 0.3s ease;
}

.font-info {
    display: flex;
    flex-direction: column;
}

.font-name {
    margin-bottom: 8px;
    font-size: 20px;
}

.font-purpose {
    margin-bottom: 16px;
    color: var(--color-muted-foreground);
}

.font-weights {
    display: flex;
    gap: 8px;
}

.font-weights span {
    display: inline-block;
    padding: 2px 6px;
    background-color: var(--color-border);
    color: var(--color-muted-foreground);
    border-radius: 4px;
    font-size: 14px;
}

.font-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    height: 100%;
}

.font-sample.light {
    font-weight: 400;
    font-size: 24px;
}

.font-sample.bold {
    font-weight: 600;
    font-size: 16px;
}

.project-slider .slider {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background: linear-gradient(to right bottom, rgb(232, 232, 232) 0%, oklab(0.930913 0.0000423491 0.0000185966 / 0.5) 100%);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    text-align: center;
}

.project-slider .slider img {
    max-width: calc(100% - 80px);
    margin: 0 40px;
    border-radius: 10px;
    max-height: 600px;
    object-fit: cover;
    box-shadow:
            rgba(0, 0, 0, 0) 0px 0px 0px 0px,
            rgba(0, 0, 0, 0) 0px 0px 0px 0px,
            rgba(0, 0, 0, 0) 0px 0px 0px 0px,
            rgba(0, 0, 0, 0) 0px 0px 0px 0px,
            rgba(0, 0, 0, 0.25) 0px 25px 50px -12px;
}

.project-slider .slider button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: oklab(0.999994 0.0000455678 0.0000200868 / 0.9);
    cursor: pointer;
    box-shadow:
            rgba(0, 0, 0, 0) 0px 0px 0px 0px,
            rgba(0, 0, 0, 0) 0px 0px 0px 0px,
            rgba(0, 0, 0, 0) 0px 0px 0px 0px,
            rgba(0, 0, 0, 0) 0px 0px 0px 0px,
            rgba(0, 0, 0, 0.1) 0px 10px 15px -3px,
            rgba(0, 0, 0, 0.1) 0px 4px 6px -4px;
    transition: 0.3s;
}

.project-slider .slider button:hover {
    transform: translateY(-50%) scale(1.1);
    background: var(--color-background);
}

.project-slider .slider .prev {
    left: 16px;
}

.project-slider .slider .next {
    right: 16px;
}

.project-slider .slider-info {
    margin-top: 16px;
    color: var(--color-muted-foreground);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.project-slider .dots {
    display: flex;
    justify-content: center;
    margin: 0 0 32px;
    gap: 8px;
}

.project-slider .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #E8E8E8;
    cursor: pointer;
    transition: 0.3s;
}

.project-slider .dot.active {
    background: var(--color-primary);
    transform: scale(1.3);
}

.project-slider .thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

.project-slider .thumbnails button {
    position: relative;
    border: none;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    border-radius: 10px;
    transition: 0.3s;
    aspect-ratio: 16 / 9;
    width: 100%;
}

.project-slider .thumbnails button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: 0.3s;
}

.project-slider .thumbnails button.active {
    outline: 1px solid var(--color-primary);
    transform: scale(1.05);
}

.project-slider .thumbnails button span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-background);
    font-size: 14px;
    opacity: 0;
    transition: 0.3s;
    z-index: 2;
}

.project-slider .thumbnails button:hover span {
    opacity: 1;
}

.project-slider .thumbnails button::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: 0.3s;
    z-index: 1;
}

.project-slider .thumbnails button:hover::after {
    background: rgba(0,0,0,0.4);
}

.section-info .primary-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: #C4513D1A;
    border-radius: 10px;
    color: var(--color-primary);
    transition: all 0.3s ease;
}

.section-info .info-box:hover .primary-icon {
    background-color: var(--color-primary);
    color: var(--color-background);
}

.section-info .primary-icon svg {
    width: 24px;
    height: 24px;
}

.section-tech .grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin: 0 auto;
}

.section-tech .info-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.section-tech .info-box:only-child {
    width: 256px;
    margin: 0 auto;
}

.tech-icon {
    display: flex;
    justify-content: center;
    color: var(--color-primary);
}

.tech-icon svg {
    width: 32px;
    height: 32px;
}

.info-box > .info-text:only-child {
    margin: auto;
    text-align: center;
}

.block.results-text,
.block.results-text p {
    font-size: 18px;
    color: var(--color-foreground);
}

.block.results-text p:not(:last-child) {
    margin-bottom: 20px;
    color: var(--color-foreground);
}

.block.results-text ul {
    margin: 20px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.block.results-text li {
    margin-bottom: 10px;
}

.block.results-text li > * {
    display: block;
}

.blog-image  {
    width: 100%;
    overflow: hidden;
    position: relative;
    height: 500px;
    margin-top: 40px;
}

.blog-image  img {
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    margin: 0 auto;
}

@media (max-width: 1100px) {
    .section-projects .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .section-hero .grid-2 {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    /* Ограничение количества строк */
    .project-info .h3,
    .project-info p {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-line-clamp: 3;
    }
}

@media (max-width: 820px) {
    .section-projects .grid-3,
    .section-projects .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .section-projects .grid-2 {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .section-info .grid-2 {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .section-info .info-text {
        justify-content: center;
    }
    .project-slider .thumbnails,
    .section-tech .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .project-meta {
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .project-meta .project-tags {
        padding: 0 8px;
        margin-bottom: 12px;
    }

    .project-meta .project-tags li {
        white-space: nowrap; /* не переносить дату/время */
    }
}

@media (max-width: 375px) {
    .section-info .info-title,
    .section-info .info-box {
        flex-direction: column;
        align-items: flex-start;
    }
    .project-slider .slider,
    .project-slider .dots {
        display: none;
    }
    .project-slider .thumbnails,
    .section-tech .grid-4 {
        grid-template-columns: 1fr;
    }
    h1 {
        font-size: 26px;
    }
}
