/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: #0d1117;
    color: #e6d9c7;
    font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.75;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Layout ── */
header, main, .meta, footer {
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

main {
    flex: 1;
    padding-top: 40px;
    padding-bottom: 60px;
}

/* ── Header & Nav ── */
header {
    padding-top: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #21262d;
}

nav {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

nav a {
    color: #8b949e;
    text-decoration: none;
    border-bottom: none;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    transition: color 0.15s;
}

nav a:hover {
    color: #dda15e;
    border-bottom: none;
}

/* ── Meta bar (badges + links) ── */
.meta {
    padding-top: 20px;
    padding-bottom: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.meta:empty {
    display: none;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    display: inline-block;
    font-size: 0.78rem;
    font-family: "SF Mono", "Fira Code", "Courier New", monospace;
    color: #dda15e;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 999px;
    padding: 2px 10px;
    letter-spacing: 0.02em;
}

.meta-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.meta-link {
    font-size: 0.88rem;
    color: #58a6ff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s, color 0.15s;
}

.meta-link:hover {
    color: #79c0ff;
    border-bottom-color: #79c0ff;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    color: #dda15e;
    margin-top: 36px;
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: 2.25rem; margin-top: 0; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
h4, h5, h6 { font-size: 1.05rem; }

p {
    margin-top: 0;
    margin-bottom: 16px;
}

b, strong {
    font-weight: 700;
    color: #f0e6d1;
}

/* ── Links ── */
article a {
    color: #dda15e;
    text-decoration: none;
    border-bottom: 1px solid #dda15e55;
    transition: border-color 0.15s, color 0.15s;
}

article a:hover {
    color: #f4a261;
    border-bottom-color: #f4a261;
}

/* ── Code ── */
code {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #e9c46a;
    padding: 0.15em 0.45em;
    font-family: "SF Mono", "Fira Code", "Courier New", monospace;
    font-size: 0.9em;
}

pre {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 18px 20px;
    overflow-x: auto;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.88rem;
}

/* ── Blockquote ── */
blockquote {
    background-color: #161b22;
    border-left: 3px solid #dda15e;
    margin: 20px 0;
    padding: 14px 20px;
    color: #8b949e;
    font-style: italic;
    border-radius: 0 6px 6px 0;
}

/* ── Lists ── */
ul, ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

li {
    margin-bottom: 4px;
}

/* ── Tables ── */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.92rem;
}

th {
    background: #161b22;
    color: #dda15e;
    font-weight: 600;
    padding: 10px 14px;
    border: 1px solid #30363d;
    text-align: left;
}

td {
    padding: 9px 14px;
    border: 1px solid #21262d;
}

tr:nth-child(even) td {
    background: #0d1117;
}

/* ── Images ── */
img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #30363d;
}

/* ── Horizontal rule ── */
hr {
    border: none;
    border-top: 1px solid #21262d;
    margin: 36px 0;
}

/* ── Footer ── */
footer {
    border-top: 1px solid #21262d;
    padding-top: 20px;
    padding-bottom: 28px;
    font-size: 0.875rem;
    color: #8b949e;
    text-align: center;
}

footer a {
    color: #dda15e;
    text-decoration: none;
    border-bottom: none;
    transition: color 0.15s;
}

footer a:hover {
    color: #f4a261;
}

/* ── Home page hero ── */
body.home-page article h1 {
    font-size: 3rem;
    margin-top: 48px;
    margin-bottom: 8px;
}

body.home-page article > p:first-of-type {
    font-size: 1.15rem;
    color: #8b949e;
    margin-bottom: 36px;
}

/* ── Projects page: card grid ── */
body.projects-page article ul {
    list-style: none;
    padding-left: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

body.projects-page article ul li {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 18px 20px;
    transition: border-color 0.2s, transform 0.15s;
    position: relative;
}

body.projects-page article ul li:hover {
    border-color: #dda15e66;
    transform: translateY(-2px);
}

body.projects-page article ul li a:first-of-type::after {
    content: '';
    position: absolute;
    inset: 0;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0d1117; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }
* { scrollbar-width: thin; scrollbar-color: #30363d #0d1117; }
