/* ============================================================
   Jian Qin — Personal Site
   Design system matched to Lightbulb Technology branding
   ============================================================ */

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

:root {
  --bg-primary: #0f0f23;
  --bg-secondary: #1a1a3e;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-tertiary: rgba(255, 255, 255, 0.4);
  --accent-orange: #f97316;
  --accent-orange-dark: #c2410c;
  --accent-blue: #3b82f6;
  --accent-purple: #7c3aed;
  --accent-emerald: #10b981;
  --border-subtle: rgba(255, 255, 255, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* --- Layout --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 120px 0;
}

/* --- Typography --- */
.font-display {
  font-family: var(--font-display);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  position: relative;
}

.hero-inner {
  max-width: 720px;
}

.hero-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 40px;
  border: 2px solid var(--glass-border);
  opacity: 0.95;
}

.hero h1 {
  font-size: 3.5rem;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.hero-role {
  font-size: 1.15rem;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-bottom: 32px;
  letter-spacing: 0.02em;
}

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

.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-dark));
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* --- Thesis Section --- */
.thesis {
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}

.thesis-text {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 680px;
  margin: 0 auto 64px;
}

/* --- Stats --- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.stat {
  text-align: center;
  padding: 24px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-value.orange { color: var(--accent-orange); }
.stat-value.blue { color: var(--accent-blue); }
.stat-value.emerald { color: var(--accent-emerald); }
.stat-value.purple { color: var(--accent-purple); }

.stat-label {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-weight: 400;
}

/* --- Products --- */
.products {
  border-top: 1px solid var(--border-subtle);
}

.section-heading {
  text-align: center;
  margin-bottom: 64px;
}

.section-heading h2 {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-heading p {
  font-size: 1.1rem;
  color: var(--text-tertiary);
  max-width: 500px;
  margin: 0 auto;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* --- Product Card --- */
.card {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 36px;
  transition: all 0.25s ease;
}

.card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.card-icon.orange { background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-dark)); }
.card-icon.blue { background: linear-gradient(135deg, var(--accent-blue), #2563eb); }
.card-icon.emerald { background: linear-gradient(135deg, var(--accent-emerald), #059669); }
.card-icon.purple { background: linear-gradient(135deg, var(--accent-purple), #6d28d9); }

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-tertiary);
}

.badge.live {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald);
}

.badge.private {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.25);
  color: var(--accent-purple);
}

.badge.soon {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.25);
  color: var(--accent-blue);
}

.card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-tertiary);
  transition: color 0.2s;
}

.card-link:hover {
  color: var(--text-primary);
}

.card-link svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

.card-link:hover svg {
  transform: translateX(3px);
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 48px 0;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

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

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

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.25);
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  section {
    padding: 80px 0;
  }

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

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

  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .stat-value {
    font-size: 1.6rem;
  }

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

  .section-heading h2 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 60px 20px;
  }

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

  .hero-photo {
    width: 110px;
    height: 110px;
  }

  .hero-role {
    font-size: 1rem;
  }

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

  .btn {
    padding: 12px 22px;
    font-size: 0.88rem;
  }

  .card {
    padding: 28px;
  }

  .thesis-text {
    font-size: 1.1rem;
  }

  .footer-links {
    gap: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
