/* Bit Space — shared base styles: accessibility, mobile navigation, polish.
   Loaded before each page's inline <style>, which retains source-of-truth overrides. */

/* Keep anchor scrolling clear of the fixed nav */
html { scroll-padding-top: 84px; }

/* Unified keyboard focus indicator */
:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.55);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Skip-to-content link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--indigo, #4f46e5);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 10px 0;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* Mobile menu toggle button */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.2s;
}
.nav-toggle:hover { background: rgba(79, 70, 229, 0.08); }
.nav-toggle .bar {
  width: 22px;
  height: 2.5px;
  background: var(--text, #1a1714);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* FAQ questions rendered as buttons (Pricing & Process) */
.faq-q {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}

/* Mobile navigation */
@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: rgba(248, 247, 244, 0.98);
    backdrop-filter: blur(20px);
    padding: 14px 5% 22px;
    border-bottom: 1px solid var(--border, rgba(26, 23, 20, 0.1));
    box-shadow: 0 24px 40px rgba(26, 23, 20, 0.12);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 11px 10px;
    border-radius: 9px;
  }
  .nav-links a.nav-cta { margin-top: 6px; text-align: center; }

  body.nav-open { overflow: hidden; }
  body.nav-open .nav-links { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
  body.nav-open .nav-toggle .bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  body.nav-open .nav-toggle .bar:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle .bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
}

@media (min-width: 641px) and (max-width: 1080px) {
  .site-header nav { position: relative !important; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 14px 5% 22px;
    background: #fff;
    border-bottom: 1px solid var(--border, #dbe3ed);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav-links li { width: 100%; }
  .nav-links > li > a,
  .nav-menu-trigger {
    display: flex;
    width: 100%;
    align-items: center;
    padding: 11px 10px;
    text-align: left;
  }
  .nav-links a.nav-cta { justify-content: center; margin-top: 6px; }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav-links {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    visibility: visible;
  }
  body.nav-open .nav-toggle .bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  body.nav-open .nav-toggle .bar:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle .bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal.visible { transform: none !important; }
}

/* Demo request modal */
body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 16, 40, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: #fff;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  padding: 34px 32px 30px;
  position: relative;
  box-shadow: 0 32px 80px rgba(26, 23, 20, 0.25);
  transform: translateY(16px);
  transition: transform 0.25s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(26, 23, 20, 0.1));
  background: var(--surface, #fafaf8);
  color: var(--muted, #7a746e);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover { background: var(--rose-soft, #fff1f2); color: var(--rose, #e11d48); }
.modal-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--indigo, #4f46e5);
  margin-bottom: 6px;
}
.modal-title {
  font-family: 'Inter Tight', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text, #1a1714);
  line-height: 1.2;
}
.modal-sub {
  font-size: 0.85rem;
  color: var(--muted, #7a746e);
  line-height: 1.7;
  margin: 8px 0 20px;
}
.modal-field { margin-bottom: 14px; }
.modal-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2, #3d3935);
  margin-bottom: 6px;
}
.modal-field input,
.modal-field select,
.modal-field textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text, #1a1714);
  background: var(--surface, #fafaf8);
  border: 1px solid var(--border, rgba(26, 23, 20, 0.1));
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus {
  outline: none;
  border-color: var(--indigo, #4f46e5);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.modal-field textarea { resize: vertical; min-height: 72px; }
.modal-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a746e' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}
.modal-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--indigo, #4f46e5);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 13px 20px;
  margin-top: 6px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 2px 16px rgba(79, 70, 229, 0.35);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.modal-submit:hover {
  background: var(--indigo-dark, #3730a3);
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(79, 70, 229, 0.4);
}
.modal-note {
  text-align: center;
  font-size: 0.74rem;
  color: var(--muted, #7a746e);
  margin-top: 12px;
}
.modal-success { text-align: center; padding: 12px 0 4px; }
.modal-success .success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--teal-soft, #f0fdfa);
  color: var(--teal, #0d9488);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 800;
}
.modal-success h3 {
  font-family: 'Inter Tight', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text, #1a1714);
  margin-bottom: 8px;
}
.modal-success p {
  font-size: 0.88rem;
  color: var(--muted, #7a746e);
  line-height: 1.7;
  margin-bottom: 20px;
}
@media (max-width: 480px) {
  .modal-overlay { padding: 16px; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: 20px 20px 0 0; padding: 28px 22px 24px; }
}

/* UI polish: nav scroll state, selection, link underline, buttons, scroll cue, back-to-top */
nav {
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
body.scrolled nav {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 24px rgba(26, 23, 20, 0.08);
  border-bottom-color: transparent;
}

::selection { background: rgba(79, 70, 229, 0.18); color: var(--indigo, #4f46e5); }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }

/* Animated underline for nav links (excludes the pill CTA) */
.nav-links a { position: relative; }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--indigo, #4f46e5);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-links a.nav-cta::after { display: none; }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

/* Press state on primary-style buttons */
.btn-primary:active,
.btn-secondary:active,
.btn-white:active,
.btn-outline-white:active,
.modal-submit:active { transform: translateY(0) scale(0.98); }

/* Hero scroll-down cue */
.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  pointer-events: none;
}
.scroll-cue .mouse {
  width: 24px;
  height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  position: relative;
}
.scroll-cue .mouse::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.85);
  animation: scrollDot 1.6s ease-in-out infinite;
}
@keyframes scrollDot {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(12px); }
}

/* Back-to-top button */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 150;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--indigo, #4f46e5);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(79, 70, 229, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background 0.2s ease;
}
.to-top:hover { background: var(--indigo-dark, #3730a3); }
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
@media (max-width: 640px) {
  .to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; }
  .scroll-cue { display: none; }
}