/* =========================================================
   dulgi0121.github.io — Resume / Portfolio
   Dark developer theme
   ========================================================= */

:root {
  --bg:        #0a0e14;
  --bg-soft:   #0f141c;
  --panel:     #131a24;
  --panel-2:   #172130;
  --border:    #223046;
  --border-soft: #1a2431;
  --text:      #e6edf3;
  --text-dim:  #9fb0c3;
  --text-mute: #64748b;
  --accent:    #37e6a4;   /* terminal green */
  --accent-2:  #4aa8ff;   /* cyan-blue */
  --accent-soft: rgba(55, 230, 164, 0.12);
  --danger:    #ff6b6b;
  --radius:    14px;
  --radius-sm: 9px;
  --mono: "JetBrains Mono", "Fira Code", "SFMono-Regular", "Consolas", "D2Coding", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard",
          "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  --maxw: 920px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

/* Subtle grid + glow background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(680px circle at 15% -5%, rgba(55, 230, 164, 0.10), transparent 60%),
    radial-gradient(720px circle at 100% 0%, rgba(74, 168, 255, 0.08), transparent 55%),
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: auto, auto, 40px 40px, 40px 40px;
  opacity: 0.9;
  mask-image: linear-gradient(180deg, #000 0%, transparent 90%);
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(10, 14, 20, 0.72);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
}
.nav-brand .accent { color: var(--accent); }
.nav-links { display: flex; gap: 22px; }
.nav-links a {
  color: var(--text-dim);
  font-size: 14px;
  font-family: var(--mono);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }
@media (max-width: 640px) { .nav-links { display: none; } }

/* ---------- Hero ---------- */
.hero {
  padding: 90px 0 60px;
}
.hero .term-tag {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 18px;
}
.hero .term-tag .prompt { color: var(--text-mute); }
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.1;
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.hero .name-en {
  font-family: var(--mono);
  color: var(--text-mute);
  font-size: 1rem;
  font-weight: 500;
}
.hero .role {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--accent);
  font-weight: 600;
  margin: 14px 0 20px;
}
.hero .tagline {
  color: var(--text-dim);
  max-width: 620px;
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--panel);
  transition: all 0.16s ease;
  cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.btn.primary {
  background: var(--accent);
  color: #05140d;
  border-color: var(--accent);
  font-weight: 600;
}
.btn.primary:hover { box-shadow: 0 8px 26px -8px var(--accent); }

/* ---------- Sections ---------- */
section { padding: 46px 0; }
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.section-head h2 {
  font-size: 1.5rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-head .idx {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
}
.section-head .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ---------- About ---------- */
.about-card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 26px 28px;
  color: var(--text-dim);
}
.about-card p { margin: 0 0 12px; }
.about-card p:last-child { margin-bottom: 0; }

/* ---------- Skills ---------- */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.skill-group {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.skill-group h3 {
  font-family: var(--mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  margin: 0 0 14px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--mono);
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(55, 230, 164, 0.25);
}
.chip.alt { background: rgba(74,168,255,0.10); color: var(--accent-2); border-color: rgba(74,168,255,0.25); }

/* ---------- Timeline (experience/education) ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 6px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--border));
}
.tl-item { position: relative; margin-bottom: 28px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -26px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(55,230,164,0.12);
}
.tl-item .when {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-mute);
}
.tl-item h3 {
  margin: 4px 0 2px;
  font-size: 1.1rem;
}
.tl-item .org { color: var(--accent); font-size: 0.95rem; margin-bottom: 8px; }
.tl-item ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-dim); }
.tl-item li { margin-bottom: 4px; }

/* ---------- Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.project-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 18px 40px -20px rgba(0,0,0,0.8);
  text-decoration: none;
}
.project-thumb {
  height: 150px;
  background: linear-gradient(135deg, var(--panel-2), var(--bg-soft));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  color: var(--text-mute);
  border-bottom: 1px solid var(--border-soft);
  position: relative;
  overflow: hidden;
}
.project-thumb .glyph { font-size: 2.4rem; color: var(--accent); opacity: 0.85; }
.project-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.project-body h3 { margin: 0 0 6px; font-size: 1.15rem; color: var(--text); }
.project-body .summary { color: var(--text-dim); font-size: 0.95rem; flex: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.project-tags .tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text-dim);
  border: 1px solid var(--border-soft);
}
.project-more {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  margin-top: 16px;
}

/* ---------- Contact ---------- */
.contact-card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 30px 28px;
  text-align: center;
}
.contact-card h2 { margin: 0 0 8px; }
.contact-card p { color: var(--text-dim); margin: 0 0 22px; }
.contact-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border-soft);
  padding: 28px 0 46px;
  text-align: center;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 13px;
}

/* ---------- Placeholder marker ---------- */
.ph {
  border-bottom: 1px dashed var(--text-mute);
  color: var(--text-dim);
}

/* ---------- Project detail page ---------- */
.detail-hero { padding: 60px 0 26px; }
.back-link {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  display: inline-flex;
  gap: 6px;
  margin-bottom: 28px;
}
.back-link:hover { color: var(--accent); text-decoration: none; }
.detail-hero h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 0 0 10px; letter-spacing: -0.02em; }
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-mute);
  margin-bottom: 18px;
}
.detail-meta b { color: var(--text-dim); font-weight: 500; }
.detail-body { padding-bottom: 60px; }
.detail-body h2 {
  font-size: 1.3rem;
  margin: 36px 0 14px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}
.detail-body p, .detail-body li { color: var(--text-dim); }
.detail-body ul { padding-left: 20px; }
.detail-figure {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0;
  background: var(--panel);
}
.detail-figure .placeholder-img {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 14px;
  background:
    repeating-linear-gradient(45deg, var(--bg-soft) 0 12px, var(--panel) 12px 24px);
}
.detail-figure img { width: 100%; display: block; }
.detail-figure figcaption {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-mute);
  border-top: 1px solid var(--border-soft);
}
.callout {
  background: var(--accent-soft);
  border: 1px solid rgba(55,230,164,0.25);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 20px 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.detail-gallery .detail-figure { margin: 0; }
.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  margin: 20px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border-soft);
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.detail-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  background: rgba(5,20,13,0.75);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  font-size: 12px;
  padding: 3px 7px;
  cursor: pointer;
  display: none;
}
body.editing .video-embed { position: relative; }
body.editing .video-embed .detail-remove-btn,
body.editing .detail-figure .detail-remove-btn { display: block; }
.detail-figure { position: relative; }

/* ---------- Inline editor (local only) ---------- */
#edit-toolbar {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--mono);
  font-size: 13px;
}
#edit-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 100px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.8);
  transition: all 0.15s;
}
#edit-toolbar button:hover { border-color: var(--accent); transform: translateY(-2px); }
#edit-toolbar button.primary { background: var(--accent); color: #05140d; border-color: var(--accent); font-weight: 600; }
#edit-toolbar .status {
  color: var(--text-mute);
  background: rgba(10, 14, 20, 0.8);
  padding: 6px 12px;
  border-radius: 100px;
  backdrop-filter: blur(6px);
}
#edit-toolbar .status:empty { display: none; }

body.editing [contenteditable="true"] {
  outline: 1px dashed rgba(55, 230, 164, 0.45);
  outline-offset: 3px;
  border-radius: 3px;
  cursor: text;
  transition: outline-color 0.15s, background 0.15s;
}
body.editing [contenteditable="true"]:hover { outline-color: var(--accent); }
body.editing [contenteditable="true"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  background: rgba(55, 230, 164, 0.06);
}
body.editing a { cursor: text; }

.edit-toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 13px;
  z-index: 300;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.85);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.edit-toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
