/* =============================================
   modern.css — Mala Gupta Personal Website
   ============================================= */

/* === Variables === */
:root {
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-light: #ede9fe;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --nav-height: 64px;
  --container: 1200px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { font-family: 'Outfit', 'Inter', sans-serif; line-height: 1.2; }
ul { list-style: none; }

/* === Layout === */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: clamp(28px, 4vw, 40px); color: var(--text); margin-bottom: 12px; }
.section-header p { font-size: 17px; color: var(--text-secondary); max-width: 600px; margin: 0 auto; }
.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 14px;
}

/* === Navigation === */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.nav.scrolled { box-shadow: var(--shadow); }
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand { font-family: 'Outfit', sans-serif; font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.nav-brand span { color: var(--primary); }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.nav-links a:hover { color: var(--text); }
.nav-links .nav-cta {
  padding: 8px 20px;
  background: var(--primary);
  color: white !important;
  border-radius: 100px;
  font-weight: 600;
}
.nav-links .nav-cta:hover { background: var(--primary-hover); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: 0.2s; }

/* === Hero === */
.hero {
  padding: calc(var(--nav-height) + 80px) 0 80px;
  background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 60%, #f0fdf4 100%);
}
.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-content h1 {
  font-size: clamp(40px, 5.5vw, 64px);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.05;
  letter-spacing: -1px;
}
.hero-content h1 .highlight { color: var(--primary); }
.hero-tagline { font-size: 19px; font-weight: 500; color: var(--text-secondary); margin-bottom: 20px; }
.hero-desc { font-size: 16px; color: var(--text-secondary); line-height: 1.75; margin-bottom: 28px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.badge { padding: 6px 14px; border-radius: 100px; font-size: 13px; font-weight: 600; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); color: white; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(124,58,237,0.35); }
.btn-outline { background: transparent; color: var(--text); border: 2px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-white { background: white; color: var(--primary); }
.btn-white:hover { background: #f5f3ff; color: var(--primary-hover); transform: translateY(-1px); }
.hero-image { display: flex; justify-content: center; }
.hero-image img {
  width: 100%;
  max-width: 360px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  object-fit: cover;
  aspect-ratio: 2/3;
}

/* === Stats === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 48px;
}
.stat-card {
  text-align: center;
  padding: 28px 20px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-num { font-family: 'Outfit', sans-serif; font-size: 40px; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }

/* === Cards === */
.card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-image { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-alt); }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.card:hover .card-image img { transform: scale(1.04); }
.card-body { padding: 20px; }
.card-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary); margin-bottom: 6px; }
.card-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.45; margin-bottom: 4px; }
.card-subtitle { font-size: 13px; color: var(--text-secondary); }
.card-date { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* === Grid layouts === */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }

/* === Books === */
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 28px; }
.book-item img {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
}
.book-item:hover img { transform: translateY(-5px) rotate(-1deg); box-shadow: var(--shadow-lg); }

/* === Talk topics === */
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 48px; }
.topic-card { padding: 24px; background: var(--bg-alt); border-radius: var(--radius); border: 1px solid var(--border); }
.topic-card h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.topic-card li { font-size: 14px; color: var(--text-secondary); padding: 5px 0 5px 18px; position: relative; border-bottom: 1px solid var(--border); }
.topic-card li:last-child { border-bottom: none; }
.topic-card li::before { content: '›'; position: absolute; left: 0; color: var(--primary); font-weight: 700; }

/* === Blog === */
.blog-list { display: flex; flex-direction: column; gap: 14px; }
.blog-item {
  display: flex;
  gap: 18px;
  padding: 20px;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s;
  align-items: flex-start;
  color: inherit;
}
.blog-item:hover { border-color: var(--primary); transform: translateX(4px); color: inherit; }
.blog-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 20px;
}
.blog-item-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.blog-item-meta { font-size: 13px; color: var(--text-secondary); }
.blog-item-meta span + span::before { content: ' · '; }

/* === Newsletter === */
.newsletter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.newsletter-card {
  padding: 28px;
  background: linear-gradient(135deg, #faf5ff, #ede9fe);
  border-radius: var(--radius);
  border: 1px solid #ddd6fe;
  transition: transform 0.2s, box-shadow 0.2s;
}
.newsletter-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.newsletter-card .issue-num { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary); margin-bottom: 10px; }
.newsletter-card h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.newsletter-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 16px; }
.newsletter-card .nl-date { font-size: 12px; color: var(--text-muted); }
.newsletter-card a.nl-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 1px solid var(--primary);
  padding-bottom: 1px;
}

/* === CTA === */
.cta-section {
  padding: 100px 0;
  background: linear-gradient(135deg, #5b21b6, #7c3aed);
  text-align: center;
}
.cta-section h2 { font-size: clamp(28px, 4vw, 42px); color: white; margin-bottom: 16px; }
.cta-section p { font-size: 18px; color: rgba(255,255,255,0.8); max-width: 480px; margin: 0 auto 36px; }

/* === Footer === */
footer { background: #0f172a; color: rgba(255,255,255,0.65); padding: 64px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand { font-family: 'Outfit', sans-serif; font-size: 22px; font-weight: 800; color: white; margin-bottom: 14px; }
.footer-brand span { color: #a78bfa; }
.footer-desc { font-size: 14px; line-height: 1.7; }
.footer-desc a { color: #a78bfa; }
.footer-col h4 { font-size: 12px; font-weight: 700; color: white; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 14px; color: rgba(255,255,255,0.55); }
.footer-col a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

/* === Back to top === */
#back-top {
  position: fixed; bottom: 28px; right: 28px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 50;
}
#back-top.visible { opacity: 1; transform: translateY(0); }
#back-top:hover { background: var(--primary-hover); }

/* === Responsive === */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-image { order: -1; }
  .hero-image img { max-width: 260px; margin: 0 auto; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: var(--nav-height); left: 0; right: 0; background: white; padding: 16px 24px; border-bottom: 1px solid var(--border); gap: 14px; box-shadow: var(--shadow-md); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .topic-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .section { padding: 60px 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
