/* ── Design Tokens ─────────────────────────────────── */
:root {
  --color-bg: #ffffff;
  --color-text: #1a1a2e;
  --color-accent: #3de8b0;
  --color-accent-dark: #2bc494;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-surface: #f9fafb;
  --color-hero-bg: #0f2027;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", monospace;
  --max-width: 1100px;
  --radius: 6px;
}

/* ── Reset ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-accent-dark);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--color-accent); }

img { max-width: 100%; height: auto; }

/* ── Container ────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.site-logo:hover { color: var(--color-accent-dark); }

.site-nav { display: flex; gap: 2rem; align-items: center; }

.site-nav a {
  color: var(--color-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s;
}
.site-nav a:hover { color: var(--color-text); }

/* Mobile nav toggle */
.nav-toggle { display: none; }
.nav-toggle-label {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--color-text);
  line-height: 1;
}

/* ── Hero ─────────────────────────────────────────── */
.hero {
  background: var(--color-hero-bg);
  background-image: url("/images/hero-circuit.png");
  background-size: cover;
  background-position: center;
  color: #ffffff;
  padding: 6rem 0;
  text-align: center;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 32, 39, 0.7);
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.hero p {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.5;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--color-accent);
  color: var(--color-hero-bg);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius);
  transition: background 0.15s, transform 0.1s;
}
.btn:hover {
  background: var(--color-accent-dark);
  color: var(--color-hero-bg);
  transform: translateY(-1px);
}

/* ── Features ─────────────────────────────────────── */
.features {
  padding: 5rem 0;
}

.features h2 {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 3rem;
  letter-spacing: -0.02em;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.feature-card {
  padding: 2rem;
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: var(--radius);
  background: var(--color-bg);
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ── Section (generic) ────────────────────────────── */
.section {
  padding: 4rem 0;
}

.section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.section--alt {
  background: var(--color-surface);
}

/* ── Post Cards ───────────────────────────────────── */
.post-list {
  display: grid;
  gap: 1.5rem;
}

.post-card {
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  transition: border-color 0.15s;
}
.post-card:hover {
  border-color: var(--color-accent);
}

.post-card__date {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 0.25rem;
}

.post-card__title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.post-card__title a {
  color: var(--color-text);
}
.post-card__title a:hover {
  color: var(--color-accent-dark);
}

.post-card__summary {
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ── Blog Post (single) ──────────────────────────── */
.post {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.post__header {
  margin-bottom: 2.5rem;
}

.post__title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.post__date {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.post__content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.post__content h2 { font-size: 1.5rem; margin: 2rem 0 1rem; font-weight: 600; }
.post__content h3 { font-size: 1.25rem; margin: 1.5rem 0 0.75rem; font-weight: 600; }
.post__content p { margin-bottom: 1.25rem; }
.post__content ul, .post__content ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.post__content li { margin-bottom: 0.5rem; }

.post__content code {
  font-family: var(--font-mono);
  background: var(--color-surface);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

.post__content pre {
  background: #1a1a2e;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.post__content pre code {
  background: none;
  padding: 0;
  font-size: 0.9rem;
}

.post__content blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: 1rem;
  color: var(--color-muted);
  margin-bottom: 1.25rem;
  font-style: italic;
}

.post__content img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

.post__back {
  display: inline-block;
  margin-top: 3rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}
.post__back:hover { color: var(--color-accent-dark); }

/* ── Page (about, docs) ──────────────────────────── */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.page-content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.page-content h2 { font-size: 1.5rem; margin: 2rem 0 1rem; font-weight: 600; }
.page-content p { margin-bottom: 1.25rem; }
.page-content ul { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.page-content li { margin-bottom: 0.5rem; }

/* ── Footer ───────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
}

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

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
}

/* ── Pagination ───────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 3rem;
  font-size: 0.95rem;
}

.pagination a {
  color: var(--color-muted);
  font-weight: 500;
}
.pagination a:hover { color: var(--color-accent-dark); }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .nav-toggle-label {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.75rem;
  }

  .nav-toggle:checked ~ .site-nav {
    display: flex;
  }

  .hero {
    padding: 4rem 0;
  }
}
