@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: #ffffff;
  color: #000000;
  line-height: 1.6;
}

::selection { background: #000000; color: #ffffff; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s;
}

/* Classic in-content hyperlink (blue + underline) */
a.link-blue {
  color: #0000ee;
  text-decoration: underline;
}
a.link-blue:visited {
  color: #551a8b;
}
a.link-blue:hover {
  color: #0000cc;
}

img { max-width: 100%; display: block; }

code {
  font-family: 'JetBrains Mono', monospace;
}

/* Page Layout */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navigation */
.nav {
  border-bottom: 1px solid #e5e5e5;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.nav-logo {
  width: 2rem;
  height: 2rem;
  background: #000000;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.875rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-weight: 500;
  color: #525252;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: #000000;
}

/* Main Content */
.content {
  flex: 1;
}

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-lg {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Sections */
.section {
  padding: 5rem 1rem;
}

.section-gray {
  background: #fafafa;
}

.section-dark {
  background: #000000;
  color: #ffffff;
}

/* Typography */
.title {
  font-size: 3.75rem;
  font-weight: 700;
  color: #000000;
  margin-bottom: 1.5rem;
  line-height: 1;
}

.title-lg {
  font-size: 2.25rem;
  font-weight: 700;
  color: #000000;
  margin-bottom: 1rem;
}

.title-md {
  font-size: 1.875rem;
  font-weight: 700;
  color: #000000;
  margin-bottom: 1rem;
}

.title-sm {
  font-size: 1.5rem;
  font-weight: 600;
  color: #000000;
  margin-bottom: 0.5rem;
}

.subtitle {
  display: block;
  color: #525252;
  font-weight: 300;
}

.lead {
  font-size: 1.25rem;
  color: #525252;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.text-gray {
  color: #525252;
}

.text-center {
  text-align: center;
}

/* Grid */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(1, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Cards */
.card {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 2px;
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.card-link:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card-read-more {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #000000;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-top: 0.5rem;
}

.card-icon {
  width: 3rem;
  height: 3rem;
  background: #000000;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.card-icon span {
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #000000;
  margin-bottom: 0.5rem;
}

.card-text {
  color: #525252;
  font-size: 0.875rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 2px;
  font-weight: 500;
  transition: all 0.2s;
  text-align: center;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: #000000;
  color: #ffffff;
}

.btn-primary:hover {
  background: #262626;
}

.btn-secondary {
  background: transparent;
  color: #000000;
  border: 1px solid #000000;
}

.btn-secondary:hover {
  background: #fafafa;
}

.btn-disabled {
  background: #f5f5f5;
  color: #a3a3a3;
  cursor: not-allowed;
}

.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Home hero — Gemma article promo */
.hero-gemma-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  background: #b91c1c;
  color: #ffffff;
  border: 2px solid #991b1b;
  border-radius: 4px;
  text-decoration: none;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.hero-gemma-link:hover {
  background: #991b1b;
  border-color: #7f1d1d;
  color: #ffffff;
  text-decoration: none;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-active {
  background: #dcfce7;
  color: #166534;
}

.badge-gray {
  background: #f5f5f5;
  color: #525252;
}

.badge-dark {
  background: #000000;
  color: #ffffff;
}

/* Tags */
.tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: #f5f5f5;
  color: #404040;
  font-size: 0.75rem;
  border-radius: 2px;
}

.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Footer */
.footer {
  border-top: 1px solid #e5e5e5;
  background: #fafafa;
  padding: 3rem 1rem;
}

.footer-inner {
  max-width: 72rem;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer h3 {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.875rem;
  color: #000000;
  margin-bottom: 1rem;
}

.footer h4 {
  font-weight: 500;
  color: #000000;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.footer p {
  color: #525252;
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-tagline {
  color: #000000 !important;
  font-size: 0.8rem !important;
  font-weight: 400;
  line-height: 2 !important;
}

.footer-principles {
  color: #525252;
  font-size: 0.8rem;
  line-height: 1.8;
}

.footer-links-curated {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer li {
  margin-bottom: 0.15rem;
  color: #525252 !important;
  font-size: 0.875rem;
}

.footer a {
  color: #525252;
  font-size: 0.875rem;
}

.footer a:hover {
  color: #000000;
}

.footer-bottom {
  border-top: 1px solid #e5e5e5;
  padding-top: 2rem;
  text-align: center;
}

.footer-bottom p {
  color: #737373;
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

/* Utilities */
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.max-w-2xl {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.max-w-3xl {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.max-w-4xl {
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* List Styles */
.bullet-list {
  list-style: none;
  padding: 0;
}

.bullet-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: #525252;
}

.bullet-list li::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  background: #000000;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.5rem;
}

/* Border Accent */
.border-accent {
  border-left: 4px solid #000000;
  padding-left: 1.5rem;
}

/* Featured Post */
.featured-post {
  display: grid;
  grid-template-columns: 1fr;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 2px;
  overflow: hidden;
}

@media (min-width: 768px) {
  .featured-post {
    grid-template-columns: 1fr 1fr;
  }
}

.featured-post-image {
  background: #f5f5f5;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-center;
  font-size: 4rem;
}

.featured-post-content {
  padding: 2rem;
}

/* Form */
.form-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #d4d4d4;
  border-radius: 2px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
}

.form-input:focus {
  outline: none;
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .title {
    font-size: 2.5rem;
  }
  
  .section {
    padding: 3rem 1rem;
  }
  
  .btn-group {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-group .btn {
    width: 100%;
  }
}

@media (min-width: 640px) {
  .nav-inner,
  .container,
  .footer-inner {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .nav-inner,
  .container,
  .footer-inner {
    padding: 0 2rem;
  }
}

/* SVG Icons */
.icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.5rem;
  display: inline-block;
  vertical-align: middle;
}

/* Print Styles */
@media print {
  .nav, .footer {
    display: none;
  }
}

/* Article / Paper Styles */
.article-wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem 1rem 5rem;
}

.article-back {
  display: inline-flex;
  align-items: center;
  color: #525252;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.article-back:hover { color: #000000; }

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.article-title {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.25;
  color: #000000;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e5e5e5;
}

.article-body { line-height: 1.8; }

.article-body p {
  color: #262626;
  margin-bottom: 1.25rem;
}

.article-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #000000;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #000000;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.article-body ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem 0;
}

.article-body ul li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: #404040;
  margin-bottom: 0.4rem;
}

.article-body ul li::before {
  content: '';
  width: 0.3rem;
  height: 0.3rem;
  background: #000000;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.7rem;
}

.article-body hr {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 2rem 0;
}

.article-body a:not(.btn) {
  color: #000000;
  text-decoration: underline;
  text-decoration-color: #d4d4d4;
  text-underline-offset: 2px;
}

.article-body a:not(.btn):hover { text-decoration-color: #000000; }

.article-foot {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e5e5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Syndication / reprint download bundle (blog technical articles) */
.syndication-downloads {
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  background: #fafafa;
  border: 1px solid #e5e5e5;
}

.syndication-downloads h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #000000;
  margin: 0 0 0.5rem 0;
}

.syndication-downloads > p {
  font-size: 0.875rem;
  color: #525252;
  margin: 0 0 1rem 0;
  line-height: 1.5;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.5rem;
}

.download-grid a {
  display: block;
  padding: 0.65rem 0.9rem;
  border: 1px solid #e5e5e5;
  background: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #000000;
  text-decoration: none;
  text-align: center;
}

.download-grid a:hover {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

/* Pandoc HTML embedded in blog (Gemma long-form) */
.gemma-article-import h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #000000;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #e5e5e5;
  line-height: 1.3;
}

.gemma-article-import table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

.gemma-article-import th,
.gemma-article-import td {
  border: 1px solid #e5e5e5;
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.gemma-article-import thead th {
  background: #fafafa;
  font-weight: 600;
}

.gemma-article-import tbody tr:nth-child(even) td {
  background: #fafafa;
}

.gemma-article-import pre {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.gemma-article-import code {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  font-size: 0.88em;
}

.gemma-article-import pre code {
  font-size: inherit;
}

.gemma-article-import p code,
.gemma-article-import li code,
.gemma-article-import td code {
  background: #f5f5f5;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.gemma-article-import blockquote {
  margin: 1.25rem 0;
  padding: 0.85rem 1.15rem;
  border-left: 3px solid #d4d4d4;
  background: #fafafa;
  font-style: italic;
  color: #404040;
}

.gemma-article-import blockquote p {
  margin-bottom: 0;
}

.gemma-article-import div.sourceCode {
  margin: 1rem 0;
}

.gemma-article-import div.sourceCode pre {
  margin: 0;
}

/* Contact page — Google Form embed */
.contact-form-embed {
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

.contact-form-embed iframe {
  display: block;
  width: 100%;
  max-width: 550px;
  height: 900px;
  border: 0;
}
