:root {
  --bg: #f6f7fb;
  --bg-elevated: rgba(255, 255, 255, 0.84);
  --surface: #ffffff;
  --surface-2: #edf1f7;
  --text: #0f172a;
  --muted: #475569;
  --muted-2: #64748b;
  --line: rgba(15, 23, 42, 0.1);
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --accent: #7c3aed;
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  --radius: 22px;
  --radius-sm: 16px;
  --container: 1180px;
}

html[data-theme="dark"] {
  --bg: #07111f;
  --bg-elevated: rgba(13, 24, 40, 0.76);
  --surface: #0d1828;
  --surface-2: #14233a;
  --text: #e5eefb;
  --muted: #b3c3db;
  --muted-2: #8ca1bf;
  --line: rgba(203, 217, 237, 0.12);
  --primary: #6ea8fe;
  --primary-strong: #93c5fd;
  --accent: #a78bfa;
  --shadow: 0 22px 54px rgba(0, 0, 0, 0.35);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(124, 58, 237, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg) 82%, #ffffff 18%));
  line-height: 1.6;
}

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

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

svg {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin-inline: auto;
}

.narrow {
  width: min(calc(100% - 2rem), 820px);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 72%, transparent 28%);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: var(--shadow);
  font-weight: 700;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.1;
}

.brand-text span {
  color: var(--muted);
  font-size: 0.86rem;
}

.main-nav {
  margin-left: auto;
  display: flex;
  gap: 1.1rem;
  align-items: center;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--muted);
  font-size: 0.96rem;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-shell {
  position: relative;
  width: min(360px, 36vw);
  min-width: 220px;
}

.search-label {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  display: inline-flex;
}

.search-input {
  width: 100%;
  padding: 0.82rem 0.95rem 0.82rem 2.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.search-input::placeholder { color: var(--muted-2); }

.search-input:focus {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
}

.search-results {
  position: absolute;
  top: calc(100% + 0.6rem);
  inset-inline: 0;
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.search-results.is-visible { display: block; }

.search-hit,
.search-empty {
  display: block;
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--line);
}

.search-hit:first-child,
.search-empty:first-child { border-top: 0; }

.search-hit strong {
  display: block;
  margin-bottom: 0.18rem;
}

.search-hit span {
  display: block;
  color: var(--muted-2);
  font-size: 0.84rem;
}

.search-hit p,
.search-empty {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.search-hit:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }

.theme-toggle {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
}

.theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-moon { display: inline-flex; }

.hero,
.page-header,
.section {
  padding: 4.5rem 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 2rem;
  align-items: stretch;
}

.eyebrow,
.section-kicker {
  display: inline-block;
  padding: 0.36rem 0.72rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  margin-bottom: 1rem;
}

h1, h2, h3 {
  letter-spacing: -0.03em;
  line-height: 1.04;
  margin: 0 0 1rem;
}

h1 { font-size: clamp(2.7rem, 7vw, 5.1rem); max-width: 11ch; }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); }

.lead {
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  color: var(--muted);
  max-width: 62ch;
}

.hero-copy,
.page-copy {
  color: var(--muted);
  max-width: 65ch;
}

.hero-panel {
  display: grid;
  gap: 1rem;
}

.metric-card,
.card,
.single-card,
.taxonomy-card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, #fff 8%), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 1.2rem 1.25rem;
}

.metric-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.metric-card strong {
  font-size: 1.2rem;
}

.cta-row,
.tag-row,
.share-row {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.button-secondary {
  background: transparent;
  border-color: var(--line);
}

.button:hover,
.text-link:hover { transform: translateY(-1px); }

.section-muted {
  background: color-mix(in srgb, var(--surface-2) 44%, transparent);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.section-heading > p {
  max-width: 40ch;
  color: var(--muted);
  margin: 0;
}

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

.card-body,
.single-card {
  padding: 1.35rem;
}

.article-card h3 { margin-bottom: 0.6rem; }
.article-card p { color: var(--muted); margin-bottom: 0.9rem; }

.meta-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.meta-pill {
  display: inline-flex;
  gap: 0.42rem;
  align-items: center;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  color: var(--muted);
  font-size: 0.86rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--primary);
  font-weight: 600;
}

.inline-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
}

.single-card.prose h2,
.single-card.prose h3 { margin-top: 1.8rem; }

.single-card.prose p,
.single-card.prose li {
  color: var(--muted);
}

.single-card.prose ul,
.single-card.prose ol {
  padding-left: 1.2rem;
}

.taxonomy-block {
  margin-top: 1.2rem;
}

.taxonomy-block strong {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.taxonomy-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.3rem;
  align-items: center;
}

.taxonomy-card span {
  color: var(--muted);
}

.pagination {
  margin-top: 1.6rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  color: var(--muted);
}

.site-footer {
  padding-top: 4rem;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 1fr;
  gap: 1.5rem;
  padding-bottom: 2rem;
}

.footer-brand {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
}

.footer-list li + li { margin-top: 0.55rem; }

.footer-list a:hover,
.social-row a:hover { color: var(--text); }

.social-row {
  display: flex;
  gap: 0.7rem;
  margin-top: 1rem;
}

.social-row a {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
  padding: 1rem 0 2rem;
  font-size: 0.92rem;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.4rem;
}

.form-field {
  display: grid;
  gap: 0.45rem;
}

.form-field.full { grid-column: 1 / -1; }

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
}

.form-field textarea {
  min-height: 9rem;
  resize: vertical;
}

@media (max-width: 1040px) {
  .header-row {
    flex-wrap: wrap;
  }

  .main-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .hero-grid,
  .footer-grid,
  .card-grid,
  .taxonomy-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .hero,
  .page-header,
  .section {
    padding: 3.5rem 0;
  }

  h1 { max-width: 100%; }

  .search-shell {
    width: 100%;
    min-width: 0;
  }

  .header-actions {
    width: 100%;
  }

  .contact-form {
    grid-template-columns: 1fr;
  }
}
