@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #090a10;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --text: #f5f5f7;
  --muted: #9699a8;
  --border: rgba(255, 255, 255, 0.09);
  --accent: #9b7cff;
  --accent-2: #6f8cff;
  --max-width: 1040px;
}

:root.light {
  --bg: #f7f7fa;
  --surface: rgba(0, 0, 0, 0.035);
  --surface-hover: rgba(0, 0, 0, 0.06);
  --text: #111218;
  --muted: #626572;
  --border: rgba(0, 0, 0, 0.1);
  --accent: #7054d9;
  --accent-2: #4d6de0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(111, 76, 255, 0.12), transparent 35rem),
    radial-gradient(circle at 80% 10%, rgba(68, 104, 255, 0.08), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  transition: background 0.2s, color 0.2s;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.06em;
}

nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

nav a {
  color: var(--muted);
  font-size: 0.85rem;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--text);
}

#theme-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}

main {
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  padding: 110px 0 85px;
  max-width: 760px;
}

.eyebrow {
  display: block;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin-bottom: 20px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.075em;
}

.hero h1 span {
  color: var(--muted);
}

.hero p {
  max-width: 600px;
  margin-top: 30px;
  color: var(--muted);
  font-size: 1.05rem;
}

.posts {
  padding-bottom: 100px;
}

.post-card {
  display: block;
  padding: 30px 0;
  border-top: 1px solid var(--border);
  transition: transform 0.2s;
}

.post-card:hover {
  transform: translateX(5px);
}

.post-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.post-category {
  color: var(--accent);
}

.post-card h2 {
  margin: 0;
  max-width: 800px;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.post-description {
  max-width: 700px;
  color: var(--muted);
  margin: 12px 0 0;
}

.empty {
  border-top: 1px solid var(--border);
  padding: 45px 0;
}

.empty span {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

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

.article-container {
  max-width: 820px;
  padding-top: 90px;
  padding-bottom: 100px;
}

.article-header {
  margin-bottom: 65px;
}

.article-header h1 {
  font-size: clamp(2.7rem, 7vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
  margin: 15px 0 25px;
}

.article-description {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 700px;
}

.article {
  font-size: 1.03rem;
}

.article h1,
.article h2,
.article h3 {
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.article h2 {
  font-size: 1.9rem;
  margin-top: 65px;
}

.article h3 {
  font-size: 1.35rem;
  margin-top: 45px;
}

.article p {
  margin: 1.25rem 0;
}

.article a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article blockquote {
  margin: 30px 0;
  padding: 5px 25px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

.article code {
  padding: 0.15em 0.4em;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
}

.article pre {
  overflow-x: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
}

.article pre code {
  padding: 0;
  border: 0;
  background: transparent;
}

.article img {
  max-width: 100%;
  border-radius: 12px;
}

.article hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 45px 0;
}

.back {
  display: inline-block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 35px;
}

.back:hover {
  color: var(--text);
}

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

footer {
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 45px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
}

footer a:hover {
  color: var(--text);
}

@media (max-width: 600px) {
  .site-header {
    padding: 22px 0;
  }

  nav {
    gap: 15px;
  }

  .hero {
    padding: 75px 0 60px;
  }

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

  .article-container {
    padding-top: 55px;
  }

  .article-header h1 {
    font-size: 3rem;
  }
}
