/* Blog stylesheet.
   Served with a content-hashed query string so browsers can cache it
   forever and pick up new versions automatically when the bytes change.
*/

:root {
  /* Dark palette is the default. A single warm orange accent
     drives every interactive element. */
  --bg: #0d0f12;
  --surface: #15181d;
  --surface-hover: #1b1f26;
  --text: #e8e6e3;
  --muted: #8a8580;
  --accent: #ff7a1a;
  --accent-hover: #ffa257;
  --accent-soft: rgba(255, 122, 26, 0.12);
  --border: #25292f;
  --code-bg: #1a1d22;
  --quote-border: var(--accent);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --radius: 6px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafaf8;
    --surface: #ffffff;
    --surface-hover: #f5f3f0;
    --text: #1a1a1a;
    --muted: #6a6560;
    --accent: #d35400;
    --accent-hover: #ff7a1a;
    --accent-soft: rgba(211, 84, 0, 0.08);
    --border: #e6e3df;
    --code-bg: #f4f1ed;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
  }
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter",
               "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ─── Two-column layout (sidebar + content) ───────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 720px);
  gap: 4rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.sidebar {
  position: sticky;
  top: 4rem;
  align-self: start;
  display: flex;
  flex-direction: column;
}

.sidebar .site-title {
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
}

.site-bio {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0 0 1.5rem;
}

.content {
  min-width: 0;
}

@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem 1.25rem 3rem;
    max-width: 720px;
  }
  .sidebar {
    position: static;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
  }
  .site-bio { margin-bottom: 1rem; }
}

/* ─── Site header / nav ───────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.site-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  position: relative;
  padding-left: 0.85rem;
}

.site-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.site-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.15rem 0;
  transition: color 120ms ease, padding-left 160ms ease;
  border-left: 2px solid transparent;
  padding-left: 0.7rem;
  margin-left: -0.7rem;
}

.site-nav a:hover {
  color: var(--accent);
  border-left-color: var(--accent);
}

/* ─── Typography ──────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 1.8em 0 0.6em;
  font-weight: 700;
  color: var(--text);
}

h1 { font-size: 2rem; margin-top: 0; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1.1em; }

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

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

/* ─── Code ────────────────────────────────────────────────────────── */
code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color: var(--accent-hover);
}

pre {
  background: var(--code-bg);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  margin: 1.5em 0;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.55;
}

pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: var(--text);
}

/* ─── Blockquote ──────────────────────────────────────────────────── */
blockquote {
  border-left: 3px solid var(--quote-border);
  margin: 1.5em 0;
  padding: 0.5em 0 0.5em 1.1em;
  color: var(--muted);
  font-style: italic;
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}

blockquote p { margin: 0.4em 0; }

/* ─── Lists ───────────────────────────────────────────────────────── */
ul, ol { padding-left: 1.5rem; margin: 1em 0; }
li { margin: 0.3em 0; }

ul li::marker { color: var(--accent); }

/* ─── Index post list ─────────────────────────────────────────────── */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li { margin: 0; }
.post-list li::marker { content: ""; }

.post-card {
  display: block;
  position: relative;
  padding: 1.2rem 1.35rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}

.post-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 160ms ease;
}

.post-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--surface-hover);
  text-decoration: none;
}

.post-card:hover::before { transform: scaleY(1); }

.post-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  color: var(--accent);
}

.post-card .post-summary {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.post-meta {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

/* ─── Single post ─────────────────────────────────────────────────── */
article header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

article header h1 { margin: 0 0 0.4rem; }

/* ─── Footer ──────────────────────────────────────────────────────── */
.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

/* ─── Misc ────────────────────────────────────────────────────────── */
img { max-width: 100%; height: auto; border-radius: var(--radius); }

::selection { background: var(--accent); color: #0d0f12; }
