/* ---------------------------------------------------------------------------
   Basic Hugo starter styles.
   Everything is driven by the custom properties in :root so you can re-skin
   the whole site by changing a handful of values. Dark mode is automatic via
   prefers-color-scheme.
--------------------------------------------------------------------------- */

:root {
  --bg:        #ffffff;
  --fg:        #1a1a1a;
  --muted:     #6b6b6b;
  --accent:    #2d6cdf;
  --border:    #e6e6e6;
  --code-bg:   #f5f5f5;

  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --measure:   52rem;   /* max line length for readable content */
  --space:     1.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #15171a;
    --fg:      #e7e7e7;
    --muted:   #9aa0a6;
    --accent:  #6ea8fe;
    --border:  #2a2d31;
    --code-bg: #1d2024;
  }
}

* { box-sizing: border-box; }

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

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

body {
  margin: 0;
  background: transparent; /* canvas paints the background */
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
}

.container {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--space);
}

/* --- header / nav ------------------------------------------------------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: var(--space);
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

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

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

/* --- main content ------------------------------------------------------- */
main { padding-block: calc(var(--space) * 2); }

a { color: var(--accent); }

h1, h2, h3 {
  line-height: 1.25;
  letter-spacing: -0.015em;
}

h1 { font-size: 2rem; margin-top: 0; }

/* --- post lists --------------------------------------------------------- */
.post-list {
  list-style: none;
  padding: 0;
  margin: var(--space) 0;
}

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

.post-list a { text-decoration: none; }
.post-list a:hover { text-decoration: underline; }

.post-list time,
.post-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

/* --- single post -------------------------------------------------------- */
.post-header { margin-bottom: calc(var(--space) * 1.5); }
.post-content > :first-child { margin-top: 0; }

.post-content img { max-width: 100%; height: auto; }

pre, code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  padding: var(--space);
  border-radius: 8px;
  overflow-x: auto;
}

pre code { background: none; padding: 0; }

blockquote {
  margin-inline: 0;
  padding-left: var(--space);
  border-left: 3px solid var(--border);
  color: var(--muted);
}

/* --- footer ------------------------------------------------------------- */
.site-footer {
  margin-top: calc(var(--space) * 3);
  padding-block: var(--space);
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
