/* ==========================================================================
   Aperture22 — Shared Design Tokens & Components
   Unified navbar, footer, and design system across all pages
   ========================================================================== */

/* ── Design Tokens ────────────────────────────────────────────────────────── */

:root {
  /* Colors */
  --color-bg-primary: #FFFFFF;
  --color-bg-secondary: #F8F9FA;
  --color-bg-surface: #FFFFFF;
  --color-text-primary: #1A1A2E;
  --color-text-secondary: #6B7280;
  --color-accent: #2563EB;
  --color-accent-hover: #1D4ED8;
  --color-border: #E5E7EB;
  --color-nav-bg: #FFFFFF;
  --color-footer-bg: #1A1A2E;
  --color-footer-text: #E5E7EB;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --spacing-section: 80px;
  --spacing-content: 40px;
  --max-width: 1200px;
  --nav-height: 64px;
  --border-radius: 8px;
}

/* ── Smooth Scrolling ─────────────────────────────────────────────────────── */

html {
  scroll-behavior: smooth;
}

/* ── Shared Navbar ────────────────────────────────────────────────────────── */

.shared-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-nav-bg);
  border-bottom: 1px solid var(--color-border);
  height: var(--nav-height);
  transition: transform 0.3s ease;
}

/* Hide navbar in App Mode (when working with images) */
body.app-mode-active .shared-navbar {
  display: none;
}

/* Hide footer in App Mode */
body.app-mode-active .shared-footer {
  display: none;
}

.navbar-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo-link {
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.logo-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
}

/* Nav Links */
.nav-center {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-center a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 400;
  transition: color 0.2s ease;
  position: relative;
}

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

.nav-center a.active {
  color: var(--color-text-primary);
  font-weight: 600;
}

.nav-center a.active::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
}

/* Auth Area */
.nav-auth {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-auth a,
.nav-auth button {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 400;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
  font-family: var(--font-primary);
}

.nav-auth a:hover,
.nav-auth button:hover {
  color: var(--color-text-primary);
}

.nav-auth .sign-in-btn {
  background: var(--color-accent);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.nav-auth .sign-in-btn:hover {
  background: var(--color-accent-hover);
  color: white;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-primary);
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: absolute;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--color-nav-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 24px;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu a,
.mobile-menu button {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 400;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-primary);
  padding: 8px 0;
}

.mobile-menu a.active {
  color: var(--color-text-primary);
  font-weight: 600;
}

.mobile-menu .sign-in-btn {
  background: var(--color-accent);
  color: white;
  padding: 12px 20px;
  border-radius: 6px;
  font-weight: 500;
  text-align: center;
  margin-top: 8px;
}

/* ── Shared Footer ────────────────────────────────────────────────────────── */

.shared-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 60px 24px 24px 24px;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

.footer-column h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-footer-text);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-logo {
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.footer-logo-text {
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--color-footer-text);
}

.footer-logo-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
}

.footer-tagline {
  font-size: 0.875rem;
  color: #9CA3AF;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: #9CA3AF;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(229, 231, 235, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: #9CA3AF;
}

.footer-bottom a {
  color: #6B7280;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-bottom a:hover {
  color: #9CA3AF;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  /* Hide desktop nav, show mobile toggle */
  .nav-center,
  .nav-auth {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  /* Footer stack on mobile */
  .footer-columns {
    grid-template-columns: 1fr;
    gap: 32px;
  }

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

@media (max-width: 1024px) {
  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}
