/* ============================================================
   Yunjung Pak - academic homepage
   ============================================================ */

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

* {
  margin: 0;
}

:root {
  --ink: #16211f;
  --muted: #5f6f6a;
  --surface: #ffffff;
  --surface-soft: #f4f7f6;
  --surface-tint: #eef5f2;
  --line: #dce5e1;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-warm: #9a5b13;
  --accent-cool: #315d80;
  --focus: #0b6bcb;
  --shadow: 0 18px 50px rgba(16, 34, 31, 0.08);
  --max-width: 1120px;
  --nav-height: 68px;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
}

body {
  min-height: 100vh;
  color: var(--ink);
  background: var(--surface);
  font-family: var(--font-sans);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-warm);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 2000;
  transform: translateY(-150%);
  padding: 0.65rem 0.9rem;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
}

.skip-link:focus {
  transform: translateY(0);
}

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(14px);
}

.nav-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 28px rgba(16, 34, 31, 0.08);
}

.nav-inner {
  max-width: var(--max-width);
  height: var(--nav-height);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.nav-name {
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  list-style: none;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
  border-radius: 2px;
  transition: transform 160ms ease, opacity 160ms ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.hero {
  padding: calc(var(--nav-height) + 4.5rem) 1.5rem 4rem;
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.08), rgba(49, 93, 128, 0.05) 46%, rgba(154, 91, 19, 0.06)),
    var(--surface);
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin-top: 0.35rem;
  font-family: var(--font-serif);
  font-size: clamp(2.65rem, 7vw, 5.4rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-title {
  margin-top: 1rem;
  color: var(--ink);
  font-size: clamp(1rem, 2vw, 1.22rem);
  font-weight: 700;
}

.hero-field {
  margin-top: 0.15rem;
  color: var(--accent-cool);
  font-size: 1rem;
  font-weight: 700;
}

.hero-description {
  max-width: 710px;
  margin-top: 1.4rem;
  color: #263936;
  font-size: 1.08rem;
}

.hero-keywords-list,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1.35rem;
}

.tag,
.hero-keywords-list .tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.34rem 0.68rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #315049;
  font-size: 0.82rem;
  font-weight: 700;
}

.hero-links {
  margin-top: 1.6rem;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.68rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--ink);
}

.btn-primary {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
}

.btn-primary:hover {
  background: #0d4f4b;
  color: #fff;
}

.hero-portrait {
  justify-self: end;
  width: min(100%, 340px);
}

.hero-portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.about-band {
  max-width: var(--max-width);
  margin: 4rem auto 0;
  padding: 2rem 0 0;
  border-top: 1px solid rgba(15, 118, 110, 0.18);
}

.about-content {
  max-width: 920px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem 2rem;
}

.about-content p {
  color: #31433f;
  font-size: 1rem;
}

.about-highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 2rem;
}

.highlight-card {
  min-height: 160px;
  padding: 1rem;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.highlight-card h3 {
  color: var(--ink);
  font-size: 0.95rem;
}

.highlight-card p {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.section {
  padding: 5rem 1.5rem;
}

.section-alt {
  background: var(--surface-soft);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.section-title::after {
  content: "";
  display: block;
  width: 52px;
  height: 4px;
  margin-top: 0.75rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
}

.section-intro {
  max-width: 820px;
  margin-top: 1.3rem;
  color: var(--muted);
  font-size: 1.04rem;
}

.research-streams,
.teaching-grid,
.engagement-grid,
.contact-grid {
  display: grid;
  gap: 1rem;
}

.research-streams {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 2rem;
}

.research-card,
.teaching-card,
.engagement-card,
.contact-card,
.cv-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.research-card,
.teaching-card,
.engagement-card,
.contact-card {
  padding: 1.35rem;
}

.research-card h3,
.teaching-card h3,
.engagement-card h3,
.contact-card h3,
.cv-block h3,
.pub-group-title,
.prepared h3 {
  color: var(--ink);
  font-size: 1.06rem;
  line-height: 1.35;
}

.research-card p,
.teaching-card p,
.engagement-card p {
  margin-top: 0.7rem;
  color: var(--muted);
}

.associated-work {
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  color: #29413c !important;
  font-size: 0.92rem;
  font-weight: 650;
}

.image-break {
  padding: 0 1.5rem 4.5rem;
  background: var(--surface);
}

.presentation-figure {
  max-width: 980px;
  margin: 0 auto;
}

.presentation-figure img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  object-position: center 24%;
  border-radius: 8px;
}

.presentation-figure figcaption {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.pub-group {
  margin-top: 2.2rem;
}

.pub-group-title {
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.pub-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
}

.pub-badge {
  align-self: start;
  justify-self: start;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  background: var(--surface-tint);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
}

.pub-text {
  color: #263936;
  line-height: 1.7;
}

.text-link {
  display: inline-flex;
  margin-top: 0.45rem;
  font-weight: 800;
}

.compact {
  padding-top: 0.7rem;
}

.case-details {
  margin-top: 1rem;
}

.case-details summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 800;
}

.case-list {
  margin-top: 1rem;
}

.teaching-lead {
  max-width: 820px;
  margin-top: 1.6rem;
  padding: 1.15rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--surface-tint);
}

.teaching-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 2rem;
}

.teaching-detail {
  color: var(--accent-cool) !important;
  font-size: 0.9rem;
  font-weight: 750;
}

.prepared {
  margin-top: 2.2rem;
}

.engagement-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 2rem;
}

.cv-block {
  padding: 1.25rem;
}

.cv-list {
  margin-top: 1rem;
}

.cv-entry {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.cv-entry:first-child {
  border-top: 0;
}

.cv-year {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.cv-content {
  color: #263936;
  font-size: 0.92rem;
}

.cv-note {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.cv-action {
  margin-top: 1.5rem;
}

.engagement-image {
  display: grid;
  place-items: center;
  height: 180px;
  margin: -1.35rem -1.35rem 1.2rem;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(49, 93, 128, 0.14)),
    var(--surface-tint);
}

.engagement-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cv-download-card {
  max-width: 720px;
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cv-download-card h3 {
  font-size: 1.18rem;
}

.cv-download-card p {
  margin: 0.6rem 0 1rem;
  color: var(--muted);
}

.cv-status {
  display: inline-flex;
  max-width: 720px;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(154, 91, 19, 0.28);
  border-radius: 8px;
  background: rgba(154, 91, 19, 0.08);
  color: #6e410d;
  font-weight: 700;
}

.contact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 2rem;
}

.contact-card {
  min-height: 150px;
}

.icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-tint);
  color: var(--accent-strong);
  font-weight: 900;
}

.profile-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer {
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--ink);
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
}

.footer p {
  font-size: 0.88rem;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.revealed {
  opacity: 1;
  transform: translateY(0);
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn:hover {
    transform: none;
  }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-portrait {
    justify-self: start;
    max-width: 280px;
    order: -1;
  }

  .about-content,
  .about-highlights,
  .research-streams,
  .teaching-grid,
  .engagement-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --nav-height: 60px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.75rem 1.5rem 1rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }

  .nav-links.nav-open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 0.7rem 0;
  }

  .hero {
    padding-top: calc(var(--nav-height) + 2rem);
  }

  .section {
    padding: 3.6rem 1.2rem;
  }

  .hero,
  .image-break {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }

  .pub-item,
  .cv-entry {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .cv-year {
    width: auto;
  }
}
