:root {
  --primary: #0b0e27;
  --accent: #1e69ff;
  --link: #ef5350;
  --bg-light: #fdfaf8;
  --text-dark: #0b0e27;
  --text-grey: #666;
  --border: #e0e0e0;
  --card-bg: #fff;
  --font-main: 'Inter', sans-serif;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: var(--font-main);
  background-color: #fff;
  color: var(--text-dark);
  line-height: 1.6;
}

p {
  margin-bottom: 20px;
}

a {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

header {
  padding: 60px 20px 40px;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
}

.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  margin-bottom: 50px;
}

.hero-img {
  width: 120px;
  height: auto;
}

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

.hero-text h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: #000;
  line-height: 1.1;
}

.hero-text p {
  color: var(--text-grey);
  font-size: 1.0rem;
  max-width: 550px;
  line-height: 1.4;
}

.search-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 48px;
}

.search-bar {
  display: flex;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.search-bar input {
  flex: 1;
  padding: 18px 25px;
  border: none;
  font-size: 1.1rem;
  outline: none;
  color: #666;
}

.search-bar button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0 45px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
}

.search-container {
  position: relative;
}

.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 500px;
  overflow-y: auto;
  display: none;
  margin-top: -1px;
}

.search-result-item {
  display: flex;
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  color: inherit;
  align-items: flex-start;
  gap: 15px;
  text-align: left;
}

.search-result-item:hover {
  background: #f9f9f9;
}

.search-result-item:last-child {
  border-bottom: none;
}

.result-thumbnail {
  width: 60px;
  height: 60px;
  background: #0b0e27;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

.result-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.result-info {
  flex: 1;
}

.result-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 5px;
  display: block;
}

.result-snippet {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
  display: block;
}

.search-highlight {
  font-weight: 700;
  color: #000;
  font-style: italic;
}

/* Categories Area */
.categories-section {
  padding: 40px 20px 80px;
  border-top: 1px solid #f0f0f0;
}

.categories-grid {
  display: flex;
  justify-content: center;
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.category-card {
  flex: 1;
  background: white;
  border: 1px solid #eef0f2;
  border-radius: 12px;
  padding: 30px;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card.how-it-works h3 {
  color: var(--accent);
}

.category-card.using-trajektory h3 {
  color: #CF5630;
}

.category-card.glossary h3 {
  color: #64748b;
}

.category-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

.category-link-wrapper {
  display: block;
  text-decoration: none;
  color: inherit;
}

.category-link-wrapper:hover {
  text-decoration: none;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.category-icon {
  width: 24px;
  height: auto;
  object-fit: contain;
}

.category-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0;
  font-weight: 700;
}

.category-card ul {
  list-style: none;
  color: #4b5563;
  font-size: 1rem;
}

.category-card ul li {
  margin-bottom: 8px;
}

.category-card ul li a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

.category-card ul li a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* FAQ Section */
.faq-section {
  background-color: #f7f9fc;
  padding: 80px 20px;
}

.faq-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 40px;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  grid-auto-rows: 1fr;
  gap: 25px;
  max-width: 1200px;
  margin: 0 auto;
}

.faq-card {
  background: white;
  border: 1px solid #eef0f2;
  border-left: 4px solid #eef0f2;
  border-radius: 10px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: all 0.25s ease;
  height: 100%;
}

.faq-card.cat-1 {
  border-left-color: rgba(30, 105, 255, 0.6);
}

.faq-card.cat-2 {
  border-left-color: rgba(207, 86, 48, 0.6);
}

.faq-card.cat-3 {
  border-left-color: rgba(148, 163, 184, 0.6);
}

.faq-card.cat-1 .faq-icon {
  color: var(--accent);
  background-color: #f5f8ff;
}

.faq-card.cat-2 .faq-icon {
  color: #CF5630;
  background-color: #fffaf9;
}

.faq-card.cat-3 .faq-icon {
  color: #64748b;
  background-color: #f8fafc;
}

.faq-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  background: white;
}

.faq-card .content {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 0px;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.faq-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background-color: #f0f4ff;
  color: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}

.faq-card:hover span:not(.faq-icon) {
  color: var(--accent);
  text-decoration: none;
}

.faq-card .learn-more::after {
  content: "→";
}

/* Removed old FAQ content/footer-text styles */

/* Subpage Utilities */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}

.breadcrumb {
  color: var(--link);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 40px;
  line-height: 1.2;
}

.accordion-item {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.accordion-header h4 {
  font-size: 1.2rem;
  font-weight: 700;
}

.accordion-content {
  padding-top: 15px;
  display: none;
}

.accordion-content.active {
  display: block;
}

/* Article Page Specific Styles */
.article-page header {
  display: none;
}

/* Category Page Specific Styles */
.category-page .container {
  border-top: 1px solid #f0f0f0;
}

.article-page .container {
  max-width: 860px;
  padding-top: 100px;
}

.article-page .article-content p {
  line-height: 2.0;
}

.article-page .page-title {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.article-list {
  list-style: none;
}

.article-list li {
  margin-bottom: 10px;
  position: relative;
  padding-left: 15px;
}

.article-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--text-grey);
}

.article-list a {
  color: var(--text-grey);
}

.article-list a:hover {
  color: var(--accent);
}

@media (max-width: 850px) {
  .categories-grid {
    flex-direction: column;
    padding: 0 20px;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-text h1 {
    font-size: 2.2rem;
  }
}

/* Accessibility Tool Styles */
.accessibility-widget {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  z-index: 10000 !important;
  font-family: var(--font-main);
  line-height: 1.6;
}

.accessibility-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #4da1ff;
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(77, 161, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  padding: 0;
}

.accessibility-btn svg {
  width: 32px;
  height: 32px;
  transition: transform 0.2s ease;
}

.accessibility-btn:hover {
  transform: scale(1.1);
}

.accessibility-btn:hover svg {
  transform: rotate(5deg);
}

.accessibility-menu {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 320px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 25px;
  display: none;
  border: 1px solid rgba(0, 0, 0, 0.05);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.accessibility-menu.active {
  display: block;
}

.accessibility-menu h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--primary);
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 10px;
}

.acc-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.acc-option span {
  font-weight: 600;
  color: #444;
}

.acc-controls {
  display: flex;
  gap: 8px;
}

.acc-btn {
  background: #f0f2f5;
  border: none;
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  color: #555;
}

.acc-btn:hover {
  background: #e4e7eb;
}

.acc-btn.active {
  background: var(--accent);
  color: white;
}

.reset-settings {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: #fff0f0;
  color: #ef5350;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.reset-settings:hover {
  background: #ffe0e0;
}

/* Global Accessibility Overrides */
body.acc-high-contrast {
  background-color: #000 !important;
  color: #fff !important;
}

body.acc-high-contrast *:not(.accessibility-widget):not(.accessibility-widget *) {
  color: #fff !important;
  border-color: #fff !important;
  box-shadow: none !important;
}

body.acc-high-contrast div:not(.accessibility-widget):not(.accessibility-widget *),
body.acc-high-contrast main,
body.acc-high-contrast section,
body.acc-high-contrast header,
body.acc-high-contrast article,
body.acc-high-contrast a,
body.acc-high-contrast li,
body.acc-high-contrast ul,
body.acc-high-contrast ol {
  background-color: #000 !important;
}

body.acc-high-contrast a,
body.acc-high-contrast a * {
  color: #00ff00 !important;
  text-decoration: underline !important;
}

/* Specific component overrides */
body.acc-high-contrast .search-bar input {
  background-color: #111 !important;
  color: #fff !important;
  border: 1px solid #fff !important;
}

body.acc-high-contrast .search-bar button {
  background-color: #fff !important;
  color: #000 !important;
}

body.acc-high-contrast .faq-icon {
  background-color: #fff !important;
  color: #000 !important;
  border: 1px solid #fff !important;
}

body.acc-high-contrast .accessibility-btn {
  background-color: #4da1ff !important;
  color: #fff !important;
}

body.acc-grayscale>*:not(.accessibility-widget) {
  filter: grayscale(100%) !important;
}

body.acc-invert>*:not(.accessibility-widget) {
  filter: invert(100%) hue-rotate(180deg) !important;
}

body.acc-highlight-links a {
  background-color: yellow !important;
  color: black !important;
  padding: 2px 4px !important;
  border-radius: 2px !important;
  font-weight: bold !important;
  text-decoration: underline !important;
}

.acc-select {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #f0f2f5;
  font-weight: 600;
}

/* TTS Highlighting */
.tts-speaking {
  background-color: rgba(30, 105, 255, 0.2);
  border-radius: 4px;
}