/* Neai Labs — shared layout styles
 * Covers: base reset, body, navbar, footer, focus visibility.
 * Requires: theme.css loaded first (uses CSS custom properties). */

/* ── Skip Navigation ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: var(--z-skip);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: var(--radius-btn);
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 12px;
}

/* ── Trust Summary Bar ── */
.trust-summary {
  margin-top: 32px;
  padding: 18px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.trust-summary p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.6;
}

.trust-summary a {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Base Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Body Base ── */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Layout Container ── */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: var(--z-content);
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-navbar);
  backdrop-filter: blur(20px) saturate(1.4);
  background: rgba(var(--bg-rgb), 0.8);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a[aria-current="page"] {
  color: var(--text);
}

/* ── Nav Actions: groups CTA + hamburger on the right ── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-cta {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-btn);
  font-size: 0.85rem;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.3);
}

/* ── Hamburger Toggle ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  min-width: 44px;
  min-height: 44px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Focus Visibility ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 20px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  font-size: 0.88rem;
  font-weight: 600;
}

.footer-brand span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text);
}

/* Desktop: hide the duplicate CTA inside the nav menu */
.nav-links .nav-cta {
  display: none;
}

/* ── Buttons — base + color tokens ──
 * .btn base structure is shared here.
 * Each page overrides padding + font-size for its density context
 * (marketing: 13px 24px / 0.92rem  ·  app console: 10px 14px / 0.85rem). */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-btn);
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.3);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-secondary {
  background: rgba(var(--white-rgb), 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(var(--white-rgb), 0.1);
}
.btn-outline {
  background: transparent;
  border: 1px solid rgba(var(--white-rgb), 0.12);
  color: var(--text);
}
.btn-outline:hover {
  background: rgba(var(--white-rgb), 0.05);
  border-color: rgba(var(--white-rgb), 0.2);
}
.btn-danger {
  background: var(--fail-bg);
  color: var(--fail);
  border: 1px solid rgba(var(--fail-rgb), 0.2);
}

/* ── Responsive: Mobile Navigation ── */
@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(var(--bg-rgb), 0.98);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 24px;
    gap: 16px;
    backdrop-filter: blur(20px);
    z-index: var(--z-dropdown);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 0.95rem;
  }

  /* Mobile: hide CTA from action bar, show it inside the hamburger menu */
  .nav-actions .nav-cta {
    display: none;
  }

  .nav-links .nav-cta {
    display: inline-flex;
    align-self: flex-start;
    margin-top: 4px;
  }

  .footer-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .trust-summary a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}
