/* ============================================================
   resume.css — 이력서 (Dark + Emerald, index와 톤 통일)
   ============================================================ */

/* ── 1. Custom Properties ─────────────────────────────────── */
:root {
  --bg-dark:       #0a0a0a;
  --bg-surface:    #111111;
  --bg-hover:      #181818;
  --text-main:     #f3f4f6;
  --text-muted:    #9ca3af;
  --text-faint:    #858b98;
  --accent:        #34d399;
  --accent-dim:    rgba(52, 211, 153, 0.10);
  --accent-border: rgba(52, 211, 153, 0.25);
  --border:        #27272a;
  --border-hover:  #3f3f46;
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --font-base:     'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Noto Sans KR', sans-serif;
}

/* ── 1b. Light Theme Override ────────────────────────────── */
[data-theme="light"] {
  --bg-dark:       #f8f9fa;
  --bg-surface:    #ffffff;
  --bg-hover:      #f1f3f5;
  --text-main:     #111111;
  --text-muted:    #4b5563;
  --text-faint:    #667085;
  --accent:        #059669;
  --accent-dim:    rgba(5, 150, 105, 0.08);
  --accent-border: rgba(5, 150, 105, 0.22);
  --border:        #e5e7eb;
  --border-hover:  #d1d5db;
}

[data-theme="light"] body {
  background-color: var(--bg-dark);
  color: var(--text-main);
}

[data-theme="light"] .back-nav {
  background: rgba(248, 249, 250, 0.92);
  border-color: var(--border);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-base);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
}

a    { text-decoration: none; color: inherit; }
li   { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 10px 14px; background: var(--text-main); color: var(--bg-dark); border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

/* ── 3. Back Nav ─────────────────────────────────────────── */
.back-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 32px;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.back-nav a {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  transition: color 0.2s;
}

.back-nav a:hover { color: var(--accent); }

/* ── 4. Layout ───────────────────────────────────────────── */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 72px 32px 120px;
}

/* ── 5. Profile Header ───────────────────────────────────── */
.profile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding-bottom: 52px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.profile-info {
  flex: 1;
}

.profile-photo {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.profile-name {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 10px;
  color: var(--text-main);
}

.profile-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.profile-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
}

.profile-contacts li {
  font-size: 0.875rem;
  color: var(--text-faint);
}

.profile-contacts a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.profile-contacts a:hover { color: var(--accent); }

/* ── 6. Section ──────────────────────────────────────────── */
.resume-section {
  padding: 52px 0;
  border-bottom: 1px solid var(--border);
}

.resume-section:last-child { border-bottom: none; }

.section-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 36px;
}

/* ── 7. Entry (경력/학력/활동) ───────────────────────────── */
.entry {
  margin-bottom: 40px;
}

.entry:last-child { margin-bottom: 0; }

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.entry-org {
  position: relative;
  padding-left: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.entry-org::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 1em;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(-50%);
}

.entry-period {
  font-size: 0.8rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.entry-role {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}

.projects-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 28px;
  margin-bottom: 16px;
}

.entry-duty {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.duty-label {
  color: var(--accent);
  font-weight: 600;
}

p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 12px;
}

p:last-child { margin-bottom: 0; }

ul {
  margin-bottom: 12px;
}

ul > li {
  position: relative;
  padding: 4px 0 4px 18px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
}

ul > li::before {
  position: absolute;
  left: 0;
  content: "–";
  color: var(--accent);
}

/* ── 8. Project (경력 하위) ──────────────────────────────── */
.project {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.project:first-of-type {
  margin-top: 16px;
  padding-top: 0;
  border-top: none;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.project-name {
  position: relative;
  padding-left: 14px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.project-name::before {
  content: "›";
  position: absolute;
  left: 0;
  top: 50%;
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
}

.project-role {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-faint);
  margin-left: 8px;
}

.project-period {
  font-size: 0.8rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.tech-stack {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: 4px 12px;
  border-radius: 20px;
  margin-top: 10px;
}

.project-sub-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 22px;
  margin-bottom: 8px;
  padding-left: 10px;
  border-left: 2px solid var(--accent);
}

/* ── 9. Skills ───────────────────────────────────────────── */
.skills {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skill-group {
  display: flex;
  align-items: baseline;
  gap: 20px;
  flex-wrap: wrap;
}

.skill-label {
  flex-shrink: 0;
  width: 72px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.skill-value {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── 9b. Theme Toggle Button ─────────────────────────────── */
.theme-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-hover);
  background: var(--bg-surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }

[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: block; }

/* ── 9c. PDF Button ────────────────────────────────────── */
.pdf-btn {
  position: fixed;
  bottom: 88px;
  right: 32px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-hover);
  background: var(--bg-surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.pdf-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── 9d. Print Styles ──────────────────────────────────── */
@media print {
  .back-nav,
  .theme-toggle,
  .pdf-btn {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #111 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .container {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  .resume-section {
    break-inside: avoid;
  }

  .project {
    break-inside: avoid;
  }

  p, ul > li, .entry-role, .tech-stack {
    color: #333 !important;
  }

  .section-title, .skill-label, .entry-period,
  .project-period, .project-role, .projects-label {
    color: #666 !important;
  }

  .entry-org, .project-name, .profile-name, .project-sub-title {
    color: #111 !important;
  }

  .profile-title, .entry-role, .duty-label {
    color: #059669 !important;
  }

  .tech-stack {
    color: #059669 !important;
    border-color: rgba(5, 150, 105, 0.3) !important;
    background: rgba(5, 150, 105, 0.06) !important;
  }

  .profile-contacts a {
    color: #444 !important;
  }

  .profile {
    border-bottom-color: #ddd !important;
  }

  .resume-section {
    border-bottom-color: #ddd !important;
  }

  .project {
    border-top-color: #eee !important;
  }

  .project-sub-title {
    border-left-color: #059669 !important;
  }
}

/* ── 10. Responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
  .container { padding: 56px 20px 80px; }

  .back-nav { padding: 12px 20px; }

  .profile-name { font-size: 2.4rem; }

  .resume-section { padding: 40px 0; }

  .section-title { margin-bottom: 28px; }

  .entry-header { flex-direction: column; gap: 2px; }
  .project-header { flex-direction: column; gap: 2px; }

  .skill-group { gap: 10px; }
  .skill-label { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
