/* ============================================================
   Ali Ahmadi Roghabadi — Personal Site
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=EB+Garamond:ital,wght@0,400;0,500;1,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #ffffff;
  --bg-subtle: #f9f9f9;
  --border:    #e5e5e5;
  --text:      #1a1a1a;
  --muted:     #6b6b6b;
  --link:      #2b5f8a;
  --link-hover:#5089b8;
  --accent:    #1a1a1a;
  --nav-h:     56px;
}

html { scroll-behavior: smooth; }

@media (hover: hover) and (pointer: fine) {
  html { zoom: 100%; }
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 2rem;
}

.nav-inner {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
}
.nav-brand:hover { text-decoration: none; color: var(--muted); }

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

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.15s;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  border-color: var(--text);
  text-decoration: none;
}

main { max-width: 780px; margin: 0 auto; padding: 0 2rem; }

section {
  display: none;
  padding: 3.5rem 0 4rem;
}
section.active { display: block; }

.profile {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  padding-top: 0.5rem;
}

.profile-img {
  flex-shrink: 0;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  filter: grayscale(10%);
}

.profile-info h1 {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.profile-links {
  display: flex;
  gap: 1.25rem;
  margin: 0.6rem 0 1rem;
  flex-wrap: wrap;
}

.profile-links a {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.15s;
}
.profile-links a:hover { color: var(--text); text-decoration: none; }
.profile-links svg { width: 14px; height: 14px; }

.profile-bio {
  font-size: 0.92rem;
  color: #333;
  max-width: 560px;
}

.news-section { margin-top: 3rem; }
.news-section h2 {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.01em;
}

.news-table { width: 100%; border-collapse: collapse; }
.news-table tr { border-bottom: 1px solid var(--border); }
.news-table tr:last-child { border-bottom: none; }
.news-table td { padding: 0.65rem 0; vertical-align: top; font-size: 0.88rem; }
.news-table td:first-child {
  white-space: nowrap;
  padding-right: 2rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  min-width: 90px;
}

.about-block { margin-bottom: 2.5rem; }
.about-block h2 {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.about-block h3 {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.about-list {
  list-style: none;
  padding: 0;
}
.about-list li {
  font-size: 0.9rem;
  padding: 0.25rem 0;
  padding-left: 1rem;
  position: relative;
  color: #333;
}
.about-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--muted);
}

.edu-item, .exp-item {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.edu-item:last-child, .exp-item:last-child { border-bottom: none; }

.edu-item .institution {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}
.edu-item .degree {
  font-size: 0.85rem;
  color: #444;
}
.edu-item .years,
.exp-item .years {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.exp-item .role { font-size: 0.9rem; font-weight: 500; }
.exp-item .org {
  font-size: 0.85rem;
  color: #444;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1px;
  border: 1px solid var(--border);
  background: var(--border);
  margin-top: 0.5rem;
}

.project-card {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transition: background 0.15s;
  overflow: hidden;
}
.project-card:hover { background: var(--bg-subtle); }

.proj-img-wrap {
  width: 100%;
  height: 160px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  flex-shrink: 0;
}
.proj-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.proj-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.proj-img-placeholder::after {
  content: 'Image coming soon';
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.proj-img-placeholder img { display: none; }

.proj-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.project-card .proj-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.project-card .proj-title svg {
  flex-shrink: 0;
  color: var(--muted);
}

.project-card .proj-desc {
  font-size: 0.83rem;
  color: #555;
  line-height: 1.55;
}

.project-card .proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.proj-tag {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 2px;
}

.project-card a.proj-link {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: auto;
  padding-top: 0.3rem;
  transition: color 0.15s;
}
.project-card a.proj-link:hover { color: var(--text); text-decoration: none; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.section-header h2 {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
}

.quotes-list { list-style: none; padding: 0; }
.quotes-list blockquote {
  border-left: 2px solid var(--border);
  margin: 0 0 2rem;
  padding: 0.5rem 0 0.5rem 1.5rem;
}
.quotes-list blockquote p {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.05rem;
  font-style: italic;
  color: #333;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}
.quotes-list cite {
  font-size: 0.8rem;
  font-style: normal;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#about > h2, #quotes > h2 {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.75rem 0;
  font-size: 0.78rem;
  color: var(--muted);
}

@media (max-width: 600px) {
  nav { padding: 0 1rem; }
  main { padding: 0 1rem; }

  .profile { flex-direction: column; gap: 1.2rem; }
  .profile-img { width: 90px; height: 90px; }

  .nav-links { gap: 1.2rem; }
  .nav-links a { font-size: 0.78rem; }

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

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}


/*  */

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.project-item {
  overflow: hidden; /* برای float */
}

.project-thumb {
  float: left;
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  margin: 0 1.25rem 0.5rem 0;
}

.project-text {
  margin: 0;
  line-height: 1.7;
  font-size: 0.95rem;
  color: var(--text, inherit);
}

.project-title-link {
  text-decoration: none;
  color: inherit;
}

.project-title-link:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .project-thumb {
    float: none;
    display: block;
    margin: 0 0 0.75rem 0;
  }
}
