/* ==========================================================================
   1. Root Variables & Reset
   ========================================================================== */
:root {
  --bg-deep: #0a0f1d;
  --bg-card: rgba(20, 30, 50, 0.7);
  --accent: #c5a358;
  --accent-light: #e2d1a7;
  --gold-gradient: linear-gradient(to bottom, #f1e5ac, #a67c00);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --border-color: rgba(212, 175, 55, 0.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Pretendard', sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

/* Gold Gradient Text Utility */
.gradient-text, .logo, .section-title, .profile-info .name, 
.project-card h3, .modal-header h2, .info-label, 
.skills-list span, .career-box h4, .filter.active {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* ==========================================================================
   2. Background Decoration
   ========================================================================== */
.bg-decoration {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  background-color: var(--bg-deep);
}

#network-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
}

.grid-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  background-image: linear-gradient(var(--border-color) 1px, transparent 1px), 
                    linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
  opacity: 0.15;
}

.spotlight {
  position: absolute;
  width: 600px; height: 600px;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.05) 0%, transparent 70%);
  filter: blur(50px);
  animation: float 20s infinite alternate;
}
.spotlight-1 { top: -10%; left: -10%; }
.spotlight-2 { bottom: -10%; right: -10%; animation-delay: -10s; }

@keyframes float {
  from { transform: translate(0, 0); }
  to { transform: translate(100px, 100px); }
}

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

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  backdrop-filter: blur(15px);
  background: rgba(10, 15, 29, 0.8);
  border-bottom: 1px solid var(--border-color);
}

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

.logo { font-weight: 600; text-decoration: none; letter-spacing: 1px; }
.nav-menu { display: flex; list-style: none; gap: 30px; }
.nav-menu a { text-decoration: none; color: var(--text-secondary); font-size: 0.9rem; transition: 0.3s; }
.nav-menu a:hover {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   4. Sections Shared Styles
   ========================================================================== */
.section-title { font-size: 2rem; margin-bottom: 30px; position: relative; }
.section-title::after {
  content: '';
  position: absolute;
  bottom: -5px; left: 0;
  width: 40px; height: 3px;
  background: var(--accent);
}

/* ==========================================================================
   5. Profile Section
   ========================================================================== */
.profile-section { padding-top: 120px; }
.profile-card {
  display: flex;
  align-items: center;
  gap: 50px;
  padding: 50px;
  border-radius: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
}

.profile-img-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 165px; height: 213px;
  aspect-ratio: 165 / 213;
}
.profile-img-wrapper::before {
  content: '';
  position: absolute;
  top: -8px; left: -8px;
  width: 100%; height: 98%;
  z-index: -1;
  border: 1px solid var(--accent);
  border-radius: 20px;
}
.profile-img { width: 100%; height: 100%; border-radius: 15px; object-fit: cover; }
.profile-info .name { font-size: 1.7rem; margin-top: -10px; margin-bottom: 30px; display: block; }
.profile-info .intro { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 15px; color: #dedede; }
.profile-info .impact { color: #e1e1a9; }

/* ==========================================================================
   6. Projects Section & Grid
   ========================================================================== */
.project-header-flex { display: flex; justify-content: flex-start; align-items: center; gap: 30px; }
.project-filter { margin-bottom: 10px; }
.project-filter .filter { cursor: pointer; color: var(--text-secondary); margin-left: 17px; font-size: 0.9rem; transition: 0.3s; }

.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; }

/* Project Card Wrapper & Animation */
.project-card-wrapper { position: relative; z-index: 1; transition: 0.3s; }
.project-card-wrapper:hover { transform: translateY(-5px); }

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  border-radius: 15px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(5px);
  transition: 0.3s;
}
.project-card-wrapper:hover .project-card {
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.15);
}

/* Badges */
.badge-container {
  position: absolute;
  top: -8px; left: -8px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
  transition: 0.3s;
}

.project-badge, .best-badge {
  width: 45px; height: 45px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.project-badge { background: #1a1a1a; border: 1px solid #707070; font-size: 0.7rem; font-weight: 800; color: #dcdcdc; }
.best-badge {
  background: #000;
  border: 1px solid var(--accent);
  font-size: 0.6rem; font-weight: 900; color: var(--accent);
  animation: badge-glow 2s infinite alternate;
}

@keyframes badge-glow {
  from { box-shadow: 0 0 5px rgba(197, 163, 88, 0.2); }
  to { box-shadow: 0 0 15px rgba(197, 163, 88, 0.5); }
}

.project-img-box { width: 100%; height: 160px; overflow: hidden; background: #000; }
.project-img-box img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; transition: 0.3s; }
.project-card-wrapper:hover .project-img-box img { opacity: 1; }
.project-card .card-content { padding: 16px; text-align: center; }
.project-card h3 { line-height: 1.3; font-size: 1.05rem; }

/* ==========================================================================
   7. Modal Details
   ========================================================================== */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 2000;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(1px);
  padding-top: 50px;
}

.modal-content {
  position: relative;
  width: 90%; max-width: 1300px; height: 60vh;
  margin: 7vh auto;
  padding: 40px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--bg-deep);
  border: 1px solid var(--border-color);
}

.close-modal {
  position: absolute;
  top: 20px; right: 25px;
  z-index: 100;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
}
.close-modal:hover {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-body { display: flex; gap: 40px; height: 100%; align-items: stretch; }
.modal-left { 
  flex: 2; height: 100%; margin: auto; 
  position: relative; overflow: hidden;
  background-color: #050505; border-radius: 15px; 
}

/* Modal Ratios */
.ratio-16-9 { aspect-ratio: 16 / 9; }
.ratio-3-4 { aspect-ratio: 9 / 19.5; height: 100% !important; max-width: 320px; }

/* Modal Slider */
.slider-container { width: 100%; height: 100%; position: relative; }
.slider-track { display: flex; width: 100%; height: 100%; transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.slider-track img { width: 100%; height: 100%; object-fit: cover; flex-shrink: 0; } 

.slider-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 35px; height: 35px; border-radius: 50%; border: none;
  background: rgba(0,0,0,0.3); color: #fff; cursor: pointer; font-size: 1rem; transition: 0.3s;
}
.slider-nav:hover { background: var(--accent); color: #000; }
.prev { left: 10px; } .next { right: 10px; }

.slider-dots { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; gap: 8px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.3); cursor: pointer; }
.dot.active { background: var(--accent); width: 15px; border-radius: 10px; }

.modal-right { flex: 1; display: flex; flex-direction: column; height: 100%; min-width: 0; }
.modal-date-row { margin-bottom: 8px; display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--text-secondary); }
.duration-badge { background: rgba(212, 175, 55, 0.15); color: var(--accent); padding: 2px 10px; border-radius: 6px; font-weight: 600; font-size: 0.75rem; }
.modal-header h2 { font-size: 1.5rem; margin-bottom: 10px; line-height: 1.3; }
.modal-hashtags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.tag { font-size: 0.7rem; color: var(--text-secondary); padding: 3px 10px; border-radius: 6px; border: 1px solid var(--border-color); background: rgba(255,255,255,0.05); }

.modal-scroll-area { flex-grow: 1; overflow-y: auto; padding-right: 15px; margin-bottom: 15px; }
.modal-scroll-area::-webkit-scrollbar { width: 4px; }
.modal-scroll-area::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }

.info-label { font-size: 0.7rem; font-weight: 800; letter-spacing: 1.2px; margin-bottom: 10px; }
.modal-summary, .modal-role { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.7; margin-bottom: 25px; white-space: pre-line; }

.modal-stacks { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 25px; }
.stack-item { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.stack-item img { width: 30px; height: 30px; object-fit: contain; }
.stack-item span { font-size: 0.7rem; color: var(--text-secondary); }

.modal-link-group { display: flex; gap: 10px; padding-top: 20px; border-top: 1px solid var(--border-color); }
.modal-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; 
  padding: 12px 10px; border-radius: 10px; text-decoration: none; font-size: 0.75rem; 
  font-weight: 600; transition: 0.3s; white-space: nowrap;
}
.btn-notion { background: #fff; color: #000; }
.btn-notion img { width: 16px; height: 16px; } 
.btn-github { background: #24292e; color: #fff; }
.btn-doc { background: rgba(212, 175, 55, 0.1); color: var(--accent); border: 1px solid var(--border-color); }
.modal-btn:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.modal-btn.disabled { opacity: 0.4; cursor: not-allowed; filter: grayscale(1); pointer-events: none; }
.modal-btn.disabled::after { content: ' (준비중)'; font-size: 0.65rem; opacity: 0.8; }

/* ==========================================================================
   8. Skills & Career(Edu, Cert) Section
   ========================================================================== */
.skills-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; list-style: none; }
.skills-list li {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 160px; padding: 25px 15px; border-radius: 15px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  backdrop-filter: blur(5px); transition: 0.3s;
  position: relative; overflow: hidden;
}
.skills-list li:hover { box-shadow: 0 10px 30px rgba(212, 175, 55, 0.15); }
.img-box { height: 60px; display: flex; align-items: center; justify-content: center; margin-bottom: 15px; }
.skills-list img { max-width: 50px; max-height: 50px; filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.4)); }
.skills-list span { display: block; font-size: 0.95rem; font-weight: 600; text-align: center; }

/* Skills Progress Bar */
.skill-progress {
  position: absolute; bottom: 0; left: 0;
  width: 100%; height: 7px;
}
.progress-fill {
  width: 0; height: 100%;
  background: var(--gold-gradient);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Data-Driven Special Overlay */
.skill-learned {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg-card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; transition: 0.3s;
  border-radius: 15px; z-index: 2;
}
.skill-learned p { font-size: 0.75rem; font-weight: 700; color: var(--accent-light); margin: 3px 0; }
.special-skill:hover .skill-learned { opacity: 1; backdrop-filter: blur(8px); }

.career-grid { display: flex; gap: 50px; align-items: stretch; }
.career-group { flex: 1; display: flex; flex-direction: column; }
.career-box {
  display: flex; flex-direction: column; flex-grow: 1;
  padding: 45px 35px; border-radius: 20px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  backdrop-filter: blur(5px);
}
.balance-box { justify-content: space-between; min-height: 400px; }
.career-box h4 { font-size: 1.15rem; margin-bottom: 8px; }
.career-box p { font-size: 0.95rem; color: var(--text-secondary); }
.career-box .item { padding: 10px 0; }

/* ==========================================================================
   9. Contact & Footer
   ========================================================================== */
.contact-links { display: flex; justify-content: center; gap: 40px; padding: 60px 0; }
.contact-item {
  width: 85px; height: 85px; padding: 0; outline: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border-color); backdrop-filter: blur(5px);
  font-size: 2rem; text-decoration: none; cursor: pointer; transition: 0.3s;
}
.gmail-btn img { width: 35px; filter: none !important; }
.velog-btn img { width: 45px; filter: none !important; }

.contact-item:hover {
  transform: translateY(-5px) scale(1.1);
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(212, 175, 55, 0.3);
}

.copy-toast {
  position: absolute; top: -50px; left: 50%; transform: translateX(-50%); z-index: 100;
  padding: 8px 16px; border-radius: 20px;
  background: var(--accent); color: #000; font-size: 0.85rem; font-weight: bold;
  white-space: nowrap; opacity: 0; visibility: hidden; transition: 0.4s;
}
.copy-toast.show { opacity: 1; visibility: visible; top: -65px; }

.footer { text-align: center; padding: 50px; border-top: 1px solid var(--border-color); color: var(--text-secondary); font-size: 0.8rem; }

#topBtn {
  position: fixed; bottom: 40px; right: 40px; z-index: 100;
  width: 50px; height: 50px; display: none;
  border: none; border-radius: 12px;
  background: var(--accent); color: #000; cursor: pointer; transition: 0.3s;
  box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

/* ==========================================================================
   10. Media Queries (Responsive)
   ========================================================================== */
@media (max-width: 950px) {
  .modal-content { height: 90vh; padding: 30px; overflow-y: auto; }
  .modal-body { flex-direction: column; height: auto; }
  .modal-left { width: 100%; flex-shrink: 0; aspect-ratio: 16/9; margin-bottom: 20px; }
  .modal-right { height: auto; }
  .modal-link-group { flex-wrap: wrap; }
  .career-grid { flex-direction: column; }
}