/* CSS Variables */
:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-secondary: #475569;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-border: #e2e8f0;
  --color-accent: #059669;
  --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --max-width: 1100px;
  --content-width: 750px;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

img {
  max-width: 100%;
  height: auto;
}

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

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

.site-title:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  color: var(--color-secondary);
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-primary);
  text-decoration: none;
  border-bottom-color: var(--color-primary);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  padding: 4rem 0;
  text-align: center;
}

.hero-headshot {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border: 4px solid white;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--color-primary);
  margin: 0;
  font-weight: 600;
}

.hero-org {
  font-size: 1.25rem;
  color: var(--color-secondary);
  margin: 0.25rem 0 1.5rem;
}

.hero-description {
  max-width: 650px;
  margin: 0 auto 2rem;
  font-size: 1.125rem;
  color: var(--color-text-light);
}

.hero-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-secondary {
  background: white;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-primary);
  color: white;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section h2 {
  font-size: 2rem;
  margin: 0 0 2rem;
  text-align: center;
}

/* Focus Grid */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.focus-card {
  background: white;
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.focus-card h3 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
  color: var(--color-primary);
}

.focus-card p {
  margin: 0;
  color: var(--color-text-light);
}

/* Post List */
.post-list {
  max-width: var(--content-width);
  margin: 0 auto 2rem;
}

.post-preview {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.post-preview:last-child {
  border-bottom: none;
}

.post-preview h2,
.post-preview h3 {
  margin: 0 0 0.25rem;
}

.post-preview h2 a,
.post-preview h3 a {
  color: var(--color-text);
}

.post-preview h2 a:hover,
.post-preview h3 a:hover {
  color: var(--color-primary);
}

.post-preview time {
  font-size: 0.875rem;
  color: var(--color-text-light);
}

.post-preview p {
  margin: 0.5rem 0 0;
  color: var(--color-text-light);
}

.blog-list {
  margin-bottom: 3rem;
}

.blog-intro {
  text-align: center;
  color: var(--color-text-light);
  max-width: var(--content-width);
  margin: 0 auto 2rem;
}

/* Page Content */
.page-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3rem 0;
}

.page-content h1 {
  font-size: 2.5rem;
  margin: 0 0 1.5rem;
}

.page-content h2 {
  font-size: 1.75rem;
  margin: 2.5rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.page-content h3 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  color: var(--color-text);
}

.page-content ul, 
.page-content ol {
  padding-left: 1.5rem;
}

.page-content li {
  margin-bottom: 0.5rem;
}

.page-content strong {
  color: var(--color-text);
}

/* Post */
.post {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3rem 0;
}

.post-header {
  margin-bottom: 2rem;
  text-align: center;
}

.post-header h1 {
  font-size: 2.25rem;
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
}

.post-header time {
  color: var(--color-text-light);
}

.post-content {
  font-family: var(--font-serif);
}

.post-content h2 {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
}

.post-content h3 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
}

/* Code */
code {
  font-family: 'SF Mono', Consolas, 'Liberation Mono', monospace;
  font-size: 0.9em;
  background: var(--color-bg-alt);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.25rem 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  line-height: 1.5;
}

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

/* Footer */
.site-footer {
  background: var(--color-text);
  color: white;
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-content p {
  margin: 0;
  color: #94a3b8;
}

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

.social-links a {
  color: #94a3b8;
  transition: color 0.2s ease;
}

.social-links a:hover {
  color: white;
}

/* Responsive */
@media (max-width: 768px) {
  .site-header .container {
    flex-direction: column;
    gap: 1rem;
  }

  .main-nav ul {
    gap: 1rem;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }

  .section {
    padding: 3rem 0;
  }

  .page-content h1 {
    font-size: 2rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

/* Syntax Highlighting (Prism.js - One Dark theme) */
.highlight-line {
  display: inline-block;
  min-width: 100%;
}

.highlight-line-isdir {
  color: #b267e6;
}

.highlight-line-active {
  background-color: #3d4555;
}

.highlight-line-add {
  background-color: #1a4721;
}

.highlight-line-remove {
  background-color: #4a1f1f;
}

pre[class*="language-"] {
  position: relative;
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.25rem 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  line-height: 1.5;
  margin: 1.5rem 0;
}

code[class*="language-"] {
  background: none;
  padding: 0;
  color: inherit;
  font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.875rem;
}

/* Token colors */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6b7280;
}

.token.punctuation {
  color: #9ca3af;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #f472b6;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #a3e635;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #67e8f9;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #818cf8;
}

.token.function,
.token.class-name {
  color: #fbbf24;
}

.token.regex,
.token.important,
.token.variable {
  color: #fb923c;
}

/* Copy button */
pre[class*="language-"]::before {
  content: attr(data-language);
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-wrapper {
  position: relative;
}

.copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  background: #334155;
  color: #94a3b8;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}

pre:hover .copy-button,
.code-wrapper:hover .copy-button {
  opacity: 1;
}

.copy-button:hover {
  background: #475569;
  color: #e2e8f0;
}

.copy-button.copied {
  background: #059669;
  color: white;
}
