/* =========================================================
   Habin Lim — CV / Clean
   ========================================================= */

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

:root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #404040;
  --muted: #737373;
  --rule: #e5e5e5;
  --accent: #1a1a1a;
  --hover: #c2410c;

  --ff-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ff-display: 'Fraunces', 'Inter', serif;

  --container: 760px;
  --t: cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--ff-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--bg); }

a { color: inherit; text-decoration: none; transition: color .15s var(--t); }
a:hover { color: var(--hover); }

h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--t);
}
.nav.scrolled { border-bottom-color: var(--rule); }
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-brand { font-weight: 600; font-size: 15px; }
.nav-links { display: flex; gap: 22px; font-size: 14px; align-items: center; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links .nav-cv {
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  transition: background .2s, color .2s;
}
.nav-links .nav-cv:hover { background: var(--ink); color: #fff; }

/* HERO */
.hero { padding: 88px 0 56px; }
.hero-grid {
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.hero-text { min-width: 0; }
.hero-photo {
  margin: 0;
  width: 100%;
}
.hero-photo img {
  width: 100%;
  height: 440px;
  object-fit: cover;
  object-position: center 35%;
  border-radius: 4px;
  filter: grayscale(8%) contrast(1.02);
}
.hero-photo figcaption {
  margin-top: 10px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (max-width: 640px) {
  .hero-photo img {
    aspect-ratio: 16 / 9;
    height: auto;
  }
}

.hero-title {
  font-family: var(--ff-display);
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 14px;
}
.hero-role {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  line-height: 1.5;
}
.role-chunk { white-space: nowrap; }
.role-sep { color: var(--rule); }
@media (max-width: 640px) {
  .role-chunk { white-space: normal; }
}
.hero-role a { color: var(--ink); border-bottom: 1px solid var(--rule); }
.hero-role a:hover { color: var(--hover); border-bottom-color: currentColor; }
.hero-lede {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 32px;
  max-width: 620px;
}
.hero-links {
  display: flex;
  gap: 20px;
  font-size: 14.5px;
}
.hero-links a {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}
.hero-links a:hover { color: var(--hover); border-bottom-color: currentColor; }

/* SECTIONS */
.section { padding: 48px 0; }

.section-title {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}

/* ABOUT */
.about p {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.about p:last-child { margin-bottom: 0; }
.about a { color: var(--ink); border-bottom: 1px solid var(--rule); }
.about a:hover { color: var(--hover); border-bottom-color: currentColor; }

/* ROWS */
.rows { display: flex; flex-direction: column; gap: 24px; }
.row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  align-items: baseline;
}
.row-date {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.row-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}
.row-title a, .row-title .row-org { color: var(--muted); font-weight: 400; }
.row-title a:hover { color: var(--hover); }
.row-desc {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* PUBLICATIONS */
.pubs { display: flex; flex-direction: column; gap: 22px; }
.pub a {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  padding: 4px 0;
  align-items: start;
}
.pub-num {
  font-family: var(--ff-display);
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
  padding-top: 1px;
  font-variant-numeric: tabular-nums;
}
.pub a:hover .pub-num { color: var(--hover); }
.pub-body { min-width: 0; }
.pub-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.4;
  transition: color .15s var(--t);
}
.pub a:hover .pub-title { color: var(--hover); }
.pub-authors {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 2px;
  line-height: 1.55;
}
.pub-venue {
  font-size: 13.5px;
  color: var(--muted);
  font-style: italic;
}

/* FOOTER */
.footer {
  padding: 56px 0 48px;
  margin-top: 48px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--hover); }

/* REVEAL */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s var(--t), transform .5s var(--t); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* RESPONSIVE */
@media (max-width: 640px) {
  .nav-inner { flex-wrap: nowrap; gap: 12px; padding: 12px 20px; }
  .nav-brand { font-size: 14px; }
  .nav-links {
    width: auto;
    margin-left: auto;
    gap: 8px;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }
  .nav-links li { display: flex; align-items: center; }
  .nav-links a[href^="#"] {
    position: relative;
    width: 18px;
    height: 18px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    font-size: 0;
    line-height: 0;
  }
  .nav-links a[href^="#"]::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    opacity: 0.45;
    transform: translate(-50%, -50%);
    transition: transform .2s var(--t), opacity .2s var(--t), background .2s var(--t);
  }
  .nav-links a[href^="#"]:hover::after,
  .nav-links a[href^="#"].active::after {
    background: var(--ink);
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.85);
  }
  .nav-links .nav-cv { font-size: 11.5px; padding: 3px 9px; }
  .hero { padding: 56px 0 40px; }
  .section { padding: 32px 0; }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .row-date { font-size: 12px; }
  .hero-links { flex-wrap: wrap; gap: 14px; }
}
