/* ==========================================================================
   rahar.net — a quiet, minimal theme
   Light/dark aware · serif reading · one warm accent
   ========================================================================== */

:root {
  --font-serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-sans:  system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:  "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;

  --bg:        #fdfdfb;
  --bg-soft:   #f4f2ec;
  --fg:        #1f1d18;
  --fg-muted:  #6b675d;
  --line:      #e4e0d6;
  --accent:    #b3432f;
  --accent-fg: #ffffff;

  --measure: 40rem;        /* readable line length */
  --space:   clamp(1.25rem, 4vw, 2rem);
  --radius:  10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #15140f;
    --bg-soft:  #211f18;
    --fg:       #ece8de;
    --fg-muted: #9d9789;
    --line:     #322f26;
    --accent:   #e8775e;
    --accent-fg:#1a1812;
  }
}

/* --- Reset-ish ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
img, svg, video { max-width: 100%; height: auto; vertical-align: middle; }
a { color: inherit; }

/* --- Base ---------------------------------------------------------------- */
body {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding: var(--space);
  padding-bottom: 4rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.content { flex: 1 0 auto; }

/* --- Header / nav -------------------------------------------------------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1.25rem 1.75rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}
.site-title {
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.site-nav {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  display: flex;
  gap: 1.25rem;
}
.site-nav a {
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--accent); }

/* --- Email-validity notice (home hero) ----------------------------------- */
.notice {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: 3rem;
}
.notice-title {
  font-size: 1.5rem;
  letter-spacing: -0.015em;
  margin-bottom: 0.6rem;
}
.notice p { margin-top: 0.6rem; }
.notice p:first-of-type { color: var(--fg); }
.notice strong { font-weight: 600; }

/* --- Home intro + sections ----------------------------------------------- */
.home-intro {
  color: var(--fg-muted);
  margin-bottom: 3rem;
}
.section-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  margin-bottom: 1rem;
}

/* --- Post list ----------------------------------------------------------- */
.posts { list-style: none; padding: 0; }
.post-item { border-bottom: 1px solid var(--line); }
.post-item:first-child { border-top: 1px solid var(--line); }
.post-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.25rem;
  padding: 0.9rem 0;
  text-decoration: none;
  transition: padding-left 0.15s ease, color 0.15s ease;
}
.post-link:hover { padding-left: 0.4rem; color: var(--accent); }
.post-link time {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--fg-muted);
  min-width: 6.5rem;
  font-variant-numeric: tabular-nums;
}
.post-link:hover time { color: inherit; }
.post-item-title { font-size: 1.0625rem; }

/* --- Post / page --------------------------------------------------------- */
.post-head, .page-head { margin-bottom: 2.25rem; }
.post-head h1, .page-head h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.post-meta, .subtitle {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: 0.6rem;
}
.post-meta .dot { margin-inline: 0.4rem; }
.post-meta .tag { font-style: italic; }

/* --- Prose --------------------------------------------------------------- */
.prose > * + * { margin-top: 1.4rem; }
.prose h2 {
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  margin-top: 2.5rem;
}
.prose h3 { font-size: 1.15rem; margin-top: 2rem; }
.prose a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
.prose a:hover { text-decoration-thickness: 2px; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.4rem; }
.prose blockquote {
  border-left: 3px solid var(--line);
  padding-left: 1.2rem;
  color: var(--fg-muted);
  font-style: italic;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-soft);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.prose pre {
  font-family: var(--font-mono);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
}
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.prose img { border-radius: var(--radius); }

/* --- Post nav ------------------------------------------------------------ */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}
.post-nav a { color: var(--fg-muted); text-decoration: none; }
.post-nav a:hover { color: var(--accent); }
.post-nav .next { margin-left: auto; text-align: right; }

/* --- Footer -------------------------------------------------------------- */
.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--fg-muted);
}
.site-footer p + p { margin-top: 0.4rem; }
.site-footer a { color: var(--fg-muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.site-footer a:hover { color: var(--accent); }
.footer-note { opacity: 0.85; }

/* --- Utilities ----------------------------------------------------------- */
.muted { color: var(--fg-muted); }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
