/* ============================================================
   Hamid Dashti — Personal Website
   style.css  |  Clean & Minimal
   ============================================================ */

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

:root {
  --accent:    #2563eb;   /* blue-600 */
  --accent-lt: #eff6ff;   /* blue-50  */
  --text:      #1e293b;   /* slate-800 */
  --muted:     #64748b;   /* slate-500 */
  --border:    #e2e8f0;   /* slate-200 */
  --bg:        #ffffff;
  --max-w:     860px;
  --nav-h:     60px;
  --font:      'Inter', system-ui, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------- Layout ---------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Nav ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nav-logo:hover { text-decoration: none; color: var(--accent); }

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); text-decoration: none; }

/* hamburger — hidden on desktop */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text); margin: 5px 0;
  transition: all 0.2s;
}

/* ---------- Page header (hero) ---------- */
.page-hero {
  padding: 3.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

/* ---------- About / Index ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 2.5rem;
  align-items: start;
  padding: 3rem 0 2.5rem;
}

.about-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}

.about-name {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.about-title {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tag {
  background: var(--accent-lt);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

.social-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
  transition: border-color 0.15s, color 0.15s;
}
.social-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.social-btn svg { width: 16px; height: 16px; }

/* About sections */
.about-section { margin-bottom: 2.5rem; }
.about-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.about-section p { color: #334155; margin-bottom: 0.75rem; }

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---------- Publications ---------- */
.pub-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-btn {
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--muted);
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-lt);
}

.pub-list { display: flex; flex-direction: column; gap: 1.25rem; }

.pub-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  transition: box-shadow 0.15s;
}
.pub-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.07); }

.pub-title {
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.pub-authors {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.pub-meta {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.pub-year-badge {
  background: var(--accent-lt);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.pub-link {
  font-size: 0.82rem;
  font-weight: 500;
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.project-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.09); transform: translateY(-2px); }

.project-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--accent-lt);
}

.project-thumb-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 2.5rem;
}

.project-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.project-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.project-desc {
  font-size: 0.88rem;
  color: var(--muted);
  flex: 1;
  margin-bottom: 1rem;
}

.project-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #1d4ed8; text-decoration: none; color: white; }

.btn-outline { border: 1px solid var(--border); background: white; color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Modal for embedded content */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: white;
  border-radius: 12px;
  width: min(90vw, 1000px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.25rem; color: var(--muted);
  line-height: 1; padding: 0.2rem;
}
.modal-close:hover { color: var(--text); }

.modal-content { flex: 1; overflow: auto; }
.modal-content iframe { width: 100%; height: 70vh; border: none; }

/* ---------- CV ---------- */
.cv-container {
  padding: 2rem 0 3rem;
}
.cv-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.cv-embed {
  width: 100%;
  height: 85vh;
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 4rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- Utilities ---------- */
.divider { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .about-photo { margin: 0 auto; }
  .about-tags, .social-links { justify-content: center; }

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

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: white;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.75rem 1.5rem; }
  .nav-toggle { display: block; }
}
