/* ── Tokens ──────────────────────────────────────────────── */
:root {
  --font-sans: "Roboto", system-ui, -apple-system, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --bg: #ffffff;
  --text: #1a202c;
  --muted: #64748b;
  --accent: #0f5c4d;
  --accent-hover: #0a4036;
  --border: #e2e8f0;

  --header-bg: #0d1117;
  --header-text: #e2e8f0;

  --hero-bg: #0d1117;
  --hero-text: #f0f6ff;
  --hero-grid: rgba(16, 185, 129, 0.07);
  --hero-glow: rgba(62, 207, 142, 0.13);
  --hero-accent: #3ecf8e;
}

/* ── Reset & base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: var(--font-sans);
  font-synthesis: none;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  scroll-behavior: smooth;
}

body { margin: 0; }

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

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

/* ── Layout ──────────────────────────────────────────────── */
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  background: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3.25rem;
}

.site-title {
  font-family: var(--font-sans);
  color: var(--header-text);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.15s;
}

.site-title:hover { color: var(--hero-accent); }

.site-nav {
  display: flex;
  gap: 1.75rem;
}

.site-nav a {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.6);
  letter-spacing: 0.03em;
  transition: color 0.15s;
}

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

/* ── Hero (parallax via background-attachment: fixed) ────── */
.hero {
  background-color: var(--hero-bg);
  background-image:
    linear-gradient(var(--hero-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-attachment: fixed;
  min-height: 58vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 5rem 1.5rem;
}

/* radial glow from top */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 55% at 50% -5%, var(--hero-glow), transparent 65%);
  pointer-events: none;
}

/* bottom fade into page bg */
.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6rem;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  animation: hero-fade-up 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hero-accent);
  margin: 0 0 1.25rem;
}

.hero-heading {
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 5vw, 2.875rem);
  font-weight: 700;
  color: var(--hero-text);
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.025em;
}

/* ── Main content ────────────────────────────────────────── */
.content {
  padding-top: 3rem;
  padding-bottom: 4.5rem;
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

/* ── Post list (homepage) ────────────────────────────────── */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list li:first-child { border-top: 1px solid var(--border); }

.post-list a {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text);
  flex: 1;
}

.post-list a:hover { color: var(--accent); }

.post-list .post-date {
  font-family: var(--font-sans);
  font-size: 0.78125rem;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* ── Post / page articles ────────────────────────────────── */
.post-meta {
  font-family: var(--font-sans);
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
}

.post-header h1,
.page-header h1 {
  margin-top: 0.25rem;
  margin-bottom: 2rem;
}

.post-body a,
.page-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.75rem 0;
  padding: 0.375rem 1.25rem;
  color: var(--muted);
  font-style: italic;
}

blockquote strong { color: var(--text); font-style: normal; }

/* ── Code ────────────────────────────────────────────────── */
pre, code { font-family: var(--font-mono); }

pre {
  overflow-x: auto;
  padding: 1.25rem 1.5rem;
  background: #0d1117;
  color: #c9d1d9;
  border-radius: 8px;
  font-size: 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin: 1.5rem 0;
}

code {
  font-size: 0.85em;
  background: #f1f5f9;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: #c0392b;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}

/* ── Screenshot helper ───────────────────────────────────── */
.post-screenshot {
  max-width: 320px;
  display: block;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  margin: 1.25rem 0;
}

/* ── Back to top ─────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  min-width: 3rem;
  min-height: 3rem;
  line-height: 1;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, background 0.2s, transform 0.2s;
  z-index: 200;
  text-decoration: none;
}

.back-to-top:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-2px);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
