:root {
    --bg: #000;
    --panel: #0e0e0e;
    --panel-2: #131319;
    --fg: #ededed;
    --dim: #6a6a6a;
    --hairline: #1a1a1a;
    --amber: #ffb04a;
    --sans: 'Inter', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
ul, li { list-style: none; }
a { color: inherit; text-decoration: none; }

html, body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-weight: 300;
}

.amber { color: var(--amber); }
.page-pad { padding: 0 2rem; max-width: 1400px; margin: 0 auto; }

/* ===== TOPBAR (copied verbatim from the previous site) ===== */
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.8rem 2rem;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--hairline);
}
.brand { display: flex; align-items: center; gap: 0.8rem; cursor: pointer; transition: opacity 0.2s; }
.brand:hover { opacity: 0.85; }
.brand img {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--hairline);
}
.brand .name { font-weight: 600; font-size: 1rem; letter-spacing: 0.02em; }
.brand .bio {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.main-nav ul { display: inline-flex; gap: 1.5rem; }
.nav-item {
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dim);
    transition: color 0.2s;
    padding: 0.2rem 0;
    border-bottom: 1px solid transparent;
}
.nav-item:hover { color: var(--fg); }
.nav-item.active { color: var(--amber); border-bottom-color: var(--amber); }
@media (max-width: 700px) {
    .topbar { flex-direction: column; gap: 0.6rem; padding: 0.6rem 0.8rem; }
    .topbar .brand .bio { display: none; }
    .topbar .brand img { width: 32px; height: 32px; }
    .main-nav ul { gap: 1rem; }
    .page-pad { padding: 0 1rem; }
}

/* ===== SECTIONS ===== */
.section { padding-bottom: 4rem; }
.hidden { display: none !important; }
.section h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    margin: 2.5rem 0 0.5rem;
}
.leadout {
    color: var(--dim);
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
}
.loading { color: var(--dim); padding: 3rem 0; text-align: center; }

/* ===== TIMELINE ===== */
.timeline-wrap {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 2.5rem;
    max-width: 1500px;
    margin: 0 auto;
    padding: 3rem clamp(1rem, 4vw, 3.5rem) 0;
}
@media (max-width: 900px) {
    .timeline-wrap { grid-template-columns: 1fr; gap: 1rem; padding: 2rem 1rem 0; }
    .rail { display: none; }
}

.rail { position: sticky; top: 80px; align-self: start; padding-top: 0.25rem; }
.rail ul { display: flex; flex-direction: column; gap: 0.1rem; }
.rail li {
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--dim);
    padding: 0.2rem 0 0.2rem 0.7rem;
    letter-spacing: 0.06em;
    border-left: 2px solid transparent;
    transition: color 0.15s, padding-left 0.15s;
}
.rail li:hover { color: var(--fg); }
.rail li.active { color: var(--amber); border-left-color: var(--amber); }
.rail li .rail-count { opacity: 0.55; margin-left: 0.4rem; font-size: 0.68rem; }

.timeline-stream { display: flex; flex-direction: column; gap: 3rem; min-width: 0; }

.year-block { scroll-margin-top: 90px; }
.year-divider {
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--hairline);
}
.year-divider h2 {
    font-size: 2rem;
    font-weight: 200;
    letter-spacing: -0.02em;
    margin: 0;
    font-feature-settings: "lnum";
}

/* posts */
.posts { display: flex; flex-direction: column; gap: 2rem; }

.post { display: flex; flex-direction: column; gap: 0.65rem; }

.post-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: baseline;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed var(--hairline);
}
.post-head .day {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--amber);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
    white-space: nowrap;
}
.post-head .title {
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: -0.005em;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-head .n {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--dim);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.post-wall { display: flex; flex-direction: column; gap: 4px; max-width: 100%; overflow: hidden; }
.pw-row { display: flex; gap: 4px; margin-bottom: 4px; max-width: 100%; }
.pw-item {
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    background: #0a0a0a;
    border-radius: 2px;
}
.pw-item img {
    width: 100%; height: 100%; object-fit: cover;
    transition: opacity 0.2s, transform 0.5s;
    opacity: 0.92;
}
.pw-item:hover img { opacity: 1; transform: scale(1.03); }

.pw-more {
    margin-top: 0.3rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: color 0.2s;
}
.pw-more:hover { color: var(--amber); }

.post-foot {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 0.3rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.post-foot .cat {
    padding: 0.08rem 0.55rem;
    border: 1px solid var(--hairline);
    border-radius: 999px;
}

.post.solo .post-wall .pw-item img { max-height: 560px; }

/* ===== CODE ===== */
.repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1px;
    background: transparent;
}
.repo {
    background: var(--bg);
    padding: 1.2rem 1.4rem;
    display: flex; flex-direction: column; gap: 0.5rem;
    border: 1px solid var(--hairline);
    transition: background 0.2s, border-color 0.2s;
}
.repo:hover { background: var(--panel); border-color: var(--dim); }
.repo .name { font-size: 1.1rem; font-weight: 500; }
.repo .name:hover { color: var(--amber); }
.repo .desc { color: var(--dim); font-size: 0.92rem; flex: 1; }
.repo .meta {
    font-family: var(--mono); font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim);
    display: flex; gap: 1rem;
}
.repo .links {
    display: flex; gap: 1rem;
    margin-top: 0.4rem;
    font-family: var(--mono); font-size: 0.78rem;
}
.repo .links a { color: var(--dim); border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.repo .links a:hover { color: var(--amber); border-bottom-color: var(--amber); }
.repo .links a.live { color: var(--amber); }

.hint { color: var(--dim); font-size: 0.9rem; }

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 3rem 2rem 2rem;
    margin-top: 3rem;
    border-top: 1px solid var(--hairline);
    color: var(--dim);
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
footer a { display: inline-block; color: var(--dim); margin-bottom: 0.6rem; transition: color 0.2s; }
footer a:hover { color: var(--amber); }
