/* Capcat Website Main Styles */

/* ====================================
   GLOBAL RESET & BASE STYLES
   ================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-body);
  font-size: var(--text-base);
  line-height: var(--line-height-body);
  color: var(--text-color);
  background-color: var(--bg-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ====================================
   ACCESSIBILITY
   ================================== */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand-orange);
  color: white;
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  font-weight: 700;
  z-index: 9999;
  transition: top 0.2s ease-in;
}

.skip-link:focus {
  top: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ====================================
   TYPOGRAPHY
   ================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--weight-heading);
  line-height: var(--line-height-heading);
  margin-bottom: var(--margin-element);
}

h1 {
  font-size: var(--text-xxlarge);
  font-weight: var(--font-weight-light);
}

h2 {
  font-size: var(--text-xlarge);
  font-weight: var(--font-weight-medium);
  text-align: center;
  color: var(--imprint-medium);
}

h3 {
  font-size: var(--text-large);
  font-weight: var(--font-weight-normal);
}

h4 {
  font-size: var(--text-base);
  font-weight: var(--font-weight-base);
  margin-top: var(--space-md);
}

.NLP-alert {
  font-size: var(--text-large);
  font-weight: 500;
  color: var(--accent-primary);
  text-align: center;
  margin-bottom: var(--margin-element);
  text-decoration: underline;
  text-decoration-color: var(--brand-orange);
  text-decoration-thickness: .100em;
  text-underline-offset: 4.5px;
  display: block;
  margin: var(--space-lg) var(--space-sm);
}

p {
  margin: var(--space-xs) 0;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: all 1s ease;
}

a:hover {
  color: var(--link-hover-color);
}

code, pre {
  font-family: var(--font-family-mono);
  font-size: 0.9rem;
}

code {
  color: var(--imprint);
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

pre {
  background-color: var(--imprint);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: var(--line-height-normal);
  border: 1px solid var(--border-color);
  max-width: 100%;
  word-wrap: break-word;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

pre code {
  color: var(--paper);
}

/* ASCII Art - matches code block styling */
.ascii-art {
  font-family: var(--font-family-mono);
  font-size: 0.9rem;
  background-color: var(--imprint);
  color: var(--paper);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: var(--line-height-normal);
  border: 1px solid var(--border-color);
  max-width: 100%;
  white-space: pre;
  display: block;
}

/* ====================================
   LAYOUT COMPONENTS
   ================================== */

hr {
 border: none;
 height: 1px;
 background: linear-gradient( to right, transparent, var(--accent-primary), transparent );
 margin:0;
 opacity: 0.6;
}

.container {
  max-width: var(--width-full);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-xl) 0 var(--space-lg) 0;
}

.section-alt {
  background: linear-gradient(180deg, var(--paper) 0%, #fffef8 100%);
}

.section-intro {
  font-size: var(--text-base);
  color: var(--text-color-light);
  text-align: center;
  max-width: var(--measure-wide);
  margin: 0 auto var(--margin-section);
}

/* ====================================
   HEADER & NAVIGATION
   ================================== */

.site-header {
  background-color: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background-color: rgba(250, 245, 238, 0.75);
  backdrop-filter: blur(8px);
  transition: background 1s ease, box-shadow 0.3s ease;
}

.site-header.inverted {
/* background: var(--accent-primary); */
background: #faf5ee;
background: linear-gradient(360deg, rgba(254, 252, 250, 0.74) 0%, rgba(250, 245, 238, 1) 75%, rgba(250, 245, 238, 1) 100%);
backdrop-filter: blur(8px);
transition: background 1s ease, box-shadow 0.3s ease;
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
}

.logo svg {
  height: 40px;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.capcat-logo {
  height: 100%;
  width: auto;
  max-height: 40px;
}

.capcat-logo path {
  transition: fill 1s ease;
}

.site-header.inverted .capcat-logo path {
  fill: #1C1A1A !important;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
  align-items: center;
}

.nav-links a {
  font-size: 1rem;
  font-weight: var(--font-weight-bold);
}

.nav-links .btn-primary {
  transition: all 1s ease;o
}

.site-header.inverted .nav-links a:not(.btn-primary) {
  color: var(--imprint-light);
}

.site-header.inverted .nav-links a:not(.btn-primary):hover {
  color: var(--accent-primary);
}

.site-header.inverted .nav-links .btn-primary {
  background-color: #fffef8;
  color: var(--imprint);
  border-color: #fffef8;
}

.site-header.inverted .nav-links .btn-primary:hover {
  background-color: var(--accent-primary);
  color: #fffef8;
  border-color: var(--accent-primary);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--imprint);
  transition: all var(--transition-base);
}

.nav-breadcrumb {
  padding: 1em 0 1.2em 0;
}


/* ====================================
   BUTTONS
   ================================== */

.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-lg);
  font-weight: var(--font-weight-semibold);
  font-size: 1rem;
  text-align: center;
  transition: all 1s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--button-primary-bg);
  color: var(--button-primary-color);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: var(--button-primary-color);
}

.btn-secondary {
  background-color: var(--button-secondary-bg);
  color: var(--button-secondary-color);
  border-color: var(--button-secondary-border);
}

.btn-secondary:hover {
  background-color: var(--imprint);
  color: #ffffff;
  border-color: var(--imprint);
}

.btn-large {
  padding: var(--space-xs) var(--space-md);
  font-size: 1.125rem;
}

/* ====================================
   HERO SECTION
   ================================== */

.hero {
  padding: var(--space-xxxl) 0;
  text-align: center;
  background: linear-gradient(180deg, var(--paper) 0%, #fffef8 100%);
}

.hero-content {
  max-width: var(--measure-wide);
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin-bottom: var(--space-md);
  font-weight: var(--font-weight-light);
}

.hero-subtitle {
  font-size: var(--text-base);
  color: var(--text-color-light);
  margin-bottom: var(--margin-section);
  line-height: var(--line-height-relaxed);
}
.hero-subtitle a {
  color: var(--link-accent);
  text-decoration: underline;
  text-decoration-color: currentcolor;
  text-decoration-thickness: auto;
  text-decoration-color: var(--link-accent);
  text-decoration-thickness: .120em;
  text-underline-offset: 2.5px;
}


.hero-cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-bottom: var(--margin-section);
}

.hero-demo {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
  max-width: var(--measure-optimal);
  margin: 0 auto;
}

.code-demo {
  text-align: left;
  background-color: var(--imprint);
  color: var(--paper);
  margin: 0;
  font-size: 0.85rem;
}

/* ====================================
   PROBLEM GRID
   ================================== */

.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--margin-section);
}

.problem-card {
  background-color: var(--card-bg);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
}

.problem-card h3 {
  color: var(--accent-primary);
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-normal);
  font-size: var(--text-large);
}

/* ====================================
   FEATURES GRID
   ================================== */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--margin-section);
}

.feature-card {
  background-color: var(--card-bg);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.feature-icon img {
  width: 60px;
  height: 60px;
  display: block;
 }

.feature-icon-sources {
  margin: 0 auto;
  font-size: 2.5rem;
  padding: var(--space-sm) 0 var(--space-xs) 0;
}

.feature-icon-sources img {
  width: 60px;
  height: 60px;
  display: block;
  margin: 0 auto;
}

.feature-cat {
  margin: 0 auto;
  font-size: 2.5rem;
}

.feature-cat img {
  width: 386px;
  height: 431px;
  display: block;
  margin: var(--space-sm) auto;
}

.feature-card h2 {
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-normal);
  color:var(--imprint);
  font-size: var(--text-large);
  text-align: left;
}

.code-example {
  margin-top: var(--space-md);
  font-size: 0.8rem;
  background-color: var(--imprint);
  color: var(--paper);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  max-width: 100%;
}

/* ====================================
   WORKFLOW SECTION
   ================================== */

.workflow {
  max-width: var(--measure-optimal);
  margin: var(--margin-section) auto 0;
  list-style: none;
  counter-reset: workflow-counter;
}

.workflow-step {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  align-items: flex-start;
  counter-increment: workflow-counter;
}

.workflow-step::before {
  content: counter(workflow-counter);
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background-color: var(--accent-primary);
  color: #ffffff;
  border-radius: var(--radius-full);
  display: flex;
  align-items: baseline;
  justify-content: center;
  font-family: var(--font-family-serif);
  font-weight: var(--font-weight-bold);
  font-size: 1.25rem;
  padding-top: 13px;
  margin: 0;
}

/* Legacy .step-number class - deprecated, kept for compatibility */
.step-number {
  display: none;
}

.step-content h3 {
  margin-bottom: var(--space-xs);
  font-size:var(--text-large);
}

.step-content p {
  color: var(--text-color-light);
  margin-bottom: 0;
}

/* ====================================
   DUAL MODE SECTION
   ================================== */

.dual-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--margin-section);
}

.mode-comparison {
  background-color: var(--card-bg);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
}

.mode-comparison h3 {
  color: var(--accent-primary);
  margin-bottom: var(--space-md);
  font-weight: var(--font-weight-normal);
  font-size:var(--text-large);
}

.mode-comparison ul {
  list-style: none;
  margin-bottom: var(--space-md);
}

.mode-comparison li {
  padding-left: var(--space-md);
  margin-bottom: var(--space-xs);
  position: relative;
}

.mode-comparison li:before {
  content: "◉";
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: var(--font-weight-bold);
}

.mode-use-case {
  padding: var(--space-md);
  background-color: var(--accent-cream-soft);
  border-radius: var(--radius-xl);
  border-width: 1px;
  border-style: solid;
  border-color: var(--accent-lighter);
  margin-bottom: 0;
}

.transition-path {
  margin-top: var(--space-xl);
  text-align: center;
  padding: var(--space-xl);
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--accent-primary);
}

.transition-path h3 {
  color: var(--accent-primary);
  margin-bottom: var(--space-sm);
}

/* ====================================
   TUTORIAL SECTION
   ================================== */

.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--margin-section);
}

.tutorial-card {
  background-color: var(--card-bg);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
}

.tutorial-card h3 {
  margin-bottom: var(--space-md);
  color: var(--accent-primary);
  font-weight: var(--font-weight-normal);
  font-size:var(--text-large);
}

.tutorial-card ul {
  list-style: none;
}

.tutorial-card li {
  margin-bottom: var(--space-xs);
}

.tutorial-card a {
  display: block;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: all 1s ease;
  text-decoration: underline;
  text-decoration-color: var(--imprint);
  text-decoration-thickness: .120em;
  text-underline-offset: 2.5px
}

.tutorial-card a:hover {
  background-color: var(--accent-lighter-plus);
  padding-left: var(--space-xs);
  transition: all 2s ease;
  text-decoration-color: var(--accent-primary);
}

.learning-paths {
  margin-top: var(--margin-section);
}

.learning-paths h3 {
  text-align: center;
  margin-bottom: var(--margin-section);
}

.paths-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.path-card {
  background-color: var(--card-bg);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
}

.path-card h4 {
  color: var(--accent-primary);
  margin-bottom: var(--space-md);
  font-weight: var(--font-weight-medium);
}

.path-card ol {
  padding-left: var(--space-md);
}

.path-card li {
  margin-bottom: var(--space-xs);
}

/* ====================================
   SOURCES SECTION
   ================================== */

.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--margin-section);
}

.source-category {
  background-color: var(--card-bg);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
}

.source-category h3 {
  color: var(--accent-primary);
  margin-bottom: var(--space-md);
  font-weight: var(--font-weight-normal);
  font-size:var(--text-large);
}

.source-category ul {
  list-style: none;
}

.source-category li {
  padding: var(--space-xs) 0;
  padding-left: var(--space-md);
  position: relative;
  color: var(--text-color-light);
}

.source-category li:before {
  content: "▷";
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: var(--font-weight-bold);
}

.custom-sources {
  margin-top: var(--margin-section);
  text-align: center;
  max-width: var(--measure-optimal);
  margin-left: auto;
  margin-right: auto;
}

.custom-sources h3 {
  margin-bottom: var(--space-md);
  font-weight: var(--font-weight-medium);
}

.custom-sources p {
  color: var(--text-color-light);
  margin-bottom: var(--space-md);
}

.custom-sources .code-example {
  text-align: left;
  max-width: 500px;
  margin: 0 auto;
}

/* ====================================
   CTA SECTION
   ================================== */

.cta-section {
  background: linear-gradient(180deg, #fffef8 0%, var(--paper) 100%);
  text-align: center;
}

.installation-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin: var(--margin-section) 0;
}

.install-step {
  background-color: var(--card-bg) var(--space-sm);
  padding: var(--space-xs);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.install-step h3 {
  margin-bottom: var(--space-md);
  font-weight: var(--font-weight-medium);
  font-size:var(--text-xlarge);
  color:var(--imprint-medium);
}

.install-step pre {
  margin: 0;
  text-align: left;
}

#get-started {
  padding: 0 0 var(--space-xxl) 0;
}

#how-it-works {
  padding: var(--space-xl) 0 var(--space-xs) 0;
}

.get-started-cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ====================================
   FOOTER
   ================================== */

.site-footer {
  background-color: var(--imprint);
  color: var(--paper);
  padding: var(--padding-section) 0 var(--space-lg);
  margin-top: var(--margin-page);
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-logo {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
  text-align: center;
  padding-top: var(--space-sm);
}

.footer-logo svg {
  height: 40px;
  width: auto;
  opacity: 0.8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-logo .capcat-logo {
  height: 100%;
  width: auto;
  max-height: 40px;
}

.footer-logo p {
  color: var(--imprint-light);
  margin: 0;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-lg);
}

.footer-column h4 {
  color: var(--paper);
  padding-top:0;
  font-size: 1.2rem;
  font-weight: var(--font-weight-medium);
}

.footer-column ul {
  list-style: none;
}

.footer-column li {
  margin-bottom: var(--space-xs);
  font-size:var(--text-small);
}

.footer-column a {
  color: var(--imprint-muted);
  transition: all 1s ease;
}

.footer-column a:hover {
  color: var(--paper);
}

.footer-credit {
  text-align: center;
  padding-top: var(--space-lg);
  color: var(--imprint-muted);
  font-size:var(--text-small);
}

.footer-credit a {
  color: var(--accent-primary);
}

.footer-credit a:hover {
  color: var(--accent-light-two);
}

/* ====================================
   BREADCRUMBS NAVIGATION
   ================================== */

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-md) 0;
  font-size: var(--text-small);
  color: var(--text-color-muted);
}

.breadcrumbs a {
  color: var(--text-color-light);
  text-decoration: none;
  transition: color var(--transition-base);
}

.breadcrumbs a:hover {
  color: var(--accent-primary);
}

.breadcrumbs .separator {
  color: var(--text-color-muted);
  user-select: none;
}

.breadcrumbs .current {
  color: var(--text-color);
  font-weight: var(--font-weight-medium);
}

/* ====================================
   DOCUMENTATION LAYOUT
   ================================== */

.doc-container {
  width: 100%;
  padding: var(--space-xl) 0;
}

.doc-content {
  background-color: var(--card-bg);
  padding: var(--space-xxxl);
  border-radius: var(--radius-lg);
  margin-top: var(--space-md);
}

.doc-content h1 {
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
  font-weight: var(--weight-medium);
}

.doc-content h2 {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  padding-bottom: var(--space-lg);
}

.doc-content ul,
.doc-content ol {
  margin: var(--space-md) 0;
  padding-left: var(--space-xl);
}

.doc-content li {
  margin-bottom: var(--space-xs);
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
}

.doc-content li code {
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  display: inline-block;
}

.doc-content a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-decoration-color: var(--accent-primary);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 2px;
  transition: all var(--transition-base);
}

.doc-content a:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}

.doc-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.doc-nav-card {
  background-color: var(--card-bg);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: all var(--transition-base);
}

.doc-nav-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.doc-nav-card h3 {
  color: var(--accent-primary);
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-medium);
}

.doc-nav-card ul {
  list-style: none;
  padding: 0;
}

.doc-nav-card li {
  margin-bottom: var(--space-xs);
}

/* ====================================
   RESPONSIVE STYLES
   ================================== */

/* Tablet View (768px - 1023px) */
@media (max-width: 1023px) {
  .container {
    padding: 0 var(--space-md);
  }

  /* Adjust grid columns for tablet */
  .features-grid,
  .sources-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .problem-grid,
  .tutorial-grid,
  .paths-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Single column for complex cards on tablet */
  .dual-mode-grid,
  .installation-steps {
    grid-template-columns: 1fr;
  }

  /* Responsive crowd background for tablet */
  .crowd-background img {
    width: 480px;
  }
}

/* Mobile & Tablet Navigation */
@media (max-width: 768px) {
  /* Global mobile text wrapping */
  * {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Hide desktop navigation */
  .nav-links {
    display: flex;
  }

  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: flex;
    z-index: calc(var(--z-modal) + 2);
    position: relative;
  }

  /* Hamburger animation */
  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  /* Full-screen overlay menu */
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--paper);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-xxl);
    padding: var(--space-xxl);
    z-index: var(--z-modal);

    /* Fade animation */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
  }

  .nav-links.active {
    opacity: 1;
    visibility: visible;
  }

  /* Menu items styling */
  .nav-links li {
    width: 100%;
    text-align: center;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
  }

  .nav-links.active li {
    transform: translateY(0);
    opacity: 1;
  }

  /* Stagger animation for menu items */
  .nav-links.active li:nth-child(1) { transition-delay: 0.1s; }
  .nav-links.active li:nth-child(2) { transition-delay: 0.15s; }
  .nav-links.active li:nth-child(3) { transition-delay: 0.2s; }
  .nav-links.active li:nth-child(4) { transition-delay: 0.25s; }
  .nav-links.active li:nth-child(5) { transition-delay: 0.3s; }

  .nav-links a {
    font-size: 1.5rem;
    font-weight: var(--font-weight-medium);
    display: block;
    padding: var(--space-lg) var(--space-md);
    width: 100%;
  }

  .nav-links .btn-primary {
    width: 80%;
    max-width: 300px;
    margin-top: var(--space-md);
    margin-left: auto;
    margin-right: auto;
    font-size: 1.25rem;
    padding: var(--space-md) var(--space-xl);
  }

  /* Typography */
  h1 {
    font-size: var(--mobile-text-xxlarge);
    line-height: 1.3;
  }

  h2 {
    font-size: var(--mobile-text-xlarge);
  }

  h3 {
    font-size: var(--mobile-text-large);
  }

  /* Hero */
  .hero {
    padding: var(--space-xxl) 0 var(--space-xl) 0;
  }

  .hero h1 {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-cta {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .hero-demo {
    padding: var(--space-md);
  }

  .code-demo {
    font-size: 0.75rem;
  }

  /* Sections */
  .section {
    padding: var(--space-xl) 0;
  }

  .section-intro {
    font-size: 1rem;
    padding: 0 var(--space-sm);
  }

  /* Grids - All single column on mobile */
  .problem-grid,
  .features-grid,
  .dual-mode-grid,
  .tutorial-grid,
  .paths-grid,
  .sources-grid,
  .installation-steps {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  /* Cards */
  .problem-card,
  .feature-card,
  .source-category,
  .tutorial-card,
  .path-card,
  .install-step {
    padding: var(--space-md);
  }

  /* Workflow */
  .workflow-step {
    flex-direction: column;
    text-align: center;
  }

  .workflow-step::before {
    margin: 0 auto var(--space-md);
  }

  /* Mode comparison */
  .dual-mode-grid {
    gap: var(--space-lg);
  }

  .mode-comparison {
    padding: var(--space-lg);
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    text-align: center;
  }

  .footer-logo {
    align-items: center;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .footer-column {
    text-align: center;
  }

  .feature-cat {
    margin: 0 auto;
    font-size: 2.5rem;
  }

  .feature-cat img {
    width: 100%;
    height: 431px;
    display: block;
    margin: var(--space-sm) auto;
  }

  /* Responsive crowd background for mobile/tablet */
  .crowd-background img {
    width: 380px;
  }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-sm);
  }

  .section {
    padding: var(--space-lg) 0;
  }

  /* Hero adjustments */
  .hero {
    padding: var(--space-xl) 0;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  /* Buttons full width */
  .btn-primary,
  .btn-secondary,
  .hero-cta .btn-primary,
  .hero-cta .btn-secondary {
    width: 100%;
    padding: var(--space-md) var(--space-sm);
  }

  /* Reduce card padding */
  .problem-card,
  .feature-card,
  .source-category,
  .tutorial-card,
  .path-card,
  .install-step,
  .mode-comparison {
    padding: var(--space-md);
  }

  /* Code blocks */
  pre {
    padding: var(--space-sm);
    font-size: 0.7rem;
  }

  code {
    font-size: 0.8rem;
    word-break: break-all;
  }

  .code-example {
    font-size: 0.7rem;
    padding: var(--space-xs);
  }

  /* Force text wrapping on mobile */
  .doc-content li {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .doc-content li code {
    word-break: break-all;
    white-space: normal;
  }

  /* Prevent horizontal overflow */
  .doc-content {
    overflow-x: hidden;
    max-width: 100%;
    padding: var(--space-lg);
  }

  .doc-content ul,
  .doc-content ol {
    padding-left: var(--space-md);
    max-width: 100%;
  }

  /* Navigation items smaller */
  .nav-links a {
    font-size: 1.25rem;
  }

  /* Installation steps */
  .install-step h3 {
    font-size: 1rem;
  }

  /* Footer */
  .footer {
    padding: var(--space-xl) 0 var(--space-md);
  }

  .footer-logo svg {
    height: 32px;
  }

  /* Responsive crowd background for small mobile */
  .crowd-background img {
    width: 280px;
  }
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Improve touch targets for mobile */
@media (max-width: 768px) {
  a,
  button {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Exception for inline text links */
  p a,
  li a {
    min-height: auto;
    min-width: auto;
    display: inline;
  }
}

/* ====================================
   BACK TO TOP BUTTON
   ================================== */

#backToTopBtn {
  opacity: 0;
  visibility: hidden;
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 99;
  border: 1px solid var(--border-color);
  outline: none;
  background-color: var(--card-bg);
  color: var(--text-color);
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  box-shadow: var(--shadow-md);
  transition: opacity 0.3s ease, visibility 0.3s ease, background-color 1s ease, color 1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#backToTopBtn:hover {
  background-color: var(--accent-primary);
  color: #ffffff;
}

#backToTopBtn svg {
  fill: currentColor;
  width: 24px;
  height: 24px;
}

/* ====================================
   MERMAID DIAGRAMS
   ================================== */

/* Center mermaid diagrams */
.mermaid {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: var(--space-lg) auto;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

/* Make mermaid SVG fit container width */
.mermaid svg {
  max-width: 100%;
  height: auto;
  width: 100%;
}

/* Mermaid container with copy button */
.mermaid-container {
  position: relative;
  margin: var(--space-lg) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Copy Mermaid Code button - matches code copy button style */
.mermaid-copy-btn {
  margin-top: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background-color: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-family-mono);
  font-size: var(--text-small);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.mermaid-copy-btn:hover {
  background-color: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.mermaid-copy-btn.copied {
  background-color: var(--success-color, #22c55e);
  color: #ffffff;
  border-color: var(--success-color, #22c55e);
}

/* Draw.io instructions styling */
.mermaid-instructions {
  text-align: center;
  margin-top: var(--space-md);
}

.mermaid-instructions p {
  text-align: center;
  margin-bottom: var(--space-sm);
}

/* ====================================
   CHAPTER NAVIGATION
   ================================== */

/* Next chapter navigation - matches breadcrumb style */
.chapter-navigation {
  padding: var(--space-md) 0;
  margin-top: var(--space-xl);
  display: flex;
  justify-content: flex-start;
}

/* Next chapter link - uses doc-content a style */
.next-chapter-link {
  color: var(--accent-primary);
  text-decoration: underline;
  text-decoration-color: var(--accent-primary);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 2px;
  transition: all var(--transition-base);
}

.next-chapter-link:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}

/* Next chapter content layout */
.next-chapter-content {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Next chapter label - plain text, no underline */
.next-chapter-label {
  color: var(--accent-primary);
  text-decoration: none;
}

/* Next chapter arrow - plain text, no underline */
.next-chapter-arrow {
  color: var(--accent-primary);
  text-decoration: none;
}

/* Responsive: Center on mobile */
@media (max-width: 768px) {
  .chapter-navigation {
    justify-content: center;
  }
}

/* ====================================
   UTILITY CLASSES
   ================================== */

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

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

/* Display */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-row {
  display: flex;
  flex-direction: row;
}

.inline-flex {
  display: inline-flex;
}

.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

.hidden {
  display: none;
}

/* Spacing - Margin */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mr-0 { margin-right: 0; }
.mb-0 { margin-bottom: 0; }
.ml-0 { margin-left: 0; }
.mx-0 { margin-left: 0; margin-right: 0; }
.my-0 { margin-top: 0; margin-bottom: 0; }

.m-xs { margin: var(--space-xs); }
.mt-xs { margin-top: var(--space-xs); }
.mr-xs { margin-right: var(--space-xs); }
.mb-xs { margin-bottom: var(--space-xs); }
.ml-xs { margin-left: var(--space-xs); }
.mx-xs { margin-left: var(--space-xs); margin-right: var(--space-xs); }
.my-xs { margin-top: var(--space-xs); margin-bottom: var(--space-xs); }

.m-sm { margin: var(--space-sm); }
.mt-sm { margin-top: var(--space-sm); }
.mr-sm { margin-right: var(--space-sm); }
.mb-sm { margin-bottom: var(--space-sm); }
.ml-sm { margin-left: var(--space-sm); }
.mx-sm { margin-left: var(--space-sm); margin-right: var(--space-sm); }
.my-sm { margin-top: var(--space-sm); margin-bottom: var(--space-sm); }

.m-md { margin: var(--space-md); }
.mt-md { margin-top: var(--space-md); }
.mr-md { margin-right: var(--space-md); }
.mb-md { margin-bottom: var(--space-md); }
.ml-md { margin-left: var(--space-md); }
.mx-md { margin-left: var(--space-md); margin-right: var(--space-md); }
.my-md { margin-top: var(--space-md); margin-bottom: var(--space-md); }

.m-lg { margin: var(--space-lg); }
.mt-lg { margin-top: var(--space-lg); }
.mr-lg { margin-right: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }
.ml-lg { margin-left: var(--space-lg); }
.mx-lg { margin-left: var(--space-lg); margin-right: var(--space-lg); }
.my-lg { margin-top: var(--space-lg); margin-bottom: var(--space-lg); }

.m-xl { margin: var(--space-xl); }
.mt-xl { margin-top: var(--space-xl); }
.mr-xl { margin-right: var(--space-xl); }
.mb-xl { margin-bottom: var(--space-xl); }
.ml-xl { margin-left: var(--space-xl); }
.mx-xl { margin-left: var(--space-xl); margin-right: var(--space-xl); }
.my-xl { margin-top: var(--space-xl); margin-bottom: var(--space-xl); }

.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }

/* Spacing - Padding */
.p-0 { padding: 0; }
.pt-0 { padding-top: 0; }
.pr-0 { padding-right: 0; }
.pb-0 { padding-bottom: 0; }
.pl-0 { padding-left: 0; }
.px-0 { padding-left: 0; padding-right: 0; }
.py-0 { padding-top: 0; padding-bottom: 0; }

.p-xs { padding: var(--space-xs); }
.pt-xs { padding-top: var(--space-xs); }
.pr-xs { padding-right: var(--space-xs); }
.pb-xs { padding-bottom: var(--space-xs); }
.pl-xs { padding-left: var(--space-xs); }
.px-xs { padding-left: var(--space-xs); padding-right: var(--space-xs); }
.py-xs { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }

.p-sm { padding: var(--space-sm); }
.pt-sm { padding-top: var(--space-sm); }
.pr-sm { padding-right: var(--space-sm); }
.pb-sm { padding-bottom: var(--space-sm); }
.pl-sm { padding-left: var(--space-sm); }
.px-sm { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }

.p-md { padding: var(--space-md); }
.pt-md { padding-top: var(--space-md); }
.pr-md { padding-right: var(--space-md); }
.pb-md { padding-bottom: var(--space-md); }
.pl-md { padding-left: var(--space-md); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }

.p-lg { padding: var(--space-lg); }
.pt-lg { padding-top: var(--space-lg); }
.pr-lg { padding-right: var(--space-lg); }
.pb-lg { padding-bottom: var(--space-lg); }
.pl-lg { padding-left: var(--space-lg); }
.px-lg { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }

.p-xl { padding: var(--space-xl); }
.pt-xl { padding-top: var(--space-xl); }
.pr-xl { padding-right: var(--space-xl); }
.pb-xl { padding-bottom: var(--space-xl); }
.pl-xl { padding-left: var(--space-xl); }
.px-xl { padding-left: var(--space-xl); padding-right: var(--space-xl); }
.py-xl { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }

/* Width & Height */
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.h-auto { height: auto; }

/* Max Width */
.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-full { max-width: 100%; }

/* Gap (for flex/grid) */
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Justify Content */
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

/* Align Items */
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

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

/* Border Radius */
.rounded-none { border-radius: 0; }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 9999px; }

/* Font Weight */
.font-light { font-weight: var(--font-weight-light); }
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* Font Size */
.text-xs { font-size: var(--text-xsmall); }
.text-sm { font-size: var(--text-small); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-large); }
.text-xl { font-size: var(--text-xlarge); }
.text-2xl { font-size: var(--text-xxlarge); }

/* Colors */
.text-primary { color: var(--accent-primary); }
.text-muted { color: var(--text-muted); }
.bg-primary { background-color: var(--accent-primary); }
.bg-card { background-color: var(--card-bg); }

/* Shadow */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-none { box-shadow: none; }

/* ====================================
   DOC CONTENT MODS
   ================================== */
.doc-content h3{
  margin-top: var(--space-md);
}

.doc-container pre {
  margin: var(--space-sm) 0;
}

/* ====================================
 OTHER MODS
 ================================== */

.title-accent {
  color: var(--accent-primary);
  font-weight: var(--font-weight-light);
  font-size:clamp(2rem, 5vw, 3.5rem);;
  display: block;
  padding: var(--space-lg) var(--space-xs);
}

#modes {
  padding: var(--space-sm) 0;
}

/*Capcat-cat-transform*/

.holographic-container {
            perspective: 1000px;
            position: relative;
            width: 100%;
            height: 628px;
            margin: 0 auto;
            overflow: hidden;
        }

        /* Static background layer: Crowd.svg
           Positioned absolutely within holographic-container.
           z-index: 1 places it behind the cat card.
           NOT a child of #capcatCard, so it does NOT inherit
           the 3D transforms - remains completely static.
           Width fixed at exactly 628px as specified. */
        .crowd-background {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 628px;
            height: auto;
            z-index: 1;
            pointer-events: none;
        }

        .crowd-background img {
            width: 628px;
            height: auto;
            display: block;
        }

        /* Interactive card layer: Cat mascot.
           Receives 3D transforms via JavaScript on #capcatCard.
           z-index: 2 places it above the static crowd background.
           Only this element (and its children) move with 3D effects. */
        .capcat-card {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            cursor: pointer;
            touch-action: none;
            transform-origin: center;
            transition: transform 0.1s ease-out;
            z-index: 2;
        }

        .svg-wrapper {
            width: 100%;
            height: 100%;
        }

        .svg-wrapper img {
            height: 100%;
            object-fit: contain;
        }