/* ==========================================================================
   Ahmad Lashkaripour — Website Stylesheet
   Design inspired by asukaeo.com: minimal, clean, generous whitespace
   ========================================================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Inter:wght@300;400;500&family=Playfair+Display:ital,wght@0,400;1,400&display=swap');

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 300;
  color: #000;
  background: #fff;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #000;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #F66;
}

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  padding: 24px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 48px;
  right: 48px;
  height: 1px;
  background: #000;
}

.site-name {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1;
}

.site-name a {
  color: #000;
  text-decoration: none;
}

.site-name a {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-name a:hover {
  color: #000;
}

.site-logo {
  height: 36px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav a {
  font-family: 'Barlow', sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #000;
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: #F66;
}

.site-nav a.active {
  color: #F66;
}

.nav-twitter {
  display: flex;
  align-items: center;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #000;
  margin: 5px 0;
  transition: 0.3s;
}

/* ---------- Main Content ---------- */
.main-content {
  min-height: calc(100vh - 180px);
}

/* ---------- Homepage Grid ---------- */
.works-grid {
  margin: 0;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.works-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  cursor: pointer;
}

.works-item a {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

.works-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.works-item:hover img {
  transform: scale(1.03);
}

.works-item .tile-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 24px;
  transition: background 0.3s ease;
}

.works-item:hover .tile-overlay {
  background: rgba(0, 0, 0, 0.25);
}

.works-item .tile-label {
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.works-item:hover .tile-label {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Content Page Layout ---------- */
.page-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 48px 80px;
}

.page-title {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 48px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}

/* ---------- About / Bio Page ---------- */
.about-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 80px 48px 80px;
}

.about-hero {
  display: flex;
  align-items: center;
  gap: 64px;
}

.about-hero-text {
  flex: 1;
  text-align: center;
}

.about-name {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: 32px;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  color: #000;
}

.about-subtitle {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  color: #555;
  margin-bottom: 32px;
}

.about-bio {
  font-size: 15px;
  line-height: 1.9;
  color: #333;
  text-align: left;
}

.about-hero-photo {
  flex-shrink: 0;
  width: 300px;
  height: 300px;
}

.about-hero-photo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.about-divider {
  border: none;
  border-top: 1px solid #ddd;
  margin: 64px 0;
}

.about-details {
  display: flex;
  gap: 64px;
}

.about-detail-col {
  flex: 1;
}

.about-detail-heading {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: 22px;
  margin-bottom: 20px;
  color: #000;
}

.about-detail-col p {
  font-size: 15px;
  line-height: 1.8;
  color: #333;
  margin-bottom: 4px;
}

.about-detail-col a {
  color: #000;
}

.about-detail-col a:hover {
  color: #F66;
}

/* Legacy bio styles kept for compatibility */
.bio-section {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  margin-bottom: 48px;
}

.bio-photo {
  flex-shrink: 0;
  width: 280px;
}

.bio-photo img {
  width: 100%;
  border-radius: 50%;
  aspect-ratio: 1;
  object-fit: cover;
}

.bio-text {
  flex: 1;
}

.bio-text p {
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.8;
  color: #333;
}

.bio-text a {
  color: #F66;
}

.bio-text a:hover {
  text-decoration: underline;
}

/* ---------- Research / Publications ---------- */
.section-heading {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.5px;
  margin-top: 56px;
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

.section-heading:first-child {
  margin-top: 0;
}

.paper {
  margin-bottom: 28px;
}

.paper-number {
  font-weight: 500;
  color: #000;
  margin-right: 4px;
}

.paper-title {
  font-weight: 600;
  color: #000;
  font-size: 15px;
  line-height: 1.5;
}

.paper-title a {
  color: #000;
  text-decoration: none;
  transition: color 0.2s;
}

.paper-title a:hover {
  color: #F66;
}

.paper-meta {
  font-size: 14px;
  color: #4D4D4D;
  margin-top: 2px;
  line-height: 1.5;
}

.paper-meta b,
.paper-meta strong {
  font-weight: 600;
}

.paper-links {
  margin-top: 6px;
  margin-left: 24px;
}

.paper-links a {
  font-size: 14px;
  color: #F66;
  margin-right: 12px;
  transition: color 0.2s;
}

.paper-links a:hover {
  color: #d44;
}

.paper-links .unavailable {
  font-size: 14px;
  color: #999;
  margin-right: 12px;
}

.paper-abstract {
  display: none;
  margin-top: 12px;
  margin-left: 24px;
  padding: 16px 20px;
  background: #f9f9f9;
  border-left: 3px solid #eee;
  font-size: 13.5px;
  line-height: 1.7;
  color: #555;
}

.paper-abstract.open {
  display: block;
}

/* ---------- Teaching ---------- */
.lecture-list {
  list-style: none;
}

.lecture-item {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 15px;
}

.lecture-item:last-child {
  border-bottom: none;
}

.lecture-number {
  font-weight: 500;
  color: #000;
  margin-right: 4px;
}

.lecture-item a {
  color: #000;
}

.lecture-item a:hover {
  color: #F66;
}

.lecture-item .code-link {
  color: #F66;
  font-weight: 600;
  font-size: 14px;
  margin-left: 8px;
}

.lecture-item .unavailable {
  color: #999;
}

/* ---------- Vita / CV ---------- */
.cv-actions {
  margin-bottom: 32px;
}

.btn {
  display: inline-block;
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 28px;
  border: 2px solid #000;
  color: #000;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn:hover {
  background: #000;
  color: #fff;
}

.cv-embed {
  width: 100%;
  height: 80vh;
  border: 1px solid #eee;
}

/* ---------- Contact Page ---------- */
.contact-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 48px 80px;
}

.contact-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 48px;
}

.contact-header-label {
  font-family: 'Barlow', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #000;
  flex-shrink: 0;
}

.contact-header-line {
  flex-shrink: 0;
  width: 60px;
  height: 2px;
  background: #000;
  align-self: center;
}

.contact-header-text {
  flex: 1;
}

.contact-header-text h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: 36px;
  line-height: 1.2;
  color: #000;
}

.contact-body {
  display: flex;
  gap: 64px;
  align-items: flex-start;
}

.contact-photo {
  flex: 1;
  max-width: 480px;
}

.contact-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.contact-details {
  flex: 1;
}

.contact-detail-item {
  font-size: 16px;
  font-weight: 500;
  color: #000;
  line-height: 1.8;
}

.contact-detail-item a {
  color: #000;
}

.contact-detail-item a:hover {
  color: #F66;
}

.contact-affiliation {
  margin-top: 40px;
}

.contact-affiliation h3 {
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: #000;
}

.contact-affiliation p {
  font-size: 15px;
  line-height: 1.8;
  color: #555;
}

.contact-affiliation a {
  color: #555;
}

.contact-affiliation a:hover {
  color: #F66;
}

/* Legacy contact styles */
.contact-info p {
  margin-bottom: 8px;
  font-size: 15px;
  color: #333;
}

.contact-info .contact-label {
  color: #F66;
  font-weight: 500;
  margin-right: 4px;
}

.contact-info a {
  color: #000;
}

.contact-info a:hover {
  color: #F66;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 40px 48px;
  border-top: 1px solid #eee;
  font-size: 12px;
  letter-spacing: 1px;
  color: #999;
  font-family: 'Barlow', sans-serif;
  text-transform: uppercase;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 16px;
  }

  .site-header {
    padding: 20px 32px;
  }

  .site-header::after {
    left: 32px;
    right: 32px;
  }

  .page-content {
    padding: 48px 32px 60px;
  }
}

@media (max-width: 768px) {
  .contact-body {
    flex-direction: column;
    gap: 40px;
  }

  .contact-photo {
    max-width: 100%;
  }

  .contact-header-text h2 {
    font-size: 28px;
  }

  .contact-page {
    padding: 32px 32px 60px;
  }

  .about-hero {
    flex-direction: column-reverse;
    gap: 32px;
    text-align: center;
  }

  .about-hero-photo {
    width: 220px;
    height: 220px;
  }

  .about-hero-text {
    text-align: center;
  }

  .about-bio {
    text-align: center;
  }

  .about-details {
    flex-direction: column;
    gap: 40px;
  }

  .about-page {
    padding: 48px 32px 60px;
  }

  .bio-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .bio-photo {
    width: 200px;
  }

  .site-nav {
    gap: 20px;
  }

  .site-name {
    font-size: 22px;
  }
}

@media (max-width: 600px) {
  .site-header {
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px;
    text-align: center;
  }

  .site-header::after {
    left: 24px;
    right: 24px;
  }

  .site-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 20px;
  }

  .works-grid {
    grid-template-columns: 1fr;
    padding: 24px 24px 48px;
    gap: 16px;
  }

  .page-content {
    padding: 32px 24px 48px;
  }

  .page-title {
    font-size: 20px;
    margin-bottom: 32px;
  }

  .site-footer {
    padding: 32px 24px;
  }
}
