:root{
  /* layout */
  --max-width: 900px;
  --content-padding: 1rem;

  /* light palette */
  --bg: #ffffff;
  --surface: #f8f8f9;
  --text: #0f1720;
  --muted: #6b7280;
  --accent: #0ea5a4; /* teal-ish */
  --muted-border: #e6e9ee;

  /* typography */
  --base-font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  --lead-size: 1.125rem;
}

/* Dark theme prefers-color-scheme fallback */
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) {
    --bg: #0b1220;
    --surface: #071023;
    --text: #e6eef6;
    --muted: #9aa6b2;
    --accent: #38bdf8;
    --muted-border: rgba(255,255,255,0.06);
  }
}

/* Explicit dark class */
:root.theme-dark{
  --bg: #0b1220;
  --surface: #071023;
  --text: #e6eef6;
  --muted: #9aa6b2;
  --accent: #38bdf8;
  --muted-border: rgba(255,255,255,0.06);
}

/* Base */
*{box-sizing:border-box}
html,body{height:100%}
body{font-family:var(--base-font); line-height:1.65; color:var(--text); background:var(--bg); padding:0; margin:0; -webkit-font-smoothing:antialiased}
.container{max-width:var(--max-width); margin:2.25rem auto; padding:0 var(--content-padding)}

/* Header */
.site-header{background:var(--surface); border-bottom:1px solid var(--muted-border)}
.site-header .inner{max-width:var(--max-width); margin:0 auto; padding:1rem; display:flex; align-items:center; justify-content:space-between; gap:1rem}
.site-title{margin:0; font-size:1.05rem}
.site-title a{color:var(--text); text-decoration:none}
.site-nav{display:flex; gap:0.75rem; align-items:center}
.site-nav a{color:var(--muted); text-decoration:none; font-weight:500}
.site-nav a:hover{color:var(--text)}

/* Theme toggle */
.theme-toggle{background:transparent; border:1px solid var(--muted-border); color:var(--muted); padding:0.35rem 0.6rem; border-radius:6px; cursor:pointer; font-size:0.9rem}
.theme-toggle:hover{color:var(--text); border-color:var(--accent)}

/* Content */
.post h1{margin-top:0; font-size:2rem}
.lead{font-size:var(--lead-size); color:var(--muted); margin-bottom:1rem}
.meta{color:var(--muted); font-size:0.9rem}
.post-summary{border-bottom:1px dashed var(--muted-border); padding:1rem 0}

/* Footer */
.site-footer{border-top:1px solid var(--muted-border); margin-top:3rem; padding:1rem 0}

/* Utility */
.card{background:var(--surface); border:1px solid var(--muted-border); padding:1rem; border-radius:8px}

/* Responsive */
@media (max-width:640px){
  .site-header .inner{padding:0.75rem}
  .site-nav{gap:0.5rem}
  .container{margin:1.25rem auto}
}

/* Small helper for code blocks, images */
img{max-width:100%; height:auto}
pre{background:var(--surface); padding:0.75rem; border-radius:6px; overflow:auto}

/* Links (content) */
/* Keep header/nav/title link rules as they are; target content/container links */
.container a{
  color:var(--accent);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  text-underline-offset:3px;
  transition: color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.container a:hover{
  color:color-mix(in srgb, var(--accent) 80%, var(--text) 20%);
  border-bottom-color:var(--accent);
}
.container a:visited{
  opacity:0.9;
}
.container a:focus-visible{
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius:6px;
}
