:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #6366f1;
  --accent-2: #ec4899;
  --shadow-sm: 0 1px 2px rgba(17,24,39,0.04), 0 1px 3px rgba(17,24,39,0.06);
  --shadow-md: 0 6px 16px rgba(17,24,39,0.08), 0 2px 4px rgba(17,24,39,0.04);
  --radius: 14px;
  --pad: 16px;
  --content: 960px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
ul { list-style: none; padding: 0; margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: auto;
  background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 6px;
}
.skip-link:focus { left: 12px; top: 12px; z-index: 10; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px var(--pad);
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; letter-spacing: 0.12em; font-size: 13px; color: var(--muted); }
.lang-toggle {
  font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
  font-size: 13px; font-weight: 600;
}
.lang-toggle .lang-opt { opacity: 0.4; transition: opacity .15s; }
.lang-toggle .lang-opt.is-active { opacity: 1; color: var(--accent); }
.lang-toggle .lang-sep { color: var(--line); }
.lang-toggle:hover { border-color: var(--accent); }

/* Sections */
main { max-width: var(--content); margin: 0 auto; padding: 0 var(--pad) 64px; }
.section { padding: 40px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }
.section-title {
  font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 16px;
}
.section-lead { color: var(--muted); margin: 0 0 20px; max-width: 640px; }

/* Hero */
.hero { padding: 48px 0 24px; text-align: center; }
.hero-photo {
  width: 96px; height: 96px; border-radius: 50%;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #dbeafe, #fce7f3);
  box-shadow: var(--shadow-md);
  object-fit: cover;
}
.hero-name { font-size: 32px; line-height: 1.2; margin: 0 0 6px; font-weight: 800; letter-spacing: -0.02em; }
.hero-title {
  margin: 0 0 14px; color: var(--muted); font-size: 15px; font-weight: 600;
  letter-spacing: 0.02em;
}
.hero-tagline {
  max-width: 520px; margin: 0 auto; color: var(--text);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 600; font-size: 16px;
}

/* Skills */
.skill-groups { display: grid; gap: 20px; }
.skill-group h3 {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px;
}
.stack { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: #eef2ff; color: #3730a3; border: 1px solid #e0e7ff;
}
.chip-flutter  { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.chip-dart     { background: #dbeafe; color: #1e3a8a; border-color: #bfdbfe; }
.chip-flame    { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.chip-riverpod { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.chip-react    { background: #cffafe; color: #155e75; border-color: #a5f3fc; }
.chip-ts       { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.chip-vite     { background: #fae8ff; color: #86198f; border-color: #f5d0fe; }
.chip-html     { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.chip-php      { background: #ede9fe; color: #4c1d95; border-color: #ddd6fe; }
.chip-firebase { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.chip-mysql    { background: #e0f2fe; color: #0c4a6e; border-color: #bae6fd; }
.chip-python   { background: #fef9c3; color: #854d0e; border-color: #fef08a; }
.chip-git, .chip-github { background: #f3f4f6; color: #1f2937; border-color: #e5e7eb; }
.chip-admob    { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.chip-iap      { background: #ffe4e6; color: #9f1239; border-color: #fecdd3; }

/* Project grid */
.project-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.project-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #d1d5db; }
.project-card .thumb {
  aspect-ratio: 16 / 10; background: #f3f4f6;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.project-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.project-card h3 { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 700; }
.project-card .meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.project-card .meta span strong { color: var(--text); font-weight: 600; }
.project-card p { margin: 0; color: #374151; font-size: 14px; }
.project-card .stack { margin-top: 2px; }
.project-card .links {
  margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px;
  padding-top: 10px; border-top: 1px dashed var(--line);
}
.project-card .links-label {
  font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase;
  width: 100%;
}
.project-card .links a {
  font-size: 12px; padding: 4px 10px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted); background: #f9fafb;
}
.project-card .links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Contact */
.contact-list { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-list a {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); font-weight: 600; font-size: 14px;
}
.contact-list a:hover { border-color: var(--accent); text-decoration: none; }

/* Footer */
.footer { text-align: center; padding: 24px var(--pad); color: var(--muted); font-size: 12px; }

/* Tablet */
@media (min-width: 720px) {
  :root { --pad: 24px; }
  .hero { padding: 64px 0 32px; }
  .hero-photo { width: 120px; height: 120px; }
  .hero-name { font-size: 40px; }
  .hero-tagline { font-size: 18px; }
  .section { padding: 56px 0; }
  .skill-groups { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .project-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
}

/* Desktop */
@media (min-width: 1080px) {
  .skill-groups { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
