/* ============================================
   CodeCraftedApps - Global Stylesheet
   Dark theme, modern, minimal
   ============================================ */

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

:root {
  --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: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

img {
  max-width: 100%;
  display: block;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

main {
  flex: 1;
}

/* --- Header / Nav --- */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

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

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

.site-nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

/* --- Hero Section --- */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero h1 span {
  color: var(--accent);
}

.hero .tagline {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 12px;
  line-height: 1.5;
}

.hero .sub-tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* --- Section --- */
.section {
  padding: 60px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 36px;
}

/* --- Project Cards Grid --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-2px);
}

.project-card .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;
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.project-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
  flex-grow: 1;
}

.project-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
}

.project-card .card-link::after {
  content: '\2192';
  transition: transform 0.2s ease;
}

.project-card:hover .card-link::after {
  transform: translateX(4px);
}

/* --- About Section --- */
.about-content {
  max-width: 700px;
}

.about-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

/* --- Page Header (for sub-pages) --- */
.page-header {
  padding: 60px 0 40px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* --- Legal / Content Pages --- */
.content-section {
  padding: 48px 0;
}

.content-body {
  max-width: 750px;
}

.content-body h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.content-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 10px;
}

.content-body p {
  color: var(--text-secondary);
  font-size: 0.93rem;
  line-height: 1.75;
  margin-bottom: 14px;
}

.content-body ul,
.content-body ol {
  color: var(--text-secondary);
  font-size: 0.93rem;
  line-height: 1.75;
  margin-bottom: 14px;
  padding-left: 24px;
}

.content-body li {
  margin-bottom: 6px;
}

.content-body a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Contact Page --- */
.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.contact-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.contact-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

.contact-card a {
  font-weight: 600;
  font-size: 0.9rem;
}

/* --- 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);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero {
    padding: 50px 0 40px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero .tagline {
    font-size: 1.05rem;
  }

  .section {
    padding: 40px 0;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    padding: 40px 0 28px;
  }

  .page-header h1 {
    font-size: 1.75rem;
  }

  /* Mobile nav */
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
  }

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

  .nav-toggle {
    display: block;
  }

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

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.65rem;
  }

  .container {
    padding: 0 16px;
  }

  .project-card {
    padding: 22px;
  }
}
