/* ============================================================
   Emad Kalantari — Personal Portfolio
   Fonts: Cormorant Garamond (headings) + Manrope (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Manrope:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:           #f5f4f1;
  --bg-card:      #ffffff;
  --bg-dark:      #0d1117;
  --text:         #111827;
  --text-muted:   #6b7280;
  --text-light:   #9ca3af;
  --accent:       #1d4ed8;
  --accent-hover: #1e3a8a;
  --accent-pale:  #eff6ff;
  --accent-rgb:   29, 78, 216;
  --border:       #e5e7eb;
  --border-dark:  #1e2633;
  --nav-h:        68px;
  --radius:       10px;
  --radius-lg:    16px;
  --shadow:       0 1px 3px rgba(0,0,0,0.05), 0 4px 20px rgba(0,0,0,0.07);
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.13);
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Manrope', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --transition:   0.22s cubic-bezier(0.4,0,0.2,1);

  /* Consistent vertical rhythm */
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Layout Utilities ──────────────────────────────────────── */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.section    { padding: 80px 0; }
.section-sm { padding: 56px 0; }
.text-center { text-align: center; }
.mt-4  { margin-top: 1rem; }
.mt-8  { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }

/* ── Typography ────────────────────────���───────────────────── */
.display-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text);
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 var(--space-4) 0;
}
.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-block;
  margin: 0 0 var(--space-2) 0;
}
.lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 640px;
  margin: 0 0 var(--space-5) 0;
}
.mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* ── Navigation ────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-dark);
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: opacity var(--transition);
}
.nav-logo:hover { opacity: 0.8; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
  color: #f1f5f9;
  background: rgba(255,255,255,0.07);
}
.nav-icons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  color: #94a3b8;
  border: 1px solid var(--border-dark);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.nav-icon-link:hover {
  color: #f1f5f9;
  border-color: #374151;
  background: rgba(255,255,255,0.06);
}
.nav-icon-link svg { width: 18px; height: 18px; fill: currentColor; }
.nav-toggle {
  display: none;
  color: #94a3b8;
  font-size: 1.25rem;
  padding: 4px 8px;
}
/* Mobile nav */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-dark);
    padding: 12px 16px 16px;
    gap: 4px;
    align-items: flex-start;
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; padding: 10px 14px; }
}

/* Page offset for fixed nav */
.page-body { padding-top: var(--nav-h); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.3);
}
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent-pale);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--text-muted);
  color: var(--text);
}
.btn svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

/* ── Tag / Badge ──��────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--accent-pale);
  color: var(--accent);
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}
.tag-gray {
  background: #f3f4f6;
  color: var(--text-muted);
  border-color: var(--border);
}
.tag-green {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}
.tags-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* ── Badge (status indicator) ──────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-6) 0;
}

/* ── Page Hero ─────────────────────────────────────────────── */
.page-hero {
  padding: var(--space-7) 0 var(--space-6);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-7);
}
.page-hero .page-title { margin-bottom: var(--space-3); }
.page-hero .lead { color: var(--text-muted); margin-bottom: 0; }

/* ── HOME: Hero ────────────────────────────────────────────── */
.hero {
  padding: var(--space-7) 0 calc(var(--space-7) - var(--space-2));
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -120px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(29,78,216,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 60px;
}
.hero-photo {
  width: 200px; height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: 0 0 0 1px var(--border), 0 8px 40px rgba(0,0,0,0.12);
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.hero-photo-placeholder {
  width: 200px; height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 4px solid white;
  box-shadow: 0 0 0 1px var(--border), 0 8px 40px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.hero-subtitle {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: var(--space-3) 0 var(--space-4);
  line-height: 1.5;
}
.hero-subtitle .sep { margin: 0 8px; color: var(--border); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--space-4); }

@media (max-width: 640px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-photo, .hero-photo-placeholder { width: 140px; height: 140px; font-size: 1.8rem; }
}

/* ── HOME: About Summary ───────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-6);
}
@media (max-width: 700px) { .about-grid { grid-template-columns: 1fr; } }

.about-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.06);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.about-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(16, 24, 40, 0.08);
  border-color: rgba(var(--accent-rgb), 0.22);
}

.about-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--accent-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}
.about-icon svg { width: 20px; height: 20px; fill: currentColor; }
.about-item-text h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.about-item-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── PROJECTS ──────────────────────────────────────────────── */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  margin: 0 0 var(--space-6) 0;
}
.project-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.project-card-header {
  padding: 32px 36px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.project-card-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  display: block;
}
.project-card-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.project-card-body { padding: 28px 36px 32px; }
.project-card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: var(--space-4);
}
.project-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin: var(--space-4) 0;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.metric-item { text-align: center; }
.metric-value {
  font-family: var(--font-body);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
}
.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}
.project-bullets { margin: var(--space-3) 0; padding-left: 0; }
.project-bullets li {
  position: relative;
  padding-left: 22px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 10px;
}
.project-bullets li::before {
  content: '→';
  color: var(--accent);
  font-weight: 700;
  position: absolute;
  left: 0;
  top: 1px;
}
.project-card-footer {
  padding: 20px 36px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .project-card-header, .project-card-body, .project-card-footer { padding-left: 22px; padding-right: 22px; }
}

/* ── CV PAGE ───────────────────────────────────────────────── */
.cv-section { margin-bottom: var(--space-6); }
.cv-section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cv-section-title svg { width: 20px; height: 20px; fill: var(--accent); }
.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  margin-bottom: 32px;
  position: relative;
}
.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 160px;
  top: 36px;
  bottom: -16px;
  width: 1px;
  background: var(--border);
  transform: translateX(-50%);
  display: none;
}
.timeline-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding-top: 3px;
  line-height: 1.4;
}
.timeline-dot { display: none; }
.timeline-role {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.timeline-org {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
  margin: 2px 0 10px;
}
.timeline-bullets { padding-left: 0; }
.timeline-bullets li {
  position: relative;
  padding-left: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 6px;
}
.timeline-bullets li::before {
  content: '·';
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1.3;
  position: absolute;
  left: 0;
  top: 0;
}
@media (max-width: 600px) {
  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
  .timeline-date { color: var(--accent); font-size: 0.78rem; }
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.skill-group-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.skill-group .tags-row { margin-top: 0; }

/* ── CERTIFICATES ──────────────────────────────────────────── */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}
.cert-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.cert-image-wrap {
  width: 100%;
  height: 220px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.cert-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  transition: transform 0.3s ease;
}
.cert-image-wrap:hover img { transform: scale(1.03); }
.cert-placeholder-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  opacity: 0.5;
}
.cert-placeholder-icon svg { width: 36px; height: 36px; fill: currentColor; }
.cert-placeholder-icon span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.cert-body { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; }
.cert-issuer {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 5px;
}
.cert-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
}
.cert-status { margin-top: 12px; }
.cert-status .tag { font-size: 0.68rem; }
.in-progress-section { margin-top: var(--space-6); }
.in-progress-section .section-heading { color: var(--text-muted); }

/* Compact in-progress card (no image) */
.cert-card-compact {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.cert-card-compact:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.cert-card-compact .cert-body { padding: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.cert-card-compact .cert-issuer { margin-bottom: 0; }
.cert-card-compact .cert-title { font-size: 0.88rem; }
.cert-card-compact .cert-status { margin-top: 6px; }

/* In-progress grid - same as cert-grid but for compact cards */
.cert-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

/* ── CONTACT ───────────────────────────────────────────────── */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
@media (max-width: 700px) { .contact-layout { grid-template-columns: 1fr; } }
.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow var(--transition), transform var(--transition);
}
.contact-item:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.contact-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--accent-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}
.contact-icon svg { width: 20px; height: 20px; fill: currentColor; }
.contact-item-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 2px;
}
.contact-item-value {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
}
.contact-item-value a {
  color: var(--accent);
  transition: color var(--transition);
}
.contact-item-value a:hover { color: var(--accent-hover); }

/* Keep social-card styles in case you still use them somewhere */
.social-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: var(--bg-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  transition: background var(--transition), transform var(--transition);
  color: #f1f5f9;
}
.social-card:hover { background: #1e2633; transform: translateY(-2px); }
.social-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #f1f5f9;
}
.social-card-icon svg { width: 22px; height: 22px; fill: currentColor; }
.social-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 2px;
}
.social-card-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: #e2e8f0;
}
.social-arrow {
  margin-left: auto;
  color: #475569;
  font-size: 1.1rem;
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-name {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
}

/* ── Fade-in animation ─────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}