:root {
  --font-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --bg: #09090b;
  --surface-1: #18181b;
  --surface-2: #27272a;
  --border: #3f3f46;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-subtle: #71717a;
  --accent: #a78bfa;
  --accent-dim: rgba(167, 139, 250, 0.15);
  --accent-glow: rgba(167, 139, 250, 0.4);
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

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

a:hover {
  text-decoration: underline;
}

header {
  padding: var(--space-2xl) 0;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-lg);
}

.logo {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
  position: relative;
}

.logo::after {
  content: '';
  position: absolute;
  bottom: 0.1em;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}

.tagline {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.125rem;
}

nav {
  margin-top: var(--space-md);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs);
  list-style: none;
}

.nav-list a {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s var(--ease-out);
  border: 1px solid transparent;
}

.nav-list a:hover {
  color: var(--text);
  background: var(--surface-1);
  border-color: var(--border);
}

.nav-list a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: var(--accent);
}

.social {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.2s var(--ease-out);
}

.social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px -10px var(--accent-glow);
}

.hero {
  padding: var(--space-3xl) 0;
  text-align: center;
}

.hero-text {
  max-width: 680px;
  margin: 0 auto;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 400;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: var(--space-md);
}

.hero p {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 540px;
  margin: 0 auto;
}

main {
  padding: var(--space-2xl) 0 var(--space-3xl);
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
}

@media (min-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr 280px;
    gap: var(--space-3xl);
  }
}

.articles {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

article {
  position: relative;
  padding: var(--space-xl);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: all 0.3s var(--ease-out);
  overflow: hidden;
}

article::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-dim) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

article:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent-dim);
}

article:hover::before {
  opacity: 1;
}

.article-inner {
  position: relative;
  z-index: 1;
}

.article-category {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.375rem 0.75rem;
  background: var(--surface-2);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: var(--space-md);
  transition: all 0.2s var(--ease-out);
}

.article-category:hover {
  background: var(--accent-dim);
  text-decoration: none;
}

.article-title {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: var(--space-md);
}

.article-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}

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

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  font-size: 0.875rem;
  color: var(--text-subtle);
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.article-meta a {
  color: var(--accent);
}

.article-excerpt {
  color: var(--text-muted);
  line-height: 1.75;
  font-size: 1rem;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.tag {
  padding: 0.25rem 0.625rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--text-subtle);
  text-decoration: none;
  transition: all 0.2s var(--ease-out);
}

.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding: 0.75rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s var(--ease-out);
}

.read-more:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  text-decoration: none;
}

.read-more svg {
  transition: transform 0.2s var(--ease-out);
}

.read-more:hover svg {
  transform: translateX(4px);
}

aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.widget {
  padding: var(--space-lg);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.widget-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 400;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.875rem;
  transition: all 0.2s var(--ease-out);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-box input::placeholder {
  color: var(--text-subtle);
}

.search-box svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
}

.widget-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.widget-list li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
}

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

.widget-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s var(--ease-out);
}

.widget-list a:hover {
  color: var(--accent);
}

.cat-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.cat-list > li {
  margin-bottom: var(--space-xs);
}

.cat-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0.875rem;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s var(--ease-out);
}

.cat-list a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.cat-list .count {
  padding: 0.125rem 0.5rem;
  background: var(--bg);
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.cat-list .children {
  list-style: none;
  margin-left: var(--space-lg);
  padding-left: var(--space-md);
  border-left: 1px solid var(--border);
}

.cat-list .children a {
  font-size: 0.8125rem;
  padding: 0.375rem 0.625rem;
}

footer {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--space-2xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-section h4 {
  font-family: var(--font-serif);
  font-size: 1rem;
  margin-bottom: var(--space-md);
  color: var(--text);
}

.footer-section p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s var(--ease-out);
}

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

.subscribe {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.subscribe input {
  padding: 0.875rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.875rem;
  transition: all 0.2s var(--ease-out);
}

.subscribe input:focus {
  outline: none;
  border-color: var(--accent);
}

.subscribe button {
  padding: 0.875rem 1.5rem;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: var(--bg);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.subscribe button:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px -10px var(--accent-glow);
}

.footer-bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.8125rem;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

header {
  animation: fadeUp 0.6s var(--ease-out) forwards;
}

.hero {
  animation: fadeUp 0.6s 0.1s var(--ease-out) both;
}

article {
  opacity: 0;
  animation: fadeUp 0.5s var(--ease-out) forwards;
}

article:nth-child(1) {
  animation-delay: 0.2s;
}

article:nth-child(2) {
  animation-delay: 0.3s;
}

article:nth-child(3) {
  animation-delay: 0.4s;
}

article:nth-child(4) {
  animation-delay: 0.5s;
}

article:nth-child(5) {
  animation-delay: 0.6s;
}

article:nth-child(6) {
  animation-delay: 0.7s;
}

article:nth-child(7) {
  animation-delay: 0.8s;
}

article:nth-child(8) {
  animation-delay: 0.9s;
}

.widget {
  opacity: 0;
  animation: fadeUp 0.5s var(--ease-out) 0.4s forwards;
}

.widget:nth-child(2) {
  animation-delay: 0.5s;
}

.widget:nth-child(3) {
  animation-delay: 0.6s;
}

.widget:nth-child(4) {
  animation-delay: 0.7s;
}

main {
  animation: fadeUp 0.6s 0.1s var(--ease-out) both;
}

@media (max-width: 640px) {
  article {
    padding: var(--space-lg);
    border-radius: 16px;
  }

  .article-tags {
    gap: var(--space-xs);
  }

  .tag {
    font-size: 0.6875rem;
    padding: 0.2rem 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: 0 0 12px 12px;
  font-weight: 500;
  z-index: 1000;
  transition: top 0.2s var(--ease-out);
}

.skip-link:focus {
  top: 0;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border);
}
