/* ===== Tokens (dark by default) ===== */
:root {
    --bg: #1E242B;
    /* page background (medium-dark gray) */
    --surface: #252C34;
    /* cards/header surface */
    --ink: #E6E9EF;
    /* primary text */
    --muted: #A5B0BD;
    /* secondary text */
    --border: #343C46;
    /* hairline borders */
    --grid: #343C46;
    /* legacy name in your markup */

    --teal: #2D8C85;
    /* primary brand (teal) */
    --teal-700: #23706A;
    /* hover */
    --orange: #D37A15;
    /* accent echo to scholar site */

    --link: var(--teal);
    --link-hover: var(--teal-700);

    --radius-sm: 10px;
    --radius-md: 14px;
    --shadow: 0 2px 10px rgba(0, 0, 0, .25);

    --wrap: 900px;
}

/* ===== Base ===== */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, Arial, "Noto Sans";
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.wrap {
    width: min(var(--wrap), 92vw);
    margin-inline: auto;
}

/* Links */
a {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

a:hover,
a:focus {
    color: var(--link-hover);
}

/* ===== Header/Nav ===== */
header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in oklab, var(--surface) 88%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(6px);
}

header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .8rem 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    color: inherit;
    font-weight: 700;
}

.brand .logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

nav ul {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

nav a {
    text-decoration: none;
    color: inherit;
    padding: .35rem .6rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

nav a:hover,
nav a:focus {
    border-color: var(--border);
    background: color-mix(in oklab, var(--teal) 18%, transparent);
}

/* ===== Sections ===== */
main section {
    padding: 1.6rem 0;
    border-bottom: 1px dashed var(--grid);
}

#intro p,
#about p {
    font-size: 1.075rem;
    max-width: 65ch;
}

/* Section title */
.section-title {
    font-size: 1.35rem;
    letter-spacing: .3px;
    margin: 0 0 .6rem;
}

/* ===== CTA buttons ===== */
.cta {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: .9rem;
}

.btn {
    display: inline-block;
    text-decoration: none;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: .55rem .9rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.btn:hover,
.btn:focus {
    background: color-mix(in oklab, var(--surface) 85%, var(--teal) 15%);
}

.btn.accent {
    background: var(--teal);
    border-color: transparent;
    color: #0c1116;
    font-weight: 600;
}

.btn.accent:hover,
.btn.accent:focus {
    background: var(--teal-700);
    color: #0b0f14;
}

/* ===== Grid + Cards (Projects) ===== */
.grid {
    display: grid;
    gap: 1rem;
    margin-top: 12px;
}

@media (min-width:720px) {
    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.card h3 {
    margin: .2rem 0 .4rem;
}

/* ===== Posts ===== */
#posts .post {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: .9rem 0;
}

#posts .post h3 {
    margin: .2rem 0;
}

#posts .post h3 a {
    text-decoration: none;
    color: var(--ink);
}

#posts .post h3 a:hover {
    color: var(--link);
    text-decoration: underline;
}

.meta {
    font-size: .93rem;
    color: var(--muted);
    margin: .2rem 0 .6rem;
}

.more {
    display: inline-block;
    margin-top: .4rem;
    text-decoration: none;
    font-weight: 500;
}

a.more:hover,
a.more:focus {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ===== Footer ===== */
footer {
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    color: var(--muted);
}

/* ===== Motion safety (nice touch) ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}