/* ==========================================================================
   Motion — Global design system
   Dark, minimal, modern. Shared across landing + feature pages.
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #0b0e14;
  --bg-elev: #11151d;
  --panel: #161b24;
  --panel-2: #1c2230;
  --border: #232a36;
  --border-strong: #2e3646;

  /* Text */
  --text: #e6edf3;
  --muted: #9aa4b2;
  --faint: #6b7482;

  /* Accent — Motion blue */
  --accent: #2f81f7;
  --accent-hover: #4c96ff;
  --accent-soft: rgba(47, 129, 247, 0.15);

  /* Feedback */
  --warn: #f7b955;
  --danger: #ff5d5d;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 70px -20px rgba(0, 0, 0, 0.75);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: clip; /* guard against accidental horizontal overflow */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.icon {
  display: inline-block;
  vertical-align: middle;
  flex: none;
}

/* --- Buttons -------------------------------------------------------------- */
.btn {
  --btn-bg: var(--panel);
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease,
    opacity 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

.btn--primary {
  --btn-bg: var(--accent);
  --btn-fg: #fff;
  border-color: transparent;
  box-shadow: 0 8px 24px -10px var(--accent);
}
.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--ghost {
  --btn-bg: transparent;
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover {
  background: var(--panel-2);
  color: var(--text);
}

/* --- Brandmark ------------------------------------------------------------ */
.brandmark {
  display: inline-grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
}
.brandmark__dot {
  grid-row: 1 / 3;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 20px 2px var(--accent);
}
.brandmark__name {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.brandmark__by {
  grid-column: 2;
  font-size: 0.68rem;
  color: var(--faint);
  letter-spacing: 0.02em;
}
.brandmark--sm .brandmark__name {
  font-size: 1rem;
}

.btn--sm {
  padding: 8px 14px;
  font-size: 0.88rem;
}

/* --- Badge ---------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
}
.badge--live {
  color: #7ee2a8;
  border-color: rgba(69, 212, 131, 0.4);
  background: rgba(69, 212, 131, 0.1);
}
.badge--live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #45d483;
  box-shadow: 0 0 8px #45d483;
}

/* --- Navbar --------------------------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}
.navbar__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.navbar__links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 0.92rem;
  color: var(--muted);
}
.navbar__links a {
  position: relative;
  padding: 4px 0;
  transition: color 0.15s;
}
.navbar__links a:hover,
.navbar__links a.is-active {
  color: var(--text);
}
.navbar__links a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.navbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.navbar__toggle {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

/* --- Mobile menu ---------------------------------------------------------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 80;
}
.mobile-menu[hidden] {
  display: none;
}
.mobile-menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.6);
  backdrop-filter: blur(4px);
  animation: overlay-in 0.2s ease;
}
.mobile-menu__panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(320px, 84vw);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
  background: var(--bg-elev);
  border-left: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  animation: slide-in 0.24s cubic-bezier(0.2, 0.8, 0.3, 1);
  overflow-y: auto;
}
@keyframes slide-in {
  from {
    transform: translateX(100%);
  }
}
.mobile-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.mobile-menu__panel > a:not(.btn) {
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  transition: background 0.15s;
}
.mobile-menu__panel > a:not(.btn):hover {
  background: var(--panel-2);
}
.mobile-menu__cta {
  margin-top: 14px;
}
body.nav-open {
  overflow: hidden;
}

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 96px;
  background: var(--bg-elev);
}
.site-footer__grid {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 24px 32px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
}
.site-footer__desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 16px 0 0;
  max-width: 320px;
}
.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.site-footer__col h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin-bottom: 4px;
}
.site-footer__col a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 0.15s;
}
.site-footer__col a:hover {
  color: var(--text);
}
.site-footer__bottom {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--faint);
  font-size: 0.85rem;
}
.site-footer__by {
  color: var(--accent);
  font-weight: 600;
}
@media (max-width: 860px) {
  .navbar__links,
  .navbar__cta {
    display: none;
  }
  .navbar__toggle {
    display: grid;
  }
  /* With the links hidden, nothing carries margin-left:auto anymore — push the
     actions (hamburger) to the far right so it sits in the top-right corner. */
  .navbar__actions {
    margin-left: auto;
  }
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px 24px;
    padding: 44px 24px 28px;
  }
  .site-footer__brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 480px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
  }
  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* --- Overlays / Modals ---------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.overlay[hidden] {
  display: none;
}
.overlay--modal {
  background: rgba(6, 8, 12, 0.72);
  backdrop-filter: blur(8px);
  animation: overlay-in 0.2s ease;
}
.overlay--loading {
  background: rgba(6, 8, 12, 0.55);
  backdrop-filter: blur(4px);
  flex-direction: column;
  gap: 16px;
}
.overlay__text {
  color: var(--muted);
  font-size: 0.95rem;
}

@keyframes overlay-in {
  from {
    opacity: 0;
  }
}

.modal {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 30px 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.24s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}
.modal__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}
.modal__icon--warn {
  background: rgba(247, 185, 85, 0.14);
  color: var(--warn);
}
.modal__title {
  font-size: 1.3rem;
  font-weight: 700;
}
.modal__body {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}
.modal__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--faint);
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: left;
}
.modal__note .icon {
  color: var(--accent);
}
.modal__list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted);
}
.modal__list li {
  padding: 4px 0 4px 18px;
  position: relative;
}
.modal__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--warn);
}
.modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.modal__actions .btn {
  flex: 1;
}

/* --- Spinner -------------------------------------------------------------- */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Error page ----------------------------------------------------------- */
.error-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}
.error-screen .brandmark {
  margin-bottom: 20px;
}
.error-screen__code {
  font-size: 4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.error-screen__title {
  font-size: 1.5rem;
}
.error-screen__msg {
  color: var(--muted);
  max-width: 380px;
  margin: 4px 0 20px;
}

@media (max-width: 560px) {
  .modal {
    max-width: 100%;
  }
}
