:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --tint: #f4f7fb;
  --accent: #5b79a8;
  --accent-ink: #46628f;
  --accent-dark: #3a5382;
  --text: #1c2430;
  --muted: #667085;
  --line: #e7ebf1;
  --font-head: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar-w: 260px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  font-size: 1.02rem;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; }

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 2.5rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.site-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.site-name::before {
  content: "";
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 3px;
  flex: none;
}
.site-name:hover { color: var(--text); }
.tagline {
  color: var(--muted);
  font-size: .92rem;
  margin: .75rem 0 2.5rem;
  line-height: 1.5;
}
.sidebar nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.sidebar nav a {
  display: block;
  padding: .55rem .85rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: background .2s, color .2s;
}
.sidebar nav a:hover { background: var(--tint); color: var(--accent-ink); }
.sidebar nav a[aria-current="page"] { background: var(--tint); color: var(--accent-ink); font-weight: 600; }

.social {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.social ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.social a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .5rem .85rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 500;
  transition: background .2s, color .2s;
}
.social a:hover { background: var(--tint); color: var(--accent-ink); }
.social svg { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* Content */
.content { margin-left: var(--sidebar-w); }
.wrap { max-width: 740px; margin: 0 auto; padding: 4.5rem 2.5rem; }
section + section { border-top: 1px solid var(--line); }
#projects { background: var(--tint); border-top: 0; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; font-weight: 700; letter-spacing: -.025em; }
h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); margin: 0 0 1rem; }
h2 { font-size: 2rem; margin: 0 0 1rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .75rem;
  color: var(--accent-ink);
  font-weight: 600;
  margin: 0 0 .8rem;
}
.lead { font-size: 1.2rem; color: var(--muted); max-width: 34rem; margin: 0; }

.hero .wrap { padding-top: 6rem; padding-bottom: 3rem; }
.hero-shape {
  width: 48px; height: 4px; background: var(--accent);
  border-radius: 2px; margin-bottom: 2rem;
}
.hero + section { border-top: 0; }
#posts .wrap { padding-top: 1.5rem; }
.more-link { display: inline-block; margin-top: 1.5rem; font-weight: 600; text-decoration: none; }
.more-link:hover { text-decoration: underline; }

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: .75rem 1.5rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  border: 0;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.button:hover { background: var(--accent-dark); color: #fff; transform: translateY(-1px); }

/* Post list (home + blog index) */
.post-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; }
.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  overflow: hidden;
}
.post-card:hover { box-shadow: 0 10px 30px rgba(91,121,168,.16); transform: translateY(-2px); border-color: #cfd9e8; }
.post-card a { display: block; padding: 1.5rem 1.7rem; text-decoration: none; color: inherit; }
.post-card-image { width: 100%; display: block; margin-bottom: 1rem; border-radius: 10px; }
.post-card-title { font-size: 1.3rem; margin: 0 0 .2rem; color: var(--text); }
.post-card-date { font-size: .85rem; color: var(--accent-ink); margin: 0 0 .5rem; display: block; font-weight: 500; }
.post-card-summary { margin: 0; color: var(--muted); }
.post-list-empty { color: var(--muted); font-style: italic; }

/* Project cards */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-top: 1.75rem; }
.project {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
  transition: box-shadow .2s, transform .2s;
}
.project:hover { box-shadow: 0 10px 30px rgba(91,121,168,.16); transform: translateY(-2px); }
.project-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--tint); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 1rem;
}
.project-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.project h3 { font-size: 1.1rem; margin: 0 0 .4rem; }
.project p { margin: 0 0 .8rem; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.project a { font-weight: 600; font-size: .95rem; text-decoration: none; }
.project a:hover { text-decoration: underline; }

/* Single post */
.post-image { width: 100%; border-radius: 14px; margin: 1.5rem 0; }
.post-meta { color: var(--muted); font-size: .95rem; margin-bottom: 2rem; }
.post-body h2 { margin-top: 2.2rem; font-size: 1.6rem; }
.post-body h3 { margin-top: 1.8rem; font-size: 1.25rem; }
.post-body a { color: var(--accent-ink); }
.post-body ul { padding-left: 1.3rem; }
.post-body blockquote { border-left: 3px solid var(--accent); margin: 1.5rem 0; padding-left: 1.2rem; color: var(--muted); }
.post-figure { margin: 2rem 0; }
.post-figure-image, .post-inline-image { border-radius: 12px; }
.post-figure figcaption { font-size: .9rem; color: var(--muted); margin-top: .5rem; }
.back-link { display: inline-block; margin-bottom: 2rem; font-size: .95rem; text-decoration: none; font-weight: 500; }
.back-link:hover { text-decoration: underline; }

:focus-visible { outline: 3px solid rgba(91,121,168,.45); outline-offset: 2px; }

footer.page-foot { border-top: 1px solid var(--line); padding: 2rem; text-align: center; color: var(--muted); font-size: .9rem; }

/* Phones and small tablets: sidebar becomes a top bar */
@media (max-width: 800px) {
  .sidebar {
    position: sticky;
    width: 100%;
    bottom: auto;
    padding: .8rem 1.25rem .5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "name social" "nav nav";
    align-items: center;
    overflow: visible;
    z-index: 10;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .site-name { grid-area: name; font-size: 1.1rem; }
  .tagline { display: none; }
  .sidebar nav { grid-area: nav; }
  .sidebar nav ul { display: flex; gap: .25rem; margin-top: .3rem; }
  .sidebar nav a { padding: .35rem .7rem; font-size: .95rem; }
  .social { grid-area: social; margin: 0; padding: 0; border: 0; }
  .social ul { display: flex; gap: .1rem; }
  .social a { padding: .45rem; }
  .social span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .content { margin-left: 0; }
  .wrap { padding: 2.75rem 1.25rem; }
  .hero .wrap { padding-top: 3rem; padding-bottom: 1.5rem; }
  #posts .wrap { padding-top: 1rem; }
}
