:root {
    --bg: #081c2a;
    --bg-alt: #122532;
    --card-bg: #122532;
    --orange: #ff6104;
    --teal: #01d8b6;
    --teal-hover: #02b39b;
    --text: #ffffff;
    --muted: #c5c5c5;
    --border: rgba(255, 255, 255, 0.08);
    --nav-height: 90px;
    --max-width: 1476px;
    --container-pad: clamp(1.25rem, 6.5vw, 7.875rem);

    /* Type scale — readable, denser than the original design export */
    --fs-xs: 0.85rem;
    --fs-sm: 0.95rem;
    --fs-body: clamp(0.9rem, 1vw, 1.125rem);
    --fs-nav: clamp(0.85rem, 1vw, 1.0625rem);
    --fs-hero: clamp(1.6rem, 2.1vw, 2.5rem);
    --fs-hero-sub: clamp(0.9rem, 1.15vw, 1.25rem);
    --fs-cta: clamp(0.95rem, 1.15vw, 1.25rem);
    --fs-h2: clamp(1.4rem, 1.7vw, 1.875rem);
    --fs-exp-date: clamp(0.9rem, 1vw, 1rem);
    --fs-exp-role: clamp(1.1rem, 1.4vw, 1.5rem);
    --fs-exp-company: clamp(1rem, 1.15vw, 1.1875rem);
    --fs-footer-cta: clamp(1.4rem, 1.9vw, 2rem);
    --fs-contact: clamp(0.9rem, 0.95vw, 1rem);

    --font-heading: "Lucida Sans", "Lucida Sans Unicode", "Lucida Grande", "PT Sans", sans-serif;
    --font-body: "Segoe UI", "Open Sans", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    overflow-x: hidden;
}

a {
    color: inherit;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

.accent-orange { color: var(--orange); }
.accent-teal { color: var(--teal); }

/* ---------- Nav ---------- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg);
    z-index: 1000;
}

nav::after {
    content: '';
    position: absolute;
    left: var(--container-pad);
    right: var(--container-pad);
    bottom: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.22);
}

.nav-container {
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--container-pad);
    display: flex;
    align-items: center;
    position: relative;
}

.nav-logo {
    display: flex;
    align-items: center;
    z-index: 2;
    text-decoration: none;
}

.nav-logo img {
    height: 42px;
    width: auto;
    display: block;
}

.nav-links {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: clamp(1.6rem, 2.9vw, 3.4rem);
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--fs-nav);
    letter-spacing: 0.015em;
    color: var(--text);
    position: relative;
    padding: 0.35rem 0 0.55rem;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--teal);
    transition: width 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--teal-hover);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
    z-index: 2;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

/* ---------- Section helpers ---------- */
.section {
    padding: 5rem 0;
}

.section.band {
    background: var(--bg-alt);
}

.section-title {
    font-family: var(--font-heading);
    font-size: var(--fs-h2);
    font-weight: 600;
    color: var(--orange);
    margin-bottom: 3rem;
}

.section-title.center {
    text-align: center;
}

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh;
    padding-top: var(--nav-height);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(200px, 0.85fr);
    gap: 2rem;
    align-items: center;
    width: 100%;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: var(--fs-hero);
    font-weight: 400;
    line-height: 1.18;
    color: #fff;
}

.hero-sub {
    margin-top: clamp(1.4rem, 2.2vw, 2.4rem);
    max-width: 18.2em;
    color: #fff;
    font-family: var(--font-body);
    font-size: var(--fs-hero-sub);
    line-height: 1.5;
    letter-spacing: 0.01em;
    font-weight: 400;
}

.cta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: clamp(2rem, 3.6vw, 3.4rem);
    color: var(--teal);
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--fs-cta);
}

.cta-link i {
    font-size: 0.85em;
    transition: transform 0.25s ease;
}

.cta-link:hover i {
    transform: translateX(4px);
}

.hero-visual {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.hero-visual img {
    width: min(100%, 274px);
    height: auto;
    display: block;
}

@media (max-width: 900px) {
    .hero-visual { display: none; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero { min-height: auto; padding: calc(var(--nav-height) + 3rem) 0 4rem; }
}

/* ---------- About ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.3fr;
    gap: 3rem;
    align-items: start;
}

.about-left .section-title {
    margin-bottom: 1.4rem;
}

.about-decor {
    --bleed: calc((100vw - min(100vw, var(--max-width))) / 2 + var(--container-pad));
    margin-left: calc(-1 * var(--bleed));
    width: calc(100% + var(--bleed));
}

.about-decor img {
    width: 100%;
    max-width: 504px;
    height: auto;
    display: block;
}

.about-content {
    padding-top: 0.4rem;
}

.about-content p {
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--fs-body);
    margin-bottom: 1.2rem;
    line-height: 1.6;
}

@media (max-width: 800px) {
    .about-grid { grid-template-columns: 1fr; }
    .about-decor {
        margin-left: 0;
        width: 100%;
    }
}

/* ---------- Experience ---------- */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: clamp(2rem, 4vw, 3.5rem);
}

.experience-grid {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    gap: clamp(2rem, 4.5vw, 5rem);
    align-items: start;
}

.exp-date {
    display: inline-block;
    color: #fff;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--fs-exp-date);
    padding-bottom: 0.55rem;
    border-bottom: 1.5px solid var(--teal);
    margin-bottom: 1.15rem;
}

.exp-role {
    font-family: var(--font-heading);
    color: var(--teal);
    font-size: var(--fs-exp-role);
    font-weight: 600;
    margin-bottom: 0.45rem;
    line-height: 1.2;
}

.exp-company {
    color: #fff;
    font-family: var(--font-body);
    font-size: var(--fs-exp-company);
    font-weight: 400;
}

.exp-list {
    list-style: none;
}

.exp-list li {
    position: relative;
    padding-left: 1.9rem;
    margin-bottom: 0.9rem;
    color: #fff;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--fs-body);
    line-height: 1.6;
}

.exp-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 18px;
    height: 5px;
    border-radius: 1px;
    background: var(--teal);
}

@media (max-width: 700px) {
    .experience-grid { grid-template-columns: 1fr; gap: 1.6rem; }
}

/* ---------- Skills ---------- */
.skills-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
}

.skills-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.6rem;
}

.skill-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.6rem 1rem;
    text-align: center;
    width: 135px;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--teal);
}

.skill-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.skill-icon img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    display: block;
}

.skill-icon--js { background: rgba(240, 219, 79, 0.15); color: #f0db4f; }
.skill-icon--ts { background: rgba(0, 122, 204, 0.15); }
.skill-icon--angular { background: rgba(221, 54, 49, 0.15); color: #dd3631; }
.skill-icon--node { background: rgba(83, 169, 84, 0.15); color: #53a954; }
.skill-icon--nestjs { background: rgba(223, 35, 79, 0.15); }
.skill-icon--postgres { background: rgba(51, 103, 145, 0.15); }
.skill-icon--go { background: rgba(1, 216, 182, 0.15); }
.skill-icon--python { background: rgba(55, 118, 171, 0.15); color: #4b8bbe; }
.skill-icon--git { background: rgba(255, 97, 4, 0.15); color: #ff6104; }
.skill-icon--linux { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
.skill-icon--aws { background: rgba(255, 153, 0, 0.15); color: #ff9900; }
.skill-icon--docker { background: rgba(13, 136, 255, 0.15); color: #0db7ed; }

.skill-card h3 {
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: 400;
    color: var(--muted);
}

@media (max-width: 700px) {
    .skill-card { width: 117px; }
}

/* ---------- Projects (Swiper) ---------- */
.projects-carousel {
    position: relative;
    padding: 0 3.2rem;
}

.projects-swiper {
    overflow: hidden;
    padding: 0.5rem;
}

.projects-swiper .swiper-slide {
    height: auto;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.25s ease;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.project-icon {
    color: var(--teal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex: none;
}

.project-card h3 {
    font-family: var(--font-body);
    color: var(--teal);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.25;
}

.project-card p {
    color: var(--muted);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.98rem;
    margin-bottom: 0.75rem;
}

.project-link {
    color: var(--teal);
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--fs-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

.project-link i {
    transition: transform 0.25s ease;
}

.project-link:hover i {
    transform: translateX(4px);
}

.project-tag {
    color: var(--muted);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--fs-xs);
    letter-spacing: 0.02em;
    margin-top: auto;
}

.projects-carousel .swiper-button-prev,
.projects-carousel .swiper-button-next {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    color: var(--text);
    top: 50%;
    margin-top: 0;
    transform: translateY(-50%);
}

.projects-carousel .swiper-button-prev {
    left: 0;
}

.projects-carousel .swiper-button-next {
    right: 0;
}

.projects-carousel .swiper-button-prev::after,
.projects-carousel .swiper-button-next::after {
    font-size: 1rem;
    font-weight: 700;
}

.projects-carousel .swiper-button-prev:hover,
.projects-carousel .swiper-button-next:hover {
    background: var(--teal);
    color: var(--bg);
}

.projects-carousel .swiper-pagination {
    position: static;
    margin-top: 2.2rem;
}

.projects-carousel .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: var(--border);
    opacity: 1;
    border-radius: 50%;
    transition: width 0.25s ease, border-radius 0.25s ease, background 0.25s ease;
}

.projects-carousel .swiper-pagination-bullet-active {
    background: var(--teal);
    width: 20px;
    border-radius: 5px;
}

@media (max-width: 600px) {
    .projects-carousel {
        padding: 0;
    }

    .projects-carousel .swiper-button-prev,
    .projects-carousel .swiper-button-next {
        display: none;
    }
}

/* ---------- Footer ---------- */
footer {
    position: relative;
    padding: 9rem 0 0;
    background-color: var(--bg);
    background-image: url("../assets/footer-circuit.svg");
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
}

.footer-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: clamp(1.5rem, 3.6vw, 4rem);
    align-items: center;
    padding-top: 4rem;
    padding-bottom: 7rem;
}

.footer-cta {
    text-align: left;
    justify-self: end;
    /* margin-right: clamp(1rem, 2.7vw, 2.5rem); */
}

.footer-cta h2 {
    font-family: var(--font-heading);
    color: var(--orange);
    font-size: var(--fs-footer-cta);
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1.15;
    margin-bottom: 1.8rem;
}

.footer-cta img {
    width: min(164px, 50%);
    height: auto;
    display: block;
}

.footer-rule {
    width: 2px;
    height: 198px;
    background: rgba(255, 255, 255, 0.61);
    align-self: center;
}

.footer-contacts {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    justify-content: center;
}

.footer-contacts a {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--fs-contact);
    letter-spacing: 0.02em;
}

.footer-contacts a:hover {
    color: var(--teal);
}

.footer-contacts i {
    color: var(--teal);
    font-size: 1.15rem;
    width: 1.4rem;
    text-align: center;
    flex: none;
}

.footer-bottom {
    position: relative;
    border-top: 1px solid var(--border);
    padding: 1.8rem 0;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 1.8rem;
    justify-content: center;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--muted);
}

@media (max-width: 700px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer-cta { justify-self: start; margin-right: 0; }
    .footer-rule { width: 100%; height: 1px; }
}

/* ---------- Responsive nav ---------- */
@media (max-width: 800px) {
    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        transform: none;
        flex-direction: column;
        background: rgba(8, 28, 42, 0.98);
        padding: 1.5rem 2rem;
        gap: 1.2rem;
        border-bottom: 1px solid var(--border);
        translate: 0 -150%;
        opacity: 0;
        transition: translate 0.3s ease, opacity 0.3s ease;
    }

    .nav-links.open {
        translate: 0 0;
        opacity: 1;
    }

    .nav-toggle {
        display: flex;
    }
}

@media (max-width: 500px) {
    .section { padding: 4rem 0; }
}

/* ---------- Latest posts (homepage) ---------- */
.latest-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.6rem;
}

.latest-post-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.latest-post-card:hover {
    transform: translateY(-5px);
    border-color: var(--teal);
}

.latest-post-date {
    color: var(--muted);
    font-size: var(--fs-xs);
    margin-bottom: 0.75rem;
}

.latest-post-card h3 {
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.latest-post-card h3 a {
    color: var(--teal);
    text-decoration: none;
}

.latest-post-card h3 a:hover {
    color: var(--teal-hover);
}

.latest-post-card p {
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.55;
    margin-bottom: 1rem;
    flex: 1;
}

.latest-posts-footer {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
}

.latest-posts-footer .cta-link {
    margin-top: 0;
    font-size: var(--fs-body);
}

@media (max-width: 900px) {
    .latest-posts-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .latest-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Blog index & posts ---------- */
.blog-section {
    padding-top: calc(var(--nav-height) + 3rem);
    min-height: 60vh;
}

.blog-container {
    max-width: 820px;
}

.blog-header {
    margin-bottom: 2.5rem;
}

.blog-header .section-title {
    margin-bottom: 0.75rem;
}

.blog-intro {
    color: var(--muted);
    font-size: var(--fs-body);
    line-height: 1.6;
}

.blog-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-list-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.6rem 1.8rem;
    transition: border-color 0.25s ease;
}

.blog-list-item:hover {
    border-color: var(--teal);
}

.blog-list-item time {
    display: block;
    color: var(--muted);
    font-size: var(--fs-xs);
    margin-bottom: 0.5rem;
}

.blog-list-item h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.15rem, 1.5vw, 1.4rem);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.6rem;
}

.blog-list-item h2 a {
    color: var(--text);
    text-decoration: none;
}

.blog-list-item h2 a:hover {
    color: var(--teal);
}

.blog-list-item p {
    color: var(--muted);
    font-size: var(--fs-body);
    line-height: 1.55;
    margin-bottom: 0.85rem;
}

.blog-empty {
    color: var(--muted);
    font-size: var(--fs-body);
}

.post-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.post-tags li {
    font-size: var(--fs-xs);
    color: var(--teal);
    border: 1px solid rgba(1, 216, 182, 0.35);
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
}

.post-header {
    margin-bottom: 2.5rem;
}

.post-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--teal);
    text-decoration: none;
    font-size: var(--fs-sm);
    font-weight: 600;
    margin-bottom: 1.4rem;
}

.post-back:hover {
    color: var(--teal-hover);
}

.post-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 2.4vw, 2.4rem);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 0.85rem;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    color: var(--muted);
    font-size: var(--fs-sm);
    margin-bottom: 1rem;
}

/* Post prose */
.post-content {
    font-size: var(--fs-body);
    line-height: 1.7;
    color: var(--text);
}

.post-content > * + * {
    margin-top: 1.15rem;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2.2rem;
    color: var(--orange);
}

.post-content h2 { font-size: 1.45rem; }
.post-content h3 { font-size: 1.25rem; }
.post-content h4 { font-size: 1.1rem; }

.post-content a {
    color: var(--teal);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-content a:hover {
    color: var(--teal-hover);
}

.post-content ul,
.post-content ol {
    padding-left: 1.4rem;
}

.post-content li + li {
    margin-top: 0.4rem;
}

.post-content blockquote {
    border-left: 3px solid var(--teal);
    padding-left: 1rem;
    color: var(--muted);
    font-style: italic;
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.post-content code {
    font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1em 0.35em;
}

.post-content pre {
    background: #0a1620;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.1rem 1.2rem;
    overflow-x: auto;
    line-height: 1.55;
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.88em;
    color: #e6edf3;
}

/* Chroma (Hugo) syntax highlighting — dark, teal-accented */
.post-content .chroma {
    background: transparent;
    color: #e6edf3;
}

.post-content .chroma .k,
.post-content .chroma .kd,
.post-content .chroma .kn,
.post-content .chroma .kp,
.post-content .chroma .kr,
.post-content .chroma .kt { color: #01d8b6; } /* keywords */

.post-content .chroma .s,
.post-content .chroma .s1,
.post-content .chroma .s2,
.post-content .chroma .se { color: #ffb86c; } /* strings */

.post-content .chroma .c,
.post-content .chroma .c1,
.post-content .chroma .cm { color: #8b9bab; font-style: italic; } /* comments */

.post-content .chroma .nx,
.post-content .chroma .nf { color: #79c0ff; } /* names / functions */

.post-content .chroma .m,
.post-content .chroma .mi,
.post-content .chroma .mf { color: #ffa657; } /* numbers */

.post-content .chroma .o { color: #c5c5c5; }
.post-content .chroma .p { color: #c5c5c5; }
.post-content .chroma .nb { color: #01d8b6; }

