:root {
  color-scheme: light;
  --white: #ffffff;
  --primary-50: #f9f5ff;
  --primary-100: #f4ebff;
  --primary-200: #e9d7fe;
  --primary-700: #6941c6;
  --primary-900: #42307d;
  --gray-300: #d0d5dd;
  --gray-500: #667085;
  --gray-900: #101828;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Arial, sans-serif;
  color: var(--gray-900);
  background: var(--white);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(20px, 4vw, 80px);
  border-bottom: 1px solid #f2f4f7;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-700);
  color: var(--white);
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  font-weight: 700;
}

.brand small {
  color: var(--gray-500);
  font-size: 12px;
  line-height: 18px;
}

.nav-links,
.account-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a,
.account-links a {
  color: var(--gray-500);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.nav-links a:hover,
.account-links a:hover {
  color: var(--primary-700);
}

.account-links {
  justify-self: end;
}

.register-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--primary-700);
  color: var(--white) !important;
  box-shadow: var(--shadow-xs);
}

main {
  min-width: 0;
}

.hero-section {
  position: relative;
  display: flex;
  min-height: 430px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding: 96px 32px 0;
  background: var(--primary-50);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(1024px, 100%);
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary-50);
  color: var(--primary-700);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  mix-blend-mode: multiply;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: -8px 0 0;
  color: var(--primary-900);
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -0.96px;
  line-height: 60px;
}

.hero-content p {
  width: min(760px, 100%);
  margin: -2px 0 16px;
  color: var(--primary-700);
  font-size: 20px;
  font-weight: 400;
  line-height: 30px;
}

.search-wrap {
  display: flex;
  width: min(320px, 100%);
  height: 48px;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow-xs);
}

.search-wrap img {
  width: 20px;
  height: 20px;
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--gray-900);
  font-size: 16px;
  line-height: 24px;
}

.search-wrap input::placeholder {
  color: var(--gray-500);
}

.background-pattern {
  position: absolute;
  right: -32%;
  bottom: -260px;
  left: -32%;
  width: 164%;
  height: 404px;
  max-width: none;
  pointer-events: none;
}

.blog-section {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 64px 32px 96px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-heading span {
  color: var(--gray-500);
  font-size: 14px;
  line-height: 20px;
}

.section-heading h2 {
  margin: 4px 0 0;
  color: var(--gray-900);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.32px;
  line-height: 40px;
}

.topic-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 32px;
}

.topic-strip button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--primary-200);
  border-radius: 999px;
  background: var(--white);
  color: var(--primary-700);
  font-size: 14px;
  font-weight: 600;
}

.topic-strip button.active {
  background: var(--primary-100);
}

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

.post-card {
  display: flex;
  min-width: 0;
  min-height: 580px;
  flex-direction: column;
  gap: 32px;
  padding: 24px 24px 32px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.post-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.post-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.post-topic {
  display: block;
  margin-bottom: 12px;
  color: var(--primary-700);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.post-title-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.post-title-row h3 {
  flex: 1;
  margin-bottom: 12px;
  color: var(--gray-900);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 32px;
}

.post-title-row img {
  width: 24px;
  height: 24px;
  margin-top: 4px;
  flex: 0 0 auto;
}

.post-card p {
  margin-bottom: 0;
  color: var(--gray-500);
  font-size: 16px;
  line-height: 24px;
}

.author-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-row img {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
}

.author-row strong,
.author-row span {
  display: block;
  white-space: nowrap;
  font-size: 14px;
  line-height: 20px;
}

.author-row strong {
  color: var(--gray-900);
  font-weight: 500;
}

.author-row span {
  color: var(--gray-500);
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 220px;
  padding: 48px;
  border: 1px dashed var(--primary-200);
  color: var(--gray-500);
  font-size: 16px;
  line-height: 24px;
  text-align: center;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding-top: 64px;
}

.load-more-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--primary-50);
  border-radius: 8px;
  background: var(--primary-50);
  color: var(--primary-700);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  box-shadow: var(--shadow-xs);
}

.load-more-button img {
  width: 20px;
  height: 20px;
}

.load-more-button[hidden] {
  display: none;
}

.editorial-section {
  display: grid;
  width: min(1216px, calc(100% - 64px));
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin: 0 auto 96px;
  padding: 56px;
  background: var(--primary-50);
}

.editorial-section h2 {
  margin: 16px 0 0;
  color: var(--primary-900);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.48px;
  line-height: 44px;
}

.editorial-section p {
  margin: 44px 0 0;
  color: var(--primary-700);
  font-size: 18px;
  line-height: 30px;
}

@media (max-width: 1060px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editorial-section {
    grid-template-columns: 1fr;
  }

  .editorial-section p {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
  }

  .nav-links,
  .account-links {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .account-links {
    justify-self: stretch;
  }

  .register-link {
    flex: 1;
  }

  .hero-section {
    min-height: 390px;
    padding: 64px 20px 0;
  }

  h1 {
    font-size: 40px;
    letter-spacing: -0.8px;
    line-height: 48px;
  }

  .hero-content p {
    font-size: 18px;
    line-height: 28px;
  }

  .background-pattern {
    right: -72%;
    bottom: -220px;
    left: -72%;
    width: 244%;
  }

  .blog-section {
    padding: 48px 20px 72px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .post-card {
    min-height: auto;
  }

  .post-title-row h3 {
    font-size: 22px;
    line-height: 30px;
  }

  .editorial-section {
    width: calc(100% - 40px);
    margin-bottom: 64px;
    padding: 32px 24px;
  }

  .editorial-section h2 {
    font-size: 30px;
    line-height: 38px;
  }
}
