/* ============================================================
   CROWN DESIGN SYSTEM v1 — Shared Framework
   Per-site color themes via .theme-{site} class on <html>
   ============================================================ */

/* --- Theme: Life System OS (Productivity) --- */
.theme-lifesystemos {
  --primary: #6c63ff;
  --primary-dark: #5a52d5;
  --primary-light: #a29bfe;
  --primary-glow: rgba(108, 99, 255, 0.25);
  --accent: #00b4d8;
  --accent-dark: #0096b5;
  --accent-glow: rgba(0, 180, 216, 0.25);
  --bg-deep: #0a0a1a;
  --bg-dark: #0f0f23;
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(255,255,255,0.06);
  --bg-glass: rgba(15,15,35,0.85);
  --border: rgba(108,99,255,0.15);
  --border-light: rgba(108,99,255,0.08);
  --text-primary: #f0f0f0;
  --text-secondary: #b0b0c0;
  --text-muted: #707090;
  --text-accent: var(--primary-light);
  --gradient-hero: linear-gradient(135deg, #f0f0f0 0%, var(--primary-light) 50%, var(--accent) 100%);
  --gradient-logo: linear-gradient(135deg, var(--primary-light), var(--accent));
}

/* --- Theme: Resume Pro Tips (Career) --- */
.theme-resumeprotips {
  --primary: #1a3a5c;
  --primary-dark: #142d48;
  --primary-light: #4a7ba8;
  --primary-glow: rgba(26,58,92,0.25);
  --accent: #c9a84c;
  --accent-dark: #b8943a;
  --accent-glow: rgba(201,168,76,0.25);
  --bg-deep: #0c0f1a;
  --bg-dark: #111625;
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(255,255,255,0.06);
  --bg-glass: rgba(17,22,37,0.85);
  --border: rgba(26,58,92,0.2);
  --border-light: rgba(26,58,92,0.1);
  --text-primary: #f0f0f0;
  --text-secondary: #b0b8c5;
  --text-muted: #6a7285;
  --text-accent: var(--accent);
  --gradient-hero: linear-gradient(135deg, #f0f0f0 0%, var(--primary-light) 50%, var(--accent) 100%);
  --gradient-logo: linear-gradient(135deg, var(--primary-light), var(--accent));
}

/* --- Theme: Zero Budgeting (Finance) --- */
.theme-zerobudgeting {
  --primary: #2d6a4f;
  --primary-dark: #1f4d38;
  --primary-light: #52b788;
  --primary-glow: rgba(45,106,79,0.25);
  --accent: #e9c46a;
  --accent-dark: #d4a843;
  --accent-glow: rgba(233,196,106,0.25);
  --bg-deep: #0a120e;
  --bg-dark: #0f1a13;
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(255,255,255,0.06);
  --bg-glass: rgba(15,26,19,0.85);
  --border: rgba(45,106,79,0.15);
  --border-light: rgba(45,106,79,0.08);
  --text-primary: #f0f0f0;
  --text-secondary: #b0b8b5;
  --text-muted: #6a7570;
  --text-accent: var(--accent);
  --gradient-hero: linear-gradient(135deg, #f0f0f0 0%, var(--primary-light) 50%, var(--accent) 100%);
  --gradient-logo: linear-gradient(135deg, var(--primary-light), var(--accent));
}

/* --- Theme: Remote Work Hub (Remote Work) --- */
.theme-remoteworkhub {
  --primary: #33415c;
  --primary-dark: #253047;
  --primary-light: #6c83a8;
  --primary-glow: rgba(51,65,92,0.25);
  --accent: #f4845f;
  --accent-dark: #e06a42;
  --accent-glow: rgba(244,132,95,0.25);
  --bg-deep: #0c0e14;
  --bg-dark: #12151e;
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(255,255,255,0.06);
  --bg-glass: rgba(18,21,30,0.85);
  --border: rgba(51,65,92,0.15);
  --border-light: rgba(51,65,92,0.08);
  --text-primary: #f0f0f0;
  --text-secondary: #b0b5c0;
  --text-muted: #6a7080;
  --text-accent: var(--accent);
  --gradient-hero: linear-gradient(135deg, #f0f0f0 0%, var(--primary-light) 50%, var(--accent) 100%);
  --gradient-logo: linear-gradient(135deg, var(--primary-light), var(--accent));
}

/* --- Theme: DogeKing (Crypto) --- */
.theme-dogeking {
  --primary: #6c2bd9;
  --primary-dark: #5820b5;
  --primary-light: #9b6be8;
  --primary-glow: rgba(108,43,217,0.25);
  --accent: #f7931a;
  --accent-dark: #e07f0a;
  --accent-glow: rgba(247,147,26,0.25);
  --bg-deep: #0a0812;
  --bg-dark: #100d1a;
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(255,255,255,0.06);
  --bg-glass: rgba(16,13,26,0.85);
  --border: rgba(108,43,217,0.15);
  --border-light: rgba(108,43,217,0.08);
  --text-primary: #f0f0f0;
  --text-secondary: #b0a8c5;
  --text-muted: #7a6a90;
  --text-accent: var(--accent);
  --gradient-hero: linear-gradient(135deg, #f0f0f0 0%, var(--primary-light) 50%, var(--accent) 100%);
  --gradient-logo: linear-gradient(135deg, var(--primary-light), var(--accent));
}

/* ============================================================
   BASE LAYOUT
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated background gradient */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, var(--primary-glow) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, var(--accent-glow) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(255,255,255,0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Subtle grid */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(var(--border-light) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-light) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-logo {
  font-weight: 800;
  font-size: 1.3rem;
  text-decoration: none;
  background: var(--gradient-logo);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.nav-links a.active {
  color: var(--text-accent);
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  border-radius: 2px;
  transition: all 0.2s ease;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  z-index: 1;
  padding: 120px 24px 60px;
  text-align: center;
  overflow: hidden;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-cta {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-graphic {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--primary-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  position: relative;
  z-index: 1;
  padding: 60px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}

.section-subtitle {
  color: var(--text-secondary);
  text-align: center;
  max-width: 600px;
  margin: 0 auto 40px;
  font-size: 1rem;
}

/* ============================================================
   CARDS
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.card h3 a {
  color: var(--text-primary);
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--text-accent);
}

.card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.card-meta {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================================
   SEARCH
   ============================================================ */
.search-box {
  width: 100%;
  max-width: 500px;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: all 0.2s ease;
  margin: 0 auto 32px;
  display: block;
}

.search-box:focus {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.search-box::placeholder {
  color: var(--text-muted);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-light);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

footer a:hover {
  color: var(--text-accent);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   404 PAGE
   ============================================================ */
.error-page {
  position: relative;
  z-index: 1;
  padding: 140px 24px 80px;
  text-align: center;
}

.error-code {
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 800;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 8px;
}

.error-page h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.error-page p {
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto 32px;
}

/* ============================================================
   ARTICLE LIST
   ============================================================ */
.article-list {
  list-style: none;
  max-width: 800px;
  margin: 0 auto;
}

.article-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.article-list li:last-child {
  border-bottom: none;
}

.article-list a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 500;
  display: block;
  transition: color 0.2s ease;
}

.article-list a:hover {
  color: var(--text-accent);
}

.article-list .article-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 16px;
    gap: 8px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    padding: 12px 16px;
  }

  .nav-hamburger {
    display: block;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 100px 16px 40px;
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}
