/* ============================================================
   LEE NAHYUN Portfolio — Sidebar Layout
   Fonts: Space Grotesk + Cormorant Garamond (imported in HTML)
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --bg: #0c1628;
  --sidebar: #080d18;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text: #eef2ff;
  --text2: rgba(220, 230, 255, 0.55);
  --accent: #8ba4f0;
  --accent2: #6ee0b0;
  --sidebar-width: 240px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(139, 164, 240, 0.3);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 164, 240, 0.5);
}

/* ── Background Layers ── */
.nebula-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.nebula-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: blob-float 20s ease-in-out infinite;
}

.nebula-blob.b1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #3b5bdb, transparent);
  top: -200px; left: -150px;
  animation-duration: 24s;
}
.nebula-blob.b2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #6ee0b0, transparent);
  top: 30%; right: -100px;
  animation-duration: 18s;
  animation-delay: -6s;
}
.nebula-blob.b3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #8ba4f0, transparent);
  bottom: 10%; left: 20%;
  animation-duration: 22s;
  animation-delay: -12s;
}
.nebula-blob.b4 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #c084fc, transparent);
  top: 60%; right: 30%;
  animation-duration: 28s;
  animation-delay: -4s;
}
.nebula-blob.b5 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #38bdf8, transparent);
  bottom: -100px; right: -50px;
  animation-duration: 20s;
  animation-delay: -15s;
}

@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.97); }
}

#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ── Sidebar ── */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-name {
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.sidebar-role {
  color: var(--text2);
  font-size: 11px;
  letter-spacing: 0.04em;
  margin-top: 4px;
  line-height: 1.4;
}

/* ── Sidebar Nav ── */
#sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

#sidebar-nav ul {
  list-style: none;
}

#sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 10px 24px;
  color: var(--text2);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: color var(--transition), background var(--transition);
  position: relative;
  cursor: pointer;
}

#sidebar-nav li a:hover {
  color: var(--accent);
  background: rgba(139, 164, 240, 0.05);
}

#sidebar-nav li a.active {
  color: var(--accent);
  background: rgba(139, 164, 240, 0.08);
  border-left: 2px solid var(--accent);
  padding-left: 22px;
}

.nav-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #080d18;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0;
}

.nav-label {
  flex: 1;
}

/* ── Sidebar Footer ── */
.sidebar-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-contact {
  color: var(--text2);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

/* ── Main Content ── */
#main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  overflow-y: auto;
  position: relative;
  z-index: 2;
}

/* ── Section ── */
.section {
  padding: 60px 52px 80px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 36px;
}

.section-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 48px;
  font-weight: 700;
  color: rgba(139, 164, 240, 0.15);
  line-height: 1;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 12px;
  color: var(--text2);
  margin-top: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Project Cards Grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* ── Card ── */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(139, 164, 240, 0.12), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.card-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
  display: block;
}

.card-thumbnail-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.card-body {
  padding: 16px 18px;
}

.card-header-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  flex: 1;
}

.card-desc {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.card-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tool-tag {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text2);
  border-radius: 4px;
  font-size: 10px;
  padding: 2px 8px;
  letter-spacing: 0.02em;
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-company {
  background: rgba(43, 87, 204, 0.25);
  color: #7aa2ff;
  border: 1px solid rgba(43, 87, 204, 0.4);
}

.badge-contest {
  background: rgba(200, 86, 26, 0.25);
  color: #f5a066;
  border: 1px solid rgba(200, 86, 26, 0.4);
}

.badge-team {
  background: rgba(28, 110, 64, 0.25);
  color: #6ee0b0;
  border: 1px solid rgba(28, 110, 64, 0.4);
}

.badge-personal {
  background: rgba(106, 59, 170, 0.25);
  color: #c4a0ff;
  border: 1px solid rgba(106, 59, 170, 0.4);
}

.badge-progress {
  background: rgba(200, 130, 30, 0.25);
  color: #f5c060;
  border: 1px solid rgba(200, 130, 30, 0.4);
}

/* ── Image Section / AI Images ── */
.filter-tabs {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}

.filter-tab:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.filter-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #080d18;
  font-weight: 700;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.image-grid-item {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  display: block;
  width: 100%;
}

.image-grid-item:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ── Photography Grid ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.photo-grid-item {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  display: block;
  width: 100%;
}

.photo-grid-item:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ── About Section ── */
.about-layout {
  display: flex;
  gap: 56px;
  align-items: flex-start;
}

.about-left {
  flex: 1;
  min-width: 0;
}

.about-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 52px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.about-role {
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
  font-weight: 600;
}

.about-intro {
  font-size: 14.5px;
  color: var(--text2);
  line-height: 1.8;
  max-width: 480px;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ── Show Reel ── */
.showreel-wrap {
  margin-top: 28px;
}
.showreel-label {
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.showreel-frame {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #0a0e1a;
  border: 1px solid var(--glass-border);
}
.showreel-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.about-right {
  width: 300px;
  flex-shrink: 0;
}

.about-stack-title {
  font-size: 11px;
  color: var(--text2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.tech-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tech-item {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text2);
  transition: border-color var(--transition), color var(--transition);
}

.tech-item:hover {
  border-color: rgba(139, 164, 240, 0.3);
  color: var(--text);
}

.tech-icon {
  font-size: 16px;
  line-height: 1;
}

/* ── Dashboard / No Thumbnail ── */
.card-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.placeholder-robot {
  background: linear-gradient(135deg, rgba(106, 59, 170, 0.25) 0%, rgba(43, 87, 204, 0.2) 100%);
}
.placeholder-chart {
  background: linear-gradient(135deg, rgba(43, 87, 204, 0.2) 0%, rgba(110, 224, 176, 0.15) 100%);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(8, 13, 24, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 80px 48px 80px;
  position: relative;
}

.modal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text2);
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  padding: 8px 16px;
  margin-bottom: 32px;
  transition: color var(--transition), border-color var(--transition);
}

.modal-back:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.modal-project-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  color: var(--text2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.modal-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

/* ── Modal Video ── */
.modal-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 32px;
  background: rgba(0,0,0,0.4);
}

.modal-video.vertical {
  max-width: 360px;
  aspect-ratio: 9 / 16;
  margin: 0 auto 32px;
}

.modal-video iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Modal Gallery (screenshots) ── */
.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 32px;
}

.modal-gallery.single {
  grid-template-columns: 1fr;
}

.modal-gallery img {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
}

/* ── Modal Scene Grid ── */
.modal-scenes-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 12px;
}

.modal-scene-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 36px;
}

.modal-scene-grid.vertical {
  grid-template-columns: repeat(4, 1fr);
}

.modal-scene-grid img {
  width: 100%;
  border-radius: 6px;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

.modal-scene-grid.vertical img {
  aspect-ratio: 9 / 16;
}

/* ── Modal Brief ── */
.modal-section {
  margin-bottom: 32px;
}

.modal-section-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.modal-brief {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.8;
}

/* ── Process Steps ── */
.process-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.process-step {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.process-step:last-child {
  border-bottom: none;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(139, 164, 240, 0.15);
  border: 1px solid rgba(139, 164, 240, 0.3);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.step-desc {
  font-size: 12.5px;
  color: var(--text2);
  line-height: 1.7;
}

.step-image {
  width: 100%;
  border-radius: 6px;
  margin-top: 10px;
  border: 1px solid var(--glass-border);
}

/* ── Tool Badges (modal) ── */
.modal-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-tool-badge {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text2);
  border-radius: 6px;
  font-size: 12px;
  padding: 5px 12px;
  letter-spacing: 0.02em;
}

/* ── Lightbox ── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(4, 7, 14, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#lightbox.open {
  opacity: 1;
  pointer-events: all;
}

#lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

#lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  font-size: 28px;
  color: var(--text2);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  transition: color var(--transition);
}

#lightbox-close:hover {
  color: var(--text);
}

/* ── Mobile Nav (Bottom) ── */
#mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(8, 13, 24, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
  overflow-x: auto;
}

#mobile-nav ul {
  display: flex;
  list-style: none;
  gap: 0;
  min-width: max-content;
  padding: 0 12px;
}

#mobile-nav li a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 14px;
  color: var(--text2);
  text-decoration: none;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: color var(--transition);
}

#mobile-nav li a.active,
#mobile-nav li a:hover {
  color: var(--accent);
}

#mobile-nav .m-nav-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition);
}

#mobile-nav li a.active .m-nav-dot {
  opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  #sidebar {
    display: none;
  }

  #mobile-nav {
    display: block;
  }

  #main-content {
    margin-left: 0;
    padding-bottom: 64px;
  }

  .section {
    padding: 40px 20px 60px;
  }

  .section-num {
    font-size: 32px;
  }

  .section-title {
    font-size: 18px;
  }

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

  .about-layout {
    flex-direction: column;
    gap: 32px;
  }

  .about-name {
    font-size: 36px;
  }

  .about-right {
    width: 100%;
  }

  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .modal-inner {
    padding: 48px 20px 60px;
  }

  .modal-title {
    font-size: 22px;
  }

  .modal-scene-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-scene-grid.vertical {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .modal-video.vertical {
    max-width: 100%;
  }
}
