:root {
  --bg: #ffffff;
  --bg-alt: #f4f6fa;
  --text: #1f2430;
  --text-muted: #5c6475;
  --accent: #4f6cf7;
  --border: #e2e6ee;
}

[data-theme="dark"] {
  --bg: #12151c;
  --bg-alt: #1b1f29;
  --text: #e8eaf0;
  --text-muted: #9aa2b4;
  --accent: #7b93ff;
  --border: #2a3040;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
  margin-right: auto;
}

.nav-menu {
  display: flex;
  gap: 24px;
  list-style: none;
}

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

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

.nav-toggle,
.theme-toggle {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text);
}

.nav-toggle {
  display: none;
}

/* Hero */
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-greeting {
  color: var(--accent);
  font-weight: 600;
}

.hero-name {
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 1.2;
}

.hero-role {
  font-size: clamp(1.3rem, 4vw, 2rem);
  color: var(--text-muted);
  min-height: 1.5em;
}

.cursor {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-desc {
  max-width: 520px;
  margin: 16px 0 32px;
  color: var(--text-muted);
}

.btn {
  display: inline-block;
  align-self: flex-start;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* Sections */
.section {
  padding: 96px 20px;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 32px;
}

.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  margin-top: 8px;
  background: var(--accent);
  border-radius: 2px;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s, transform 0.6s;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* About */
.about-content {
  display: flex;
  align-items: center;
  gap: 32px;
}

.avatar {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 700;
}

/* Skills */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
}

.skills-list li {
  padding: 8px 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.card p {
  color: var(--text-muted);
  flex-grow: 1;
}

.tags {
  display: flex;
  gap: 8px;
}

.tags span {
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--accent);
}

.card-link {
  color: var(--accent);
  font-weight: 600;
}

/* Contact */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
}

.contact-form input,
.contact-form textarea {
  padding: 12px 16px;
  font: inherit;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.form-status {
  color: var(--accent);
}

/* Footer */
.footer {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* Mobile */
@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu a {
    display: block;
    padding: 14px 20px;
  }

  .about-content {
    flex-direction: column;
    text-align: center;
  }

  .section {
    padding: 64px 20px;
  }
}
