/* Shared site chrome: header, mega-menu, mobile menu, contact drawer and footer. Extracted from index.html. */
/* Language selection is off for now: English only, no dropdown. Remove this rule to bring it back. */
.language-selector { display: none !important; }

/* Header positioning does not depend on Tailwind, so pages without it still pin the header. */
header { position: fixed; top: 0; left: 0; width: 100%; z-index: 40; background: #ffffff; height: auto; padding: 0; display: block; border-bottom: none; }
/* Pages load this after their own styles so these rules take precedence. */
    .gold-gradient-bg {
      background: linear-gradient(90deg, var(--gold-primary), var(--gold-secondary));
    }

    /* Scroll progress bar: pinned to the bottom edge of the fixed header */
    #progressBar {
      position: absolute;
      top: 0;
      bottom: auto;
      left: 0;
      height: 4px;
      background: #007AFF;
    }

    header {
      font-family: 'Google Sans Flex', 'Roboto', sans-serif;
    }

    /* Arabic Modern Sans Fonts - Only for Arabic */
    .brand-name-left {
      font-family: 'Google Sans Flex', sans-serif;
      font-weight: 500;
      font-size: 21.25px;
      line-height: 1;
      letter-spacing: 0.07em;
      white-space: nowrap;
      text-transform: uppercase;
      color: #000000;
      margin-left: 0.5rem;
      position: relative;
      display: inline-block;
      cursor: default;
    }


    /* Header Scroll States */
    header {
      transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
    }

    header.header-scrolled {
      background-color: #000000;
    }

    /* Scrolled header: inverted colors. Logo swap is handled in the scroll script. */
    header.header-scrolled .brand-name-left {
      color: #ffffff;
    }

    header.header-scrolled .rd-button {
      color: #d1d5db;
    }

    header.header-scrolled .rd-button:hover {
      color: #ffffff;
    }

    header.header-scrolled .desktop-nav .pill-button.secondary {
      background: #ffffff;
      color: #000000;
      border: 2px solid #ffffff;
    }

    header.header-scrolled .desktop-nav .pill-button.secondary:hover {
      background: #d1d5db;
      color: #000000;
      border: 2px solid #d1d5db;
    }

    header.header-scrolled .language-button {
      background: #333333;
      border-color: #333333;
      color: #ffffff;
    }

    header.header-scrolled .hamburger-icon span {
      background: #ffffff;
    }


    /* Language Selector */
    .language-selector {
      position: relative;
      display: inline-block;
      margin-left: 1rem;
    }

    /* Tight coupling at hamburger transition breakpoint */
    @media (max-width: 768px) {
      .mobile-only {
        gap: 0.5rem !important;
      }
      .mobile-only .language-selector {
        margin-left: 0;
      }
    }

    /* Portrait phones: a little more space between the language selector and the hamburger */
    @media (orientation: portrait) and (max-width: 768px) {
      .mobile-only {
        gap: 0.75rem !important;
      }
    }

    /* R&D Dropdown Selector */
    .rd-selector {
      position: relative;
      display: inline-block;
      margin-left: 1rem;
    }

    .language-button {
      color: #000000;
      font-size: 0.9rem;
      font-weight: 500;
      cursor: pointer;
      display: flex;
      align-items: center;
      padding: 0.35rem 1.1rem;
      border-radius: 9999px;
      background: #f2f2f2;
      border: 2px solid #f2f2f2;
      white-space: nowrap;
      transition: background 0.3s ease, border-color 0.3s ease;
    }

    .language-button span {
      transition: color 0.3s ease;
    }

    .rd-button span {
      transition: color 0.3s ease;
    }

    .rd-button {
      color: #555555;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 0.25rem;
      padding: 0.5rem;
      transition: color 0.3s ease, background 0.3s ease;
    }

    .rd-button:hover {
      color: #000000;
    }

    .language-button:hover,
    .language-selector:has(.language-dropdown.open) .language-button {
      background: #e0e0e0;
      border-color: #e0e0e0;
      color: #000000;
    }

    .language-dropdown {
      display: none;
      position: absolute;
      top: 100%;
      right: 0;
      background: rgba(0, 0, 0, 0.85);
      backdrop-filter: blur(10px);
      border-radius: 8px 8px 12px 12px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.3);
      min-width: 150px;
      margin-top: 0.5rem;
      z-index: 50;
      border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .language-dropdown.open {
      display: block;
    }

    .language-option {
      padding: 0.75rem 1rem;
      cursor: pointer;
      transition: background 0.2s;
      color: white;
      font-weight: 600;
    }

    .language-option:hover {
      background: rgba(255, 255, 255, 0.1);
    }

    .language-option.selected {
      background: #007AFF;
      color: white;
    }

    .rd-dropdown {
      display: none;
      position: absolute;
      top: 100%;
      left: 0;
      background: rgba(255, 255, 255, 0.98);
      backdrop-filter: blur(10px);
      border-radius: 8px 8px 12px 12px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.15);
      min-width: 200px;
      margin-top: 0.5rem;
      z-index: 50;
      border: 1px solid rgba(0, 0, 0, 0.1);
    }

    .rd-dropdown.open {
      display: block;
    }

    .rd-option {
      padding: 0.75rem 1rem;
      cursor: pointer;
      transition: background 0.2s;
      color: #000000;
      font-weight: 600;
    }

    .rd-option:hover,
    .rd-option.selected {
      background: #007AFF;
      color: white;
    }

    /* Round bottom corners for last dropdown items to match panel */
    .rd-option:last-child:hover,
    .rd-option:last-child.selected {
      border-radius: 0 0 12px 12px;
    }

    .language-option:first-child {
      border-radius: 8px 8px 0 0;
    }

    .language-option:last-child {
      border-radius: 0 0 12px 12px;
    }


    /* CTA Button - 25% larger */
    .pill-button {
      padding: 1rem 2.5rem;
      border-radius: 9999px;
      font-weight: bold;
      transition: all 0.3s ease;
      border: 2px solid transparent;
      cursor: pointer;
      font-family: 'Google Sans Flex', 'Roboto', sans-serif;
      font-size: 1.125rem;
    }

    .pill-button.primary {
      background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
      color: #fff;
      border: 2px solid var(--brand-primary);
    }

    .pill-button.primary:hover {
      background: linear-gradient(135deg, var(--brand-primary-light), var(--brand-secondary-light));
      transform: translateY(-2px);
      box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }

    .pill-button.outline {
      border: 2px solid black;
      color: black;
      background: transparent;
    }

    .pill-button.outline:hover {
      background: black;
      color: white;
      border: 2px solid black;
    }

    .pill-button.secondary {
      background: #f2f2f2;
      color: black;
      border: 2px solid #f2f2f2;
    }

    .pill-button.secondary:hover {
      background: black;
      color: white;
      border: 2px solid black;
    }

    /* Socrates nav button — inverted states vs generic secondary */
    .desktop-nav .pill-button.secondary {
      background: black;
      color: white;
      border: 2px solid black;
      margin-left: 1rem;
    }

    .desktop-nav .pill-button.secondary:hover {
      background: #333333;
      color: white;
      border: 2px solid #333333;
    }
    /* Footer */
    .footer-section {
      background: #ffffff !important;
      border-top: 1px solid #e5e7eb;
      margin-left: 4rem;
      margin-right: 4rem;
    }

    .footer-bottom-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1.5rem;
      margin-bottom: 0.5rem;
    }

    .footer-copyright {
      margin: 0;
      text-align: center;
      letter-spacing: 0.07em;
    }

    .footer-link {
      color: #000000 !important;
    }

    .footer-link:hover {
      color: #007AFF !important;
    }

    .sales-email-link:hover {
      color: #C93046;
    }

    .social-icons {
      display: flex;
      justify-content: center;
      gap: 1rem;
      margin-left: 0;
      padding-left: 0;
    }

    @media (min-width: 768px) {
      .footer-bottom-container {
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        gap: 1rem;
        padding-right: 12px;
      }

      .footer-copyright {
        margin: 0;
        text-align: right;
        transform: translateY(1px);
      }

      .social-icons {
        justify-content: flex-end;
        padding-right: 0;
      }
    }

    .social-icons a .social-icon {
      stroke: #6b7280;
      fill: none;
      width: 16px;
      height: 16px;
      display: block;
      flex-shrink: 0;
      transition: stroke 0.3s ease, fill 0.3s ease;
    }

    .social-icons a:hover .social-icon {
      stroke: #000;
    }

    .social-icons a .social-icon.linkedin {
      fill: #6b7280;
      stroke: none;
    }

    .social-icons a:hover .social-icon.linkedin {
      fill: #000;
    }

    .social-icons a .social-icon.discord {
      fill: #6b7280;
      stroke: none;
    }

    .social-icons a:hover .social-icon.discord {
      fill: #000;
    }

    .footer-links a {
      text-decoration: none;
      font-size: 15.4px;
      font-weight: 700;
      color: #e0e0e0;
      margin: 0 0.75rem;
      transition: color 0.3s ease;
    }

    .footer-links a:hover {
      color: var(--gold-secondary);
    }

    .minilogo {
      width: 34px;
      height: 34px;
      transition: transform 0.3s ease;
    }

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

    .minilogo:hover {
      transform: scale(1.1);
    }

    .partners-grid-fourths {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 1.5rem;
      align-items: center;
      justify-items: center;
    }

    .partner-logo {
      max-width: 120px;
      height: auto;
      transition: transform 0.3s ease;
    }

    .partner-logo:hover {
      transform: scale(1.1);
    }

    .hamburger-menu {
      display: none;
      cursor: pointer;
    }

    .hamburger-icon {
      width: 30px;
      height: 20px;
      position: relative;
      transition: .5s ease-in-out;
    }

    .hamburger-icon span {
      display: block;
      position: absolute;
      height: 3px;
      width: 100%;
      background: #000000;
      border-radius: 9px;
      opacity: 1;
      left: 0;
      transition: .25s ease-in-out;
    }

    .hamburger-icon span:nth-child(1) { top: 0px; }
    .hamburger-icon span:nth-child(2) { top: 8px; }
    .hamburger-icon span:nth-child(3) { top: 16px; }

    .hamburger-icon.open span:nth-child(1) {
      top: 8px;
      transform: rotate(135deg);
    }

    .hamburger-icon.open span:nth-child(2) {
      opacity: 0;
      left: -60px;
    }

    .hamburger-icon.open span:nth-child(3) {
      top: 8px;
      transform: rotate(-135deg);
    }

    .mobile-nav {
      display: none;
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      width: 100%;
      background: #000;
      padding: 1.25rem 2rem 2rem;
      z-index: 30;
    }

    .mobile-nav.open {
      display: block;
    }

    .mobile-nav-section {
      margin-bottom: 1.25rem;
    }

    .mobile-nav-heading {
      font-family: 'Google Sans Flex', sans-serif;
      font-size: 0.75rem;
      font-weight: 600;
      color: #ffffff;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      margin: 0 0 0.5rem 0;
      padding: 0;
    }

    .mobile-nav-link {
      display: block;
      padding: 0.45rem 0;
      color: #8B8B8B;
      text-decoration: none;
      font-family: 'Google Sans Flex', sans-serif;
      font-size: 1rem;
      font-weight: 500;
      transition: color 0.2s ease;
    }

    .mobile-nav-link:hover {
      color: #007AFF;
    }
/* Mobile header: hamburger and mobile-only controls */
.mobile-only { display: none; }
@media (max-width: 768px) {
  .hamburger-menu { display: flex; align-items: center; }
  nav.desktop-nav { display: none; }
  .mobile-only { display: flex; align-items: center; }
}

    /* Footer language selector: sits bottom right on desktop and opens upward */
    .footer-language {
      margin-left: 0;
      grid-row: 1;
      grid-column: 3;
      justify-self: end;
    }
    .footer-language .language-dropdown {
      top: auto;
      bottom: 100%;
      margin-bottom: 0.5rem;
    }
    /* The language selector lives in the footer at every width; hide the header copies */
    header .language-selector {
      display: none !important;
    }

    /* Desktop footer: same 16px edge inset as the header, so the footer's left and right edges line up with the header's */
    @media (min-width: 1024px) {
      .footer-section {
        margin-left: 0;
        margin-right: 0;
      }
      .footer-section > div {
        max-width: none;
      }
    }

    /* Desktop footer bottom row: social icons on the left, copyright centered on the same line */
    @media (min-width: 1024px) {
      .footer-bottom-container {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 1rem;
        padding-right: 0;
      }
      .footer-bottom-container .social-icons {
        grid-row: 1;
        grid-column: 1;
        justify-self: start;
        justify-content: flex-start;
        padding-right: 0;
      }
      .footer-bottom-container .footer-copyright {
        grid-row: 1;
        grid-column: 2;
        text-align: center;
        transform: none;
      }
    }

    /* Contact drawer: a clean panel from the right, with generous white space */
    .contact-drawer {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0);
      pointer-events: none;
      transition: background 0.3s ease;
      z-index: 100;
    }
    .contact-drawer.open {
      background: rgba(0, 0, 0, 0.35);
      pointer-events: auto;
    }
    .contact-drawer-panel {
      position: absolute;
      top: 0;
      left: 0;
      height: 100%;
      width: min(420px, 100%);
      background: #ffffff;
      padding: 3rem 2.5rem;
      box-sizing: border-box;
      transform: translateX(-100%);
      transition: transform 0.35s ease;
      box-shadow: 8px 0 24px rgba(0, 0, 0, 0.08);
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
    }
    .contact-drawer.open .contact-drawer-panel {
      transform: translateX(0);
    }
    .contact-drawer-close {
      position: absolute;
      top: 1rem;
      right: 1.25rem;
      background: none;
      border: none;
      font-size: 2rem;
      line-height: 1;
      cursor: pointer;
      color: #000000;
    }
    .contact-drawer-title {
      font-family: 'Google Sans Flex', sans-serif;
      font-size: 1.5rem;
      font-weight: 600;
      color: #111827;
      margin: 0;
    }
    .contact-drawer-form {
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
    }
    .contact-drawer-label {
      font-family: 'Google Sans Flex', sans-serif;
      font-size: 0.95rem;
      font-weight: 500;
      color: #6B7280;
    }
    .contact-drawer-form input {
      padding: 0.8rem 1.25rem;
      border: 2px solid #e5e7eb;
      border-radius: 9999px;
      font-size: 1rem;
    }
    .contact-drawer-form input:focus {
      outline: none;
      border-color: #000000;
    }
    .contact-drawer-form button {
      margin-top: 0.75rem;
      padding: 0.8rem 1.5rem;
      background: #000000;
      color: #ffffff;
      border: none;
      border-radius: 9999px;
      font-size: 1rem;
      font-weight: 600;
      cursor: pointer;
    }
    .contact-drawer-form button:hover:not(:disabled) {
      background: #333333;
    }

    /* CTA under the hero: equal space above (from the hero) and below (to the trio caption, which adds 3rem) */
    #cta-under-hero {
      padding-top: 2.5rem;
      padding-bottom: 0;
    }

    /* Header 2-column flex layout */
    .header-row {
      width: 100%;
      padding-left: 1rem;
      padding-right: 1rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .header-center-nav {
      display: flex;
      align-items: center;
      margin-left: 2rem;
      gap: 1rem;
      margin-right: 0;
    }

    .header-center-nav .rd-selector {
      margin-left: 0;
    }

    .header-center-nav .rd-selector::after {
      content: '';
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      height: 1rem;
    }

    .header-center-nav .rd-dropdown {
      display: block;
      visibility: hidden;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.15s ease, visibility 0s linear 0.05s;
    }

    .header-center-nav .rd-selector:hover .rd-dropdown {
      visibility: visible;
      opacity: 1;
      pointer-events: auto;
      transition: opacity 0.15s ease, visibility 0s;
    }

    /* Full-width menu panel under the header: white, generous space, items in a left column.
       Opens for Products, Solutions, and R&D on hover or click. The hamburger menu is unchanged. */
    .header-center-nav .rd-selector {
      position: static;
    }
    .header-center-nav .rd-dropdown {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      width: auto;
      min-width: 0;
      margin: 0;
      box-sizing: border-box;
      background: #ffffff;
      border: none;
      border-radius: 0;
      box-shadow: none;
      padding: 1.25rem 2.5rem 1.5rem;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 0.5rem;
      z-index: 45;
    }
    .header-center-nav .rd-dropdown .rd-option {
      display: block;
      padding: 0.45rem 0;
      text-align: left;
      color: #000000;
      font-size: 18px;
      font-weight: 500;
      background: none;
      border-radius: 0;
      white-space: nowrap;
      cursor: pointer;
    }
    .header-center-nav .rd-dropdown .rd-option:hover {
      background: none;
      color: #007AFF;
    }

    /* Category label at the top of each menu panel */
    .header-center-nav .rd-dropdown .rd-category {
      font-size: 14px;
      font-weight: 500;
      color: #6B7280;
      padding: 0;
      margin: 0;
    }
    header.header-scrolled .header-center-nav .rd-dropdown .rd-category {
      color: #9CA3AF;
    }

    /* Header Contact Sales button: light gray at the top, dark gray with white text when scrolled */
    header .header-contact {
      padding: 0.35rem 1.1rem;
      font-size: 0.9rem;
      font-weight: 500;
      border-radius: 9999px;
      background: #f2f2f2;
      color: #000000;
      border: 2px solid #f2f2f2;
      white-space: nowrap;
      cursor: pointer;
      transition: background 0.3s ease, color 0.3s ease;
    }
    header .header-contact:hover {
      background: #e0e0e0;
      border-color: #e0e0e0;
    }
    header.header-scrolled .header-contact {
      background: #333333;
      color: #ffffff;
      border-color: #333333;
    }
    header.header-scrolled .header-contact:hover {
      background: #4a4a4a;
      border-color: #4a4a4a;
    }

    /* Scrolled header: the menu panel turns black with white text */
    header.header-scrolled .header-center-nav .rd-dropdown {
      background: #000000;
    }
    header.header-scrolled .header-center-nav .rd-dropdown .rd-option {
      color: #ffffff;
    }
    header.header-scrolled .header-center-nav .rd-dropdown .rd-option:hover {
      color: #007AFF;
    }

    @media (max-width: 768px) {
      .header-center-nav {
        display: none;
      }
      .header-row {
        grid-template-columns: 1fr 1fr;
      }
    }

