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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #a5b4fc;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #273449;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #334155;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
  --nav-height: 64px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
ul { list-style: none; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* === Typography === */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
.gradient-text {
  background: linear-gradient(135deg, var(--primary-light), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === Navigation === */
.nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-height);
  background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); z-index: 1000;
}
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.nav-logo { font-size: 1.25rem; font-weight: 700; }
.nav-logo span { color: var(--primary-light); }
.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-cta {
  background: var(--primary); color: #fff; padding: 8px 20px;
  border-radius: 24px; font-size: 0.85rem; font-weight: 600;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--primary-dark); color: #fff !important; }
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 4px; }
.hamburger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s; }

/* === Buttons === */
.btn {
  display: inline-block; padding: 12px 28px; border-radius: 28px;
  font-weight: 600; font-size: 0.95rem; border: none; transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4); }
.btn-outline { border: 2px solid var(--border); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); }
.btn-sm { padding: 6px 16px; font-size: 0.8rem; border-radius: 20px; }

/* === Hero === */
.hero { padding: calc(var(--nav-height) + 80px) 0 80px; text-align: center; }
.hero-avatar { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 24px; border: 3px solid var(--primary); object-fit: cover; }
.hero h1 { margin-bottom: 16px; }
.hero .subtitle { font-size: 1.15rem; color: var(--text-muted); max-width: 560px; margin: 0 auto 8px; }
.hero-tags { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 20px 0 32px; }
.tag {
  background: rgba(99, 102, 241, 0.15); color: var(--primary-light);
  padding: 6px 16px; border-radius: 20px; font-size: 0.85rem; font-weight: 500;
}

/* === Section === */
.section { padding: 80px 0; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { margin-bottom: 8px; }
.section-header p { color: var(--text-muted); }
.section-cta { text-align: center; margin-top: 40px; }

/* === Service Cards === */
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 32px 24px;
  border: 1px solid var(--border); transition: all 0.3s; text-align: center;
}
.service-card:hover { background: var(--bg-card-hover); transform: translateY(-4px); border-color: var(--primary); }
.service-icon { font-size: 2.5rem; margin-bottom: 16px; }

/* === Software Cards === */
.software-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.software-card {
  background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); transition: all 0.3s; cursor: pointer;
}
.software-card:hover { transform: translateY(-4px); border-color: var(--primary); background: var(--bg-card-hover); }
.software-card-img { width: 100%; height: 180px; object-fit: cover; background: #1a2744; }
.software-card-body { padding: 20px; }
.software-card-body h3 { font-size: 1.05rem; margin-bottom: 6px; }
.software-card-body p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }
.platform-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.platform-badge {
  font-size: 0.7rem; padding: 3px 10px; border-radius: 12px;
  background: rgba(99, 102, 241, 0.15); color: var(--primary-light); font-weight: 500;
}

/* === Tutorial Cards === */
.tutorial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tutorial-card {
  background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); transition: all 0.3s; cursor: pointer;
}
.tutorial-card:hover { transform: translateY(-4px); border-color: var(--primary); }
.tutorial-card-img { width: 100%; height: 200px; object-fit: cover; background: #1a2744; position: relative; }
.tutorial-card-img .duration {
  position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.8);
  color: #fff; padding: 3px 8px; border-radius: 4px; font-size: 0.75rem;
}
.tutorial-card-body { padding: 20px; }
.tutorial-card-body h3 { font-size: 1rem; margin-bottom: 6px; }
.tutorial-card-body p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }
.category-badge {
  display: inline-block; font-size: 0.7rem; padding: 3px 10px; border-radius: 12px;
  background: rgba(168, 85, 247, 0.15); color: #c084fc; font-weight: 500;
}

/* === Category Filter === */
.filter-bar { display: flex; gap: 10px; justify-content: center; margin-bottom: 36px; flex-wrap: wrap; }
.filter-btn {
  padding: 8px 20px; border-radius: 20px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); font-size: 0.85rem; font-weight: 500; transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--primary-light); color: var(--text); }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* === Software Detail === */
.detail-hero { padding: calc(var(--nav-height) + 40px) 0 40px; }
.detail-hero .container { display: flex; gap: 48px; align-items: flex-start; }
.detail-cover { width: 400px; border-radius: var(--radius); flex-shrink: 0; }
.detail-info { flex: 1; }
.detail-info h1 { font-size: 2rem; margin-bottom: 12px; }
.detail-info .short-desc { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 16px; }
.dl-section { margin-top: 24px; }
.dl-section h3 { margin-bottom: 12px; font-size: 1rem; color: var(--text-muted); }
.dl-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.dl-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px;
  border-radius: 8px; background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); font-size: 0.9rem; font-weight: 500; transition: all 0.2s;
}
.dl-btn:hover { border-color: var(--primary); background: var(--bg-card-hover); }
.dl-btn.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.detail-body { padding: 40px 0 60px; }
.detail-body .container { max-width: 800px; }
.detail-body .description { line-height: 1.8; }
.detail-body .description p { margin-bottom: 16px; }
.screenshots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 32px; }
.screenshots img { border-radius: var(--radius-sm); width: 100%; }
.tech-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.tech-tag {
  padding: 4px 12px; border-radius: 16px; background: rgba(99, 102, 241, 0.1);
  color: var(--primary-light); font-size: 0.8rem;
}

/* === Collaborate === */
.collab-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.collab-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 36px;
  border: 1px solid var(--border);
}
.collab-card h3 { margin-bottom: 20px; font-size: 1.3rem; }
.collab-card ul { margin-bottom: 20px; }
.collab-card ul li { padding: 6px 0; color: var(--text-muted); font-size: 0.95rem; position: relative; padding-left: 20px; }
.collab-card ul li::before { content: '▸'; position: absolute; left: 0; color: var(--primary-light); }
.contact-section { margin-top: 60px; text-align: center; }
.contact-links { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.contact-link {
  display: flex; align-items: center; gap: 8px; padding: 12px 24px;
  background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--border);
  transition: all 0.2s;
}
.contact-link:hover { border-color: var(--primary); }

/* === Modal === */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal { background: var(--bg-card); border-radius: var(--radius); max-width: 900px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-close {
  position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,0.1);
  border: none; color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
}
.modal-video { width: 100%; aspect-ratio: 16/9; }
.modal-body { padding: 24px; }
.modal-body h3 { margin-bottom: 8px; }

/* === Footer === */
.footer { border-top: 1px solid var(--border); padding: 32px 0; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* === CTA Section === */
.cta-section {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(168,85,247,0.1));
  border-radius: var(--radius); padding: 60px 32px; text-align: center;
  border: 1px solid var(--border);
}
.cta-section h2 { margin-bottom: 12px; }
.cta-section p { color: var(--text-muted); margin-bottom: 24px; max-width: 500px; margin-left: auto; margin-right: auto; }

/* === Responsive === */
@media (max-width: 1024px) {
  .software-grid { grid-template-columns: repeat(3, 1fr); }
  .tutorial-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-hero .container { flex-direction: column; }
  .detail-cover { width: 100%; max-width: 400px; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: var(--nav-height); left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 16px 24px; gap: 16px;
  }
  .hamburger { display: flex; }
  .hero { padding-top: calc(var(--nav-height) + 40px); }
  .service-grid { grid-template-columns: 1fr; }
  .software-grid { grid-template-columns: repeat(2, 1fr); }
  .tutorial-grid { grid-template-columns: 1fr; }
  .collab-grid { grid-template-columns: 1fr; }
  .screenshots { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
}

@media (max-width: 480px) {
  .software-grid { grid-template-columns: 1fr; }
  .hero-tags { gap: 8px; }
}
