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

:root {
  --bg: #f5f4f1;
  --fg: #37352f;
  --fg-secondary: #52514c;
  --muted: #6b7280;
  --accent: #2563eb;
  --border: #e5e7eb;
  --code-bg: #f3f4f6;
  --surface: #f9fafb;
  --max-width: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --fg: #e4e4e7;
    --fg-secondary: #d1d5db;
    --muted: #9ca3af;
    --accent: #60a5fa;
    --border: #27272a;
    --code-bg: #1e1e22;
    --surface: #18181b;
  }
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
}

body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Navigation --- */

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

nav .site-name {
  font-weight: 700;
  text-decoration: none;
  color: var(--fg);
}

nav .nav-links {
  display: flex;
  gap: 1.25rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
}

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

/* --- Base typography --- */

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

a:hover {
  text-decoration: underline;
}

p {
  margin-bottom: 1rem;
}

h1, h2, h3 {
  line-height: 1.3;
}

/* --- Hero --- */

.hero {
  margin-bottom: 3.5rem;
}

.hero h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.hero p {
  color: var(--fg-secondary);
  margin-bottom: 1rem;
  max-width: 34rem;
}

/* --- Home sections --- */

.home-section {
  margin-bottom: 3rem;
}

.home-section h2 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* --- Item lists (shared across experience, projects, writing) --- */

.experience-list,
.item-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.experience-list li,
.item-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.experience-list li:first-child,
.item-list li:first-child {
  padding-top: 0;
}

.experience-list li:last-child,
.item-list li:last-child {
  border-bottom: none;
}

.experience-list h3,
.item-list h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.experience-list p,
.item-list p {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* --- Linked items (writing section) --- */

.item-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-decoration: none;
  color: var(--fg);
}

.item-link:hover {
  text-decoration: none;
}

.item-link:hover h3 {
  color: var(--accent);
}

.chevron {
  font-size: 1.25rem;
  color: var(--muted);
  flex-shrink: 0;
  line-height: 1;
}

/* --- Blog list page --- */

.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list li:first-child {
  padding-top: 0;
}

.post-list time {
  font-size: 0.75rem;
  color: var(--muted);
}

.post-list h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.15rem 0 0.2rem;
}

.post-list p {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
}

/* --- Article --- */

article h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

article time {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

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

/* --- Prose (article body) --- */

main h2 { font-size: 1.25rem; margin-top: 2rem; margin-bottom: 0.5rem; }
main h3 { font-size: 1.1rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }

code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

pre code {
  background: none;
  padding: 0;
}

blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  color: var(--muted);
  margin: 1.25rem 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

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

li {
  margin-bottom: 0.25rem;
}

/* --- Footer --- */

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  color: var(--muted);
  transition: color 0.15s;
}

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