/* ───────────────────────────────────────────
   Swapnil Barot — Portfolio Styles
   Design System: Evidence-first, Premium SaaS
   ─────────────────────────────────────────── */

/* ─── CSS Variables ─── */
:root {
  --bg-primary: #FAFAFA;
  --bg-alt: #F1F1F3;
  --surface: #FFFFFF;
  --text-primary: #1A1A1A;
  --text-secondary: #5C5C63;
  --accent: #2255FF;
  --accent-hover: #1A44CC;
  --border: #E8E8EA;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.06);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
  --content-max: 720px;
  --content-wide: 900px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-hover); }

/* ─── Typography ─── */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 3vw, 1.875rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 0.875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
p { margin-bottom: var(--space-md); color: var(--text-secondary); }
p:last-child { margin-bottom: 0; }

/* ─── Layout ─── */
.section { width: 100%; }
.section-alt { background: var(--bg-alt); }
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--space-lg); }
.container-wide { max-width: var(--content-wide); margin: 0 auto; padding: 0 var(--space-lg); }
.py-hero { padding-top: var(--space-4xl); padding-bottom: var(--space-3xl); }
.py-section { padding-top: var(--space-3xl); padding-bottom: var(--space-3xl); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
  padding: 12px 28px; font-family: inherit; font-size: 0.9375rem; font-weight: 500;
  border-radius: var(--radius-md); cursor: pointer; transition: all 0.15s ease;
  border: 1.5px solid transparent; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover { background: rgba(34,85,255,0.06); }
.btn-group { display: flex; gap: var(--space-md); flex-wrap: wrap; }

/* ─── Cards ─── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: var(--space-xl); transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-card-hover); }

/* ─── Metric Cards ─── */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-md); }
.metric-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-lg); box-shadow: var(--shadow-card);
}
.metric-value { font-size: 1.75rem; font-weight: 600; color: var(--text-primary); line-height: 1.1; margin-bottom: var(--space-xs); }
.metric-label { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.4; }

/* ─── Tables ─── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th {
  font-weight: 500; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-secondary); background: var(--bg-alt);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table td { color: var(--text-primary); }

/* ─── Skill Tags ─── */
.skill-list { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.skill-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius-md); font-size: 0.875rem; color: var(--text-primary);
}

/* ─── Certification Cards ─── */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-md); }
.cert-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-lg); box-shadow: var(--shadow-card);
}
.cert-title { font-weight: 600; font-size: 1rem; margin-bottom: var(--space-xs); }
.cert-meta { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.5; }
.cert-id {
  font-family: ui-monospace, SFMono-Regular, 'Cascadia Code', monospace;
  font-size: 0.75rem; color: var(--text-secondary); margin-top: var(--space-sm);
  padding-top: var(--space-sm); border-top: 1px solid var(--border);
}

/* ─── Contact Cards ─── */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-md); }
.contact-card {
  display: flex; align-items: center; gap: var(--space-md); padding: var(--space-lg);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); text-decoration: none; color: var(--text-primary);
  transition: box-shadow 0.2s ease, border-color 0.15s ease;
}
.contact-card:hover { box-shadow: var(--shadow-card-hover); border-color: var(--accent); }
.contact-icon {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt); border-radius: var(--radius-md); flex-shrink: 0;
}
.contact-icon svg { width: 20px; height: 20px; stroke: var(--accent); stroke-width: 1.5; fill: none; }
.contact-label { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 2px; }
.contact-value { font-weight: 500; font-size: 0.9375rem; }

/* ─── Navigation ─── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,250,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--content-wide); margin: 0 auto; padding: 0 var(--space-lg);
  display: flex; align-items: center; justify-content: space-between; height: 56px;
}
.nav-brand { font-weight: 600; font-size: 0.9375rem; color: var(--text-primary); }
.nav-links { display: flex; gap: var(--space-lg); list-style: none; }
.nav-links a { font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); }
.nav-links a:hover { color: var(--accent); }

/* ─── Hero ─── */
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius-md); font-size: 0.8125rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: var(--space-lg);
}
.hero-title { margin-bottom: var(--space-md); }
.hero-subtitle { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--text-secondary); max-width: 560px; margin-bottom: var(--space-xl); line-height: 1.5; }
.hero-meta { display: flex; flex-wrap: wrap; gap: var(--space-md); margin-bottom: var(--space-xl); font-size: 0.875rem; color: var(--text-secondary); }
.hero-meta span { display: flex; align-items: center; gap: 6px; }

/* ─── Section Header ─── */
.section-header { margin-bottom: var(--space-xl); }
.section-header h2 { margin-bottom: var(--space-sm); }
.section-header p { max-width: 600px; }

/* ─── Divider ─── */
.divider { height: 1px; background: var(--border); margin: var(--space-xl) 0; }

/* ─── Case Study ─── */
.case-study-section { margin-bottom: var(--space-3xl); }
.case-study-section:last-child { margin-bottom: 0; }
.snapshot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-xl); }
.snapshot-item { padding: var(--space-md) 0; }
.snapshot-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin-bottom: var(--space-xs); }
.snapshot-value { font-weight: 600; font-size: 1rem; color: var(--text-primary); }

/* ─── Scroll Animation ─── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── Footer ─── */
.footer { border-top: 1px solid var(--border); padding: var(--space-xl) 0; text-align: center; font-size: 0.8125rem; color: var(--text-secondary); }

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .btn-group { flex-direction: column; }
  .btn { width: 100%; }
  .nav-links { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .cert-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .py-hero { padding-top: var(--space-3xl); padding-bottom: var(--space-2xl); }
  .py-section { padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); }
}
@media (max-width: 400px) {
  .metric-grid { grid-template-columns: 1fr; }
}
