:root {
    --ink: #1a2236;
    --ink-soft: #2a3650;
    --ink-muted: #3d4f6a;
    --sky: #edf1f7;
    --sky-light: #f4f6fa;
    --white: #ffffff;
    --slate: #5d7ea0;
    --slate-soft: #7a96b4;
    --slate-pale: #c8d6e5;
    --slate-wash: #dfe7f0;
    --warm: #8a6e5a;
    --warm-pale: #f0e8e2;
    --sage: #5a7a6e;
    --sage-pale: #e2ede8;
    --border: #d5dce6;
    --border-lt: #e4eaf1;
    --fd: 'Playfair Display', Georgia, serif;
    --fb: 'Nunito Sans', 'Segoe UI', sans-serif;
    --mw: 960px;
    --r: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 17px; }
body {
    font-family: var(--fb);
    background: var(--sky-light);
    color: var(--ink);
    line-height: 1.75;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}
::selection { background: var(--slate-wash); color: var(--ink); }

/* Nav */
nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 0 2rem;
    background: rgba(244,246,250,.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-lt);
}
.nav-inner {
    max-width: var(--mw); margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    height: 52px;
}
.nav-name {
    font-family: var(--fd); font-size: 1.1rem; font-weight: 700;
    color: var(--ink); text-decoration: none; display: flex; align-items: center;
}
.nav-logo { height: 28px; width: 28px; border-radius: 6px; }
.nav-links { display: flex; gap: 1.8rem; list-style: none; }
.nav-links a {
    font-size: .8rem; font-weight: 500; color: var(--ink-muted);
    text-decoration: none; letter-spacing: .02em; transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }

/* Hero (home page) */
.hero {
    padding: 7rem 2rem 3rem;
    max-width: var(--mw); margin: 0 auto;
}
.hero-content {
    display: flex; gap: 3rem; align-items: flex-start;
}
.hero-text { flex: 1; min-width: 0; }
.hero-photo {
    flex-shrink: 0; width: 220px;
}
.hero-photo img {
    width: 100%; border-radius: 12px;
    box-shadow: 0 4px 20px rgba(26,34,54,.1);
}
.hero h1 {
    font-family: var(--fd); font-size: 2.8rem; font-weight: 700;
    line-height: 1.15; color: var(--ink); margin-bottom: 1.8rem;
}
.hero-intro { color: var(--ink-muted); font-size: 1.05rem; line-height: 1.85; }
.hero-intro p { margin-bottom: 1.2rem; }
.hero-intro a { color: var(--ink); text-decoration: none; border-bottom: 1.5px solid var(--slate-pale); transition: border-color .2s; }
.hero-intro a:hover { border-color: var(--slate); }
.hero-links { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 2rem; }
.hl {
    font-size: .8rem; font-weight: 600; color: var(--ink-muted);
    text-decoration: none; padding: .45rem 1rem;
    border: 1px solid var(--border); border-radius: 100px;
    background: var(--white); transition: all .2s;
}
.hl:hover { border-color: var(--slate-soft); color: var(--ink); }

/* Sections (home page) */
.section {
    max-width: var(--mw); margin: 0 auto;
    padding: 3rem 2rem 4rem;
    border-top: 1px solid var(--border-lt);
}
.section-header { margin-bottom: 2rem; }
.section-label {
    display: inline-block; font-size: .7rem; font-weight: 700;
    color: var(--slate); letter-spacing: .12em; text-transform: uppercase;
    margin-bottom: .5rem;
}
.section-title {
    font-family: var(--fd); font-size: 1.6rem; font-weight: 700;
    color: var(--ink); line-height: 1.3;
}

/* Notes list */
.notes-list { margin-bottom: 1.5rem; }
.note-item { padding: 1rem 0; border-bottom: 1px solid var(--border-lt); }
.note-item:last-child { border-bottom: none; }
.note-date { font-size: .75rem; color: var(--slate-soft); letter-spacing: .02em; }
.note-item h3 { font-family: var(--fd); font-size: 1.15rem; font-weight: 600; margin: .2rem 0 .3rem; line-height: 1.35; }
.note-item h3 a { color: var(--ink); text-decoration: none; border-bottom: 1.5px solid transparent; transition: border-color .2s; }
.note-item h3 a:hover { border-bottom-color: var(--slate-pale); }
.note-summary { font-size: .88rem; color: var(--ink-muted); line-height: 1.6; }
.more-link {
    font-size: .82rem; font-weight: 600; color: var(--slate);
    text-decoration: none; transition: color .2s;
}
.more-link:hover { color: var(--ink); }

/* Page (single & list) */
.page {
    max-width: var(--mw); margin: 0 auto;
    padding: 6rem 2rem 4rem;
}
.page-header { margin-bottom: 2.5rem; }
.page-header h1 {
    font-family: var(--fd); font-size: 2.2rem; font-weight: 700;
    color: var(--ink); line-height: 1.2; margin-bottom: .5rem;
}
.page-date { font-size: .8rem; color: var(--slate-soft); }
.page-intro { color: var(--ink-muted); font-size: .95rem; margin-bottom: 2rem; }

/* Prose (article content) */
.prose { max-width: 720px; }
.prose h2 {
    font-family: var(--fd); font-size: 1.5rem; font-weight: 700;
    color: var(--ink); margin: 2.5rem 0 1rem; line-height: 1.3;
}
.prose h3 {
    font-family: var(--fd); font-size: 1.2rem; font-weight: 600;
    color: var(--ink); margin: 2rem 0 .8rem; line-height: 1.35;
}
.prose p { font-size: .95rem; color: var(--ink-soft); line-height: 1.85; margin-bottom: 1.2rem; }
.prose a { color: var(--ink); text-decoration: none; border-bottom: 1.5px solid var(--slate-pale); transition: border-color .2s; }
.prose a:hover { border-color: var(--slate); }
.prose blockquote {
    font-family: var(--fd); font-style: italic; font-size: 1.05rem;
    color: var(--ink); line-height: 1.65;
    padding: 1rem 1.3rem; margin: 1.5rem 0;
    background: var(--sky); border-left: 3px solid var(--ink-soft);
    border-radius: 0 var(--r) var(--r) 0;
}
.prose blockquote p { color: var(--ink); font-size: inherit; margin-bottom: .5rem; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose em { font-style: italic; color: var(--ink-muted); }
.prose ul, .prose ol { margin: 0 0 1.2rem 1.5rem; }
.prose li { font-size: .95rem; color: var(--ink-soft); line-height: 1.8; margin-bottom: .3rem; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.prose img { max-width: 100%; border-radius: var(--r); margin: 1.5rem 0; }
.prose code {
    font-size: .85em; background: var(--slate-wash); padding: .15em .4em;
    border-radius: 4px; font-family: 'SF Mono', 'Fira Code', monospace;
}

/* List pages (notes, projects) */
.items-list { margin-top: 1rem; }
.list-item { padding: 1.2rem 0; border-bottom: 1px solid var(--border-lt); }
.list-item:last-child { border-bottom: none; }
.item-date { font-size: .75rem; color: var(--slate-soft); }
.list-item h3 { font-family: var(--fd); font-size: 1.15rem; font-weight: 600; margin: .2rem 0 .3rem; line-height: 1.35; }
.list-item h3 a { color: var(--ink); text-decoration: none; transition: color .2s; }
.list-item h3 a:hover { color: var(--slate); }
.item-summary { font-size: .88rem; color: var(--ink-muted); line-height: 1.6; }

/* Footer */
footer {
    background: var(--ink); color: var(--white); margin-top: 2rem;
}
.footer-inner {
    max-width: var(--mw); margin: 0 auto; padding: 3rem 2rem;
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 2rem; flex-wrap: wrap;
}
footer h2 { font-family: var(--fd); font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; }
.footer-links { display: flex; flex-direction: column; gap: .5rem; }
.footer-links a { color: var(--slate-pale); text-decoration: none; font-size: .88rem; transition: color .2s; }
.footer-links a:hover { color: var(--white); }
.footer-copy { color: var(--ink-muted); font-size: .72rem; align-self: flex-end; }

/* Responsive */
@media (max-width: 700px) {
    html { font-size: 15px; }
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: .72rem; }
    .hero { padding: 5.5rem 1.5rem 2rem; }
    .hero-content { flex-direction: column-reverse; gap: 1.5rem; }
    .hero-photo { width: 160px; }
    .hero h1 { font-size: 2.2rem; }
    .section { padding: 2rem 1.5rem 3rem; }
    .page { padding: 5rem 1.5rem 3rem; }
    .footer-inner { flex-direction: column; }
    .footer-copy { align-self: flex-start; }
}


/* Project cards */
.projects-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem;
    margin-top: 1.5rem;
}
.project-card {
    background: var(--white); border: 1px solid var(--border-lt);
    border-radius: var(--r); padding: 1.6rem;
    transition: all .3s; position: relative; overflow: hidden;
}
.project-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px; background: linear-gradient(90deg, var(--ink-soft), var(--slate));
    opacity: 0; transition: opacity .3s;
}
.project-card:hover {
    box-shadow: 0 4px 16px rgba(26,34,54,.07);
    transform: translateY(-2px); border-color: var(--slate-pale);
}
.project-card:hover::after { opacity: 1; }
.project-featured { grid-column: 1 / -1; }
.project-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: .6rem; gap: .8rem;
}
.project-name {
    font-family: var(--fd); font-size: 1.3rem;
    font-weight: 700; color: var(--ink);
}
.project-period {
    font-size: .7rem; font-weight: 600; color: var(--slate-soft);
    white-space: nowrap; background: var(--sky);
    padding: .2rem .65rem; border-radius: 100px; margin-top: .15rem;
}
.project-desc {
    font-size: .88rem; color: var(--ink-muted); line-height: 1.7;
    margin-bottom: .8rem;
}
.project-desc p { margin: 0; }
.project-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.tg {
    font-size: .68rem; font-weight: 600;
    padding: .2rem .6rem; border-radius: 4px; letter-spacing: .02em;
}
.tg-ink { background: rgba(26,34,54,.08); color: var(--ink-soft); }
.tg-slate { background: var(--slate-wash); color: var(--slate); }
.tg-sage { background: var(--sage-pale); color: var(--sage); }
.tg-warm { background: var(--warm-pale); color: var(--warm); }
.project-link {
    font-size: .8rem; font-weight: 600; color: var(--slate);
    text-decoration: none; display: inline-flex; align-items: center;
    gap: .3rem; transition: all .2s;
}
.project-link:hover { gap: .5rem; color: var(--ink); }


/* Expand (collapsible) blocks */
.expand-block { margin: 1rem 0 1.5rem; }
.expand-btn {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: .8rem; font-weight: 600; color: var(--slate);
    cursor: pointer; border: 1px solid var(--slate-pale);
    background: var(--white); padding: .4rem 1rem;
    border-radius: 100px; transition: all .25s;
    font-family: var(--fb); letter-spacing: .02em;
}
.expand-btn:hover {
    background: var(--slate-wash); border-color: var(--slate-soft);
    box-shadow: 0 1px 4px rgba(26,34,54,.05);
}
.expand-icon {
    display: inline-block; transition: transform .3s; font-size: .75rem;
}
.expand-content {
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height .6s cubic-bezier(.25,0,.25,1), opacity .4s, margin .4s;
    margin-top: 0;
}
.expand-content.open {
    max-height: 8000px; opacity: 1; margin-top: 1rem;
}
.expand-inner {
    background: var(--white); border: 1px solid var(--border-lt);
    border-radius: var(--r); padding: 1.8rem;
    box-shadow: 0 1px 4px rgba(26,34,54,.05);
}
.expand-inner p {
    font-size: .95rem; color: var(--ink-muted);
    line-height: 1.85; margin-bottom: 1.1rem;
}
.expand-inner p:last-child { margin-bottom: 0; }

/* Fade-in animation */
.fade-in {
    opacity: 0; transform: translateY(20px);
    transition: opacity .5s, transform .5s;
}
.fade-in.visible {
    opacity: 1; transform: translateY(0);
}

/* Responsive: project cards */
@media (max-width: 700px) {
    .projects-grid { grid-template-columns: 1fr; }
    .project-featured { grid-column: auto; }
}
