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

:root {
  --primary-color: #fbd144;
  --secondary-color: #ffe066;
  --text-color: #1a1a1a;
  --text-light: #666;
  --bg-color: #fff;
  --bg-light: #f8f9fa;
  --bg-dark: #1a1a1a;
  --border-color: #e9ecef;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s ease;
  --section-padding: 100px;
  --container-padding: 40px;
  --gap-small: 1rem;
  --gap-medium: 2rem;
  --gap-large: 4rem;
}

body.dark-mode {
  --text-color: #ffffff;
  --text-light: #b0b0b0;
  --bg-color: #0a0a0a;
  --bg-light: #1a1a1a;
  --bg-dark: #0a0a0a;
  --border-color: #2a2a2a;
  --shadow: 0 1px 3px rgba(255, 255, 255, 0.08);
  --shadow-hover: 0 4px 12px rgba(255, 255, 255, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system,
    BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI",
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

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

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ===== Theme Toggle Button ===== */
.theme-toggle {
  position: fixed;
  top: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 1000;
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  transform: rotate(20deg) scale(1.05);
}

.theme-toggle:hover svg {
  stroke: white;
}

.theme-toggle svg {
  transition: var(--transition);
  stroke: var(--text-color);
}

.sun-icon {
  display: none;
}

.moon-icon {
  display: block;
}

body.dark-mode .sun-icon {
  display: block;
}

body.dark-mode .moon-icon {
  display: none;
}

/* ===== Container ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header & Navigation ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg-color);
  box-shadow: none;
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-color);
  font-family: "Georgia", serif;
  font-style: italic;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-menu {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-link {
  font-weight: 400;
  font-size: 0.95rem;
  transition: var(--transition);
  color: var(--text-color);
  position: relative;
}

.nav-link:hover {
  color: var(--primary-color);
}

.nav-link::after {
  display: none;
}

.btn-contact {
  padding: 10px 24px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
}

.btn-contact:hover {
  background-color: #3443dd;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(67, 83, 255, 0.3);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--text-color);
  transition: var(--transition);
}

/* ===== Hero Section ===== */
.hero {
  padding: 0;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  background: var(--bg-color);
  color: var(--text-color);
  position: relative;
  overflow: hidden;
}

.hero-bg-shape {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 400px;
  background: linear-gradient(180deg, transparent 0%, var(--bg-light) 100%);
  border-radius: 50% 50% 0 0 / 15% 15% 0 0;
  z-index: 0;
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
  animation: fadeInUp 1s ease;
  line-height: 1.2;
}

.highlight {
  color: var(--text-color);
  font-weight: 800;
}

.hero-subtitle {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: var(--text-light);
  font-weight: 400;
  animation: fadeInUp 1s ease 0.2s;
  animation-fill-mode: both;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.scroll-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-color);
  background-color: var(--bg-light);
  transition: var(--transition);
  animation: fadeInUp 1s ease 0.4s, bounce 2s ease-in-out infinite;
  animation-fill-mode: both;
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 10;
}

.scroll-down:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateX(-50%) rotate(20deg) scale(1.05);
}

.scroll-down:hover svg {
  stroke: white;
}

.scroll-down svg {
  transition: var(--transition);
  stroke: var(--text-color);
}

@keyframes bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-10px);
  }
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: #5a52d5;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(108, 99, 255, 0.4);
}

.btn-secondary {
  background-color: transparent;
  color: white;
  border-color: white;
}

.btn-secondary:hover {
  background-color: white;
  color: var(--primary-color);
}

.btn-small {
  padding: 8px 20px;
  font-size: 0.9rem;
}

/* ===== Section Styles ===== */
.section {
  padding: var(--section-padding) 0;
}

/* 공통 섹션 레이아웃 (재사용) */
.section-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: start;
}

/* 공통 섹션 헤더 (재사용) */
.section-header {
  position: sticky;
  top: 100px;
}

/* 공통 섹션 타이틀 (재사용) */
.section-large-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* 공통 콘텐츠 컨테이너 (재사용) */
/* .section-content {
  padding-top: var(--gap-small);
} */

/* 공통 서브타이틀 (재사용) */
.section-subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.6;
  margin-bottom: var(--gap-medium);
  word-break: keep-all;
}

/* 공통 설명 텍스트 (재사용) */
.section-description {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 2.5rem;
  word-break: keep-all;
}

/* 공통 본문 텍스트 (재사용) */
.section-text {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  word-break: keep-all;
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 2px;
}

/* ===== About Section ===== */
.about {
  background-color: var(--bg-color);
  padding: var(--section-padding) 0;
  position: relative;
  z-index: 2;
}

.about-contact {
  display: flex;
  flex-direction: column;
  gap: var(--gap-small);
  margin-top: 2.5rem;
}

/* 재사용 가능한 링크 스타일 */
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text-color);
  font-size: 0.95rem;
  transition: var(--transition);
  width: fit-content;
}

.contact-link:hover {
  color: var(--primary-color);
}

.contact-link svg {
  flex-shrink: 0;
}

.about-image-large {
  width: 100%;
  margin-top: 3rem;
}

/* 재사용 가능한 이미지 스타일 */
.profile-image {
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  object-fit: cover;
  display: block;
}

/* ===== Experience Section ===== */
.experience {
  background-color: var(--bg-color);
  padding: var(--section-padding) 0;
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* 재사용 가능한 리스트 아이템 스타일 */
.experience-item {
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border-color);
}

.experience-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.experience-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: var(--gap-small);
}

.experience-role {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
}

.experience-period {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
}

.experience-company {
  font-size: 0.9rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: var(--gap-small);
}

.experience-description {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.8;
}

/* ===== Projects Section ===== */
.projects {
  background-color: var(--bg-color);
  padding: var(--section-padding) 0;
}

/* 재사용 가능한 그리드 시스템 */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap-medium);
}

/* 재사용 가능한 카드 스타일 */
.project-card {
  position: relative;
  background-color: var(--bg-light);
  border-radius: 16px;
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

/* 그리드 레이아웃 패턴 */
.project-card:nth-child(1) {
  grid-column: span 6;
}
.project-card:nth-child(2) {
  grid-column: span 6;
}
.project-card:nth-child(3) {
  grid-column: span 7;
}
.project-card:nth-child(4) {
  grid-column: span 5;
}
.project-card:nth-child(5) {
  grid-column: span 5;
}
.project-card:nth-child(6) {
  grid-column: span 7;
}
.project-card:nth-child(7) {
  grid-column: span 7;
}
.project-card:nth-child(8) {
  grid-column: span 5;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* 재사용 가능한 미디어 컨테이너 */
.project-image {
  width: 100%;
  height: 240px;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
  opacity: 0;
}

.project-image img[src*=".jpg"],
.project-image img[src*=".png"],
.project-image img[src*=".gif"] {
  opacity: 1;
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

.project-icon {
  width: 100%;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-color);
  flex-shrink: 0;
  background-size: cover;      
  background-position: center; 
  background-repeat: no-repeat; 
}

.project-icon svg {
  transition: var(--transition);
}

.project-card:hover .project-icon svg {
  transform: scale(1.1);
}

.project-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: var(--gap-small);
}

.project-description {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  word-break: keep-all;
}

/* 재사용 가능한 태그 컨테이너 */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: auto;
}

/* 재사용 가능한 태그 스타일 */
.project-tag {
  display: inline-block;
  padding: 6px 16px;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.85rem;
  font-weight: 500;
}

/* 재사용 가능한 오버레이 버튼 */
.project-link-overlay {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  background-color: var(--bg-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  opacity: 0;
}

.project-card:hover .project-link-overlay {
  opacity: 1;
}

/* 조건부 표시 */
.project-card:has(.project-image) .project-link-overlay,
.project-card:has(.project-icon) .project-link-overlay {
  display: flex;
}

.project-card:not(:has(.project-image)):not(:has(.project-icon))
  .project-link-overlay {
  display: none;
}

.project-link-overlay svg {
  transition: var(--transition);
  stroke: var(--text-color);
}

/* ===== Skills Section ===== */
.skills {
  background-color: var(--bg-color);
  padding: var(--section-padding) 0;
}

/* 재사용 가능한 태그 그리드 */
.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-small);
  margin-top: 1.5rem;
}

/* 재사용 가능한 스킬 태그 */
.skill-tag {
  display: inline-block;
  padding: 6px 16px;
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-color);
  font-size: 0.85rem;
  font-weight: 400;
  transition: var(--transition);
  cursor: default;
}

.skill-tag:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
  border-color: var(--text-color);
}

/* ===== Contact Section ===== */
.contact {
  background-color: var(--bg-color);
  padding: var(--section-padding) 0;
}

/* 재사용 가능한 언더라인 링크 */
.contact-email,
.contact-resume {
  color: var(--text-color);
  text-decoration: underline;
  font-weight: 600;
  transition: var(--transition);
}

.contact-email:hover,
.contact-resume:hover {
  color: var(--primary-color);
}

/* ===== Footer ===== */
.footer {
  background-color: #2a2a2a;
  color: #e0e0e0;
  text-align: center;
  padding: 2rem 0;
  font-size: 0.85rem;
  font-weight: 300;
}

/* ===== Scroll to Top Button ===== */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow);
  z-index: 999;
}

.scroll-top.show {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateY(-5px) scale(1.05);
}

.scroll-top:hover svg {
  stroke: white;
}

.scroll-top svg {
  transition: var(--transition);
  stroke: var(--text-color);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Responsive Design ===== */

/* Tablet (768px 이하) */
@media (max-width: 768px) {
  :root {
    --section-padding: 60px;
    --container-padding: 20px;
  }

  .nav-right {
    position: fixed;
    left: -100%;
    top: 80px;
    flex-direction: column;
    background-color: var(--bg-color);
    width: 100%;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
    padding: var(--gap-medium) 0;
    gap: 1.5rem;
  }

  .nav-right.active {
    left: 0;
  }

  .nav-menu {
    flex-direction: column;
    gap: 1.5rem;
  }

  .menu-toggle {
    display: flex;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .section-layout {
    grid-template-columns: 1fr;
    gap: var(--gap-medium);
  }

  .section-header {
    position: static;
  }

  .section-large-title {
    font-size: 2.5rem;
  }

  .about-subtitle {
    font-size: 1.3rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .projects-grid {
    display: block;
  }

  .project-card {
    width: 100%;
    margin-bottom: 1.5rem;
  }

  .project-card:last-child {
    margin-bottom: 0;
  }

  .project-image,
  .project-icon {
    height: 220px;
  }

  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--gap-medium);
  }

  .contact-header,
  .contact-title {
    position: static;
    font-size: 2.5rem;
  }
}

/* Mobile (480px 이하) */
@media (max-width: 480px) {
  .container {
    padding: 0 24px;
  }

  .nav-container {
    padding: 0 24px;
  }

  .theme-toggle {
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .about-subtitle {
    font-size: 1.1rem;
  }

  .about-text {
    font-size: 0.95rem;
  }

  .experience-role {
    font-size: 1.2rem;
  }

  .experience-description {
    font-size: 0.9rem;
  }

  .section-description {
    font-size: 0.95rem;
  }

  .skill-tag {
    padding: 10px 20px;
    font-size: 0.85rem;
  }

  .section-title {
    font-size: 1.8rem;
    margin-bottom: var(--gap-medium);
  }

  .btn {
    padding: 10px 25px;
    font-size: 0.9rem;
  }

  .btn-contact {
    padding: 8px 20px;
    font-size: 0.85rem;
  }

  .scroll-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
  }
}

/* Large Desktop (1400px 이상) */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }

  .hero-title {
    font-size: 4.5rem;
  }

  .section-title {
    font-size: 3rem;
  }
}
