:root {
    --kb-black: #0d0d0d;
    --kb-panel: #151515;
    --kb-panel-soft: #1b1b1b;
    --kb-heading: #ffffff;
    --kb-text: #a9a9a9;
    --kb-muted: #777777;
    --kb-accent: #00a86b;
    --kb-link: #00a86b;
    --kb-topbar: rgba(12, 12, 12, 0.78);
    --kb-font: 'Poppins', Arial, sans-serif;
    --kb-body-size: 16px;
    --kb-shell: 1180px;
}

* { box-sizing: border-box; }

.kb-html,
.kb-theme {
    min-height: 100%;
}

.kb-theme {
    margin: 0;
    color: var(--kb-text);
    background-color: var(--kb-black);
    background-image: linear-gradient(90deg, rgba(12, 12, 12, 0.96) 0%, rgba(12, 12, 12, 0.82) 45%, rgba(12, 12, 12, 0.62) 100%);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: var(--kb-font);
    font-size: var(--kb-body-size);
    line-height: 1.7;
}

.kb-theme a {
    color: var(--kb-link);
    text-decoration: none;
}

.kb-header {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 82px;
    display: grid;
    grid-template-columns: minmax(180px, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(12px, 1.8vw, 24px);
    padding: 20px clamp(18px, 3vw, 46px);
    background: var(--kb-topbar);
    backdrop-filter: blur(16px);
    overflow: visible;
}

.kb-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--kb-heading);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: 0;
}

.kb-brand-photo {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--kb-accent);
}

.kb-brand-mark {
    width: 28px;
    height: 28px;
    display: inline-block;
    background: linear-gradient(135deg, var(--kb-accent) 0 50%, transparent 50% 100%);
    border: 2px solid var(--kb-accent);
}

.kb-nav {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.5vw, 24px);
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.kb-nav-link,
.kb-nav-button,
.kb-cv-link,
.kb-page-nav a,
.kb-footer a {
    color: var(--kb-heading);
    font: inherit;
    font-weight: 600;
    opacity: 0.78;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.kb-nav-link:hover,
.kb-nav-link.is-active,
.kb-cv-link:hover,
.kb-page-nav a:hover {
    color: var(--kb-accent);
    opacity: 1;
}

.kb-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    white-space: nowrap;
}

.kb-header-actions details,
.kb-lang {
    position: relative;
    flex: 0 0 auto;
}

.kb-header-actions summary,
.kb-lang__summary {
    list-style: none;
    color: var(--kb-heading);
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 48px;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.kb-header-actions summary::-webkit-details-marker,
.kb-lang__summary::-webkit-details-marker {
    display: none;
}

.kb-lang__caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
}

.kb-lang__panel,
.kb-header-actions details ul {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 92px;
    margin: 0;
    padding: 10px;
    background: var(--kb-panel);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    z-index: 80;
}

.kb-lang__panel {
    display: grid;
    gap: 6px;
    min-width: 170px;
}

.kb-lang__opt {
    display: block;
    color: var(--kb-heading);
    padding: 8px 10px;
    opacity: 0.82;
}

.kb-lang__opt:hover,
.kb-lang__opt.is-active {
    color: var(--kb-accent);
    opacity: 1;
}

.kb-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: transparent;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.kb-menu-button span {
    width: 18px;
    height: 2px;
    background: var(--kb-heading);
}

.kb-page-nav {
    position: sticky;
    top: 82px;
    z-index: 40;
    display: flex;
    justify-content: center;
    gap: 18px;
    padding: 10px 18px;
    background: rgba(12, 12, 12, 0.72);
    backdrop-filter: blur(12px);
}

.kb-main {
    min-height: calc(100vh - 82px);
}

.kb-shell,
.kb-section,
.kb-blog-detail {
    width: min(100% - 36px, var(--kb-shell));
    margin-inline: auto;
}

.kb-hero {
    min-height: calc(100vh - 82px);
    display: grid;
    place-items: center;
    padding: clamp(90px, 12vh, 150px) 18px;
    text-align: center;
}

.kb-hero-content {
    max-width: 900px;
}

.kb-hero-title {
    margin: 0 0 24px;
    color: var(--kb-heading);
    font-size: clamp(3.25rem, 7vw, 6.25rem);
    line-height: 0.98;
    font-weight: 900;
}

.kb-rotator {
    min-height: 48px;
    color: var(--kb-heading);
    font-size: clamp(1.25rem, 2.8vw, 2rem);
    font-weight: 500;
}

.kb-rotating-title {
    color: var(--kb-heading);
}

.kb-caret {
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 4px;
    background: var(--kb-accent);
    vertical-align: -0.14em;
    animation: kbBlink 0.8s steps(1) infinite;
}

@keyframes kbBlink {
    50% { opacity: 0; }
}

.kb-social-rail {
    position: fixed;
    right: 32px;
    bottom: 34px;
    z-index: 30;
}

.kb-social-links {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.kb-social-link {
    color: var(--kb-heading);
    font-size: 1.05rem;
}

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

.kb-section {
    padding: clamp(76px, 10vw, 120px) 0;
}

.kb-section-kicker {
    display: block;
    margin-bottom: 12px;
    color: var(--kb-muted);
    font-weight: 600;
}

.kb-section-title {
    margin: 0 0 54px;
    color: var(--kb-heading);
    font-size: clamp(2.4rem, 4vw, 4rem);
    line-height: 1;
    font-weight: 900;
}

.kb-section-title::after {
    content: "";
    display: block;
    width: 78px;
    height: 4px;
    margin-top: 28px;
    background: linear-gradient(90deg, var(--kb-accent) 0 70%, transparent 70% 78%, var(--kb-accent) 78% 88%, transparent 88% 100%);
}

.kb-about-grid,
.kb-contact-grid,
.kb-resume-grid,
.kb-office-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
    gap: clamp(34px, 6vw, 74px);
    align-items: start;
}

.kb-profile-photo {
    width: 100%;
    max-height: 620px;
    object-fit: cover;
}

.kb-lead-title {
    margin: 0 0 20px;
    color: var(--kb-heading);
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    line-height: 1.25;
}

.kb-accent {
    color: var(--kb-accent);
}

.kb-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 36px;
    margin: 34px 0;
    padding-top: 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.kb-info-grid strong {
    color: var(--kb-heading);
    margin-right: 8px;
}

.kb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 28px;
    color: var(--kb-black) !important;
    background: var(--kb-accent);
    border-radius: 999px;
    border: 0;
    font-weight: 700;
}

.kb-button:hover {
    filter: brightness(1.08);
}

.kb-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.kb-card {
    min-height: 230px;
    padding: 34px;
    background: var(--kb-panel);
}

.kb-card i {
    color: var(--kb-accent);
    font-size: 2.7rem;
    margin-bottom: 28px;
}

.kb-card h3 {
    margin: 0 0 14px;
    color: var(--kb-heading);
    font-size: 1.35rem;
}

.kb-card p {
    margin: 0;
}

.kb-faq-section {
    padding-bottom: clamp(38px, 6vw, 74px);
}

.kb-faq-list {
    display: grid;
    gap: 12px;
    max-width: 980px;
}

.kb-faq-item {
    background: var(--kb-panel);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.kb-faq-item summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    color: var(--kb-heading);
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.kb-faq-item summary::-webkit-details-marker {
    display: none;
}

.kb-faq-item summary::before {
    content: "+";
    color: var(--kb-accent);
    font-size: 1.15rem;
    line-height: 1;
}

.kb-faq-item[open] summary::before {
    content: "-";
}

.kb-faq-answer {
    padding: 0 22px 20px 46px;
}

.kb-project-grid,
.kb-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
}

.kb-project-card,
.kb-post-card {
    display: block;
    background: var(--kb-panel);
    color: var(--kb-heading);
}

.kb-project-card img,
.kb-post-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 0.92;
    object-fit: cover;
}

.kb-card-body {
    padding: 22px;
}

.kb-tag {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--kb-accent);
    font-size: 0.88rem;
    font-weight: 700;
}

.kb-timeline {
    border-left: 2px solid var(--kb-accent);
    background: var(--kb-panel);
}

.kb-timeline-item {
    position: relative;
    padding: 28px 30px 28px 44px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kb-timeline-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 38px;
    width: 24px;
    height: 14px;
    background: var(--kb-accent);
    clip-path: polygon(0 0, 75% 0, 100% 50%, 75% 100%, 0 100%);
}

.kb-skill-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px;
}

.kb-skill-name {
    display: flex;
    justify-content: space-between;
    color: var(--kb-heading);
    font-weight: 700;
    margin-bottom: 10px;
}

.kb-skill-bar {
    height: 10px;
    background: #2b2b2b;
}

.kb-skill-fill {
    height: 100%;
    background: var(--kb-accent);
}

.kb-contact-list {
    display: grid;
    gap: 22px;
}

.kb-contact-item {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 18px;
    align-items: center;
}

.kb-contact-item i {
    color: var(--kb-accent);
    font-size: 2rem;
    text-align: center;
}

.kb-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.kb-input,
.kb-textarea {
    width: 100%;
    border: 0;
    background: var(--kb-panel);
    color: var(--kb-heading);
    padding: 16px 18px;
    font: inherit;
}

.kb-input.is-invalid,
.kb-textarea.is-invalid {
    outline: 1px solid rgba(255, 95, 95, 0.86);
}

.kb-textarea {
    min-height: 170px;
    grid-column: 1 / -1;
    resize: vertical;
}

.kb-field-error {
    margin-top: 7px;
    color: #ff8f8f;
    font-size: 0.88rem;
    line-height: 1.4;
}

.kb-alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    background: var(--kb-panel);
    border-left: 3px solid var(--kb-accent);
    color: var(--kb-heading);
}

.kb-alert-warning {
    border-left-color: #ffb454;
}

.kb-alert-success {
    border-left-color: var(--kb-accent);
}


.kb-blog-detail {
    padding: clamp(90px, 11vw, 130px) 0;
}

.kb-blog-detail-title {
    margin: 0 0 18px;
    color: var(--kb-heading);
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: 1.04;
}

.kb-blog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 34px;
    color: var(--kb-muted);
}

.kb-blog-cover {
    width: 100%;
    max-height: 560px;
    object-fit: cover;
    margin-bottom: 42px;
}

.kb-rich-content {
    max-width: 860px;
    color: var(--kb-text);
    overflow-wrap: anywhere;
}

.kb-rich-content img,
.kb-rich-content iframe,
.kb-rich-content table {
    max-width: 100%;
}

.kb-rich-content pre {
    max-width: 100%;
    overflow-x: auto;
}

.kb-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 34px clamp(18px, 3vw, 46px);
    color: var(--kb-muted);
    background: var(--theme-footer-background-color, transparent);
}

.kb-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

@media (max-width: 980px) {
    .kb-header {
        grid-template-columns: auto auto;
    }

    .kb-menu-button {
        display: inline-flex;
        justify-self: end;
    }

    .kb-nav {
        grid-column: 1 / -1;
        display: none;
        justify-self: stretch;
        flex-direction: column;
        align-items: flex-start;
        padding: 18px 0;
    }

    .kb-nav.is-open {
        display: flex;
    }

    .kb-header-actions {
        grid-column: 1 / -1;
        justify-content: space-between;
    }

    .kb-about-grid,
    .kb-contact-grid,
    .kb-resume-grid,
    .kb-office-grid,
    .kb-card-grid,
    .kb-project-grid,
    .kb-blog-grid,
    .kb-skill-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .kb-header {
        padding: 16px;
    }

    .kb-hero-title {
        font-size: 3rem;
    }

    .kb-info-grid,
    .kb-form-grid {
        grid-template-columns: 1fr;
    }

    .kb-social-rail {
        display: none;
    }
}
