:root {
  --fg: #0f172a;
  --muted: #64748b;
  --subtle: #f1f5f9;
  --border: #e2e8f0;
  --card: #ffffff;
  --accent: #6366f1;
  --accent-dark: #4f46e5;
  --bg-gradient: linear-gradient(180deg, #eef2ff 0%, #f8fafc 300px);
  --radius: 16px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 20px rgba(15, 23, 42, 0.06);
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg-gradient);
  background-attachment: fixed;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 900px; margin: 0 auto; padding: 4rem 1.5rem 5rem; }

header {
  text-align: center;
  margin-bottom: 4rem;
}
header h1 { margin: 0; font-size: 3rem; letter-spacing: -0.03em; font-weight: 800; line-height: 1.1; background: linear-gradient(135deg, var(--fg) 0%, var(--accent) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
header h1 a { color: inherit; text-decoration: none; }
header p { color: var(--muted); font-size: 1.2rem; margin: 1rem auto 1.5rem; max-width: 560px; }
nav { display: inline-flex; gap: 0.5rem; background: var(--card); border-radius: 999px; padding: 0.35rem; box-shadow: var(--shadow); }
nav a { color: var(--fg); text-decoration: none; padding: 0.5rem 1.25rem; border-radius: 999px; font-weight: 500; font-size: 0.9rem; transition: background 0.15s; }
nav a:hover { background: var(--subtle); }

article {
  background: var(--card);
  padding: 3rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
article h1 { margin-top: 0; font-size: 2.5rem; letter-spacing: -0.025em; line-height: 1.15; }
article h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; color: var(--fg); font-weight: 700; letter-spacing: -0.01em; }
article h3 { font-size: 1.2rem; margin: 2rem 0 0.75rem; }
article p { margin: 0 0 1.2rem; }
article ul, article ol { padding-left: 1.5rem; }
article li { margin-bottom: 0.4rem; }
article code { background: var(--subtle); padding: 0.15rem 0.4rem; border-radius: 6px; font-size: 0.9em; }
article a { color: var(--accent); font-weight: 500; }
article strong { color: var(--fg); font-weight: 700; }

ul.articles {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
ul.articles li {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
ul.articles li:hover { transform: translateY(-3px); box-shadow: 0 4px 24px rgba(99, 102, 241, 0.15); }
ul.articles a {
  display: block;
  padding: 1.5rem;
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.4;
  height: 100%;
}
ul.articles a::after {
  content: '→';
  display: inline-block;
  margin-left: 0.4rem;
  color: var(--accent);
  transition: transform 0.15s;
}
ul.articles li:hover a::after { transform: translateX(4px); }

aside.related {
  margin: 4rem 0 0;
  background: var(--card);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
aside.related h3 { margin: 0 0 1rem; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
aside.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
aside.related a { color: var(--accent); text-decoration: none; font-weight: 500; padding: 0.35rem 0; display: block; }
aside.related a:hover { color: var(--accent-dark); }

footer {
  text-align: center;
  margin-top: 4rem;
  color: var(--muted);
  font-size: 0.9rem;
}
