/* ─────────────────────────────────────────────────────────
   DESIGN TOKENS
   ───────────────────────────────────────────────────────── */
:root {
  --bg:     #f6f7f9;
  --ink:    #15171c;
  --muted:  #5d6370;
  --line:   #dcdfe5;
  --accent: #2f3fd6;
  --code:   #eceef2;
  --sans:   "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif:  "Source Serif 4", Georgia, serif;
  --radius: 999px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #14161b;
    --ink:    #eceef2;
    --muted:  #9aa1ae;
    --line:   #2a2e37;
    --accent: #8c9bff;
    --code:   #1d2027;
  }
}

/* ─────────────────────────────────────────────────────────
   BASE
   ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box }
html { font-size: 100%; -webkit-text-size-adjust: 100% }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  max-width: 44rem;
  padding: 0 1.25rem;
  margin-inline: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; padding-bottom: 4rem }
a { color: var(--accent); text-underline-offset: .2em }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px }
.skip { position: absolute; left: -999px }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem; z-index: 9 }

/* ─────────────────────────────────────────────────────────
   HEADER / NAV
   ───────────────────────────────────────────────────────── */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 2rem 0 1rem;
}
.brand { font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -.01em }
.site-header nav a { margin-left: 1.25rem; color: var(--muted); text-decoration: none }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--ink) }
.site-header nav a[aria-current] { text-decoration: underline; text-underline-offset: .35em }

/* ─────────────────────────────────────────────────────────
   HERO — two-column with profile photo
   ───────────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--sans); line-height: 1.2; letter-spacing: -.02em }

.hero { padding: 4.5rem 0 3rem }
.hero-inner {
  display: flex;
  align-items: center;
  gap: 3rem;
}
.hero-text { flex: 1; min-width: 0 }
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 700;
  margin: 0 0 1.25rem;
  max-width: 18ch;
}
.lead {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* Profile photo */
.hero-avatar {
  flex-shrink: 0;
}
.hero-avatar img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  border: 3px solid var(--line);
  box-shadow: 0 8px 32px rgba(0,0,0,.10);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.hero-avatar img:hover {
  transform: scale(1.04);
  box-shadow: 0 14px 40px rgba(0,0,0,.18);
}

@media (max-width: 38rem) {
  .hero-inner {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 1.75rem;
  }
  .hero-avatar img { width: 110px; height: 110px }
}

/* ─────────────────────────────────────────────────────────
   SOCIAL ICONS  (hero row + footer row)
   ───────────────────────────────────────────────────────── */
.hero-socials {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.hero-socials .social-icon {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 500;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.hero-socials .social-icon:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* Footer social icons — compact icon-only style */
.social-links {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.social-links .social-icon {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--muted);
  text-decoration: none;
  padding: .25rem .4rem;
  border-radius: 4px;
  font-size: .9rem;
  transition: color 0.2s, background 0.2s;
}
.social-links .social-icon:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.social-links .social-icon span {
  display: none; /* show icon only in footer; hero shows both */
}
/* In the hero, show text labels */
.hero-socials .social-icon span { display: inline }

/* ─────────────────────────────────────────────────────────
   FOCUS GRID
   ───────────────────────────────────────────────────────── */
.focus {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 3rem;
}
.focus h2 { font-size: 1rem; margin: 0 0 .5rem }
.focus p  { margin: 0; color: var(--muted); font-size: .95rem }
@media (max-width: 40rem) { .focus { grid-template-columns: 1fr; gap: 1.5rem } }

/* ─────────────────────────────────────────────────────────
   POST LIST
   ───────────────────────────────────────────────────────── */
.section-head { display: flex; justify-content: space-between; align-items: baseline }
.section-head h2, .year h2 { font-size: 1.1rem; margin: 0 0 .5rem }
.page-title { font-size: 2.2rem; margin: 2.5rem 0 1.5rem }
.year { margin-bottom: 2rem }

.posts { list-style: none; margin: 0; padding: 0 }
.posts li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line) }
.posts time { color: var(--muted); font-size: .9rem; padding-top: .15rem }
.posts a { font-weight: 600; color: var(--ink); text-decoration: none; font-size: 1.05rem }
.posts a:hover { color: var(--accent); text-decoration: underline }
.posts p { margin: .25rem 0 0; color: var(--muted); font-size: .95rem }
@media (max-width: 34rem) { .posts li { grid-template-columns: 1fr; gap: .2rem } }

/* ─────────────────────────────────────────────────────────
   POST / ARTICLE
   ───────────────────────────────────────────────────────── */
.post { padding-top: 2.5rem }
.post h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin: 0 0 .5rem }
.meta { color: var(--muted); margin: 0 0 2rem; font-size: .95rem }
.prose { font-family: var(--serif); font-size: 1.125rem; line-height: 1.75 }
.prose h2 { font-family: var(--sans); font-size: 1.4rem; margin: 2.2rem 0 .6rem }
.prose h3 { font-family: var(--sans); font-size: 1.15rem; margin: 1.8rem 0 .5rem }
.prose img { max-width: 100%; height: auto }
.prose blockquote { margin: 1.5rem 0; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--muted) }
.prose code { font-size: .88em; background: var(--code); padding: .12em .35em; border-radius: 3px }
.prose pre { background: var(--code); padding: 1rem; border-radius: 4px; overflow-x: auto; line-height: 1.5 }
.prose pre code { background: none; padding: 0; font-size: .88rem }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace }
.back { margin-top: 3rem; font-family: var(--sans); font-size: .95rem }

/* ─────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────── */
.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}
.site-footer a { color: var(--muted); margin-left: .25rem }
.site-footer a:hover { color: var(--ink) }

/* ─────────────────────────────────────────────────────────
   SYNTAX HIGHLIGHTING  (Rouge — light/dark safe)
   ───────────────────────────────────────────────────────── */
.highlight .c, .highlight .c1, .highlight .cm { color: var(--muted); font-style: italic }
.highlight .k, .highlight .kd, .highlight .kn { color: var(--accent) }
.highlight .s, .highlight .s1, .highlight .s2 { color: #b1491f }
@media (prefers-color-scheme: dark) {
  .highlight .s, .highlight .s1, .highlight .s2 { color: #f0a37f }
}
