/* Velantis — personal dev journal */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #f7f8fa;
  --surface:     #ffffff;
  --indigo:      #4338ca;
  --indigo-mid:  #6366f1;
  --indigo-light:#a5b4fc;
  --text:        #1a1f36;
  --text-muted:  #64748b;
  --border:      #e2e8ef;
  --code-bg:     #1e2533;
  --code-fg:     #a8d8b9;
  --accent-dim:  #eef2ff;

  --font-body: system-ui, -apple-system, 'Segoe UI', Helvetica, sans-serif;
  --font-mono: 'Menlo', 'Monaco', 'Fira Code', monospace;
  --font-serif: 'Georgia', 'Times New Roman', serif;

  --max-w: 720px;
  --wide-w: 1040px;
}

html { font-size: 17px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

/* ── Header ── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: var(--wide-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3rem;
}
.logo {
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: -.01em;
  color: var(--indigo);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.logo-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--indigo-mid);
}
nav { display: flex; gap: 1.6rem; }
nav a {
  font-size: .84rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: .01em;
  transition: color .15s;
}
nav a:hover, nav a.active { color: var(--indigo); }

/* ── Layout ── */
main { max-width: var(--max-w); margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
main.wide { max-width: var(--wide-w); }

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: .78rem;
  padding: 1.4rem 1.5rem;
  text-align: center;
}
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--indigo); }

/* ── Hero ── */
.hero {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 2.5rem;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  background: var(--code-bg);
}
.hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .55;
}
.hero-body {
  position: relative;
  padding: 2rem 2.2rem 2.4rem;
  color: #e8eaf0;
}
.hero-body h1 {
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: .5rem;
}
.hero-body p { font-size: 1rem; opacity: .75; max-width: 480px; }

/* ── Typography ── */
h1 { font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin-bottom: .9rem; color: var(--text); }
h2 { font-size: 1.3rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; margin: 2.2rem 0 .65rem; color: var(--text); }
h3 { font-size: 1.05rem; font-weight: 600; margin: 1.8rem 0 .45rem; color: var(--text-muted); }
p  { margin-bottom: 1rem; }
a  { color: var(--indigo); text-decoration: none; border-bottom: 1px solid var(--indigo-light); transition: color .15s; }
a:hover { color: var(--indigo-mid); }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: .3rem; }
blockquote {
  border-left: 3px solid var(--indigo-light);
  padding: .5rem 1.1rem;
  margin: 1.4rem 0;
  color: var(--text-muted);
  font-style: italic;
  background: var(--accent-dim);
  border-radius: 0 4px 4px 0;
}
hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
code {
  font-family: var(--font-mono);
  font-size: .8em;
  background: var(--accent-dim);
  color: var(--indigo);
  padding: .1em .4em;
  border-radius: 4px;
}
pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 1.1rem 1.3rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: .8rem;
  line-height: 1.7;
  margin: 1.4rem 0;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* ── Post grid ── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.3rem;
  margin: 1.8rem 0;
}
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .2s, border-color .2s;
}
.post-card:hover { box-shadow: 0 4px 16px rgba(67,56,202,.09); border-color: var(--indigo-light); }
.post-card img { width: 100%; height: 150px; object-fit: cover; display: block; }
.card-body { padding: 1rem 1.15rem 1.2rem; flex: 1; display: flex; flex-direction: column; }
.card-tag {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--indigo-mid);
  margin-bottom: .35rem;
}
.card-body h3 { font-size: 1rem; color: var(--text); margin: 0 0 .4rem; line-height: 1.35; }
.card-body p { font-size: .85rem; color: var(--text-muted); margin: 0; flex: 1; }
.card-date { font-size: .73rem; color: var(--text-muted); margin-top: .6rem; }

/* ── Post ── */
.post-header { margin-bottom: 1.8rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--border); }
.post-header .tag { font-size: .73rem; text-transform: uppercase; letter-spacing: .08em; color: var(--indigo-mid); margin-bottom: .5rem; }
.post-header h1 { margin-bottom: .4rem; }
.post-meta { font-size: .78rem; color: var(--text-muted); }
.post-hero { width: 100%; max-height: 360px; object-fit: cover; border-radius: 8px; margin-bottom: 1.8rem; display: block; }

/* ── Misc ── */
.pill {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--indigo);
  font-size: .75rem;
  padding: .18rem .6rem;
  border-radius: 999px;
  margin: .15rem;
  border-bottom: none;
}
.pill:hover { background: var(--indigo); color: white; }

.toc {
  background: var(--accent-dim);
  border: 1px solid var(--indigo-light);
  border-radius: 6px;
  padding: .9rem 1.2rem;
  margin: 1.4rem 0;
  font-size: .85rem;
}
.toc ul { margin: .3rem 0 0; }
.toc li { margin-bottom: .2rem; }
.toc a { border-bottom: none; color: var(--indigo); }

.section-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-bottom: .9rem;
}

.now-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  margin: 1.1rem 0;
}
.now-block h3 { margin-top: 0; }

.error-page { text-align: center; padding: 4rem 1.5rem; }
.error-page .big-num { font-size: 5rem; color: var(--indigo-light); font-weight: 700; line-height: 1; margin-bottom: .4rem; }

@media (max-width: 600px) {
  html { font-size: 15px; }
  nav { gap: .9rem; }
  .hero-body h1 { font-size: 1.5rem; }
  .post-grid { grid-template-columns: 1fr; }
}
