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

:root {
  --color-bg: #0a0a0a;
  --color-surface: #141414;
  --color-text: #e0e0e0;
  --color-text-muted: #888;
  --color-accent: #00d4aa;
  --color-accent-dim: #009977;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --max-width: 720px;
}

html {
  font-size: 16px;
  line-height: 1.7;
}

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

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

a:hover {
  text-decoration: underline;
}

/* Header */
.site-header {
  border-bottom: 1px solid #222;
  padding: 1rem 2rem;
}

.site-header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header .logo {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
}

.site-header ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.site-header ul a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.site-header ul a:hover {
  color: var(--color-accent);
}

/* Main */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
  flex: 1;
  width: 100%;
}

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.hero h1 {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.hero .description {
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.hero .cta {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}

.hero .cta:hover {
  background: var(--color-accent);
  color: var(--color-bg);
  text-decoration: none;
}

.hero-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Page & Post shared content styles */
.page h1,
.post-header h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.page h1 {
  margin-bottom: 1.5rem;
}

.page h2,
.post h2 {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.4rem;
}

.page h3,
.post h3 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
}

.page p,
.post p {
  margin-bottom: 1rem;
}

.page ul,
.page ol,
.post ul,
.post ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.page li,
.post li {
  margin-bottom: 0.25rem;
}

.page code,
.post code {
  font-family: var(--font-mono);
  background: var(--color-surface);
  padding: 0.15rem 0.4rem;
  font-size: 0.85rem;
  border-radius: 3px;
}

.page pre,
.post pre {
  background: var(--color-surface);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  border-radius: 4px;
}

.page pre code,
.post pre code {
  background: none;
  padding: 0;
}

.page img,
.post img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 0.5rem 0 1rem;
}

/* Tables */
.page table,
.post table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.page th,
.post th {
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid #333;
  padding: 0.5rem 1.5rem 0.5rem 0;
}

.page td,
.post td {
  padding: 0.4rem 1.5rem 0.4rem 0;
  border-bottom: 1px solid #1a1a1a;
}

.page td:last-child,
.post td:last-child,
.page th:last-child,
.post th:last-child {
  padding-right: 0;
}

/* Back link */
.back-link {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #1a1a1a;
}

.back-link a {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}

.back-link a:hover {
  background: var(--color-accent);
  color: var(--color-bg);
  text-decoration: none;
}

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

.post-header time {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Devlog List */
.devlog-list {
  list-style: none;
}

.devlog-list li {
  padding: 1.25rem 0;
  border-bottom: 1px solid #1a1a1a;
}

.devlog-list li:last-child {
  border-bottom: none;
}

.devlog-list time {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.devlog-list a {
  font-size: 1.15rem;
  font-weight: 600;
}

/* Language Switch */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.lang-switch a {
  color: var(--color-text-muted);
  font-weight: 500;
}

.lang-switch a.active {
  color: var(--color-accent);
}

.lang-switch a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.lang-divider {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

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

.footer-nav {
  margin-bottom: 0.5rem;
}

.footer-nav a {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

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

.footer-divider {
  margin: 0 0.5rem;
}

/* Responsive */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .hero .tagline {
    font-size: 1rem;
  }

  main {
    padding: 2rem 1rem;
  }
}
