/* ── Fonts ── */
@font-face {
    font-family: 'JetBrains Mono';
    src: url('fonts/jetbrainsmono-light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'JetBrains Mono';
    src: url('fonts/jetbrainsmono-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'JetBrains Mono';
    src: url('fonts/jetbrainsmono-medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* ── Palette ── */
:root {
    --bg:      #0a0a0a;
    --surface: #111111;
    --border:  #1e1e1e;
    --text:    #d5d5d5;
    --dim:     #888;
    --accent:  #e8e8e8;
    --radius:  6px;
}

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Base ── */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img[src$=".svg"] {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(0.6);
    vertical-align: middle;
    flex-shrink: 0;
}

/* ── Page ── */
.page {
    max-width: 640px;
    margin: 0 auto;
    padding: 3rem 1.5rem 2rem;
}

/* ── Header ── */
.header {
    margin-bottom: 2rem;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.header-id {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header h1 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent);
    line-height: 1.2;
}

.header-subtitle {
    font-size: 0.75rem;
    color: var(--dim);
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.72rem;
    color: var(--dim);
    transition: color 0.15s, border-color 0.15s;
}

.nav-btn:hover {
    color: var(--accent);
    border-color: #333;
}

.header-bio {
    color: var(--dim);
    font-size: 0.8rem;
    line-height: 1.7;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

/* ── Section ── */
.section {
    margin-bottom: 2.5rem;
}

.section-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.section-heading {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.section-desc {
    font-size: 0.72rem;
    color: var(--dim);
    text-align: center;
    margin-bottom: 1.25rem;
    line-height: 1.7;
}

.exp-hint {
    font-size: 0.65rem;
    color: var(--dim);
    text-align: center;
    margin-bottom: 1rem;
}

/* ── Experience ── */
.exp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.5rem;
}

.exp-card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0 1rem;
    align-items: baseline;
}

.exp-label {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text);
}

.exp-value {
    font-size: 0.7rem;
    color: var(--dim);
    text-align: right;
}

.exp-bar {
    grid-column: 1 / -1;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
    margin-top: 0.4rem;
    overflow: hidden;
}

.exp-bar span {
    display: block;
    height: 100%;
    background: var(--dim);
    border-radius: 1px;
}

/* ── Stack (Languages) ── */
.stack-group {
    margin-bottom: 1.25rem;
}

.stack-group:last-of-type {
    margin-bottom: 0;
}

.stack-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

/* ── Tech Rows ── */
.tech-rows {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
}

.tech-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tech-key {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.tech-key::before,
.tech-key::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.tech-val {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.tech-val a {
    color: var(--text);
    white-space: nowrap;
    transition: color 0.15s;
}

.tech-val a:hover {
    color: var(--accent);
}


/* ── Domains ── */
.domains {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.domain {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    font-size: 0.8rem;
}

.domain-key {
    color: var(--accent);
    font-weight: 400;
    white-space: nowrap;
    min-width: 4rem;
}

.domain-sep {
    flex: 1;
    border-bottom: 1px dotted var(--border);
    min-width: 1rem;
    align-self: center;
    margin-bottom: 2px;
}

.domain-val {
    color: var(--dim);
    font-size: 0.72rem;
}

.quote {
    font-size: 0.72rem;
    color: var(--dim);
    font-style: italic;
    margin-top: 0.5rem;
}

/* ── Projects ── */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.project-row {
    font-size: 0.8rem;
    color: var(--text);
    padding-left: 1rem;
    position: relative;
}

.project-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--dim);
}

/* ── Hardware ── */
.hw-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 540px) {
    .hw-grid {
        grid-template-columns: 1fr;
    }
}

.hw-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.35rem;
}

.hw-table td {
    font-size: 0.72rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border);
}

.hw-table tr:last-child td {
    border-bottom: none;
}

.hw-table td:first-child {
    color: var(--dim);
    width: 4.5rem;
    padding-right: 0.75rem;
}

.hw-table td:last-child {
    color: var(--text);
}

/* ── Services ── */
.services {
    columns: 3;
    column-gap: 1rem;
    margin-top: 0.75rem;
}

.services a {
    display: block;
    font-size: 0.7rem;
    color: var(--dim);
    padding: 0.25rem 0;
    padding-left: 0.6rem;
    border-left: 1px solid var(--border);
    transition: color 0.15s, border-color 0.15s;
}

.services a:hover {
    color: var(--accent);
    border-left-color: var(--accent);
}

/* ── Contact ── */
.contact-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--dim);
    transition: color 0.15s;
}

.contact-item:hover {
    color: var(--accent);
}

.contact-item:hover img {
    filter: brightness(0) invert(1);
}

/* ── Last Update ── */
.last-update {
    margin-top: 1rem;
    font-size: 0.55rem;
    color: #333;
}

/* ── Footer ── */
footer {
    margin-top: 1.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.7rem;
    color: var(--dim);
    line-height: 1.8;
}

/* ── Fade in ── */
.fade-in {
    opacity: 0;
    transform: translateY(10px);
    animation: rise 0.4s ease forwards;
}

@keyframes rise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in:nth-child(1)  { animation-delay: 0s; }
.fade-in:nth-child(2)  { animation-delay: 0.04s; }
.fade-in:nth-child(3)  { animation-delay: 0.08s; }
.fade-in:nth-child(4)  { animation-delay: 0.12s; }
.fade-in:nth-child(5)  { animation-delay: 0.16s; }
.fade-in:nth-child(6)  { animation-delay: 0.20s; }
.fade-in:nth-child(7)  { animation-delay: 0.24s; }
.fade-in:nth-child(8)  { animation-delay: 0.28s; }

/* ── Mobile ── */
@media (max-width: 540px) {
    .page {
        padding: 2rem 1rem 1.5rem;
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .domain {
        flex-direction: column;
        gap: 0.15rem;
    }

    .domain-sep {
        display: none;
    }

    .contact-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .exp-grid {
        grid-template-columns: 1fr;
    }

}

/* ── CSP-safe width helpers ── */
.w-0   { width: 0%; }
.w-30  { width: 30%; }
.w-40  { width: 40%; }
.w-50  { width: 50%; }
.w-60  { width: 60%; }
.w-70  { width: 70%; }
.w-90  { width: 90%; }
.w-100 { width: 100%; }
.link-underline { text-decoration: underline; }
