:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #172033;
  --muted: #687386;
  --border: rgba(23, 32, 51, 0.12);
  --accent: #3953e6;
  --accent-dark: #1f27b7;
  --accent-soft: rgba(92, 57, 230, 0.1);
  --shadow: 0 14px 38px rgba(16, 24, 40, 0.10);
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(66, 57, 230, 0.722), transparent 30rem),
    radial-gradient(circle at top right, rgba(37, 50, 235, 0.277), transparent 28rem),
    var(--bg);
}

a {
  color: inherit;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  padding: clamp(30px, 6vw, 72px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

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

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.hero p:last-child {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.65;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 22px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
}

.toolbar div {
  color: var(--muted);
}

.toolbar strong {
  color: var(--text);
  font-size: 1.2rem;
}

input[type="search"] {
  width: min(360px, 100%);
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
}

input[type="search"]:focus {
  border-color: rgba(230, 57, 70, 0.45);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 18px;
}

.blog-card,
.error-card {
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.14);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.category,
.featured {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.category {
  color: var(--accent);
  background: var(--accent-soft);
}

.featured {
  color: #0f5132;
  background: rgba(25, 135, 84, 0.12);
}

.blog-card h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.blog-card p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: auto;
  padding-top: 22px;
  color: var(--muted);
  font-size: 0.88rem;
}

.read-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 18px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  padding: 11px 15px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.65);
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  input[type="search"] {
    width: 100%;
  }
}