/* Portfolio Frontend CSS */
:root {
  --primary-color: #2563eb;
  --secondary-color: #1e40af;
  --accent-color: #3b82f6;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-accent: #eff6ff;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

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

body {
  font-family: 'NanumSquare', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'NanumSquare', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

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

/* Layout */
.portfolio-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

.portfolio-sidebar {
  position: sticky;
  top: 2rem;
  height: fit-content;
}

@media (max-width: 1024px) {
  .portfolio-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .portfolio-sidebar {
    position: static;
  }
}

/* Header */
.portfolio-header {
  text-align: center;
  padding: 4rem 0 2rem;
  background: var(--bg-secondary);
  margin-bottom: 3rem;
  border-radius: 0 0 2rem;
  position: relative;
  overflow: hidden;
}

.portfolio-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-primary);
  opacity: 0.05;
  z-index: 1;
}

.portfolio-header>* {
  position: relative;
  z-index: 2;
}

.portfolio-title {
  font-family: 'NanumSquare', sans-serif;
  font-weight: 800;
  font-size: 3rem;
  margin-bottom: 0.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.8s ease-out;
}

.portfolio-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Content */
.portfolio-content {
  font-family: 'NanumSquare', sans-serif;
  font-weight: 400;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Sections */
.portfolio-section {
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--bg-primary);
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.portfolio-section:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.section-title {
  font-size: 1.75rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 3rem;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

#about-me {
  margin-bottom: 3rem;
}

#about-me p {
  text-align: center;
  color: var(--text-primary);

  &:first-child {
    font-size: 1.75rem;
  }

  &:last-child {
    font-size: 1.25rem;
  }
}

@media (max-width: 768px) {
  .section-title {
    font-size: 1.5rem;
  }
  
  #about-me p {
    &:first-child {
      font-size: 1.5rem;
    }
    &:last-child {
      font-size: 1rem;
    }
  }
}

/* Project Cards */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.project-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

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

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

.project-period {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.project-role {
  font-size: 0.875rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tech-tag {
  background: var(--bg-accent);
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.project-link:hover {
  color: var(--secondary-color);
  transform: translateX(4px);
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.skill-category {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
}

.skill-category h4 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.skill-list {
  list-style: none;
}

.skill-list li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.skill-list li:last-child {
  border-bottom: none;
}

/* Contact */
.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.contact-item:hover {
  background: var(--bg-accent);
  transform: translateY(-2px);
}

.contact-item a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

.contact-item a:hover {
  color: var(--secondary-color);
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .portfolio-title {
    font-size: 2rem;
  }

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

  .portfolio-section {
    padding: 1.5rem;
    margin-bottom: 2rem;
  }

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

  .project-card {
    padding: 0;
  }

  .project-card::before {
    display: none;
  }

  .project-info-container {
    padding: 1.5rem;
  }

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

  .contact-info {
    grid-template-columns: 1fr;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Selection */
::selection {
  background: var(--accent-color);
  color: white;
}

/* Blog Navigation Links */
.blog-nav-links {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  z-index: 10;
}

.blog-nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

.blog-nav-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--primary-color);
  text-decoration: none;
  background: rgba(255, 255, 255, 1);
}

.blog-nav-link i {
  font-size: 1rem;
  color: var(--primary-color);
}

.blog-nav-link span {
  font-weight: 600;
}

@media (max-width: 768px) {
  .blog-nav-links {
    top: 1rem;
    left: 1rem;
    gap: 0.5rem;
  }

  .blog-nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }

  .blog-nav-link i {
    font-size: 1.1rem;
  }
}

.project-desc {
  margin: 1rem 0 0.5rem 0;
  padding-left: 1.2rem;
  color: var(--text-primary);
  font-size: 0.95em;
  line-height: 1.6;
}

.project-desc li {
  list-style: disc;
  margin-bottom: 0.3em;
}

.project-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  justify-content: center;
  align-items: center;
}

.project-modal.active {
  display: flex;
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .project-image-placeholder {
    height: 300px;
    font-size: 0.9rem;
    margin-bottom: 0;
  }
}

.modal-content {
  background: #fff;
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  max-width: 400px;
  width: 90vw;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  position: relative;
  animation: fadeInModal 0.3s;
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-content ul {
  margin: 0 0 1rem 1.2rem;
  color: var(--text-primary);
  font-size: 1em;
  line-height: 1.7;
}

.modal-content li {
  margin-bottom: 0.5em;
  list-style: disc;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #888;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #222;
}

@keyframes fadeInModal {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-large {
  max-width: 1100px;
  width: 90vw;
  min-height: 400px;
  max-height: 85vh;
  padding: 2.5rem 2.5rem;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-flex {
  display: flex;
  gap: 2.5rem;
  flex-wrap: nowrap;
}

.modal-left {
  flex: 1 1 340px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}

.modal-left-top {
  display: flex;
  flex-direction: column;
}

.modal-left-bottom {
  margin-top: auto;
}

.modal-right {
  flex: 1 1 340px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1.5rem;
}

.modal-right .project-tech {
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 900px) {
  .modal-flex {
    flex-direction: column;
    gap: 1.5rem;
  }
  .modal-left, .modal-right {
    min-width: 0;
    width: 100%;
  }
  .modal-left-bottom {
    margin-top: 1rem;
  }
  .modal-close {
    right: -1rem;
  }
}

.portfolio-title,
#about-me p {
  transition: all 0.3s ease;
}

.project-image-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  height: auto;
  background: #f3f4f6;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.75rem;
}

@media (max-width: 900px) {  
  .project-header-sticky {
    position: absolute;
    top: 0;
    background: #fff;
    padding: 2rem 0 1rem 0;
    margin: -1rem 0 1rem 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
    position: -webkit-sticky;
    position: sticky;
  }
  
  .project-header-sticky .project-title {
    margin-bottom: 0.5rem;
  }
  
  .project-header-sticky .project-period {
    margin-bottom: 0;
  }
  
  .modal-large {
    overflow-y: auto;
    max-width: 90vw;
    padding: 0 2rem;
    max-height: 85vh;
    position: relative;
  }
  
  .modal-flex {
    min-height: 0;
    gap: 1.2rem;
    overflow: visible;
    position: relative;
  }
  
  .modal-left {
    min-width: 0;
    overflow: visible;
    position: relative;
  }
  
  .modal-left-top {
    overflow: visible;
    position: relative;
  }
}

.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }
  .desktop-only {
    display: none;
  }
}