:root {
  --bg: #ffffff;
  --panel: #f4f5f3;
  --ink: #16201d;
  --muted: #5a6560;
  --line: #e2e6e3;
  --accent: #0b6e63;
  --accent-ink: #ffffff;
  --st-active: #0b6e63;
  --st-shipped: #2f5fb3;
  --st-proto: #b26b00;
  --st-paused: #7c8580;
  --st-retired: #a5aca8;
  --sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101312; --panel: #181c1b; --ink: #e8ece9; --muted: #9aa5a0; --line: #272d2b;
    --accent: #5fc9b5; --accent-ink: #0a1210;
    --st-active: #5fc9b5; --st-shipped: #8fb1ee; --st-proto: #e6b155; --st-paused: #8b958f; --st-retired: #6b746f;
  }
}
:root[data-theme="dark"] {
  --bg: #101312; --panel: #181c1b; --ink: #e8ece9; --muted: #9aa5a0; --line: #272d2b;
  --accent: #5fc9b5; --accent-ink: #0a1210;
  --st-active: #5fc9b5; --st-shipped: #8fb1ee; --st-proto: #e6b155; --st-paused: #8b958f; --st-retired: #6b746f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; background: var(--panel); padding: 1px 5px; border-radius: 4px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
.muted { color: var(--muted); }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.top nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.theme-btn { font: 500 13px var(--sans); color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px; cursor: pointer; }
.theme-btn:hover { color: var(--ink); border-color: var(--muted); }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 8px 48px; align-items: center; padding-top: 72px; padding-bottom: 8px; }
.hero h1 { font-size: clamp(44px, 7vw, 68px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; margin: 0 0 16px; }
.tagline { font-size: clamp(19px, 2.4vw, 24px); line-height: 1.35; margin: 0 0 28px; color: var(--muted); max-width: 26em; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid var(--accent); }
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); filter: none; }
.avatar { position: relative; width: 210px; height: 280px; border-radius: 24px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; justify-self: end; }
.avatar-ph { font-size: 56px; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.glance { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 48px 0 0; border-top: 1px solid var(--line); }
.glance > div { padding: 20px 24px 4px 0; }
.glance > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.glance dt { font-weight: 700; font-size: 15px; margin: 0 0 4px; }
.glance dd { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }

/* sections */
section.wrap { padding-top: 88px; }
h2 { font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 28px; }
h3 { margin: 0; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
#research .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { position: relative; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: border-color .15s; }
.card:hover { border-color: var(--muted); }
.card.wide { grid-column: 1 / -1; flex-direction: row; }
.thumb { background: var(--panel); color: var(--ink); border-bottom: 1px solid var(--line); display: grid; place-items: center; }
.thumb svg { display: block; width: 100%; height: 100%; }
.thumb:not(.photo) { aspect-ratio: 16 / 9; }
#projects .card:not(.wide) .thumb { aspect-ratio: 16 / 7; }
.thumb.photo { padding: 0; }
.thumb.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card.wide .thumb { flex: 0 0 46%; border-bottom: 0; border-right: 1px solid var(--line); }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.status { margin: 0 0 10px; font-size: 13.5px; font-weight: 500; color: var(--muted); line-height: 1.4; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; transform: translateY(-1px); }
.s-active { background: var(--st-active); }
.s-shipped { background: var(--st-shipped); }
.s-proto { background: var(--st-proto); }
.s-paused { background: var(--st-paused); }
.s-retired { background: var(--st-retired); }
.card h3 { font-size: 18px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 700; margin-bottom: 10px; }
.open { all: unset; cursor: pointer; }
.open::after { content: ""; position: absolute; inset: 0; }
.open:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.summary { margin: 0 0 14px; color: var(--ink); font-size: 15.5px; }
.tags { margin: auto 0 0; color: var(--muted); font-size: 13.5px; }

/* also built */
h3.sub { font-size: 22px; letter-spacing: -0.015em; margin: 64px 0 8px; }
.also { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.also li { padding: 16px 0; border-top: 1px solid var(--line); }
.also b { font-weight: 700; }
.also b a { text-decoration-thickness: 1px; }
.also p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.state { margin-left: 8px; font-size: 13px; color: var(--muted); }

/* timeline rows */
.timeline .row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 4px 32px; padding: 22px 0; border-top: 1px solid var(--line); }
.timeline .row:last-child { border-bottom: 1px solid var(--line); }
.when { margin: 3px 0 0; color: var(--muted); font-size: 14.5px; font-weight: 500; }
.timeline h3 { font-size: 17px; line-height: 1.35; letter-spacing: -0.005em; margin-bottom: 4px; }
.timeline p { margin: 0 0 6px; }
.timeline .muted { font-size: 15px; }
.skills { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 10px 32px; margin: 40px 0 0; }
.skills dt { color: var(--muted); font-size: 14.5px; font-weight: 500; }
.skills dd { margin: 0; }

.contact-lead { margin: 0 0 12px; max-width: 34em; }
.contact { list-style: none; padding: 0; margin: 0; }
.contact li { margin: 6px 0; font-size: 17px; }
.foot { display: flex; justify-content: space-between; margin-top: 96px; padding-top: 22px; padding-bottom: 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* details dialog */
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--bg); color: var(--ink); }
dialog::backdrop { background: rgb(10 14 13 / 0.55); }
.modal-in { padding: 28px 32px 32px; position: relative; }
.modal-x { position: absolute; top: 18px; right: 20px; font: 500 13px var(--sans); color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.modal-x:hover { color: var(--ink); border-color: var(--muted); }
#modal-title { font-size: 24px; line-height: 1.25; letter-spacing: -0.02em; margin: 0 72px 18px 0; }
.modal-body p { margin: 0 0 14px; }
.modal-body ul { margin: 0 0 14px; padding-left: 20px; }
.modal-body li { margin: 6px 0; }
.modal-body .full-links { display: flex; flex-wrap: wrap; gap: 6px 20px; font-weight: 500; margin: 18px 0 0; }
.modal-body .full-shot { margin: 14px 0 0; }
.modal-body .full-shot img { display: block; width: 200px; height: auto; border-radius: 14px; border: 1px solid var(--line); }
.modal-body .full-shot figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* without JS the details show inline */
.no-js .full { display: block !important; padding: 0 22px 20px; }
.no-js .full[hidden] { display: block; }

@media (max-width: 900px) {
  #research .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top nav { display: none; }
  .top-in { justify-content: space-between; }
  .hero { grid-template-columns: minmax(0, 1fr) 132px; gap: 8px 24px; padding-top: 44px; }
  .avatar { width: 132px; height: 176px; border-radius: 18px; }
  .avatar-ph { font-size: 38px; }
  .glance { grid-template-columns: 1fr; margin-top: 32px; }
  .glance > div, .glance > div + div { padding: 16px 0; border-left: 0; }
  .glance > div + div { border-top: 1px solid var(--line); }
  section.wrap { padding-top: 64px; }
}
@media (max-width: 680px) {
  .wrap { padding: 0 18px; }
  #research .cards, .cards { grid-template-columns: 1fr; }
  .card.wide { flex-direction: column; }
  .card.wide .thumb { flex: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .also { grid-template-columns: 1fr; }
  .timeline .row, .skills { grid-template-columns: 1fr; gap: 2px; }
  .skills dt { margin-top: 8px; }
  .hero { grid-template-columns: 1fr; }
  .avatar { grid-row: 1; justify-self: start; width: 108px; height: 144px; }
  .avatar-ph { font-size: 30px; }
  .modal-in { padding: 22px 20px 24px; }
}
@media print { .top, .theme-btn, dialog { display: none; } .card { break-inside: avoid; } .no-js .full, .full { display: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .card { transition: none; } }
