:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-alt: #eef4fb;
  --text: #172033;
  --muted: #5d6b82;
  --line: #d9e2ee;
  --blue: #1664c0;
  --blue-dark: #0f3f7d;
  --ink: #0c1322;
  --shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.75;
}

a {
  color: inherit;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.narrow {
  width: min(820px, calc(100% - 32px));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
}

.site-logo {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.94rem;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--blue);
}

.hero {
  padding: 72px 0 48px;
  background: linear-gradient(180deg, #ffffff 0%, #f2f6fb 100%);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 48px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: 0;
}

.hero h1,
.page-title h1,
.article-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.6rem);
  line-height: 1.16;
}

.subtitle {
  margin: 18px 0 0;
  color: var(--blue-dark);
  font-size: clamp(1.08rem, 2.2vw, 1.45rem);
  font-weight: 700;
}

.lead {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
}

.button.primary {
  color: #ffffff;
  background: var(--blue);
}

.button.secondary {
  color: var(--blue-dark);
  background: #ffffff;
  border: 1px solid var(--line);
}

.hero-panel {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.hero-panel p {
  margin: 0;
  color: var(--muted);
}

.section,
.page-title,
.article-hero {
  padding: 56px 0;
}

.tinted {
  background: var(--surface-alt);
  border-block: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2,
.page-title h1 {
  margin: 0;
}

.section-heading h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.page-title {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.page-title p:last-child {
  max-width: 720px;
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card-grid.slim {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.05);
}

.card-link,
.compact-card a {
  display: block;
  height: 100%;
  padding: 22px;
  text-decoration: none;
}

.card h2 {
  margin: 10px 0;
  font-size: 1.18rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-meta,
.article-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.card-meta span,
.article-facts span {
  padding: 3px 8px;
  background: #f3f6fa;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag-row span,
.tag-row a,
.info-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  color: var(--blue-dark);
  background: #edf5ff;
  border: 1px solid #cfe2f8;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.compact-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.compact-card p {
  margin-top: 8px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-cloud a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
}

.tag-cloud span {
  color: var(--blue);
  font-weight: 800;
}

.stack {
  display: grid;
  gap: 24px;
}

.listing-block {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.listing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.listing-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.listing-header span,
.muted {
  color: var(--muted);
}

.idea-list {
  display: grid;
  gap: 14px;
}

.idea-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.idea-card h2,
.idea-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.idea-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.idea-card a {
  color: var(--blue-dark);
  font-weight: 700;
}

.article-hero {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.article-facts {
  margin-top: 22px;
}

.article-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 780px);
  gap: 40px;
  align-items: start;
  padding-top: 42px;
  padding-bottom: 64px;
}

.toc {
  position: sticky;
  top: 92px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.toc h2 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.toc a {
  display: block;
  padding: 7px 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

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

.article-content {
  min-width: 0;
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.article-content h2 {
  margin-top: 42px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 1.5rem;
}

.article-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.article-content h3 {
  margin-top: 30px;
  font-size: 1.18rem;
}

.article-content p,
.article-content li {
  color: #26344d;
}

.article-content a {
  color: var(--blue-dark);
  font-weight: 700;
}

.article-content ul {
  padding-left: 1.25em;
}

.article-extra {
  margin-top: 46px;
}

.embedded .idea-card {
  grid-template-columns: 1fr;
}

.site-footer {
  padding: 28px 0;
  color: var(--muted);
  background: var(--ink);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 0.9rem;
}

.footer-inner p {
  margin: 0;
}

@media (max-width: 900px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .site-nav {
    width: 100%;
    gap: 12px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .hero-grid,
  .article-shell {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }

  .card-grid,
  .card-grid.slim,
  .mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .idea-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .container,
  .narrow {
    width: min(100% - 24px, 1120px);
  }

  .hero,
  .section,
  .page-title,
  .article-hero {
    padding: 42px 0;
  }

  .hero h1,
  .page-title h1,
  .article-hero h1 {
    font-size: 2.2rem;
  }

  .card-grid,
  .card-grid.slim,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .article-content {
    padding: 22px;
  }

  .footer-inner {
    flex-direction: column;
  }
}
