/*
 * Jarrod Barnes - Personal Site
 * Design inspired by shikun.io
 * Serif body, minimal, generous whitespace
 */

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

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

body {
  font-family: 'Crimson Text', Georgia, 'Times New Roman', serif;
  line-height: 1.8;
  color: #1a1a1a;
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: #b8a590;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

a:hover {
  text-decoration-color: #1a1a1a;
}

h1 {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

h2 {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.25rem;
  color: #333;
}

em {
  font-style: italic;
}

strong {
  font-weight: 600;
}

/* Header / Navigation */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.nav-left, .nav-right {
  display: flex;
  gap: 24px;
  align-items: center;
}

.site-header a {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  text-decoration: none;
  color: #666;
  transition: color 0.2s;
}

.site-header a:hover,
.site-header a.active {
  color: #1a1a1a;
}

.site-header svg {
  display: block;
}

/* Main Content */
.site-content {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px;
  width: 100%;
}

/* Footer */
.site-footer {
  padding: 60px 40px;
  text-align: center;
  color: #999;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.8rem;
}

/* ===============================
   HOME PAGE
   =============================== */
.home-page {
  padding: 80px 0 120px;
}

.home-page .greeting {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.home-page .intro-name {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.home-page .intro-tagline {
  font-size: 1.5rem;
  font-weight: 400;
  color: #1a1a1a;
  margin-bottom: 2rem;
}

.home-page .intro-description {
  font-style: italic;
  color: #555;
  max-width: 600px;
  margin-bottom: 2.5rem;
}

.home-page .cta-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: #1a1a1a;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.home-page .cta-link:hover {
  background: #1a1a1a;
  color: #fff;
  text-decoration: none;
}

.home-page .cta-link::after {
  content: '|→';
  font-size: 0.9em;
}

/* ===============================
   ABOUT PAGE - Two Column Layout
   =============================== */
.about-page {
  padding: 60px 0 120px;
}

.about-page .opening-question {
  font-size: 1.35rem;
  font-style: italic;
  color: #333;
  max-width: 680px;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.about-page .opening-bridge {
  color: #555;
  margin-bottom: 4rem;
  max-width: 600px;
}

.about-section {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 40px;
  margin-bottom: 4rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid #eee;
}

.about-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.section-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1a1a1a;
  padding-top: 0.3rem;
}

.section-label::first-letter {
  font-size: 1.1em;
}

.section-content p {
  margin-bottom: 1.25rem;
}

.section-content p:last-child {
  margin-bottom: 0;
}

.project-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1.5rem;
}

.project-badge {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 12px;
  background: #f5f2ed;
  border-radius: 4px;
  text-decoration: none;
  color: #1a1a1a;
  transition: background 0.2s;
}

.project-badge:hover {
  background: #ebe7e0;
  text-decoration: none;
}

/* ===============================
   PROJECTS PAGE
   =============================== */
.projects-page {
  padding: 60px 0 120px;
}

.projects-page h1 {
  margin-bottom: 3rem;
}

/* Project Grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-bottom: 4rem;
}

.project-card {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  border-color: #ccc;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.project-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.project-card p {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 1rem;
}

.project-card .project-links {
  display: flex;
  gap: 12px;
}

.project-card .project-links a {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: #666;
  text-decoration: none;
}

.project-card .project-links a:hover {
  color: #1a1a1a;
  text-decoration: underline;
}

/* Section Headers */
.section-header {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
  margin-top: 4rem;
  margin-bottom: 1.5rem;
  padding-top: 2rem;
  padding-bottom: 0.75rem;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

/* Publication List */
.publication-list {
  margin-bottom: 4rem;
}

.publication-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 20px;
  padding: 1.25rem 0;
  border-bottom: 1px solid #f5f5f5;
}

.publication-item:last-child {
  border-bottom: none;
}

.pub-venue {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: #666;
  padding-top: 0.2rem;
}

.pub-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.pub-title a {
  text-decoration: none;
}

.pub-title a:hover {
  text-decoration: underline;
}

.pub-links {
  margin-top: 0.5rem;
}

.pub-links a {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: #666;
  text-decoration: none;
  margin-right: 12px;
}

.pub-links a:hover {
  color: #1a1a1a;
}

.pub-links a::before {
  content: '[';
}

.pub-links a::after {
  content: ']';
}

/* Writing List */
.writing-list {
  margin-bottom: 4rem;
  display: grid;
  gap: 16px;
}

.writing-item {
  padding: 1.25rem;
  border: 1px solid #eee;
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.writing-item:hover {
  border-color: #ccc;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.writing-item h3 {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.writing-item h3 a {
  text-decoration: none;
}

.writing-item h3 a:hover {
  text-decoration: underline;
}

.writing-item p {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 0;
}

/* Open Source List */
.oss-list {
  display: grid;
  gap: 16px;
}

.oss-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: baseline;
}

.oss-name {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
}

.oss-name a {
  text-decoration: none;
}

.oss-name a:hover {
  text-decoration: underline;
}

.oss-desc {
  color: #666;
  font-size: 0.95rem;
}

/* ===============================
   BLOG POSTS
   =============================== */

/* Post Layout */
.post {
  padding-top: 40px;
}

.post-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #eee;
}

.post-title {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: #1a1a1a;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.post-date {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.85rem;
  color: #666;
}

.post-categories {
  display: flex;
  gap: 8px;
}

.category {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 12px;
  background: #f5f2ed;
  border-radius: 4px;
  color: #555;
}

/* Post Content */
.post-content {
  max-width: 100%;
}

.post-content h2 {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  color: #1a1a1a;
}

.post-content h3 {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #1a1a1a;
}

/* Inline Code */
.post-content code {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  font-size: 0.875em;
  background: #f5f2ed;
  padding: 2px 6px;
  border-radius: 3px;
  color: #1a1a1a;
}

/* Code Blocks */
.post-content pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 1.5rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 2rem 0;
  line-height: 1.5;
  font-size: 0.9rem;
}

.post-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
}

/* Images */
.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2.5rem auto;
  border-radius: 4px;
}

/* Captions: only match em paragraphs that follow images or tables */
.post-content p[align] + p > em:only-child,
.post-content table + p > em:only-child {
  display: block;
  text-align: center;
  font-size: 0.875rem;
  color: #666;
  margin-top: -1.5rem;
  margin-bottom: 2rem;
}

/* Blockquotes */
.post-content blockquote {
  border-left: 3px solid #ddd;
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #555;
}

.post-content blockquote p {
  margin-bottom: 0;
}

/* Lists */
.post-content ul,
.post-content ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.75rem;
  color: #333;
}

.post-content li > ul,
.post-content li > ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}

.post-content thead th {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1a1a1a;
  padding: 10px 14px;
  border-bottom: 2px solid #ddd;
  text-align: left;
}

.post-content tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
  color: #333;
}

.post-content tbody tr:last-child td {
  border-bottom: none;
}

.post-content tbody tr:hover {
  background: #faf9f7;
}

@media (max-width: 768px) {
  .post-content table {
    font-size: 0.85rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .post-content thead th,
  .post-content tbody td {
    padding: 8px 10px;
    white-space: nowrap;
  }
}

/* Horizontal Rules */
.post-content hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 3rem 0;
}

/* Links in content */
.post-content a {
  color: #1a1a1a;
  text-decoration: underline;
  text-decoration-color: #999;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.post-content a:hover {
  text-decoration-color: #1a1a1a;
}

/* Post Footer */
.post-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.post-share {
  margin-bottom: 2rem;
}

.post-share span {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.85rem;
  color: #666;
  display: block;
  margin-bottom: 1rem;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.share-button {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.8rem;
  color: #666;
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid #eee;
  border-radius: 4px;
  transition: border-color 0.2s, color 0.2s;
}

.share-button:hover {
  border-color: #ccc;
  color: #1a1a1a;
  text-decoration: none;
}

/* Post Navigation */
.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.post-navigation a {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.9rem;
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}

.post-navigation a:hover {
  color: #1a1a1a;
}

.post-navigation .prev {
  text-align: left;
}

.post-navigation .next {
  text-align: right;
  margin-left: auto;
}

/* ===============================
   BLOG LIST PAGE
   =============================== */
.blog-page {
  padding: 60px 0 120px;
}

.blog-page h1 {
  margin-bottom: 3rem;
}

/* Post Grid */
.post-grid {
  display: grid;
  gap: 0;
}

.post-card {
  padding: 2rem 0;
  border-bottom: 1px solid #eee;
}

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

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

.post-card .post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 0.75rem;
}

.post-card .post-date {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.85rem;
  color: #666;
}

.post-card .post-categories {
  display: flex;
  gap: 8px;
}

.post-card .post-title {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.post-card .post-title a {
  text-decoration: none;
}

.post-card .post-title a:hover {
  text-decoration: underline;
}

.post-card .post-excerpt {
  color: #555;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.post-card .post-excerpt p {
  margin-bottom: 0;
}

.post-card .post-excerpt blockquote {
  border-left: 3px solid #ddd;
  padding-left: 1rem;
  margin: 0;
  font-style: italic;
  color: #555;
}

.post-card .read-more {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.85rem;
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}

.post-card .read-more:hover {
  color: #1a1a1a;
}

/* ===============================
   RESPONSIVE
   =============================== */
@media (max-width: 768px) {
  .site-header {
    padding: 20px;
  }

  .nav-left, .nav-right {
    gap: 16px;
  }

  .site-content {
    padding: 20px;
  }

  .home-page {
    padding: 40px 0 80px;
  }

  .home-page .intro-name,
  .home-page .intro-tagline {
    font-size: 1.25rem;
  }

  .about-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .section-label {
    margin-bottom: 0.5rem;
  }

  .publication-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .oss-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  /* Post responsive */
  .post {
    padding-top: 20px;
  }

  .post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }

  .post-title {
    font-size: 1.75rem;
  }

  .post-content h2 {
    font-size: 1.35rem;
    margin-top: 2.5rem;
  }

  .post-content h3 {
    font-size: 1.15rem;
    margin-top: 2rem;
  }

  .post-content pre {
    padding: 1rem;
    font-size: 0.85rem;
    margin: 1.5rem -20px;
    border-radius: 0;
  }

  .post-navigation {
    flex-direction: column;
    gap: 16px;
  }

  .post-navigation .next {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .site-header {
    flex-direction: column;
    gap: 16px;
  }

  .nav-left {
    order: 2;
  }

  .nav-right {
    order: 1;
  }

  h1 {
    font-size: 1.5rem;
  }

  .about-page .opening-question {
    font-size: 1.1rem;
  }

  /* Post responsive - small */
  .post-title {
    font-size: 1.5rem;
  }

  .post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .share-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .share-button {
    text-align: center;
  }
}

/* ===============================
   RESOURCE LINKS (Research CTAs)
   =============================== */
.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 1.5rem 0;
}

.resource-links--large {
  margin: 2rem 0;
}

.resource-btn {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: #555;
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  display: inline-block;
}

.resource-btn:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
  text-decoration: none;
}

.resource-btn--primary {
  padding: 10px 20px;
  font-size: 0.85rem;
  border-color: #1a1a1a;
  color: #1a1a1a;
}

.resource-btn--primary:hover {
  background: #1a1a1a;
  color: #fff;
}

@media (max-width: 480px) {
  .resource-links {
    flex-direction: column;
    gap: 8px;
  }

  .resource-btn {
    text-align: center;
  }
}
