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

:root {
  --bg-base: #0a0a0a;
  --bg-surface: #111;
  --bg-elevated: #1a1a1a;
  --bg-hover: #1e1e1e;
  --bg-sidebar: #0d0d0d;
  --border-color: #1a1a1a;
  --border-light: #2a2a2a;
  --text-primary: #f0f0f0;
  --text-secondary: #bbb;
  --text-muted: #888;
  --accent-green: #00ff88;
  --accent-green-dim: rgba(0, 255, 136, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --sidebar-width: 240px;
  --font-main: 'Segoe UI', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

.sidebar-header {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  cursor: pointer;
}

.logo-icon { color: var(--accent-green); font-size: 1.2rem; }
.logo-text { font-weight: 700; font-size: 1rem; letter-spacing: 1px; }

/* -- sidebar nav -- */
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-category { padding: 0 10px; }
.nav-category + .nav-category { margin-top: 2px; }

.nav-category-btn {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.nav-category-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.nav-category-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.cat-icon { flex-shrink: 0; opacity: 0.7; color: var(--text-muted); }
.nav-category-btn.active .cat-icon { color: var(--accent-green); opacity: 1; }

.cat-chevron {
  margin-left: auto; flex-shrink: 0; opacity: 0.5;
  transition: transform 0.2s ease;
}

.nav-category-btn.expanded .cat-chevron { transform: rotate(180deg); opacity: 0.8; }

/* -- nav subitems -- */
.nav-subitems {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease, margin 0.3s ease;
  margin: 0 10px;
  display: flex; flex-direction: column; gap: 2px;
}

.nav-subitems.open { max-height: 800px; margin: 6px 10px 4px; }

.nav-subitem {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.nav-subitem:hover { background: var(--bg-hover); color: var(--text-primary); }

.nav-subitem.active { background: var(--accent-green-dim); color: var(--accent-green); }

.subitem-thumb {
  width: 22px; height: 22px;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800;
  flex-shrink: 0;
}

.subitem-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* -- sidebar skills/footer -- */
.sidebar-section { padding: 0 18px; }
.sidebar-section + .sidebar-section { margin-top: 4px; }

.sidebar-section-title {
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 8px 2px 6px;
}

.skills-section { border-top: 1px solid var(--border-color); margin-top: 8px; padding-top: 10px; }

.skill-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px 4px; }

.skill-badge {
  display: inline-block;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 600;
}

.badge-green  { background: rgba(0,255,136,0.12); color: var(--accent-green); }
.badge-blue   { background: rgba(96,165,250,0.12);  color: #60a5fa; }
.badge-purple { background: rgba(167,139,250,0.12); color: #a78bfa; }
.badge-yellow { background: rgba(250,204,21,0.12);  color: #facc15; }
.badge-pink   { background: rgba(244,114,182,0.12); color: #f472b6; }

.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.sidebar-contact { display: flex; gap: 12px; margin-bottom: 8px; }
.sidebar-social { color: var(--text-muted); transition: color 0.15s ease; }
.sidebar-social:hover { color: var(--text-primary); }
.sidebar-copy { font-size: 0.65rem; color: var(--text-muted); }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  overflow-x: hidden;
  min-height: 100vh;
}

.content-view { display: none; }
.content-view.active { display: block; }

.container { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* ===== HERO ===== */
.hero {
  min-height: 55vh;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 80px 0 60px;
  background: linear-gradient(180deg, #0a0a0a 0%, #111 100%);
  border-bottom: 1px solid #151515;
}

.hero-tag {
  color: var(--accent-green);
  font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  margin-bottom: 16px;
  opacity: 0; transform: translateY(10px);
  animation: fadeUp 0.6s ease forwards;
}

.hero h1 {
  font-size: 52px; font-weight: 900; line-height: 1.1; margin-bottom: 12px; color: #fff;
  opacity: 0; transform: translateY(10px);
  animation: fadeUp 0.6s ease 0.1s forwards;
}

.hero-sub {
  font-size: 20px; color: #888; margin-bottom: 32px;
  opacity: 0; transform: translateY(10px);
  animation: fadeUp 0.6s ease 0.2s forwards;
}

.tech-tags {
  display: flex; flex-wrap: wrap; gap: 10px;
  opacity: 0; transform: translateY(10px);
  animation: fadeUp 0.6s ease 0.3s forwards;
}

.tech-tag {
  padding: 8px 18px; border-radius: 20px; font-size: 13px; font-weight: 600;
  background: #151515; border: 1px solid #2a2a2a; color: #ddd;
  transition: all 0.2s ease;
}

.tech-tag:hover { border-color: var(--accent-green); color: var(--accent-green); transform: translateY(-2px); }
.tech-tag.unity { border-color: #333; color: #fff; }
.tech-tag.godot { border-color: #478cbf; color: #6eb1ff; }
.tech-tag.cs { border-color: #68217a; color: #b866d9; }
.tech-tag.js { border-color: #f7df1e; color: #f7df1e; }

/* ===== SECTIONS ===== */
section { padding: 60px 0; border-bottom: 1px solid #151515; }

.section-title {
  font-size: 12px; font-weight: 700; color: var(--accent-green);
  letter-spacing: 4px; text-transform: uppercase;
  margin-bottom: 36px;
}

/* ===== FEATURED ===== */
.featured-card {
  display: flex; gap: 32px;
  background: var(--bg-surface); border: 1px solid #222;
  border-radius: var(--radius-lg); padding: 32px; align-items: center;
  transition: all 0.3s ease;
}

.featured-card:hover { border-color: #333; }

.featured-img {
  width: 300px; height: 190px;
  background: var(--bg-elevated); border-radius: 12px;
  flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}

.featured-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }

.placeholder-box {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  display: flex; align-items: center; justify-content: center;
  color: #444; font-size: 13px; font-weight: 500;
}

.featured-info h3 { font-size: 26px; margin-bottom: 12px; color: #fff; }
.featured-info p { color: #999; font-size: 15px; margin-bottom: 20px; line-height: 1.7; }

.btn {
  display: inline-block; padding: 12px 26px;
  background: var(--accent-green); color: #000;
  font-weight: 700; border-radius: 8px;
  text-decoration: none; font-size: 14px;
  transition: all 0.2s ease;
}

.btn:hover { background: #00e67a; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,255,136,0.2); }

.meta-tags { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.meta-tag { font-size: 12px; padding: 4px 10px; border-radius: 6px; background: var(--bg-elevated); color: #aaa; border: 1px solid #333; }

/* ===== PROJECT LIST ===== */
.project-list { display: flex; flex-direction: column; gap: 16px; }

.project-item {
  display: flex; gap: 20px;
  background: var(--bg-surface); border: 1px solid var(--bg-hover);
  border-radius: 12px; padding: 20px; align-items: center;
  text-decoration: none; color: inherit;
  transition: all 0.2s ease;
}

.project-item:hover { border-color: #333; background: #151515; }

.project-thumb {
  width: 120px; height: 80px;
  background: var(--bg-elevated); border-radius: 8px;
  flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}

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

.project-info h4 { font-size: 17px; margin-bottom: 6px; color: #fff; }
.project-info p { font-size: 14px; color: #888; margin-bottom: 10px; line-height: 1.5; }

.project-tags { display: flex; gap: 6px; }
.project-tag { font-size: 11px; padding: 3px 10px; border-radius: 4px; background: var(--bg-elevated); color: #888; border: 1px solid var(--border-light); }

.thumb-space {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}

/* ===== SKILLS ===== */
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.skill-box {
  background: var(--bg-surface); border: 1px solid var(--bg-hover);
  border-radius: 12px; padding: 28px 16px; text-align: center;
  transition: all 0.3s ease;
}

.skill-box:hover { border-color: #333; transform: translateY(-4px); }

.skill-icon {
  width: 44px; height: 44px;
  background: var(--bg-elevated); border-radius: 10px;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.skill-name { font-size: 13px; font-weight: 600; color: #ddd; }

/* ===== ABOUT ===== */
.about-text { font-size: 16px; color: #bbb; line-height: 2; max-width: 640px; }

.contact-links { display: flex; gap: 20px; margin-top: 28px; }

.contact-links a {
  color: var(--accent-green); text-decoration: none;
  font-size: 14px; font-weight: 600;
  transition: all 0.2s ease;
}

.contact-links a:hover { color: #fff; }

/* ===== FOOTER ===== */
footer { text-align: center; padding: 40px 0; color: #444; font-size: 13px; border-top: 1px solid #151515; }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 120px 20px; text-align: center;
}

.empty-icon { color: var(--text-muted); margin-bottom: 16px; opacity: 0.25; }
.empty-heading { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.empty-desc { color: var(--text-muted); font-size: 0.9rem; }

/* ===== DETAIL PANEL ===== */
.detail-panel {
  margin-top: 16px;
  background: var(--bg-surface);
  border: 1px solid #222;
  border-radius: var(--radius-lg);
  padding: 32px;
  animation: fadeUp 0.4s ease;
}

.detail-header {
  display: flex; gap: 20px; align-items: center;
  margin-bottom: 24px; padding-bottom: 20px;
  border-bottom: 1px solid #222;
}

.detail-thumb {
  width: 64px; height: 64px;
  border-radius: 12px;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.detail-thumb:hover { border-color: var(--accent-green); transform: scale(1.05); }
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; }

.detail-title-area h2 { font-size: 24px; margin-bottom: 4px; color: #fff; }
.detail-title-area p { color: #888; font-size: 14px; }

.detail-body { display: flex; flex-direction: column; gap: 20px; }

.detail-label {
  font-size: 12px; font-weight: 700; color: var(--accent-green);
  letter-spacing: 3px; text-transform: uppercase;
  margin-bottom: 10px;
}

.detail-text { color: #bbb; font-size: 15px; line-height: 1.7; white-space: pre-line; }

.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-tag { font-size: 12px; padding: 5px 12px; border-radius: 6px; background: var(--bg-elevated); color: #aaa; border: 1px solid #333; }

.detail-list { list-style: disc; padding-left: 20px; color: #bbb; font-size: 14px; line-height: 1.8; }

.detail-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.detail-btn {
  display: inline-block; padding: 12px 26px; border-radius: 8px;
  font-size: 14px; font-weight: 700; text-decoration: none;
  transition: all 0.2s ease;
}

.detail-btn.btn-web { background: var(--accent-green); color: #000; }
.detail-btn.btn-web:hover { background: #00e67a; transform: translateY(-2px); }

.detail-btn.btn-apk { background: var(--bg-elevated); border: 1px solid #333; color: #ddd; }
.detail-btn.btn-apk:hover { border-color: var(--accent-green); color: var(--accent-green); }

/* ===== IFRAME CONTAINER ===== */
.iframe-container {
  margin-top: 24px; border-radius: 12px; overflow: hidden;
  border: 1px solid #333; background: var(--bg-base);
}

.iframe-container iframe {
  display: block;
  width: 100%;
  height: 760px;
  border: none;
}
.iframe-container.portrait iframe {
  height: 760px;
  max-width: 480px;
  margin: 0 auto;
}

.iframe-close,
.detail-close {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px; padding: 10px 20px;
  background: var(--bg-elevated); border: 1px solid #333;
  color: #ddd; border-radius: 8px;
  cursor: pointer; font-size: 14px; font-weight: 600;
  transition: all 0.2s ease;
}

.iframe-close:hover,
.detail-close:hover { border-color: var(--accent-green); color: var(--accent-green); }

/* ===== RETROSPECTIVE TOGGLE ===== */
.retrospective-toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 14px 18px;
  background: #151515; border: 1px solid var(--border-light);
  border-radius: 10px;
  color: #ddd; font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
}

.retrospective-toggle:hover { background: var(--bg-elevated); border-color: var(--accent-green); color: #fff; }

.retrospective-toggle .toggle-arrow {
  display: inline-block; transition: transform 0.3s ease;
  font-size: 12px; margin-left: auto; color: #888;
}

.retrospective-toggle.active .toggle-arrow { transform: rotate(90deg); }
.retrospective-toggle.active { border-color: rgba(0,255,136,0.27); background: var(--bg-elevated); border-radius: 10px 10px 0 0; }

.retrospective-content {
  max-height: 0; overflow: hidden;
  transition: max-height 0.5s ease, padding 0.3s ease;
  background: #0d0d0d; border: 1px solid var(--border-light);
  border-top: none; border-radius: 0 0 10px 10px;
  padding: 0 18px;
  color: #bbb; font-size: 14px; line-height: 1.8;
}

.retrospective-content.open { max-height: 3000px; padding: 18px; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }

  .hero h1 { font-size: 36px; }
  .hero-sub { font-size: 16px; }

  .featured-card { flex-direction: column; padding: 24px; }
  .featured-img { width: 100%; height: 200px; }

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

  .project-item { flex-direction: column; align-items: flex-start; }
  .project-thumb { width: 100%; height: 160px; }

  .detail-panel { padding: 20px; }
  .detail-header { flex-direction: column; align-items: flex-start; }
  .iframe-container iframe { height: 360px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 30px; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .skill-box { padding: 20px 10px; }
}
