:root {
    --bg: #080909;
    --bg-soft: #0d0f0f;
    --card: #101313;
    --border: #202525;

    --text: #eeeeeb;
    --muted: #8b9290;

    --accent: #9cffb0;
    --accent-dark: #17351f;

    --max-width: 1150px;
}


/* =========================
   RESET
========================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.6;
}

body::before {
    content: "";

    position: fixed;
    inset: 0;

    pointer-events: none;

    opacity: 0.035;

    background-image:
        linear-gradient(
            rgba(255,255,255,0.08) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255,255,255,0.08) 1px,
            transparent 1px
        );

    background-size: 50px 50px;

    mask-image: linear-gradient(
        to bottom,
        black,
        transparent 75%
    );
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

.container {
    width: min(
        calc(100% - 32px),
        var(--max-width)
    );

    margin-inline: auto;
}


/* =========================
   HEADER
========================= */

.header {
    position: sticky;
    top: 0;
    z-index: 100;

    background: rgba(8, 9, 9, 0.82);

    backdrop-filter: blur(14px);

    border-bottom: 1px solid var(--border);
}

.nav {
    min-height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: monospace;

    font-size: 1.2rem;
    font-weight: 800;

    letter-spacing: -0.08em;
}

.logo span {
    color: var(--accent);
}

nav {
    display: none;

    align-items: center;

    gap: 30px;
}

nav a {
    color: var(--muted);

    font-size: 0.9rem;

    transition:
        color 0.2s ease;
}

nav a:hover {
    color: var(--text);
}

.menu-toggle {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);
    border-radius: 6px;

    background: var(--card);

    color: var(--text);

    cursor: pointer;
}


/* =========================
   HERO
========================= */

.hero {
    min-height: calc(100vh - 72px);

    display: flex;
    align-items: center;

    padding:
        80px 0
        100px;
}

.hero-content {
    max-width: 950px;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;

    color: var(--accent);

    font-family: monospace;
    font-size: 0.75rem;

    letter-spacing: 0.12em;
}

.eyebrow::before {
    content: "";

    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--accent);

    box-shadow:
        0 0 12px rgba(156, 255, 176, 0.5);
}

.hero h1 {
    margin: 24px 0;

    max-width: 900px;

    font-size:
        clamp(
            3.5rem,
            13vw,
            8.5rem
        );

    line-height: 0.88;

    letter-spacing: -0.075em;

    font-weight: 750;
}

.hero h1 span {
    color: var(--accent);
}

.hero-text {
    max-width: 650px;

    margin: 35px 0 0;

    color: var(--muted);

    font-size:
        clamp(
            1rem,
            2vw,
            1.2rem
        );
}

.hero-buttons {
    display: flex;

    flex-direction: column;

    gap: 10px;

    margin-top: 35px;
}

.button {
    min-height: 48px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 0 20px;

    border: 1px solid var(--border);
    border-radius: 5px;

    font-size: 0.9rem;
    font-weight: 650;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button.primary {
    background: var(--accent);

    color: #071008;

    border-color: var(--accent);
}

.button.secondary:hover {
    border-color: var(--accent);

    color: var(--accent);
}


/* =========================
   SECTIONS
========================= */

.section {
    padding: 110px 0;
}

.section-alt {
    background: var(--bg-soft);

    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-label {
    margin: 0;

    color: var(--accent);

    font-family: monospace;

    font-size: 0.75rem;

    letter-spacing: 0.12em;
}

.section h2 {
    margin:
        18px 0 55px;

    max-width: 800px;

    font-size:
        clamp(
            2.3rem,
            6vw,
            4.5rem
        );

    line-height: 0.95;

    letter-spacing: -0.06em;
}


/* =========================
   ABOUT
========================= */

.about-grid {
    display: grid;

    gap: 50px;
}

.about-grid p {
    max-width: 650px;

    color: var(--muted);

    font-size: 1.05rem;
}

.about-card {
    border: 1px solid var(--border);

    background:
        linear-gradient(
            135deg,
            rgba(156,255,176,0.035),
            transparent 50%
        );

    padding: 25px;
}

.about-card div {
    display: flex;
    flex-direction: column;

    padding: 18px 0;

    border-bottom: 1px solid var(--border);
}

.about-card div:last-child {
    border-bottom: 0;
}

.about-card span {
    margin-bottom: 5px;

    color: #626966;

    font-family: monospace;

    font-size: 0.7rem;

    letter-spacing: 0.08em;
}

.about-card strong {
    font-size: 0.95rem;
}


/* =========================
   SKILLS
========================= */

.skills-grid {
    display: grid;

    gap: 12px;
}

.skill {
    min-height: 190px;

    padding: 25px;

    background: var(--card);

    border: 1px solid var(--border);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.skill:hover {
    transform: translateY(-3px);

    border-color:
        rgba(156,255,176,0.35);
}

.skill h3 {
    margin:
        0 0 12px;

    font-size: 1rem;
}

.skill p {
    margin: 0;

    color: var(--muted);

    font-size: 0.9rem;
}


/* =========================
   PROJECTS
========================= */

.projects-grid {
    display: grid;

    gap: 15px;
}

.project-card {
    position: relative;

    min-height: 330px;

    display: flex;
    flex-direction: column;

    padding: 28px;

    background: var(--card);

    border: 1px solid var(--border);

    overflow: hidden;

    transition:
        transform 0.25s ease,
        border-color 0.25s ease;
}

.project-card::after {
    content: "";

    position: absolute;

    width: 180px;
    height: 180px;

    right: -90px;
    bottom: -90px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(156,255,176,0.08),
            transparent 70%
        );
}

.project-card:hover {
    transform: translateY(-5px);

    border-color:
        rgba(156,255,176,0.45);
}

.project-number {
    margin-bottom: 45px;

    color: var(--accent);

    font-family: monospace;

    font-size: 0.75rem;
}

.project-card h3 {
    margin: 0 0 12px;

    font-size: 1.4rem;

    letter-spacing: -0.03em;
}

.project-card p {
    margin: 0;

    color: var(--muted);

    font-size: 0.9rem;
}

.tags {
    display: flex;

    flex-wrap: wrap;

    gap: 7px;

    margin-top: auto;
    padding-top: 25px;
}

.tags span {
    padding:
        4px 8px;

    border: 1px solid #2b3330;
    border-radius: 3px;

    color: #9da6a2;

    font-family: monospace;

    font-size: 0.7rem;
}


/* =========================
   CONTACT
========================= */

.contact {
    text-align: center;
}

.contact .section-label {
    justify-content: center;
}

.contact h2 {
    margin-bottom: 25px;
}

.contact p {
    max-width: 550px;

    margin:
        0 auto 30px;

    color: var(--muted);
}


/* =========================
   FOOTER
========================= */

footer {
    padding: 30px 0;

    border-top: 1px solid var(--border);

    color: #5e6662;

    font-family: monospace;

    font-size: 0.7rem;
}


/* =========================
   MOBILE MENU
========================= */

@media (max-width: 849px) {

    nav.open {
        position: absolute;

        top: 72px;
        left: 0;
        right: 0;

        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 0;

        background: #080909;

        border-bottom: 1px solid var(--border);
    }

    nav.open a {
        padding: 18px 16px;

        border-bottom: 1px solid var(--border);
    }
}


/* =========================
   TABLET
========================= */

@media (min-width: 600px) {

    .container {
        width:
            min(
                calc(100% - 48px),
                var(--max-width)
            );
    }

    .hero-buttons {
        flex-direction: row;

        justify-content: flex-start;
    }

    .skills-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .projects-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }
}


/* =========================
   DESKTOP
========================= */

@media (min-width: 850px) {

    .menu-toggle {
        display: none;
    }

    nav {
        display: flex;
    }

    .about-grid {
        grid-template-columns:
            1.3fr 0.7fr;

        align-items: start;
    }

    .skills-grid {
        grid-template-columns:
            repeat(3, 1fr);
    }

    .projects-grid {
        grid-template-columns:
            repeat(3, 1fr);
    }
}


/* =========================
   LARGE DESKTOP
========================= */

@media (min-width: 1400px) {

    .hero h1 {
        font-size: 9rem;
    }
}


/* =========================
   REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
    }
}


/* =========================
   HOMELAB
========================= */

.homelab-hero {
    min-height: 75vh;
}

.hero-tags {
    margin-top: 35px;
}


/* =========================
   LAB DIAGRAM
========================= */

.lab-diagram {
    max-width: 850px;
    margin: 0 auto;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 12px;
}

.diagram-node {
    width: min(100%, 360px);

    padding: 22px;

    display: flex;
    flex-direction: column;

    background: var(--card);

    border: 1px solid var(--border);

    text-align: center;

    transition:
        border-color 0.2s ease,
        transform 0.2s ease;
}

.diagram-node:hover {
    transform: translateY(-3px);

    border-color:
        rgba(156, 255, 176, 0.4);
}

.diagram-node span {
    margin-bottom: 8px;

    color: var(--accent);

    font-family: monospace;

    font-size: 0.7rem;
}

.diagram-node strong {
    font-size: 1rem;
}

.diagram-node small {
    margin-top: 5px;

    color: var(--muted);

    font-family: monospace;

    font-size: 0.7rem;
}

.diagram-node.highlight {
    border-color:
        rgba(156, 255, 176, 0.3);

    background:
        linear-gradient(
            135deg,
            rgba(156, 255, 176, 0.06),
            var(--card)
        );
}

.diagram-line {
    color: var(--accent);

    font-family: monospace;

    font-size: 1.3rem;
}

.diagram-cluster {
    width: 100%;

    display: grid;

    grid-template-columns: 1fr;

    gap: 12px;
}


@media (min-width: 600px) {

    .diagram-cluster {
        grid-template-columns:
            repeat(3, 1fr);
    }

}



/* =========================
   ARCHITECTURE IMAGE
========================= */

.section-intro {
    max-width: 700px;

    margin: 0 auto 40px;

    color: var(--muted);

    text-align: center;

    line-height: 1.7;
}


.architecture-image {
    width: 100%;

    overflow: hidden;

    border: 1px solid var(--border);

    background: #0d0f10;

    border-radius: 12px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.35);
}


.architecture-image img {
    display: block;

    width: 100%;
    height: auto;

    transition:
        transform 0.3s ease;
}


.architecture-image:hover img {
    transform: scale(1.01);
}



/* =========================
    Project-link
========================= */




.project-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-top: 28px;
    padding: 11px 16px;

    min-width: 140px;

    border: 1px solid #555;
    border-radius: 6px;

    background: transparent;

    color: #fff;

    font-family: monospace;
    font-size: 0.8rem;
    text-decoration: none;

    box-sizing: border-box;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.project-link-text {
    color: #fff;
}

.project-link-arrow {
    color: var(--accent);
    font-size: 1rem;

    transition:
        transform 0.2s ease;
}

.project-link:hover {
    border-color: var(--accent);

    background: rgba(255, 255, 255, 0.04);

    transform: translateY(-2px);
}

.project-link:hover .project-link-arrow {
    transform: translateX(4px);
}

/* =========================
   HOMELAB ZONES
========================= */

.lab-zones {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}


.lab-zone {
    padding: 28px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--card);

    transition:
        border-color 0.2s ease,
        transform 0.2s ease;
}


.lab-zone:hover {
    border-color: rgba(156, 255, 176, 0.35);

    transform: translateY(-3px);
}


/* HEADER */

.lab-zone-header {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}


.lab-zone-number {
    display: block;

    margin-bottom: 7px;

    color: var(--accent);

    font-family: monospace;
    font-size: 0.7rem;
}


.lab-zone h3 {
    margin: 0;

    font-size: 1.35rem;
}


.lab-zone-type {
    padding: 5px 9px;

    border: 1px solid var(--border);
    border-radius: 4px;

    color: var(--muted);

    font-family: monospace;
    font-size: 0.65rem;

    white-space: nowrap;
}


/* DESCRIPTION */

.lab-zone-description {
    max-width: 650px;

    margin-bottom: 25px;

    color: var(--muted);

    line-height: 1.7;
}


/* SERVICES */

.service-list {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    border-top: 1px solid var(--border);
}


.service-item {
    display: flex;

    flex-direction: column;

    gap: 4px;

    padding: 14px 0;

    border-bottom: 1px solid var(--border);
}


.service-item:nth-child(odd) {
    padding-right: 15px;
}


.service-item:nth-child(even) {
    padding-left: 15px;

    border-left: 1px solid var(--border);
}


.service-item strong {
    font-size: 0.85rem;
}


.service-item span {
    color: var(--muted);

    font-family: monospace;
    font-size: 0.65rem;
}


.lab-zones {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.lab-zone {
    width: 100%;
    box-sizing: border-box;
}


@media (max-width: 500px) {

    .lab-zone {
        padding: 20px;
    }


    .service-list {
        grid-template-columns: 1fr;
    }


    .service-item:nth-child(even) {
        padding-left: 0;

        border-left: none;
    }


    .service-item:nth-child(odd) {
        padding-right: 0;
    }

}

/* =========================
   HOST GROUPS
========================= */

.host-group {
    margin-top: 22px;

    border: 1px solid var(--border);
    border-radius: 6px;

    overflow: hidden;

    background: rgba(255, 255, 255, 0.015);
}


.host-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 13px 16px;

    border-bottom: 1px solid var(--border);
}


.host-header strong {
    font-family: monospace;
    font-size: 0.8rem;
}


.host-header span {
    color: var(--muted);

    font-family: monospace;
    font-size: 0.65rem;
}

.host-group .service-list {
    border-top: none;
    padding: 0 20px;
}

.host-group .service-item {
    padding: 14px 0;
}

.host-group .service-item:nth-child(odd),
.host-group .service-item:nth-child(even) {
    padding-left: 0;
    padding-right: 0;
}

.host-group .service-item:nth-child(even) {
    border-left: none;
}

.host-empty {
    margin: 0;

    padding: 16px;

    color: var(--muted);

    font-family: monospace;
    font-size: 0.7rem;
}


/* =========================
   ARCHITECTURE IMAGE
========================= */

.architecture-image img {
    display: block;
    width: 100%;
    height: auto;
    cursor: zoom-in;
}


/* =========================
   FULLSCREEN LIGHTBOX
========================= */

.architecture-lightbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;

    z-index: 99999 !important;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 30px;

    box-sizing: border-box;

    background: rgba(0, 0, 0, 0.95);
}


/* SHOW LIGHTBOX */

.architecture-lightbox.active {
    display: flex;
}


/* FULLSCREEN IMAGE */

.architecture-lightbox img {
    display: block;

    max-width: 95vw;
    max-height: 90vh;

    width: auto;
    height: auto;

    object-fit: contain;

    cursor: default;
}


/* CLOSE BUTTON */

.architecture-close {
    position: absolute !important;

    top: 20px;
    right: 25px;

    z-index: 100000 !important;

    width: 45px;
    height: 45px;

    padding: 0;

    border: 1px solid #555;
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.8);

    color: white;

    font-size: 28px;
    line-height: 40px;

    text-align: center;

    cursor: pointer;
}


.architecture-close:hover {
    border-color: var(--accent);
    color: var(--accent);
}


/* MOBILE */

@media (max-width: 600px) {

    .architecture-lightbox {
        padding: 10px;
    }

    .architecture-lightbox img {
        max-width: 100vw;
        max-height: 90vh;
    }

    .architecture-close {
        top: 10px;
        right: 10px;
    }

}