/* ==========================================================================
   Theme variables
   ========================================================================== */
:root {
    --color-bg-200: #e9e9e7;
  --color-bg: #f2f0e9;
  --color-text: #111;
  --color-text-muted: #444;
  --color-text-subtle: #555;
  --color-border: #999;
  --color-headshot-bg: #ddd;
  --color-headshot-text: #666;
  --color-link: #0000ee;
  --color-link-visited: #551a8b;
}

@media (prefers-color-scheme: dark) {
  :root {
      --color-bg-200: #0e0e0e;
    --color-bg: #0e0e0e;
    --color-text: #eee;
    --color-text-muted: #bbb;
    --color-text-subtle: #999;
    --color-border: #555;
    --color-headshot-bg: #333;
    --color-headshot-text: #aaa;
    --color-link: #8ab4ff;
    --color-link-visited: #c3a6e0;
  }
}

/* Manual override classes, in case you want a toggle button later
   instead of (or in addition to) relying on OS-level preference */
.theme-light {
  --color-bg: #f2f0e9;
  --color-text: #111;
  --color-text-muted: #444;
  --color-text-subtle: #555;
  --color-border: #999;
  --color-headshot-bg: #ddd;
  --color-headshot-text: #666;
  --color-link: #0000ee;
  --color-link-visited: #551a8b;
}
.theme-dark {
  --color-bg: #1a1a17;
  --color-text: #eee;
  --color-text-muted: #bbb;
  --color-text-subtle: #999;
  --color-border: #555;
  --color-headshot-bg: #333;
  --color-headshot-text: #aaa;
  --color-link: #8ab4ff;
  --color-link-visited: #c3a6e0;
}

/* ==========================================================================
   Base
   ========================================================================== */
body {
  max-width: 680px;
  margin: 0 auto;
  padding: 30px 20px 60px;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Libertinus Serif", Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.5;
}

a {
  color: var(--color-link);
}
a:visited {
  color: var(--color-link-visited);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 26px 0;
}

/* ==========================================================================
   Header / nav
   ========================================================================== */
h1 {
  font-size: 1.9rem;
  margin: 0 0 4px;
}
h1 a {
  color: var(--color-text);
  text-decoration: none;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 12px;
}

p.tagline {
  margin: 0 0 20px;
  color: var(--color-text-muted);
}

.headshot {
  width: 120px;
  height: 120px;
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.headshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

nav {
  margin-bottom: 24px;
}
nav a {
  margin-right: 14px;
}

.archive-header {
  margin-bottom: 20px;
}

/* ==========================================================================
   Post previews (writing / archive)
   ========================================================================== */
.post {
  margin-bottom: 18px;
  border: 1px solid var(--color-border);
  padding: 0.8em;
}
.post-date {
  color: var(--color-text-subtle);
  font-size: 0.85rem;
}
.post h3 {
  font-size: 1.05rem;
  margin: 2px 0 6px;
}
.post p {
  margin: 0 0 4px;
}

/* ==========================================================================
   Projects
   ========================================================================== */
   .project-grid {
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
     gap: 1rem;
     align-items: start; /* cards align to top of their row, not bottom */
   }

   .project-card {
     text-decoration: none;
     color: inherit;
     display: flex;
     flex-direction: column;
   }

   .project-card img {
     width: 100%;
     height: auto;
     display: block;
     margin: 0 0 8px; /* just spacing below image, no more auto-centering trick */
   }

   .project-card h3 {
     font-size: 0.85rem;
     margin: 0 0 2px;
   }

   .project-card .project-category {
     font-size: 0.7rem;
     color: var(--color-text-subtle);
     margin: 0;
   }

   .project-hero-image {
     max-width: 300px; /* was 100% / 500px — much smaller now */
     width: 100%;
     max-height: 300px;
     height: auto;
     object-fit: contain;
     display: block;
     margin: 0 auto 20px; /* centers it and adds space below before the outline/content */
   }



/* ==========================================================================
   CV
   ========================================================================== */
table.cv {
  border-collapse: collapse;
}
table.cv td {
  padding: 6px 14px 6px 0;
  vertical-align: top;
}
table.cv td.year {
  white-space: nowrap;
  color: var(--color-text-muted);
}
table.cv td p {
  margin: 0; /* set:html descriptions wrap in <p> by default; kill extra spacing in table cells */
}

/* ==========================================================================
   Contact / footer
   ========================================================================== */
.contact-label {
  color: var(--color-text-subtle);
  font-size: 0.85rem;
}
footer {
  margin-top: 40px;
  color: var(--color-text-subtle);
  font-size: 0.85rem;
}

/* ==========================================================================
   Prose (longform markdown content — writing posts, project write-ups)
   ========================================================================== */
.outline {
font-style: italic;
font-size: 1.1em;
}

   .prose {
  font-size: 1.1em;
  line-height: 1.7;
}

.prose > * + * {
  margin-top: 1.2em; /* consistent vertical rhythm between block elements */
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  line-height: 1.3;
  margin-top: 1.8em;
  margin-bottom: 0.5em;
}
.prose h1 {
    font-size: 1.5em;

}
.prose h2 {
    font-size: 1.3em;
    padding-bottom: 1em;
    margin-bottom:1em;
    border-bottom: 1px solid var(--color-border);
}
.prose h3 { font-size: 1.15em; }
.prose h4 { font-size: 1em; font-weight: bold; }

.prose p {
  margin: 0;
  margin-bottom: 1.4em;
}

.prose a {
  color: var(--color-link);
  text-decoration: underline;
}
.prose a:visited {
  color: var(--color-link-visited);
}

.prose strong {
  font-weight: bold;
}
.prose em {
  font-style: italic;
}

.prose blockquote {
  margin: 1.2em 0;
  padding-left: 1em;
  border-left: 3px solid var(--color-border);
  color: var(--color-text-muted);
  font-style: italic;
}
.prose blockquote p {
  margin: 0;
}

.prose ul,
.prose ol {
  margin: 0;
  padding-left: 1.4em;
}
.prose li {
  margin-bottom: 0.4em;
}
.prose li > ul,
.prose li > ol {
  margin-top: 0.4em;
}

.prose code {
  font-family: 'SF Mono', Consolas, 'Courier New', monospace;
  font-size: 0.85em;
  background: var(--color-headshot-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.prose pre {
  background: var(--color-headshot-bg);
  padding: 1em;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.2em 0;
}
.prose pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
}

.prose img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.2em auto;
}

.prose hr {
  margin: 2em 0;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.2em 0;
}
.prose th,
.prose td {
  border: 1px solid var(--color-border);
  padding: 0.5em 0.8em;
  text-align: left;
}

.prose .credits {
    /*font-family:'Arial';*/
    font-style: italic;
    /*margin-bottom: 1em;*/
    font-size: 0.8rem;
    line-height: 1;
}

.prose .credits h3 {
    margin-bottom: 1em;
}
