:root {
  color-scheme: dark;
  --bg: #111520;
  --surface: #1a2030;
  --ink: #f5f1ea;
  --muted: #b6c1d3;
  --line: #353f53;
  --accent: #b7e7cb;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.65 var(--sans); }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
figure, h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.04; }
img { display: block; max-width: 100%; }
.page-width, .site-header { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: fixed; z-index: 5; top: 8px; left: 8px; padding: 8px 14px; background: var(--accent); color: var(--bg); transform: translateY(-150%); }
.skip:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 4vw, 3.5rem);
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.wordmark { margin-right: auto; font: 1.35rem var(--serif); white-space: nowrap; }
.wordmark span, .header-github span { color: var(--accent); }
.site-header nav { display: flex; gap: clamp(1rem, 3vw, 2rem); }
.site-header nav a, .header-github, .footer a { font-size: .9rem; color: var(--muted); }
.site-header a:hover, .footer a:hover { color: var(--accent); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, .92fr);
  align-items: center;
  gap: clamp(2.5rem, 7vw, 7rem);
  padding-block: clamp(4.5rem, 10vw, 8rem) clamp(5rem, 11vw, 9rem);
}
.label { color: var(--accent); font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 { margin-block: 1.25rem 1.65rem; font-size: clamp(3.1rem, 6.1vw, 6rem); letter-spacing: -.065em; }
.hero h1 em { display: inline-block; color: var(--accent); font-weight: inherit; }
.intro { max-width: 33rem; color: var(--muted); font-size: clamp(1.04rem, 1.6vw, 1.2rem); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }
.button { display: inline-flex; align-items: center; gap: .8rem; padding: .65rem .95rem; border: 1px solid transparent; border-radius: 7px; font-size: .9rem; font-weight: 650; }
.button.primary { background: var(--accent); color: #14281f; }
.button.primary:hover { background: #d4f3e0; }
.button.secondary { border-color: var(--line); }
.button.secondary:hover { border-color: var(--accent); }
.portrait {
  width: min(100%, 352px);
  justify-self: end;
}
.portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 50% 32%;
  border: 1px solid #748d92;
  border-radius: 50%;
  background: var(--surface);
}
.portrait-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin-top: .85rem;
}
.portrait-links a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: .85rem;
  font-weight: 650;
}
.portrait-links a:hover { border-color: var(--accent); }
.portrait-links a span { color: var(--accent); }

.work { border-top: 1px solid var(--line); padding-block: 4.6rem 5.5rem; }
.section-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: .9rem 3rem; margin-bottom: 1.9rem; }
h2 { font-size: clamp(2.7rem, 5.1vw, 4.3rem); letter-spacing: -.05em; }
.section-heading p { max-width: 25rem; color: var(--muted); }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.3rem; }
.project { display: flex; flex-direction: column; overflow: hidden; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); }
.project:focus-within { border-color: #86ab9a; }
.art { min-height: 220px; display: grid; place-content: center; padding: clamp(.75rem, 3vw, 2rem); overflow: hidden; border-bottom: 1px solid #526173; }
.art-seonsu { background: radial-gradient(ellipse at 50% 85%, #578674, #233e3e 65%, #1c3033); }
.art-network { background: radial-gradient(ellipse at 85% 20%, #4e5c84, #2c324d 64%, #222940); }
.art-next { background: radial-gradient(ellipse at 36% 22%, #754c58, #452e41 70%, #352637); }
.art-ml { background: radial-gradient(ellipse at 65% 20%, #745770, #463952 65%, #302539); }
.art-device { background: radial-gradient(ellipse at 70% 15%, #506c92, #293c59 65%, #202b41); }
.art-faultline { background: radial-gradient(ellipse at 75% 20%, #815c49, #4d352e 65%, #352923); }
.recovery, .discovery, .route-panel, .model-panel { width: clamp(176px, 24vw, 275px); border: 1px solid #8f9cad80; border-radius: 10px; padding: 14px 17px; box-shadow: 0 12px 32px #0005; }
.recovery { background: #192b29; }
.recovery > span, .art-caption { display: block; color: #b7e7cb; font-size: .61rem; font-weight: 650; letter-spacing: .12em; }
.recovery strong { font: 1.38rem var(--serif); }
.steps { display: flex; gap: 5px; margin-block: 12px; }
.steps i { flex: 1; height: 4px; background: #56766e; border-radius: 5px; }
.steps i:nth-child(-n+2) { background: var(--accent); }
.check-row { padding-block: 3px; color: #d0e2dc; font-size: .73rem; }
.check-row b { margin-right: .4em; color: var(--accent); }
.route-panel { width: clamp(220px, 27vw, 310px); background: #222b44; }
.route-panel .art-caption { color: #b4c8f0; }
.route-hops { display: flex; justify-content: space-between; gap: .45rem; margin-top: 1rem; background: linear-gradient(#7794c5, #7794c5) center 5px / 68% 1px no-repeat; }
.route-hops span { min-width: 0; color: #e0eafe; font-size: .72rem; text-align: center; }
.route-hops span::before { display: block; width: 11px; height: 11px; margin: 0 auto 6px; border: 2px solid #222b44; border-radius: 50%; background: #afc7f5; content: ''; }
.faultline-panel { background: #382a25; }
.faultline-panel .art-caption { color: #f3c5a3; }
.faultline-panel .route-hops { background-image: linear-gradient(#a6806b, #a6806b); }
.faultline-panel .route-hops span { color: #f7e4d6; }
.faultline-panel .route-hops span::before { border-color: #382a25; background: #edb99b; }
.discovery { background: #30202e; }
.search { display: flex; justify-content: space-between; padding: .2rem .55rem; border-radius: 4px; border: 1px solid #785b73; font-size: .72rem; }
.posters { display: flex; margin-block: .65rem; gap: 7px; }
.posters b { flex: 1; height: 48px; border-radius: 4px; background: linear-gradient(137deg, #a3647a 26%, #533c70 70%); }
.posters b:nth-child(2) { background: linear-gradient(40deg, #343759 18%, #5f8298 66%); }
.posters b:nth-child(3) { background: linear-gradient(119deg, #59385d 18%, #b8656d 78%); }
.filter-labels { display: flex; gap: 6px; font-size: .56rem; }
.filter-labels span { border: 1px solid #785b73; border-radius: 5px; padding-inline: .25rem; }
.model-panel { background: #33263d; }
.model-panel .art-caption { margin-bottom: .65rem; color: #f2c9e6; }
.model-list { display: grid; gap: 5px; }
.model-list span { padding: .25rem .55rem; border: 1px solid #6e5373; border-radius: 5px; color: #f3e7f3; font-size: .72rem; }

.project-copy { display: flex; flex-direction: column; align-items: flex-start; flex-grow: 1; padding: clamp(1.18rem, 2.5vw, 1.65rem); }
.project h3 { margin-block: .65rem .75rem; font-size: clamp(1.95rem, 3.1vw, 2.5rem); letter-spacing: -.035em; }
.project-copy > p:not(.label) { color: var(--muted); font-size: .95rem; }
.project-copy > p.stack { margin-top: auto; padding-top: .9rem; font-size: .77rem; }
.project-links { display: flex; flex-wrap: wrap; gap: .3rem 1.15rem; margin-top: 1rem; }
.project-links a { border-bottom: 1px solid transparent; color: var(--accent); font-size: .87rem; font-weight: 650; }
.project-links a:hover { border-color: currentColor; }

.publications, .about { padding-block: 4.2rem; border-top: 1px solid var(--line); }
.publication-list { margin: 0; padding: 0; list-style: none; }
.publication-list li { padding: clamp(1.2rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); }
.publication-list strong { color: var(--ink); }
.publication-list a { color: var(--accent); text-decoration: underline; text-underline-offset: .18em; }
.publication-list a:hover { color: var(--ink); }
.about { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 6vw, 5rem); }
.about p { max-width: 34rem; margin-top: 1.05rem; color: var(--muted); }
.toolkit { align-self: center; padding: 1.4rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.toolkit h3 { font-size: 1.5rem; }
.toolkit ul { display: flex; flex-wrap: wrap; gap: .45rem; margin: .9rem 0 0; padding: 0; list-style: none; }
.toolkit li { border: 1px solid var(--line); border-radius: 6px; padding: .2rem .52rem; color: var(--muted); font-size: .82rem; }
.contact { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem 2rem; padding-block: 3.25rem; border-top: 1px solid var(--line); }
.contact .actions { margin: 0; }
.footer { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.35rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }

@media (max-width: 760px) {
  .page-width, .site-header { width: calc(100% - 40px); }
  .hero { grid-template-columns: 1fr; gap: 2.3rem; padding-block: 3.7rem 4.5rem; }
  .hero h1 { font-size: clamp(3rem, 10vw, 4.7rem); }
  .portrait { width: min(67%, 270px); justify-self: start; }
  .project-grid, .about { grid-template-columns: minmax(0, 1fr); }
  .work, .publications, .about { padding-block: 3rem; }
}

@media (max-width: 560px) {
  .site-header { flex-wrap: wrap; gap: .35rem 1rem; padding-block: .6rem; }
  .site-header nav { order: 1; width: 100%; flex-wrap: wrap; gap: .3rem .85rem; }
}

@media (max-width: 410px) {
  .header-github { display: none; }
  .hero h1 { font-size: clamp(2.65rem, 11vw, 3.2rem); }
  .art { min-height: 185px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
