/* =============================================
   DESIGN TOKENS
   Change these to retheme the whole site.
   ============================================= */
:root {
  --bg:      #F8F8F6;
  --ink:     #1A1A1A;
  --accent:  #5C7A62;
  --muted:   #8A8A8A;
  --rule:    #DEDED9;
  --serif:   'DM Serif Display', Georgia, serif;
  --sans:    'Inter', system-ui, sans-serif;
}


/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 2rem;
}


/* =============================================
   NAV
   ============================================= */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(248, 248, 246, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
}
.nav-name {
  font-family: var(--serif);
  font-size: 1.05rem;
}
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--ink); }


/* =============================================
   HERO
   ============================================= */
#hero {
  padding-top: 140px;
  padding-bottom: 100px;
  border-top: none;
}
.hero-rule {
  width: 40px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 2rem;
}
.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
h1 {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6vw, 3.8rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}
.hero-sub {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}
.hero-sub strong { color: var(--ink); font-weight: 500; }
.cta-group { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  border-radius: 2px;
  transition: all 0.2s;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { border: 1px solid var(--rule); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }


/* =============================================
   SECTIONS — shared
   ============================================= */
section {
  padding: 80px 0;
  border-top: 1px solid var(--rule);
}
.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2.5rem;
}
h2 {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 400;
  margin-bottom: 1.25rem;
}
p {
  color: #3A3A3A;
  font-weight: 300;
  margin-bottom: 1rem;
}
p:last-child { margin-bottom: 0; }
.section-intro {
  font-size: 1rem;
  font-weight: 300;
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 2rem;
}
.credentials {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 1.75rem;
}


/* =============================================
   LATEST POST PREVIEW
   Shown on the home page for each section.
   ============================================= */
.latest-post {
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
  margin-bottom: 1.5rem;
}
.latest-post h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 0.4rem;
}
.latest-post h3 a { transition: color 0.2s; }
.latest-post h3 a:hover { color: var(--accent); }
.latest-post p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.post-meta {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.read-more {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  transition: opacity 0.2s;
}
.read-more:hover { opacity: 0.7; }
.archive-link {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.5rem;
  transition: color 0.2s;
}
.archive-link:hover { color: var(--ink); }


/* =============================================
   COMING SOON PLACEHOLDER
   ============================================= */
.coming-soon {
  padding: 2.5rem;
  border: 1px dashed var(--rule);
  border-radius: 3px;
  text-align: center;
  margin-top: 1.5rem;
}
.coming-soon p {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}


/* =============================================
   ARCHIVE / SECTION LIST PAGE
   ============================================= */
.archive {
  padding-top: 120px;
  padding-bottom: 80px;
  border-top: none;
}
.post-list { margin-top: 2rem; }
.post-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.post-item:first-child { padding-top: 0; }
.post-item:last-child { border-bottom: none; }
.post-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.post-item-title {
  font-size: 1rem;
  font-weight: 500;
  transition: color 0.2s;
}
.post-item-title:hover { color: var(--accent); }
.post-item-summary {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 300;
}

/* Hugo's built-in pagination */
.pagination {
  display: flex;
  gap: 0.5rem;
  margin-top: 2.5rem;
  font-size: 0.82rem;
}
.pagination a, .pagination span {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--muted);
  transition: all 0.2s;
}
.pagination a:hover { border-color: var(--ink); color: var(--ink); }
.pagination .active span {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}


/* =============================================
   SINGLE POST PAGE
   ============================================= */
.single {
  padding-top: 120px;
  padding-bottom: 80px;
  border-top: none;
}
.single-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}
.single-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

/* Tag chips on single posts */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.tag {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: #4A4A4A;
}

/* Rendered markdown content styles */
.post-content { max-width: 660px; }
.post-content p {
  margin-bottom: 1.4rem;
  font-size: 1rem;
  line-height: 1.8;
}
.post-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
.post-content h3 {
  font-size: 1.15rem;
  font-weight: 500;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.4rem;
}
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li {
  font-size: 1rem;
  font-weight: 300;
  color: #3A3A3A;
  margin-bottom: 0.4rem;
  line-height: 1.7;
}
.post-content a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.post-content a:hover { border-color: var(--accent); }
.post-content img {
  max-width: 100%;
  border-radius: 3px;
  margin: 2rem 0;
}
.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
}
.post-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: var(--rule);
  padding: 0.15em 0.4em;
  border-radius: 2px;
}
.post-content pre {
  background: #1A1A1A;
  color: #F8F8F6;
  padding: 1.25rem;
  border-radius: 3px;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.88rem;
  color: inherit;
}

/* Back link at the bottom of a post */
.back-link {
  display: inline-block;
  margin-top: 3rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.back-link:hover { color: var(--ink); }


/* =============================================
   CONTACT
   ============================================= */
#contact { border-bottom: 1px solid var(--rule); }
.contact-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  transition: color 0.2s;
}
.contact-link:hover { color: var(--accent); }
.contact-link svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}


/* =============================================
   FOOTER
   ============================================= */
footer { padding: 2rem 0; }
footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
footer p { font-size: 0.78rem; color: var(--muted); font-weight: 400; }


/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 600px) {
  .nav-links { display: none; }
  #hero { padding-top: 100px; padding-bottom: 70px; }
  section { padding: 60px 0; }
  .archive, .single { padding-top: 90px; }
  .post-item-header { flex-direction: column; gap: 0.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* =============================================
   HERO PHOTO
   ============================================= */
.hero-inner {
  display: flex;
  align-items: center;
  gap: 4rem;
}
.hero-text {
  flex: 1;
  min-width: 0;
}
.hero-photo {
  flex-shrink: 0;
  width: 240px;
}
.hero-photo img {
  width: 100%;
  display: block;
  border-radius: 3px;
}

/* Stack vertically on mobile */
@media (max-width: 600px) {
  .hero-inner {
    flex-direction: column-reverse;
    gap: 2rem;
  }
  .hero-photo {
    width: 100%;
    max-width: 320px;
  }
}

/* =============================================
   DARK MODE
   Automatically applies when the user's OS
   is set to dark mode. To adjust colors, edit
   the variables below — they override the
   defaults set in :root at the top of the file.
   ============================================= */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #1A1A1A;
    --ink:    #E8E8E4;
    --accent: #C4622D;
    --muted:  #6A6A6A;
    --rule:   #2E2E2B;
  }

  /* Slightly lighten body text in dark mode for readability */
  p { color: #C8C8C4; }
  .post-content p { color: #C8C8C4; }
  .post-content li { color: #C8C8C4; }
  .tag { color: #A0A09C; }

  /* Nav background in dark mode */
  nav { background: rgba(26, 26, 26, 0.92); }

  /* Soften inline code background */
  .post-content code { background: #2E2E2B; }
}