:root{
  /* type + rhythm */
  --base: 20px;                 /* body font-size */
  --lh: 1.7;                    /* line-height */
  --measure: 66ch;              /* max readable line length */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;

  /* colors (light) */
  --bg: #faf7f2;
  --text: #0f0f0f;
  --muted: #555;
  --link: #0f0f0f;
  --tag-bg: #e8e2d5;           /* Slightly darker beige for tags */

  color-scheme: light dark; /* enables native form control theming and pairs with prefers-color-scheme */
}

/* dark theme overrides */
:root.dark{
  --bg: #0f0f0f;
  --text: #eae7e1;
  --muted: #aaa;
  --link: #eae7e1;
  --tag-bg: #2a2a2a;            /* Dark gray for tags in dark mode */
}

html, body{
  padding:0; margin:0;
  background: var(--bg);
  color: var(--text);
  font-size: var(--base);
  line-height: var(--lh);
  /* serif stack that matches the feel on macOS/iOS and falls back cleanly */
  font-family:
    "New York", "Iowan Old Style", "Palatino Linotype", Palatino,
    "Book Antiqua", Georgia, "Times New Roman", Times, serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-variant-ligatures: common-ligatures;
}

main{
  /* left-aligned narrow column with generous right whitespace */
  max-width: var(--measure);
  padding: var(--space-4) var(--space-2) var(--space-5);
  margin-left: clamp(16px, 12vw, 220px); /* creates the left gutter seen on the site */
}

h1{
  font-size: 1.9rem;            /* ~38px on base 20px */
  margin: 0 0 var(--space-2) 0;
  font-weight: 700;
}

h2{
  font-size: 1.15rem;
  margin: var(--space-4) 0 var(--space-2);
  font-weight: 700;
}

p{ margin: 0 0 var(--space-2) 0; }

ul{ 
  margin: 0 0 var(--space-3) 0;
  padding-left: 1.25rem;
}
li{ margin: 0.35rem 0; }

a{
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

/* small gray metadata text */
.muted{ color: var(--muted); }

/* toggle pill near the title */
.theme-toggle{
  display:inline-flex; align-items:center; justify-content:center;
  width: 34px; height: 22px; border-radius: 999px;
  border: 1px solid currentColor; opacity:.8;
  margin-left: .5rem; cursor:pointer; user-select:none;
  font-size: 12px; line-height: 0;
}
.theme-toggle:hover{ opacity:1; }

/* Additional styles for your existing components */
nav {
  margin-bottom: var(--space-4);
}

nav a {
  color: var(--text);
  margin-right: var(--space-3);
}

/* Image styles - smaller size for better performance */
img {
  max-width: 80%;
  height: auto;
  max-height: 400px;
  margin: var(--space-3) auto;
  display: block;
  object-fit: contain;
}

/* Code blocks if needed */
pre, code {
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 0.9em;
}

/* Blockquote styling */
blockquote {
  border-left: 3px solid var(--muted);
  padding-left: var(--space-2);
  margin: var(--space-3) 0;
  color: var(--muted);
}