/* ══════════════════════════════════════════════════════════════════
   shared-nav.css — single source of truth for the top navigation.
   Loaded by both:
     • apps/www/public/landing.html (via <link>)
     • apps/www/app/layout.tsx       (via <link>)
   Class names mirror landing's markup: .nav / .nav-links / .btn-demo /
   .btn-nav-cta / .hamburger / .mobile-menu / .btn-theme-toggle.
   Font: Poppins across all nav text (var(--font-poppins) comes from
   Next.js's next/font, 'Poppins' fallback picks up landing's @font-face).
   ══════════════════════════════════════════════════════════════════ */

/* ── Nav shell (DEFAULT = DARK) ─────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  /* Full-width background/border, but cap inner content to 1200px and
     center it — mirrors Apple.com style nav. The max() floor keeps a
     56px safe margin on narrower viewports. */
  padding: 0 max(56px, calc((100% - 1200px) / 2));
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(17, 17, 17, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  font-family: var(--font-poppins), "Poppins", system-ui, -apple-system, sans-serif;
  transition: background 0.3s, border-color 0.3s;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #f0f0f0;
  text-decoration: none;
  transition: color 0.3s;
}
.nav-wordmark {
  color: #f0f0f0;
  display: block;
  height: 18px;
  width: auto;
}

.logo-box {
  width: 28px;
  height: 28px;
  background: #f0f0f0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}
.logo-box svg { width: 15px; height: 15px; }

.nav-left {
  display: flex;
  align-items: center;
  gap: 36px;
  min-width: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-links a {
  font-family: var(--font-poppins), "Poppins", system-ui, -apple-system, sans-serif;
  color: #888888;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.005em;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: #f0f0f0; }
.nav-links a[aria-current="page"] { color: #f0f0f0; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Nav buttons ────────────────────────────────────────────────── */
.btn-demo, .btn-nav-cta { text-decoration: none; }

.btn-demo {
  background: transparent;
  color: #888888;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 18px;
  border-radius: 999px;
  font-family: var(--font-poppins), "Poppins", system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.btn-demo:hover {
  color: #f0f0f0;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-nav-cta {
  background: #f0f0f0;
  color: #0a0a0a;
  border: none;
  padding: 8px 18px;
  border-radius: 999px;
  font-family: var(--font-poppins), "Poppins", system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.2;
  cursor: pointer;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.btn-nav-cta:hover { opacity: 0.82; }

/* ── dark-nav alias (landing's scroll JS toggles this; our default
      IS already dark, so this is effectively idempotent) ────────── */
.nav.dark-nav {
  background: rgba(17, 17, 17, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.10);
}
.nav.dark-nav .logo,
.nav.dark-nav .nav-wordmark { color: #f0f0f0; }
.nav.dark-nav .logo-box { background: #f0f0f0; }
.nav.dark-nav .nav-links a { color: #888888; }
.nav.dark-nav .nav-links a:hover,
.nav.dark-nav .nav-links a[aria-current="page"] { color: #f0f0f0; }
.nav.dark-nav .btn-demo { color: #888888; border-color: rgba(255, 255, 255, 0.12); }
.nav.dark-nav .btn-demo:hover { color: #f0f0f0; border-color: rgba(255, 255, 255, 0.25); }
.nav.dark-nav .btn-nav-cta { background: #f0f0f0; color: #0a0a0a; }
.nav.dark-nav .hamburger span { background: #ffffff; }

/* ── Theme toggle button ────────────────────────────────────────── */
.btn-theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  opacity: 0.85;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}
.btn-theme-toggle svg { width: 20px; height: 20px; }
.btn-theme-toggle:hover { opacity: 1; }

/* ── Hamburger ──────────────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Mobile menu ────────────────────────────────────────────────── */
.mobile-menu {
  display: none;
  position: fixed;
  top: 60px;
  left: 0; right: 0;
  background: #0d0d0d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 199;
  padding: 20px 24px 28px;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
  pointer-events: none;
}
.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}
.mobile-menu ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mobile-menu ul li { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }

.mm-link {
  display: block;
  padding: 14px 0;
  font-family: var(--font-poppins), "Poppins", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: #888888;
  text-decoration: none;
  transition: color 0.15s;
}
.mm-link:hover { color: #f0f0f0; }

.mm-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.mm-cta {
  width: 100%;
  background: #f0f0f0;
  color: #0a0a0a;
  border: none;
  border-radius: 8px;
  padding: 13px;
  font-family: var(--font-poppins), "Poppins", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.mm-demo {
  width: 100%;
  background: none;
  color: #888888;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-poppins), "Poppins", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

/* ── Light mode overrides ───────────────────────────────────────── */
html.light-mode .nav:not(.dark-nav) {
  background: rgba(247, 247, 245, 0.92);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
html.light-mode .nav:not(.dark-nav) .logo,
html.light-mode .nav:not(.dark-nav) .nav-wordmark { color: #111111; }
html.light-mode .nav:not(.dark-nav) .logo-box { background: #111111; }
html.light-mode .nav:not(.dark-nav) .nav-links a { color: #666666; }
html.light-mode .nav:not(.dark-nav) .nav-links a:hover,
html.light-mode .nav:not(.dark-nav) .nav-links a[aria-current="page"] { color: #111111; }
html.light-mode .nav:not(.dark-nav) .btn-nav-cta { background: #111111; color: #ffffff; }
html.light-mode .nav:not(.dark-nav) .btn-demo { color: #666666; border-color: rgba(0, 0, 0, 0.14); }
html.light-mode .nav:not(.dark-nav) .btn-demo:hover { color: #111111; border-color: rgba(0, 0, 0, 0.3); }
html.light-mode .nav:not(.dark-nav) .hamburger span { background: #111111; }

html.light-mode .btn-theme-toggle { color: #111111; opacity: 0.6; }
html.light-mode .btn-theme-toggle:hover { opacity: 1; }

html.light-mode .mobile-menu {
  background: #ffffff;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
html.light-mode .mobile-menu ul li { border-bottom-color: rgba(0, 0, 0, 0.06); }
html.light-mode .mm-link { color: #666666; }
html.light-mode .mm-link:hover { color: #111111; }
html.light-mode .mm-cta { background: #111111; color: #ffffff; }
html.light-mode .mm-demo { color: #666666; border-color: rgba(0, 0, 0, 0.14); }

/* ── Mobile breakpoint ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav { padding: 0 20px; }
  .nav-links,
  .btn-demo,
  .btn-nav-cta { display: none; }
  .hamburger { display: flex; }
  .mobile-menu { display: block; }
}
