/* ============================================
   CodeCraftedApps — Brand Core
   Design tokens + components shared by every section of the site.
   Load FIRST on every page, before the section stylesheet:
     <link rel="stylesheet" href="css/brand-core.css?v=1">
     <link rel="stylesheet" href="css/style.css?v=N">   (or the section's)
   Section stylesheets may override tokens (brew's amber, the
   platform accents) — they load after this file, so they win.
   Reference: /style-guide.html
   ============================================ */

/* --- Design tokens --- */
:root {
  color-scheme: light dark;
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-card: #1e2130;
  --bg-card-hover: #252839;
  --text-primary: #e8e9ed;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --border: #2a2d3a;
  --border-hover: #3b82f6;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1100px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
  /* Spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
}

/* --- Wordmark --- */
.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.site-logo span {
  color: var(--accent);
}

/* Muted " - Section" suffix on section-page header wordmarks */
.site-logo .logo-section {
  color: var(--text-secondary);
  font-weight: 500;
}

@media (max-width: 600px) {
  .site-logo .logo-section {
    display: none;
  }
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--accent);
  color: var(--bg-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  z-index: 200;
  transition: top 0.2s ease;
}

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

/* --- Breadcrumbs --- */
.breadcrumbs {
  padding: 12px 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs .separator {
  margin: 0 8px;
  opacity: 0.5;
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, background 0.2s ease, border-color 0.2s ease;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Status badges (six labels; see style guide "Status badges") --- */
.card-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 20px;
  width: fit-content;
}

.badge-app {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.badge-tool {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.badge-coming-soon {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
}

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

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

.footer-copyright {
  color: var(--text-muted);
  font-size: 0.8rem;
}

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

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

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

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-brand .site-logo {
  margin-bottom: 8px;
}

.footer-brand .footer-tagline {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 280px;
}

.footer-column h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.footer-column a {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 3px 0;
  transition: color 0.2s ease;
}

.footer-column a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }

  .footer-brand .footer-tagline {
    max-width: 100%;
  }

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

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

/* --- Light mode (tokens + badge contrast; section sheets add their own) --- */
@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f6f7f9;
    --bg-secondary: #eceff3;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f2f5;
    --text-primary: #1a1d27;
    --text-secondary: #52606f;
    --text-muted: #78828f;
    --accent-glow: rgba(59, 130, 246, 0.12);
    --border: #e2e6ec;
  }

  .badge-app {
    color: #2563eb;
  }
  .badge-tool {
    color: #059669;
  }
  .badge-coming-soon {
    color: #6b7280;
  }
}
