.article-page {
  position: relative;
  --color-primary: #f43f5e;
  --color-primary-strong: #e11d48;
  --color-primary-rgb: 244 63 94;
  --color-accent: #06b6d4;
  --color-accent-rgb: 6 182 212;
}

.article-page .glass-panel {
  background: rgba(10, 10, 12, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.article-page .tech-card {
  background: #0a0a0c;
  border: 1px solid #1f1f23;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
}

.article-grid-pattern {
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

.article-grid-size {
  background-size: 40px 40px;
}

.article-radial {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 60%);
}

.article-radial-purple {
  background-image: radial-gradient(circle, rgba(217, 70, 239, 0.18), transparent 65%);
}

.article-radial-cyan {
  background-image: radial-gradient(circle, rgba(6, 182, 212, 0.18), transparent 65%);
}

.article-scanline {
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.3) 50%);
}

.article-scanline-size {
  background-size: 100% 4px;
}

.text-glow-rose {
  text-shadow: 0 0 20px rgba(244, 63, 94, 0.5);
}

.text-glow-cyan {
  text-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}

.corner-accent {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: rgba(255, 255, 255, 0.2);
  border-style: solid;
  transition: all 0.3s ease;
}

.corner-tl {
  top: 0;
  left: 0;
  border-width: 1px 0 0 1px;
}

.corner-tr {
  top: 0;
  right: 0;
  border-width: 1px 1px 0 0;
}

.corner-bl {
  bottom: 0;
  left: 0;
  border-width: 0 0 1px 1px;
}

.corner-br {
  bottom: 0;
  right: 0;
  border-width: 0 1px 1px 0;
}

.tech-card:hover .corner-accent {
  border-color: rgba(244, 63, 94, 0.6);
  width: 12px;
  height: 12px;
}

.prose {
  color: var(--color-text);
}

.prose h1 {
  color: #ffffff;
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .prose h1 {
    font-size: 2rem;
  }
}

@media (min-width: 768px) {
  .prose h1 {
    font-size: 2.25rem;
  }
}

.prose h2 {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
  .prose h2 {
    font-size: 1.75rem;
  }
}

@media (min-width: 768px) {
  .prose h2 {
    font-size: 1.875rem;
  }
}

.prose h3 {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
  .prose h3 {
    font-size: 1.375rem;
  }
}

@media (min-width: 768px) {
  .prose h3 {
    font-size: 1.5rem;
  }
}

.prose p {
  margin-bottom: 1.25rem;
  line-height: 1.75;
}

.prose ul {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  list-style-type: disc;
}

.prose ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  list-style-type: decimal;
}

.prose li {
  margin-bottom: 0.5rem;
  display: list-item;
}

.prose strong {
  font-weight: 600;
  color: #ffffff;
}

.prose a {
  color: var(--color-primary);
  text-decoration: underline;
}

.prose a:hover {
  color: var(--color-primary-strong);
}

.prose blockquote {
  border-left: 4px solid rgba(255, 255, 255, 0.12);
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--color-muted);
}

.prose code {
  background-color: rgba(255, 255, 255, 0.08);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  color: var(--color-accent-3);
}

.prose pre {
  background-color: #1f2937;
  color: #f9fafb;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.prose pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
}

.prose img {
  border-radius: 0.5rem;
  margin: 1.5rem 0;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
  object-fit: cover;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.prose th,
.prose td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem;
  text-align: left;
}

.prose th {
  background-color: rgba(255, 255, 255, 0.06);
  font-weight: 600;
}

.table-of-contents ul {
  display: flex !important;
  flex-direction: column !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.table-of-contents li {
  display: block !important;
  width: 100% !important;
  margin-bottom: 0.25rem !important;
}

.table-of-contents a {
  display: block !important;
  width: 100% !important;
  text-decoration: none !important;
}

.prose h1[id],
.prose h2[id],
.prose h3[id] {
  scroll-margin-top: 2rem;
}

nav svg {
  width: 1rem !important;
  height: 1rem !important;
  max-width: 1rem !important;
  max-height: 1rem !important;
}

.w-4.h-4 {
  width: 1rem !important;
  height: 1rem !important;
}

.floating-toc {
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.fixed-download-button {
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    transform: translate(-50%, 100%) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
  }
}

.toc-content {
  transition: all 0.3s ease-in-out;
  overflow: hidden;
}

.toc-collapsed {
  max-height: 0;
  opacity: 0;
}

.toc-expanded {
  max-height: 1000px;
  opacity: 1;
}

.faq-section h1,
.faq-section h2,
.faq-section h3,
.faq-section h4,
.faq-section h5,
.faq-section h6 {
  font-size: 1rem !important;
  line-height: 1.5 !important;
  font-weight: 600 !important;
  margin-top: 1.5rem !important;
  margin-bottom: 0.5rem !important;
}

.faq-section p {
  font-size: 1rem !important;
  line-height: 1.5 !important;
}

.faq-section {
  padding: 0.5rem !important;
  margin-top: 1rem !important;
  margin-bottom: 1rem !important;
}

.article-page .footer-container {
  background: #020203;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.article-page .footer-container::before {
  opacity: 0.35;
}

.article-page .footer-link {
  color: #64748b;
}

.article-page .footer-link:hover {
  color: #e2e8f0;
}

@media (max-width: 640px) {
  .prose p,
  .prose li,
  .prose blockquote,
  .prose td,
  .prose th {
    font-size: 0.875rem !important;
  }

  .prose h1 {
    font-size: 1.5rem !important;
  }

  .prose h2 {
    font-size: 1.25rem !important;
  }

  .prose h3 {
    font-size: 1.125rem !important;
  }

  .prose h4 {
    font-size: 1rem !important;
  }

  .prose h5,
  .prose h6 {
    font-size: 0.875rem !important;
  }

  .article-meta {
    font-size: 0.875rem !important;
  }

  .article-meta .text-sm {
    font-size: 0.75rem !important;
  }

  .bg-gradient-to-br.from-blue-50.to-indigo-50 p {
    font-size: 0.875rem !important;
  }

  .text-sm.text-gray-500 {
    font-size: 0.75rem !important;
  }

  .text-sm.bg-blue-100 {
    font-size: 0.75rem !important;
  }

  .faq-section {
    padding: 0.25rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
  }

  .faq-section h1,
  .faq-section h2,
  .faq-section h3,
  .faq-section h4,
  .faq-section h5,
  .faq-section h6 {
    margin-top: 0.75rem !important;
    margin-bottom: 0.25rem !important;
  }

  .faq-section p {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
  }

  .faq-section ul,
  .faq-section ol {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    padding-left: 1rem !important;
  }

  .faq-section li {
    margin-top: 0.25rem !important;
    margin-bottom: 0.25rem !important;
  }
}

/* Fixed download button placement to avoid bottom overlays (cookie banner / CMS popups). */
.article-fixed-download {
  z-index: 2147483646;
  --article-bottom-overlay: 0px;
  --article-fixed-gap: 12px;
  bottom: calc(env(safe-area-inset-bottom) + var(--article-bottom-overlay) + var(--article-fixed-gap));
}

@media (min-width: 768px) {
  .article-fixed-download {
    --article-fixed-gap: 20px;
  }
}
