/* Preserve al-folio's palette and responsive navigation. */
@layer theme {
  @media (max-width: 991.98px) {
    #navbar > .container { flex-wrap: wrap !important; }
    #navbar .navbar-toggler-main { display: block !important; margin-left: auto; }
    #navbar .navbar-collapse-main { display: none !important; flex-basis: 100%; text-align: left; }
    #navbar .navbar-collapse-main.show { display: flex !important; max-height: 75vh; overflow-y: auto; }
    #navbar .navbar-menu-list { flex-direction: column !important; align-items: flex-start; width: 100%; margin-left: 0; }
    #navbar .nav-link { white-space: nowrap; }
    #light-toggle { transform: none; }
  }
  body footer.sticky-bottom { font-size: 16px !important; }
}

/* A single type scale: body 16, section headings 24, name 26. */
body { --site-font: Roboto, Arial, sans-serif; font-family: var(--site-font); font-size: 16px; font-weight: 400; }
.academic-home, #navbar, footer { font-family: var(--site-font); font-size: 16px; font-weight: 400; line-height: 1.65; }
.academic-home :is(p, li, a, span, strong, h1, h2, h3), #navbar :is(a, span), footer :is(a, span) { font-family: inherit; }
.academic-home :is(p, li, h3, .venture-role), #navbar .nav-link { font-size: 16px; line-height: 1.65; font-weight: 400; }
.academic-home strong { font-weight: inherit; }
.academic-home .award-authors .author-self { font-weight: 700; }
.academic-home p { margin: 0; }
.academic-home h1, .academic-home h2[id] { font-size: 24px; font-weight: 400; line-height: 1.3; padding: 0; border: 0; }
.academic-home h1 { margin: 0 0 16px; }
.academic-home h2[id] { margin: 36px 0 16px; }
.academic-home h3 { margin: 24px 0 4px; }
.academic-home [id] { scroll-margin-top: 88px; }
.academic-home a { text-underline-offset: 3px; }

/* Aligned identity and reading columns. */
.academic-home.profile-page { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 48px; align-items: start; }
.profile-content { min-width: 0; }
.profile-identity .academic-portrait { display: block; width: 200px; max-width: 100%; height: auto; margin: 0; border-radius: 2px; }
.academic-home .profile-name { font-size: 26px; font-weight: 400; line-height: 1.3; margin: 16px 0 0; }
.profile-contact { margin-top: 20px; }
.profile-contact p + p { margin-top: 16px; }
.profile-content header p + p { margin-top: 16px; }

/* Keep each institution and awarded paper together. */
.compact-experience h3:first-child { margin-top: 0; }
.academic-home .compact-experience h3 { font-weight: 500; }
.academic-home #awards { font-size: 16px; font-weight: 500; line-height: 1.65; margin: 24px 0 8px; }
.awarded-papers p { margin-bottom: 24px; }
.award-authors { display: inline; margin: 0; }
.award-label { display: block; margin-bottom: 4px; }

/* Small original logos with one shared text alignment. */
.venture-entry { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 20px; align-items: start; margin: 0 0 24px; }
.venture-entry:last-child { margin-bottom: 0; }
.academic-home .venture-entry h3 { margin: 0 0 4px; }
.venture-logo { padding-top: 3px; }
.venture-logo > img { display: block; width: 60px; max-width: 100%; height: auto; margin: 0; }
.coact-brand { display: flex; flex-direction: column; align-items: center; width: 60px; max-width: 100%; box-sizing: border-box; padding: 5px; gap: 2px; background: #f3f5f7; }
.coact-brand img { display: block; width: 100%; height: auto; margin: 0; }
.venture-role { font-weight: 400; }

@media (max-width: 767px) {
  .academic-home.profile-page { display: block; }
  .profile-identity { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 16px 24px; align-items: start; margin-bottom: 32px; }
  .profile-identity .academic-portrait { width: 88px; grid-column: 1; grid-row: 1 / span 2; }
  .academic-home .profile-name { grid-column: 2; margin: 0; }
  .profile-contact { grid-column: 2; margin: 0; }
  .academic-home h2[id] { margin-top: 32px; }
}
@media (max-width: 480px) {
  .profile-identity { gap: 12px 20px; }
  .profile-contact { grid-column: 1 / -1; }
  .profile-identity .academic-portrait { grid-row: 1; }
  .academic-home .profile-name { align-self: center; }
  .venture-entry { grid-template-columns: 48px minmax(0, 1fr); gap: 10px 16px; }
  .venture-entry > div:not(.venture-logo) { display: contents; }
  .venture-logo { grid-column: 1; grid-row: 1; padding: 0; }
  .venture-logo > img, .coact-brand { width: 48px; }
  .academic-home .venture-entry h3 { grid-column: 2; grid-row: 1; align-self: center; margin: 0; }
  .venture-entry p { grid-column: 1 / -1; }
}
/* Retained draft research pages. */
.research-entry { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 24px; margin: 24px 0; }
.research-thumbnail { grid-column: 2; grid-row: 1; }
.research-thumbnail img { width: 180px; max-height: 140px; object-fit: contain; }
.research-entry > div { grid-column: 1; grid-row: 1; }
.research-entry.text-entry { display: block; }
@media (max-width: 600px) { .research-entry { display: block; } }
/* Mobile refinement: balance contact details without shrinking text. */
@media (min-width: 361px) and (max-width: 480px) {
  .profile-contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; }
  .profile-contact p + p { margin-top: 0; }
}
@media (max-width: 360px) {
  .venture-role { display: block; }
}
