:root {
  --primary-blue: #4169E1;
  --accent-blue-light: #5A7EEB;
  --bg-white: #FFFFFF;
  --bg-light-gray: #F5F7FA;
  --text-dark: #333333;
  --text-muted: #777777;
  --border-color: #E1E5EB;
  --font-family-base: 'Roboto', sans-serif;
  --base-font-size: 16px; 
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--base-font-size);
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-white);
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.flex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}

.bg-light {
  background-color: var(--bg-light-gray);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
}

.btn {
  display: inline-flex; /* inline-block 대신 flex로 변경 추천 */
  align-items: center;
  gap: 10px;
  padding: 0.75rem 2rem;
  border-radius: 4px; /* ✨ 전체 일관성을 위해 4px로 통일 */
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  text-decoration: none;
}

/* 2. 주 버튼 (꽉 찬 색상) */
.btn-primary {
  background-color: var(--primary-blue);
  color: #fff;
  border: 2px solid var(--primary-blue);
}

.btn-primary:hover {
  background-color: var(--accent-blue-light);
}

.btn-solid-blue {
  background-color: var(--primary-blue);
  color: #fff;
  border: 2px solid var(--primary-blue);
}

.btn-solid-blue:hover {
  background-color: var(--accent-blue-light);
  border-color: var(--accent-blue-light);
}

.btn-outlined-blue {
  background-color: transparent;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
}

.btn-outlined-blue:hover {
  background-color: var(--bg-light-gray);
}

header {
  background-color: var(--bg-white);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header .logo {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-dark);
}

header nav ul {
  display: flex;
  gap: 1.5rem;
}

header nav a {
  font-weight: 400;
  font-size: 1rem;
  color: var(--text-dark);
}

header nav a:hover {
  color: var(--primary-blue);
}

.hero {
  padding: 5rem 0; 
  background-color: var(--bg-white);
}

.hero .hero-text {
  flex: 1;
}

.hero h2 {
  font-size: 2.5rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
}

.hero .tagline {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.container.flex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero .hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
  position: relative;
}

.hero .profile-photo-placeholder {
  width: 100%;
  max-width: 450px; 
  height: 350px;
  /* background-color: #eee; */
  display: flex;
  align-items: center;
  justify-content: center;
  /* color: var(--text-muted);
  font-size: 1.25rem;
  border-radius: 8px; */
  overflow: hidden;
  border-radius: 24px; 
  background: linear-gradient(145deg, #eeeeee, #f5f5f5);
  transition: var(--transition);
}

.hero .profile-photo {
  width: auto;
  height: 100%;
  object-fit: cover; 
  display: block; 
}

.about {
  padding: 5rem 0;
}

.about h3 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.about .about-content {
  flex: 1;
  font-size: 1rem;
  color: var(--text-dark);
}

.about .skills-content {
  flex: 1;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.skill-item {
  background-color: var(--bg-white);
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-item i {
  color: var(--primary-blue);
  font-size: 1.25rem;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5); 
  z-index: 2000; 
  justify-content: center;
  align-items: center;
}

body.modal-active {
  overflow: hidden; 
}

.modal-overlay.show {
  display: flex; 
}

.modal-content {
  background-color: var(--bg-white);
  width: 100%;
  max-width: 900px; 
  max-height: 90vh; 
  padding: 3rem;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); 
  overflow-y: auto; 
  position: relative; 
}

.modal-title {
  font-size: 2rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 2rem;
  text-align: center; 
}

.close-modal {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: var(--primary-blue); 
}

.modal-body-text {
  font-size: 1rem;
  color: var(--text-dark);
  margin-bottom: 2rem;
}

.modal-body-text p {
  margin-bottom: 1rem;
}

.detail-block {
  margin-bottom: 2rem;
}

.detail-block h3 {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.detail-block h3 i {
  color: var(--primary-blue); 
}

.detail-block ul {
  list-style: disc; 
  padding-left: 1.5rem;
  color: var(--text-muted);
}

.detail-block ul li {
  margin-bottom: 0.5rem;
}

.modal-content .close-btn {
  display: block; 
  margin: 0 auto;
}

.projects {
  padding: 5rem 0;
  background-color: var(--bg-white);
}

.projects-grid {
  max-height: 50em;
  display: grid;
  overflow-y: auto;
  grid-template-columns: repeat(auto-fit, minmax(350px, 350px));
  gap: 2rem;
  animation: fadeIn 0.4s ease-out;
  scroll-behavior: smooth;
  -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
  padding-right: 15px;
}

.projects-grid::-webkit-scrollbar {
  width: 6px;
}

.projects-grid::-webkit-scrollbar-thumb {
  background-color: var(--primary-blue); 
  border-radius: 10px;
}

.projects-grid::-webkit-scrollbar-track {
  background-color: #f1f1f1;
  border-radius: 10px;
}

.project-card {
  cursor: pointer;
  background-color: var(--bg-white);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.project-card:hover {
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.card-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-thumb-placeholder {
  width: 90%;
  height: 200px;
  background-color: #FFFFFF; /* EEE */
  display: flex;
  align-items: center;
  margin-top: 10px;
  margin-right: 5px;
  justify-content: center;
  color: var(--text-muted);
}
.project-thumb {
    height: 100%;
    width: auto;
}

.project-card .card-content {
  padding: 1.5rem;
}

.project-card h4 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.project-one-liner {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tag {
  background-color: var(--bg-light-gray);
  color: var(--primary-blue);
  font-size: 0.875rem;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* 필터 바 컨테이너 */
.filter-group {
    display: flex;
    justify-content: flex-start; /* 지난번 결정에 따라 왼쪽 정렬 추천 */
    gap: 12px;
    margin-bottom: 2.5rem;
    flex-wrap: wrap; /* 모바일 대응 */
}

/* 필터 버튼 기본 스타일 */
.filter-btn {
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-muted);
    border-radius: 4px; /* 기존 버튼과 통일 */
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

/* 활성화된 필터 버튼 (선택된 상태) */
.filter-btn.active {
    background-color: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
    box-shadow: 0 4px 10px rgba(65, 105, 225, 0.2);
}

.card-buttons {
  display: flex;
  gap: 1rem;
}

.project-detail {
  display: none;
  padding-top: 1rem;
  padding-bottom: 3rem;
  animation: fadeIn 0.4s ease-out;
}

.project-detail > button {
  background-color: transparent;
  border: 1px solid var(--border-color, #E1E5EB);
  padding: 0.5rem 1.2rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted, #777);
  margin-bottom: 2rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
}

#detail-content {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: start;
}

#detail-content h4 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark, #333);
  margin-bottom: 1rem;
}

#detail-content p {
  font-size: 1.05rem;
  color: var(--text-muted, #555);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.project-detail > button:hover {
  background-color: var(--bg-light-gray, #F5F7FA);
  color: var(--primary-blue, #4169E1);
  border-color: var(--primary-blue, #4169E1);
}

.detail-visual-area {
  display: flex;
  flex-direction: column;
  gap: 2rem; 
}

.architecture-card {
  background-color: var(--bg-white, #ffffff);
  border: 1px solid var(--border-color, #E1E5EB);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03); 
}

.architecture-card h4 {
  font-size: 1.1rem;
  color: var(--primary-blue, #4169E1);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem; 
}

.architecture-img-wrapper {
  height: 350px; 
  background-color: var(--bg-light-gray, #F5F7FA); 
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center; 
  justify-content: center; 
}

.architecture-img-wrapper img {
  max-height: 100%; 
  width: auto; 
  object-fit: contain;
}

.detail-info-area {
  position: sticky;
  top: 100px; 
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.info-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-section h4 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-dark, #333);
  border-bottom: 2px solid var(--border-color, #E1E5EB);
  padding-bottom: 0.5rem;
}

.info-section ul {
  padding-left: 1.2rem;
  color: var(--text-muted, #555);
  line-height: 1.8;
}

.info-section li {
  margin-bottom: 0.5rem;
}

#detail-title {
  font-size: 2.5rem !important; 
  font-weight: 700;
  color: var(--text-dark, #111) !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.study {
  padding: 80px 0;
}

.study-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 1000px; /* 너무 퍼지지 않게 너비 제한 */
  margin: 0 auto;
}

.study-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  border-left: 5px solid #007bff; 
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  cursor: pointer;
}

.study-card:hover {
  transform: translateX(8px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  background-color: #fff;
}

.study-icon {
  font-size: 1.5rem;
  color: #007bff;
  background: #e7f1ff;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  flex-shrink: 0; /* 아이콘 크기 고정 */
}

.study-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #007bff;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.study-card h4 {
  margin: 0 0 8px 0;
  font-size: 1.15rem;
  line-height: 1.4;
  color: #333;
}

.study-summary {
  margin: 0;
  font-size: 0.95rem;
  color: #666;
  line-height: 1.6;
}

.view-all-container {
    text-align: center;
    margin-top: 40px;
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-blue);
  color: var(--primary-blue);
}

.btn-outline:hover {
    background-color: #007bff;
    color: #fff;
    transform: translateY(-3px);
}

.btn-outline i {
    transition: transform 0.3s ease;
}

.btn-outline:hover i {
    transform: translateX(5px); /* 화살표가 옆으로 슥 밀리는 효과 */
}

.code {
  padding: 5rem 0;
}

.code .code-viewer {
  flex: 1.5;
}

.code h3 {
  /* font-size: 1.5rem; */
  margin-bottom: 1.5rem;
}

.code .code-block {
  background-color: #1E1E1E;
  color: #D4D4D4;
  font-family: 'Consolas', 'Monaco', monospace;
  padding: 1.5rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.9rem;
}

.code-block code {
  font-family: 'Fira Code', 'Roboto Mono', monospace; /* 디자인적 가독성 우수 */
  font-size: 0.95rem;
  line-height: 1.7;
  color: #ABB2BF; /* 기본 글자색 (연한 그레이) */
}

/* 요소별 컬러링 */
.code-keyword { color: #C678DD; font-weight: bold; } /* def, while, if, for, return, in, True, False */
.code-function { color: #61AFEF; }                /* miller_rabin, pow, range */
.code-number   { color: #D19A66; }                /* 모든 숫자 데이터 */
.code-comment  { color: #5C6370; font-style: italic; }

.code .code-description {
  flex: 1;
}

.view-repo {
  color: var(--primary-blue);
  font-weight: 500;
  font-size: 1rem;
  margin-top: 1.5rem;
  display: inline-block;
}

.view-repo:hover {
  color: var(--accent-blue-light);
}

footer {
  padding: 5rem 0;
  background-color: var(--bg-white);
  text-align: center;
  border-top: 1px solid var(--border-color);
}

footer h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

footer p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.social-links a {
  color: var(--primary-blue);
}

.social-links a:hover {
  color: var(--accent-blue-light);
}

.copyright {
  font-size: 0.875rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .flex-row {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  
  .hero-image, .hero-image .profile-photo-placeholder, .hero-image .profile-photo {
    justify-content: center;
    max-width: 300px;
    height: 250px;
  }

  .profile-photo-placeholder img {
    max-width: auto;
    height: 250px;
  }
  
  .hero h2 {
    font-size: 2rem;
  }
  
  header .container, header nav ul {
    flex-direction: column;
    gap: 1rem;
  }
  
  .code .code-viewer {
    width: 100%;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .study-grid {
    grid-template-columns: 1fr;
    padding: 0 20px;
  }
}

@media (max-width: 992px) {
  #detail-content {
    grid-template-columns: 1fr; 
    gap: 2rem;
  }
}