:root {
  --servxx-focus: #22d3ee;
  --servxx-cyan: #22d3ee;
  --servxx-radius: 1.25rem;
}

.servxx-body {
  font-family: "Assistant", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  min-height: 100vh;
}

html:not(.dark) .servxx-body {
  background:
    radial-gradient(1200px 520px at 8% -12%, rgba(6, 182, 212, 0.14), transparent 58%),
    radial-gradient(900px 400px at 100% 10%, rgba(59, 130, 246, 0.08), transparent 50%),
    #f8fafc;
}

html.dark .servxx-body {
  background:
    radial-gradient(1100px 520px at 92% -18%, rgba(6, 182, 212, 0.2), transparent 55%),
    radial-gradient(900px 420px at -5% 35%, rgba(37, 99, 235, 0.14), transparent 52%),
    #0b1220;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100px;
  z-index: 100;
  border-radius: 0.5rem;
  background: #0891b2;
  color: #042f2e;
  padding: 0.75rem 1rem;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.focus-ring:focus-visible {
  outline: 3px solid var(--servxx-focus);
  outline-offset: 2px;
}

.icon {
  display: inline-block;
  width: 1.15rem;
  height: 1.15rem;
  stroke-width: 2;
  flex-shrink: 0;
  vertical-align: middle;
}

.icon-lg {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  vertical-align: middle;
}

.icon-xl {
  display: inline-block;
  width: 1.75rem;
  height: 1.75rem;
  vertical-align: middle;
}

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.9rem;
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.2), rgba(37, 99, 235, 0.15));
  color: #0891b2;
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.nav-sep {
  display: none;
  width: 1px;
  height: 1.5rem;
  flex-shrink: 0;
  align-self: center;
  background-color: rgb(226 232 240); /* slate-200 — same as former tools border */
}

html.dark .nav-sep {
  background-color: rgb(51 65 85); /* slate-700 */
}

.site-header > nav {
  /* Flush brand edge (right in RTL, left in LTR); keep inset on tools side */
  padding-inline-start: 0 !important;
  padding-inline-end: 1rem;
}

.brand-link {
  padding: 0;
  margin: 0;
  /* Hebrew: left 3px · English: right 3px (toward the menu) */
  padding-inline-end: 3px;
}

.brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  color: #0f172a;
}

html.dark .brand-name {
  color: #f8fafc;
}

.brand-initial {
  font-size: 1.45em;
  font-weight: 800;
  line-height: 0.9;
  color: #eab308; /* yellow-500 */
  margin-inline-end: 0.02em;
}

html.dark .brand-initial {
  color: #facc15; /* yellow-400 */
}

@media (min-width: 768px) {
  .nav-sep {
    display: block;
  }

  /* Flatten menu so: brand | links | tools become nav flex children */
  .site-header #primary-menu {
    display: contents !important;
  }

  .site-header .nav-links {
    display: flex;
    flex: 1 1 auto;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .site-header .nav-tools {
    flex-shrink: 0;
    margin-top: 0;
    border-top: 0;
    padding-top: 0;
  }
}

html.dark .icon-badge {
  color: #67e8f9;
  border-color: rgba(34, 211, 238, 0.3);
}

.feature-panel {
  border: 1px solid rgb(226 232 240);
  background: rgba(255, 255, 255, 0.78);
  border-radius: var(--servxx-radius);
  padding: 1.35rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

html.dark .feature-panel {
  border-color: rgb(30 41 59 / 0.95);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.04);
}

.feature-panel:hover {
  transform: translateY(-3px);
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 12px 40px rgba(6, 182, 212, 0.08);
}

/* Product thumbs: height follows card width */
.app-thumb {
  overflow: hidden;
  border-radius: 0.75rem;
  aspect-ratio: 16 / 9;
}

.app-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.page-hero-media {
  width: 100%;
  border-radius: var(--servxx-radius);
  overflow: hidden;
  border: 1px solid rgb(226 232 240);
  aspect-ratio: 16 / 9;
  background: #0f172a;
}

html.dark .page-hero-media {
  border-color: rgb(30 41 59);
}

.page-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Carousel */
.carousel {
  position: relative;
  border-radius: calc(var(--servxx-radius) + 0.25rem);
  overflow: hidden;
  border: 1px solid rgb(226 232 240);
  background: #0b1220;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.35);
}

html.dark .carousel {
  border-color: rgba(51, 65, 85, 0.8);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(34, 211, 238, 0.08);
}

.carousel-viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  direction: ltr;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.carousel-slide {
  position: relative;
  min-width: 100%;
  height: 100%;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 2.5rem 1.25rem 1.25rem;
  background: linear-gradient(transparent, rgba(2, 6, 23, 0.88));
  color: #f8fafc;
}

.carousel-caption h2 {
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  font-weight: 700;
  margin: 0;
}

.carousel-caption-link {
  color: inherit;
  text-decoration: none;
  border-radius: 0.25rem;
}

.carousel-caption-link:hover,
.carousel-caption-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.carousel-caption p {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: #cbd5e1;
  max-width: 36rem;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.carousel-btn:hover {
  background: rgba(8, 145, 178, 0.85);
  border-color: rgba(34, 211, 238, 0.5);
}

.carousel-btn.prev {
  inset-inline-start: 0.75rem;
}

.carousel-btn.next {
  inset-inline-end: 0.75rem;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.85rem 0.5rem 1rem;
  background: rgba(2, 6, 23, 0.92);
}

.carousel-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: #64748b;
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.carousel-dot[aria-current="true"] {
  width: 1.4rem;
  background: #22d3ee;
}

.cta-row a,
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-primary {
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #0891b2, #2563eb);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.7rem 1.2rem;
  box-shadow: 0 10px 28px rgba(8, 145, 178, 0.28);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  border-radius: 0.75rem;
  border: 1px solid rgb(203 213 225);
  background: rgba(255, 255, 255, 0.75);
  color: #0f172a;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.7rem 1.2rem;
}

html.dark .btn-secondary {
  border-color: rgb(71 85 105);
  background: rgba(15, 23, 42, 0.7);
  color: #f1f5f9;
}

.btn-secondary:hover {
  border-color: rgba(6, 182, 212, 0.55);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0e7490;
}

html.dark .link-arrow {
  color: #67e8f9;
}

.link-arrow:hover {
  text-decoration: underline;
}

.prose-servxx h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

.prose-servxx p,
.prose-servxx li {
  line-height: 1.7;
  color: rgb(71 85 105);
}

html.dark .prose-servxx p,
html.dark .prose-servxx li {
  color: rgb(203 213 225);
}

/* Dark mode: force readable headings (Flowbite/base can leave near-black text) */
html.dark main h1,
html.dark main h2,
html.dark main h3,
html.dark main h4,
html.dark main h5,
html.dark main h6,
html.dark .prose-servxx h1,
html.dark .prose-servxx h2,
html.dark .prose-servxx h3,
html.dark footer .text-slate-900,
html.dark header .text-slate-900 {
  color: #f8fafc !important;
}

html.dark footer h2 {
  color: #94a3b8 !important;
}

html.dark .carousel-caption h2 {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

html.dark .carousel-caption p {
  color: #e2e8f0 !important;
}

html.dark body.servxx-body {
  color: #e2e8f0;
}

/* Header + footer: force dark surfaces (Tailwind dark: utilities may lose to Flowbite) */
html.dark header.site-header,
html.dark header.site-header #primary-menu {
  background-color: rgba(2, 6, 23, 0.94) !important;
  border-color: #1e293b !important;
  color: #f1f5f9 !important;
}

html.dark header.site-header #primary-menu {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

@media (min-width: 768px) {
  html.dark header.site-header #primary-menu {
    background-color: transparent !important;
    box-shadow: none;
    border-color: transparent !important;
  }
}

html.dark header.site-header a,
html.dark header.site-header button {
  color: #e2e8f0;
}

html.dark header.site-header a:hover,
html.dark header.site-header button:hover {
  background-color: rgba(30, 41, 59, 0.85);
}

html.dark header.site-header a[aria-current="page"] {
  background-color: rgba(34, 211, 238, 0.15);
  color: #67e8f9;
}

html.dark footer.site-footer {
  background-color: #020617 !important;
  border-color: #1e293b !important;
  color: #cbd5e1 !important;
}

html.dark footer.site-footer a {
  color: #67e8f9;
}

html.dark footer.site-footer a:not([href^="tel"]):not([href^="mailto"]) {
  color: #e2e8f0;
}

html.dark footer.site-footer .footer-meta {
  border-color: #1e293b !important;
  color: #94a3b8 !important;
}

/* Contact / form controls in dark mode */
html.dark #contact-form input:not([type="hidden"]),
html.dark #contact-form textarea,
html.dark .form-control {
  background-color: #0b1220 !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
  color-scheme: dark;
}

html.dark #contact-form input::placeholder,
html.dark #contact-form textarea::placeholder,
html.dark .form-control::placeholder {
  color: #94a3b8 !important;
}

html.dark #contact-form input:focus,
html.dark #contact-form textarea:focus,
html.dark .form-control:focus {
  border-color: #22d3ee !important;
  background-color: #020617 !important;
}

html.dark #contact-form label {
  color: #e2e8f0 !important;
}

.prose-servxx ul {
  list-style: disc;
  padding-inline-start: 1.25rem;
  margin: 0.75rem 0;
}

.stack-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 0.65rem;
  border: 1px solid rgb(203 213 225);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.7);
}

html.dark .stack-chip {
  border-color: rgb(51 65 85);
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.7);
}

.arch-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.arch-node {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 0.75rem;
  border: 1px solid rgb(203 213 225);
  padding: 0.55rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.75);
}

html.dark .arch-node {
  border-color: rgb(51 65 85);
  background: rgba(15, 23, 42, 0.75);
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track,
  .feature-panel,
  .carousel-dot {
    transition: none !important;
  }

  .feature-panel:hover {
    transform: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* Accessibility floating widget */
.a11y-widget {
  position: fixed;
  inset-inline-end: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.a11y-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 2px solid #fff;
  background: linear-gradient(145deg, #0891b2, #1d4ed8);
  color: #fff;
  box-shadow: 0 8px 22px rgba(8, 145, 178, 0.4);
  cursor: pointer;
}

.a11y-fab .icon-xl {
  width: 1.35rem;
  height: 1.35rem;
}

.a11y-fab:hover {
  filter: brightness(1.08);
}

.a11y-panel {
  width: min(20rem, calc(100vw - 2rem));
  border-radius: 1rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.28);
  overflow: hidden;
}

html.dark .a11y-panel {
  border-color: #334155;
  background: #0f172a;
  color: #f8fafc;
}

.a11y-panel[hidden] {
  display: none !important;
}

.a11y-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

html.dark .a11y-panel-head {
  border-bottom-color: #334155;
  background: #111827;
}

.a11y-panel-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: inherit !important;
}

.a11y-panel-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem;
}

.a11y-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
}

html.dark .a11y-label {
  color: #94a3b8;
}

.a11y-font-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: center;
}

.a11y-font-value {
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.a11y-action,
.a11y-reset,
.a11y-toggle-row,
.a11y-icon-btn {
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: inherit;
}

html.dark .a11y-action,
html.dark .a11y-reset,
html.dark .a11y-toggle-row,
html.dark .a11y-icon-btn {
  border-color: #475569;
  background: #1e293b;
}

.a11y-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 0.65rem;
  padding: 0.55rem 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
}

.a11y-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  padding: 0;
}

.a11y-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  border-radius: 0.75rem;
  padding: 0.7rem 0.8rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: start;
}

.a11y-switch {
  width: 2.4rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #94a3b8;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.a11y-switch::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  inset-inline-start: 0.15rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: #fff;
  transition: inset-inline-start 0.2s ease;
}

.a11y-toggle-row[aria-pressed="true"] .a11y-switch {
  background: #0891b2;
}

.a11y-toggle-row[aria-pressed="true"] .a11y-switch::after {
  inset-inline-start: calc(100% - 1.2rem);
}

.a11y-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 0.75rem;
  padding: 0.65rem;
  font-weight: 700;
  font-size: 0.875rem;
}

.a11y-statement {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0e7490;
  text-decoration: underline;
  border-radius: 0.35rem;
}

html.dark .a11y-statement {
  color: #67e8f9;
}

/* Accessibility modes */
html.a11y-contrast,
html.a11y-contrast body {
  background: #000 !important;
  color: #fff !important;
}

html.a11y-contrast .feature-panel,
html.a11y-contrast .a11y-panel,
html.a11y-contrast header,
html.a11y-contrast footer,
html.a11y-contrast .carousel,
html.a11y-contrast .page-hero-media {
  background: #000 !important;
  border-color: #fff !important;
  color: #fff !important;
  box-shadow: none !important;
}

html.a11y-contrast a {
  color: #ffff00 !important;
}

html.a11y-contrast .btn-primary,
html.a11y-contrast .a11y-fab {
  background: #ffff00 !important;
  color: #000 !important;
  border-color: #fff !important;
}

html.a11y-contrast main h1,
html.a11y-contrast main h2,
html.a11y-contrast main h3,
html.a11y-contrast main h4 {
  color: #fff !important;
}

html.a11y-underline a {
  text-decoration: underline !important;
  text-underline-offset: 0.18em;
}

html.a11y-readable,
html.a11y-readable body,
html.a11y-readable .servxx-body {
  font-family: Arial, Helvetica, sans-serif !important;
  letter-spacing: 0.02em;
  word-spacing: 0.06em;
  line-height: 1.7;
}
