/* =========================================================================
   Suwoong Yeom — academic portfolio
   Tokens → reset → layout → components → responsive
   ========================================================================= */

:root {
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

  --shell: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- light (default) ---------- */
:root,
:root[data-theme="light"] {
  --bg:          #fbfaf8;
  --bg-alt:      #f4f2ed;
  --surface:     #ffffff;
  --plate:       #ffffff;   /* figure background — stays light in both themes */

  --ink:         #14130f;
  --ink-soft:    #57534c;
  --ink-faint:   #8b877e;

  --line:        rgba(20, 19, 15, 0.10);
  --line-2:      rgba(20, 19, 15, 0.18);

  --accent:      #b8431f;
  --accent-soft: rgba(184, 67, 31, 0.08);
  --accent-line: rgba(184, 67, 31, 0.32);

  --shadow: 0 1px 2px rgba(20, 19, 15, 0.04), 0 12px 28px -12px rgba(20, 19, 15, 0.14);
  color-scheme: light;
}

/* ---------- dark ---------- */
:root[data-theme="dark"] {
  --bg:          #100f0d;
  --bg-alt:      #171613;
  --surface:     #1b1a17;
  /* 흰 배경 로고·논문 figure가 판 위에서 사각형으로 도드라지지 않도록 순백 유지 */
  --plate:       #ffffff;

  --ink:         #f4f1ea;
  --ink-soft:    #a9a49a;
  --ink-faint:   #7c7870;

  --line:        rgba(244, 241, 234, 0.11);
  --line-2:      rgba(244, 241, 234, 0.20);

  --accent:      #ff8355;
  --accent-soft: rgba(255, 131, 85, 0.12);
  --accent-line: rgba(255, 131, 85, 0.40);

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 32px -14px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* =========================================================================
   Reset
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

h1, h2, h3, h4, p, figure, ul { margin: 0; padding: 0; }
ul { list-style: none; }
img, svg, video { display: block; max-width: 100%; }
/* beat the width/height presentation hints so aspect-ratio can take effect */
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.25rem;
}
.skip-link:focus { left: 0; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* =========================================================================
   Nav
   ========================================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line); }

.nav-inner {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}
.nav-brand-mark {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.nav-brand-name {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  position: relative;
  padding: 0.25rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-faint);
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after { transform: scaleX(1); }

.theme-toggle {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 2.125rem;
  height: 2.125rem;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }
.theme-toggle svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
:root[data-theme="light"] .icon-moon,
:root[data-theme="dark"]  .icon-sun { display: none; }

/* =========================================================================
   Hero
   ========================================================================= */
.hero { padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5.5rem); }

.hero-grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.25rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
}

.hero-lede {
  max-width: 34em;
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  line-height: 1.75;
  color: var(--ink-soft);
}
.hero-lede p + p { margin-top: 1rem; }

/* inline links in the bio — same emphasis as a highlighted author name */
.hero-lede a {
  font-weight: 600;
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent-line);
  transition: color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.hero-lede a:hover {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.hero-lede em {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.08em;
  color: var(--ink);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
}
.chips li {
  padding: 0.3125rem 0.75rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.chips li:hover { border-color: var(--accent-line); color: var(--ink); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 2.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  padding: 0.5625rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease),
              color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn svg {
  width: 0.9375rem;
  height: 0.9375rem;
  flex-shrink: 0;
  fill: currentColor;
  stroke: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 86%, #000);
  border-color: color-mix(in srgb, var(--accent) 86%, #000);
  color: #fff;
}

/* ---------- portrait ---------- */
.hero-aside { justify-self: start; width: 100%; max-width: 340px; }

.portrait {
  position: relative;
  padding: 0 0.875rem 0.875rem 0;
}
.portrait::before {
  content: "";
  position: absolute;
  left: 0.875rem;
  top: 0.875rem;
  right: 0;
  bottom: 0;
  border: 1px solid var(--accent-line);
  border-radius: 4px;
}
.portrait img {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-alt);
}

.portrait-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.125rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}
.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* =========================================================================
   Sections
   ========================================================================= */
section[id] { scroll-margin-top: 4.5rem; }

.band { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.band-alt {
  background: var(--bg-alt);
  transition: background-color 0.3s var(--ease);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-2);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 3.6vw, 2.625rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.section-note {
  font-size: 0.875rem;
  color: var(--ink-faint);
}
.section-note .mark { color: var(--accent); font-weight: 600; }

/* =========================================================================
   Selected work
   ========================================================================= */
.work-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

.work-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease),
              box-shadow 0.25s var(--ease);
}
.work-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.work-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  min-height: 0;   /* else the flex item's auto minimum beats aspect-ratio */
  padding: 0.75rem;
  background: var(--plate);
  border-bottom: 1px solid var(--line);
}
/* fill the ratio box rather than letting the asset's own height set it,
   so every card lines up regardless of figure or video proportions */
.work-thumb img,
.work-thumb video { width: 100%; height: 100%; object-fit: contain; }

.work-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem;
}

.venue-chip {
  display: inline-block;
  padding: 0.1875rem 0.5rem;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

.work-title {
  margin-top: 0.75rem;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.011em;
}

.work-desc {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.work-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1rem;
}
.work-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease);
}
.work-links a:hover { border-bottom-color: var(--accent); }

/* =========================================================================
   Publications
   ========================================================================= */
.pub-group + .pub-group { margin-top: clamp(2.5rem, 5vw, 3.5rem); }

.pub-group-title {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.pub-group-title .count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--ink-faint);
}

.pub {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.pub-group-title + .pub { margin-top: 0.5rem; }

.pub-idx {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.pub-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 16 / 10;
  min-height: 0;   /* else the grid item's auto minimum beats aspect-ratio */
  padding: 0.5rem;
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.pub-thumb img,
.pub-thumb video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s var(--ease);
}
.pub-thumb:hover img,
.pub-thumb:hover video { transform: scale(1.03); }

.pub-venue {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
}
.venue-sub { color: var(--ink-faint); }

.pub-title {
  margin-top: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.012em;
}

.pub-authors {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--ink-faint);
}
/* .me = 본인 (Publications) · .mentee = 멘티 (Mentoring) — 강조 방식은 동일 */
.pub-authors .me,
.pub-authors .mentee {
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent-line);
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.875rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3125rem 0.6875rem;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease),
              color 0.2s var(--ease);
}
.pill:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.pill-arxiv { border-color: var(--accent-line); color: var(--accent); }
.pill-openreview { border-color: var(--line-2); }

/* =========================================================================
   Mentoring
   ========================================================================= */
/* same three-column rhythm as .pub so both sections line up */
.mentor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
  position: relative;
}

.mentor-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

/* who was mentored — same chip pattern as the advisor line */
.mentee-tag {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}
.mentee-tag .label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.125rem 0.4375rem;
  border: 1px solid var(--accent-line);
  border-radius: 4px;
}
.mentee-tag .name {
  font-weight: 600;
  color: var(--ink);
}
.mentee-tag .role {
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 0.6875rem;
  color: var(--ink-faint);
}

.mentor-title {
  margin-top: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.012em;
}

/* =========================================================================
   Timeline (projects / education)
   ========================================================================= */
.tl-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
  position: relative;
}

.tl-date {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
}

.tl-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.012em;
}

.tl-org {
  margin-top: 0.375rem;
  color: var(--ink-soft);
}

/* 지도교수 / 호스트 */
.tl-advisor {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}
.tl-advisor .label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.125rem 0.4375rem;
  border: 1px solid var(--accent-line);
  border-radius: 4px;
}
.tl-advisor .name { color: var(--ink-soft); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4375rem;
  margin-top: 0.875rem;
}
.tags span {
  padding: 0.1875rem 0.5625rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--ink-faint);
}

/* ---------- institution logos (education) ---------- */
.timeline-logos .tl-item {
  grid-template-columns: 4rem 1fr;
  grid-template-areas:
    "logo date"
    "body body";
  gap: 0.75rem 1rem;
  align-items: center;
}
.timeline-logos .tl-date { grid-area: date; }
.timeline-logos .tl-logo { grid-area: logo; }
.timeline-logos .tl-body { grid-area: body; }

.tl-logo {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  padding: 0.4375rem;
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.tl-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
/* the Purdue file carries a lot of internal padding — even it out */
.logo-purdue img { transform: scale(1.25); }

/* ---------- wide plates for horizontal wordmarks (company logos) ---------- */
.timeline-logos-wide .tl-item { grid-template-columns: 7rem 1fr; }
.timeline-logos-wide .tl-logo { width: 7rem; height: 3.25rem; }

/* =========================================================================
   Template markers (delete these entries once filled in)
   ========================================================================= */
.is-template { opacity: 0.72; }
.is-template::after {
  content: "";
  position: absolute;
  inset: 0.75rem -0.875rem 0.5rem;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  pointer-events: none;
}

.template-badge {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.1875rem 0.5rem;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}
.footer-inner a:hover { color: var(--accent); }

/* =========================================================================
   Reveal on scroll
   ========================================================================= */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (min-width: 600px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .shell { padding-inline: 2.5rem; }
  .nav-inner { padding-inline: 2.5rem; }

  .timeline-logos .tl-item {
    grid-template-columns: 11rem 4rem 1fr;
    grid-template-areas: "date logo body";
    gap: 1.5rem;
  }

  /* project rows carry tags, so the body is tall — top-align instead of centring */
  .timeline-logos-wide .tl-item {
    grid-template-columns: 11rem 7rem 1fr;
    align-items: start;
  }
  .timeline-logos-wide .tl-date { padding-top: 0.3125rem; }

  .pub {
    grid-template-columns: 2.25rem 200px 1fr;
    gap: 1.75rem;
    align-items: start;
  }
  .pub-idx { padding-top: 0.125rem; }
  .pub-thumb { max-width: none; }

  .mentor {
    grid-template-columns: 2.25rem 200px 1fr;
    gap: 1.75rem;
    align-items: start;
  }
  .mentor-year { padding-top: 0.125rem; }

  .tl-item {
    grid-template-columns: 12rem 1fr;
    gap: 2rem;
    align-items: start;
  }
  .tl-date { padding-top: 0.1875rem; }
}

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  .hero-aside { justify-self: end; }
  .work-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Narrow phones — keep the nav from crowding the brand out */
@media (max-width: 640px) {
  .nav-brand-name { display: none; }
  .nav-inner { gap: 0.875rem; }
  .nav-links { gap: 1.125rem; }
}
