/* =========================================================
   Personal homepage — layout inspired by the Minimal Mistakes
   author-sidebar theme (left profile column + right content).
   Supports a light/dark theme and an EN/KO language switch.
   ========================================================= */

/* ------------------------------ Palette ------------------------------- */
:root {
  --bg: #ffffff;
  --text: #3d3d3d;
  --strong: #222222;
  --detail: #555555;
  --muted: #7a8288;
  --link: #2f6fab;
  --link-hover: #1a4a75;
  --border: rgba(130, 130, 130, 0.3);
  --btn-hover: rgba(130, 130, 130, 0.12);
  /* GitHub-inspired colors for project stack labels. */
  --stack-python: #3572a5;
  --stack-pytorch: #ee4c2c;
  --stack-selenium: #43b02a;
  --stack-pandas: #6f42c1;
  --stack-transformers: #d4a72c;
  --stack-trl: #e36209;
  --stack-openai: #10a37f;
  --stack-scipy: #4d77cf;
  --stack-seaborn: #4c72b0;
  --stack-javascript: #c9a227;
  --stack-db: #39ff14;
  --stack-react: #149eca;
  --stack-typescript: #3178c6;
  --stack-vite: #9b66ff;
  --stack-express: #555555;
  --stack-postgresql: #336791;
  --stack-supabase: #3ecf8e;
  --stack-docker: #2496ed;
  --masthead-h: 60px;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
          system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo",
          "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji",
          "Segoe UI Symbol", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15171c;
  --text: #c9ced6;
  --strong: #e8ebef;
  --detail: #a8aeb8;
  --muted: #868e99;
  --link: #7cb0f0;
  --link-hover: #a6cbf7;
  --border: rgba(150, 155, 165, 0.25);
  --btn-hover: rgba(200, 205, 215, 0.12);
}

/* --------------------------- Language switch -------------------------- */
/* English is the default when no language has been chosen yet. */
html[data-lang="ko"] .en { display: none; }
html:not([data-lang="ko"]) .ko { display: none; }
html:not([data-lang="ko"]) .education-high-school { display: none; }

/* Korean typography refinements */
html[data-lang="ko"],
.ko {
  word-break: keep-all;
  overflow-wrap: break-word;
  letter-spacing: -0.015em;
}

* { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

/* Keep icon-only project links accessible to screen readers. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  padding-top: var(--masthead-h);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

p { margin: 0 0 1em; }

/* ------------------------------ Masthead ------------------------------ */
.masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  height: var(--masthead-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s ease;
}

.masthead__inner-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.site-title:hover { text-decoration: none; color: var(--link); }

/* --------------------------- Toggle buttons --------------------------- */
.masthead__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Language : EN | KR */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.lang-switch__sep { color: var(--border); }

.lang-opt {
  padding: 0;
  font: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
}

.lang-opt:hover { color: var(--link); }
.lang-opt:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* Highlight the active language (English is the default). */
html[data-lang="ko"] .lang-opt[data-set-lang="ko"],
html:not([data-lang="ko"]) .lang-opt[data-set-lang="en"] {
  color: var(--strong);
  font-weight: 700;
  cursor: default;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.6rem;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover { background: var(--btn-hover); }
.icon-btn:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* Show the moon in light mode, the sun in dark mode. */
.icon-btn .icon-sun { display: none; }
html[data-theme="dark"] .icon-btn .icon-moon { display: none; }
html[data-theme="dark"] .icon-btn .icon-sun { display: block; }

/* ------------------------------- Layout ------------------------------- */
.page__wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
}

.sidebar {
  flex: 0 0 260px;
  width: 260px;
  font-size: 0.875rem;
}

.sidebar.sticky {
  position: sticky;
  top: calc(var(--masthead-h) + 2rem);
}

.page { flex: 1 1 auto; min-width: 0; }

/* ------------------------------- Author ------------------------------- */
.author__avatar { margin-bottom: 1rem; }

.author__avatar img {
  display: block;
  width: 175px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.author__name {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--strong);
}

.author__bio { margin-bottom: 1rem; color: var(--muted); }
.author__bio p { margin: 0; font-size: 0.875rem; }

.author__urls {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.author__urls li {
  padding: 0.4rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.author__urls a { color: var(--text); }
.author__urls a:hover { color: var(--link); text-decoration: none; }
.author__urls i { color: var(--muted); margin-right: 0.35rem; }

/* ------------------------------ Sections ------------------------------ */
.section { margin-bottom: 2.5rem; }

.section-title {
  margin: 0 0 0.35em;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--strong);
}

hr.sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0 0 0.9em;
  width: 100%;
}

.page__content p { font-size: 0.95rem; }

/* Entry lists (Education / Experiences / Projects) */
.my_list {
  list-style: none;
  margin: 0.5em 0 0;
  padding-left: 0;
  font-size: 0.925rem;
}

.my_list > li { margin-bottom: 0.85em; }
/* Projects: space between one project's badge row and the next project's title */
#projects .my_list > li:not(:last-child) { margin-bottom: 1.8em; }
.my_list > li:last-child { margin-bottom: 0; }

.no-top-level-bullets {
  list-style: none;
  padding-left: 0;
}

.experience-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.45rem;
  row-gap: 0.1rem;
}

.experience-sep {
  color: var(--muted);
  margin: 0 0.05rem;
}

.experience-role {
  flex-basis: 100%;
}

.title { font-weight: 700; color: var(--strong); }

.dot-sep { margin: 0 5px; color: var(--muted); }

.inner-ul {
  list-style: none;
  margin: 0.15em 0 0;
  padding-left: 0;
  color: var(--detail);
}

.inner-li { margin: 0; }

/* Bulleted detail list (used in Projects) */
.inner-ul.bullets {
  list-style: disc;
  padding-left: 1.15em;
}

.inner-ul.bullets .inner-li { margin-bottom: 0.1em; }
.inner-ul.bullets .inner-li::marker { color: var(--muted); }

/* Role / affiliation line above the bullets */
.role { color: var(--detail); }

/* Tech-stack + link line below the bullets */
.meta {
  margin-top: 0.3em;
  font-size: 0.85em;
  color: var(--muted);
}

.tech-stack {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.45em;
  vertical-align: middle;
}

.tech-stack img {
  display: block;
  width: auto;
  height: 20px;
  max-width: 100%;
}

.model-badge {
  display: inline-flex;
  height: 20px;
  overflow: hidden;
  color: #fff;
  border-radius: 3px;
  font-family: Verdana, Geneva, "DejaVu Sans", sans-serif;
  font-size: 11px;
  line-height: 20px;
  white-space: nowrap;
}

.model-badge__label,
.model-badge__model {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
}

.model-badge__label { background: #555; }
.model-badge__model { background: #007ec6; }

.model-badge img {
  width: 12px;
  height: 12px;
}

.tech-stack--grouped {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  max-width: 100%;
  vertical-align: middle;
}

.tech-stack-group {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  min-width: 0;
}

.tech-stack-label {
  min-width: 0;
  color: var(--muted);
  font-size: 0.82em;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.tech-stack-items {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
}

.project-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7em;
  height: 1.7em;
  margin-left: 0.45em;
  color: var(--muted);
  border-radius: 0.35em;
  vertical-align: middle;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.project-link:hover {
  color: var(--link);
  background: var(--btn-hover);
  text-decoration: none;
}

.project-link:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.project-link i { font-size: 1.15em; }

.project-link--code i { font-size: 1.3em; }

.project-link--demo i { font-size: 1.25em; }

.stack {
  margin-right: 0.35em;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}
.stack-item { font-weight: 600; }
.stack-python { color: var(--stack-python); }
.stack-pytorch { color: var(--stack-pytorch); }
.stack-selenium { color: var(--stack-selenium); }
.stack-pandas { color: var(--stack-pandas); }
.stack-transformers { color: var(--stack-transformers); }
.stack-trl { color: var(--stack-trl); }
.stack-openai { color: var(--stack-openai); }
.stack-scipy { color: var(--stack-scipy); }
.stack-seaborn { color: var(--stack-seaborn); }
.stack-javascript { color: var(--stack-javascript); }
.stack-react { color: var(--stack-react); }
.stack-typescript { color: var(--stack-typescript); }
.stack-vite { color: var(--stack-vite); }
.stack-express { color: var(--stack-express); }
.stack-postgresql { color: var(--stack-postgresql); }
.stack-supabase { color: var(--stack-supabase); }
.stack-docker { color: var(--stack-docker); }
.stack-db {
  color: var(--stack-db);
  text-shadow: 0 0 0.35em rgba(57, 255, 20, 0.35);
}
.stack::after { content: " ·"; }

/* ------------------------------- Footer ------------------------------- */
.page__footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
}

.copyright {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ------------------------------ Responsive ---------------------------- */
@media (max-width: 900px) {
  .page__wrap {
    flex-direction: column;
    gap: 2rem;
    padding-top: 2rem;
  }

  .sidebar {
    flex: none;
    width: 100%;
    position: static;
    text-align: center;
  }

  .sidebar.sticky { position: static; }

  .author__avatar img { margin: 0 auto; width: 140px; }

  .author__urls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 1.25rem;
    border-top: 0;
    padding-top: 0.5rem;
  }

  .author__urls li { border-bottom: 0; padding: 0.2rem 0; }
}
