/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a2e;
  --color-text-secondary: #555;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-border: #e5e7eb;
  --color-surface: #f8f9fc;
  --color-heading: #0f172a;
  --max-width: 720px;
  --header-height: 64px;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-heading);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-name:hover {
  color: var(--color-accent);
}

.site-header nav {
  display: flex;
  gap: 2rem;
}

.site-header nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.site-header nav a:hover {
  color: var(--color-accent);
}

.site-header nav .github-link {
  display: flex;
  align-items: center;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.site-header nav .github-link:hover {
  opacity: 1;
}

.site-header nav .github-link img {
  width: 20px;
  height: 20px;
}

/* ── Main Content ── */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ── Typography ── */
h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-heading);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-heading);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--color-border);
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-heading);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

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

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

strong, b {
  font-weight: 600;
  color: var(--color-heading);
}

em, i {
  font-style: italic;
}

/* ── Lists ── */
ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.35rem;
}

li::marker {
  color: var(--color-accent);
}

/* ── Front Page ── */
.frontpage {
  padding-top: 1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2.5rem;
}
.frontpage > :not(.profile-photo-col):not(.profile-bio) {
  grid-column: 1 / -1;
}
@media (max-width: 600px) {
  .frontpage {
    grid-template-columns: 1fr;
  }
}

/* ── Horizontal Rule ── */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* ── Code ── */
code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  background: var(--color-surface);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

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

/* ── Footer ── */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--color-text-secondary);
  font-weight: 500;
}

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

/* ── Responsive ── */
@media (max-width: 600px) {
  html { font-size: 16px; }

  .site-header nav {
    gap: 1.25rem;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.2rem; }
}
