/* ===== VARIABLES ===== */
:root {
  --bg: #0d0d12;
  --bg2: #13131a;
  --bg3: #1a1a24;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text: #e2e0d8;
  --text2: #8a887e;
  --text3: #5a5850;
  --accent: #e8a230;
  --accent2: #c47c10;
  --green: #3db87a;
  --blue: #4a9eff;
}

/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans KR', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Background grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
          linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
          linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(13,13,18,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 2rem;
}
.nav-brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-right: auto;
}
nav a {
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}
nav a:hover { color: var(--text); }

/* ===== LAYOUT ===== */
section { position: relative; z-index: 1; }
.container { max-width: 900px; margin: 0 auto; padding: 0 2rem; }

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 0 80px;
}
.hero-inner { max-width: 900px; margin: 0 auto; padding: 0 2rem; }

.hero-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-tag::before {
  content: '';
  display: inline-block;
  width: 20px; height: 1px;
  background: var(--accent);
}

h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: #f0ede4;
}
h1 span { color: var(--accent); }

.hero-desc {
  font-size: 16px;
  color: var(--text2);
  max-width: 600px;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: flex;
  gap: 3rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.stat-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
}
.stat-unit { font-size: 1.2rem; color: var(--text2); }
.stat-label { font-size: 12px; color: var(--text3); margin-top: 4px; }

.hero-links { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 2.5rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: #0d0d12; }
.btn-primary:hover { background: #f0b040; }
.btn-outline { border: 1px solid var(--border2); color: var(--text2); }
.btn-outline:hover { border-color: var(--text2); color: var(--text); }

/* Timeline */
.timeline {
  display: flex;
  gap: 0;
  position: relative;
  margin-top: 1rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 8px;
  height: 1px;
  background: var(--border2);
}
.tl-item { flex: 1; padding: 0 8px; text-align: center; }
.tl-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0 auto 8px;
  position: relative; z-index: 1;
}
.tl-dot-gap { background: var(--text3); }
.tl-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--accent);
  display: block;
  margin-bottom: 3px;
}
.tl-year-gap { color: var(--text3); }
.tl-company { font-size: 11px; color: var(--text2); }
.tl-role { font-size: 10px; color: var(--text3); margin-top: 2px; }
.tl-muted { color: var(--text3) !important; }

/* ===== SECTION COMMON ===== */
.section-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f0ede4;
  letter-spacing: -0.02em;
}
.section-sub { font-size: 13px; color: var(--text2); margin-top: 6px; }

/* ===== TECH STACK ===== */
#stack { padding: 80px 0; }
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.stack-group { background: var(--bg2); padding: 1.5rem; }
.stack-group-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.stack-items { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 3px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  white-space: nowrap;
}
.badge-hot {
  border-color: rgba(232,162,48,0.4);
  color: var(--accent);
  background: rgba(232,162,48,0.07);
}

/* ===== PROJECTS ===== */
#projects { padding: 80px 0; }
.project-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
  cursor: pointer;
}
.project-card:hover { border-color: var(--border2); }
.project-header {
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}
.project-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text3);
  flex-shrink: 0;
  padding-top: 3px;
  min-width: 24px;
}
.project-main { flex: 1; min-width: 0; }
.project-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.project-title {
  font-size: 15px;
  font-weight: 700;
  color: #f0ede4;
  letter-spacing: -0.01em;
}
.tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 2px;
  font-weight: 500;
}
.tag-live { background: rgba(61,184,122,0.15); color: var(--green); border: 1px solid rgba(61,184,122,0.25); }
.tag-ja { background: rgba(74,158,255,0.12); color: var(--blue); border: 1px solid rgba(74,158,255,0.2); }
.tag-solo { background: rgba(232,162,48,0.12); color: var(--accent); border: 1px solid rgba(232,162,48,0.2); }

.project-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 8px;
}
.project-desc { font-size: 13px; color: var(--text2); line-height: 1.6; }

.project-metrics {
  display: flex;
  gap: 1.5rem;
  margin-top: 12px;
  flex-wrap: wrap;
}
.metric { display: flex; align-items: baseline; gap: 4px; }
.metric-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
}
.metric-label { font-size: 11px; color: var(--text3); }

.project-toggle {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text3);
  font-size: 18px;
  transition: transform 0.25s;
}
.project-card.open .project-toggle { transform: rotate(45deg); }

.project-detail {
  display: none;
  padding: 0 1.75rem 1.5rem 4.25rem;
  border-top: 1px solid var(--border);
}
.project-card.open .project-detail { display: block; padding-top: 1.25rem; }

.detail-section { margin-bottom: 1.25rem; }
.detail-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.detail-list { list-style: none; padding: 0; }
.detail-list li {
  font-size: 13px;
  color: var(--text2);
  padding: 3px 0 3px 14px;
  position: relative;
  line-height: 1.6;
}
.detail-list li::before {
  content: '—';
  position: absolute; left: 0;
  color: var(--text3);
  font-size: 10px;
}
.stack-row { display: flex; flex-wrap: wrap; gap: 5px; }

/* ===== CAREER ===== */
#career { padding: 80px 0; }
.career-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0;
}
.career-period {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text3);
  padding: 1.25rem 1.25rem 1.25rem 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}
.career-period-gap { opacity: 0.5; }
.career-content {
  padding: 1.25rem 0 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.career-content-gap { opacity: 0.5; }
.career-company { font-size: 14px; font-weight: 700; color: #f0ede4; margin-bottom: 3px; }
.career-gap-text { color: var(--text2) !important; font-weight: 400 !important; }
.career-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 6px;
}
.career-desc { font-size: 13px; color: var(--text2); }

/* ===== INDUSTRY ===== */
#industry { padding: 80px 0 120px; }
.industry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.industry-item { background: var(--bg2); padding: 1.25rem 1.5rem; }
.industry-sector {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.industry-companies { font-size: 12px; color: var(--text2); line-height: 1.6; }
.industry-closing {
  font-size: 13px;
  color: var(--text3);
  text-align: center;
}

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  position: relative; z-index: 1;
}
.footer-links { font-size: 12px; color: var(--text3); margin-bottom: 6px; }
.footer-links a { color: var(--text2); text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 11px; color: var(--text3); }

/* ===== FADE IN ===== */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible { opacity: 1; transform: none; }

/* ===== EVIDENCE (운영 화면 증거) ===== */
.evidence-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.evidence-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(232,162,48,0.1);
  border: 1px solid rgba(232,162,48,0.35);
  border-radius: 4px;
  color: var(--accent);
  font-size: 12px;
  font-family: 'Noto Sans KR', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}
.evidence-btn:hover { background: rgba(232,162,48,0.2); }
.evidence-icon { font-size: 13px; }
.evidence-link {
  font-size: 12px;
  color: var(--text2);
  text-decoration: none;
  transition: color 0.2s;
}
.evidence-link:hover { color: var(--text); }

/* ===== IMAGE MODAL ===== */
.img-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1.5rem;
  overflow-y: auto;
}
.img-modal-overlay.active {
  display: flex;
}
.img-modal-box {
  position: relative;
  width: min(936px, 100%);
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  overflow: hidden;
  animation: modalIn 0.2s ease;
  margin: auto;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.img-modal-close {
  position: sticky;
  top: 12px;
  float: right;
  margin: 12px 14px 0 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
  transition: background 0.2s;
}
.img-modal-close:hover { background: rgba(0,0,0,0.9); color: var(--text); }
.img-modal-img {
  width: 100%;
  display: block;
  clear: both;
}
.img-modal-caption {
  font-size: 12px;
  color: var(--text3);
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
  line-height: 1.5;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  nav a { display: none; }
  nav a:last-child { display: block; }
  .timeline { display: none; }
  .career-grid { grid-template-columns: 1fr; }
  .career-period { border-bottom: none; padding-bottom: 2px; }
  .career-content { border-left: 2px solid var(--border); border-bottom: 1px solid var(--border); }
  .project-detail { padding-left: 1.75rem; }
  h1 { font-size: 2rem; }
  .hero-stats { gap: 1.5rem; }
}