:root {
    --bg: #0a0a0d;
    --panel-border: #2a2a2e;
    --header-bg: #111318;
    --text: #ddd;
    --text-dim: #8a8a90;
    --cyan: #0ff;
    --magenta: #f0f;
    --muted: #777;
    --font-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --radius: 4px;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 20% -10%, rgba(0, 255, 255, 0.07), transparent 40%),
        radial-gradient(circle at 80% 110%, rgba(255, 0, 255, 0.06), transparent 40%);
    background-attachment: fixed;
}

a {
    color: var(--cyan);
}

/* Top nav */
.topnav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 20px 12px 0;
    font-size: 13px;
}

.topnav a {
    color: var(--text-dim);
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius);
}

.topnav a:hover,
.topnav a:focus {
    color: var(--cyan);
    border-color: var(--panel-border);
}

.topnav a.active {
    color: var(--cyan);
    border-color: var(--cyan);
}

/* Terminal card */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 24px 16px 48px;
}

.term-card {
    width: 100%;
    max-width: 720px;
    align-self: flex-start;
    background: var(--bg);
    border: 2px solid var(--panel-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.03);
}

.term-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--cyan);
    background: var(--header-bg);
    border-bottom: 2px solid var(--panel-border);
}

.term-bar .dots {
    display: flex;
    gap: 6px;
}

.term-bar .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.term-bar .dot.r { background: #ff5f56; }
.term-bar .dot.y { background: #ffbd2e; }
.term-bar .dot.g { background: #27c93f; }

.term-body {
    padding: 24px;
}

.page-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 720px;
}

.intro-text {
    margin: 4px 4px 0;
    font-size: 15px;
}

.term-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.term-card.placeholder {
    border-style: dashed;
}

.term-card.placeholder .term-bar {
    color: var(--text-dim);
}

.term-card.placeholder .term-body {
    padding: 18px;
}

.term-card.placeholder .section-text {
    color: var(--text-dim);
}

/* Glitch title */
.glitch {
    position: relative;
    display: inline-block;
    margin: 0;
    font-size: clamp(28px, 6vw, 44px);
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: .6;
}

.glitch::before {
    color: var(--magenta);
    transform: translate(2px, 0);
    animation: glitch-flicker 6s infinite;
}

.glitch::after {
    color: var(--cyan);
    transform: translate(-2px, 0);
    animation: glitch-flicker 6s infinite .15s;
}

@keyframes glitch-flicker {
    0%, 100% { opacity: .6; }
    45% { opacity: .6; }
    46% { opacity: .15; }
    47% { opacity: .6; }
    92% { opacity: .6; }
    93% { opacity: .2; }
    94% { opacity: .6; }
}

.subtitle {
    margin: 10px 0 0;
    color: var(--cyan);
    font-size: 14px;
}

.cursor {
    display: inline-block;
    width: .55ch;
    margin-left: 2px;
    background: var(--cyan);
    animation: blink 1s steps(1) infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .glitch::before,
    .glitch::after,
    .cursor {
        animation: none;
    }
}

.bio {
    margin: 18px 0 0;
    color: var(--text-dim);
    font-size: 14px;
}

.bio + .bio {
    margin-top: 6px;
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.tag {
    font-size: 11px;
    letter-spacing: .5px;
    text-transform: uppercase;
    border: 1.5px solid;
    border-radius: 999px;
    padding: 4px 12px;
}

.tag.cyan { border-color: var(--cyan); color: var(--cyan); }
.tag.magenta { border-color: var(--magenta); color: var(--magenta); }
.tag.muted { border-color: var(--muted); color: var(--text); }

/* Section label, e.g. "# about.log" */
.label {
    margin-top: 26px;
    color: var(--muted);
    font-size: 12px;
}

.section-text {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--text);
}

/* Row lists (projects / links) */
.row-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.row-list + .label,
.section-text + .label {
    margin-top: 26px;
}

.proj-row {
    display: block;
    border: 1px solid var(--panel-border);
    border-left: 3px solid var(--muted);
    border-radius: 2px;
    padding: 14px 16px;
    color: var(--text);
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease;
}

.proj-row:hover {
    background: rgba(255, 255, 255, 0.03);
    border-left-color: var(--cyan);
}

.proj-row.cyan { border-left-color: var(--cyan); }
.proj-row.magenta { border-left-color: var(--magenta); }

.proj-row.placeholder {
    border-style: dashed;
    color: var(--text-dim);
    cursor: default;
}

.proj-row.placeholder:hover {
    background: none;
    border-left-color: var(--muted);
}

.proj-name {
    font-weight: 600;
}

.proj-desc {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-dim);
}

.link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--panel-border);
    border-radius: 2px;
    padding: 14px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: background .15s ease, border-color .15s ease;
}

.link-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.link-row.cyan { border-color: var(--cyan); color: var(--cyan); }
.link-row.magenta { border-color: var(--magenta); color: var(--magenta); }

.link-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.link-label svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

.link-row .arrow {
    opacity: .6;
}

.link-row:hover .arrow {
    opacity: 1;
}

/* CV page */
.cv-entry + .cv-entry {
    margin-top: 26px;
}

.cv-entry h3 {
    margin: 0 0 4px;
    font-size: 16px;
    color: #fff;
}

.cv-entry .meta {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--text-dim);
}

.cv-entry ul {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
}

.cv-entry li {
    margin-bottom: 6px;
}

.cv-entry li::marker {
    color: var(--muted);
}

footer {
    padding: 16px;
    text-align: center;
    font-size: 11px;
    color: var(--text-dim);
    border-top: 1px solid var(--panel-border);
}
