/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
img, svg { display: block; }
img, video { max-width: 100%; height: auto; }
button { color: inherit; cursor: pointer; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.9em;
}

/* Theme variables — dark is default */
:root {
  --bg: #0f1117;
  --bg-surface: #1a1d27;
  --bg-hover: #22263a;
  --border: #2e3149;
  --text: #e2e8f0;
  --text-muted: #8892a4;
  --accent: #7c6af7;
  --accent-hover: #9585f9;
}

:root.light {
  --bg: #f8fafc;
  --bg-surface: #ffffff;
  --bg-hover: #f1f5f9;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #5b4de8;
  --accent-hover: #4338ca;
}

/* Base */
html {
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background-color: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  background-color: var(--bg);
}

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

/* Layout */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Nav */
.nav {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.nav-brand:hover {
  text-decoration: none;
  color: var(--accent);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 6px;
  color: var(--text-muted);
  transition: color 150ms, background 150ms;
}
.nav-icon-link:hover {
  color: #ff0000;
  background: var(--bg-hover);
  text-decoration: none;
}
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 150ms, background 150ms;
}
.theme-toggle:hover {
  color: var(--text);
  background: var(--bg-hover);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
}
.btn:hover {
  background: var(--bg-hover);
  text-decoration: none;
  color: var(--text);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 150ms;
}
.card:hover {
  border-color: var(--accent);
}

/* Typography */
h1 { font-size: 2rem; line-height: 1.2; font-weight: 700; }
h2 { font-size: 1.5rem; line-height: 1.3; font-weight: 600; }
h3 { font-size: 1.25rem; line-height: 1.4; font-weight: 600; }
p { margin-top: 1rem; }

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

/* Utilities */
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 1rem; }
.gap-2 { gap: 0.5rem; }

/* Hero */
.hero {
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: 2.5rem;
  line-height: 1.15;
}
.hero p {
  margin-top: 0.75rem;
  font-size: 1.1rem;
}

/* Articles section */
.articles-section {
  margin-top: 2.5rem;
}
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.article-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.article-card {
  display: block;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  transition: border-color 150ms, background 150ms;
  text-decoration: none;
  color: var(--text);
}
.article-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  text-decoration: none;
  color: var(--text);
}
.article-meta {
  margin-bottom: 0.35rem;
}
.article-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.article-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}
.article-desc {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.empty-state {
  padding: 3rem 0;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* About page */
.about-page {
  padding: 3rem 0;
  max-width: 600px;
}
.about-body p {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Post page */
.post {
  padding: 3rem 0;
  max-width: 660px;
}
.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.post-header h1 {
  margin-top: 0.5rem;
}
.post-description {
  margin-top: 0.75rem;
  font-size: 1.05rem;
  color: var(--text-muted);
}
.post-body p {
  margin-top: 1.25rem;
  line-height: 1.8;
}
.post-body h2 {
  margin-top: 2rem;
}
.post-body h3 {
  margin-top: 1.5rem;
}
.post-body a {
  color: var(--accent);
}
.post-body a:hover {
  color: var(--accent-hover);
}
.post-body strong {
  font-weight: 600;
}

/* ── Mobile responsive ── */
@media (max-width: 600px) {
  .container {
    padding: 0 1rem;
  }

  .nav-inner {
    padding: 0 1rem;
  }

  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }

  .article-card {
    padding: 1rem 1.25rem;
  }

  .post,
  .about-page {
    padding: 2rem 0;
  }

  /* Collapse nav label on very small screens */
  .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }
}
