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

:root {
  --bg:      #080810;
  --surface: #0e0e1a;
  --surface2:#13131f;
  --border:  #1e1e30;
  --accent:  #00e5a0;
  --accent2: #6366f1;
  --text:    #e2e2f0;
  --muted:   #888;
  --radius:  10px;
  --max-w:   1100px;
  --nav-h:   62px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
strong { color: var(--text); font-weight: 600; }

.mono    { font-family: 'JetBrains Mono', monospace; }
.accent  { color: var(--accent); }
.muted   { color: var(--muted); }

/* ─── Nav ─── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
#nav.scrolled {
  background: rgba(8,8,16,.85);
  backdrop-filter: blur(16px);
  border-color: var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.5px;
}

.nav-links {
  display: flex;
  gap: 36px;
}
.nav-links a {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .04em;
  transition: color .2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--text);
  transition: .3s;
}

/* ─── Hero ─── */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

#gridCanvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: .4;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}
.glow-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,229,160,.18) 0%, transparent 70%);
  top: -100px; left: -150px;
  animation: glowFloat 8s ease-in-out infinite;
}
.glow-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(99,102,241,.15) 0%, transparent 70%);
  bottom: -80px; right: -100px;
  animation: glowFloat 10s ease-in-out infinite reverse;
}
@keyframes glowFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-30px) scale(1.05); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  padding-top: var(--nav-h);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(0,229,160,.3);
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 28px;
  background: rgba(0,229,160,.05);
}
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent); }
  50%       { opacity: .6; box-shadow: 0 0 16px var(--accent); }
}

.hero-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
}
.name-ko {
  font-size: clamp(56px, 10vw, 100px);
  font-weight: 700;
  letter-spacing: -3px;
  line-height: 1;
  background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.name-en {
  font-size: clamp(20px, 3.5vw, 36px);
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 2px;
  -webkit-text-fill-color: var(--muted);
}

.hero-desc {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(13px, 1.6vw, 16px);
  color: var(--muted);
  margin-bottom: 40px;
  min-height: 1.5em;
}
.cursor {
  color: var(--accent);
  animation: blink .8s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 28px;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-size: 16px; font-weight: 600; letter-spacing: .05em; }
.stat-label { font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.stat-divider { width: 1px; height: 32px; background: var(--border); }

.scroll-hint {
  position: absolute;
  bottom: 40px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .1em;
  font-family: 'JetBrains Mono', monospace;
  animation: fadeInUp 1s ease 1.5s both;
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--muted), transparent);
  animation: scrollAnim 1.5s ease-in-out infinite;
}
@keyframes scrollAnim {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  transition: all .2s;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  font-weight: 600;
}
.btn-primary:hover {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(0,229,160,.2);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 24px rgba(0,229,160,.1);
}

/* ─── Sections ─── */
section { padding: 100px 0; }

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

.section-label {
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: 12px;
  opacity: .8;
}
.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -1.5px;
  margin-bottom: 48px;
  line-height: 1.1;
}

.section-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  margin-top: -36px;
  margin-bottom: 36px;
}

/* ─── About ─── */
#about { background: var(--surface); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 60px;
  align-items: center;
}

.about-text {
  font-size: 16px;
  color: var(--muted);
  line-height: 2;
}

.about-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.about-card-header {
  background: var(--border);
  padding: 10px 16px;
  font-size: 12px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}
.about-card-header::before {
  content: '';
  display: flex;
  gap: 4px;
}
.about-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.json-line { display: flex; gap: 6px; flex-wrap: wrap; }
.json-key  { color: #6366f1; }
.json-colon{ color: var(--muted); }
.json-str  { color: var(--accent); }
.json-bool { font-weight: 600; }

/* ─── Skills ─── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .2s, transform .2s;
}
.skill-group:hover {
  border-color: rgba(0,229,160,.3);
  transform: translateY(-2px);
}

.skill-group-title {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: .06em;
}

.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  color: var(--muted);
  transition: all .2s;
  cursor: default;
}
.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0,229,160,.06);
}

/* ─── Projects ─── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  min-height: 100px;
}

.loading-state {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 60px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--muted);
}
.dots { animation: dotBlink 1.2s steps(4, end) infinite; }
@keyframes dotBlink { to { opacity: 0; } }

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform: scaleX(0);
  transition: transform .3s;
  transform-origin: left;
}
.project-card:hover {
  border-color: rgba(0,229,160,.25);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,.4), 0 0 0 1px rgba(0,229,160,.1);
}
.project-card:hover::before { transform: scaleX(1); }

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.project-icon { color: var(--accent); opacity: .7; }
.project-arrow { color: var(--muted); font-size: 14px; transition: color .2s, transform .2s; }
.project-card:hover .project-arrow { color: var(--accent); transform: translate(2px,-2px); }

.project-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.project-desc {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  line-height: 1.6;
}
.project-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}
.project-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
}
.lang-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.project-stars {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
}
.project-card.empty {
  border-style: dashed;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 40px;
  cursor: default;
}
.project-card.empty:hover { transform: none; box-shadow: none; border-color: var(--border); }
.project-card.empty::before { display: none; }

.projects-more { margin-top: 36px; text-align: center; }

/* ─── Comments ─── */
#comments { background: var(--surface); }

.comments-wrap {
  max-width: 720px;
}

.comment-form {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}
.comment-form-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  color: var(--text);
}
.comment-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.comment-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: border-color .2s;
  outline: none;
}
.comment-input:focus { border-color: var(--accent); }
.comment-input::placeholder { color: var(--muted); }
textarea.comment-input {
  resize: vertical;
  min-height: 100px;
  margin-bottom: 12px;
}
.comment-submit {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: 'Inter', sans-serif;
}
.comment-submit:hover { opacity: .85; }
.comment-submit:disabled { opacity: .5; cursor: default; }

.comment-list { display: flex; flex-direction: column; gap: 16px; }

.comment-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  animation: fadeInUp .4s ease both;
}
.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.comment-author {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.comment-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
}
.comment-body {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-empty {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 40px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.comment-notice {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Contact ─── */
.contact-desc {
  color: var(--muted);
  margin-bottom: 40px;
  font-size: 15px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
.contact-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,229,160,.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .2s;
}
.contact-card:hover {
  border-color: rgba(0,229,160,.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.contact-card:hover::after { opacity: 1; }
.contact-card:hover .contact-card-icon { color: var(--accent); }

.contact-card-icon {
  color: var(--muted);
  transition: color .2s;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.contact-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  position: relative;
  z-index: 1;
}
.contact-card-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.contact-card-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.contact-card-arrow {
  color: var(--muted);
  font-size: 14px;
  transition: color .2s, transform .2s;
  position: relative;
  z-index: 1;
}
.contact-card:hover .contact-card-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* ─── Footer ─── */
footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

/* ─── Animations ─── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-stats { gap: 16px; }
  .comment-row { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}
