/* ---------- Theme ---------- */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1917;
  --muted: #78716c;
  --border: #e7e5e4;
  --accent: #2563eb;
  --max-width: 760px;
  --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1917;
    --surface: #292524;
    --text: #f5f5f4;
    --muted: #a8a29e;
    --border: #44403c;
    --accent: #60a5fa;
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

main {
  flex: 1;
  padding: 2rem 0 4rem;
}

h1,
h2,
h3 {
  line-height: 1.25;
}

.muted {
  color: var(--muted);
}

/* ---------- Header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
}

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

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

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

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

.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

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

/* ---------- Home ---------- */
.hero {
  padding: 2rem 0;
}

.hero h1 {
  font-size: 2.25rem;
  margin: 0 0 0.5rem;
}

.hero p {
  font-size: 1.125rem;
  color: var(--muted);
  margin: 0;
}

.section {
  margin-top: 3rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

/* ---------- Cards (portfolio) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-image {
  aspect-ratio: 16 / 9;
  background: var(--border);
}

.card-body {
  padding: 1rem;
}

.card-body h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.card-body p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.925rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.tags li {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
}

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

.post-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list a {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

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

.post-list p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

time {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- Single post ---------- */
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  margin: 0 0 0.25rem;
  font-size: 2rem;
}

.post-content {
  font-size: 1.05rem;
}

.post-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
}

.post-content blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

.back-link {
  display: inline-block;
  margin-top: 3rem;
}
