/* ============================================================
   Hwanhee Jung — academic profile
   Refined sage-green editorial theme
   Inter (UI/body) · Schibsted Grotesk (display headings)
   ============================================================ */

:root {
  /* ---- Color: neutral canvas, green used purely as an accent ----
     Big surfaces (page, sidebar, bands) stay a clean near-white so the
     layout breathes; green lives in links, tags, active states, meta. */
  --bg:          #f8f9f5;   /* page + sidebar — clean near-white neutral */
  --bg-tint:     #eef0e9;   /* recessed bands (carousel) — faint neutral */
  --surface:     #ffffff;   /* card / panel backgrounds */
  --surface-2:   #f5f6f0;   /* faint secondary surface */

  --ink:         #1c1f1b;   /* primary text — neutral charcoal */
  --ink-soft:    #595e55;   /* secondary text */
  --ink-muted:   #8a8f84;   /* captions, meta, dates */

  --line:        #e6e7df;   /* hairlines & dividers (neutral) */
  --line-strong: #d6d8cc;   /* stronger dividers */

  --accent:      #3f7d5c;   /* links, focus, primary green (the accent) */
  --accent-deep: #2c5a42;   /* hover / active emphasis */
  --accent-tint: rgba(63, 125, 92, 0.10); /* wash behind links */

  --tag-bg:      #e9efe0;   /* skill-chip fill — soft sage accent */
  --tag-ink:     #3a5a45;   /* skill-chip text — deep green */
  --tag-line:    #d7e0ca;   /* skill-chip border */

  --pill-bg:     #3f7d5c;   /* green link buttons in cards */
  --pill-ink:    #ffffff;   /* text on green pills */
  --avatar-bg:   #dde7d2;   /* placeholder behind empty avatar */

  /* ---- Radius scale ---- */
  --r-xs:   8px;
  --r-sm:  10px;
  --r-md:  14px;
  --r-lg:  18px;
  --r-xl:  22px;
  --r-full: 999px;

  /* ---- Elevation ---- */
  --shadow-xs: 0 1px 2px rgba(28, 48, 35, 0.05);
  --shadow-sm: 0 1px 2px rgba(28, 48, 35, 0.05), 0 2px 6px rgba(28, 48, 35, 0.06);
  --shadow-md: 0 6px 18px -6px rgba(30, 54, 38, 0.16);
  --shadow-lg: 0 18px 40px -16px rgba(26, 46, 32, 0.30);

  /* ---- Type ---- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Schibsted Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* ---- Layout metrics ---- */
  --topbar-h:  58px;
  --sidebar-w: 33%;
  --max-w:     1250px;  /* caps how wide the layout stretches */
  --scale:     1.25;    /* global UI scale (design authored at 100%, shown at 125%) */
  --content-pad-x: 60px;/* content side padding; carousel band bleeds by this */
}

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

html,
body {
  margin: 0;
  height: 100%;
}

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.006em;
  font-feature-settings: 'cv05', 'cv11', 'ss01';
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
ul {
  margin: 0;
}

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

::selection {
  background: rgba(63, 125, 92, 0.20);
  color: var(--accent-deep);
}

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

/* ============================================================
   App frame — centered, width-capped column
   ============================================================ */
.app {
  zoom: var(--scale);
  height: calc(100vh / var(--scale));
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  flex: 0 0 var(--topbar-h);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar__brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-link {
  position: relative;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding-bottom: 3px;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-link.is-active {
  color: var(--accent-deep);
}

.nav-link.is-active::after {
  transform: scaleX(1);
}

/* ============================================================
   Layout: fixed sidebar + scrolling content
   ============================================================ */
.layout {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  overflow-y: auto;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--bg);
  padding: 40px 30px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.content {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 34px var(--content-pad-x) 48px;
  scroll-behavior: smooth;
}

/* ============================================================
   Custom auto-hiding overlay scrollbar (content column)
   ============================================================ */
html.js .content {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html.js .content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.cscroll {
  position: absolute;
  top: 8px;
  right: 4px;
  bottom: 8px;
  width: 10px;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.cscroll.is-visible {
  opacity: 1;
}

.cscroll__thumb {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  border-radius: var(--r-full);
  background: rgba(44, 90, 66, 0.28);
  pointer-events: auto;
  transition: background-color 0.2s ease;
}

.cscroll__thumb:hover {
  background: rgba(44, 90, 66, 0.42);
}

.cscroll__thumb:active {
  background: rgba(44, 90, 66, 0.55);
}

/* ============================================================
   Profile (sidebar)
   ============================================================ */
.avatar {
  width: 188px;
  height: 188px;
  border-radius: 50%;
  background: var(--avatar-bg);
  overflow: hidden;
  margin-top: 6px;
  margin-bottom: 18px;
  flex: 0 0 auto;
  border: 5px solid var(--surface);
  box-shadow: 0 14px 34px -14px rgba(26, 46, 32, 0.45),
    0 0 0 1px var(--line);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile__name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.15;
  margin: 0 0 8px;
  color: var(--ink);
}

.profile__role {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.005em;
}

.profile__affil {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 3px;
  margin-bottom: 4px;
}

/* Socials */
.socials {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 18px 0 6px;
}

.social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: color 0.18s ease, transform 0.18s ease,
    border-color 0.18s ease, background-color 0.18s ease;
}

.social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.social:hover {
  color: var(--accent-deep);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.social--text {
  width: auto;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* Tags / research interests */
.tags {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  max-width: 290px;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-ink);
  border: 1px solid var(--tag-line);
  border-radius: var(--r-full);
  padding: 6px 13px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.tag:hover {
  background: #dde8cf;
  color: var(--accent-deep);
}

/* ============================================================
   Sections (content)
   ============================================================ */
.section {
  margin-bottom: 60px;
}

.section#about {
  margin-top: 0;
}

.section__title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.12;
  margin: 0 0 22px;
  color: var(--ink);
}

/* Prose */
.prose p {
  font-size: 14.5px;
  line-height: 1.78;
  margin: 0 0 14px;
  max-width: 680px;
  color: #2b2e29;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose a {
  color: var(--accent-deep);
  font-weight: 500;
  text-decoration: none;
  padding: 1px 3px;
  margin: 0 -1px;
  border-radius: 4px;
  background-image: linear-gradient(var(--accent-tint), var(--accent-tint));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 0%;
  transition: background-size 0.28s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.prose a:hover,
.prose a:focus-visible {
  color: var(--accent-deep);
  background-size: 100% 100%;
}

/* Institution brand names */
.brand {
  font-weight: 600;
}

.brand--ut {
  color: #bf5700; /* UT Austin burnt orange */
}

.brand--meta {
  color: #0668e1; /* Meta blue */
}

/* Google wordmark colors */
.brand--google .g-b { color: #4285f4; }
.brand--google .g-r { color: #ea4335; }
.brand--google .g-y { color: #f9ab00; }
.brand--google .g-g { color: #34a853; }

.prose__note {
  color: var(--ink-soft);
}

/* ============================================================
   News — refined timeline
   ============================================================ */
.news {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news__item {
  display: flex;
  gap: 18px;
  padding: 12px 0;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
}

.news__item:first-child {
  padding-top: 2px;
}

.news__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.news__date {
  flex: 0 0 78px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.news__text {
  font-size: 13.5px;
  line-height: 1.62;
  color: #2c2f2a;
}

.news__text strong {
  font-weight: 600;
  color: var(--ink);
}

/* ============================================================
   Image placeholder frame
   ============================================================ */
.img-frame {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.img-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--surface);
  border-radius: inherit;
  display: block;
}

/* ============================================================
   Projects carousel
   ============================================================ */
.carousel {
  position: relative;
}

/* Full-bleed recessed band behind the cards. */
.carousel::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--content-pad-x));
  right: calc(-1 * var(--content-pad-x));
  top: 0;
  bottom: 0;
  background: var(--bg-tint);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  z-index: 0;
  pointer-events: none;
}

.carousel__viewport {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 26px 48px;
  margin: 0;
  --fade: 48px;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 var(--fade),
    #000 calc(100% - var(--fade)),
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 var(--fade),
    #000 calc(100% - var(--fade)),
    transparent 100%
  );
}

.carousel__track {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 20px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: pan-y;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

.carousel__track:active {
  cursor: grabbing;
}

.project-card {
  flex: 0 0 calc(50% - 10px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.22s ease, border-color 0.22s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
}

.project-card__img {
  height: 178px;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
}

.project-card__title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.008em;
  line-height: 1.45;
  margin: 0;
  padding: 16px 18px 18px;
  color: var(--ink);
  transition: color 0.18s ease;
}

.project-card:hover .project-card__title {
  color: var(--accent-deep);
}

.project-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 5;
  padding: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.carousel__btn:hover {
  transform: translateY(-50%) scale(1.06);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
}

.carousel__btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carousel__btn--prev {
  left: 4px;
}

.carousel__btn--next {
  right: 4px;
}

/* ============================================================
   Publications / Patents
   ============================================================ */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pub-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s ease, border-color 0.2s ease,
    transform 0.2s ease;
}

.pub-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pub-card__img {
  flex: 0 0 140px;
  height: 100px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
}

.pub-card__body {
  flex: 1;
  min-width: 0;
}

.pub-card__title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin: 0 0 5px;
  color: var(--ink);
}

.pub-card__venue {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 7px;
}

.pub-card__authors {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 12px;
}

.pub-card__authors strong {
  color: var(--ink);
  font-weight: 600;
}

.pub-card__note {
  font-size: 11.5px;
  font-style: italic;
  color: var(--ink-muted);
  margin: -6px 0 12px;
}

.pub-card__links {
  display: flex;
  flex-direction: row;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  background: var(--surface);
  color: var(--accent-deep);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-full);
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  transition: background-color 0.18s ease, color 0.18s ease,
    border-color 0.18s ease;
}

.pill:hover {
  background: var(--accent);
  color: var(--pill-ink);
  border-color: var(--accent);
}

/* Shown when a list (e.g. Patents) has no entries yet. */
.empty-note {
  font-size: 13px;
  font-style: italic;
  color: var(--ink-muted);
  padding: 4px 0;
}

/* ============================================================
   Footer — closing strip
   ============================================================ */
.site-footer {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.site-footer__affil {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.site-footer__cta {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.site-footer__cta a {
  color: var(--accent-deep);
  font-weight: 500;
  text-decoration: none;
}

.site-footer__cta a:hover {
  text-decoration: underline;
}

.site-footer__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--ink-muted);
}

.site-footer__sep {
  color: var(--line-strong);
}

.site-footer__top {
  color: var(--accent-deep);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s ease;
}

.site-footer__top:hover {
  color: var(--accent);
}

/* ============================================================
   Project detail modal — page style
   ============================================================ */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 26, 19, 0);
  -webkit-backdrop-filter: blur(0px);
  backdrop-filter: blur(0px);
  transition: background 0.22s ease,
    -webkit-backdrop-filter 0.22s ease, backdrop-filter 0.22s ease;
}

.modal.is-open .modal__backdrop {
  background: rgba(16, 26, 19, 0.46);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  transition: background 0.45s ease,
    -webkit-backdrop-filter 0.45s ease, backdrop-filter 0.45s ease;
}

.modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(960px, 94vw);
  max-height: 90vh;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 30px 70px rgba(14, 22, 16, 0.28),
    0 4px 12px rgba(14, 22, 16, 0.12);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.3s ease;
}

.modal__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.modal__scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.modal.is-open .modal__dialog {
  opacity: 1;
  transform: none;
}

.modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  transition: background-color 0.18s ease, transform 0.25s ease,
    border-color 0.18s ease;
}

.modal__close:hover {
  background: var(--bg-tint);
  border-color: var(--line-strong);
  transform: rotate(90deg);
}

.modal__close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Two-column header: image box (left) | meta (right) */
.modal__header {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: stretch;
  padding: 48px 44px 38px;
  border-bottom: 1px solid var(--line);
}

.modal__img {
  align-self: start;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.modal__meta {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.modal__venue {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.modal__title {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.22;
  color: var(--ink);
  margin: 0;
}

.modal__summary {
  margin: -2px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.modal__collab-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: auto 0 0;
}

.modal__collabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.modal__logo {
  width: 132px;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal__logo img {
  max-width: 82%;
  max-height: 70%;
  object-fit: contain;
}

.modal__logo--ph {
  color: var(--ink-muted);
  font-size: 13px;
}

/* Body */
.modal__body {
  padding: 40px 44px 44px;
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.modal__block {
  margin: 0;
}

.modal__subhead {
  font-family: var(--font-display);
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.016em;
  line-height: 1.3;
  color: var(--ink);
}

.modal__block--heading {
  margin-bottom: -22px;
}

.modal__block--heading .modal__subhead {
  margin-bottom: 0;
}

.modal__block--text,
.modal__section-text {
  font-size: 15px;
  line-height: 1.78;
  color: #2b2e29;
}

.modal__block--text p,
.modal__section-text p {
  margin: 0;
}

.modal__block--text p + p,
.modal__section-text p + p {
  margin-top: 0.7em;
}

.modal__block--image-narrow {
  margin-inline: auto;
}

.modal__block-img {
  width: 100%;
}

.modal__block-img img,
.modal__block-img--video video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

.modal__block-img--video video {
  background: #000;
}

.modal__gallery {
  display: grid;
  gap: 16px;
  align-items: start;
}

.modal__gallery--uniform .modal__block-img {
  aspect-ratio: var(--item-ratio, 16 / 9);
}

.modal__gallery--uniform .modal__block-img img,
.modal__gallery--uniform .modal__block-img--video video {
  height: 100%;
  max-height: none;
}

.modal__caption {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-muted);
  text-align: center;
}

/* Split block */
.modal__section {
  display: grid;
  grid-template-columns: var(--media-w, 300px) 1fr;
  gap: 40px;
  align-items: start;
}

.modal__section--reverse {
  grid-template-columns: 1fr var(--media-w, 300px);
}

.modal__section--reverse .modal__section-media {
  order: 2;
}

.modal__section-media {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal__section-media .modal__block-img img,
.modal__section-media .modal__block-img--video video {
  max-height: var(--media-maxh, 70vh);
}

/* Related publications */
.modal__related {
  padding: 34px 44px 44px;
  border-top: 1px solid var(--line);
}

.modal__related-label {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.016em;
  color: var(--ink);
}

.modal__related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal__related-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
}

a.modal__related-item:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.modal__related-text {
  flex: 1;
  min-width: 0;
}

.modal__related-logos {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.modal__related-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 36px;
}

.modal__related-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.modal__related-title {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.008em;
  line-height: 1.4;
  color: var(--ink);
}

.modal__related-meta {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-muted);
}

.modal__related-venue {
  font-weight: 600;
  color: var(--accent);
}

/* ============================================================
   Responsive
   ============================================================ */

/* --- Project modal: collapse the two-column header/sections --- */
@media (max-width: 600px) {
  .modal {
    padding: 16px 12px;
  }

  .modal__header,
  .modal__section,
  .modal__section--reverse {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .modal__section--reverse .modal__section-media {
    order: 0;
  }

  .modal__header {
    padding: 30px 24px 24px;
  }

  .modal__body {
    padding: 26px 24px;
    gap: 28px;
  }

  .modal__related {
    padding: 26px 24px;
  }

  .modal__img {
    aspect-ratio: 16 / 10;
  }

  .modal__title {
    font-size: 22px;
  }
}

/* --- Tablet & mobile: stack the sidebar, flow the document --- */
@media (max-width: 820px) {
  :root {
    --scale: 1;
    --content-pad-x: 32px;
  }

  html,
  body {
    height: auto;
    overflow: visible;
  }

  .app {
    height: auto;
    max-width: 100%;
    overflow: visible;
    border-left: none;
    border-right: none;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 22px;
  }

  .layout {
    flex-direction: column;
  }

  .sidebar {
    flex: none;
    width: auto;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 34px 22px 32px;
  }

  .content {
    flex: none;
    height: auto;
    overflow: visible;
    padding-top: 38px;
  }
}

/* --- Phones --- */
@media (max-width: 560px) {
  :root {
    --content-pad-x: 18px;
  }

  .topbar {
    justify-content: center;
    padding: 0 14px;
  }

  .topbar__brand {
    display: none;
  }

  .topbar__nav {
    gap: 20px;
  }

  .nav-link {
    font-size: 13px;
  }

  .section {
    margin-bottom: 46px;
  }

  .section__title {
    font-size: 25px;
  }

  .avatar {
    width: 150px;
    height: 150px;
  }

  .profile__name {
    font-size: 25px;
  }

  .carousel__viewport {
    padding: 22px 32px;
    --fade: 28px;
  }

  .carousel__btn {
    width: 32px;
    height: 32px;
  }

  .carousel__btn--prev {
    left: 2px;
  }

  .carousel__btn--next {
    right: 2px;
  }

  .carousel__btn svg {
    width: 15px;
    height: 15px;
  }

  .project-card__img {
    height: 140px;
  }

  .pub-card {
    flex-direction: column;
    gap: 14px;
    padding: 16px;
  }

  .pub-card__img {
    flex: none;
    width: 100%;
    height: 170px;
  }
}
