:root {
  --color-primary: #238878;
  --color-primary-dark: #1a6b5e;
  --color-primary-light: #34b89a;
  --color-primary-subtle: #e6f2f0;
  --color-bg: #f8f8f6;
  --color-surface: #ffffff;
  --color-text: #1f2937;
  --color-text-secondary: #6b7280;
  --color-text-tertiary: #9ca3af;
  --color-border: #e5e5e0;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --max-width: 1120px;
  --radius: 16px;
  --radius-sm: 12px;
  --gradient-primary: linear-gradient(135deg, #1a6b5e, #34b89a);
  --shadow-accent: 0 4px 14px rgba(35, 136, 120, 0.25);
  --shadow-accent-lg: 0 8px 24px rgba(35, 136, 120, 0.18);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-dark);
}

main {
  min-height: calc(100vh - 64px);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid rgba(35, 136, 120, 0.18);
  border-radius: 999px;
  background: rgba(35, 136, 120, 0.08);
  color: var(--color-primary-dark);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.section-label::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(248, 248, 246, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  color: var(--color-primary);
}

.nav-brand img {
  width: 36px;
  height: 36px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--color-text-secondary);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: var(--gradient-primary);
  color: #fff !important;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    filter 0.2s;
}

.nav-cta:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
  filter: brightness(1.08);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--color-text);
}

.mobile-toggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--color-text);
}

.mobile-toggle svg line {
  stroke: currentColor;
}

.page-shell {
  position: relative;
  overflow: hidden;
  padding-top: 112px;
}

.page-shell::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -220px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(35, 136, 120, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.blog-hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-bottom: 36px;
}

.blog-hero h1 {
  font-size: 48px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 18px 0 14px;
}

.blog-hero p {
  max-width: 680px;
  margin: 0 auto;
  font-size: 18px;
  color: var(--color-text-secondary);
}

.blog-listing {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding-bottom: 48px;
}

.post-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 30px 32px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent-lg);
  border-color: rgba(35, 136, 120, 0.2);
}

.post-card-tag {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--color-primary-subtle);
  color: var(--color-primary-dark);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.post-card-title {
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.post-card-title a {
  color: var(--color-text);
}

.post-card-title a:hover {
  color: var(--color-primary);
}

.post-card-meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--color-text-tertiary);
  font-size: 14px;
}

.post-card-meta span + span::before,
.article-meta span + span::before {
  content: '•';
  margin-right: 10px;
}

.post-card-excerpt {
  margin-top: 14px;
  color: var(--color-text-secondary);
  font-size: 18px;
}

.post-card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-weight: 600;
}

.post-card-link::after {
  content: '→';
  transition: transform 0.2s ease;
}

.post-card:hover .post-card-link::after {
  transform: translateX(4px);
}

.post-card-note {
  margin: -4px auto 0;
  color: var(--color-text-secondary);
  font-size: 15px;
  text-align: center;
}

.article-shell {
  position: relative;
  overflow: hidden;
  padding-top: 104px;
}

.article-shell::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 260px;
  background: linear-gradient(180deg, rgba(35, 136, 120, 0.08), rgba(35, 136, 120, 0));
  pointer-events: none;
}

.article {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.article-header {
  margin: 0 auto 36px;
}

.article-header h1 {
  margin: 18px 0 16px;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.article-header p {
  font-size: 20px;
  line-height: 1.65;
  color: var(--color-text-secondary);
}

.article-body {
  margin: 0 auto;
}

.article-body p,
.article-body ul,
.article-body ol {
  font-size: 18px;
  line-height: 1.8;
  margin-bottom: 22px;
}

.article-body ul,
.article-body ol {
  padding-left: 24px;
}

.article-body li + li {
  margin-top: 10px;
}

.article-body h2 {
  margin: 42px 0 16px;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.article-body h3 {
  margin: 30px 0 14px;
  font-size: 24px;
  line-height: 1.3;
}

.article-body blockquote {
  margin: 30px 0;
  padding: 18px 22px;
  border-left: 4px solid var(--color-primary);
  background: var(--color-primary-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-primary-dark);
  font-size: 18px;
  font-weight: 500;
}

.article-body strong {
  color: var(--color-text);
}

.article-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(35, 136, 120, 0.08);
  font-size: 0.95em;
}

.article-body hr {
  margin: 34px 0;
  border: none;
  border-top: 1px solid var(--color-border);
}

.article-callout {
  margin: 28px 0;
  padding: 20px 22px;
  background: #ffffff;
  border: 1px solid rgba(35, 136, 120, 0.18);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.article-callout h3 {
  margin-top: 0;
}

.waitlist-cta {
  max-width: var(--max-width);
  margin: 56px auto 0;
  padding: 0 24px;
}

.waitlist-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-accent-lg);
  text-align: center;
}

.waitlist-card h2 {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.waitlist-card p:not(.form-hint):not(.form-message) {
  max-width: 560px;
  margin: 0 auto 20px;
  color: var(--color-text-secondary);
  font-size: 17px;
}

.email-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  max-width: 460px;
  margin: 0 auto;
}

.email-form input[type='email'] {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  font: inherit;
  color: var(--color-text);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.email-form input[type='email']:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(35, 136, 120, 0.12);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border: none;
  border-radius: 14px;
  background: var(--gradient-primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
  filter: brightness(1.08);
}

.btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
  filter: none;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.form-hint {
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin-top: 8px;
  text-align: center;
}

.form-message {
  min-height: 24px;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 500;
}

.form-message.success {
  color: #059669;
}

.form-message.error {
  color: #dc2626;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 32px auto 0;
  padding: 0 24px;
  max-width: var(--max-width);
  color: var(--color-text-secondary);
  font-weight: 500;
}

.back-link::before {
  content: '←';
}

.back-link-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-footer {
  position: relative;
  margin-top: 80px;
  padding: 32px 0;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 999px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.footer-brand img {
  width: 24px;
  height: 24px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  color: var(--color-text-secondary);
  font-size: 14px;
}

.footer-links a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.footer-copy {
  color: var(--color-text-tertiary);
  font-size: 14px;
}

/* ── Key takeaway card ── */

.article-tldr {
  margin: 0 0 28px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(35, 136, 120, 0.07), rgba(35, 136, 120, 0.02));
  border: 1px solid rgba(35, 136, 120, 0.15);
  border-radius: var(--radius);
}

.article-tldr > strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary-dark);
}

.article-tldr p {
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text);
}

/* ── Table of contents ── */

.article-toc {
  margin: 0 0 40px;
  padding: 18px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.article-toc strong {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
}

.article-toc ol {
  padding-left: 20px;
  margin: 0;
}

.article-toc li {
  margin-bottom: 4px;
  font-size: 15px;
  line-height: 1.5;
}

.article-toc a {
  color: var(--color-text-secondary);
}

.article-toc a:hover {
  color: var(--color-primary);
}

/* ── Article tables ── */

.article-body table {
  width: 100%;
  margin: 28px 0;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.6;
}

.article-body thead {
  background: var(--color-primary-subtle);
}

.article-body th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--color-primary-dark);
  border-bottom: 2px solid rgba(35, 136, 120, 0.2);
}

.article-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.article-body tbody tr:last-child td {
  border-bottom: none;
}

.article-body tbody tr:hover {
  background: rgba(35, 136, 120, 0.03);
}

.article-body .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 28px 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.article-body .table-wrap table {
  margin: 0;
  min-width: 580px;
}

.article-body .table-note {
  margin-top: -20px;
  margin-bottom: 22px;
  font-size: 14px;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* ── Lead paragraph ── */

.article-body > p:first-child {
  font-size: 20px;
  line-height: 1.7;
}

/* ── Pull quote ── */

.article-body .pull-quote {
  margin: 40px auto;
  padding: 0 24px;
  border: none;
  background: none;
  text-align: center;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-primary-dark);
  letter-spacing: -0.01em;
  max-width: 720px;
}

/* ── Related posts ── */

.related-posts {
  max-width: var(--max-width);
  margin: 48px auto 0;
  padding: 0 24px;
}

.related-posts h2 {
  font-size: 20px;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.related-post-card {
  display: block;
  padding: 22px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  max-width: 520px;
}

.related-post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent-lg);
  border-color: rgba(35, 136, 120, 0.2);
  text-decoration: none;
}

.related-post-tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--color-primary-subtle);
  color: var(--color-primary-dark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.related-post-card h3 {
  font-size: 18px;
  line-height: 1.3;
  color: var(--color-text);
  margin: 0 0 6px;
}

.related-post-card p {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
  }

  .nav-links.open {
    display: flex;
  }

  .mobile-toggle {
    display: block;
  }

  .page-shell {
    padding-top: 92px;
  }

  .article-shell {
    padding-top: 88px;
  }

  .blog-hero h1,
  .article-header h1 {
    font-size: 34px;
  }

  .blog-hero p,
  .article-header p,
  .post-card-excerpt,
  .article-body p,
  .article-body ul,
  .article-body ol,
  .article-body blockquote {
    font-size: 16px;
  }

  .blog-listing {
    grid-template-columns: 1fr;
  }

  .post-card {
    padding: 24px 22px;
  }

  .post-card-title {
    font-size: 26px;
  }

  .article {
    padding: 0 16px;
  }

  .article-body h2 {
    font-size: 28px;
  }

  .article-body h3 {
    font-size: 22px;
  }

  .waitlist-cta {
    padding: 0 16px;
  }

  .waitlist-card {
    padding: 24px 18px;
  }

  .waitlist-card h2 {
    font-size: 26px;
  }

  .email-form {
    flex-direction: column;
  }

  .btn-primary {
    width: 100%;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }

  .article-body > p:first-child {
    font-size: 17px;
  }

  .article-body .pull-quote {
    font-size: 20px;
    padding: 0;
  }

  .related-posts {
    padding: 0 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .post-card:hover,
  .related-post-card:hover,
  .nav-cta:hover,
  .btn-primary:hover {
    transform: none;
  }
}
