@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
  color-scheme: light;
  --color-bg: #f7f8fb;
  --color-surface: #ffffff;
  --color-text: #1f1f2c;
  --color-muted: #6b6b82;
  --color-accent: #4f46e5;
  --color-accent-soft: #e0e7ff;
  --color-border: #e3e4ed;
  --shadow-soft: 0 20px 50px rgba(58, 64, 169, 0.08);
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

img {
  max-width: 100%;
  display: block;
  border-radius: 16px;
}

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

.wrapper {
  width: min(1100px, 90vw);
  margin: 0 auto;
}

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.site-header .wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 20px;
}

.brand-title {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-subtitle {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.main-nav {
  display: flex;
  gap: 16px;
  font-weight: 500;
}

.main-nav a {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s;
}

.main-nav a:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.main-nav .active {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.hero {
  padding: 80px 0 30px;
}

.ai-disclosure {
  margin-top: 24px;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px dashed var(--color-accent);
  background: rgba(79, 70, 229, 0.08);
  color: var(--color-text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.ai-disclosure strong {
  display: inline-block;
  margin-right: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  color: var(--color-accent);
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: 12px;
  line-height: 1.2;
}

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

.search {
  background: var(--color-surface);
  padding: 32px;
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 16px;
}

.search label {
  font-weight: 600;
}

.search-control input {
  width: 100%;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  font-size: 1rem;
}

.search-hint {
  display: block;
  margin-top: 8px;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.posts {
  margin: 48px auto 80px;
}

.posts-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
}

.posts-header h2 {
  margin: 0;
}

.posts-header p {
  margin: 0;
  color: var(--color-muted);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--color-surface);
  border-radius: 24px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-4px);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
}

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

.card-title {
  margin: 0;
  font-size: 1.4rem;
}

.button {
  display: inline-flex;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  justify-content: center;
  border: none;
  cursor: pointer;
  background: var(--color-accent);
  color: #fff;
  transition: opacity 0.2s;
}

.button:hover {
  opacity: 0.9;
}

.button.ghost {
  background: transparent;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
}

.empty-state {
  text-align: center;
  color: var(--color-muted);
  margin-top: 32px;
}

footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 32px 0;
  color: var(--color-muted);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
}

.article {
  margin: 60px auto 40px;
  background: var(--color-surface);
  padding: 40px;
  border-radius: 32px;
  box-shadow: var(--shadow-soft);
}

.article h1 {
  margin-top: 0;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.article-meta {
  color: var(--color-muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.article p {
  line-height: 1.75;
  font-size: 1.05rem;
}

.article-sidebar {
  margin-bottom: 80px;
}

.sidebar-card {
  background: var(--color-surface);
  padding: 24px;
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 20px;
}

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

@media (max-width: 720px) {
  .site-header .wrapper {
    flex-direction: column;
    gap: 12px;
  }

  .search,
  .article {
    padding: 24px;
  }
}
