/* Monochrome theme: light (default) + dark via [data-theme="dark"] on <html> */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-elevated: #fafafa;
  --text: #0a0a0a;
  --muted: #525252;
  --faint: #a3a3a3;
  --stroke: #e5e5e5;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #f5f5f5;
  --shadow: rgba(0, 0, 0, 0.05);
  --hero-glow: rgba(0, 0, 0, 0.03);
  --header-bg: rgba(255, 255, 255, 0.95);
  --btn-primary-bg: #0a0a0a;
  --btn-primary-fg: #ffffff;
  --btn-primary-shadow: rgba(0, 0, 0, 0.15);
  --grad-from: #111111;
  --grad-to: #666666;
  --nav-menu-bg: #ffffff;
  --nav-menu-hover: #f0f0f0;
  --nav-menu-shadow: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --text: #fafafa;
  --muted: #a3a3a3;
  --faint: #737373;
  --stroke: #404040;
  --surface: rgba(23, 23, 23, 0.75);
  --surface-solid: #262626;
  --shadow: rgba(0, 0, 0, 0.45);
  --hero-glow: rgba(255, 255, 255, 0.04);
  --header-bg: rgba(10, 10, 10, 0.88);
  --btn-primary-bg: #fafafa;
  --btn-primary-fg: #0a0a0a;
  --btn-primary-shadow: rgba(0, 0, 0, 0.35);
  --grad-from: #fafafa;
  --grad-to: #a3a3a3;
  --nav-menu-bg: #1a1a1a;
  --nav-menu-hover: #2e2e2e;
  --nav-menu-shadow: rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

img, svg {
  max-width: 100%;
}

html {
  font-family: "Montserrat", sans-serif;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Montserrat", sans-serif;
  background:
    radial-gradient(ellipse 100% 70% at 100% 0%, var(--hero-glow) 0%, transparent 50%),
    radial-gradient(ellipse 80% 50% at 0% 100%, var(--hero-glow) 0%, transparent 45%),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.container {
  width: 95%;
  max-width: none;
  padding: 0;
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--stroke);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
  position: relative;
}

.brand-logo {
  display: block;
  height: auto;
  max-width: 168px;
}

.brand-logo--footer {
  max-width: 140px;
  opacity: 0.95;
}

[data-theme="light"] .brand-logo--for-dark,
[data-theme="dark"] .brand-logo--for-light {
  display: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-link {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.15s ease, background 0.15s ease;
  background: var(--bg);
  position: relative;
}

@property --border-angle {
  syntax: '<angle>';
  inherits: true;
  initial-value: 0turn;
}

.page-link::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 10px;
  padding: 2px;
  background: conic-gradient(from var(--border-angle), transparent 70%, #ed2024 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.page-link:hover:not(.active)::before {
  opacity: 1;
  animation: spin-border-angle 1.2s linear infinite;
}

@keyframes spin-border-angle {
  to { --border-angle: 1turn; }
}

.page-link::after {
  display: none;
}

.page-link:hover,
.page-link.active {
  color: var(--text);
}

.page-link.active {
  background: var(--bg) !important;
  color: var(--text) !important;
  box-shadow: 0 0 12px #f72e64 !important;
  border: 1px solid #ed2024 !important;
}

[data-theme="dark"] .page-link.active {
  color: #fff !important;
}

.page-view {
  display: none;
  animation: fade-in 0.4s ease;
}

.page-view.active {
  display: block;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-dropdown__trigger:hover,
.nav-dropdown:hover > .nav-dropdown__trigger,
.nav-dropdown:focus-within > .nav-dropdown__trigger {
  color: var(--text);
  background: var(--surface-solid);
}

.nav-dropdown__chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown__chevron,
.nav-dropdown:focus-within .nav-dropdown__chevron {
  transform: rotate(180deg);
}

.nav-dropdown--align-end .nav-dropdown__panel {
  left: auto;
  right: 0;
}

.nav-dropdown__panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 240px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--nav-menu-bg);
  box-shadow: 0 16px 48px var(--nav-menu-shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 0.18s ease,
    visibility 0.18s ease,
    transform 0.18s ease;
  z-index: 40;
}

.nav-dropdown:hover .nav-dropdown__panel,
.nav-dropdown:focus-within .nav-dropdown__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-dropdown__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.nav-dropdown__item:hover,
.nav-dropdown__item:focus-visible {
  background-color: var(--nav-menu-hover);
  color: var(--text);
  outline: none;
}

.nav-dropdown__item--sub {
  padding: 8px 12px 8px 16px;
  font-size: 0.85rem;
  color: var(--muted);
  position: relative;
}

.nav-dropdown__item--sub::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--text);
  border-radius: 0 4px 4px 0;
  transition: height 0.15s ease;
}

.nav-dropdown__item--sub:hover::before,
.nav-dropdown__item--sub:focus-visible::before {
  height: 60%;
}

.nav-dropdown__group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--stroke);
}

.nav-dropdown__label {
  margin: 4px 12px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
}

.nav-dropdown__icon {
  display: flex;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: var(--bg-elevated);
  color: var(--text);
}

.nav-dropdown__icon svg {
  width: 20px;
  height: 20px;
}

.nav-dropdown__trigger:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--surface-solid);
  border-color: #ed2024;
  color: #ed2024;
}

.theme-toggle:active {
  transform: scale(0.96);
  background: #ed2024;
  color: #fff;
  border-color: #ed2024;
  box-shadow: 0 0 12px #f72e64;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--stroke);
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  box-shadow: 0 8px 24px var(--btn-primary-shadow);
}

.btn-primary:active {
  background: #ed2024 !important;
  color: #000000 !important;
  box-shadow: 0 0 12px #f72e64 !important;
}

[data-theme="dark"] .btn-primary:active {
  color: #fff !important;
}

.btn-outline {
  color: var(--text);
  border: 1px solid var(--stroke);
  background: transparent;
  font-family: inherit;
}

.btn--full {
  width: 100%;
  margin-top: 10px;
}

.hero {
  padding: 88px 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 44px;
  align-items: center;
}

.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.08;
  margin: 10px 0 16px;
}

h1 span {
  color: inherit;
}

.subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin: 24px 0 30px;
  flex-wrap: wrap;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.metrics strong {
  font-size: 1.55rem;
}

.metrics p {
  color: var(--muted);
  margin: 7px 0 0;
}

.hero-visual {
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
}

.doc-animation-container {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 340px;
}

.doc-paper {
  position: absolute;
  top: 0;
  right: 20px;
  width: 250px;
  height: 310px;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 20px 40px var(--shadow);
  transform-style: preserve-3d;
  overflow: hidden;
}

.doc-skeleton-title {
  width: 60%;
  height: 12px;
  background: var(--stroke);
  border-radius: 4px;
  margin-bottom: 20px;
}

.doc-skeleton-line {
  height: 8px;
  background: var(--stroke);
  border-radius: 4px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.doc-skeleton-box {
  width: 100%;
  height: 70px;
  background: var(--surface-solid);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  margin: 16px 0;
}

/* Keep scanner animation */
@keyframes scan-vertical {
  0%, 10% { top: 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  90%, 100% { top: 100%; opacity: 0; }
}

.doc-scanner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #ed2024;
  box-shadow: 0 0 10px #ed2024, 0 4px 20px var(--shadow);
  animation: scan-vertical 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  z-index: 10;
}

/* Updated Hero Animation CSS */
.doc-anim-multibox {
  perspective: 1200px;
}

.doc-anim-multibox .doc-paper {
  width: 280px;
  height: 380px;
  right: 50px;
  padding: 20px;
  transform: rotateY(-8deg) rotateX(4deg) translateZ(-40px);
  animation: float-doc-center 6s ease-in-out infinite;
}

.doc-skeleton-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.doc-skeleton-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  width: 65%;
}

.doc-skeleton-header-right .doc-skeleton-title {
  width: 100%;
  height: 14px;
  margin: 0;
  background: var(--stroke);
  border-radius: 4px;
}

.doc-skeleton-barcode {
  display: flex;
  gap: 2px;
  height: 24px;
}

.doc-skeleton-barcode .bar {
  width: 2px;
  background: var(--stroke);
}
.doc-skeleton-barcode .bar.wide {
  width: 4px;
}

.doc-skeleton-table {
  border: 1px solid var(--stroke);
  border-radius: 4px;
  margin: 16px 0;
  overflow: hidden;
}

.doc-table-row {
  display: flex;
  gap: 4px;
  padding: 6px;
  border-bottom: 1px solid var(--stroke);
}
.doc-table-row:last-child {
  border-bottom: none;
}

.doc-table-row.header {
  background: var(--surface-solid);
}

.doc-table-row span {
  height: 6px;
  background: var(--stroke);
  border-radius: 2px;
}

.doc-skeleton-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px dashed var(--stroke);
}

.doc-skeleton-stamp {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px dashed var(--stroke);
  opacity: 0.6;
}

.doc-skeleton-signature {
  width: 60px;
  height: 20px;
  background: var(--stroke);
  border-radius: 10px;
  opacity: 0.8;
  mask-image: linear-gradient(to right, #000 30%, transparent 40%, #000 50%, transparent 60%, #000 70%);
  -webkit-mask-image: linear-gradient(to right, #000 30%, transparent 40%, #000 50%, transparent 60%, #000 70%);
}

.doc-skeleton-photo {
  width: 50px;
  height: 50px;
  background: var(--surface-solid);
  border: 1px dashed var(--stroke);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stroke);
  flex-shrink: 0;
}
.doc-skeleton-photo svg {
  width: 24px;
  height: 24px;
}

.extract-box {
  position: absolute;
  background: var(--header-bg);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 25px var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
}

.box-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--text);
  flex-shrink: 0;
}

.box-icon svg {
  width: 18px;
  height: 18px;
}

.box-data {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.box-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.box-val {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Animations for extracted boxes */
.box-barcode {
  top: 10px;
  right: -30px;
  animation: pop-out 6s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
  animation-delay: 0.5s;
}

.box-text {
  top: 80px;
  left: -20px;
  animation: pop-out 6s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
  animation-delay: 1.5s;
}

.box-photo {
  top: -10px;
  left: -40px;
  animation: pop-out 6s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
  animation-delay: 0.8s;
}

.box-table {
  top: 150px;
  right: -40px;
  animation: pop-out 6s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
  animation-delay: 2.8s;
}

.box-signature {
  bottom: 20px;
  right: -10px;
  animation: pop-out 6s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
  animation-delay: 3.5s;
}

@keyframes float-doc-center {
  0%, 100% { transform: rotateY(-8deg) rotateX(4deg) translateZ(-40px) translateY(0); }
  50% { transform: rotateY(-8deg) rotateX(4deg) translateZ(-40px) translateY(-15px); }
}

@keyframes pop-out {
  0%, 15% { opacity: 0; transform: scale(0.8) translateZ(20px); }
  25%, 85% { opacity: 1; transform: scale(1) translateZ(50px); }
  95%, 100% { opacity: 0; transform: scale(0.8) translateZ(20px); }
}

.trusted {
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
  background: var(--surface-solid);
}

.logos {
  padding: 28px 0 12px;
}

.logos__title {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-marquee {
  padding: 8px 0 32px;
}

.logo-marquee__viewport {
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent,
    #000 4%,
    #000 96%,
    transparent
  );
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 4%,
    #000 96%,
    transparent
  );
}

.logo-marquee__viewport:hover .logo-marquee__track {
  animation-play-state: paused;
}

.logo-marquee__track {
  display: flex;
  width: max-content;
  align-items: flex-end;
  gap: clamp(36px, 5vw, 64px);
  padding: 12px 0 8px;
  animation: logo-marquee 42s linear infinite;
}

.logo-img {
  max-width: 140px;
  max-height: 48px;
  object-fit: contain;
  opacity: 0.6;
  transition: all 0.2s ease;
  color: #000;
}

[data-theme="dark"] .logo-img {
  opacity: 0.8;
  filter: brightness(0) invert(1);
  color: #fff;
}

.logo-marquee__item:hover .logo-img {
  opacity: 1;
}

.logo-marquee__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  min-width: 132px;
  max-width: 160px;
  color: var(--text);
  opacity: 0.88;
  transition: opacity 0.2s ease;
}

.logo-marquee__item:hover {
  opacity: 1;
}

.logo-marquee__glyph {
  width: 40px;
  height: 40px;
  color: var(--text);
}

.logo-marquee__name {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
  line-height: 1.25;
}

@keyframes logo-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-marquee__track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: min(920px, 94%);
    margin: 0 auto;
    row-gap: 20px;
    column-gap: 28px;
    padding-bottom: 16px;
  }

  .logo-marquee__item[aria-hidden="true"] {
    display: none;
  }

  .logo-marquee__viewport {
    mask-image: none;
  }
}

#about,
#careers,
.industry-card,
#contact {
  scroll-margin-top: 92px;
}

.company-block {
  padding: 56px 0;
  border-bottom: 1px solid var(--stroke);
}

.company-block h2 {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
}

.company-block p {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.65;
}

/* About Section */
.about-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--stroke);
}

.about-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 56px;
}

.about-header h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0 0 16px;
  background: linear-gradient(120deg, var(--grad-from), var(--grad-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.about-intro {
  font-size: 1.15rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.about-map-container {
  position: relative;
  width: 100%;
  max-width: 450px;
  margin: 0 auto 56px;
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--stroke);
  box-shadow: 0 12px 32px var(--shadow);
}

.about-map-img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.8;
  filter: grayscale(1) contrast(3) brightness(0.6);
}

[data-theme="dark"] .about-map-container {
  background: var(--bg-elevated);
}

[data-theme="dark"] .about-map-img {
  filter: invert(1) grayscale(1) contrast(1.5) opacity(0.5);
}

.map-pin {
  position: absolute;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.map-pin .pin-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ed2024;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(237, 32, 36, 0.6);
  z-index: 2;
}

.map-pin .pin-pulse {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-color: rgba(237, 32, 36, 0.4);
  border-radius: 50%;
  z-index: 1;
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.map-pin .pin-label {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px var(--shadow);
}

.map-pin:hover .pin-label {
  opacity: 1;
  transform: translate(-50%, -4px);
}

@keyframes pulse-ring {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.about-card {
  background: #ffffff;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 32px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

[data-theme="dark"] .about-card {
  background: var(--bg-elevated);
}

.about-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 2px;
  background: conic-gradient(from var(--border-angle), transparent 70%, #ed2024 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.about-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--shadow);
}

.about-card:hover::before {
  opacity: 1;
  animation: spin-border-angle 1.2s linear infinite;
}

.about-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--text);
}

.about-card-icon svg {
  width: 24px;
  height: 24px;
}

.about-card h3 {
  font-size: 1.25rem;
  margin: 0 0 12px;
  color: var(--text);
}

.about-card p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.about-mission {
  background: #ffffff;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 48px;
  text-align: center;
}

[data-theme="dark"] .about-mission {
  background: linear-gradient(135deg, var(--surface-solid), var(--bg-elevated));
}

.about-mission-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-mission h3 {
  font-size: 1.5rem;
  margin: 0 0 16px;
  color: var(--text);
}

.about-mission p {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.features {
  padding: 80px 0;
}

.section-head h2 {
  margin-top: 10px;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
}

.feature-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-grid article {
  border: 1px solid var(--stroke);
  background: var(--bg-elevated);
  border-radius: 16px;
  padding: 24px;
}

.feature-grid p {
  color: var(--muted);
  line-height: 1.6;
}

.solutions {
  padding: 80px 0;
  background: linear-gradient(to bottom, var(--surface-solid), var(--bg-elevated));
}

.solution-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.solution-wrap h2 {
  margin-top: 10px;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
}

.solution-wrap p,
.solution-wrap li {
  color: var(--muted);
}

.solution-wrap ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.solution-wrap li {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--bg-elevated);
}

.section-head--center {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.subtitle--center {
  margin-left: auto;
  margin-right: auto;
}

.use-cases-section {
  padding: 80px 0;
}

.solutions-tabs-container {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.solutions-tabs-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  border-bottom: 1px solid var(--stroke);
  padding-bottom: 16px;
}

.solutions-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 10px 20px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.solutions-tab-btn::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 999px;
  padding: 2px;
  background: conic-gradient(from var(--border-angle), transparent 70%, #ed2024 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.solutions-tab-btn:hover:not(.active)::before {
  opacity: 1;
  animation: spin-border-angle 1.2s linear infinite;
}

.solutions-tab-btn:hover:not(.active) {
  color: var(--text);
  border-color: transparent;
}

.solutions-tab-btn.active {
  background: var(--bg) !important;
  color: var(--text) !important;
  box-shadow: 0 0 12px #f72e64 !important;
  border-color: #ed2024 !important;
}

[data-theme="dark"] .solutions-tab-btn.active {
  color: #fff !important;
}

.solutions-panel {
  display: none;
  animation: fade-in 0.4s ease;
}

.solutions-panel.active {
  display: block;
}

.solutions-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 48px;
  box-shadow: 0 12px 32px var(--shadow);
}

.solutions-panel-info h3 {
  font-size: 1.8rem;
  margin: 0 0 16px;
}

.solutions-panel-info p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 32px;
}

.panel-anim-container {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 320px;
  margin: 0 auto;
  perspective: 1200px;
}

.doc-paper--static {
  animation: none;
  transform: rotateY(-8deg) rotateX(4deg) translateZ(0);
}

.data-panel {
  position: absolute;
  background: var(--surface-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  z-index: 10;
  padding: 0;
  width: 250px;
}

[data-theme="dark"] .data-panel {
  background: rgba(30, 30, 30, 0.8);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.data-panel-header {
  background: rgba(0, 0, 0, 0.05);
  padding: 6px 10px;
  display: flex;
  gap: 5px;
  border-bottom: 1px solid var(--stroke);
}

[data-theme="dark"] .data-panel-header {
  background: rgba(255, 255, 255, 0.05);
}

.data-panel-header .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5f56;
}
.data-panel-header .dot:nth-child(2) { background: #ffbd2e; }
.data-panel-header .dot:nth-child(3) { background: #27c93f; }

.data-panel-code {
  padding: 15px;
  color: var(--text);
  line-height: 1.5;
}

.code-key { color: #ed2024; }
.code-val { color: #27c93f; }
.code-num { color: #ffbd2e; }
.code-cursor {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.data-panel--static {
  animation: none;
  transform: translateZ(30px);
  bottom: -20px;
  left: -20px;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.use-case-list {
  margin: auto 0 0;
  padding: 16px 0 0;
  list-style: none;
  border-top: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.use-case-list li {
  position: relative;
  padding-left: 20px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}

.use-case-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

.cta {
  margin: 72px auto 90px;
  border: 1px solid var(--stroke);
  background: #ffffff;
  border-radius: 20px;
  padding: 35px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

[data-theme="dark"] .cta {
  background: linear-gradient(130deg, var(--surface-solid), var(--bg-elevated));
}

.cta p {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--stroke);
  padding: 24px 0 34px;
}

.footer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

@media (min-width: 800px) {
  .footer-wrap {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

@media (min-width: 800px) {
  .footer-brand {
    align-items: flex-start;
    text-align: left;
  }
}

.footer-legal {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.footer-contacts {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
  text-align: center;
}

@media (min-width: 600px) {
  .footer-contacts {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 48px;
  }
}

.footer-contact-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

@media (min-width: 600px) {
  .footer-contact-block {
    align-items: flex-start;
  }
}

.footer-icon {
  width: 24px;
  height: 24px;
  color: var(--text);
  margin-bottom: 6px;
}

.footer-contact-block p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
}

.footer-socials {
  display: flex;
  gap: 12px;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: var(--text);
  transition: all 0.2s ease;
}

.footer-social-link:hover {
  transform: scale(1.1);
}

.footer-social-link:active {
  transform: scale(0.96);
}

.footer-social-link svg {
  width: 20px;
  height: 20px;
}

/* Modal & Form Styles */
.modal {
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 25px 80px var(--shadow);
  width: min(520px, 94vw);
  max-height: 90vh;
  margin: auto;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal__content {
  position: relative;
  padding: 36px 32px;
  overflow-y: auto;
  max-height: inherit;
}

.modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-solid);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.modal__close:hover {
  background: var(--stroke);
  color: var(--text);
}

.modal__close svg {
  width: 20px;
  height: 20px;
}

.modal__title {
  margin: 0 0 10px;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.modal__subtitle {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.demo-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 200px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--muted);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 10%, transparent);
}

@media (max-width: 980px) {
  .hero {
    padding: 48px 0 40px;
  }

  .about-section,
  .use-cases-section {
    padding: 48px 0;
  }

  .hero-grid,
  .solutions-panel-grid,
  .solution-wrap,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .solutions-panel-grid {
    padding: 32px 24px;
    gap: 40px;
  }

  .hero-visual {
    min-height: 280px;
  }

  .card-main {
    position: relative;
  }

  .card-secondary {
    left: auto;
    right: 0;
    bottom: 0;
  }

  .nav-wrap {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .brand {
    order: 1;
  }

  .header-actions {
    order: 2;
    margin-left: auto;
  }

  .nav-links {
    order: 3;
    flex-basis: 100%;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    gap: 8px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-dropdown__panel {
    left: 0;
    right: auto;
    min-width: min(100%, 280px);
  }

  .nav-dropdown--align-end .nav-dropdown__panel {
    left: 0;
    right: auto;
  }

  .cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Features Grid (General)
   ========================================================================== */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 32px;
  transition: all 0.3s ease;
  position: relative;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  padding: 2px;
  background: conic-gradient(from var(--border-angle), transparent 70%, #ed2024 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px var(--shadow);
  border-color: transparent;
}

.feature-card:hover::before {
  opacity: 1;
  animation: spin-border-angle 1.2s linear infinite;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(237, 32, 36, 0.1);
  color: #ed2024;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-icon--white {
  background: var(--bg);
  border: 1px solid #ed2024;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin: 0 0 12px;
  color: var(--text);
}

.feature-card p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   RAG Animation
   ========================================================================== */

.rag-anim-container {
  position: relative;
  width: 100%;
  max-width: 720px;
  height: 380px;
  margin: 0 auto;
  font-family: 'Courier New', Courier, monospace;
}

.rag-node {
  position: absolute;
  background: var(--surface-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  width: 160px;
  z-index: 2;
}

[data-theme="dark"] .rag-node {
  background: rgba(30, 30, 30, 0.8);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.rag-node-header {
  background: rgba(0, 0, 0, 0.05);
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .rag-node-header {
  background: rgba(255, 255, 255, 0.05);
}

.rag-node-header svg {
  color: #ed2024;
}

.rag-node-body {
  padding: 12px;
  font-size: 0.75rem;
  color: var(--text);
  min-height: 50px;
  display: flex;
  align-items: flex-start;
}

/* Positions */
.rag-prompt { top: 0; left: 0; width: 160px; }
.rag-loader { bottom: 0; left: 0; width: 160px; }
.rag-dashboard { top: 50%; left: 32%; transform: translate(-50%, -50%); width: 140px; }
.rag-retrieval { top: 0; left: 55%; transform: translateX(-50%); width: 100px; }
.rag-db { bottom: 0; left: 55%; transform: translateX(-50%); width: 100px; }
.rag-llm { top: 0; right: 0; left: auto; transform: none; width: 80px; }
.rag-output { bottom: 0; right: 0; left: auto; transform: none; width: 96px; }

/* Typewriter effects */
.rag-typewriter-line {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid transparent;
  width: 0;
  font-size: 0.8rem;
  line-height: 1.2;
}

/* Prompt */
.prompt-line-1 {
  animation: type-p1 8s steps(3, end) infinite;
}
.prompt-line-2 {
  animation: type-p2 8s steps(2, end) infinite;
}

@keyframes type-p1 {
  0% { width: 0; border-right-color: #ed2024; }
  10% { width: 100%; border-right-color: #ed2024; }
  11%, 29% { width: 100%; border-right-color: transparent; }
  30%, 100% { width: 0; border-right-color: transparent; }
}

@keyframes type-p2 {
  0%, 10% { width: 0; border-right-color: transparent; }
  11% { width: 0; border-right-color: #ed2024; }
  20% { width: 100%; border-right-color: #ed2024; }
  21%, 29% { width: 100%; border-right-color: transparent; }
  30%, 100% { width: 0; border-right-color: transparent; }
}

/* Output */
.out-line-1 {
  color: #27c93f;
  animation: type-o1 8s steps(2, end) infinite;
}
.out-line-2 {
  color: #27c93f;
  animation: type-o2 8s steps(2, end) infinite;
}

@keyframes type-o1 {
  0%, 65% { width: 0; border-right-color: transparent; }
  66% { width: 0; border-right-color: #27c93f; }
  75% { width: 100%; border-right-color: #27c93f; }
  76%, 100% { width: 100%; border-right-color: transparent; }
}

@keyframes type-o2 {
  0%, 75% { width: 0; border-right-color: transparent; }
  76% { width: 0; border-right-color: #27c93f; }
  85% { width: 100%; border-right-color: #27c93f; }
  86%, 100% { width: 100%; border-right-color: transparent; }
}

/* DB specifics */
.db-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.db-row {
  height: 8px;
  background: var(--stroke);
  border-radius: 4px;
  width: 100%;
}
.db-row.highlight {
  background: #ed2024;
  animation: db-pulse 8s infinite;
  opacity: 0.3;
}

@keyframes db-pulse {
  0%, 25% { opacity: 0.3; box-shadow: none; }
  30%, 45% { opacity: 1; box-shadow: 0 0 8px #ed2024; }
  50%, 100% { opacity: 0.3; box-shadow: none; }
}

/* Loader internals */
.loader-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.loader-file {
  background: var(--stroke);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--text);
  animation: file-load 8s infinite;
  opacity: 0;
}
.loader-file:nth-child(2) {
  animation-delay: 1s;
}
@keyframes file-load {
  0%, 5% { opacity: 0; transform: translateY(5px); }
  10%, 90% { opacity: 1; transform: translateY(0); }
  95%, 100% { opacity: 0; transform: translateY(-5px); }
}

/* Retrieval tags */
.retrieval-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.retrieval-tags .tag {
  background: rgba(237, 32, 36, 0.1);
  color: #ed2024;
  border: 1px solid rgba(237, 32, 36, 0.2);
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  animation: tag-pulse 8s infinite;
}
.retrieval-tags .tag:nth-child(2) {
  animation-delay: 0.5s;
}
@keyframes tag-pulse {
  0%, 30% { box-shadow: none; background: rgba(237, 32, 36, 0.1); }
  35%, 50% { box-shadow: 0 0 8px rgba(237, 32, 36, 0.5); background: rgba(237, 32, 36, 0.2); }
  55%, 100% { box-shadow: none; background: rgba(237, 32, 36, 0.1); }
}

/* Dashboard Metrics */
.dashboard-metrics {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
}
.metric-label {
  color: var(--muted);
}
.metric-val {
  font-weight: bold;
  color: #27c93f;
}
.metric-val.ms {
  color: #ffbd2e;
}

/* LLM Brain */
.rag-llm-brain {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
}
.brain-core {
  width: 32px;
  height: 32px;
  background: conic-gradient(from 0deg, transparent 70%, #ed2024 100%);
  border-radius: 50%;
  animation: spin-brain 8s linear infinite;
  position: relative;
  opacity: 0.2;
}
.brain-core::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--bg);
  border-radius: 50%;
}
@keyframes spin-brain {
  0%, 45% { transform: rotate(0deg); opacity: 0.2; filter: drop-shadow(0 0 0 transparent); }
  50%, 75% { transform: rotate(720deg); opacity: 1; filter: drop-shadow(0 0 10px #f72e64); }
  80%, 100% { transform: rotate(720deg); opacity: 0.2; filter: drop-shadow(0 0 0 transparent); }
}

/* Lines connecting nodes */
.rag-line {
  position: absolute;
  background-image: linear-gradient(to right, var(--faint) 50%, transparent 50%);
  background-size: 8px 1px;
  background-repeat: repeat-x;
  height: 1px;
  z-index: 1;
}

.rag-line.vertical {
  background-image: linear-gradient(to bottom, var(--faint) 50%, transparent 50%);
  background-size: 1px 8px;
  background-repeat: repeat-y;
  width: 1px;
  height: auto;
}

.line-q-retrieval {
  top: 45px;
  left: 160px;
  right: calc(45% + 50px);
}

.line-loader-db {
  bottom: 45px;
  left: 160px;
  right: calc(45% + 50px);
}

.line-db-retrieval {
  left: 55%;
  bottom: 85px;
  top: 85px;
  background-image: linear-gradient(to top, var(--faint) 50%, transparent 50%);
}

.line-retrieval-llm {
  top: 45px;
  left: calc(55% + 50px);
  right: 80px;
}

.line-llm-output {
  right: 40px;
  top: 85px;
  bottom: 85px;
}

/* Flowing dots along lines */
.rag-flow-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #ed2024;
  border-radius: 50%;
  box-shadow: 0 0 8px #f72e64;
  opacity: 0;
}

.line-loader-db .rag-flow-dot {
  top: -3px;
  animation: flow-right 8s infinite;
  animation-delay: 1s;
}

.line-q-retrieval .rag-flow-dot {
  top: -3px;
  animation: flow-right 8s infinite;
  animation-delay: 2s;
}

.line-retrieval-llm .rag-flow-dot {
  top: -3px;
  animation: flow-right 8s infinite;
  animation-delay: 4.5s;
}

.line-llm-output .rag-flow-dot {
  left: -3px;
  animation: flow-down-late 8s infinite;
  animation-delay: 5.5s;
}

@keyframes flow-right {
  0%, 5% { left: 0; opacity: 0; }
  6% { opacity: 1; }
  25% { left: 100%; opacity: 1; }
  26%, 100% { opacity: 0; left: 100%; }
}

@keyframes flow-down-late {
  0%, 5% { top: 0; opacity: 0; }
  6% { opacity: 1; }
  25% { top: 100%; opacity: 1; }
  26%, 100% { opacity: 0; top: 100%; }
}

/* Floating chunks from DB to Retrieval */
.rag-chunk {
  position: absolute;
  left: -12px;
  bottom: 0;
  background: var(--bg);
  border: 1px solid #ed2024;
  color: var(--text);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(237, 32, 36, 0.2);
  opacity: 0;
}

.rag-chunk.vertical-chunk {
  animation: flow-up 8s infinite;
  animation-delay: 3s;
}

.rag-chunk.binary-chunk-1 {
  bottom: -10px;
  font-family: 'Courier New', Courier, monospace;
  font-weight: bold;
  animation: flow-right-chunk 8s infinite;
  animation-delay: 1s;
}

.rag-chunk.binary-chunk-2 {
  bottom: -10px;
  font-family: 'Courier New', Courier, monospace;
  font-weight: bold;
  animation: flow-right-chunk 8s infinite;
  animation-delay: 1.5s;
}

.rag-chunk svg {
  color: #ed2024;
}

@keyframes flow-up {
  0%, 5% { bottom: 0; opacity: 0; transform: scale(0.8); }
  6% { opacity: 1; transform: scale(1); }
  25% { bottom: 100%; opacity: 1; transform: scale(1); }
  26%, 100% { opacity: 0; bottom: 100%; transform: scale(0.8); }
}

@keyframes flow-right-chunk {
  0%, 5% { left: 0; opacity: 0; transform: scale(0.8); }
  6% { opacity: 1; transform: scale(1); }
  25% { left: 100%; opacity: 1; transform: scale(1); }
  26%, 100% { opacity: 0; left: 100%; transform: scale(0.8); }
}

@media (max-width: 900px) {
  .rag-anim-container {
    transform: scale(0.8);
    transform-origin: top center;
    margin-bottom: -76px; /* 380 * 0.2 */
  }
  .doc-animation-container {
    transform: scale(0.8);
    transform-origin: top center;
    margin-bottom: -68px; /* 340 * 0.2 */
  }
  .panel-anim-container {
    transform: scale(0.8);
    transform-origin: top center;
    margin-bottom: -64px; /* 320 * 0.2 */
  }
}

@media (max-width: 600px) {
  .rag-anim-container {
    transform: scale(0.5);
    transform-origin: top center;
    margin-bottom: -190px; /* 380 * 0.5 */
  }
  .doc-animation-container {
    transform: scale(0.5);
    transform-origin: top center;
    margin-bottom: -170px; /* 340 * 0.5 */
  }
  .panel-anim-container {
    transform: scale(0.5);
    transform-origin: top center;
    margin-bottom: -160px; /* 320 * 0.5 */
  }
}

/* --- AGENTS ANIMATION --- */
.mt-12 {
  margin-top: 48px;
}

.agents-anim-wrapper {
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  padding-top: 40px;
  padding-bottom: 20px;
}

.agents-anim-container {
  position: relative;
  width: 900px;
  height: 550px;
  flex-shrink: 0;
  margin: 0 auto;
  font-family: 'Courier New', Courier, monospace;
  perspective: 1000px;
}

.agent-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: transform 0.3s ease;
}

.agent-node:hover {
  transform: scale(1.1);
  z-index: 20;
}

.agent-node:hover .node-label {
  border-color: #ed2024;
  box-shadow: 0 4px 12px rgba(237, 32, 36, 0.3);
  color: #ed2024;
}

.node-label {
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-glass);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px var(--shadow);
}

/* Orchestrator */
.orchestrator {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
}

.orchestrator:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

.orch-core {
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, #ff5f56 0%, #ed2024 100%);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(255, 95, 86, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.5);
  animation: pulse-core 3s ease-in-out infinite alternate;
  z-index: 5;
}

.orch-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed rgba(237, 32, 36, 0.4);
  z-index: 1;
}

@keyframes pulse-core {
  0% { transform: scale(0.9); box-shadow: 0 0 20px rgba(255, 95, 86, 0.4); }
  100% { transform: scale(1.1); box-shadow: 0 0 50px rgba(255, 95, 86, 0.8), 0 0 80px rgba(237, 32, 36, 0.4); }
}

@keyframes spin-ring {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Specialized Agents */
.specialized {
  width: 70px;
  height: 70px;
}

.agent-icon {
  width: 50px;
  height: 50px;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 20px var(--shadow);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

/* .agent-icon::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: conic-gradient(from 0deg, transparent 70%, rgba(237, 32, 36, 0.4) 100%);
  animation: spin-conic 4s linear infinite;
  z-index: -1;
} */

@keyframes spin-conic {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Agent Positions */
.planner-panel {
  top: -5%;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
}
.planner-panel:hover {
  transform: translateX(-50%) scale(1.05);
  transition: transform 0.3s ease;
}
.coder-panel {
  top: 70%;
  right: 0;
  width: 180px;
}
.coder-panel:hover {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}
.vision-panel {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
}
.vision-panel:hover {
  transform: translateX(-50%) scale(1.05);
  transition: transform 0.3s ease;
}

.researcher-panel {
  top: 5%;
  right: 0;
  width: 180px;
}
.researcher-panel:hover {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

.evaluator-panel {
  top: 70%;
  left: 0;
  width: 180px;
}
.evaluator-panel:hover {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}


/* Panels */
.agent-panel {
  position: absolute;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: 0 12px 30px var(--shadow);
  z-index: 5;
  overflow: hidden;
}

.dashboard-panel {
  top: 5%;
  left: 0;
  width: 220px;
  font-family: 'Courier New', Courier, monospace;
}

.panel-header {
  background: rgba(0, 0, 0, 0.05);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--stroke);
}
[data-theme="dark"] .panel-header {
  background: rgba(255, 255, 255, 0.05);
}

.panel-header .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dashboard-body {
  padding: 12px;
  font-family: monospace;
  font-size: 0.65rem;
}

.dash-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--text);
}

.dash-label { color: var(--muted); }
.dash-val { font-weight: bold; color: #ed2024; }

.dash-graph {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 40px;
  margin: 12px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--stroke);
}

.dash-graph .bar {
  flex: 1;
  background: linear-gradient(to top, #ed2024, #ff5f56);
  border-radius: 2px 2px 0 0;
  transform-origin: bottom;
  animation: graph-bounce 2s ease infinite alternate;
}
.dash-graph .bar:nth-child(2) { animation-delay: 0.2s; }
.dash-graph .bar:nth-child(3) { animation-delay: 0.4s; }
.dash-graph .bar:nth-child(4) { animation-delay: 0.6s; }
.dash-graph .bar:nth-child(5) { animation-delay: 0.8s; }
.dash-graph .bar:nth-child(6) { animation-delay: 1s; }

@keyframes graph-bounce {
  0% { transform: scaleY(0.8); }
  100% { transform: scaleY(1.2); }
}

.dash-log {
  font-family: monospace;
  font-size: 0.6rem;
  color: var(--muted);
  height: 40px;
  overflow: hidden;
  position: relative;
  margin-top: 8px;
}
.log-track {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: log-slide 12s infinite;
}

@keyframes log-slide {
  0%, 10% { transform: translateY(0); }
  15%, 25% { transform: translateY(-20px); }
  30%, 40% { transform: translateY(-40px); }
  45%, 55% { transform: translateY(-60px); }
  60%, 70% { transform: translateY(-80px); }
  75%, 85% { transform: translateY(-100px); }
  90%, 100% { transform: translateY(-120px); }
}

.code-container-inner {
  display: inline-block;
}

.code-cursor {
  display: inline-block;
  width: 6px;
  height: 12px;
  background: #ed2024;
  vertical-align: middle;
  animation: code-blink 1s step-end infinite;
  margin-left: 2px;
}

@keyframes code-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.coder-body {
  background: var(--bg);
  border: 1px solid var(--stroke);
}
[data-theme="dark"] .coder-body {
  background: rgba(0, 0, 0, 0.2);
  border: none;
}

#code-container {
  color: #000000;
}
[data-theme="dark"] #code-container {
  color: #ffffff;
}

/* Light mode (default) syntax colors */
.kw { color: #ed2024; font-weight: bold; }
.fn { color: #000000; font-weight: bold; }
.ar { color: #000000; }
.st { color: #ed2024; }
.nu { color: #ed2024; }
.op { color: #000000; }

/* Dark mode syntax colors */
[data-theme="dark"] .kw { color: #ed2024; font-weight: bold; }
[data-theme="dark"] .fn { color: #ffffff; font-weight: bold; }
[data-theme="dark"] .ar { color: #ffffff; }
[data-theme="dark"] .st { color: #ed2024; }
[data-theme="dark"] .nu { color: #ed2024; }
[data-theme="dark"] .op { color: #ffffff; }

.evaluator-body {
  background: var(--bg);
  border-radius: 4px;
  border: 1px solid var(--stroke);
  overflow: hidden;
}
[data-theme="dark"] .evaluator-body {
  background: rgba(0, 0, 0, 0.2);
  border: none;
}

/* Memory Panel */
/* Lines and Data Flow */
.agent-line {
  position: absolute;
  background: var(--stroke);
  z-index: 1;
  opacity: 0.5;
  transform-origin: 0 0;
}

.agent-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #ff5f56;
  border-radius: 50%;
  box-shadow: 0 0 10px #ff5f56, 0 0 20px #ed2024;
  top: -3.5px;
  left: 0;
}

/* Calculate lines from center (450, 275) to nodes */
/* Center to Planner (450, 55) -> dist = 220, angle = -90deg */
.line-orch-planner { top: 50%; left: 50%; width: 170px; height: 1px; transform: rotate(-90deg); }
.line-orch-planner .agent-particle { animation: particle-flow 3s linear infinite; }

.line-orch-researcher { top: 50%; left: 50%; width: 340px; height: 1px; transform: rotate(-18deg); }
.line-orch-researcher .agent-particle { animation: particle-flow 2.5s linear infinite 0.5s; }

.line-orch-coder { top: 50%; left: 50%; width: 340px; height: 1px; transform: rotate(18deg); }
.line-orch-coder .agent-particle { animation: particle-flow 4s linear infinite 1s; }

.line-orch-vision { top: 50%; left: 50%; width: 140px; height: 1px; transform: rotate(90deg); }
.line-orch-vision .agent-particle { animation: particle-flow 2s linear infinite 0.2s; }

.line-orch-evaluator { top: 50%; left: 50%; width: 340px; height: 1px; transform: rotate(162deg); }
.line-orch-evaluator .agent-particle { animation: particle-flow 3.5s linear infinite 1.5s; }

/* Center to Dash (220, 82.5 + X) approx -> left panel */
/* Let's just make arbitrary cool lines */
.line-orch-dash { top: 50%; left: 50%; width: 350px; height: 1px; transform: rotate(-155deg); }
.line-orch-dash .agent-particle { animation: particle-flow-rev 3s linear infinite; background: #ff5f56; box-shadow: 0 0 10px #ff5f56; }

@keyframes particle-flow {
  0% { left: 0; opacity: 0; transform: scale(0.5); }
  10% { opacity: 1; transform: scale(1); }
  90% { left: 100%; opacity: 1; transform: scale(1); }
  100% { left: 100%; opacity: 0; transform: scale(0.5); }
}

@keyframes particle-flow-rev {
  0% { left: 100%; opacity: 0; transform: scale(0.5); }
  10% { opacity: 1; transform: scale(1); }
  90% { left: 0; opacity: 1; transform: scale(1); }
  100% { left: 0; opacity: 0; transform: scale(0.5); }
}

@media (max-width: 900px) {
  .agents-anim-container {
    transform: scale(0.8);
    transform-origin: top center;
    margin-bottom: -110px;
  }
}

@media (max-width: 750px) {
  .agents-anim-container {
    transform: scale(0.65);
    transform-origin: top center;
    margin-bottom: -192px; /* 550 * 0.35 */
  }
}

@media (max-width: 600px) {
  .agents-anim-container {
    transform: scale(0.45);
    transform-origin: top center;
    margin-bottom: -300px;
  }
}

@media (max-width: 450px) {
  .agents-anim-container {
    transform: scale(0.35);
    transform-origin: top center;
    margin-bottom: -357px; /* 550 * 0.65 */
  }
}

/* Memory Lottie Icon Filtering */
.memory-lottie-icon {
  /* No filter in light mode, the python script changed the blue to red */
}
[data-theme="dark"] .memory-lottie-icon {
  /* Invert black to white, but keep the red by rotating hue back */
  /* Red inverted is cyan, so we hue-rotate ~180deg back to red */
  filter: invert(1) hue-rotate(180deg) saturate(3);
}

/* Scroll Progress Button */
.scroll-progress-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: none;
  box-shadow: 0 4px 12px var(--shadow);
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
}

.scroll-progress-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-progress-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px var(--shadow);
}

.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
}

.progress-ring__circle-bg {
  stroke: var(--stroke);
  transition: stroke 0.3s ease;
}

.progress-ring__circle {
  transition: stroke-dashoffset 0.1s linear;
  stroke-linecap: round;
}

.progress-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* Vision Agent Scanning Animation */
.vision-scanner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #ed2024;
  box-shadow: 0 0 10px 3px rgba(237, 32, 36, 0.4);
  z-index: 2;
  animation: scanDocument 2.5s ease-in-out infinite;
}

@keyframes scanDocument {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.vision-doc {
  position: relative;
}
.vision-doc::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent, rgba(237, 32, 36, 0.05), transparent);
  animation: scanDocument 2.5s ease-in-out infinite;
  pointer-events: none;
}
/* Evaluator Agent Animation */
@keyframes evalStepAnim {
  0% { opacity: 0; transform: translateX(-5px); }
  10%, 80% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(5px); }
}

@keyframes evalBarFill {
  0%, 15% { width: 0%; background: var(--stroke); box-shadow: none; }
  50%, 85% { width: 98%; background: #ed2024; box-shadow: 0 0 8px #ed2024; }
  100% { width: 0%; background: var(--stroke); box-shadow: none; }
}

@keyframes fadeOutTest {
  0%, 40% { opacity: 1; color: var(--text); }
  45%, 100% { opacity: 0; }
}

@keyframes fadeInPass {
  0%, 40% { opacity: 0; }
  45%, 85% { opacity: 1; text-shadow: 0 0 5px rgba(237, 32, 36, 0.5); }
  100% { opacity: 0; }
}

@keyframes evalLogScroll {
  0%, 10% { transform: translateY(0); }
  40%, 60% { transform: translateY(-50%); }
  90%, 100% { transform: translateY(-100%); }
}

.eval-log-anim {
  animation: evalLogScroll 8s infinite ease-in-out;
}

.eval-step {
  opacity: 0;
  animation: evalStepAnim 4s infinite ease-out;
}
.eval-step-1 { animation-delay: 0s; }
.eval-step-2 { animation-delay: 0.5s; }
.eval-step-3 { animation-delay: 1s; }

.eval-bar {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  animation: evalBarFill 4s infinite ease-out;
}

.eval-status-testing { animation: fadeOutTest 4s infinite; }
.eval-status-pass { animation: fadeInPass 4s infinite; }
/* Research Agent Animation */
@keyframes researchStepFade {
  0%, 15% { opacity: 1; font-weight: bold; color: var(--text); }
  25%, 100% { opacity: 0.4; font-weight: normal; color: var(--text); }
}

@keyframes researchDotPulse {
  0%, 15% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 6px #ed2024; }
  25%, 100% { transform: scale(1); opacity: 0.4; box-shadow: none; }
}

.research-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: monospace;
  font-size: 0.65rem;
  color: var(--text);
  opacity: 0.4;
  animation: researchStepFade 8s infinite;
}

.research-dot {
  width: 6px;
  height: 6px;
  min-width: 6px;
  border-radius: 50%;
  background-color: #ed2024;
  opacity: 0.4;
  animation: researchDotPulse 8s infinite;
}

.r-step-1, .r-step-1 .research-dot { animation-delay: 0s; }
.r-step-2, .r-step-2 .research-dot { animation-delay: 2s; }
.r-step-3, .r-step-3 .research-dot { animation-delay: 4s; }
.r-step-4, .r-step-4 .research-dot { animation-delay: 6s; }

.researcher-body {
  background: var(--bg);
  border: 1px solid var(--stroke);
  border-radius: 4px;
}
[data-theme="dark"] .researcher-body {
  background: rgba(0, 0, 0, 0.2);
  border: none;
}
/* Planner Agent Animation */
@keyframes planStepFade {
  0%, 15% { opacity: 1; font-weight: bold; color: var(--text); }
  25%, 100% { opacity: 0.4; font-weight: normal; color: var(--text); }
}

@keyframes planDotPulse {
  0%, 15% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 6px #ed2024; }
  25%, 100% { transform: scale(1); opacity: 0.4; box-shadow: none; }
}

.plan-step {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-family: monospace;
  font-size: 0.65rem;
  white-space: normal;
  line-height: 1.2;
  color: var(--text);
  opacity: 0.4;
  animation: planStepFade 10s infinite;
}

.plan-dot {
  width: 5px;
  height: 5px;
  min-width: 5px;
  margin-top: 2px;
  border-radius: 50%;
  background-color: #ed2024;
  opacity: 0.4;
  animation: planDotPulse 10s infinite;
}

.p-step-1, .p-step-1 .plan-dot { animation-delay: 0s; }
.p-step-2, .p-step-2 .plan-dot { animation-delay: 2s; }
.p-step-3, .p-step-3 .plan-dot { animation-delay: 4s; }
.p-step-4, .p-step-4 .plan-dot { animation-delay: 6s; }
.p-step-5, .p-step-5 .plan-dot { animation-delay: 8s; }

.plan-status::after {
  content: 'PLAN GENERATION';
  color: var(--text);
}

[data-theme="dark"] .planner-body {
  background: rgba(0, 0, 0, 0.2);
  border: none;
}

/* ==========================================================================
   GenAI Animation
   ========================================================================== */

.genai-anim-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 40px 0;
}

.genai-anim-container {
  position: relative;
  width: 700px;
  height: 500px;
  margin: 0 auto;
  font-family: inherit;
}

/* Core Node */
.genai-core-node {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  background: #ffffff;
  border: 1px solid rgba(237, 32, 36, 0.5);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  z-index: 10;
  box-shadow: 0 0 20px rgba(237, 32, 36, 0.2), inset 0 0 10px rgba(237, 32, 36, 0.1);
  animation: genaiCorePulse 4s ease-in-out infinite;
}
[data-theme="dark"] .genai-core-node {
  background: #000000;
  backdrop-filter: blur(8px);
}

@keyframes genaiCorePulse {
  0%, 100% { box-shadow: 0 0 20px rgba(237, 32, 36, 0.2), inset 0 0 10px rgba(237, 32, 36, 0.1); }
  50% { box-shadow: 0 0 35px rgba(237, 32, 36, 0.5), inset 0 0 15px rgba(237, 32, 36, 0.2); }
}

.core-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.3;
}

.core-models {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.core-models span {
  font-size: 0.65rem;
  padding: 3px 8px;
  background: rgba(237, 32, 36, 0.1);
  color: #ed2024;
  border-radius: 20px;
  font-family: monospace;
  border: 1px solid rgba(237, 32, 36, 0.3);
}

/* Tech Nodes */
.genai-tech-node {
  position: absolute;
  width: 170px;
  background: #ffffff;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  z-index: 10;
  opacity: 0;
  animation: techNodeFadeIn 0.8s ease-out forwards;
}

[data-theme="dark"] .genai-tech-node {
  background: #000000;
  backdrop-filter: blur(4px);
}

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

.tech-abbr {
  font-size: 1rem;
  font-weight: bold;
  color: #ed2024;
  margin-bottom: 4px;
}

.tech-name {
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.2;
}

.tech-details {
  margin: 8px 0 0 0;
  padding: 0 0 0 12px;
  text-align: left;
  font-size: 0.7rem;
  color: #000000;
  list-style-type: disc;
}

[data-theme="dark"] .tech-details {
  color: #ffffff;
}

.tech-details li {
  margin-bottom: 2px;
}

/* Positioning outer nodes around the center (50%, 50%) */
.sft-node  { top: 10%; left: 10%; animation-delay: 0.5s; }
.lora-node { top: 10%; left: 90%; animation-delay: 1.0s; }
.cpt-node  { top: 50%; left: 10%; animation-delay: 1.5s; }
.rl-node   { top: 50%; left: 90%; animation-delay: 2.0s; }
.grpo-node { top: 95%; left: 50%; animation-delay: 2.5s; }

/* Connecting Lines */
.genai-line {
  position: absolute;
  background: var(--stroke);
  height: 1px;
  transform-origin: left center;
  z-index: 5;
  opacity: 0;
  animation: lineFadeIn 0.5s ease-out forwards;
}

@keyframes lineFadeIn {
  to { opacity: 0.5; }
}

/* Line Positions & Rotations (from Center to Nodes) */
/* Center is at (350, 250). 
   SFT: (140, 75). dx=-210, dy=-175. dist=273. angle=219deg 
   LoRA: (560, 75). dx=210, dy=-175. dist=273. angle=-39deg (or 320deg)
   CPT: (70, 250). dx=-280, dy=0. dist=280. angle=180deg
   RL: (630, 250). dx=280, dy=0. dist=280. angle=0deg
   GRPO: (350, 425). dx=0, dy=175. dist=175. angle=90deg
*/
.line-sft  { top: 50%; left: 50%; width: 273px; transform: rotate(-140deg); animation-delay: 0.3s; z-index: 1; }
.line-lora { top: 50%; left: 50%; width: 273px; transform: rotate(-40deg); animation-delay: 0.8s; z-index: 1; }
.line-cpt  { top: 50%; left: 50%; width: 280px; transform: rotate(180deg); animation-delay: 1.3s; z-index: 1; }
.line-rl   { top: 50%; left: 50%; width: 280px; transform: rotate(0deg); animation-delay: 1.8s; z-index: 1; }
.line-grpo { top: 50%; left: 50%; width: 200px; transform: rotate(90deg); animation-delay: 2.3s; z-index: 1; }

/* Particles */
.genai-particle {
  position: absolute;
  top: -2px;
  left: 0;
  width: 5px;
  height: 5px;
  background: #ed2024;
  border-radius: 50%;
  box-shadow: 0 0 8px 2px rgba(237, 32, 36, 0.6);
  opacity: 0;
  animation: genaiParticleMove 3s infinite;
}

@keyframes genaiParticleMove {
  0% { left: 45%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.line-sft .genai-particle { animation-delay: 0.3s; }
.line-lora .genai-particle { animation-delay: 0.8s; }
.line-cpt .genai-particle { animation-delay: 1.3s; }
.line-rl .genai-particle { animation-delay: 1.8s; }
.line-grpo .genai-particle { animation-delay: 2.3s; }

/* Responsive tweaks */
@media (max-width: 768px) {
  .genai-anim-container {
    transform: scale(0.6);
    transform-origin: top center;
    margin-bottom: -200px;
  }
}
@media (max-width: 480px) {
  .genai-anim-container {
    transform: scale(0.45);
    transform-origin: top center;
    margin-bottom: -250px;
  }
}
/* Sidebar toggle styles */
#tryme-sidebar {
  transition: width 0.3s ease;
  overflow: hidden;
}

#tryme-sidebar.collapsed {
  width: 70px !important;
  padding: 20px 10px !important;
}

#tryme-sidebar.collapsed .sidebar-text,
#tryme-sidebar.collapsed h3 {
  display: none;
}

#tryme-sidebar.collapsed .btn {
  padding: 10px;
  justify-content: center;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

#tryme-sidebar.collapsed .sidebar-header {
  justify-content: center;
}

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-toggle-btn:hover {
  color: var(--text);
}

/* Fox Toggle Hover State */
.fox-toggle:hover .fox-img {
  opacity: 0 !important;
}
.fox-toggle:hover .fox-expand-icon {
  opacity: 1 !important;
}

[data-theme="dark"] .tryme-card {
  background: var(--bg-elevated) !important;
}
[data-theme="dark"] .tryme-tabs-container {
  background: var(--bg-elevated) !important;
}
#f-chat-send:hover { transform: translateY(-50%) scale(1.05) !important; }

@keyframes flyUpLoop {
  0% { transform: translateY(0); opacity: 1; }
  40% { transform: translateY(-24px); opacity: 0; }
  41% { transform: translateY(24px); opacity: 0; }
  60% { transform: translateY(24px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

#f-chat-send:hover .send-icon-svg {
  animation: flyUpLoop 1.6s ease-in-out infinite;
}
[data-theme="dark"] .fox-logo-red-dark { filter: brightness(0) saturate(100%) invert(20%) sepia(87%) saturate(5412%) hue-rotate(338deg) brightness(97%) contrast(97%) !important; }

/* In dark mode, hide the light user icon and show the dark user icon */
.user-lottie-icon-dark { display: none; }
[data-theme="dark"] .user-lottie-icon-light { display: none; }
[data-theme="dark"] .user-lottie-icon-dark { display: block; }
