:root {
  --brand-purple: #7c6bd8;
  --brand-purple-dark: #5d4bb8;
  --brand-yellow: #ffdf58;
  --brand-green: #4f8f7b;
  --ink: #21302f;
  --muted: #61716f;
  --line: #dfe8e4;
  --surface: #fff;
  --soft: #f8faf8;
}

html {
  font-size: 14px;
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html { font-size: 16px; }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(79, 143, 123, .25);
}

html {
  min-height: 100%;
  position: relative;
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 223, 88, .18), transparent 28rem),
    linear-gradient(180deg, #fbfcfb 0%, var(--soft) 44%, #fff 100%);
  color: var(--ink);
  margin-bottom: 60px;
  max-width: 100%;
  overflow-x: hidden;
}

.page-container { padding-top: 24px; }

.container,
.container-fluid,
main,
section,
article {
  max-width: 100%;
}

.public-header {
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid rgba(124, 107, 216, .16);
  box-shadow: 0 10px 30px rgba(33, 48, 47, .06);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.public-header .navbar {
  background: transparent;
  padding-bottom: 12px;
  padding-top: 12px;
}

.brand-lockup {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.brand-lockup img {
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(124, 107, 216, .22);
  height: 42px;
  object-fit: cover;
  width: 42px;
}

.brand-lockup span {
  color: var(--ink);
  font-size: 1.25rem;
  letter-spacing: 0;
}

.nav-search {
  display: flex;
  gap: 8px;
  max-width: 320px;
  width: 100%;
}

.page-hero {
  background: linear-gradient(135deg, rgba(124, 107, 216, .1), rgba(255, 223, 88, .14) 58%, #fff);
  border: 1px solid rgba(124, 107, 216, .14);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(33, 48, 47, .07);
  margin-bottom: 24px;
  padding: 32px;
}

.home-hero {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(124, 107, 216, .12), rgba(255, 223, 88, .2) 56%, rgba(79, 143, 123, .1)),
    #fff;
  border: 1px solid rgba(124, 107, 216, .14);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(33, 48, 47, .08);
  display: grid;
  min-height: 430px;
  margin-bottom: 34px;
  padding: 44px;
  overflow: hidden;
}

.home-hero-content {
  max-width: 820px;
}

.home-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1.08;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}

.home-hero p {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 680px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.home-section {
  margin-top: 42px;
}

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

.section-heading h2,
.category-panel h2 {
  font-size: 1.6rem;
  margin: 0;
}

.split-section {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 340px;
}

.stack-list {
  display: grid;
  gap: 12px;
}

.stack-item,
.category-panel {
  background: #fff;
  border: 1px solid #dfe8e4;
  border-radius: 8px;
  padding: 18px;
}

.stack-item span {
  color: #4f8f7b;
  font-size: .85rem;
  font-weight: 700;
}

.stack-item h3 {
  font-size: 1.1rem;
  margin: 6px 0;
}

.stack-item h3 a {
  color: #21302f;
  text-decoration: none;
}

.stack-item p {
  color: #61716f;
  margin: 0;
}

.category-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.category-cloud span {
  background: #edf5f1;
  border-radius: 999px;
  color: #61716f;
  padding: 6px 10px;
}

.page-hero h1,
.detail-header h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: 12px;
}

.page-hero p,
.detail-header p {
  color: #61716f;
  font-size: 1.05rem;
  max-width: 760px;
}

.eyebrow {
  color: var(--brand-purple-dark);
  display: inline-block;
  font-weight: 700;
  margin-bottom: 8px;
}

.resource-filter,
.resource-card,
.download-panel,
.content-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.resource-filter {
  margin-bottom: 24px;
  padding: 16px;
}

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

.resource-card {
  box-shadow: 0 12px 30px rgba(33, 48, 47, .05);
  display: flex;
  flex-direction: column;
  min-height: 260px;
  overflow: hidden;
}

.resource-card,
.stack-item,
.blog-result-card,
.category-panel {
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.resource-card:hover,
.stack-item:hover,
.blog-result-card:hover,
.category-panel:hover {
  border-color: rgba(124, 107, 216, .32);
  box-shadow: 0 16px 34px rgba(33, 48, 47, .08);
  transform: translateY(-2px);
}

.resource-card-image {
  aspect-ratio: 16 / 9;
  background: #edf5f1;
  display: block;
  overflow: hidden;
}

.resource-card-image img,
.detail-cover-image,
.blog-cover-image {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.resource-card-body { flex: 1; padding: 20px; }

.resource-card h2 {
  font-size: 1.25rem;
  line-height: 1.3;
}

.resource-card h2 a {
  color: #21302f;
  text-decoration: none;
}

.resource-card p { color: #61716f; }

.resource-meta,
.resource-tags,
.resource-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.resource-meta span,
.resource-tags span {
  background: #edf5f1;
  border-radius: 999px;
  color: #61716f;
  font-size: .8rem;
  padding: 4px 9px;
}

.resource-card-footer {
  align-items: center;
  border-top: 1px solid #dfe8e4;
  justify-content: space-between;
  padding: 14px 20px;
}

.resource-card-footer span { color: #61716f; }

.pagination-nav {
  margin-top: 30px;
}

.pagination-nav .page-link {
  color: #3d7564;
}

.pagination-nav .active > .page-link,
.pagination-nav .page-link.active {
  background-color: #4f8f7b;
  border-color: #4f8f7b;
  color: #fff;
}

.resource-detail { padding-bottom: 40px; }

.breadcrumb-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.detail-header {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 280px;
  margin-bottom: 18px;
}

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

.download-panel {
  align-self: start;
  padding: 20px;
}

.detail-side {
  display: grid;
  gap: 14px;
}

.detail-cover-image,
.blog-cover-image {
  background: #edf5f1;
  border: 1px solid #dfe8e4;
  border-radius: 8px;
  max-height: 360px;
}

.blog-cover-image {
  margin-bottom: 18px;
}

.download-count {
  color: #61716f;
  margin-bottom: 14px;
}

.download-form {
  display: grid;
  gap: 10px;
}

.detail-tags { margin-bottom: 24px; }

.content-body {
  line-height: 1.75;
  padding: 24px;
}

.contact-form-panel {
  max-width: 880px;
}

.honeypot {
  left: -10000px;
  position: absolute;
}

.empty-state {
  background: #fff;
  border: 1px dashed #cfdcd6;
  border-radius: 8px;
  color: #61716f;
  padding: 32px;
  text-align: center;
}

.btn-primary {
  background-color: var(--brand-purple);
  border-color: var(--brand-purple);
}

.btn-primary:hover {
  background-color: var(--brand-purple-dark);
  border-color: var(--brand-purple-dark);
}

.public-footer {
  background: #fff;
  border-top-color: rgba(124, 107, 216, .16) !important;
  margin-top: 48px;
  padding: 28px 0;
}

.newsletter-box {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 620px);
}

.newsletter-box p {
  color: #61716f;
  margin: 6px 0 0;
}

.newsletter-form {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr auto;
}

.newsletter-form .form-check {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.footer-bottom {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 22px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legal-page {
  background: #fff;
  border: 1px solid #dfe8e4;
  border-radius: 8px;
  line-height: 1.75;
  margin-bottom: 36px;
  padding: 28px;
}

.legal-page h2 {
  font-size: 1.25rem;
  margin-top: 28px;
}

.legal-page p,
.legal-page li {
  color: #61716f;
}

.error-page {
  background: #fff;
  border: 1px solid #dfe8e4;
  border-radius: 8px;
  margin: 48px auto;
  max-width: 720px;
  padding: 42px;
  text-align: center;
}

.error-code {
  color: #4f8f7b;
  display: block;
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 14px;
}

.error-page p {
  color: #61716f;
  margin: 0 auto 24px;
  max-width: 520px;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.search-hero {
  margin-bottom: 18px;
}

.search-page-form {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 22px;
  max-width: 760px;
}

.search-summary {
  align-items: center;
  background: #fff;
  border: 1px solid #dfe8e4;
  border-radius: 8px;
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  padding: 14px 18px;
}

.search-summary span {
  color: #61716f;
}

.search-section {
  margin-top: 34px;
}

.blog-result-grid {
  display: grid;
  gap: 14px;
}

.blog-result-card {
  background: #fff;
  border: 1px solid #dfe8e4;
  border-radius: 8px;
  padding: 20px;
}

.blog-result-card > span {
  color: #4f8f7b;
  font-size: .85rem;
  font-weight: 700;
}

.blog-result-card h3 {
  font-size: 1.25rem;
  margin: 6px 0 8px;
}

.blog-result-card h3 a {
  color: #21302f;
  text-decoration: none;
}

.blog-result-card p {
  color: #61716f;
  margin-bottom: 12px;
}

.blog-result-meta {
  color: #61716f;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .9rem;
}

.reveal-item {
  opacity: 0;
  transition: opacity .48s ease-out, transform .48s ease-out;
  will-change: opacity, transform;
}

.reveal-left {
  transform: translateX(-46px);
}

.reveal-right {
  transform: translateX(46px);
}

.reveal-item.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-top-button {
  align-items: center;
  background: var(--brand-purple);
  border: 0;
  border-radius: 999px;
  bottom: 22px;
  box-shadow: 0 14px 32px rgba(93, 75, 184, .28);
  color: #fff;
  display: inline-flex;
  font-weight: 700;
  height: 46px;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 22px;
  transform: translateY(14px);
  transition: opacity .2s ease, transform .2s ease, background-color .2s ease;
  width: 46px;
  z-index: 1040;
}

.scroll-top-button:hover {
  background: var(--brand-purple-dark);
}

.scroll-top-button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.toast-area {
  display: grid;
  gap: 10px;
  max-width: min(420px, calc(100vw - 28px));
  position: fixed;
  right: 18px;
  top: 86px;
  z-index: 1080;
}

.app-toast {
  background: rgba(255, 255, 255, .97);
  border: 1px solid rgba(124, 107, 216, .18);
  border-left: 5px solid var(--brand-purple);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(33, 48, 47, .16);
  color: var(--ink);
  width: 100%;
}

.app-toast.toast-error {
  border-left-color: #d65a5a;
}

.app-toast .toast-body {
  align-items: start;
  display: grid;
  gap: 3px 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px 14px 14px 16px;
}

.app-toast .toast-body strong,
.app-toast .toast-body span {
  grid-column: 1;
}

.app-toast .toast-body span {
  color: var(--muted);
  line-height: 1.45;
}

.app-toast .btn-close {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-top: 2px;
}

@media (max-width: 768px) {
  .home-hero { padding: 24px; min-height: 360px; }
  .home-hero h1 { font-size: clamp(2rem, 11vw, 2.7rem); }
  .home-hero p { font-size: 1rem; }
  .page-hero { padding: 22px; }
  .detail-header { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .split-section { grid-template-columns: 1fr; }
  .nav-search,
  .search-page-form {
    grid-template-columns: 1fr;
    max-width: none;
  }
  .newsletter-box,
  .newsletter-form {
    grid-template-columns: 1fr;
  }

  .toast-area {
    left: 14px;
    right: 14px;
    top: 76px;
  }

  .reveal-left,
  .reveal-right {
    transform: translate3d(0, 18px, 0);
  }

  .resource-card:hover,
  .stack-item:hover,
  .blog-result-card:hover,
  .category-panel:hover {
    transform: none;
  }
}

@media (max-width: 991.98px) {
  .public-header .navbar {
    padding-bottom: 10px;
    padding-top: 10px;
  }

  .navbar-toggler {
    border-color: rgba(124, 107, 216, .24);
    border-radius: 8px;
    padding: 8px 10px;
  }

  .mobile-menu-panel {
    background: #fff;
    border: 1px solid rgba(124, 107, 216, .16);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(33, 48, 47, .12);
    margin-top: 12px;
    padding: 10px;
  }

  .mobile-menu-panel .navbar-nav {
    gap: 4px;
  }

  .mobile-menu-panel .nav-link {
    border-radius: 8px;
    font-weight: 600;
    padding: 11px 12px;
  }

  .mobile-menu-panel .nav-link:hover,
  .mobile-menu-panel .nav-link:focus {
    background: rgba(124, 107, 216, .09);
    color: var(--brand-purple-dark) !important;
  }

  .nav-search {
    background: #f8faf8;
    border-radius: 8px;
    margin-top: 10px;
    max-width: none;
    padding: 10px;
  }
}

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

  .reveal-item,
  .reveal-left,
  .reveal-right {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
