* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --page-bg: #121212;
    --surface-bg: #1c1c1c;
    --text: #f2f2f2;
    --muted-text: #b8b8b8;
    --accent: #a78bfa;
    --border: #383838;
    --content-width: 900px;
}

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--text);
    font-family: "RecMono", monospace;
}

@font-face {
    font-family: "RecMono";
    src: url("fonts/RecursiveMonoLnrSt-Regular.woff2") format("woff2");
    font-weight: 400;
}

@font-face {
    font-family: "RecMono";
    src: url("fonts/RecursiveMonoLnrSt-Med.woff2") format("woff2");
    font-weight: 500;
}

@font-face {
    font-family: "RecMono";
    src: url("fonts/RecursiveMonoLnrSt-Bold.woff2") format("woff2");
    font-weight: 700;
}

@font-face {
    font-family: "RecMono Nerd Icons";
    src: url("fonts/RecMonoLinearNerdFont-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 30px;
    transition: padding 0.2s ease;
}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--surface-bg);
    transition: box-shadow 0.2s ease;
}

header.is-compact {
    box-shadow: 0 4px 16px rgb(0 0 0 / 25%);
}

header.is-compact .navbar {
    padding-top: 6px;
    padding-bottom: 6px;
}

section[id] {
    scroll-margin-top: 96px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    transition: gap 0.2s ease;
}

header.is-compact .brand {
    gap: 8px;
}

.logo {
    color: var(--text);
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    transition: font-size 0.2s ease;
}

header.is-compact .logo {
    font-size: 18px;
}

.flag {
    display: block;
    width: 48px;
    height: 30px;
    object-fit: cover;
    transition: width 0.2s ease, height 0.2s ease;
}

header.is-compact .flag {
    width: 36px;
    height: 22px;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    transition: gap 0.2s ease, font-size 0.2s ease;
}

header.is-compact .nav-links {
    gap: 6px 10px;
    font-size: 14px;
}

.nav-links li:not(:last-child) {
    padding-right: 20px;
    border-right: 1px solid var(--border);
    transition: padding 0.2s ease;
}

header.is-compact .nav-links li:not(:last-child) {
    padding-right: 10px;
}

.nav-links a {
    color: #c4c4c4;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--accent);
}

.about,
.linux-section,
.hardware-section,
.homelab-section,
.projects-section {
    width: min(var(--content-width), 100% - 48px);
    margin: 72px auto;
}

.about h1,
.linux-section h2,
.hardware-section h2,
.homelab-section h2,
.projects-section h2 {
    margin: 0 0 20px;
    color: var(--accent);
    font-size: 24px;
}

.linux-section h3,
.hardware-section h3,
.homelab-section h3,
.projects-section h3 {
    margin: 32px 0 12px;
    color: var(--text);
    font-size: 18px;
    font-weight: 500;
}

.about p,
.linux-story p {
    color: var(--muted-text);
    line-height: 1.8;
    text-align: justify;
}

.about p {
    margin: 0 0 28px;
}

.about h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

.interests {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.interests span {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #d0d0d0;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.interests span:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.linux-story {
    max-width: 100%;
}

.linux-story p {
    margin: 0 0 20px;
}

.linux-story p:last-child {
    margin-bottom: 0;
}

.distro-icon {
    font-family: "RecMono Nerd Icons", sans-serif;
    font-size: 1.15em;
    font-weight: 400;
    white-space: nowrap;
}

.hardware-tables {
    display: grid;
    gap: 32px;
}

.hardware-group h3 {
    margin-top: 24px;
}

.hardware-icon {
    font-family: "RecMono Nerd Icons", sans-serif;
    font-size: 1.15em;
    font-weight: 400;
}

.hardware-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.hardware-table th,
.hardware-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    line-height: 1.6;
    vertical-align: top;
}

.hardware-table th {
    width: 190px;
    color: var(--text);
    font-size: 0.95em;
    font-weight: 500;
}

.hardware-table td {
    color: var(--muted-text);
    font-weight: 400;
}

.hardware-table tr:hover th,
.hardware-table tr:hover td {
    background: rgb(255 255 255 / 3%);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 700px) {
    .navbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
        padding: 18px 24px;
    }

    .nav-links {
        justify-content: flex-start;
        gap: 10px 14px;
    }

    .nav-links li:not(:last-child) {
        padding-right: 14px;
    }

    header.is-compact .navbar {
        gap: 8px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    header.is-compact .nav-links {
        gap: 6px 10px;
    }

    header.is-compact .nav-links li:not(:last-child) {
        padding-right: 10px;
    }

    .about,
    .linux-section,
    .hardware-section,
    .homelab-section,
    .projects-section {
        width: calc(100% - 40px);
        margin: 52px auto;
    }

    .hardware-table th,
    .hardware-table td {
        padding: 10px 8px;
    }

    .hardware-table th {
        width: 130px;
    }

    .homelab-host {
        padding: 18px;
    }

    .homelab-specs {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .navbar,
    header,
    .brand,
    .logo,
    .flag,
    .nav-links,
    .nav-links li:not(:last-child) {
        transition: none;
    }
}

.linux-recommendations {
    max-width: 100%;
}

.linux-recommendations ul {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding-left: 24px;
}

.linux-recommendations li {
    color: var(--muted-text);
    font-weight: 400;
    line-height: 1.8;
    text-align: justify;
}

.linux-recommendations li::marker {
    color: var(--accent);
}

.homelab-intro {
    max-width: 760px;
    margin: 0 0 20px;
    color: var(--muted-text);
    line-height: 1.7;
}

.homelab-host,
.service-group {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-bg);
}

.homelab-host {
    max-width: 900px;
    padding: 22px 24px;
}

.homelab-host-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.homelab-host-heading h3 {
    margin: 4px 0 0;
}

.homelab-label {
    margin: 0;
    color: var(--muted-text);
    font-size: 12px;
    letter-spacing: 0.06em;
}

.homelab-icon {
    color: var(--accent);
    font-family: "RecMono Nerd Icons", sans-serif;
    font-size: 28px;
}

.homelab-specs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 32px;
    margin: 20px 0 0;
}

.homelab-specs div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.homelab-specs dt {
    color: var(--muted-text);
}

.homelab-specs dd {
    margin: 0;
    text-align: right;
}

.homelab-service-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    max-width: 900px;
}

.service-group {
    padding: 18px;
}

.service-group h4 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 500;
}

.service-group ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.service-group li {
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--muted-text);
    font-size: 13px;
}

.projects-intro {
    max-width: 100%;
    margin: 0 0 18px;
    color: var(--muted-text);
    line-height: 1.7;
}

.project-list {
    max-width: 100%;
    border-top: 1px solid var(--border);
}

.project-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}

.project-copy h3 {
    margin: 0;
    font-size: 16px;
}

.project-copy h3 a {
    color: var(--text);
    text-decoration: none;
}

.project-copy h3 a:hover,
.project-copy h3 a:focus-visible {
    color: var(--accent);
}

.project-copy h3 a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.project-copy p {
    margin: 7px 0 0;
    color: var(--muted-text);
    line-height: 1.7;
}

.project-status {
    flex-shrink: 0;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--muted-text);
    font-size: 12px;
}

.project-status.is-active {
    border-color: #514276;
    color: #d5c8ff;
}

.github-link {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 9px;
    padding: 12px 16px;
    border: 1px solid #514276;
    border-radius: 6px;
    color: var(--text);
    background: #302747;
    font-size: 14px;
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.github-link:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: #3a3054;
}

.github-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.projects-section > .github-link {
    margin-top: 22px;
}

.github-icon {
    font-family: "RecMono Nerd Icons", sans-serif;
    font-size: 18px;
}

.external-link-icon {
    color: #c4b5fd;
    font-size: 16px;
}

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

@media (prefers-reduced-motion: reduce) {
    .github-link {
        transition: none;
    }
}
