/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1e293b; background: #fff; line-height: 1.6; font-size: 16px;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* === Layout === */
.container { max-width: 960px; margin: 0 auto; padding: 0 1.5rem; }
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page main { flex: 1; }

/* === Header / Nav === */
header {
  background: #fff; border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 0; position: sticky; top: 0; z-index: 100;
}
header .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
header .logo { display: flex; align-items: center; }
header .logo img { height: 96px; width: auto; }
nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
nav a { color: #475569; font-size: 0.9rem; font-weight: 500; }
nav a:hover, nav a.active { color: #2563eb; text-decoration: none; }
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.hamburger svg { width: 24px; height: 24px; color: #475569; }

/* === Hero === */
.hero {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
  padding: 3rem 0; text-align: center;
}
.hero h1 { font-size: 2.5rem; font-weight: 800; color: #0f172a; margin-bottom: 0.5rem; }
.hero h1 span { background: linear-gradient(90deg, #0f172a, #7FC9F9); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: 1.1rem; color: #475569; max-width: 600px; margin: 0 auto 0.75rem; }
.hero .tagline { font-size: 0.95rem; color: #64748b; font-style: italic; margin-bottom: 1.5rem; }
.demo-buttons { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.demo-buttons a {
  display: inline-block; padding: 0.6rem 1.25rem; border-radius: 0.5rem;
  background: #7FC9F9; color: #0f172a; font-weight: 600; font-size: 0.9rem;
  transition: background 0.2s;
}
.demo-buttons a:hover { background: #5bb8f5; text-decoration: none; }

/* === Spotlight / Featured Callout === */
.spotlight { padding: 1.5rem 0 0; }
.spotlight-box {
  background: #f0f9ff; border: 2px solid #7FC9F9; border-radius: 0.75rem;
  padding: 1.5rem 2rem; text-align: center;
}
.spotlight-box h2 { font-size: 1.25rem; font-weight: 700; color: #0f172a; margin-bottom: 0.35rem; }
.spotlight-box p { font-size: 0.95rem; color: #475569; margin-bottom: 1rem; }
.spotlight-links { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.spotlight-links a {
  display: inline-block; padding: 0.55rem 1.15rem; border-radius: 0.5rem;
  background: #7FC9F9; color: #0f172a; font-weight: 600; font-size: 0.9rem;
  transition: background 0.2s;
}
.spotlight-links a:hover { background: #5bb8f5; text-decoration: none; }

/* === Tabs === */
.tabs { border-bottom: 2px solid #e2e8f0; display: flex; gap: 0; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tabs a {
  padding: 0.65rem 1rem; color: #64748b; font-weight: 500; font-size: 0.9rem;
  border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.tabs a:hover { color: #2563eb; text-decoration: none; }
.tabs a.active { color: #2563eb; border-bottom-color: #2563eb; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* === Sections === */
section { padding: 2rem 0; }
section h2 { font-size: 1.5rem; font-weight: 700; color: #0f172a; margin-bottom: 1rem; }
section h3 { font-size: 1.15rem; font-weight: 600; color: #0f172a; margin-bottom: 0.75rem; }

/* === Cards Grid === */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.card {
  border: 1px solid #e2e8f0; border-radius: 0.5rem; overflow: hidden;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.card img { width: 100%; height: 160px; object-fit: cover; }
.card .card-body { padding: 1rem; }
.card .card-body h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.card .card-body p { font-size: 0.875rem; color: #64748b; margin-bottom: 0.5rem; }
.card .card-body a { font-size: 0.875rem; font-weight: 500; }

/* === Benefits List === */
.benefits { list-style: none; counter-reset: benefit; }
.benefits li {
  counter-increment: benefit; padding: 0.75rem 0; border-bottom: 1px solid #f1f5f9;
  padding-left: 2.5rem; position: relative; font-size: 0.95rem;
}
.benefits li::before {
  content: counter(benefit); position: absolute; left: 0; top: 0.75rem;
  background: #7FC9F9; color: #0f172a; width: 1.75rem; height: 1.75rem;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
}

/* === Testimonials === */
.testimonial {
  border-left: 3px solid #7FC9F9; padding: 1rem 1.25rem; margin-bottom: 1.25rem;
  background: #f8fafc; border-radius: 0 0.5rem 0.5rem 0;
}
.testimonial blockquote { font-size: 0.95rem; color: #334155; margin-bottom: 0.5rem; font-style: italic; }
.testimonial .attribution { font-size: 0.85rem; color: #64748b; }
.testimonial .attribution strong { color: #0f172a; font-style: normal; }
.testimonial .attribution a { font-size: 0.8rem; }

/* === FAQ === */
.faq details { border-bottom: 1px solid #e2e8f0; padding: 0.75rem 0; }
.faq summary { font-weight: 600; cursor: pointer; font-size: 0.95rem; color: #0f172a; }
.faq details p { margin-top: 0.5rem; font-size: 0.9rem; color: #475569; }

/* === Collapsible Sections (books, archive, all) === */
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '\25B6'; display: inline-block; margin-right: 0.5rem; font-size: 0.75rem; transition: transform 0.2s; }
details[open] > summary::before { transform: rotate(90deg); }
details > summary h2 { display: inline; }
details > summary p { margin: 0.25rem 0 0 1.25rem; }
details + details { margin-top: 2rem; }
details { border-bottom: 1px solid #e2e8f0; padding-bottom: 1rem; }

/* === Info Box === */
.info-box {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.5rem;
  padding: 1.5rem; margin-bottom: 1.25rem;
}
.info-box h3 { margin-bottom: 0.5rem; }
.info-box p, .info-box li { font-size: 0.9rem; color: #475569; }
.info-box ul { margin-top: 0.5rem; padding-left: 1.25rem; list-style: disc; }

/* === Contact === */
.contact-list { list-style: none; }
.contact-list li { padding: 0.4rem 0; font-size: 0.95rem; }
.contact-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

/* === Colleagues === */
.colleagues { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.colleague {
  border: 1px solid #e2e8f0; border-radius: 0.5rem; overflow: hidden;
  text-align: center; padding-bottom: 1rem;
}
.colleague img { width: 100%; height: 140px; object-fit: cover; }
.colleague h3 { margin: 0.75rem 0 0.25rem; font-size: 1rem; }
.colleague p { font-size: 0.85rem; color: #64748b; padding: 0 1rem; margin-bottom: 0.5rem; }

/* === Footer === */
footer {
  background: #f8fafc; border-top: 1px solid #e2e8f0; padding: 2rem 0;
  font-size: 0.85rem; color: #64748b; margin-top: 2rem;
}
footer .footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
footer h4 { color: #0f172a; font-size: 0.9rem; margin-bottom: 0.5rem; }
footer ul { list-style: none; }
footer ul li { padding: 0.2rem 0; }
footer .footer-bottom { border-top: 1px solid #e2e8f0; padding-top: 1rem; text-align: center; }

/* === Legal Pages === */
.legal h2 { font-size: 1.25rem; margin-top: 1.5rem; }
.legal p, .legal li { font-size: 0.9rem; color: #475569; margin-bottom: 0.5rem; }
.legal ul { padding-left: 1.25rem; list-style: disc; }

/* === Writings Tab Bar === */
.writings-tabs { border-bottom: 2px solid #e2e8f0; display: flex; flex-wrap: wrap; gap: 0; margin-top: 1rem; margin-bottom: 1.5rem; }
.writings-tabs a {
  padding: 0.6rem 1rem; color: #64748b; font-weight: 500; font-size: 0.9rem;
  border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.writings-tabs a:hover { color: #2563eb; text-decoration: none; }
.writings-tabs a.active { color: #2563eb; border-bottom-color: #2563eb; }
.writings-tabs .tab-count { font-size: 0.75rem; color: #94a3b8; margin-left: 0.25rem; }

/* === Post List (recent.html) === */
.post-list { display: flex; flex-direction: column; gap: 0; }
.post-summary {
  display: flex; gap: 1.25rem; padding: 1.25rem 0;
  border-bottom: 1px solid #e2e8f0; align-items: baseline;
}
.post-summary time {
  flex-shrink: 0; width: 6.5rem; font-size: 0.85rem; color: #64748b;
}
.post-summary h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
.post-summary h2 a { color: #0f172a; }
.post-summary h2 a:hover { color: #2563eb; }
.post-summary p { font-size: 0.9rem; color: #475569; margin-bottom: 0.25rem; }
.post-source { font-size: 0.8rem; color: #94a3b8; }

/* === Individual Post === */
.post { padding: 2rem 0; }
.post h1 { font-size: 2rem; font-weight: 800; color: #0f172a; margin-bottom: 1.25rem; line-height: 1.3; }
.post h2 { font-size: 1.25rem; font-weight: 700; color: #0f172a; margin: 1.75rem 0 0.5rem; }
.post h3 { font-size: 1.1rem; font-weight: 600; color: #0f172a; margin: 1.5rem 0 0.4rem; }
.post p { font-size: 1rem; color: #334155; margin-bottom: 1rem; line-height: 1.7; }
.post .fig-title { margin-top: 2rem; }
.post figure { margin: 0.5rem 0 1.5rem; }
.post figure img { margin: 0 auto; }
.post img {
  display: block; max-width: 100%; height: auto;
  margin: 1.5rem auto; border-radius: 0.25rem;
}
.post blockquote {
  border-left: 3px solid #7FC9F9; margin: 1.25rem 0; padding: 0.75rem 1.25rem;
  background: #f8fafc; border-radius: 0 0.5rem 0.5rem 0;
}
.post blockquote p { margin-bottom: 0.5rem; color: #334155; }
.post blockquote p:last-child { margin-bottom: 0; }
.post blockquote em { font-style: italic; }
.post ul, .post ol {
  margin: 1rem 0; padding-left: 1.75rem; color: #334155;
  font-size: 1rem; line-height: 1.7;
}
.post ul { list-style: disc; }
.post ol { list-style: decimal; }
.post li { margin-bottom: 0.4rem; }
.post pre {
  background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 0.5rem;
  padding: 1rem 1.25rem; margin: 1.25rem 0; overflow-x: auto;
}
.post pre code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem; line-height: 1.5; color: #1e293b;
}
.post a { color: #2563eb; }
.post a:hover { text-decoration: underline; }
.post-meta { font-size: 0.85rem; color: #64748b; margin-bottom: 0.5rem; }
.post-note {
  font-size: 0.9rem; color: #64748b; font-style: italic;
  border-top: 1px solid #e2e8f0; padding-top: 1rem; margin-top: 2rem;
}

/* === Responsive === */
@media (max-width: 768px) {
  .hamburger { display: block; }
  nav {
    display: none; flex-direction: column; width: 100%;
    gap: 0; border-top: 1px solid #e2e8f0; padding-top: 0.5rem; margin-top: 0.5rem;
  }
  nav.open { display: flex; }
  nav a { padding: 0.6rem 0; border-bottom: 1px solid #f1f5f9; font-size: 1rem; }
  nav a:last-child { border-bottom: none; }
  header .logo img { height: 64px; }
}
@media (max-width: 640px) {
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1rem; }
  .cards { grid-template-columns: 1fr; }
  .contact-columns { grid-template-columns: 1fr; }
  footer .footer-grid { grid-template-columns: 1fr; }
  .tabs { gap: 0; }
  .tabs a { padding: 0.5rem 0.65rem; font-size: 0.8rem; }
  .writings-tabs { gap: 0; }
  .writings-tabs a { padding: 0.4rem 0.5rem; font-size: 0.75rem; }
}
