/* ─────────────────────────────────────────────
   Shinjeong Kim — personal site
   Ivory theme · mobile-first
   ───────────────────────────────────────────── */

:root {
  --ivory:        #fefefc;
  --ivory-banner: #fbf6ea;
  --ivory-soft:   #f5eedb;
  --ivory-deep:   #efe6cd;
  --ink:          #2a241f;
  --ink-soft:     #4a4039;
  --ink-muted:    #7a6e62;
  --rule:         #d9cfb6;
  --accent:       #8a6a3d;
  --accent-soft:  #b08e5e;

  --font-sans:    "Noto Sans", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif:   "Noto Serif", "Noto Serif KR", "Iowan Old Style", "Apple Garamond", Baskerville, "Times New Roman", serif;

  --container:    1080px;
  --container-narrow: 880px;
  --banner-max:   1080px;   /* fixed — independent of any subpage --container override */
  --banner-h:     56px;
  --radius:       12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--banner-h) + 16px); }

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

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 2px;
}
a:hover { text-decoration: underline; }

/* ───── Sticky top banner ───── */
.site-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 246, 234, 0.85);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-banner__inner {
  max-width: var(--banner-max);
  margin: 0 auto;
  height: var(--banner-h);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
@media (min-width: 720px) {
  .site-banner__inner { padding: 0 2rem; }
}
.site-banner__brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .01em;
}
.site-banner__brand:hover { text-decoration: none; color: var(--accent); }
.site-banner__nav a {
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.site-banner__nav a:hover { color: var(--accent); text-decoration: none; }

/* ───── Page container ───── */
.site {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}
@media (min-width: 720px) {
  .site { padding: 4rem 2rem 5rem; }
}

/* ───── 1-2 Name row ───── */
.name-row {
  text-align: center;
  margin-bottom: 3.75rem;
}
.name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2rem, 5.5vw, 2.75rem);
  letter-spacing: -.01em;
  margin: 0;
  line-height: 1.2;
}

/* ───── 1-3 Bio columns ───── */
.bio {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  align-items: start;
  margin-bottom: 2.5rem;
  scroll-margin-top: calc(var(--banner-h) + 16px);
}
@media (min-width: 720px) {
  .bio {
    /* The bio section spans the full content width (same as News/Research).
       JS sets the column ratio so that column 1 width = bio collapsed
       height — the picture fills its column AND aligns top/bottom with
       the bio text. Expanding "Previously" doesn't re-fire, so the
       picture stays the same size on toggle. */
    grid-template-columns: 1fr 3fr;
    gap: 2rem;
    align-items: start;
  }
}
.bio__picture {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.bio__picture img {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(58,44,20,.08);
  display: block;
}
@media (min-width: 720px) {
  .bio__picture { justify-content: flex-start; }
  .bio__picture img { max-width: 100%; }
}

.bio__text { min-width: 0; }
.bio__text {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.bio__text p {
  margin: 0 0 1rem;
  text-align: justify;
  hyphens: auto;
}
.bio__text p:last-child { margin-bottom: 0; }

/* Collapsible Previously */
.previously { margin-top: .35rem; }
.previously summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
  color: var(--ink);
  user-select: none;
  padding: .1rem 0;
}
.previously summary::-webkit-details-marker { display: none; }
.previously summary::before {
  content: "";
  width: 0; height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .15s ease;
}
.previously[open] summary::before { transform: rotate(90deg); }
.previously__label { line-height: 1; }
.previously__content { margin-top: .75rem; }
.previously__content p { margin: 0; }

/* ───── 1-4 Social icons ───── */
.socials {
  margin: 2.5rem 0 1.5rem;
  display: flex;
  justify-content: center;
}
.socials__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem;
}
.socials__list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  color: var(--ink-soft);
  border-radius: 50%;
  transition: color .15s ease, transform .15s ease, background-color .15s ease;
}
.socials__list a:hover {
  color: var(--accent);
  background: var(--ivory-soft);
  text-decoration: none;
  transform: translateY(-1px);
}
.socials__list svg {
  width: 33px;
  height: 33px;
  fill: currentColor;
}

/* ───── Soft divider ───── */
.soft-divider {
  border: 0;
  height: 1px;
  width: 100%;
  max-width: 360px;
  margin: 1.5rem auto 2.5rem;
  background: linear-gradient(90deg, transparent, var(--rule), transparent);
}

/* ───── Sections ───── */
.section-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.55rem, 3vw, 1.9rem);
  text-align: center;
  margin: 0 0 1.5rem;
  letter-spacing: -.005em;
}

/* News */
.news { margin-bottom: 3.5rem; }
.news__list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 760px;
}
.news__list li {
  position: relative;
  padding: .35rem 0 .35rem 1.25rem;
  line-height: 1.65;
}
.news__list li::before {
  content: "•";
  position: absolute;
  left: .15rem;
  top: .35rem;
  color: var(--accent-soft);
  font-weight: 700;
}
.news__date {
  font-weight: 600;
  color: var(--ink);
  margin-right: .25rem;
}

/* Research */
.research { margin-top: 2rem; }
.paper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
  background: rgba(255, 252, 242, .55);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.paper:hover {
  box-shadow: 0 2px 6px rgba(58,44,20,.05), 0 12px 28px rgba(58,44,20,.07);
  border-color: var(--accent-soft);
}
@media (min-width: 640px) {
  .paper {
    grid-template-columns: 220px 1fr;
    align-items: start;
    gap: 1.5rem;
    padding: 1.5rem;
  }
}
.paper__thumb {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--ivory-soft);
}
.paper__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.paper__thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-muted);
  background:
    repeating-linear-gradient(45deg, var(--ivory-soft), var(--ivory-soft) 10px, var(--ivory-deep) 10px, var(--ivory-deep) 20px);
}
.paper__title {
  margin: 0 0 .35rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.3;
}
.paper__title a { color: var(--ink); }
.paper__title a:hover { color: var(--accent); text-decoration: none; }
.paper__authors {
  margin: 0 0 .25rem;
  color: var(--ink-soft);
  font-size: .98rem;
}
.paper__authors strong { color: var(--ink); font-weight: 600; }
.paper__venue {
  margin: 0 0 .65rem;
  color: var(--ink-muted);
  font-style: italic;
  font-size: .95rem;
}
.paper__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .5rem;
}
.paper__links li {
  display: inline-flex;
}
.paper__links a {
  display: inline-block;
  padding: .25rem .7rem;
  font-size: .85rem;
  color: var(--ink);
  background: var(--ivory-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.paper__links a:hover {
  background: var(--ink);
  color: var(--ivory);
  border-color: var(--ink);
  text-decoration: none;
}

/* ───── Footer ───── */
.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: .85rem;
  color: var(--ink-muted);
}

/* ───── Reduced motion ───── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
