/* ========== Design tokens ========== */
:root{
  --bg: #faf7f1;          /* warm off-white */
  --surface: #ffffff;
  --text: #2b2b2b;        /* soft black */
  --muted: #6b6b6b;
  --rule: rgba(0,0,0,.08);
  --accent: #d45a41;      /* Reeder-ish orange/red */
  --accent-hover: #b74834;

  --measure: 68ch;        /* comfortable reading line length */
  --radius: 14px;
  --code-bg: rgba(0,0,0,.03);

  --font-sans: ui-sans-serif, -apple-system, system-ui, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: ui-serif, "New York", "Iowan Old Style", "Palatino", "Georgia", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --lh: 1.65;
}

/* Dark mode */
@media (prefers-color-scheme: dark){
  :root{
    --bg: #121211;
    --surface: #191917;
    --text: rgba(255,255,255,.88);
    --muted: rgba(255,255,255,.60);
    --rule: rgba(255,255,255,.10);
    --accent: #ff7a59;
    --accent-hover: #ff5f3a;
    --code-bg: rgba(255,255,255,.06);
  }
}

/* ========== Base ========== */
html { -webkit-text-size-adjust: 100%; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: var(--lh);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a{
  color: var(--accent);
  text-decoration: none;
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}
a:hover{ color: var(--accent-hover); text-decoration: underline; }

hr{
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.2rem 0;
}

/* ========== Layout “chrome” (classes ok) ========== */
.container{
  max-width: calc(var(--measure) + 4rem);
  padding: 2.2rem 1.2rem;
  margin: 0 auto;
}

.site-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.2rem;
}

.brand{
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--text);
}
.brand .icon{
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 0;
}
.nav{
  display: flex;
  align-items: center;
}
.nav a{ color: var(--muted); margin-left: .9rem; }
.nav a:hover{ color: var(--text); text-decoration: none; }

.site-footer{
  padding-top: 1.6rem;
  color: var(--muted);
  font-size: .95rem;
}

/* Home "cards" */
.cards{
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 540px){
  .cards{ grid-template-columns: 1fr; }
}
.card{
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}
.card > img{
  width: 100%;
  height: 140px;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}
.card h3{ margin: 0 0 .4rem 0; font-size: 1.05rem; line-height: 1.25; padding: .9rem 1.05rem 0 1.05rem; }
.card p{
  margin: 0 1.05rem 1rem 1.05rem;
  padding: 0;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== Article typography (no classes required) ========== */
main{ display: block; }
article{
  max-width: var(--measure);
  margin: 0 auto;
}

article header{
  margin: 1.2rem 0 1.4rem 0;
}

h1{
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 .55rem 0;
  font-weight: 800;
}
.meta{
  color: var(--muted);
  font-size: .98rem;
}

h2, h3{
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 2rem 0 .65rem 0;
}
h2{ font-size: 1.55rem; }
h3{ font-size: 1.22rem; }

p{ margin: 0 0 1.05rem 0; font-size: 1.07rem; }
ul, ol{ margin: 0 0 1.2rem 1.2rem; padding: 0; }
li{ margin: .35rem 0; }

blockquote{
  margin: 1.4rem 0;
  padding: .2rem 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}
blockquote p{ margin: .6rem 0; }

code{
  font-family: var(--font-mono);
  font-size: .95em;
  padding: .12em .35em;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--code-bg);
}

pre{
  overflow: auto;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--code-bg);
}
pre code{
  padding: 0;
  border: 0;
  background: transparent;
  font-size: .92rem;
}

img{
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--rule);
}
.nav img, .brand img{
  border: 0;
  border-radius: 0;
  display: block;
}

figure{
  margin: 1.6rem 0;
}
figure img{
  display: block;
}
figcaption{
  margin-top: .5rem;
  font-size: .92rem;
  color: var(--muted);
  text-align: center;
}

@media print{
  body{ background: #fff; color: #000; }
  .site-header, .site-footer, .nav{ display: none !important; }
  a{ color: #000; text-decoration: underline; }
}