/* ponytail: still one hand-rolled stylesheet, no build step. */
:root {
    --bg: #0b0e14;
    --bg-raised: #11151f;
    --fg: #e7eaf0;
    --muted: #8b93a7;
    --accent: #6d9eff;
    --accent-2: #b07cff;
    --border: #1e2433;
    --border-hover: #2e3a55;
    --gradient: linear-gradient(120deg, var(--accent), var(--accent-2));
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #fafbfd;
        --bg-raised: #ffffff;
        --fg: #171c28;
        --muted: #5b6475;
        --accent: #2563eb;
        --accent-2: #7c3aed;
        --border: #e5e8f0;
        --border-hover: #c7cede;
    }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
    line-height: 1.65;
    background: var(--bg);
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
}

/* subtle dot grid behind everything */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent 60%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent 60%);
    pointer-events: none;
}

nav, main, footer {
    max-width: 46rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
}

/* ---------- nav ---------- */
header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    border-bottom: 1px solid var(--border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

nav .brand {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
    color: var(--fg);
}
nav .brand::before {
    content: "~/";
    font-family: var(--mono);
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-right: 0.15rem;
}

nav .links a {
    margin-left: 1.5rem;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 500;
    transition: color 120ms ease;
}
nav .links a:hover { color: var(--fg); text-decoration: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

main { padding-bottom: 4rem; min-height: 72vh; }

/* ---------- type ---------- */
h1 {
    font-size: clamp(2.1rem, 5vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin: 0 0 1rem;
}

.eyebrow {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 0.75rem;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- hero ---------- */
.hero { padding-top: 5rem; }
@media (max-width: 40rem) {
    .hero { padding-top: 3rem; }
}

.lede {
    font-size: 1.08rem;
    color: var(--muted);
    max-width: 40rem;
}

.pills { margin: 1.5rem 0 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    background: var(--bg-raised);
}

.button {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border-radius: 0.6rem;
    background: var(--gradient);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    margin-right: 0.6rem;
    transition: transform 120ms ease, box-shadow 120ms ease;
}
.button:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent);
}
.button.secondary {
    background: var(--bg-raised);
    color: var(--fg);
    border: 1px solid var(--border);
}
.button.secondary:hover { border-color: var(--border-hover); box-shadow: none; }

/* ---------- experience ---------- */
h2 { letter-spacing: -0.02em; margin: 0 0 0.75rem; }

.role { margin-bottom: 2.5rem; }
.role-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}
.role-head h2 { font-size: 1.25rem; margin-bottom: 0; }
.role-head .meta { margin: 0; }
.role .lede { font-size: 1rem; margin-top: 0.5rem; }

.experience {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}
.experience li {
    position: relative;
    padding: 0 0 1rem 1.5rem;
    color: var(--muted);
    font-size: 0.97rem;
}
.experience li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: var(--mono);
}

/* ---------- cards ---------- */
.section-title { margin-top: 3.5rem; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
@media (max-width: 40rem) { .cards { grid-template-columns: 1fr; } }

.card {
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    padding: 1.25rem 1.4rem;
    background: var(--bg-raised);
    transition: border-color 150ms ease, transform 150ms ease;
}
.card:hover { border-color: var(--border-hover); transform: translateY(-2px); }

.card.featured {
    grid-column: 1 / -1;
    border: 1px solid transparent;
    background:
        linear-gradient(var(--bg-raised), var(--bg-raised)) padding-box,
        linear-gradient(120deg, color-mix(in srgb, var(--accent) 55%, var(--border)), color-mix(in srgb, var(--accent-2) 55%, var(--border))) border-box;
}

.card h2 { margin: 0 0 0.3rem; font-size: 1.12rem; letter-spacing: -0.01em; }
.card h2 a { color: var(--fg); }
.card h2 a:hover { color: var(--accent); text-decoration: none; }

.badge {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-2);
    border: 1px solid color-mix(in srgb, var(--accent-2) 40%, transparent);
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.tech {
    font-family: var(--mono);
    color: var(--muted);
    font-size: 0.78rem;
    margin: 0 0 0.6rem;
}

.card p:last-child { margin-bottom: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- blog ---------- */
.post-item {
    margin: 0 0 1rem;
    padding: 1.25rem 1.4rem;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: var(--bg-raised);
    transition: border-color 150ms ease;
}
.post-item:hover { border-color: var(--border-hover); }
.post-item h2 { margin: 0 0 0.2rem; font-size: 1.15rem; }
.post-item h2 a { color: var(--fg); }
.post-item h2 a:hover { color: var(--accent); text-decoration: none; }
.post-item p:last-child { margin-bottom: 0; color: var(--muted); }

.meta {
    font-family: var(--mono);
    color: var(--muted);
    font-size: 0.78rem;
    margin: 0 0 0.5rem;
}

.post { padding-top: 2rem; }
.post h1 { margin-bottom: 0.25rem; }
.post img { max-width: 100%; border-radius: 0.6rem; }
.post pre {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    padding: 1rem 1.25rem;
    border-radius: 0.7rem;
    overflow-x: auto;
    font-size: 0.88rem;
}
.post code { font-family: var(--mono); font-size: 0.9em; }
.post > p, .post li { color: color-mix(in srgb, var(--fg) 82%, var(--muted)); }

.back { font-family: var(--mono); font-size: 0.85rem; }

/* ---------- demos ---------- */
.demo-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}
.demo-controls .meta { margin: 0 0 0 0.5rem; }
.demo-controls .button { margin-right: 0; }

.canvas-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
@media (max-width: 40rem) { .canvas-row { grid-template-columns: 1fr; } }

.canvas-row canvas {
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    touch-action: none;
    cursor: crosshair;
}
.demo-label {
    font-family: var(--mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 0 0 0.5rem;
}

/* ---------- footer ---------- */
footer {
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    padding-bottom: 2.5rem;
    color: var(--muted);
    font-size: 0.85rem;
}
