/* ==========================================================================
   WebTribe — Core Stylesheet
   Tokens · Base · Typography · Navigation · Footer · Buttons · Utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --bg: #05070d;
  --bg-elev: #090e1a;
  --surface: #0c1220;
  --surface-2: #101828;
  --surface-3: #16203a;

  /* Borders */
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);

  /* Text */
  --text: #eef2f8;
  --text-2: #a9b4c8;
  --text-3: #6d7b94;

  /* Accent — electric cyan leaning blue */
  --cyan: #22d3ee;
  --sky: #38bdf8;
  --blue: #2563eb;
  --grad: linear-gradient(120deg, var(--cyan) 0%, var(--sky) 45%, var(--blue) 110%);
  --grad-soft: linear-gradient(120deg, rgba(34, 211, 238, 0.14), rgba(37, 99, 235, 0.14));
  --glow: 0 0 24px rgba(34, 211, 238, 0.35);

  /* Semantic */
  --success: #34d399;
  --danger: #f87171;

  /* Typography */
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;

  /* Layout */
  --container: 1160px;
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --section-pad: clamp(4.5rem, 9vw, 7.5rem);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --nav-h: 76px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 160ms;
  --t-med: 260ms;
  --t-slow: 450ms;

  /* Elevation */
  --shadow-card: 0 8px 30px rgba(2, 6, 16, 0.45);
  --shadow-card-hover: 0 16px 48px rgba(2, 6, 16, 0.6), 0 0 0 1px rgba(56, 189, 248, 0.18);

  /* Z-index scale */
  --z-nav: 100;
  --z-dropdown: 110;
  --z-drawer: 120;
  --z-toast: 200;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.13), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(34, 211, 238, 0.05), transparent 60%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle grid texture behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 75%);
  pointer-events: none;
}

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

a {
  color: var(--sky);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

a:hover {
  color: var(--cyan);
}

::selection {
  background: rgba(34, 211, 238, 0.28);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 300;
  padding: 0.75rem 1.25rem;
  background: var(--surface-3);
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: top var(--t-med) var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.25rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  letter-spacing: -0.025em;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1rem;
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--text-2);
  line-height: 1.7;
  max-width: 62ch;
}

.text-grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Section eyebrow label */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1.1rem;
}

.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--grad);
}

.section {
  padding: var(--section-pad) 0;
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-head.center .eyebrow::before {
  display: none;
}

.section-head.center .eyebrow::after {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--grad);
}

.section-head p {
  color: var(--text-2);
  font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-wide {
  max-width: 1320px;
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 0.95rem 1.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform var(--t-fast) var(--ease),
    box-shadow var(--t-med) var(--ease),
    background-color var(--t-med) var(--ease),
    border-color var(--t-med) var(--ease),
    color var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn .fa-solid,
.btn .fa-regular,
.btn .fa-brands {
  font-size: 0.9em;
  transition: transform var(--t-med) var(--ease);
}

.btn:hover .fa-arrow-right,
.btn:hover .fa-arrow-up-right-from-square,
.btn:hover .fa-chevron-right {
  transform: translateX(3px);
}

/* Primary — gradient, dark text for contrast */
.btn-primary {
  background: var(--grad);
  color: #04121f;
  box-shadow: 0 4px 24px rgba(34, 211, 238, 0.22);
}

.btn-primary:hover {
  color: #04121f;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(34, 211, 238, 0.38);
}

/* Ghost — outline on dark */
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-2px);
}

/* Subtle ghost variant */
.btn-soft {
  background: var(--grad-soft);
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.25);
}

.btn-soft:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.72rem 1.35rem;
  font-size: 0.88rem;
}

.btn-lg {
  padding: 1.1rem 2.1rem;
  font-size: 1.02rem;
}

/* Arrow link */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--cyan);
}

.link-arrow .fa-solid {
  font-size: 0.8em;
  transition: transform var(--t-med) var(--ease);
}

.link-arrow:hover {
  color: var(--sky);
}

.link-arrow:hover .fa-solid {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   6. Header / Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  height: var(--nav-h);
  background: rgba(5, 7, 13, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med) var(--ease), background-color var(--t-med) var(--ease);
}

.site-header.scrolled {
  background: rgba(5, 7, 13, 0.88);
  border-bottom-color: var(--border);
}

.nav-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  flex-shrink: 0;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--grad-soft);
  border: 1px solid rgba(34, 211, 238, 0.3);
  box-shadow: inset 0 0 12px rgba(34, 211, 238, 0.1);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-name b {
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Main nav */
.main-nav {
  margin-inline: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  font-family: var(--font-display);
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 999px;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}

.nav-link:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.08);
}

.nav-link.active {
  color: var(--cyan);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

.nav-link .fa-chevron-down {
  font-size: 0.62em;
  transition: transform var(--t-med) var(--ease);
}

/* Dropdown */
.has-dropdown {
  position: relative;
}

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 8px);
  min-width: 264px;
  padding: 0.6rem;
  background: rgba(12, 18, 32, 0.98);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card-hover);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease), visibility var(--t-med);
  z-index: var(--z-dropdown);
}

.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.has-dropdown:hover .nav-link .fa-chevron-down,
.has-dropdown:focus-within .nav-link .fa-chevron-down {
  transform: rotate(180deg);
}

.dropdown a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.72rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.dropdown a:hover {
  background: var(--grad-soft);
  color: var(--text);
}

.dropdown a .fa-solid {
  width: 20px;
  text-align: center;
  color: var(--cyan);
  font-size: 0.95rem;
}

.dropdown a small {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.76rem;
  color: var(--text-3);
  margin-top: 1px;
}

/* Nav actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1.05rem;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.nav-toggle:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* Mobile menu — full-screen overlay with its own close button.
   IMPORTANT: keep this element a direct child of <body>. If any ancestor
   gets a filter/transform/backdrop-filter it becomes the containing block
   for this fixed-position overlay and the menu shrinks to that box. */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  background: rgba(5, 7, 13, 0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  padding: 1.25rem var(--gutter) calc(1.25rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-14px);
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease), visibility var(--t-med);
}

.mobile-nav.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Top bar: brand + close button */
.mobile-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.mobile-nav-top .brand-name {
  font-size: 1.3rem;
}

.mobile-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}

.mobile-close:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--grad-soft);
}

.mobile-close:active {
  transform: scale(0.94);
}

.mobile-close .fa-xmark {
  transition: transform var(--t-med) var(--ease);
}

.mobile-close:hover .fa-xmark {
  transform: rotate(90deg);
}

/* Links — scroll independently so the CTA stays on screen */
.mobile-links {
  display: flex;
  flex-direction: column;
  padding: 1.4rem 0 2rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.mobile-nav a.mobile-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 0.4rem;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: color var(--t-fast) var(--ease), padding-left var(--t-fast) var(--ease);
}

.mobile-nav a.mobile-link:hover,
.mobile-nav a.mobile-link:active {
  color: var(--cyan);
  padding-left: 0.8rem;
}

.mobile-nav a.mobile-link.active {
  color: var(--cyan);
}

.mobile-nav a.mobile-link .fa-solid {
  width: 30px;
  text-align: center;
  color: var(--cyan);
  font-size: 1.05rem;
}

.mobile-group-label {
  margin-top: 1.2rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
}

.mobile-nav .mobile-sub {
  padding-left: 2.1rem;
  font-size: 1.02rem;
  color: var(--text-2);
}

/* Bottom bar: CTA + contact */
.mobile-nav-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.4rem;
  display: grid;
  gap: 0.9rem;
  flex-shrink: 0;
}

.mobile-nav-bottom .btn {
  width: 100%;
}

.mobile-nav-contact {
  margin: 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-3);
}

.mobile-nav-contact a {
  color: var(--text-2);
  font-weight: 500;
}

.mobile-nav-contact a:hover {
  color: var(--cyan);
}

/* Staggered entrance for menu items */
.mobile-nav .mobile-nav-top,
.mobile-nav .mobile-nav-bottom,
.mobile-nav .mobile-links > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}

.mobile-nav.open .mobile-nav-top { transition-delay: 40ms; }
.mobile-nav.open .mobile-links > :nth-child(1) { transition-delay: 80ms; }
.mobile-nav.open .mobile-links > :nth-child(2) { transition-delay: 110ms; }
.mobile-nav.open .mobile-links > :nth-child(3) { transition-delay: 140ms; }
.mobile-nav.open .mobile-links > :nth-child(4) { transition-delay: 170ms; }
.mobile-nav.open .mobile-links > :nth-child(5) { transition-delay: 200ms; }
.mobile-nav.open .mobile-links > :nth-child(6) { transition-delay: 230ms; }
.mobile-nav.open .mobile-links > :nth-child(7) { transition-delay: 260ms; }
.mobile-nav.open .mobile-links > :nth-child(8) { transition-delay: 290ms; }
.mobile-nav.open .mobile-links > :nth-child(9) { transition-delay: 320ms; }
.mobile-nav.open .mobile-links > :nth-child(10) { transition-delay: 350ms; }
.mobile-nav.open .mobile-nav-bottom { transition-delay: 390ms; }

.mobile-nav.open .mobile-nav-top,
.mobile-nav.open .mobile-nav-bottom,
.mobile-nav.open .mobile-links > * {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   7. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(9, 14, 26, 0.9));
  padding: clamp(3.5rem, 7vw, 5.5rem) 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.4fr;
  gap: 3rem;
  padding-bottom: 3rem;
}

.footer-about p {
  color: var(--text-2);
  font-size: 0.95rem;
  max-width: 34ch;
}

.footer-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1.2rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-2);
  font-size: 0.93rem;
  transition: color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.footer-links a:hover {
  color: var(--cyan);
  transform: translateX(3px);
}

.footer-contact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.footer-contact li {
  display: flex;
  gap: 0.75rem;
  color: var(--text-2);
  font-size: 0.93rem;
  line-height: 1.5;
}

.footer-contact .fa-solid {
  color: var(--cyan);
  margin-top: 0.2rem;
  width: 18px;
  text-align: center;
}

.footer-contact a {
  color: var(--text-2);
}

.footer-contact a:hover {
  color: var(--cyan);
}

.social-row {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

.social-row a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--surface);
  transition: all var(--t-med) var(--ease);
}

.social-row a:hover {
  color: #04121f;
  background: var(--grad);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: var(--glow);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-3);
  font-size: 0.85rem;
}

.footer-bottom a {
  color: var(--text-2);
}

.footer-bottom a:hover {
  color: var(--cyan);
}

/* --------------------------------------------------------------------------
   8. Utilities
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   9. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .main-nav {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-actions .btn-primary {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
