:root {
    --bg: #0a0a0a;
    --bg-1: #0e0e0e;
    --bg-2: #141414;
    --line: #1f1f1f;
    --line-2: #2a2a2a;
    --fg: #e6e6e6;
    --fg-dim: #8a8a8a;
    --fg-dimmer: #5a5a5a;
    --accent-h: 253;
    --accent: oklch(0.8 0.14 var(--accent-h));
    --accent-dim: oklch(0.8 0.14 var(--accent-h) / 0.5);
    --accent-faint: oklch(0.8 0.14 var(--accent-h) / 0.12);
    --mono:
        "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
    --sans: "Inter", system-ui, -apple-system, sans-serif;
    --grid-alpha: 0.04;
    --scan-alpha: 0.025;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    background: var(--bg);
    color: var(--fg);
}
body {
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* texture layers — fixed, behind everything */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(
            to right,
            rgba(255, 255, 255, var(--grid-alpha)) 1px,
            transparent 1px
        ),
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, var(--grid-alpha)) 1px,
            transparent 1px
        );
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.4) 70%,
        rgba(0, 0, 0, 0.1) 100%
    );
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(255, 255, 255, var(--scan-alpha)) 3px,
        rgba(255, 255, 255, var(--scan-alpha)) 3px
    );
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
}

#app {
    position: relative;
    z-index: 2;
}

/* ---------- top bar ---------- */
.topbar {
    position: sticky;
    top: 0;
    backdrop-filter: blur(6px);
    background: rgba(10, 10, 10, 0.72);
    border-bottom: 1px solid var(--line);
    z-index: 50;
}
.topbar-inner {
    max-width: 920px;
    margin: 0 auto;
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 13px;
}
.brand {
    color: var(--fg);
    letter-spacing: -0.01em;
    text-decoration: none;
}
.brand .at {
    color: var(--fg-dim);
}
.brand .host {
    color: var(--fg-dim);
}
.brand .accent {
    color: var(--accent);
}
.navlinks {
    display: flex;
    gap: 22px;
}
.navlinks a {
    color: var(--fg-dim);
    text-decoration: none;
    transition: color 120ms ease;
}
.navlinks a:hover {
    color: var(--fg);
}
.navlinks a .hash {
    color: var(--fg-dimmer);
    margin-right: 1px;
}

/* ---------- shell ---------- */
.shell {
    max-width: 920px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ---------- section heads ---------- */
.section {
    padding: 72px 0 8px;
}
.section-head {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--fg-dim);
    text-transform: lowercase;
    letter-spacing: 0.02em;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-head .prompt {
    color: var(--accent);
}
.section-head .cmd {
    color: var(--fg);
}
.section-head .rule {
    flex: 1;
    height: 1px;
    background: linear-gradient(
        to right,
        var(--line) 0%,
        transparent 100%
    );
}

/* ---------- hero / terminal ---------- */
.hero {
    padding: 88px 0 8px;
}
.terminal {
    border: 1px solid var(--line);
    background: var(--bg-1);
    font-family: var(--mono);
    font-size: 13.5px;
    line-height: 1.75;
}
.terminal-titlebar {
    border-bottom: 1px solid var(--line);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--fg-dimmer);
    font-size: 11px;
}
.terminal-titlebar .dots {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.terminal-titlebar .dot {
    width: 9px;
    height: 9px;
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
}
.terminal-titlebar .path {
    margin-left: 8px;
    letter-spacing: 0.02em;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.terminal-titlebar .meta {
    margin-left: auto;
    flex-shrink: 0;
}

.terminal-body {
    padding: 18px 22px 22px;
}
.line {
    display: block;
    color: var(--fg);
    white-space: pre-wrap;
    word-break: break-word;
}
.line + .line {
    margin-top: 0;
}
.blank {
    height: 12px;
}
.prompt-line {
    color: var(--fg-dim);
}
.prompt-line .user {
    color: var(--accent);
}
.prompt-line .at {
    color: var(--fg-dimmer);
}
.prompt-line .host {
    color: var(--fg-dim);
}
.prompt-line .dollar {
    color: var(--fg-dimmer);
    margin: 0 6px 0 4px;
}
.prompt-line .cmd {
    color: var(--fg);
}
.prompt-line .flag {
    color: var(--fg-dim);
}
.out {
    color: var(--fg);
}
.out.dim {
    color: var(--fg-dim);
}
.out.accent {
    color: var(--accent);
}
.out .k {
    color: var(--fg-dim);
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 1.05em;
    background: var(--accent);
    vertical-align: -2px;
    margin-left: 2px;
    animation: blink 1.1s steps(2, start) infinite;
}
@keyframes blink {
    to {
        background: transparent;
    }
}

/* prompt input row (live, at bottom of terminal) */
.prompt-input-row {
    display: flex;
    align-items: center;
    color: var(--fg-dim);
}
.prompt-input-row input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--fg);
    font-family: var(--mono);
    font-size: 13.5px;
    flex: 1;
    min-width: 0;
    padding: 0;
    margin-left: 2px;
    caret-color: var(--accent);
}
.prompt-input-row .hint {
    color: var(--fg-dimmer);
    font-size: 11px;
    margin-left: 12px;
}

/* ---------- projects ---------- */
.projects {
    display: flex;
    flex-direction: column;
}
.project {
    border-top: 1px solid var(--line);
    padding: 22px 4px;
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 28px;
    align-items: baseline;
    cursor: pointer;
    transition: background 140ms ease;
}
.project:last-child {
    border-bottom: 1px solid var(--line);
}
.project:hover {
    background: rgba(255, 255, 255, 0.012);
}
.project:hover .proj-name {
    color: var(--accent);
}
.project-meta {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--fg-dimmer);
    letter-spacing: 0.02em;
    padding-top: 4px;
    display: flex;
    flex-direction: column;
    align-self: stretch;
}
.project-meta .proj-logo {
    width: 76px;
    height: auto;
    margin: auto;
}
.project-main {
    min-width: 0;
}
.proj-name {
    font-family: var(--mono);
    font-size: 16px;
    font-weight: 500;
    color: var(--fg);
    letter-spacing: -0.01em;
    transition: color 120ms ease;
}
.proj-name .star {
    color: var(--fg-dimmer);
    font-weight: 400;
    margin-left: 8px;
    font-size: 12px;
}
.proj-blurb {
    margin-top: 4px;
    color: var(--fg-dim);
    font-size: 14px;
    line-height: 1.55;
}
.proj-stack {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--fg-dim);
}
.proj-stack span::before {
    content: "·";
    margin-right: 8px;
    color: var(--fg-dimmer);
}
.proj-stack span:first-child::before {
    content: "";
    margin: 0;
}

.proj-expand {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--fg-dimmer);
    user-select: none;
    padding-top: 6px;
}
.project.open .proj-expand .chev {
    transform: rotate(90deg);
}
.proj-expand .chev {
    display: inline-block;
    width: 8px;
    transition: transform 160ms ease;
    color: var(--accent);
}

.proj-detail {
    grid-column: 2 / 4;
    margin-top: 14px;
    padding: 14px 16px;
    border-left: 2px solid var(--accent-dim);
    background: var(--accent-faint);
    color: var(--fg);
    font-size: 13.5px;
    line-height: 1.65;
    overflow: hidden;
}
.proj-detail p + p {
    margin-top: 8px;
}
.proj-detail .links {
    margin-top: 12px;
    display: flex;
    gap: 18px;
    font-family: var(--mono);
    font-size: 12px;
}
.proj-detail .links a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-dim);
    padding-bottom: 1px;
}
.proj-detail .links a:hover {
    border-bottom-style: solid;
}
.proj-detail .lessons {
    margin-top: 10px;
    color: var(--fg-dim);
    font-family: var(--mono);
    font-size: 11.5px;
}

/* ---------- blog ---------- */
.posts {
    display: flex;
    flex-direction: column;
}
.post {
    border-top: 1px solid var(--line);
    padding: 18px 4px;
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 28px;
    align-items: baseline;
    cursor: pointer;
    transition: background 140ms ease;
    color: inherit;
    text-decoration: none;
}
.post:last-child {
    border-bottom: 1px solid var(--line);
}
.post:hover {
    background: rgba(255, 255, 255, 0.012);
}
.post:hover .post-title {
    color: var(--accent);
}
.post-date {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--fg-dimmer);
    letter-spacing: 0.02em;
}
.post-title {
    font-family: var(--mono);
    font-weight: 400;
    font-size: 14.5px;
    color: var(--fg);
    letter-spacing: -0.005em;
    transition: color 120ms ease;
}
.post-snippet {
    color: var(--fg-dim);
    font-size: 13px;
    margin-top: 3px;
}
.post-readtime {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--fg-dimmer);
}

/* ---------- contact ---------- */
.contact-card {
    border: 1px solid var(--line);
    background: var(--bg-1);
    padding: 26px 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px 40px;
    font-family: var(--mono);
    font-size: 13px;
}
.contact-field .k {
    color: var(--fg-dim);
    font-size: 11px;
    margin-bottom: 4px;
    text-transform: lowercase;
    letter-spacing: 0.04em;
}
.contact-field .v {
    color: var(--fg);
}
.contact-field a {
    color: var(--fg);
    text-decoration: none;
    border-bottom: 1px dashed var(--line-2);
    padding-bottom: 1px;
}
.contact-field a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent-dim);
}
.contact-field .v.dim {
    color: var(--fg-dim);
    font-size: 12.5px;
    line-height: 1.55;
}

.availability {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    padding-top: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--fg-dim);
    font-size: 12.5px;
}
.availability .pulse {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--accent);
    box-shadow: 0 0 0 0 var(--accent);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 var(--accent-dim);
    }
    70% {
        box-shadow: 0 0 0 8px transparent;
    }
    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}
.availability .accent {
    color: var(--accent);
}

/* ---------- footer ---------- */
footer {
    margin-top: 88px;
    border-top: 1px solid var(--line);
    padding: 26px 0 60px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--fg-dimmer);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
footer .right {
    display: flex;
    gap: 18px;
}

/* ---------- focus / a11y ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- responsive ---------- */
@media (max-width: 680px) {
    .topbar-inner {
        padding: 12px 20px;
    }
    .shell {
        padding: 0 20px;
    }
    .navlinks {
        gap: 14px;
        font-size: 12px;
    }
    .project,
    .post {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .project-meta,
    .post-date {
        font-size: 11px;
    }
    .proj-expand,
    .post-readtime {
        display: none;
    }
    .proj-detail {
        grid-column: 1 / -1;
        margin-top: 12px;
    }
    .contact-card {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 22px;
    }
    .terminal-body {
        padding: 14px 16px 18px;
        font-size: 12.5px;
    }
    .terminal {
        font-size: 12.5px;
    }
}
