/* Premium dark minimal — RIGOR design system: emerald accent, thin borders, subtle glow */
:root {
    --bg-900: #0F1113;
    --bg-800: #151A1E;
    --bg-700: #1B1F23;

    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;

    --accent-500: #10B981;
    --accent-600: #059669;

    --border-soft: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-900);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}


/* HEADER */
header {
    background: var(--bg-900);
    color: var(--text-primary);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-soft);
}

header .container,
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-overlay {
    display: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    margin: 0 auto;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.logo-wrap {
    text-decoration: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

.logo-img {
    height: 90px;
    width: auto;
    display: block;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    line-height: 1.1;
    white-space: nowrap;
}

.logo-slogan {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

.header-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 6px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.header-nav a:hover {
    color: var(--text-primary);
    border-color: var(--accent-500);
    background: rgba(16, 185, 129, 0.08);
}

/* SECTIONS */
section {
    padding: 96px 0;
    border-bottom: 1px solid var(--border-soft);
}

section h2 {
    font-family: 'Playfair Display', serif;
    text-align: center;
    font-size: 36px;
    font-weight: 400;
    margin-bottom: 48px;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 24px;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 1px;
    background: var(--accent-500);
}

/* ABOUT SECTION */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
    margin-bottom: 56px;
}

.about-title-block {
    margin-bottom: 20px;
}

.about-tagline {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.about-text h3 {
    font-family: 'Playfair Display', serif;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 400;
}

.about-title-block h3 {
    margin-bottom: 8px;
    font-size: 48px;
    font-weight: 500;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.accent-text {
    color: var(--text-primary);
    font-weight: 500;
}

.section-subtitle {
    font-family: 'Playfair Display', serif;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 20px;
}

.link-accent {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

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

.about-photo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-photo {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-soft);
}

/* CARDS */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.card {
    background: var(--bg-800);
    border-radius: 4px;
    padding: 32px;
    border: 1px solid var(--border-soft);
    transition: all 0.25s ease;
}

.card:hover {
    border-color: var(--accent-500);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.08);
    transform: translateY(-2px);
}

.card h3 {
    font-family: 'Playfair Display', serif;
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 400;
}

.card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 15px;
}

/* PORTFOLIO */
.portfolio-item {
    background: var(--bg-800);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    transition: all 0.25s ease;
    max-width: 100%;
    box-sizing: border-box;
}

.portfolio-item:hover {
    border-color: var(--accent-500);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.08);
}

.portfolio-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: var(--bg-700);
    padding: 12px;
    height: 212px;
    box-sizing: border-box;
}

.portfolio-image {
    width: 100%;
    height: 200px;
    min-height: 200px;
    max-height: 200px;
    background: var(--bg-800);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.portfolio-image[role="button"]:focus-visible {
    outline: 2px solid var(--accent-500);
    outline-offset: 2px;
}

.portfolio-image:hover {
    background: var(--bg-700);
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    vertical-align: middle;
}

.portfolio-item--website .portfolio-image {
    height: 200px;
    min-height: 200px;
    max-height: 200px;
}

.portfolio-image--contain img {
    object-fit: contain;
    object-position: top center;
}

.portfolio-content {
    padding: 24px;
    max-height: 240px;
    overflow-y: auto;
}

.portfolio-content h3 {
    font-family: 'Playfair Display', serif;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 18px;
}

.portfolio-content p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 12px;
}

.portfolio-content p:last-child {
    margin-bottom: 0;
}

/* CERTIFICATES GALLERY */
.certificates-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.certificate-card {
    background: var(--bg-800);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    transition: all 0.25s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.certificate-card:hover {
    border-color: var(--accent-500);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.08);
}

.certificate-image-wrapper {
    width: 100%;
    min-height: 280px;
    background: var(--bg-700);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.certificate-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    object-position: center;
    display: block;
}

.certificate-image-placeholder {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}

.certificate-info {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.certificate-info h3 {
    font-family: 'Playfair Display', serif;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
}

.certificate-info p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
    flex: 1;
    display: flex;
    align-items: center;
}

/* REVIEWS */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.review-card {
    background: var(--bg-800);
    border-radius: 4px;
    padding: 28px;
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--accent-500);
    transition: all 0.25s ease;
}

.review-card:hover {
    border-color: var(--accent-500);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.08);
}

.review-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-700);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 20px;
    overflow: hidden;
}

.review-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-name {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.review-service {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.review-text {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 14px;
}

/* PERSONAL SECTION */
.section-personal {
    background: var(--bg-800);
}

.section-personal .card {
    background: var(--bg-800);
}

.section-personal .card p {
    color: var(--text-secondary);
}

/* BUTTON */
.btn-telegram {
    background: linear-gradient(to right, var(--accent-600), var(--accent-500));
    color: white;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    margin: 20px 0;
    border-radius: 20px;
    border: 1px solid var(--accent-500);
    display: inline-block;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-telegram:hover {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.btn-telegram:active {
    transform: scale(0.98);
}

.contact-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

/* FOOTER */
footer {
    background: var(--bg-900);
    color: var(--text-secondary);
    text-align: center;
    padding: 40px 0;
    margin-top: 0;
    border-top: 1px solid var(--border-soft);
}

footer p {
    font-size: 14px;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent-500);
    color: white;
    padding: 15px 25px;
    border-radius: 4px;
    z-index: 2000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.error {
    background: #B80957;
    color: white;
}

/* LIGHTBOX СЕРТИФИКАТОВ */
.cert-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
}

.cert-lightbox.is-open {
    display: flex;
}

.cert-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.cert-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cert-lightbox-img {
    max-width: 95vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: default;
}

@media (max-width: 768px) {
    header {
        position: relative;
    }

    .nav-toggle {
        display: flex;
        order: 2;
        margin-left: auto;
        z-index: 10;
    }

    .header-nav {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(280px, 85vw);
        background: var(--bg-900);
        padding: 80px 20px 24px;
        gap: 8px;
        border-left: 1px solid var(--border-soft);
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.3);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        z-index: 100;
    }

    .header-nav.is-open {
        transform: translateX(0);
    }

    .header-nav a {
        font-size: 15px;
        padding: 12px 16px;
        border-radius: 12px;
        text-align: left;
    }

    .header-inner {
        position: relative;
        flex-wrap: wrap;
    }

    .header-inner .logo-wrap {
        order: 1;
    }

    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        cursor: pointer;
    }

    .header-nav.is-open ~ .nav-overlay {
        display: block;
    }

    .logo-img {
        height: 70px;
    }

    .logo {
        font-size: 22px;
        white-space: nowrap;
    }

    .logo-slogan {
        font-size: 12px;
        white-space: nowrap;
    }

    .logo-wrap {
        gap: 10px;
        flex-shrink: 0;
    }

    .header-nav a {
        font-size: 13px;
        padding: 8px 14px;
    }

    header {
        padding: 16px 0;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-images {
        grid-template-columns: 1fr;
    }

    .certificates-gallery {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 16px;
    }

    section {
        padding: 48px 0;
    }

    section h2 {
        font-size: 24px;
        margin-bottom: 32px;
        padding-bottom: 16px;
    }

    .about-content {
        gap: 32px;
        margin-bottom: 32px;
    }

    .about-text h3 {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .about-title-block h3 {
        font-size: 32px;
        margin-bottom: 8px;
    }

    .about-tagline {
        font-size: 14px;
    }

    .about-text p {
        font-size: 15px;
        margin-bottom: 16px;
    }

    .section-subtitle {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .profile-photo {
        width: 180px;
        height: 180px;
    }

    .card-grid {
        gap: 20px;
        margin-bottom: 24px;
    }

    .card {
        padding: 20px;
    }

    .card h3 {
        font-size: 17px;
        margin-bottom: 12px;
    }

    .card p {
        font-size: 14px;
    }

    .portfolio-images {
        padding: 10px;
        gap: 10px;
        height: auto;
        min-height: 0;
        grid-template-rows: 160px 160px;
        grid-auto-rows: 160px;
    }

    .portfolio-image {
        height: 160px;
        min-height: 160px;
        max-height: 160px;
        width: 100%;
        overflow: hidden;
    }

    .portfolio-image img {
        object-fit: contain;
        object-position: center;
        width: 100%;
        height: 100%;
        display: block;
    }

    .portfolio-item--website .portfolio-image {
        height: 160px;
        min-height: 160px;
        max-height: 160px;
    }

    .portfolio-content {
        padding: 16px;
        max-height: 220px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #portfolio-section .portfolio-item {
        min-width: 0;
    }

    .portfolio-content h3 {
        font-size: 16px;
    }

    .portfolio-content p {
        font-size: 13px;
    }

    .certificates-gallery {
        gap: 20px;
    }

    .certificate-image-wrapper {
        min-height: 200px;
    }

    .certificate-info {
        padding: 16px;
    }

    .certificate-info h3 {
        font-size: 14px;
    }

    .reviews-grid {
        gap: 20px;
    }

    .review-card {
        padding: 20px;
    }

    .review-avatar {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .review-name {
        font-size: 15px;
    }

    .review-service {
        font-size: 11px;
    }

    .review-text {
        font-size: 13px;
    }

    .section-personal .card {
        padding: 20px;
    }

    .btn-telegram {
        display: block;
        width: 100%;
        text-align: center;
        margin: 16px 0;
        padding: 14px 24px;
    }

    .footer {
        padding: 24px 0;
    }

    .footer p {
        font-size: 13px;
    }

    #contact .card p {
        margin-top: 12px;
        word-break: break-word;
    }

    #contact .card a {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    section {
        padding: 40px 0;
    }

    section h2 {
        font-size: 22px;
        margin-bottom: 24px;
    }

    .about-title-block h3 {
        font-size: 29px;
    }

    .logo-img {
        height: 56px;
    }

    .logo {
        font-size: 18px;
    }

    .logo-slogan {
        font-size: 11px;
    }

    .profile-photo {
        width: 140px;
        height: 140px;
    }

    .portfolio-images {
        height: auto;
        min-height: 0;
        grid-template-rows: 140px 140px;
        grid-auto-rows: 140px;
    }

    .portfolio-image {
        height: 140px;
        min-height: 140px;
        max-height: 140px;
        width: 100%;
        overflow: hidden;
    }

    .portfolio-image img {
        object-fit: contain;
        object-position: center;
    }

    .portfolio-item--website .portfolio-image {
        height: 140px;
        min-height: 140px;
        max-height: 140px;
    }

    .certificate-image-wrapper {
        min-height: 160px;
    }
}
