/* ---------- tokens ---------- */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c1f1e;
  --muted: #5f6664;
  --line: #e4e2dc;
  --accent: #1f5f5b;
  --accent-soft: #e6f0ee;
  --chip: #f1efea;
  --shadow: 0 1px 2px rgba(20, 30, 28, 0.04), 0 4px 16px rgba(20, 30, 28, 0.04);
  --radius: 12px;
  --max: 880px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Segoe UI", "Malgun Gothic", "Noto Sans KR", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121514;
    --surface: #191d1c;
    --text: #e8ebe9;
    --muted: #9aa3a0;
    --line: #2a302e;
    --accent: #6fc2b8;
    --accent-soft: #1d2d2b;
    --chip: #232826;
    --shadow: none;
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4, h5, p { margin: 0; }
ul { margin: 0; padding: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

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

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: var(--max); margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px;
}
.brand { font-weight: 700; color: var(--text); white-space: nowrap; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--muted); font-size: 0.9rem; padding: 6px 10px; border-radius: 8px; white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--chip); text-decoration: none; }

.lang {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; flex-shrink: 0;
  background: var(--surface);
}
.lang button {
  font: inherit; font-size: 0.82rem; font-weight: 600;
  border: 0; background: transparent; color: var(--muted);
  padding: 4px 12px; border-radius: 999px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--bg); }

/* ---------- layout ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

.hero { padding: 72px 0 40px; }
.hero__name { font-size: clamp(2.2rem, 6vw, 3.2rem); line-height: 1.15; letter-spacing: -0.02em; }
.hero__title { margin-top: 6px; font-size: 1.2rem; color: var(--accent); font-weight: 600; }
.hero__links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; }
.hero__links a { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.hero__pdfs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.pdf {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.85rem; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); background: var(--surface);
}
.pdf:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.icon { display: inline-flex; width: 16px; height: 16px; }
.icon svg { width: 100%; height: 100%; }

.section { padding: 40px 0; border-top: 1px solid var(--line); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section__title {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 20px;
}
.toggle-all {
  font: inherit; font-size: 0.85rem; color: var(--accent); background: none; border: 0; cursor: pointer; padding: 4px;
}
.about { font-size: 1.08rem; max-width: 68ch; }

/* ---------- featured ---------- */
.featured { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.feature__title { font-size: 1.05rem; }
.feature__summary { margin-top: 8px; color: var(--muted); font-size: 0.95rem; }
.feature .chips { margin-top: 12px; }
.feature__link { margin-top: auto; padding-top: 14px; font-size: 0.9rem; font-weight: 600; align-self: flex-start; }

/* Briefly highlight the card a featured link jumped to */
.card:target { animation: target-flash 1.6s ease-out; }
@keyframes target-flash {
  0%, 30% { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  100% { border-color: var(--line); }
}

/* ---------- experience ---------- */
.job + .job { margin-top: 48px; }
.job__head {
  display: grid; grid-template-columns: 1fr auto; column-gap: 16px; align-items: baseline;
}
.job__company { font-size: 1.4rem; letter-spacing: -0.01em; }
.job__role { grid-column: 1; color: var(--muted); }
.job__period { grid-column: 2; grid-row: 1; color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.job__summary { margin-top: 12px; }

.bullets { padding-left: 1.1em; }
.bullets li { margin: 4px 0; }
.bullets li::marker { color: var(--accent); }

.cards { display: grid; gap: 16px; margin-top: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.card__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; }
.card__title { font-size: 1.08rem; }
.card__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.card__meta span + span::before { content: "·"; margin-right: 12px; }
.card .bullets { margin-top: 12px; }
.card__links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: 0.9rem; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips li {
  font-size: 0.78rem; padding: 2px 9px; border-radius: 6px; background: var(--chip); color: var(--muted);
}

.details { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.details summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-size: 0.9rem; font-weight: 600; user-select: none;
}
.details summary::-webkit-details-marker { display: none; }
.details summary::before {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform 0.15s;
}
.details[open] summary::before { transform: rotate(45deg); }
.details .when-open { display: none; }
.details[open] .when-open { display: inline; }
.details[open] .when-closed { display: none; }
.details__body { display: grid; gap: 18px; margin-top: 14px; }

.block h5 {
  font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px;
}
.block .bullets { margin-top: 0; }
.topics { display: grid; gap: 12px; }
.topic { padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); }
.topic__title { font-weight: 600; }
.topic .bullets { margin-top: 4px; font-size: 0.95rem; }

.other { margin-top: 24px; }
.other__title { font-size: 1rem; margin-bottom: 8px; }
.other__list { list-style: none; }
.other__list li {
  display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line);
}
.other__list li:last-child { border-bottom: 0; }
.other__period { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; padding-top: 2px; }
.other__name { font-weight: 600; }
.other__stack { font-weight: 400; color: var(--muted); font-size: 0.8rem; margin-left: 8px; white-space: nowrap; }
.other__desc { color: var(--muted); font-size: 0.92rem; }

/* ---------- skills / education ---------- */
.skills { display: grid; grid-template-columns: 110px 1fr; gap: 12px 16px; margin: 0; }
.skills dt { font-weight: 600; padding-top: 10px; }
.skills dd { margin: 0; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.plain { list-style: none; display: grid; gap: 16px; }
.plain li { display: flex; flex-direction: column; }

.footer {
  max-width: var(--max); margin: 0 auto; padding: 32px 16px 48px; color: var(--muted); font-size: 0.85rem;
  border-top: 1px solid var(--line);
}
.noscript { text-align: center; padding: 16px; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .nav { display: none; }
  .lang { margin-left: auto; }
  .hero { padding: 48px 0 32px; }
  .featured { grid-template-columns: 1fr; }
  .job__head { grid-template-columns: 1fr; }
  .job__period { grid-column: 1; grid-row: auto; }
  .card { padding: 16px; }
  .other__list li { grid-template-columns: 1fr; gap: 2px; }
  .skills { grid-template-columns: 1fr; gap: 4px; }
  .skills dt { padding-top: 8px; }
  .split { grid-template-columns: 1fr; gap: 0; }
  .split > div + div { margin-top: 32px; }
}

/* ---------- print ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #444; --line: #ccc; --accent: #1f5f5b; --accent-soft: #f4f4f4; --chip: #f0f0f0; }
  body { font-size: 11pt; }
  #featured, .topbar, .toggle-all, .hero__pdfs, .details summary, .skip, .footer { display: none !important; }
  .hero { padding: 0 0 16px; }
  .section { padding: 18px 0; }
  .card { box-shadow: none; break-inside: avoid-page; }
  .details { border: 0; padding: 0; }
  a { color: inherit; }
}

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