:root {
  --bg-page: #fafaf7;
  --bg-surface: #ffffff;
  --bg-muted: #f0f1f3;
  --bg-tint: #f0f4fb;
  --text-primary: #1a1a1c;
  --text-secondary: #5a5a55;
  --text-muted: #888780;
  --border-soft: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.1);
  --accent: #2F7FE8;
  --accent-tint: rgba(47, 127, 232, 0.18);
  --accent-text: #ffffff;
  --shadow-soft: rgba(0, 0, 0, 0.04);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 1100px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

[data-theme="dark"] {
  --bg-page: #0d0d0f;
  --bg-surface: #16161a;
  --bg-muted: #2a2a30;
  --bg-tint: #16161a;
  --text-primary: #f5f5f3;
  --text-secondary: #c8c6c0;
  --text-muted: #888780;
  --border-soft: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.1);
  --accent: #2F7FE8;
  --accent-tint: rgba(47, 127, 232, 0.22);
  --accent-text: #ffffff;
  --shadow-soft: rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; background: var(--bg-page); color: var(--text-primary); font-family: var(--font-sans); font-size: 16px; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.site-header { background: var(--bg-surface); border-bottom: 0.5px solid var(--border-soft); position: sticky; top: 0; z-index: 10; }
.site-header-inner { max-width: var(--max-width); margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.wordmark { font-size: 20px; font-weight: 500; letter-spacing: -0.5px; color: var(--text-primary); }
.wordmark:hover { text-decoration: none; }
.wordmark-bonjour { color: var(--text-primary); }
.wordmark-builder { color: var(--accent); }
.site-nav { display: flex; gap: 22px; }
.site-nav a { color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.site-nav a:hover { color: var(--text-primary); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle { background: transparent; border: 0.5px solid var(--border-medium); color: var(--text-secondary); font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: 18px; cursor: pointer; font-family: inherit; }
.theme-toggle:hover { color: var(--text-primary); border-color: var(--text-muted); }
.btn { display: inline-block; font-size: 13px; font-weight: 500; padding: 7px 16px; border-radius: 18px; border: 0; cursor: pointer; font-family: inherit; }
.btn:hover { text-decoration: none; opacity: 0.92; }
.btn-primary { background: var(--accent); color: var(--accent-text); }

main { max-width: var(--max-width); margin: 0 auto; padding: 32px 24px 64px; }

.section-label { font-size: 12px; font-weight: 500; color: var(--accent); letter-spacing: 1.4px; text-transform: uppercase; margin: 0 0 14px; }

.hero-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 40px; }
.hero-featured, .hero-latest { background: var(--bg-surface); border: 0.5px solid var(--border-medium); border-radius: var(--radius-lg); padding: 20px; }
.hero-card { background: var(--bg-tint); border: 0.5px solid var(--accent-tint); border-radius: var(--radius-md); padding: 32px 24px; text-align: center; }
.hero-wordmark { font-size: 26px; font-weight: 500; letter-spacing: -0.5px; margin: 0 0 10px; }
.hero-tagline { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin: 0 0 18px; }

.signup-form { display: flex; flex-wrap: wrap; gap: 6px; max-width: 320px; margin: 0 auto; }
.signup-form input[type="email"] { flex: 1; background: var(--bg-surface); border: 0.5px solid var(--border-medium); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; color: var(--text-primary); font-family: inherit; }
.signup-form input[type="email"]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.signup-form button { background: var(--accent); color: var(--accent-text); font-size: 13px; font-weight: 500; padding: 9px 16px; border-radius: var(--radius-sm); border: 0; cursor: pointer; font-family: inherit; }

.latest-item { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 0.5px solid var(--border-soft); }
.latest-item:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.latest-meta { font-size: 12px; color: var(--text-muted); margin: 0 0 4px; }
.latest-title { display: block; font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--text-primary); margin-bottom: 6px; }
.latest-title:hover { color: var(--accent); text-decoration: none; }

.pill { display: inline-block; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 12px; letter-spacing: 0.2px; }

.trending { margin-bottom: 48px; }
.trending-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card { background: var(--bg-surface); border: 0.5px solid var(--border-medium); border-radius: var(--radius-md); overflow: hidden; transition: transform 0.15s ease; }
.card:hover { transform: translateY(-2px); }
.card-image { background: var(--bg-muted); height: 110px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-muted); letter-spacing: 1.2px; font-weight: 500; }
.card-body { padding: 14px; }
.card-title { display: block; font-size: 15px; font-weight: 500; line-height: 1.35; color: var(--text-primary); margin-bottom: 8px; }
.card-title:hover { color: var(--accent); text-decoration: none; }
.card-excerpt { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin: 0 0 10px; }

.cta-band { background: var(--accent); color: var(--accent-text); padding: 32px 24px; text-align: center; border-radius: var(--radius-lg); margin-bottom: 48px; }
.cta-inner h2 { font-size: 22px; font-weight: 500; margin: 0 0 6px; letter-spacing: -0.3px; }
.cta-inner p { font-size: 14px; opacity: 0.92; margin: 0 0 18px; }
.signup-form-cta { max-width: 380px; }
.signup-form-cta input[type="email"] { background: var(--bg-surface); border: 0; color: var(--text-primary); }
.signup-form-cta button { background: var(--text-primary); color: var(--bg-surface); }

.post { max-width: 720px; margin: 0 auto; }
.post-header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 0.5px solid var(--border-soft); }
.post-meta { font-size: 13px; color: var(--text-muted); margin: 0 0 12px; }
.post-category { color: var(--accent); font-weight: 500; }
.post-title { font-size: 36px; font-weight: 500; line-height: 1.2; letter-spacing: -0.6px; margin: 0 0 16px; color: var(--text-primary); }
.post-excerpt { font-size: 18px; color: var(--text-secondary); line-height: 1.5; margin: 0; }
.post-body { font-size: 17px; line-height: 1.75; color: var(--text-primary); }
.post-body p { margin: 0 0 20px; }
.post-body h2 { font-size: 24px; font-weight: 500; margin: 36px 0 16px; letter-spacing: -0.3px; }
.post-body h3 { font-size: 19px; font-weight: 500; margin: 30px 0 12px; }
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-body code { background: var(--bg-muted); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; font-family: "SF Mono", Menlo, Consolas, monospace; }
.post-body pre { background: var(--bg-muted); padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 14px; }
.post-body pre code { background: transparent; padding: 0; }
.post-body blockquote { border-left: 3px solid var(--accent); padding-left: 16px; color: var(--text-secondary); margin: 24px 0; }

.site-footer { background: var(--bg-surface); border-top: 0.5px solid var(--border-soft); margin-top: 64px; }
.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 40px 24px 24px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 32px; }
.footer-heading { font-size: 12px; font-weight: 500; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin: 0 0 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { font-size: 13px; color: var(--text-secondary); line-height: 2; }
.footer-col a { color: var(--text-secondary); }
.footer-col a:hover { color: var(--text-primary); text-decoration: none; }
.footer-bottom { max-width: var(--max-width); margin: 0 auto; padding: 16px 24px 32px; border-top: 0.5px solid var(--border-soft); }
.footer-bottom p { font-size: 12px; color: var(--text-muted); margin: 0; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .trending-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .site-header-inner { flex-wrap: wrap; gap: 12px; }
  .site-nav { order: 3; width: 100%; justify-content: flex-start; }
  .post-title { font-size: 28px; }
  .post-body { font-size: 16px; }
  main { padding: 24px 16px 48px; }
}

.form-status { flex-basis: 100%; margin: 6px 0 0; font-size: 12px; line-height: 1.4; min-height: 1em; text-align: center; color: var(--text-secondary); }
.form-status.is-success { color: var(--accent); }
.form-status.is-error { color: #c0392b; }
.signup-form-cta .form-status { color: var(--accent-text); opacity: 0.92; }
.signup-form-cta .form-status.is-success { color: var(--accent-text); }
.signup-form-cta .form-status.is-error { color: #ffd6cf; }
