/* ===================================================================
   Narrative Canvas — Design System
   Vanilla CSS replacement for Tailwind + shadcn/ui
   =================================================================== */

/* ===== CSS Custom Properties ===== */
:root {
  --background: 210 40% 98%;
  --foreground: 222 84% 5%;

  --card: 0 0% 100%;
  --card-foreground: 222 84% 5%;

  --primary: 222 47% 11%;
  --primary-foreground: 210 40% 98%;

  --secondary: 210 40% 96%;
  --secondary-foreground: 222 47% 11%;

  --muted: 210 40% 96%;
  --muted-foreground: 215 16% 40%;

  --accent: 239 84% 67%;
  --accent-foreground: 0 0% 100%;

  --destructive: 0 84% 60%;
  --destructive-foreground: 210 40% 98%;

  --border: 214 32% 91%;
  --input: 214 32% 91%;
  --ring: 239 84% 67%;

  --radius: 0.75rem;

  /* Cluster colors */
  --cluster-fundamentals: 217 91% 60%;
  --cluster-frameworks: 239 84% 67%;
  --cluster-architecture: 263 70% 58%;
  --cluster-optimization: 160 84% 39%;
  --cluster-monetization: 43 96% 56%;
  --cluster-analytics: 350 89% 60%;
  --cluster-maintenance: 215 14% 34%;
  --cluster-trust: 173 80% 40%;
  --cluster-localization: 189 94% 43%;
  --cluster-distribution: 185 65% 38%;

  /* Hero gradient */
  --hero-from: 222 47% 11%;
  --hero-to: 215 25% 27%;
}

/* ===== Reset / Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-color: hsl(var(--border));
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  min-height: 100vh;
}

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

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

button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

:focus-visible {
  outline: 2px solid hsl(var(--accent));
  outline-offset: 2px;
  border-radius: 2px;
}

ul,
ol {
  list-style: none;
}

/* ===== Typography ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  letter-spacing: -0.025em;
  color: hsl(var(--foreground));
  line-height: 1.2;
}

h1 {
  font-size: 1.875rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.125rem;
}

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

  h2 {
    font-size: 1.875rem;
  }
}

/* ===== Layout ===== */
.editorial-container {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .editorial-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .editorial-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

main.site-main {
  min-height: 100vh;
}

/* ===== Grid Utilities ===== */
.grid {
  display: grid;
  gap: 1.5rem;
}

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

@media (min-width: 768px) {
  .grid-md-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-md-5 {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-lg-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== Component: Article Card ===== */
.article-card {
  background-color: hsl(var(--card));
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.25s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.article-card:hover {
  box-shadow: 0 16px 30px -6px rgb(0 0 0 / 0.15), 0 6px 10px -4px rgb(0 0 0 / 0.08);
  border-color: hsl(var(--accent) / 0.4);
  transform: translateY(-2px);
}

/* ── Thumbnail ── */
.article-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: hsl(var(--muted));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
}

.article-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.article-card:hover .article-card-thumb img {
  transform: scale(1.06);
}

/* Fallback when image fails to load */
.article-card-thumb.thumb-fallback {
  background: linear-gradient(135deg, hsl(var(--muted)), hsl(var(--secondary)));
}

.article-card-thumb.thumb-fallback::after {
  content: '📄';
  font-size: 2rem;
  opacity: 0.4;
}

/* ── Body ── */
.article-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card-body h3 {
  margin-top: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  line-height: 1.25;
}

.article-card-body p {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-footer {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.article-card-footer span {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.article-card-footer a {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--accent));
  transition: text-decoration 0.2s;
}

.article-card-footer a:hover {
  text-decoration: underline;
}

/* Read arrow chip shown in card footer */
.card-read-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--accent));
  transition: letter-spacing 0.2s;
}

.article-card:hover .card-read-link {
  letter-spacing: 0.04em;
}

/* Compact article card (sidebar) */
.article-card-compact {
  display: block;
  padding: 0.75rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s;
}

.article-card-compact:hover {
  background-color: hsl(var(--muted) / 0.5);
}

.article-card-compact h4 {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  line-height: 1.375;
}

.article-card-compact .read-time {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* ===== Component: Cluster Badge ===== */
.cluster-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}

.cluster-badge-fundamentals {
  background-color: hsl(var(--cluster-fundamentals));
  color: hsl(var(--accent-foreground));
}

.cluster-badge-frameworks {
  background-color: hsl(var(--cluster-frameworks));
  color: hsl(var(--accent-foreground));
}

.cluster-badge-architecture {
  background-color: hsl(var(--cluster-architecture));
  color: hsl(var(--accent-foreground));
}

.cluster-badge-optimization {
  background-color: hsl(var(--cluster-optimization));
  color: hsl(var(--accent-foreground));
}

.cluster-badge-monetization {
  background-color: hsl(var(--cluster-monetization));
  color: hsl(var(--foreground));
}

.cluster-badge-analytics {
  background-color: hsl(var(--cluster-analytics));
  color: hsl(var(--accent-foreground));
}

.cluster-badge-maintenance {
  background-color: hsl(var(--cluster-maintenance));
  color: hsl(var(--accent-foreground));
}

.cluster-badge-trust {
  background-color: hsl(var(--cluster-trust));
  color: hsl(var(--accent-foreground));
}

.cluster-badge-localization {
  background-color: hsl(var(--cluster-localization));
  color: hsl(var(--accent-foreground));
}

.cluster-badge-distribution {
  background-color: hsl(var(--cluster-distribution));
  color: hsl(var(--accent-foreground));
}

.bg-cluster-distribution {
  background-color: hsl(var(--cluster-distribution));
}

/* ===== Component: Ad Slot ===== */
/* ===== Component: Hero Gradient ===== */
.hero-gradient {
  background: linear-gradient(135deg, hsl(var(--hero-from)), hsl(var(--hero-to)));
}

/* ===== Component: Accent Gradient ===== */
.accent-gradient {
  background: linear-gradient(135deg, hsl(var(--accent)), hsl(263 70% 58%));
}

/* ===== Component: Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: hsl(var(--card) / 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid hsl(var(--border));
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.125rem;
  color: hsl(var(--foreground));
  letter-spacing: -0.025em;
}

.navbar-logo .accent-diamond {
  color: hsl(var(--accent));
}

/* Desktop nav */
.navbar-desktop {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 1024px) {
  .navbar-desktop {
    display: flex;
  }
}

.navbar-dropdown {
  position: relative;
}

.navbar-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  border-radius: 0.375rem;
  transition: color 0.2s;
}

.navbar-dropdown-btn:hover {
  color: hsl(var(--foreground));
}

.navbar-dropdown-btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

.navbar-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.25rem;
  width: 16rem;
  background-color: hsl(var(--card));
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  border: 1px solid hsl(var(--border));
  padding: 0.5rem 0;
  z-index: 60;
  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  pointer-events: none;
}

/* Show on hover of the parent wrapper */
.navbar-dropdown:hover .navbar-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.navbar-dropdown-menu a {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s, background-color 0.2s;
}

.navbar-dropdown-menu a:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--muted) / 0.5);
}

/* Mobile hamburger */
.navbar-hamburger {
  padding: 0.5rem;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-hamburger svg {
  width: 24px;
  height: 24px;
}

@media (min-width: 1024px) {
  .navbar-hamburger {
    display: none;
  }
}

/* Mobile menu */
.navbar-mobile {
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  max-height: 80vh;
  overflow-y: auto;
  /* Ensure fully opaque on mobile — no alpha leak */
  opacity: 1;
}

@media (min-width: 1024px) {
  .navbar-mobile {
    display: none !important;
  }
}

.navbar-mobile-group {
  border-bottom: 1px solid hsl(var(--border));
}

.navbar-mobile-group:last-child {
  border-bottom: none;
}

.navbar-mobile-group-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.navbar-mobile-group-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.navbar-mobile-group-btn.open svg {
  transform: rotate(180deg);
}

.navbar-mobile-links {
  padding-bottom: 0.5rem;
}

.navbar-mobile-links a {
  display: block;
  padding: 0.5rem 2rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s;
}

.navbar-mobile-links a:hover {
  color: hsl(var(--foreground));
}

/* ===== Component: Footer ===== */
.site-footer {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  margin-top: 5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr repeat(4, 1fr);
  }
}

.footer-brand p {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: hsl(var(--primary-foreground) / 0.7);
}

.footer-col h4 {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  color: hsl(var(--primary-foreground));
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col ul a {
  font-size: 0.875rem;
  color: hsl(var(--primary-foreground) / 0.7);
  transition: color 0.2s;
}

.footer-col ul a:hover {
  color: hsl(var(--primary-foreground));
}

.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--primary-foreground) / 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: hsl(var(--primary-foreground) / 0.6);
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
  }
}

.footer-bottom-links {
  display: flex;
  gap: 1rem;
}

.footer-bottom-links a {
  transition: color 0.2s;
}

.footer-bottom-links a:hover {
  color: hsl(var(--primary-foreground));
}

/* ===== Component: Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 2.5rem;
  right: 1.5rem;
  z-index: 50;
  padding: 0.75rem;
  border-radius: 50%;
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  transition: opacity 0.3s, transform 0.3s;
  cursor: pointer;
}

.back-to-top:hover {
  opacity: 0.9;
}

.back-to-top.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(1rem);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* ===== Component: Author Bio ===== */
.author-bio {
  margin-top: 3rem;
  padding: 1.5rem;
  border-radius: 0.75rem;
  background-color: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border));
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

@media (min-width: 640px) {
  .author-bio {
    flex-direction: row;
  }
}

.author-bio-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background-color: hsl(var(--muted));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.author-bio-avatar svg {
  width: 2rem;
  height: 2rem;
  color: hsl(var(--muted-foreground));
}

.author-bio h4 {
  font-weight: 700;
  color: hsl(var(--foreground));
}

.author-bio p {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.author-bio-links {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.75rem;
}

.author-bio-links a {
  font-size: 0.75rem;
  color: hsl(var(--accent));
  transition: text-decoration 0.2s;
}

.author-bio-links a:hover {
  text-decoration: underline;
}

/* ===== Component: Table of Contents ===== */
.toc-nav a {
  display: block;
  font-size: 0.875rem;
  padding: 0.25rem 0;
  padding-left: 0.75rem;
  border-left: 2px solid transparent;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s, border-color 0.2s;
}

.toc-nav a:hover {
  color: hsl(var(--foreground));
}

.toc-nav a.active {
  border-left-color: hsl(var(--accent));
  color: hsl(var(--accent));
  font-weight: 500;
}

/* ===== Component: Breadcrumb ===== */
.breadcrumb {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: hsl(var(--accent));
}

.breadcrumb .sep {
  margin: 0 0.5rem;
}

/* ===== Component: Featured Image ===== */
.article-featured-image {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  border: 1px solid hsl(var(--border) / 0.5);
  background-color: hsl(var(--muted));
  position: relative;
}

.article-featured-image img {
  width: 100%;
  height: auto;
  max-height: 550px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.article-featured-image:hover img {
  transform: scale(1.02);
}

/* ===== Prose (Article Body) ===== */
.prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
}

.prose h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.prose h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.prose p {
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
  line-height: 1.75;
}

.prose a {
  color: hsl(var(--accent));
  text-decoration: none;
  background-image: linear-gradient(
    hsl(var(--accent) / 0.35),
    hsl(var(--accent) / 0.35)
  );
  background-size: 100% 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  border-radius: 1px;
  padding-bottom: 1px;
  font-weight: 500;
  transition:
    color 0.2s ease,
    background-size 0.2s ease,
    background-image 0.2s ease;
}

.prose a:hover {
  color: hsl(var(--accent));
  background-image: linear-gradient(
    hsl(var(--accent)),
    hsl(var(--accent))
  );
  background-size: 100% 2px;
}

.prose a::after {
  content: '\00A0\2197';
  font-size: 0.7em;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: inline-block;
  transform: translate(-2px, 1px);
}

.prose a:hover::after {
  opacity: 0.6;
  transform: translate(1px, -1px);
}

.prose blockquote {
  border-left: 4px solid hsl(var(--accent));
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
}

.prose blockquote p {
  color: hsl(var(--muted-foreground));
}

.prose ul,
.prose ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose li {
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.5rem;
  line-height: 1.75;
}

.prose strong {
  color: hsl(var(--foreground));
  font-weight: 600;
}

/* ===== Page: Hero Section ===== */
.hero-section {
  padding: 5rem 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero-section {
    padding: 8rem 0;
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
  }
}

.hero-text-col {
  text-align: center;
}

@media (min-width: 1024px) {
  .hero-text-col {
    text-align: left;
  }
}

.hero-image-wrapper {
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5);
  border: 1px solid hsl(var(--accent) / 0.3);
  background-color: hsl(var(--hero-to));
  animation: float 6s ease-in-out infinite;
}

.hero-image-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1.5rem;
  box-shadow: inset 0 0 20px hsl(var(--accent) / 0.2);
  pointer-events: none;
  z-index: 10;
}

.hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 900;
  color: hsl(var(--primary-foreground));
  line-height: 1.15;
  max-width: 56rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3.75rem;
  }
}

@media (min-width: 1024px) {
  .hero-title {
    margin: 0;
  }
}

.hero-subtitle {
  margin-top: 1.5rem;
  font-size: 1.125rem;
  color: hsl(var(--primary-foreground) / 0.8);
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .hero-subtitle {
    margin-left: 0;
    margin-right: 0;
  }
}

.hero-buttons {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .hero-buttons {
    justify-content: flex-start;
  }
}

.hero-buttons .btn-primary,
.hero-buttons .btn-secondary {
  width: 100%;
  max-width: 20rem;
}

@media (min-width: 640px) {
  .hero-buttons .btn-primary,
  .hero-buttons .btn-secondary {
    width: auto;
    max-width: none;
  }
}

@media (min-width: 640px) {
  .hero-buttons {
    flex-direction: row;
  }
}

.btn-primary {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  font-weight: 700;
  font-size: 1.125rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  transition: opacity 0.2s;
  text-align: center;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  background-color: hsl(var(--primary-foreground) / 0.1);
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  border: 1px solid hsl(var(--primary-foreground) / 0.2);
  transition: background-color 0.2s;
  text-align: center;
}

.btn-secondary:hover {
  background-color: hsl(var(--primary-foreground) / 0.2);
}

/* ===== Page: Pillar Preview Card ===== */
.pillar-card {
  border-left: 4px solid hsl(var(--accent));
}

.pillar-card-inner {
  padding: 2rem;
}

@media (min-width: 768px) {
  .pillar-card-inner {
    padding: 2.5rem;
  }
}

.pillar-card-meta {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pillar-card-meta span {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.pillar-card-meta a {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--accent));
  transition: text-decoration 0.2s;
}

.pillar-card-meta a:hover {
  text-decoration: underline;
}

/* ===== Pillar Preview Section ===== */
.pillar-preview-section {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid hsl(var(--border));
}

.pillar-preview-container {
  max-width: 820px;
}

.pillar-preview-article h1 {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
}

@media (min-width: 768px) {
  .pillar-preview-article h1 {
    font-size: 2.75rem;
  }
}

.pillar-last-updated {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.75rem;
}

.pillar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 2rem;
}

.pillar-hook-quote {
  border-left: 4px solid hsl(var(--accent));
  padding: 1rem 1.5rem;
  margin: 0 0 2rem;
  background: hsl(var(--muted) / 0.5);
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
}

.pillar-hook-quote p {
  margin: 0;
}

.pillar-hook-quote a {
  color: hsl(var(--accent));
}

.pillar-summary-box {
  background: hsl(var(--muted) / 0.4);
  border-radius: 0.5rem;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  border-left: 3px solid hsl(var(--accent));
  font-size: 0.95rem;
  line-height: 1.7;
  color: hsl(var(--muted-foreground));
}

.pillar-summary-box strong {
  color: hsl(var(--foreground));
}

/* TOC dropdown */
.pillar-toc {
  background: hsl(var(--muted) / 0.3);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 2.5rem;
  border: 1px solid hsl(var(--border));
}

.pillar-toc summary {
  font-weight: 700;
  cursor: pointer;
  color: hsl(var(--foreground));
  font-size: 1rem;
}

.pillar-toc ul {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  line-height: 2.2;
  list-style: none;
}

.pillar-toc a {
  color: hsl(var(--accent));
  font-size: 0.9rem;
  text-decoration: none;
  transition: text-decoration 0.2s;
}

.pillar-toc a:hover {
  text-decoration: underline;
}

/* Infographics */
.pillar-infographic {
  margin: 2rem 0;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
}

.pillar-infographic img {
  width: 100%;
  height: auto;
  display: block;
}

/* FAQ section */
.pillar-faq-section {
  margin-top: 1rem;
}

.pillar-faq-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid hsl(var(--border));
}

.pillar-faq-item:last-child {
  border-bottom: none;
}

.pillar-faq-item h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.pillar-faq-item p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0;
}

/* Continue Learning grid */
.pillar-continue-learning {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
}

.pillar-continue-learning h2 {
  margin-top: 0;
}

.pillar-link-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .pillar-link-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pillar-link-card {
  display: block;
  padding: 1.25rem;
  border-radius: 0.75rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  transition: border-color 0.3s, box-shadow 0.3s;
  text-decoration: none;
}

.pillar-link-card:hover {
  border-color: hsl(var(--accent) / 0.5);
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.08);
}

.pillar-link-card strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.25rem;
}

.pillar-link-card span {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}

/* Sources */
.pillar-sources-divider {
  margin: 2.5rem 0 1rem;
  border: none;
  border-top: 1px solid hsl(var(--border));
}

.pillar-sources-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.5rem;
}

.pillar-sources-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pillar-sources-list li {
  margin-bottom: 0.375rem;
}

.pillar-sources-list a {
  font-size: 0.875rem;
  color: hsl(var(--accent));
  text-decoration: none;
  transition: text-decoration 0.2s;
}

.pillar-sources-list a:hover {
  text-decoration: underline;
}

/* ===== Page: Cluster Nav Grid Card ===== */
.cluster-nav-card {
  padding: 1.5rem;
  transition: border-color 0.3s;
}

.cluster-nav-card:hover {
  border-color: hsl(var(--accent) / 0.5);
}

.cluster-nav-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  transition: color 0.2s;
}

.cluster-nav-card:hover h3 {
  color: hsl(var(--accent));
}

.cluster-nav-card p {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.cluster-nav-card-footer {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cluster-nav-card-footer span:first-child {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.cluster-nav-card-footer span:last-child {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--accent));
}

/* ===== Page: Download Banner ===== */
.download-banner {
  margin: 0;
}

.download-banner h2 {
  color: hsl(var(--accent-foreground));
}

.download-banner p {
  margin-top: 1rem;
  color: hsl(var(--accent-foreground) / 0.8);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.download-banner a {
  margin-top: 2rem;
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  font-weight: 700;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  transition: opacity 0.2s;
}

.download-banner a:hover {
  opacity: 0.9;
}

/* ===== Page: Related Articles Scroll ===== */
.related-scroll {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.related-scroll::-webkit-scrollbar {
  display: none;
}

.related-scroll {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.related-scroll-item {
  min-width: 300px;
  max-width: 300px;
  flex-shrink: 0;
}

/* ===== Page: Article Layout ===== */
.article-layout {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .article-layout {
    flex-direction: row;
  }
}

.article-main {
  flex: 1;
  min-width: 0;
}

@media (min-width: 1024px) {
  .article-main {
    max-width: 70%;
  }
}

.article-sidebar {
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .article-sidebar {
    width: 30%;
  }
}

.sidebar-sticky {
  position: static;
}

@media (min-width: 1024px) {
  .sidebar-sticky {
    position: sticky;
    top: 5rem;
  }
}

.sidebar-sticky>*+* {
  margin-top: 2rem;
}

/* ===== Page: Article Meta ===== */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.article-meta button {
  color: hsl(var(--accent));
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.article-meta button:hover {
  text-decoration: underline;
}

.article-meta button svg {
  width: 14px;
  height: 14px;
}

/* ===== Page: In This Guide Box ===== */
.guide-toc-box {
  padding: 1.5rem;
  border-radius: 0.75rem;
  background-color: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border));
  margin-bottom: 2.5rem;
}

.guide-toc-box h3 {
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.75rem;
}

.guide-toc-box ul {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.guide-toc-box a {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s;
}

.guide-toc-box a:hover {
  color: hsl(var(--accent));
}

/* ===== Page: Sidebar About Box ===== */
.sidebar-about {
  padding: 1.5rem;
  border-radius: 0.75rem;
  background-color: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border));
}

.sidebar-about h3 {
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.sidebar-about p {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.sidebar-about .count {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* ===== Page: Cluster list ===== */
.sidebar-clusters ul {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.sidebar-clusters a {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s;
}

.sidebar-clusters a:hover {
  color: hsl(var(--accent));
}

.sidebar-clusters a.active {
  color: hsl(var(--accent));
  font-weight: 600;
}

/* ===== Page: 404 ===== */
.page-404 {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: hsl(var(--muted));
}

.page-404 h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.page-404 p {
  font-size: 1.25rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
}

.page-404 a {
  color: hsl(var(--primary));
  text-decoration: underline;
}

.page-404 a:hover {
  color: hsl(var(--primary) / 0.9);
}

/* ===== Pillar Page: Hero breadcrumb ===== */
.pillar-hero-breadcrumb {
  font-size: 0.875rem;
  color: hsl(var(--primary-foreground) / 0.6);
  margin-bottom: 1rem;
}

.pillar-hero-breadcrumb a {
  transition: color 0.2s;
}

.pillar-hero-breadcrumb a:hover {
  color: hsl(var(--primary-foreground));
}

/* ===== Scrollbar hide ===== */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ===== Prose: Table & Blockquote Enhancements ===== */
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1.5rem 0;
}

.prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  background-color: hsl(var(--muted) / 0.6);
  border: 1px solid hsl(var(--border));
  font-weight: 700;
  color: hsl(var(--foreground));
}

.prose td {
  padding: 0.75rem 1rem;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  vertical-align: top;
}

.prose tr:nth-child(even) td {
  background-color: hsl(var(--muted) / 0.2);
}

.prose blockquote {
  border-left: 4px solid hsl(var(--accent));
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background-color: hsl(var(--muted) / 0.4);
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
}

/* ===== Sidebar compact card fixes ===== */
.article-card-compact h4 {
  word-break: break-word;
  margin-top: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  line-height: 1.35;
}

/* ===== Hidden utility ===== */
.hidden {
  display: none !important;
}

/* ===== Sitemap styles ===== */
.sitemap-section {
  margin-bottom: 2rem;
}

.sitemap-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.75rem;
}

.sitemap-section ul {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.sitemap-section a,
.sitemap-top-links a {
  font-size: 0.875rem;
  color: hsl(var(--accent));
  transition: text-decoration 0.2s;
}

.sitemap-top-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.sitemap-section a:hover,
.sitemap-top-links a:hover {
  text-decoration: underline;
}

/* ===================================================================
   Utility Classes — Vanilla replacements for Tailwind-style classes
   used in HTML templates and components.js but not previously defined.
   =================================================================== */

/* Display & layout */
.min-h-screen      { min-height: 100vh; }
.flex              { display: flex; }
.flex-col          { flex-direction: column; }
.flex-1            { flex: 1; }
.flex-shrink-0     { flex-shrink: 0; }
.items-center      { align-items: center; }
.items-start       { align-items: flex-start; }
.justify-between   { justify-content: space-between; }
.flex-wrap         { flex-wrap: wrap; }
.inline-flex       { display: inline-flex; }

/* Spacing — padding */
.py-12  { padding-top: 3rem;    padding-bottom: 3rem; }
.px-4   { padding-left: 1rem;   padding-right: 1rem; }
.p-4    { padding: 1rem; }
.p-6    { padding: 1.5rem; }

/* Spacing — margin */
.mt-1   { margin-top: 0.25rem; }
.mt-2   { margin-top: 0.5rem; }
.mt-4   { margin-top: 1rem; }
.mt-6   { margin-top: 1.5rem; }
.mt-10  { margin-top: 2.5rem; }
.mb-2   { margin-bottom: 0.5rem; }
.mb-3   { margin-bottom: 0.75rem; }
.mb-6   { margin-bottom: 1.5rem; }
.mx-2   { margin-left: 0.5rem; margin-right: 0.5rem; }

/* Gap */
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.gap-6  { gap: 1.5rem; }

/* Child spacing (lobotomised owl) */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* Typography */
.text-xs    { font-size: 0.75rem; }
.text-sm    { font-size: 0.875rem; }
.text-base  { font-size: 1rem; }
.text-lg    { font-size: 1.125rem; }
.text-xl    { font-size: 1.25rem; }
.text-2xl   { font-size: 1.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold  { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }
.leading-tight { line-height: 1.25; }
.tracking-tight { letter-spacing: -0.025em; }
.italic     { font-style: italic; }
.uppercase  { text-transform: uppercase; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Colors */
.text-foreground        { color: hsl(var(--foreground)); }
.text-muted-foreground  { color: hsl(var(--muted-foreground)); }
.text-accent            { color: hsl(var(--accent)); }
.text-accent-foreground { color: hsl(var(--accent-foreground)); }

/* Backgrounds */
.bg-muted               { background-color: hsl(var(--muted)); }
.bg-card                { background-color: hsl(var(--card)); }
.bg-accent              { background-color: hsl(var(--accent)); }

/* Cluster badge backgrounds */
.bg-cluster-fundamentals  { background-color: hsl(var(--cluster-fundamentals)); }
.bg-cluster-frameworks    { background-color: hsl(var(--cluster-frameworks)); }
.bg-cluster-architecture  { background-color: hsl(var(--cluster-architecture)); }
.bg-cluster-optimization  { background-color: hsl(var(--cluster-optimization)); }
.bg-cluster-monetization  { background-color: hsl(var(--cluster-monetization)); }
.bg-cluster-analytics     { background-color: hsl(var(--cluster-analytics)); }
.bg-cluster-maintenance   { background-color: hsl(var(--cluster-maintenance)); }
.bg-cluster-trust         { background-color: hsl(var(--cluster-trust)); }
.bg-cluster-localization  { background-color: hsl(var(--cluster-localization)); }
.bg-cluster-distribution  { background-color: hsl(var(--cluster-distribution)); }

/* Borders & radius */
.border     { border: 1px solid hsl(var(--border)); }
.rounded    { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* Shadows */
.shadow     { box-shadow: 0 1px 3px rgb(0 0 0 / 0.1), 0 1px 2px rgb(0 0 0 / 0.06); }
.shadow-md  { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07); }

/* Overflow */
.overflow-hidden   { overflow: hidden; }
.overflow-x-auto   { overflow-x: auto; }

/* Position */
.relative  { position: relative; }
.absolute  { position: absolute; }
.sticky    { position: sticky; }
.top-0     { top: 0; }

/* Sizing */
.w-full    { width: 100%; }
.h-full    { height: 100%; }
.max-w-xl  { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }

/* Text align */
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Grid — baseline (mobile-first) */
.grid-cols-1 { grid-template-columns: 1fr; }

/* Grid — responsive breakpoints (escaped colon for vanilla CSS) */
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Category page article grid — direct ID target as a reliable fallback
   because the class `md:grid-cols-2` colon requires escaping in standard CSS */
#cluster-articles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

@media (min-width: 768px) {
  #cluster-articles {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Sidebar box (used in category pages) */
.sidebar-box {
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  background-color: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border));
}

.sidebar-box h3 {
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.sidebar-box p {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* ===== Component: Story Idea Generator ===== */
.story-generator {
  padding: 4rem 0;
  background: linear-gradient(180deg, hsl(var(--background)), hsl(var(--muted) / 0.4));
  position: relative;
}

.story-generator::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 600px;
  height: 1px;
  background: linear-gradient(90deg, transparent, hsl(var(--accent) / 0.3), transparent);
}

.story-generator-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.story-generator-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .story-generator-header h2 {
    font-size: 2.25rem;
  }
}

.story-generator-header .icon-spark {
  font-size: 1.5rem;
}

.story-generator-header p {
  margin-top: 0.5rem;
  color: hsl(var(--muted-foreground));
  font-size: 1rem;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.story-generator-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 52rem;
  margin: 0 auto 2rem;
}

@media (min-width: 768px) {
  .story-generator-controls {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

.story-generator-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.story-generator-field label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.story-generator-field select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9375rem;
  color: hsl(var(--foreground));
  background-color: hsl(var(--card));
  border: 1.5px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.story-generator-field select:focus {
  outline: none;
  border-color: hsl(var(--accent));
  box-shadow: 0 0 0 3px hsl(var(--accent) / 0.15);
}

.story-generator-field select:hover {
  border-color: hsl(var(--accent) / 0.5);
}

.story-generator-actions {
  text-align: center;
  margin-bottom: 2.5rem;
}

.story-generator-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2.25rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, hsl(var(--accent)), hsl(263 70% 58%));
  color: hsl(var(--accent-foreground));
  font-weight: 700;
  font-size: 1rem;
  font-family: 'Inter', system-ui, sans-serif;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px hsl(var(--accent) / 0.35);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.story-generator-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px hsl(var(--accent) / 0.45);
}

.story-generator-btn:active {
  transform: translateY(0);
}

.story-generator-btn .btn-icon {
  font-size: 1.125rem;
  transition: transform 0.3s;
}

.story-generator-btn:hover .btn-icon {
  transform: rotate(15deg) scale(1.1);
}

.story-generator-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 64rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .story-generator-results {
    grid-template-columns: repeat(3, 1fr);
  }
}

.story-idea-card {
  background-color: hsl(var(--card));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  border-left: 4px solid hsl(var(--accent));
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
  transition: box-shadow 0.3s, transform 0.3s;
  animation: storyCardSlideUp 0.5s ease-out both;
}

.story-idea-card:nth-child(2) {
  animation-delay: 0.1s;
}

.story-idea-card:nth-child(3) {
  animation-delay: 0.2s;
}

.story-idea-card:hover {
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1);
  transform: translateY(-3px);
}

.story-idea-card .card-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(var(--accent)), hsl(263 70% 58%));
  color: hsl(var(--accent-foreground));
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.story-idea-card h4 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  line-height: 1.35;
  margin-bottom: 0.625rem;
}

.story-idea-card .hook {
  font-size: 0.875rem;
  font-style: italic;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
  margin-bottom: 1rem;
  padding-left: 0.75rem;
  border-left: 2px solid hsl(var(--accent) / 0.3);
}

.story-idea-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.story-idea-card .meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
}

.story-idea-card .meta-tag.keyword {
  background-color: hsl(var(--accent) / 0.1);
  color: hsl(var(--accent));
}

.story-idea-card .meta-tag.format {
  background-color: hsl(160 84% 39% / 0.1);
  color: hsl(160 84% 39%);
}

.story-generator-empty {
  text-align: center;
  padding: 2rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
  max-width: 24rem;
  margin: 0 auto;
  opacity: 0.7;
}

.story-generator-empty .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

@keyframes storyCardSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}