/* ARRAC.IO — Shared site chrome: top nav, footer, buttons, scroll-reveal.
   Uses CSS custom properties from brand.css for light/dark theming.
   brand.css must be loaded after this file on every page. */

/* ── BUTTONS ── */
.btn-primary {
  background: var(--brand-crimson);
  color: #fff;
  font-family: 'Inter', 'Barlow Condensed', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s, box-shadow 0.2s;
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--brand-crimson) 90%, black);
  box-shadow: 0 0 20px rgba(200,39,45,0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--brand-ice);
  font-family: 'Inter', 'Barlow Condensed', sans-serif;
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--brand-ice);
  cursor: pointer;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

/* ── NAV ── */
.site-nav {
  background: var(--nav-bg, rgba(255,255,255,0.96));
  border-bottom: 1px solid var(--nav-border, var(--surface-border));
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 0;
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.2s;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-wordmark {
  font-family: 'Space Grotesk', 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 3px;
  color: var(--text-primary);
  transition: color 0.2s;
}
.nav-dot { color: var(--brand-ice); }
.nav-io  { color: var(--brand-crimson); }

.nav-links {
  display: flex;
  gap: 1.75rem;
  margin-left: 2.5rem;
  list-style: none;
}
.nav-links a {
  font-family: 'Inter', 'Barlow Condensed', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active {
  color: var(--text-primary);
  border-bottom-color: var(--brand-crimson);
}

.nav-right {
  margin-left: auto;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.nav-login {
  font-family: 'Inter', 'Barlow Condensed', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--brand-royal);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-login:hover { color: var(--text-primary); }

.nav-cta {
  font-size: 0.8rem !important;
  padding: 0.45rem 1.1rem !important;
}

/* ── THEME TOGGLE ── */
.theme-toggle {
  background: rgba(155,207,232,0.07);
  border: 1px solid rgba(155,207,232,0.25);
  border-radius: 6px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: rgba(155,207,232,0.15);
  border-color: var(--brand-ice);
  color: var(--text-primary);
}
/* In light mode, show moon (to go dark); in dark mode, show sun (to go light) */
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none;  }
html.dark .theme-toggle .icon-moon { display: none;  }
html.dark .theme-toggle .icon-sun  { display: block; }

/* ── HAMBURGER (mobile only) ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: 0.5rem;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}
/* Animate to × when open */
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE MENU ── */
.mobile-menu {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--brand-navy);
  border-bottom: 2px solid var(--brand-crimson);
  padding: 1.25rem 2rem 1.5rem;
  z-index: 199;
  flex-direction: column;
  gap: 0;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu a {
  font-family: 'Inter', 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  transition: color 0.15s;
  display: block;
}
.mobile-menu a:hover { color: var(--brand-ice); }
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu-divider {
  height: 1px;
  background: rgba(255,255,255,0.12);
  margin: 0.75rem 0;
}
.mobile-menu-login {
  color: var(--brand-ice) !important;
  font-weight: 600 !important;
}
.mobile-menu-cta {
  margin-top: 0.25rem;
  display: inline-block !important;
  background: var(--brand-crimson) !important;
  color: #fff !important;
  padding: 0.65rem 1.25rem !important;
  border-radius: 4px;
  border: none !important;
  font-weight: 700 !important;
}
.mobile-menu-cta:hover { opacity: 0.9; }

/* ── FOOTER ── */
.site-footer {
  background: var(--brand-navy);
  border-top: 1px solid var(--surface-border);
  padding: 3rem 2rem 2rem;
}
.footer-grid {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand {
  font-family: 'Space Grotesk', 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: #EEF4FA;
  letter-spacing: 2px;
  margin-bottom: 0.3rem;
}
.footer-brand span { color: var(--brand-crimson); }
.footer-tagline {
  font-family: 'JetBrains Mono', 'Share Tech Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 2px;
  color: #4a6070;
  margin-bottom: 1rem;
  display: block;
}
.footer-about { font-size: 0.82rem; color: #6a7a8a; line-height: 1.65; }
.footer-col-title {
  font-family: 'JetBrains Mono', 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: #4a6070;
  margin-bottom: 0.875rem;
  display: block;
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0;
  margin: 0;
}
.footer-links a { color: #8A9AB0; font-size: 0.85rem; text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: #EEF4FA; }
.footer-bottom {
  max-width: 960px;
  margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.footer-legal {
  font-family: 'JetBrains Mono', 'Share Tech Mono', monospace;
  font-size: 0.62rem;
  color: #4a6070;
  letter-spacing: 0.75px;
}
.footer-socials { display: flex; gap: 1.1rem; }
.footer-socials a {
  font-family: 'JetBrains Mono', 'Share Tech Mono', monospace;
  font-size: 0.62rem;
  color: #4a6070;
  text-decoration: none;
  letter-spacing: 0.75px;
  transition: color 0.15s;
}
.footer-socials a:hover { color: #8A9AB0; }

/* ── NAV DROPDOWN ── */
.nav-has-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-dropdown-toggle {
  font-family: 'Inter', 'Barlow Condensed', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  padding: 4px 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: color 0.15s;
}
.nav-dropdown-toggle:hover { color: var(--text-primary); }
.nav-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--nav-bg, rgba(255,255,255,0.98));
  border: 1px solid var(--nav-border, var(--surface-border));
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 0.4rem;
  min-width: 240px;
  list-style: none;
  opacity: 0;
  pointer-events: none;
  /* 200ms delay before hiding — gives mouse time to travel into the panel */
  transition: opacity 0.15s ease 0.2s, transform 0.15s ease 0.2s;
  z-index: 300;
}
.nav-has-dropdown:hover .nav-dropdown,
.nav-has-dropdown:focus-within .nav-dropdown,
.nav-has-dropdown.dropdown-open .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  /* open immediately, no delay */
  transition: opacity 0.15s ease, transform 0.15s ease;
}
/* Invisible bridge fills the gap between button and panel so hover isn't lost */
.nav-has-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -20px;
  right: -20px;
  height: 16px;
}
.nav-dropdown li a {
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  border-bottom: none !important;
  padding-bottom: 0.55rem !important;
  transition: background 0.12s;
}
.nav-dropdown li a:hover { background: rgba(155,207,232,0.09); color: inherit; }
.nav-dropdown li a strong {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
}
.nav-dropdown li a span {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 2px;
  display: block;
  white-space: nowrap;
}

/* ── MOBILE SOLUTIONS ACCORDION ── */
.mobile-solutions-accordion {
  display: flex;
  flex-direction: column;
}
.mobile-solutions-toggle {
  font-family: 'Inter', 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 0.65rem 0;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
}
.mobile-solutions-items {
  display: none;
  flex-direction: column;
  padding-left: 1rem;
  background: rgba(0,0,0,0.15);
}
.mobile-solutions-items.open { display: flex; }
.mobile-solutions-items a {
  font-size: 0.9rem !important;
  color: rgba(255,255,255,0.75) !important;
  border-bottom: 1px solid rgba(255,255,255,0.04) !important;
  padding: 0.55rem 0 !important;
}

/* ── REVEAL ON SCROLL ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  /* override hidden attribute on mobile */
  .mobile-menu { display: flex !important; }
}
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .site-nav { padding: 0 1.25rem; }
}
