/*
 * style.css — the one stylesheet for this entire site
 *
 * To change the font: update the @import line below and the font-family in
 * the Typography section. That's it.
 *
 * To change colors: edit the custom properties in :root.
 *
 * Table of contents:
 *   1. Font import
 *   2. Custom properties (colors, sizes)
 *   3. Reset
 *   4. Base typography
 *   5. Layout
 *   6. Navigation
 *   7. Home page
 *   8. Article pages (projects, pages)
 *   9. Post list
 *  10. Reflection section
 *  11. Code blocks
 *  12. Blockquotes
 *  13. Footer
 *  14. 404 page
 */


/* ============================================================
   1. Font — self-hosted Newsreader (latin subset)
   Files live in /assets/fonts/. No CDN dependency.
   To update the font, replace the .woff2 files and adjust
   the src paths below.
   ============================================================ */

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('fonts/newsreader-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 300 800;
  font-display: swap;
  src: url('fonts/newsreader-italic.woff2') format('woff2');
}


/* ============================================================
   2. Custom properties
   ============================================================ */

:root {
  --bg:       #f7f1e6;   /* warm cream — slightly warmer than pure #f5f0e8 */
  --text:     #1a1714;   /* dark warm brown */
  --muted:    #6b6560;   /* secondary text: dates, labels, captions */
  --accent:   #c25e2a;   /* rust — links, highlights */
  --border:   #ddd8cf;   /* subtle dividers */
  --code-bg:  #ede8df;   /* inset background for inline code and code blocks */

  --max-width: 680px;
  --padding:   2rem;
}


/* ============================================================
   3. Reset
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}


/* ============================================================
   4. Base typography
   ============================================================ */

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
  line-height: 1.75;
  font-optical-sizing: auto;
}

h1, h2, h3, h4 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

h1 { font-size: 2rem;    margin-bottom: 0.4rem; }
h2 { font-size: 1.35rem; margin-top: 2.25rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.1rem;  margin-top: 1.75rem; margin-bottom: 0.4rem; }
h4 { font-size: 1rem;    margin-top: 1.5rem; }

p {
  margin-bottom: 1.25rem;
}

p:last-child {
  margin-bottom: 0;
}

ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Inline emphasis */
strong { font-weight: 700; }
em     { font-style: italic; }

time, .date {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

figure {
  margin: 2rem 0;
}

figcaption {
  color: var(--muted);
  font-size: 0.875rem;
  font-style: italic;
  margin-top: 0.5rem;
  text-align: center;
}


/* ============================================================
   5. Layout — single centered column
   ============================================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--padding);
}

body > header,
body > main,
body > footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--padding);
}

body > header {
  padding-top: 4rem;
  padding-bottom: 1.5rem;
}

body > main {
  padding-bottom: 3rem;
}

body > footer {
  padding-top: 2rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--border);
}


/* ============================================================
   6. Navigation
   ============================================================ */

/* Top nav on home page: shown beneath the h1 */
.site-nav {
  margin-top: 0.75rem;
  color: var(--text);
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--text);
}

.site-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Home link on inner pages: shown above the h1 */
body > header > a {
  display: block;
  margin-bottom: 1.25rem;
  font-size: 1.0rem;
}


/* ============================================================
   7. Home page
   ============================================================ */

.home-bio {
  font-size: 1.05rem;
  color: var(--text);
}

.home-section {
  margin-top: 3rem;
}

.home-section h2 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 1rem;
}


/* ============================================================
   8. Article pages (projects, pages)
   ============================================================ */

.article-header h1 {
  font-size: 1.8rem;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.article-header time {
  display: block;
  margin-top: 0.25rem;
}

/* The article body — scoped styles so post content looks right */
article p,
article ul,
article ol {
  margin-bottom: 1.25rem;
}

article h2 {
  margin-top: 2.5rem;
}

article h3 {
  margin-top: 2rem;
}


/* ============================================================
   9. Post list (home page and any index pages)
   ============================================================ */

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.post-list li:first-child {
  border-top: 1px solid var(--border);
}

.post-list a {
  color: var(--text);
  font-size: 1rem;
}

.post-list a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-list time {
  flex-shrink: 0;
  font-size: 0.85rem;
}

/* On small screens, stack the date below the title */
@media (max-width: 480px) {
  .post-list li {
    flex-direction: column;
    gap: 0.15rem;
  }
}


/* ============================================================
   10. Reflection section
   (appears at the bottom of every project write-up — not on living pages)
   ============================================================ */

.reflection {
  margin-top: 3rem;
  padding: 1.5rem 1.5rem 1.5rem 1.75rem;
  border-left: 3px solid var(--accent);
  background-color: var(--code-bg);
  border-radius: 0 4px 4px 0;
}

.reflection h2 {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--text);
}

.reflection h3 {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
  font-weight: 600;
}

.reflection p:last-child {
  margin-bottom: 0;
}


/* ============================================================
   11. Code blocks
   ============================================================ */

code {
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}


/* ============================================================
   12. Blockquotes
   ============================================================ */

blockquote {
  border-left: 3px solid var(--border);
  margin: 1.75rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  color: var(--muted);
  font-style: italic;
}

blockquote p {
  margin-bottom: 0;
}


/* ============================================================
   13. Footer
   ============================================================ */

footer {
  color: var(--muted);
  font-size: 0.9rem;
}

footer a {
  color: var(--muted);
}

footer a:hover {
  color: var(--accent);
  text-decoration: none;
}


/* ============================================================
   14. 404 page
   ============================================================ */

.page-404 {
  text-align: center;
  padding-top: 5rem;
}

.page-404 pre {
  display: inline-block;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  margin: 2rem auto;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text);
}

.page-404 h1 {
  font-size: 1.5rem;
  margin-top: 0;
}

.page-404 img {
  margin: 0 auto;
}

/* Alternating red/green letters — change colors here */
.xmas span:nth-child(odd)  { color: #cc0000; }
.xmas span:nth-child(even) { color: #008000; }
