/* Sean Lewis — Clean Light Theme */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@700;800&family=IBM+Plex+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #ffffff;
  --bg-tan: #faf6f1;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f8f8;
  --text: #1a1a1a;
  --text-dim: #4a4a4a;
  --text-muted: #8a8a8a;
  --accent: #0d7c5f;
  --accent-hover: #0a6049;
  --coral: #d4563a;
  --purple: #6d5acd;
  --border: #e5e5e5;
  --border-hover: #ccc;
  --radius: 10px;

  /* Mermaid */
  --mermaid-bg-color: #faf6f1;
  --mermaid-fg-color: #4a4a4a;
  --mermaid-fg-color--lighter: #e5e5e5;
  --mermaid-fg-color--lightest: #f5f5f5;
  --mermaid-node-bg-color: #f0ebe4;
  --mermaid-node-fg-color: #0d7c5f;
  --mermaid-label-fg-color: #1a1a1a;
  --mermaid-label-bg-color: #faf6f1;
  --mermaid-edge-color: #0d7c5f;
  --mermaid-font-family: 'IBM Plex Sans', sans-serif;
  --mermaid-font-weight: 500;
}

/* ── Base ── */
body {
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
  background: var(--bg) !important;
  color: var(--text) !important;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}

h1 { font-weight: 800; }

a { color: var(--accent); transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

p { color: var(--text-dim); }

html { scroll-behavior: smooth; }

::selection {
  background: rgba(13, 124, 95, 0.15);
  color: #000;
}

/* ── Navbar ── */
.navbar {
  background: #fff !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 0.5rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.navbar-brand, .navbar-title {
  color: var(--text) !important;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.navbar-nav .nav-link {
  color: var(--text-dim) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem !important;
  border-radius: 8px;
  transition: all 0.2s;
}

.navbar-nav .nav-link:hover {
  color: var(--text) !important;
  background: rgba(13, 124, 95, 0.06);
}

.navbar-nav .nav-link.active { color: var(--accent) !important; }
.navbar .bi { font-size: 1.1rem; color: var(--text-dim); }

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── About Page (jolla template) ── */
.quarto-about-jolla {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  min-height: 100vh;
}

.quarto-about-jolla::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse,
    rgba(13, 124, 95, 0.06) 0%,
    rgba(109, 90, 205, 0.03) 50%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.quarto-about-jolla .about-entity,
.quarto-about-jolla .about-contents {
  position: relative;
  z-index: 1;
}

.quarto-about-jolla .about-entity {
  padding: 3rem 1rem;
}

/* Headshot */
.about-entity .about-image {
  border-radius: 50%;
  border: 3px solid rgba(13, 124, 95, 0.25);
  box-shadow: 0 0 30px rgba(13, 124, 95, 0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  animation: fadeInUp 0.7s ease-out 0.1s both;
}

.about-entity .about-image:hover {
  transform: scale(1.04);
  box-shadow: 0 0 50px rgba(13, 124, 95, 0.12);
}

/* Name */
.quarto-about-jolla .about-entity .about-heading {
  color: var(--text);
  font-size: clamp(2rem, 5vw, 2.8rem);
  animation: fadeInUp 0.6s ease-out 0.25s both;
  -webkit-text-fill-color: var(--text);
}

/* Subtitle badge */
.typing-subtitle {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  display: inline-block;
  background: rgba(13, 124, 95, 0.06);
  border: 1px solid rgba(13, 124, 95, 0.15);
  padding: 0.35rem 1rem;
  border-radius: 20px;
  margin: 0 auto 1.5rem;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

/* Social buttons */
.about-entity .about-link {
  background: var(--bg) !important;
  color: var(--text) !important;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 1.3rem;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
  text-decoration: none;
  opacity: 0;
  animation: fadeInUp 0.5s ease-out both;
}

.about-entity .about-links a:nth-child(1) { animation-delay: 0.55s; }
.about-entity .about-links a:nth-child(2) { animation-delay: 0.65s; }

.about-entity .about-link:hover {
  border-color: var(--accent);
  background: rgba(13, 124, 95, 0.04) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Bio */
.quarto-about-jolla .about-contents p {
  color: var(--text-dim);
  line-height: 1.75;
}

.quarto-about-jolla .about-contents blockquote {
  border-left: 3px solid var(--accent) !important;
  background: rgba(13, 124, 95, 0.03);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
}

.quarto-about-jolla .about-contents blockquote p {
  color: var(--text-dim);
}

/* ── Page Content ── */
#quarto-content { background: var(--bg) !important; }
main.content { color: var(--text); }

/* Blog post pages get a warm tan background */
.quarto-title-block ~ #quarto-content,
body:has(.quarto-title-meta) #quarto-content {
  background: var(--bg-tan) !important;
}
body:has(.quarto-title-meta) {
  background: var(--bg-tan) !important;
}

.quarto-title > h1,
.quarto-title .title {
  font-size: clamp(2rem, 5vw, 2.8rem);
  color: var(--text) !important;
  letter-spacing: -0.03em;
}

.quarto-title-block .quarto-title-banner {
  background: var(--bg-tan) !important;
  border-bottom: 1px solid var(--border);
}

.quarto-title-block .quarto-title-banner h1,
.quarto-title-block .quarto-title-banner .title {
  color: var(--text) !important;
}

/* ── Blog Listing ── */
.quarto-listing { margin-top: 1.5rem; }

/* Salmon highlight for new paper posts (temp review marker) */
div.quarto-post:has(a[href*="chain-of-thought-prompting"]),
div.quarto-post:has(a[href*="plan-and-solve-prompting"]),
div.quarto-post:has(a[href*="benchmarking-llm-agents"]),
div.quarto-post:has(a[href*="react-reasoning-acting"]),
div.quarto-post:has(a[href*="computer-age-statistical-inference"]),
div.quarto-post:has(a[href*="non-manipulable-causes"]),
div.quarto-post:has(a[href*="hypothesis-generation-llms"]),
div.quarto-post:has(a[href*="explainability-agentic-ai"]),
div.quarto-post:has(a[href*="star-agents-data-optimization"]),
div.quarto-post:has(a[href*="agentic-ai-alzheimers"]),
div.quarto-post:has(a[href*="perturbed-dml"]),
div.quarto-post:has(a[href*="kernel-debiased-estimation"]),
div.quarto-post:has(a[href*="intro-dml"]) {
  background: #FA8072 !important;
}

div.quarto-post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

div.quarto-post:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

div.quarto-post .listing-title { font-weight: 700; color: var(--text); }
div.quarto-post .listing-title a { color: var(--text); text-decoration: none; }
div.quarto-post .listing-title a:hover { color: var(--accent); }
div.quarto-post .listing-description { color: var(--text-dim); }

div.quarto-post .listing-categories .listing-category {
  background: rgba(13, 124, 95, 0.06);
  color: var(--accent);
  border: 1px solid rgba(13, 124, 95, 0.15);
  border-radius: 6px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ── Project Cards ── */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.project-card h3 { font-size: 1.3rem; margin-bottom: 0.6rem; }
.project-card p { color: var(--text-dim); line-height: 1.65; font-size: 0.95rem; }

.project-card .tech-tag {
  display: inline-block;
  background: rgba(109, 90, 205, 0.07);
  color: var(--purple);
  border: 1px solid rgba(109, 90, 205, 0.15);
  border-radius: 6px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  margin-right: 0.4rem;
  margin-bottom: 0.4rem;
}

.project-card .btn-project {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1.3rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.2s;
  margin-top: 1rem;
}

.project-card .btn-project:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 124, 95, 0.15);
  color: #fff;
}

/* ── Section Headers ── */
.projects-header { text-align: center; margin-bottom: 2.5rem; }
.projects-header h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 0.5rem;
}
.projects-header p { color: var(--text-dim); max-width: 500px; margin: 0 auto; }
.projects-header .accent-line {
  width: 50px; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: 2px;
  margin: 0.8rem auto;
}

/* ── Code Blocks ── */
pre.sourceCode {
  background: #f7f4ef !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

pre.sourceCode code {
  font-size: 0.85rem;
  color: var(--text) !important;
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: rgba(109, 90, 205, 0.07);
  color: var(--purple);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── Tables ── */
.table, table {
  color: var(--text) !important;
}
.table th, table th {
  color: var(--text) !important;
  border-bottom-color: var(--border) !important;
}
.table td, table td {
  color: var(--text-dim) !important;
  border-bottom-color: var(--border) !important;
}

/* ── Table of Contents ── */
nav#TOC a {
  color: var(--text-muted);
  border-left: 2px solid transparent;
  transition: all 0.2s;
}

nav#TOC a:hover,
nav#TOC a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

/* ── Footer ── */
.nav-footer {
  background: var(--bg) !important;
  border-top: 1px solid var(--border) !important;
  color: var(--text-muted);
}

.nav-footer a { color: var(--text-muted) !important; transition: color 0.2s; }
.nav-footer a:hover { color: var(--text) !important; }

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .animate-in { opacity: 1; transform: none; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .project-card { padding: 1.5rem; }
  .quarto-about-jolla::before { width: 400px; height: 350px; }
  .typing-subtitle { font-size: 0.85rem; }
}
